FIX: lib makefile
FIX: c-cpp lib FIX: makefile delete
This commit is contained in:
parent
b0afca5d61
commit
216e47571b
@ -28,6 +28,7 @@
|
||||
- [Unicode支持(C11) uchar](#uchar)
|
||||
- [CPP](#CPP)
|
||||
- [STL](../STL/)
|
||||
- [POSIX](#unistd)
|
||||
- [SELF](#SELF)
|
||||
- [offsetof](./self/offsetof.h)
|
||||
- [string hash](./self/string_hash.c)
|
||||
@ -678,3 +679,43 @@ struct tm {
|
||||
- **更安全的数值操作**
|
||||
|
||||
---
|
||||
|
||||
## **unistd**
|
||||
- 进程控制
|
||||
- [fork](../linux/fork.cpp)
|
||||
- [exec](../linux/exec.cpp)
|
||||
- `unsigned int sleep(unsigned int seconds);`
|
||||
|
||||
- 文件操作
|
||||
- `ssize_t read(int fildes, void *buf, size_t nbyte);`
|
||||
- 共享偏移量
|
||||
- `ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);`
|
||||
- 指定偏移量,线程安全
|
||||
- `ssize_t write(int fildes, const void *buf, size_t nbyte);`
|
||||
- `ssize_t pwrite(int fildes, const void *buf, size_t nbyte);`
|
||||
- `int clos(int fildes);`
|
||||
|
||||
- 管道操作
|
||||
- `int pipe(int fildes[2]);`
|
||||
- 创建匿名管道
|
||||
- [0]读
|
||||
- [1]写
|
||||
- 0 成功 -1 失败
|
||||
|
||||
- `uid_t getuid(void);`
|
||||
- 获取用户真实uid
|
||||
|
||||
- 目录操作
|
||||
- `int chdir(const char *path);`
|
||||
- 切换工作目录
|
||||
- 0 成功 -1 失败
|
||||
- `char *getcwd(char buf[.size], size_t size);`
|
||||
|
||||
- 其他
|
||||
- `int dup(int fildes);`
|
||||
- `int dup2(int fildes, int fildes2);`
|
||||
- 复制文件描述符
|
||||
- `int isatty(int fd);`
|
||||
- 检查文件描述符是否关联到终端
|
||||
|
||||
---
|
||||
|
@ -11,7 +11,7 @@ int main() {
|
||||
// pid_t getppid(void); 父进程
|
||||
|
||||
// fork() 函数
|
||||
// pid_t fork(void); 创建一个子进程,父进程返回pid,子进程返回0
|
||||
// pid_t fork(void); 创建一个子进程,父进程返回pid,子进程返回0,失败返回-1,设置errno
|
||||
// 子进程获取父进程 数据空间,堆,栈 的副本,并不是共享
|
||||
// 若父进程比子进程先退出,那么子进程由1号进程托管
|
||||
// 若子进程先退出,而父进程没处理,则会造成僵尸进程(No!)
|
||||
|
@ -22,11 +22,6 @@
|
||||
- [使用循环](#使用循环)
|
||||
- [执行外部命令](#执行外部命令)
|
||||
- [](#)
|
||||
- [](#)
|
||||
- [](#)
|
||||
- [](#)
|
||||
- [](#)
|
||||
- [](#)
|
||||
|
||||
---
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user