Commit 404fa87c authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Paul E. McKenney

tools/nolibc: s390: provide custom implementation for sys_fork

On s390 the first two arguments to the clone() syscall are swapped,
as documented in clone(2).
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent f2fa6b38
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef _NOLIBC_ARCH_S390_H #ifndef _NOLIBC_ARCH_S390_H
#define _NOLIBC_ARCH_S390_H #define _NOLIBC_ARCH_S390_H
#include <asm/signal.h>
#include <asm/unistd.h> #include <asm/unistd.h>
/* The struct returned by the stat() syscall, equivalent to stat64(). The /* The struct returned by the stat() syscall, equivalent to stat64(). The
...@@ -223,4 +224,12 @@ void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd, ...@@ -223,4 +224,12 @@ void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd,
return (void *)my_syscall1(__NR_mmap, &args); return (void *)my_syscall1(__NR_mmap, &args);
} }
#define sys_mmap sys_mmap #define sys_mmap sys_mmap
static __attribute__((unused))
pid_t sys_fork(void)
{
return my_syscall5(__NR_clone, 0, SIGCHLD, 0, 0, 0);
}
#define sys_fork sys_fork
#endif /* _NOLIBC_ARCH_S390_H */ #endif /* _NOLIBC_ARCH_S390_H */
...@@ -336,6 +336,7 @@ void exit(int status) ...@@ -336,6 +336,7 @@ void exit(int status)
* pid_t fork(void); * pid_t fork(void);
*/ */
#ifndef sys_fork
static __attribute__((unused)) static __attribute__((unused))
pid_t sys_fork(void) pid_t sys_fork(void)
{ {
...@@ -351,6 +352,7 @@ pid_t sys_fork(void) ...@@ -351,6 +352,7 @@ pid_t sys_fork(void)
#error Neither __NR_clone nor __NR_fork defined, cannot implement sys_fork() #error Neither __NR_clone nor __NR_fork defined, cannot implement sys_fork()
#endif #endif
} }
#endif
static __attribute__((unused)) static __attribute__((unused))
pid_t fork(void) pid_t fork(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment