X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fmissing.h;h=91a6215226f840edb57c437f1b3d28c0c430b603;hb=9b15b7846d4de01bb5d9700a24077787e984e8ab;hp=c547479ad277651058a96d117742b153f572ba67;hpb=700c6087eb58de7af510f747414ea97b07e08b2b;p=elogind.git diff --git a/src/shared/missing.h b/src/shared/missing.h index c547479ad..91a621522 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -635,3 +635,17 @@ static inline int setns(int fd, int nstype) { #ifndef CAP_AUDIT_READ #define CAP_AUDIT_READ 37 #endif + +static inline int raw_clone(unsigned long flags, void *child_stack) { +#if defined(__s390__) || defined(__CRIS__) + /* On s390 and cris the order of the first and second arguments + * of the raw clone() system call is reversed. */ + return (int) syscall(__NR_clone, child_stack, flags); +#else + return (int) syscall(__NR_clone, flags, child_stack); +#endif +} + +static inline pid_t raw_getpid(void) { + return (pid_t) syscall(__NR_getpid); +}