fork.c

来自「java 到c的转换程序的原代码.对喜欢C程序而不懂JAVA程序的人很有帮助」· C语言 代码 · 共 30 行

C
30
字号
/* Redefinition of the fork() system call, so that we can make sure * that ownership for SIGIO goes to the right process */#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>pid_t __wrap_fork(void) {    int ret;    ret = __real_fork();    if (ret > 0) {	/* Parent or error */	return ret;    } else if (ret < 0) {	return ret;    } else {	/* Child */	int i;	int pid = getpid();	/* Restart this thread's alarms, as those aren't inherited. */	threadTimerReset();		return 0;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?