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

你可能感兴趣的文章
Needle in a haystack: efficient storage of billions of photos 【转】
查看>>
NeHe OpenGL教程 07 纹理过滤、应用光照
查看>>
NeHe OpenGL教程 第四十四课:3D光晕
查看>>
Neighbor2Neighbor 开源项目教程
查看>>
neo4j图形数据库Java应用
查看>>
Neo4j图数据库_web页面关闭登录实现免登陆访问_常用的cypher语句_删除_查询_创建关系图谱---Neo4j图数据库工作笔记0013
查看>>
Neo4j图数据库的介绍_图数据库结构_节点_关系_属性_数据---Neo4j图数据库工作笔记0001
查看>>
Neo4j图数据库的数据模型_包括节点_属性_数据_关系---Neo4j图数据库工作笔记0002
查看>>
Neo4j安装部署及使用
查看>>
Neo4j电影关系图Cypher
查看>>
Neo4j的安装与使用
查看>>
Neo4j(1):图数据库Neo4j介绍
查看>>
Neo4j(2):环境搭建
查看>>
Neo4j(3):Neo4j Desktop安装
查看>>
Neo4j(4):Neo4j - CQL使用
查看>>
Neo图数据库与python交互
查看>>
NEO改进协议提案1(NEP-1)
查看>>
Neo私链
查看>>
NervanaGPU 项目使用教程
查看>>
Nerves 项目教程
查看>>