📄 getppid.c
字号:
#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include "sys9.h"pid_tgetppid(void){ int n, f; char ppidbuf[15]; f = open("#c/ppid", 0); n = read(f, ppidbuf, sizeof ppidbuf); if(n < 0) errno = EINVAL; else n = atoi(ppidbuf); close(f); return n;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -