Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/procdesc.h
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | |||||
struct rusage; | struct rusage; | ||||
/* | /* | ||||
* Process descriptor system calls. | * Process descriptor system calls. | ||||
*/ | */ | ||||
__BEGIN_DECLS | __BEGIN_DECLS | ||||
pid_t pdfork(int *, int); | pid_t pdfork(int *, int); | ||||
pid_t pdvfork(int *, int); | |||||
jilles: This needs `__returns_twice` like vfork/rfork/setjmp. If a `PD_VFORK` flag is added to `pdfork… | |||||
jillesUnsubmitted Not Done Inline ActionsThe standard syscall stub will not work properly on x86 for this function. The child process pops the return address off the stack and if it is subsequently overwritten, the parent process will jump to nowhere. See for example lib/libc/amd64/sys/vfork.S. jilles: The standard syscall stub will not work properly on x86 for this function. The child process… | |||||
kibUnsubmitted Not Done Inline ActionsNote that this patch does not even add the proposed syscall to libc/sys/Symbol.ver. kib: Note that this patch does not even add the proposed syscall to libc/sys/Symbol.ver. | |||||
int pdkill(int, int); | int pdkill(int, int); | ||||
int pdgetpid(int, pid_t *); | int pdgetpid(int, pid_t *); | ||||
__END_DECLS | __END_DECLS | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
/* | /* | ||||
* Flags which can be passed to pdfork(2). | * Flags which can be passed to pdfork(2). | ||||
*/ | */ | ||||
#define PD_DAEMON 0x00000001 /* Don't exit when procdesc closes. */ | #define PD_DAEMON 0x00000001 /* Don't exit when procdesc closes. */ | ||||
#define PD_CLOEXEC 0x00000002 /* Close file descriptor on exec. */ | #define PD_CLOEXEC 0x00000002 /* Close file descriptor on exec. */ | ||||
#define PD_ALLOWED_AT_FORK (PD_DAEMON | PD_CLOEXEC) | #define PD_ALLOWED_AT_FORK (PD_DAEMON | PD_CLOEXEC) | ||||
#endif /* !_SYS_PROCDESC_H_ */ | #endif /* !_SYS_PROCDESC_H_ */ |
This needs __returns_twice like vfork/rfork/setjmp. If a PD_VFORK flag is added to pdfork() instead of adding pdvfork(), then pdfork() will need to be annotated.