
Linux系统编程
sjiang
爱劳动
展开
-
高级进程管理
1.sched_yield()中断当前进程让出处理器int sched_yield (void);2.设置进程优先级int nice (int inc);int getpriority (int which, int who);int setpriority (int which, int who, int prio);3.设置I/O优先级int ioprio_get原创 2012-08-10 14:02:05 · 693 阅读 · 0 评论 -
缓冲输入输出
1.fopen()打开文件,返回流FILE* fopen(const char * path, const char * mode);2.fdopen()通过文件描述符打开文件FILE * fdopen (int fd, const char *mode);3.fclose()关闭文件int fclose (FILE *stream);4.fcloseall()关闭所有文件原创 2012-08-08 16:09:55 · 2625 阅读 · 0 评论 -
进程管理
1.getpid()获得调用进程的IDpid_t getpid (void);2.getppid()获得调用进程的父IDpid_t getppid (void);3.exec()启动进程int execl (const char *path, const char *arg, ...);int execlp (const char *file, const char *ar原创 2012-08-09 17:02:11 · 662 阅读 · 0 评论 -
高级文件I/O
1.readv()从fd读取count个segment到iov描述的缓冲区中ssize_t readv (int fd, const struct iovec *iov,int count);2.writev()从iov描述的缓冲区中读取count个segment的数据并写入fd中ssize_t writev (int fd, const struct iovec *iov,int c原创 2012-08-09 14:46:00 · 1172 阅读 · 0 评论 -
文件I/O相关函数
1.open()系统调用打开一个文件返回文件描述符int open (const char *name, int flags);int open (const char *name, int flags, mode_t mode);2.creat()函数int creat (const char *name, mode_t mode);3.read()读取文件ssize原创 2012-08-08 15:03:34 · 1053 阅读 · 0 评论 -
文件与目录管理
1.获取文件信息#include #include #include int stat (const char *path, struct stat *buf);int fstat (int fd, struct stat *buf);int lstat (const char *path, struct stat *buf);struct stat { dev_t st_d原创 2012-08-10 17:57:57 · 919 阅读 · 0 评论