Improve system call support

This commit is contained in:
Justine Tunney 2021-08-25 21:35:58 -07:00
parent 63b867bd2f
commit 3085ac7837
65 changed files with 900 additions and 544 deletions

View file

@ -2057,7 +2057,7 @@ syscon nr __NR_execve 0x003b 0x200003b 0x003b 0x003b 0x03b 0xfff # D
syscon nr __NR_wait4 0x003d 0x2000007 0x0007 0x000b 0x1c1 0xfff
syscon nr __NR_kill 0x003e 0x2000025 0x0025 0x007a 0x025 0xfff
syscon nr __NR_killpg 0xfff 0xfff 0x0092 0xfff 0xfff 0xfff
syscon nr __NR_clone 0x0038 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_clone 0x0038 0xfff 0xfff 0xfff 0x11f 0xfff
syscon nr __NR_tkill 0x00c8 0xfff 0xfff 0xfff 0xfff 0xfff
syscon nr __NR_futex 0x00ca 0xfff 0xfff 0x0053 0xfff 0xfff
syscon nr __NR_set_robust_list 0x0111 0xfff 0xfff 0xfff 0xfff 0xfff

View file

@ -1,2 +1,2 @@
#include "libc/sysv/consts/syscon.internal.h"
.syscon nr,__NR_clone,0x0038,0xfff,0xfff,0xfff,0xfff,0xfff
.syscon nr,__NR_clone,0x0038,0xfff,0xfff,0xfff,0x11f,0xfff

26
libc/sysv/consts/clone.h Normal file
View file

@ -0,0 +1,26 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define CLONE_VM 0x00000100
#define CLONE_FS 0x00000200
#define CLONE_FILES 0x00000400
#define CLONE_SIGHAND 0x00000800
#define CLONE_PTRACE 0x00002000
#define CLONE_VFORK 0x00004000
#define CLONE_PARENT 0x00008000
#define CLONE_THREAD 0x00010000
#define CLONE_NEWNS 0x00020000
#define CLONE_SYSVSEM 0x00040000
#define CLONE_SETTLS 0x00080000
#define CLONE_PARENT_SETTID 0x00100000
#define CLONE_CHILD_CLEARTID 0x00200000
#define CLONE_DETACHED 0x00400000
#define CLONE_UNTRACED 0x00800000
#define CLONE_CHILD_SETTID 0x01000000
#define CLONE_STOPPED 0x02000000
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_ */

View file

@ -1,32 +1,32 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_
#define S_ISVTX 01000 /* THE STICKY BIT */
#define S_ISGID 02000 /* the setgid bit */
#define S_ISUID 04000 /* the setuid bit */
#define S_IXUSR 00100 /* user --x; just use octal */
#define S_IWUSR 00200 /* user -w-; just use octal */
#define S_IRUSR 00400 /* user r--; just use octal */
#define S_IRWXU 00700 /* user rwx; just use octal */
#define S_IXGRP 00010 /* group --x; just use octal */
#define S_IWGRP 00020 /* group -w-; just use octal */
#define S_IRGRP 00040 /* group r--; just use octal */
#define S_IRWXG 00070 /* group rwx; just use octal */
#define S_IXOTH 00001 /* other --x; just use octal */
#define S_IWOTH 00002 /* other -w-; just use octal */
#define S_IROTH 00004 /* other r--; just use octal */
#define S_IRWXO 00007 /* other rwx; just use octal */
#define S_IREAD 00400 /* just use octal */
#define S_IEXEC 00100 /* just use octal */
#define S_IWRITE 00200 /* just use octal */
#define S_IFIFO 0010000 /* pipe */
#define S_IFCHR 0020000 /* character device */
#define S_IFDIR 0040000 /* directory */
#define S_IFBLK 0060000 /* block device */
#define S_IFREG 0100000 /* regular file */
#define S_IFLNK 0120000 /* symbolic link */
#define S_IFSOCK 0140000 /* socket */
#define S_IFMT 0170000 /* mask of file types above */
#define S_IFIFO (1 << 12) /* pipe */
#define S_IFCHR (2 << 12) /* character device */
#define S_IFDIR (4 << 12) /* directory */
#define S_IFBLK (6 << 12) /* block device */
#define S_IFREG (8 << 12) /* regular file */
#define S_IFLNK (10 << 12) /* symbolic link */
#define S_IFSOCK (12 << 12) /* socket */
#define S_IFMT (15 << 12) /* mask of file types above */
#define S_ISVTX 0001000 /* THE STICKY BIT */
#define S_ISGID 0002000 /* the setgid bit */
#define S_ISUID 0004000 /* the setuid bit */
#define S_IXUSR 0000100 /* user --x; just use octal */
#define S_IWUSR 0000200 /* user -w-; just use octal */
#define S_IRUSR 0000400 /* user r--; just use octal */
#define S_IRWXU 0000700 /* user rwx; just use octal */
#define S_IXGRP 0000010 /* group --x; just use octal */
#define S_IWGRP 0000020 /* group -w-; just use octal */
#define S_IRGRP 0000040 /* group r--; just use octal */
#define S_IRWXG 0000070 /* group rwx; just use octal */
#define S_IXOTH 0000001 /* other --x; just use octal */
#define S_IWOTH 0000002 /* other -w-; just use octal */
#define S_IROTH 0000004 /* other r--; just use octal */
#define S_IRWXO 0000007 /* other rwx; just use octal */
#define S_IREAD 0000400 /* just use octal */
#define S_IEXEC 0000100 /* just use octal */
#define S_IWRITE 0000200 /* just use octal */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_S_H_ */