博客
关于我
《Linux系统调用:getgrent,setgrent,endgrent》
阅读量:254 次
发布时间:2019-03-01

本文共 474 字,大约阅读时间需要 1 分钟。

一、介绍

getgrent(),setgrent(),endgrent() 组合起来使用按顺序扫描密码文件(/etc/group)中的所有的各项记录。

#include 
#include
// 调用会自动打开组文件,不需要执行open打开// 每次调用会按顺序读取各项,有点类似文件操作的lseekstruct group *getgrent(void);// 调用重返文件的起始处void setgrent(void);// 调用相当于关闭组文件,不需要执行close关闭void endgrent(void);

二、实例

#include 
#include
#include
#include
#include
#include
#include
void print_grp(struct group *grp){ printf("grp->gr_name : [%s]

转载地址:http://mmkt.baihongyu.com/

你可能感兴趣的文章
Nginx gateway集群和动态网关
查看>>
nginx http配置说明,逐渐完善。
查看>>
Nginx keepalived一主一从高可用,手把手带你一步一步配置!
查看>>
Nginx Location配置总结
查看>>
Nginx log文件写入失败?log文件权限设置问题
查看>>
Nginx Lua install
查看>>
nginx net::ERR_ABORTED 403 (Forbidden)
查看>>
vue中处理过内存泄露处理方法
查看>>
Nginx RTMP 模块使用指南
查看>>
Nginx SSL 性能调优
查看>>
nginx ssl域名配置
查看>>
Nginx SSL私有证书自签,且反代80端口
查看>>
Nginx upstream性能优化
查看>>
Nginx 中解决跨域问题
查看>>
nginx 代理解决跨域
查看>>
Nginx 做负载均衡的几种轮询策略分析
查看>>
Nginx 入门,一篇搞定!
查看>>
Nginx 利用代理转发请求示例
查看>>
Nginx 动静分离与负载均衡的实现
查看>>
Nginx 反向代理 MinIO 及 ruoyi-vue-pro 配置 MinIO 详解
查看>>