博客
关于我
《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/

你可能感兴趣的文章
navicat工具查看MySQL数据库_表占用容量_占用空间是多少MB---Linux工作笔记048
查看>>
navicat怎么导出和导入数据表
查看>>
Navicat怎样同步两个数据库中的表
查看>>
Navicat怎样筛选数据
查看>>
Navicat报错connection is being used
查看>>
Navicat报错:1045-Access denied for user root@localhost(using passwordYES)
查看>>
Navicat控制mysql用户权限
查看>>
navicat操作mysql中某一张表后, 读表时一直显示正在载入,卡死不动,无法操作
查看>>
Navicat连接mysql 2003 - Can't connect to MySQL server on ' '(10038)
查看>>
Navicat连接mysql数据库中出现的所有问题解决方案(全)
查看>>
Navicat连接Oracle出现Oracle library is not loaded的解决方法
查看>>
Navicat连接Oracle数据库以及Oracle library is not loaded的解决方法
查看>>
Navicat连接sqlserver提示:未发现数据源名并且未指定默认驱动程序
查看>>
navicat连接远程mysql数据库
查看>>
Navicat通过存储过程批量插入mysql数据
查看>>
Navicat(数据库可视化操作软件)安装、配置、测试
查看>>
navigationController
查看>>
NB-IOT使用LWM2M移动onenet基础通信套件对接之APN设置
查看>>
NBear简介与使用图解
查看>>
Vue过滤器_使用过滤器进行数据格式化操作---vue工作笔记0015
查看>>