| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 1 | # This file is used to automatically generate bionic's system call stubs. | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 2 | # | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 3 | # Each non-blank, non-comment line has the following format: | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 4 | # | 
| H.J. Lu | 6fe4e87 | 2013-10-04 10:03:17 -0700 | [diff] [blame] | 5 | # return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 6 | # | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 7 | # where: | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 8 | #       arch_list ::= "all" | "lp32" | "lp64" | arch+ | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 9 | #       arch      ::= "arm" | "arm64" | "mips" | "mips64" | "x86" | "x86_64" | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 10 | # | 
|  | 11 | # Note: | 
| Elliott Hughes | a51916b | 2013-04-03 10:08:09 -0700 | [diff] [blame] | 12 | #      - syscall_name corresponds to the name of the syscall, which may differ from | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 13 | #        the exported function name (example: the exit syscall is implemented by the _exit() | 
|  | 14 | #        function, which is not the same as the standard C exit() function which calls it) | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 15 | # | 
| H.J. Lu | 6fe4e87 | 2013-10-04 10:03:17 -0700 | [diff] [blame] | 16 | #      - alias_list is optional comma separated list of function aliases. | 
|  | 17 | # | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 18 | #      - The call_id parameter, given that func_name and syscall_name have | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 19 | #        been provided, allows the user to specify dispatch style syscalls. | 
|  | 20 | #        For example, socket() syscall on i386 actually becomes: | 
|  | 21 | #          socketcall(__NR_socket, 1, *(rest of args on stack)). | 
|  | 22 | # | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 23 | #      - Each parameter type is assumed to be stored in 32 bits. | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 24 | # | 
| Elliott Hughes | 0493a6f | 2013-03-07 11:48:58 -0800 | [diff] [blame] | 25 | # This file is processed by a python script named gensyscalls.py. | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 26 |  | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 27 | int     execve(const char*, char* const*, char* const*)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 28 |  | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 29 | uid_t   getuid:getuid32()         arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 30 | uid_t   getuid:getuid()           arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 31 | gid_t   getgid:getgid32()         arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 32 | gid_t   getgid:getgid()           arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 33 | uid_t   geteuid:geteuid32()       arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 34 | uid_t   geteuid:geteuid()         arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 35 | gid_t   getegid:getegid32()       arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 36 | gid_t   getegid:getegid()         arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 37 | uid_t   getresuid:getresuid32(uid_t* ruid, uid_t* euid, uid_t* suid)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 38 | uid_t   getresuid:getresuid(uid_t* ruid, uid_t* euid, uid_t* suid)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 39 | gid_t   getresgid:getresgid32(gid_t* rgid, gid_t* egid, gid_t* sgid)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 40 | gid_t   getresgid:getresgid(gid_t* rgid, gid_t* egid, gid_t* sgid)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 41 | ssize_t readahead(int, off64_t, size_t)     all | 
|  | 42 | int     getgroups:getgroups32(int, gid_t*)    arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 43 | int     getgroups:getgroups(int, gid_t*)      arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 44 | pid_t   getpgid(pid_t)             all | 
|  | 45 | pid_t   getppid()                  all | 
|  | 46 | pid_t   getsid(pid_t)              all | 
|  | 47 | pid_t   setsid()                   all | 
|  | 48 | int     setgid:setgid32(gid_t)     arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 49 | int     setgid:setgid(gid_t)       arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 232163c | 2013-10-09 17:35:36 -0700 | [diff] [blame] | 50 | int     setuid:setuid32(uid_t)    arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 51 | int     setuid:setuid(uid_t)      arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 232163c | 2013-10-09 17:35:36 -0700 | [diff] [blame] | 52 | int     setreuid:setreuid32(uid_t, uid_t)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 53 | int     setreuid:setreuid(uid_t, uid_t)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 232163c | 2013-10-09 17:35:36 -0700 | [diff] [blame] | 54 | int     setresuid:setresuid32(uid_t, uid_t, uid_t)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 55 | int     setresuid:setresuid(uid_t, uid_t, uid_t)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 56 | int     setresgid:setresgid32(gid_t, gid_t, gid_t)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 57 | int     setresgid:setresgid(gid_t, gid_t, gid_t)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 58 | void*   __brk:brk(void*)           all | 
| Christopher Ferris | ed45970 | 2013-12-02 17:44:53 -0800 | [diff] [blame] | 59 | int     kill(pid_t, int)           all | 
| Christopher Ferris | ed45970 | 2013-12-02 17:44:53 -0800 | [diff] [blame] | 60 | int     tgkill(pid_t tgid, pid_t tid, int sig)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 61 | int     __ptrace:ptrace(int request, int pid, void* addr, void* data)  all | 
| Elliott Hughes | 0f461e3 | 2014-01-09 10:17:03 -0800 | [diff] [blame] | 62 |  | 
|  | 63 | # <sys/resource.h> | 
|  | 64 | int getrusage(int, struct rusage*)  all | 
| Elliott Hughes | 8f0e42f | 2016-11-29 15:10:29 -0800 | [diff] [blame] | 65 | int __getpriority:getpriority(int, id_t)  all | 
|  | 66 | int setpriority(int, id_t, int)   all | 
| Elliott Hughes | 0f461e3 | 2014-01-09 10:17:03 -0800 | [diff] [blame] | 67 | # On LP64, rlimit and rlimit64 are the same. | 
|  | 68 | # On 32-bit systems we use prlimit64 to implement the rlimit64 functions. | 
|  | 69 | int getrlimit:ugetrlimit(int, struct rlimit*)  arm,x86 | 
|  | 70 | int getrlimit(int, struct rlimit*)  mips | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 71 | int getrlimit|getrlimit64(int, struct rlimit*)  lp64 | 
|  | 72 | int setrlimit(int, const struct rlimit*)  lp32 | 
|  | 73 | int setrlimit|setrlimit64(int, const struct rlimit*)  lp64 | 
|  | 74 | int prlimit64|prlimit(pid_t, int, struct rlimit64*, const struct rlimit64*)  lp64 | 
|  | 75 | int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*)  lp32 | 
| Elliott Hughes | 0f461e3 | 2014-01-09 10:17:03 -0800 | [diff] [blame] | 76 |  | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 77 | int     setgroups:setgroups32(int, const gid_t*)   arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 78 | int     setgroups:setgroups(int, const gid_t*)     arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 79 | int     setpgid(pid_t, pid_t)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 80 | int     setregid:setregid32(gid_t, gid_t)  arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 81 | int     setregid:setregid(gid_t, gid_t)    arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 82 | int     chroot(const char*)  all | 
| Elliott Hughes | 9c07aee | 2014-07-18 15:55:41 -0700 | [diff] [blame] | 83 | int     prctl(int, unsigned long, unsigned long, unsigned long, unsigned long) all | 
| Elliott Hughes | 4906e56 | 2013-10-04 14:55:30 -0700 | [diff] [blame] | 84 | long    __arch_prctl:arch_prctl(int, unsigned long) x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 85 | int     capget(cap_user_header_t header, cap_user_data_t data) all | 
|  | 86 | int     capset(cap_user_header_t header, const cap_user_data_t data) all | 
|  | 87 | int     sigaltstack(const stack_t*, stack_t*) all | 
|  | 88 | int     acct(const char*  filepath)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 89 |  | 
|  | 90 | # file descriptors | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 91 | ssize_t     read(int, void*, size_t)        all | 
|  | 92 | ssize_t     write(int, const void*, size_t)       all | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 93 | ssize_t     pread64(int, void*, size_t, off64_t) lp32 | 
|  | 94 | ssize_t     pread64|pread(int, void*, size_t, off_t) lp64 | 
|  | 95 | ssize_t     pwrite64(int, void*, size_t, off64_t) lp32 | 
|  | 96 | ssize_t     pwrite64|pwrite(int, void*, size_t, off_t) lp64 | 
| Elliott Hughes | 6f4594d | 2015-08-26 13:27:43 -0700 | [diff] [blame] | 97 |  | 
|  | 98 | # On LP32, preadv/pwritev don't use off64_t --- they use pairs of 32-bit | 
|  | 99 | # arguments to avoid problems on architectures like ARM where 64-bit arguments | 
|  | 100 | # must be in a register pair starting with an even-numbered register. | 
|  | 101 | # See linux/fs/read_write.c and https://lwn.net/Articles/311630/. | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 102 | ssize_t     __preadv64:preadv(int, const struct iovec*, int, long, long) lp32 | 
|  | 103 | ssize_t     preadv|preadv64(int, const struct iovec*, int, off_t) lp64 | 
|  | 104 | ssize_t     __pwritev64:pwritev(int, const struct iovec*, int, long, long) lp32 | 
|  | 105 | ssize_t     pwritev|pwritev64(int, const struct iovec*, int, off_t) lp64 | 
| Elliott Hughes | 6f4594d | 2015-08-26 13:27:43 -0700 | [diff] [blame] | 106 |  | 
| Elliott Hughes | 3391a9f | 2015-04-22 21:40:38 -0700 | [diff] [blame] | 107 | int         ___close:close(int)  all | 
| Elliott Hughes | 7086ad6 | 2014-06-19 16:39:01 -0700 | [diff] [blame] | 108 | pid_t       __getpid:getpid()  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 109 | int         munmap(void*, size_t)  all | 
| Daniel Micay | 4200e26 | 2015-11-03 05:14:08 -0500 | [diff] [blame] | 110 | void*       ___mremap:mremap(void*, size_t, size_t, int, void*)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 111 | int         msync(const void*, size_t, int)    all | 
|  | 112 | int         mprotect(const void*, size_t, int)  all | 
| Yabin Cui | efbb6fb | 2014-12-03 11:11:50 -0800 | [diff] [blame] | 113 | int         madvise(void*, size_t, int)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 114 | int         mlock(const void* addr, size_t len)    all | 
|  | 115 | int         munlock(const void* addr, size_t len)   all | 
|  | 116 | int         mlockall(int flags)   all | 
|  | 117 | int         munlockall()   all | 
|  | 118 | int         mincore(void*  start, size_t  length, unsigned char*  vec)   all | 
|  | 119 | int         __ioctl:ioctl(int, int, void*)  all | 
| Josh Gao | 753361a | 2016-11-29 14:26:15 -0800 | [diff] [blame] | 120 | ssize_t     readv(int, const struct iovec*, int)   all | 
|  | 121 | ssize_t     writev(int, const struct iovec*, int)  all | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 122 | int         __fcntl64:fcntl64(int, int, void*)  lp32 | 
|  | 123 | int         fcntl(int, int, void*)  lp64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 124 | int         flock(int, int)   all | 
| Nick Kralevich | 00490ae | 2015-02-03 11:27:25 -0800 | [diff] [blame] | 125 | int         ___fchmod:fchmod(int, mode_t)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 126 | int         dup(int)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 127 | int         pipe2(int*, int) all | 
| Elliott Hughes | cac7b9d | 2013-10-23 09:48:29 -0700 | [diff] [blame] | 128 | int         dup3(int, int, int)   all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 129 | int         fsync(int)  all | 
|  | 130 | int         fdatasync(int) all | 
|  | 131 | int         fchown:fchown32(int, uid_t, gid_t)  arm,x86 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 132 | int         fchown:fchown(int, uid_t, gid_t)    arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 133 | void        sync(void)  all | 
| Elliott Hughes | 896362e | 2017-08-24 16:31:49 -0700 | [diff] [blame] | 134 | int         syncfs(int)  all | 
| Nick Kralevich | 2825f10 | 2015-05-31 13:43:13 -0700 | [diff] [blame] | 135 | int         ___fsetxattr:fsetxattr(int, const char*, const void*, size_t, int) all | 
|  | 136 | ssize_t     ___fgetxattr:fgetxattr(int, const char*, void*, size_t) all | 
| Nick Kralevich | e1d0810 | 2015-06-06 11:23:26 -0700 | [diff] [blame] | 137 | ssize_t     ___flistxattr:flistxattr(int, char*, size_t) all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 138 | int         fremovexattr(int, const char*) all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 139 |  | 
| Elliott Hughes | 3d5cb30 | 2014-06-06 11:44:55 -0700 | [diff] [blame] | 140 | int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int)   arm,arm64,mips,mips64,x86,x86_64 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 141 |  | 
| Elliott Hughes | f8fcfbc | 2013-10-22 13:28:46 -0700 | [diff] [blame] | 142 | int __openat:openat(int, const char*, int, mode_t) all | 
| Nick Kralevich | 3577825 | 2015-02-24 13:40:43 -0800 | [diff] [blame] | 143 | int ___faccessat:faccessat(int, const char*, int)  all | 
| Nick Kralevich | 00490ae | 2015-02-03 11:27:25 -0800 | [diff] [blame] | 144 | int ___fchmodat:fchmodat(int, const char*, mode_t)  all | 
| Elliott Hughes | f8fcfbc | 2013-10-22 13:28:46 -0700 | [diff] [blame] | 145 | int fchownat(int, const char*, uid_t, gid_t, int)  all | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 146 | int fstatat64|fstatat:fstatat64(int, const char*, struct stat*, int)   lp32 | 
| Miodrag Dinic | a301e73 | 2017-06-12 10:52:12 +0200 | [diff] [blame] | 147 | int fstatat64|fstatat:newfstatat(int, const char*, struct stat*, int)  arm64,x86_64 | 
| Elliott Hughes | f8fcfbc | 2013-10-22 13:28:46 -0700 | [diff] [blame] | 148 | int linkat(int, const char*, int, const char*, int)  all | 
|  | 149 | int mkdirat(int, const char*, mode_t)  all | 
|  | 150 | int mknodat(int, const char*, mode_t, dev_t)  all | 
|  | 151 | int readlinkat(int, const char*, char*, size_t)  all | 
|  | 152 | int renameat(int, const char*, int, const char*)  all | 
|  | 153 | int symlinkat(const char*, int, const char*)  all | 
|  | 154 | int unlinkat(int, const char*, int)   all | 
|  | 155 | int utimensat(int, const char*, const struct timespec times[2], int)  all | 
|  | 156 |  | 
| Elliott Hughes | a6519d6 | 2013-10-17 16:56:40 -0700 | [diff] [blame] | 157 | # Paired off_t/off64_t system calls. On 64-bit systems, | 
|  | 158 | # sizeof(off_t) == sizeof(off64_t), so there we emit two symbols that are | 
|  | 159 | # aliases. On 32-bit systems, we have two different system calls. | 
|  | 160 | # That means that every system call in this section should take three lines. | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 161 | off_t lseek(int, off_t, int) lp32 | 
|  | 162 | int __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int) lp32 | 
|  | 163 | off_t lseek|lseek64(int, off_t, int) lp64 | 
|  | 164 | int ftruncate64(int, off64_t) lp32 | 
|  | 165 | int ftruncate|ftruncate64(int, off_t) lp64 | 
|  | 166 | ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) lp32 | 
|  | 167 | ssize_t sendfile64(int out_fd, int in_fd, off64_t* offset, size_t count) lp32 | 
|  | 168 | ssize_t sendfile|sendfile64(int out_fd, int in_fd, off_t* offset, size_t count) lp64 | 
|  | 169 | int truncate(const char*, off_t) lp32 | 
|  | 170 | int truncate64(const char*, off64_t) lp32 | 
|  | 171 | int truncate|truncate64(const char*, off_t) lp64 | 
| Serban Constantinescu | ed76a93 | 2013-12-12 09:36:27 +0000 | [diff] [blame] | 172 | # (mmap only gets two lines because we only used the 64-bit variant on 32-bit systems.) | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 173 | void* __mmap2:mmap2(void*, size_t, int, int, int, long)   lp32 | 
|  | 174 | void* mmap|mmap64(void*, size_t, int, int, int, off_t)  lp64 | 
| Elliott Hughes | f64b8ea | 2014-02-03 16:20:46 -0800 | [diff] [blame] | 175 | # (fallocate only gets two lines because there is no 32-bit variant.) | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 176 | int fallocate64:fallocate(int, int, off64_t, off64_t) lp32 | 
|  | 177 | int fallocate|fallocate64(int, int, off_t, off_t) lp64 | 
| Elliott Hughes | a6519d6 | 2013-10-17 16:56:40 -0700 | [diff] [blame] | 178 |  | 
| Elliott Hughes | b587f33 | 2014-09-10 17:39:00 -0700 | [diff] [blame] | 179 | # posix_fadvise64 is awkward: arm has shuffled arguments, | 
|  | 180 | # the POSIX functions don't set errno, and no architecture has posix_fadvise. | 
|  | 181 | int __arm_fadvise64_64:arm_fadvise64_64(int, int, off64_t, off64_t) arm | 
| Elliott Hughes | 9990b39 | 2014-09-11 10:10:08 -0700 | [diff] [blame] | 182 | int __fadvise64:fadvise64_64(int, off64_t, off64_t, int) x86 | 
|  | 183 | int __fadvise64:fadvise64(int, off64_t, off64_t, int) arm64,mips,mips64,x86_64 | 
| Elliott Hughes | b587f33 | 2014-09-10 17:39:00 -0700 | [diff] [blame] | 184 |  | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 185 | int __fstatfs64:fstatfs64(int, size_t, struct statfs*)  lp32 | 
|  | 186 | int __fstatfs:fstatfs(int, struct statfs*)  lp64 | 
|  | 187 | int __statfs64:statfs64(const char*, size_t, struct statfs*)  lp32 | 
|  | 188 | int __statfs:statfs(const char*, struct statfs*)  lp64 | 
| Elliott Hughes | db1ea34 | 2014-01-17 18:42:49 -0800 | [diff] [blame] | 189 |  | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 190 | int     fstat64|fstat:fstat64(int, struct stat*)    lp32 | 
| Miodrag Dinic | a301e73 | 2017-06-12 10:52:12 +0200 | [diff] [blame] | 191 | int     fstat64|fstat:fstat(int, struct stat*)    arm64,x86_64 | 
| Elliott Hughes | db1ea34 | 2014-01-17 18:42:49 -0800 | [diff] [blame] | 192 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 193 | # file system | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 194 | int     chdir(const char*)              all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 195 | int     mount(const char*, const char*, const char*, unsigned long, const void*)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 196 | int     umount2(const char*, int)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 197 | int     __getcwd:getcwd(char* buf, size_t size)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 198 | int     fchdir(int)    all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 199 | int     setxattr(const char*, const char*, const void*, size_t, int) all | 
|  | 200 | int     lsetxattr(const char*, const char*, const void*, size_t, int) all | 
|  | 201 | ssize_t getxattr(const char*, const char*, void*, size_t) all | 
|  | 202 | ssize_t lgetxattr(const char*, const char*, void*, size_t) all | 
|  | 203 | ssize_t listxattr(const char*, char*, size_t) all | 
|  | 204 | ssize_t llistxattr(const char*, char*, size_t) all | 
|  | 205 | int     removexattr(const char*, const char*) all | 
|  | 206 | int     lremovexattr(const char*, const char*) all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 207 | int     swapon(const char*, int) all | 
|  | 208 | int     swapoff(const char*) all | 
| Stephen Smalley | 5eb686d | 2012-01-13 07:45:16 -0500 | [diff] [blame] | 209 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 210 | # time | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 211 | int           settimeofday(const struct timeval*, const struct timezone*)   all | 
|  | 212 | clock_t       times(struct tms*)       all | 
|  | 213 | int           nanosleep(const struct timespec*, struct timespec*)   all | 
| Haruki Hasegawa | 1816025 | 2014-10-13 00:50:47 +0900 | [diff] [blame] | 214 | int           clock_settime(clockid_t, const struct timespec*)  all | 
| Elliott Hughes | b130493 | 2015-06-15 19:39:04 -0700 | [diff] [blame] | 215 | int           ___clock_nanosleep:clock_nanosleep(clockid_t, int, const struct timespec*, struct timespec*)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 216 | int           getitimer(int, const struct itimerval*)   all | 
|  | 217 | int           setitimer(int, const struct itimerval*, struct itimerval*)  all | 
| Elliott Hughes | 4b558f5 | 2014-03-04 15:58:02 -0800 | [diff] [blame] | 218 | int           __timer_create:timer_create(clockid_t clockid, struct sigevent* evp, __kernel_timer_t* timerid)    all | 
|  | 219 | int           __timer_settime:timer_settime(__kernel_timer_t, int, const struct itimerspec*, struct itimerspec*) all | 
|  | 220 | int           __timer_gettime:timer_gettime(__kernel_timer_t, struct itimerspec*)                                all | 
|  | 221 | int           __timer_getoverrun:timer_getoverrun(__kernel_timer_t)                                              all | 
|  | 222 | int           __timer_delete:timer_delete(__kernel_timer_t)                                                      all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 223 | int           timerfd_create(clockid_t, int)   all | 
|  | 224 | int           timerfd_settime(int, int, const struct itimerspec*, struct itimerspec*)   all | 
|  | 225 | int           timerfd_gettime(int, struct itimerspec*)   all | 
| Greg Hackmann | 3f3f6c5 | 2016-01-27 17:13:51 -0800 | [diff] [blame] | 226 | int           adjtimex(struct timex*)   all | 
| Elliott Hughes | 5f26c6b | 2016-02-03 13:19:10 -0800 | [diff] [blame] | 227 | int           clock_adjtime(clockid_t, struct timex*)   all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 228 |  | 
|  | 229 | # signals | 
| Elliott Hughes | 8251d44 | 2018-11-09 13:55:21 -0800 | [diff] [blame] | 230 | int     __sigaction:sigaction(int, const struct sigaction*, struct sigaction*)  lp32 | 
| Elliott Hughes | 1f5af92 | 2013-10-15 18:01:56 -0700 | [diff] [blame] | 231 | int     __rt_sigaction:rt_sigaction(int, const struct sigaction*, struct sigaction*, size_t)  all | 
| Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 232 | int     __rt_sigpending:rt_sigpending(sigset64_t*, size_t)  all | 
|  | 233 | int     __rt_sigprocmask:rt_sigprocmask(int, const sigset64_t*, sigset64_t*, size_t)  all | 
|  | 234 | int     __rt_sigsuspend:rt_sigsuspend(const sigset64_t*, size_t)  all | 
|  | 235 | int     __rt_sigtimedwait:rt_sigtimedwait(const sigset64_t*, siginfo_t*, const timespec*, size_t)  all | 
| Yabin Cui | 40a8f21 | 2015-05-18 11:19:11 -0700 | [diff] [blame] | 236 | int     ___rt_sigqueueinfo:rt_sigqueueinfo(pid_t, int, siginfo_t*)  all | 
| Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 237 | int     __signalfd4:signalfd4(int, const sigset64_t*, size_t, int)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 238 |  | 
|  | 239 | # sockets | 
| Sreeram Ramachandran | 903b788 | 2014-05-19 13:39:57 -0700 | [diff] [blame] | 240 | int           __socket:socket(int, int, int)              arm,arm64,mips,mips64,x86_64 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 241 | int           socketpair(int, int, int, int*)    arm,arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 2b9605f | 2016-08-16 13:37:24 -0700 | [diff] [blame] | 242 | int           bind(int, struct sockaddr*, socklen_t)  arm,arm64,mips,mips64,x86_64 | 
| Sreeram Ramachandran | ceb5bd7 | 2014-05-12 11:19:16 -0700 | [diff] [blame] | 243 | int           __connect:connect(int, struct sockaddr*, socklen_t)   arm,arm64,mips,mips64,x86_64 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 244 | int           listen(int, int)                   arm,arm64,mips,mips64,x86_64 | 
| Sreeram Ramachandran | 903b788 | 2014-05-19 13:39:57 -0700 | [diff] [blame] | 245 | int           __accept4:accept4(int, struct sockaddr*, socklen_t*, int)  arm,arm64,mips,mips64,x86_64 | 
| Chris Dearman | 5043212 | 2014-02-05 16:59:23 -0800 | [diff] [blame] | 246 | int           getsockname(int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64 | 
|  | 247 | int           getpeername(int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64 | 
|  | 248 | int           sendto(int, const void*, size_t, int, const struct sockaddr*, socklen_t)  arm,arm64,mips,mips64,x86_64 | 
|  | 249 | int           recvfrom(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*)  arm,arm64,mips,mips64,x86_64 | 
|  | 250 | int           shutdown(int, int)  arm,arm64,mips,mips64,x86_64 | 
|  | 251 | int           setsockopt(int, int, int, const void*, socklen_t)  arm,arm64,mips,mips64,x86_64 | 
|  | 252 | int           getsockopt(int, int, int, void*, socklen_t*)    arm,arm64,mips,mips64,x86_64 | 
| Elliott Hughes | 2b9605f | 2016-08-16 13:37:24 -0700 | [diff] [blame] | 253 | ssize_t       recvmsg(int, struct msghdr*, unsigned int)   arm,arm64,mips,mips64,x86_64 | 
|  | 254 | ssize_t       sendmsg(int, const struct msghdr*, unsigned int)  arm,arm64,mips,mips64,x86_64 | 
| Guillaume Ranquet | 6ff0c75 | 2014-02-10 13:11:29 +0100 | [diff] [blame] | 255 | int           recvmmsg(int, struct mmsghdr*, unsigned int, int, const struct timespec*)   arm,arm64,mips,mips64,x86_64 | 
|  | 256 | int           sendmmsg(int, struct mmsghdr*, unsigned int, int)   arm,arm64,mips,mips64,x86_64 | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 257 |  | 
|  | 258 | # sockets for x86. These are done as an "indexed" call to socketcall syscall. | 
| Sreeram Ramachandran | 903b788 | 2014-05-19 13:39:57 -0700 | [diff] [blame] | 259 | int           __socket:socketcall:1(int, int, int) x86 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 260 | int           bind:socketcall:2(int, struct sockaddr*, int)  x86 | 
| Sreeram Ramachandran | ceb5bd7 | 2014-05-12 11:19:16 -0700 | [diff] [blame] | 261 | int           __connect:socketcall:3(int, struct sockaddr*, socklen_t)   x86 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 262 | int           listen:socketcall:4(int, int)                   x86 | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 263 | int           getsockname:socketcall:6(int, struct sockaddr*, socklen_t*)  x86 | 
|  | 264 | int           getpeername:socketcall:7(int, struct sockaddr*, socklen_t*)  x86 | 
|  | 265 | int           socketpair:socketcall:8(int, int, int, int*)    x86 | 
|  | 266 | int           sendto:socketcall:11(int, const void*, size_t, int, const struct sockaddr*, socklen_t)  x86 | 
|  | 267 | int           recvfrom:socketcall:12(int, void*, size_t, unsigned int, struct sockaddr*, socklen_t*)  x86 | 
|  | 268 | int           shutdown:socketcall:13(int, int)  x86 | 
|  | 269 | int           setsockopt:socketcall:14(int, int, int, const void*, socklen_t)  x86 | 
|  | 270 | int           getsockopt:socketcall:15(int, int, int, void*, socklen_t*)    x86 | 
|  | 271 | int           sendmsg:socketcall:16(int, const struct msghdr*, unsigned int)  x86 | 
|  | 272 | int           recvmsg:socketcall:17(int, struct msghdr*, unsigned int)   x86 | 
| Sreeram Ramachandran | 903b788 | 2014-05-19 13:39:57 -0700 | [diff] [blame] | 273 | int           __accept4:socketcall:18(int, struct sockaddr*, socklen_t*, int)  x86 | 
| Guillaume Ranquet | 6ff0c75 | 2014-02-10 13:11:29 +0100 | [diff] [blame] | 274 | int           recvmmsg:socketcall:19(int, struct mmsghdr*, unsigned int, int, const struct timespec*)   x86 | 
|  | 275 | int           sendmmsg:socketcall:20(int, struct mmsghdr*, unsigned int, int)   x86 | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 276 |  | 
|  | 277 | # scheduler & real-time | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 278 | int sched_setscheduler(pid_t pid, int policy, const struct sched_param* param)  all | 
|  | 279 | int sched_getscheduler(pid_t pid)  all | 
|  | 280 | int sched_yield(void)  all | 
|  | 281 | int sched_setparam(pid_t pid, const struct sched_param* param)  all | 
|  | 282 | int sched_getparam(pid_t pid, struct sched_param* param)  all | 
|  | 283 | int sched_get_priority_max(int policy)  all | 
|  | 284 | int sched_get_priority_min(int policy)  all | 
|  | 285 | int sched_rr_get_interval(pid_t pid, struct timespec* interval)  all | 
|  | 286 | int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) all | 
| Elliott Hughes | 887e114 | 2014-01-02 12:05:50 -0800 | [diff] [blame] | 287 | int setns(int, int) all | 
|  | 288 | int unshare(int) all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 289 | int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set)  all | 
| Elliott Hughes | 887e114 | 2014-01-02 12:05:50 -0800 | [diff] [blame] | 290 | int __getcpu:getcpu(unsigned*, unsigned*, void*) all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 291 |  | 
|  | 292 | # other | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 293 | int     uname(struct utsname*)  all | 
|  | 294 | mode_t  umask(mode_t)  all | 
| Elliott Hughes | 1f5af92 | 2013-10-15 18:01:56 -0700 | [diff] [blame] | 295 | int     __reboot:reboot(int, int, int, void*)  all | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 296 | int     init_module(void*, unsigned long, const char*)  all | 
|  | 297 | int     delete_module(const char*, unsigned int)   all | 
|  | 298 | int     klogctl:syslog(int, char*, int)   all | 
|  | 299 | int     sysinfo(struct sysinfo*)  all | 
|  | 300 | int     personality(unsigned long)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 301 |  | 
| Elliott Hughes | 3f525d4 | 2014-06-24 16:32:01 -0700 | [diff] [blame] | 302 | ssize_t tee(int, int, size_t, unsigned int)  all | 
|  | 303 | ssize_t splice(int, off64_t*, int, off64_t*, size_t, unsigned int)  all | 
|  | 304 | ssize_t vmsplice(int, const struct iovec*, size_t, unsigned int)  all | 
|  | 305 |  | 
| Elliott Hughes | cac7b9d | 2013-10-23 09:48:29 -0700 | [diff] [blame] | 306 | int epoll_create1(int)  all | 
|  | 307 | int epoll_ctl(int, int op, int, struct epoll_event*)  all | 
| Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 308 | int __epoll_pwait:epoll_pwait(int, struct epoll_event*, int, int, const sigset64_t*, size_t)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 309 |  | 
| Elliott Hughes | cac7b9d | 2013-10-23 09:48:29 -0700 | [diff] [blame] | 310 | int eventfd:eventfd2(unsigned int, int)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 311 |  | 
| Elliott Hughes | 9f52564 | 2014-04-08 17:14:01 -0700 | [diff] [blame] | 312 | void _exit|_Exit:exit_group(int)  all | 
| Elliott Hughes | 6b53c23 | 2013-10-24 22:36:58 -0700 | [diff] [blame] | 313 | void __exit:exit(int)  all | 
|  | 314 |  | 
| Elliott Hughes | cac7b9d | 2013-10-23 09:48:29 -0700 | [diff] [blame] | 315 | int inotify_init1(int)  all | 
|  | 316 | int inotify_add_watch(int, const char*, unsigned int)  all | 
|  | 317 | int inotify_rm_watch(int, unsigned int)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 318 |  | 
| Elliott Hughes | 1195207 | 2013-10-24 15:15:14 -0700 | [diff] [blame] | 319 | int __pselect6:pselect6(int, fd_set*, fd_set*, fd_set*, timespec*, void*)  all | 
| Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 320 | int __ppoll:ppoll(pollfd*, unsigned int, timespec*, const sigset64_t*, size_t)  all | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 321 |  | 
| Elliott Hughes | be57a40 | 2015-06-10 17:24:20 -0700 | [diff] [blame] | 322 | ssize_t process_vm_readv(pid_t, const struct iovec*, unsigned long, const struct iovec*, unsigned long, unsigned long)  all | 
|  | 323 | ssize_t process_vm_writev(pid_t, const struct iovec*, unsigned long, const struct iovec*, unsigned long, unsigned long)  all | 
|  | 324 |  | 
| Elliott Hughes | eafad49 | 2016-04-05 23:01:42 -0700 | [diff] [blame] | 325 | int quotactl(int, const char*, int, char*)  all | 
|  | 326 |  | 
| Elliott Hughes | 36d6188 | 2013-11-19 13:31:58 -0800 | [diff] [blame] | 327 | int __set_tid_address:set_tid_address(int*)  all | 
|  | 328 |  | 
| Elliott Hughes | 7931099 | 2014-07-30 15:05:09 -0700 | [diff] [blame] | 329 | int setfsgid(gid_t)  all | 
|  | 330 | int setfsuid(uid_t)  all | 
|  | 331 |  | 
| Greg Hackmann | e2faf07 | 2016-03-03 08:37:53 -0800 | [diff] [blame] | 332 | int setdomainname(const char*, size_t)  all | 
| Elliott Hughes | b86a4c7 | 2014-11-07 16:07:13 -0800 | [diff] [blame] | 333 | int sethostname(const char*, size_t)  all | 
|  | 334 |  | 
| Elliott Hughes | 7f72ad4 | 2016-04-05 11:56:03 -0700 | [diff] [blame] | 335 | int __sync_file_range:sync_file_range(int, off64_t, off64_t, unsigned int) arm64,mips,mips64,x86,x86_64 | 
|  | 336 | int __sync_file_range2:sync_file_range2(int, unsigned int, off64_t, off64_t) arm | 
|  | 337 |  | 
| Elliott Hughes | 6b53c23 | 2013-10-24 22:36:58 -0700 | [diff] [blame] | 338 | pid_t wait4(pid_t, int*, int, struct rusage*)  all | 
|  | 339 | int __waitid:waitid(int, pid_t, struct siginfo_t*, int, void*)  all | 
|  | 340 |  | 
| Elliott Hughes | a6519d6 | 2013-10-17 16:56:40 -0700 | [diff] [blame] | 341 | # ARM-specific | 
| Elliott Hughes | 5e52279 | 2013-09-24 00:30:25 -0700 | [diff] [blame] | 342 | int     __set_tls:__ARM_NR_set_tls(void*)                                 arm | 
|  | 343 | int     cacheflush:__ARM_NR_cacheflush(long start, long end, long flags)  arm | 
| Raghu Gandham | 1fa0d84 | 2012-01-27 17:51:42 -0800 | [diff] [blame] | 344 |  | 
|  | 345 | # MIPS-specific | 
| Miodrag Dinic | a301e73 | 2017-06-12 10:52:12 +0200 | [diff] [blame] | 346 | int     _flush_cache:cacheflush(char* addr, const int nbytes, const int op) mips | 
| Elliott Hughes | dcbef06 | 2014-05-12 16:11:06 -0700 | [diff] [blame] | 347 | int     __set_tls:set_thread_area(void*) mips,mips64 | 
|  | 348 |  | 
|  | 349 | # x86-specific | 
|  | 350 | int     __set_thread_area:set_thread_area(void*) x86 | 
| Elliott Hughes | 625993d | 2014-07-15 16:53:13 -0700 | [diff] [blame] | 351 |  | 
|  | 352 | # vdso stuff. | 
| Elliott Hughes | 2180978 | 2017-12-11 11:40:40 -0800 | [diff] [blame] | 353 | int __clock_getres:clock_getres(clockid_t, struct timespec*) all | 
| Goran Ferenc | 996f6de | 2017-05-30 16:00:41 +0200 | [diff] [blame] | 354 | int __clock_gettime:clock_gettime(clockid_t, timespec*) all | 
|  | 355 | int __gettimeofday:gettimeofday(timeval*, timezone*) all | 
| Elliott Hughes | 8465e96 | 2017-09-27 16:33:35 -0700 | [diff] [blame] | 356 |  | 
|  | 357 | # <sys/random.h> | 
|  | 358 | ssize_t getrandom(void*, size_t, unsigned) all |