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

你可能感兴趣的文章
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 项目教程
查看>>
nessus快速安装使用指南(非常详细)零基础入门到精通,收藏这一篇就够了
查看>>
Nessus漏洞扫描教程之配置Nessus
查看>>
Nest.js 6.0.0 正式版发布,基于 TypeScript 的 Node.js 框架
查看>>
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML.
查看>>
nestesd exception is java .lang.NoSuchMethodError:com.goolge.common.collect
查看>>
nestJS学习
查看>>