
code linux
文章平均质量分 70
zylgbin
不知死,焉知生
展开
-
Linux Thread
thread 习惯性使用c++的,本文着重了解一下linux 的pthread 创建: int pthread_create(pthread_t *restrict tidp,const pthread_attr_t *restrict attr,void *(*start_rtn)(void *), void *restrict arg); 获取线程id: pthread_t pthread_self(void); #include "log/logx.h" #include <error.h&原创 2022-04-04 10:55:37 · 264 阅读 · 0 评论 -
Linux Process_control
文章目录进程标识pidforkwait and waitpidexec 进程标识pid id=0的是调度进程(swapper),该进程是内核的一部分,并不执行磁盘的任何的程序,也被称为系统进程 id=1 是init进程,属于用户态进程,但是以超级用户特权运行,是所有孤儿进程的父进程 #include <unistd.h> pid_t getpid(void); Returns: process ID of calling process pid_t getppid(void); Retur原创 2022-04-03 20:28:26 · 1706 阅读 · 0 评论 -
linux file_systm
文章目录file_operationopencreatecloselseekreadwritedup和dup2sync / fsyncfctnlfile_sharingfile and directorystat/fstat/lstat文件类型文件访问权限accessumaskchmod /fchmod/fchmodatchowntruncationlink and unlinksymlink文件时间修改renamemkdirchdirread directory file_operation open原创 2022-01-04 23:02:09 · 614 阅读 · 0 评论