系列-Linux常用C函数
liuyuan185442111
主要为了增强记忆和方便查询,评论如果没有及时回复,还请见谅
展开
-
c非标准库参考6-用户组篇
密码文件#include <sys/types.h>#include <pwd.h>strcut passwd *getpwent(void);//从密码文件中取得账号的数据void endpwent(void);//关闭密码文件void setpwent(void);//从头读取密码文件中的账号数据struct passwd *fgetpwent(FILE *stream);//从指定的文原创 2016-11-04 20:44:32 · 604 阅读 · 0 评论 -
c非标准库参考5-文件与目录操作
chdir(改变当前的工作目录)#include <unistd.h>int chdir(const char *path);chdir()用来将当前的工作目录改变成以参数path所指的目录。 执行成功则返回0,失败返回-1,errno为错误代码。chmod(改变文件的权限)#include <sys/types.h>#include <sys/stat.h>int chmod(const原创 2016-10-29 19:45:18 · 690 阅读 · 0 评论 -
c非标准库参考4-信号和管道
sleep(让进程暂停执行一段时间)#include <unistd.h>unsigned int sleep(unsigned int seconds);sleep()会令目前的进程暂停,直到达到参数seconds所指定的时间,或是被信号所中断。若进程暂停到参数seconds所指定的时间则返回0,若有信号中断则返回剩余秒数。pause(让进程暂停直到信号出现)#include <unistd.原创 2016-10-26 16:59:17 · 434 阅读 · 0 评论 -
c非标准库参考3-文件操作篇
open(打开文件)#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>int open(const char *file, int oflag, ...);参数file指向欲打开的文件路径字符串。下列是参数oflag所能使用的旗标: O_RDONLY 以只读方式打开文件 O_WRONLY 以只写方式打开文件 O_R原创 2016-10-24 16:26:02 · 492 阅读 · 0 评论 -
c非标准库参考-进程操作篇
.原创 2016-10-21 16:39:56 · 672 阅读 · 0 评论 -
c非标准库参考-杂类
.原创 2016-10-21 12:47:06 · 857 阅读 · 0 评论