The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in |
| 12 | * the documentation and/or other materials provided with the |
| 13 | * distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 | * SUCH DAMAGE. |
| 27 | */ |
Elliott Hughes | f4c948a | 2014-08-19 11:16:41 -0700 | [diff] [blame] | 28 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | #ifndef _UNISTD_H_ |
| 30 | #define _UNISTD_H_ |
| 31 | |
| 32 | #include <stddef.h> |
| 33 | #include <sys/cdefs.h> |
| 34 | #include <sys/types.h> |
| 35 | #include <sys/select.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 36 | |
Josh Gao | ee8d169 | 2016-04-07 14:16:30 -0700 | [diff] [blame] | 37 | #include <bits/fcntl.h> |
Josh Gao | 7449e59 | 2016-04-07 16:37:49 -0700 | [diff] [blame] | 38 | #include <bits/getopt.h> |
Josh Gao | 98e574c | 2016-04-07 14:19:03 -0700 | [diff] [blame] | 39 | #include <bits/ioctl.h> |
Elliott Hughes | 5704c42 | 2016-01-25 18:06:24 -0800 | [diff] [blame] | 40 | #include <bits/lockf.h> |
| 41 | #include <bits/posix_limits.h> |
Elliott Hughes | fd936ae | 2016-08-12 10:16:34 -0700 | [diff] [blame] | 42 | #include <bits/seek_constants.h> |
Josh Gao | 8c8ef59 | 2016-04-07 16:33:30 -0700 | [diff] [blame] | 43 | #include <bits/sysconf.h> |
Elliott Hughes | 1ed337d | 2015-02-02 14:02:09 -0800 | [diff] [blame] | 44 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 45 | __BEGIN_DECLS |
| 46 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | #define STDIN_FILENO 0 |
| 48 | #define STDOUT_FILENO 1 |
| 49 | #define STDERR_FILENO 2 |
| 50 | |
Elliott Hughes | 1ed337d | 2015-02-02 14:02:09 -0800 | [diff] [blame] | 51 | #define F_OK 0 |
| 52 | #define X_OK 1 |
| 53 | #define W_OK 2 |
| 54 | #define R_OK 4 |
| 55 | |
Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 56 | #define _PC_FILESIZEBITS 0 |
| 57 | #define _PC_LINK_MAX 1 |
| 58 | #define _PC_MAX_CANON 2 |
| 59 | #define _PC_MAX_INPUT 3 |
| 60 | #define _PC_NAME_MAX 4 |
| 61 | #define _PC_PATH_MAX 5 |
| 62 | #define _PC_PIPE_BUF 6 |
| 63 | #define _PC_2_SYMLINKS 7 |
| 64 | #define _PC_ALLOC_SIZE_MIN 8 |
| 65 | #define _PC_REC_INCR_XFER_SIZE 9 |
| 66 | #define _PC_REC_MAX_XFER_SIZE 10 |
| 67 | #define _PC_REC_MIN_XFER_SIZE 11 |
| 68 | #define _PC_REC_XFER_ALIGN 12 |
| 69 | #define _PC_SYMLINK_MAX 13 |
| 70 | #define _PC_CHOWN_RESTRICTED 14 |
| 71 | #define _PC_NO_TRUNC 15 |
| 72 | #define _PC_VDISABLE 16 |
| 73 | #define _PC_ASYNC_IO 17 |
| 74 | #define _PC_PRIO_IO 18 |
| 75 | #define _PC_SYNC_IO 19 |
| 76 | |
Elliott Hughes | 58d9e28 | 2014-04-22 17:41:00 -0700 | [diff] [blame] | 77 | extern char** environ; |
| 78 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 79 | __noreturn void _exit(int __status); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 80 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 81 | pid_t fork(void); |
| 82 | pid_t vfork(void); |
| 83 | pid_t getpid(void); |
Elliott Hughes | 95fa061 | 2016-09-28 12:29:52 -0700 | [diff] [blame] | 84 | pid_t gettid(void) __attribute_const__; |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 85 | pid_t getpgid(pid_t __pid); |
| 86 | int setpgid(pid_t __pid, pid_t __pgid); |
| 87 | pid_t getppid(void); |
| 88 | pid_t getpgrp(void); |
| 89 | int setpgrp(void); |
| 90 | pid_t getsid(pid_t __pid) __INTRODUCED_IN(17); |
| 91 | pid_t setsid(void); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 92 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 93 | int execv(const char* __path, char* const* __argv); |
| 94 | int execvp(const char* __file, char* const* __argv); |
| 95 | int execvpe(const char* __file, char* const* __argv, char* const* __envp) __INTRODUCED_IN(21); |
| 96 | int execve(const char* __file, char* const* __argv, char* const* __envp); |
Josh Gao | d80a52e | 2016-08-10 15:18:29 -0700 | [diff] [blame] | 97 | int execl(const char* __path, const char* __arg0, ...) __attribute__((__sentinel__)); |
| 98 | int execlp(const char* __file, const char* __arg0, ...) __attribute__((__sentinel__)); |
| 99 | int execle(const char* __path, const char* __arg0, ... /*, char* const* __envp */) |
| 100 | __attribute__((__sentinel__(1))); |
Elliott Hughes | 4d215aa | 2017-10-18 15:54:56 -0700 | [diff] [blame] | 101 | int fexecve(int __fd, char* const* __argv, char* const* __envp) __INTRODUCED_IN_FUTURE; |
David 'Digit' Turner | b083bb5 | 2011-05-26 02:46:41 +0200 | [diff] [blame] | 102 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 103 | int nice(int __incr); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 105 | int setuid(uid_t __uid); |
| 106 | uid_t getuid(void); |
| 107 | int seteuid(uid_t __uid); |
| 108 | uid_t geteuid(void); |
| 109 | int setgid(gid_t __gid); |
| 110 | gid_t getgid(void); |
| 111 | int setegid(gid_t __gid); |
| 112 | gid_t getegid(void); |
| 113 | int getgroups(int __size, gid_t* __list); |
| 114 | int setgroups(size_t __size, const gid_t* __list); |
| 115 | int setreuid(uid_t __ruid, uid_t __euid); |
| 116 | int setregid(gid_t __rgid, gid_t __egid); |
| 117 | int setresuid(uid_t __ruid, uid_t __euid, uid_t __suid); |
| 118 | int setresgid(gid_t __rgid, gid_t __egid, gid_t __sgid); |
| 119 | int getresuid(uid_t* __ruid, uid_t* __euid, uid_t* __suid); |
| 120 | int getresgid(gid_t* __rgid, gid_t* __egid, gid_t* __sgid); |
| 121 | char* getlogin(void); |
Elliott Hughes | 06bd586 | 2017-07-28 16:27:49 -0700 | [diff] [blame] | 122 | int getlogin_r(char* __buffer, size_t __buffer_size) __INTRODUCED_IN_FUTURE; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 123 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 124 | long fpathconf(int __fd, int __name); |
| 125 | long pathconf(const char* __path, int __name); |
Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 126 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 127 | int access(const char* __path, int __mode); |
| 128 | int faccessat(int __dirfd, const char* __path, int __mode, int __flags) __INTRODUCED_IN(16); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 129 | int link(const char* __old_path, const char* __new_path); |
| 130 | int linkat(int __old_dir_fd, const char* __old_path, int __new_dir_fd, const char* __new_path, int __flags) __INTRODUCED_IN(21); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 131 | int unlink(const char* __path); |
| 132 | int unlinkat(int __dirfd, const char* __path, int __flags); |
| 133 | int chdir(const char* __path); |
| 134 | int fchdir(int __fd); |
| 135 | int rmdir(const char* __path); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 136 | int pipe(int __fds[2]); |
Elliott Hughes | 5f5cc45 | 2014-08-18 16:04:03 -0700 | [diff] [blame] | 137 | #if defined(__USE_GNU) |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 138 | int pipe2(int __fds[2], int __flags) __INTRODUCED_IN(9); |
David 'Digit' Turner | 275cd48 | 2010-09-27 17:33:08 +0200 | [diff] [blame] | 139 | #endif |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 140 | int chroot(const char* __path); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 141 | int symlink(const char* __old_path, const char* __new_path); |
| 142 | int symlinkat(const char* __old_path, int __new_dir_fd, const char* __new_path) __INTRODUCED_IN(21); |
| 143 | ssize_t readlink(const char* __path, char* __buf, size_t __buf_size) |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 144 | __overloadable __RENAME_CLANG(readlink); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 145 | ssize_t readlinkat(int __dir_fd, const char* __path, char* __buf, size_t __buf_size) |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 146 | __INTRODUCED_IN(21) __overloadable __RENAME_CLANG(readlinkat); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 147 | int chown(const char* __path, uid_t __owner, gid_t __group); |
| 148 | int fchown(int __fd, uid_t __owner, gid_t __group); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 149 | int fchownat(int __dir_fd, const char* __path, uid_t __owner, gid_t __group, int __flags); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 150 | int lchown(const char* __path, uid_t __owner, gid_t __group); |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 151 | char* getcwd(char* __buf, size_t __size) __overloadable __RENAME_CLANG(getcwd); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 152 | |
Elliott Hughes | 79a8f4b | 2016-11-29 15:16:08 -0800 | [diff] [blame] | 153 | void sync(void); |
Elliott Hughes | 896362e | 2017-08-24 16:31:49 -0700 | [diff] [blame] | 154 | #if defined(__USE_GNU) |
| 155 | int syncfs(int __fd) __INTRODUCED_IN_FUTURE; |
| 156 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 157 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 158 | int close(int __fd); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 159 | |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 160 | ssize_t read(int __fd, void* __buf, size_t __count) __overloadable |
| 161 | __RENAME_CLANG(read); |
| 162 | ssize_t write(int __fd, const void* __buf, size_t __count) __overloadable |
| 163 | __RENAME_CLANG(write); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 164 | |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 165 | int dup(int __old_fd); |
| 166 | int dup2(int __old_fd, int __new_fd); |
| 167 | int dup3(int __old_fd, int __new_fd, int __flags) __INTRODUCED_IN(21); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 168 | int fsync(int __fd); |
| 169 | int fdatasync(int __fd) __INTRODUCED_IN(9); |
Elliott Hughes | 68dc20d | 2015-02-06 22:28:49 -0800 | [diff] [blame] | 170 | |
Elliott Hughes | a348174 | 2017-11-28 14:47:17 -0800 | [diff] [blame^] | 171 | /* See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md */ |
Elliott Hughes | 00fedf5 | 2017-07-05 15:23:50 -0700 | [diff] [blame] | 172 | #if defined(__USE_FILE_OFFSET64) |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 173 | int truncate(const char* __path, off_t __length) __RENAME(truncate64) __INTRODUCED_IN(21); |
Elliott Hughes | a348174 | 2017-11-28 14:47:17 -0800 | [diff] [blame^] | 174 | off_t lseek(int __fd, off_t __offset, int __whence) __RENAME(lseek64); |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 175 | ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset) |
| 176 | __overloadable __RENAME(pread64) __INTRODUCED_IN(12); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 177 | ssize_t pwrite(int __fd, const void* __buf, size_t __count, off_t __offset) |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 178 | __overloadable __RENAME(pwrite64) __INTRODUCED_IN(12); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 179 | int ftruncate(int __fd, off_t __length) __RENAME(ftruncate64) __INTRODUCED_IN(12); |
Dan Albert | af4713e | 2015-09-04 12:59:53 -0700 | [diff] [blame] | 180 | #else |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 181 | int truncate(const char* __path, off_t __length); |
Elliott Hughes | a348174 | 2017-11-28 14:47:17 -0800 | [diff] [blame^] | 182 | off_t lseek(int __fd, off_t __offset, int __whence); |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 183 | ssize_t pread(int __fd, void* __buf, size_t __count, off_t __offset) |
| 184 | __overloadable __RENAME_CLANG(pread); |
| 185 | ssize_t pwrite(int __fd, const void* __buf, size_t __count, off_t __offset) |
| 186 | __overloadable __RENAME_CLANG(pwrite); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 187 | int ftruncate(int __fd, off_t __length); |
Dan Albert | af4713e | 2015-09-04 12:59:53 -0700 | [diff] [blame] | 188 | #endif |
| 189 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 190 | int truncate64(const char* __path, off64_t __length) __INTRODUCED_IN(21); |
Elliott Hughes | a348174 | 2017-11-28 14:47:17 -0800 | [diff] [blame^] | 191 | off64_t lseek64(int __fd, off64_t __offset, int __whence); |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 192 | ssize_t pread64(int __fd, void* __buf, size_t __count, off64_t __offset) |
| 193 | __INTRODUCED_IN(12) __overloadable __RENAME_CLANG(pread64); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 194 | ssize_t pwrite64(int __fd, const void* __buf, size_t __count, off64_t __offset) |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 195 | __INTRODUCED_IN(12) __overloadable __RENAME_CLANG(pwrite64); |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 196 | int ftruncate64(int __fd, off64_t __length) __INTRODUCED_IN(12); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 197 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 198 | int pause(void); |
| 199 | unsigned int alarm(unsigned int __seconds); |
| 200 | unsigned int sleep(unsigned int __seconds); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 201 | int usleep(useconds_t __microseconds); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 202 | |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 203 | int gethostname(char* __buf, size_t __buf_size); |
| 204 | int sethostname(const char* __name, size_t __n) __INTRODUCED_IN(23); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 205 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 206 | int brk(void* __addr); |
| 207 | void* sbrk(ptrdiff_t __increment); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 208 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 209 | int isatty(int __fd); |
| 210 | char* ttyname(int __fd); |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 211 | int ttyname_r(int __fd, char* __buf, size_t __buf_size) __INTRODUCED_IN(8); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 212 | |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 213 | int acct(const char* __path); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 214 | |
Elliott Hughes | 5bc78c8 | 2016-11-16 11:35:43 -0800 | [diff] [blame] | 215 | #if __ANDROID_API__ >= __ANDROID_API_L__ |
Josh Gao | b6a4a4c | 2016-07-26 16:34:40 -0700 | [diff] [blame] | 216 | int getpagesize(void) __INTRODUCED_IN(21); |
Dan Albert | af4713e | 2015-09-04 12:59:53 -0700 | [diff] [blame] | 217 | #else |
Dan Albert | a39f5d8 | 2016-09-14 17:10:26 -0700 | [diff] [blame] | 218 | static __inline__ int getpagesize(void) { |
Dan Albert | af4713e | 2015-09-04 12:59:53 -0700 | [diff] [blame] | 219 | return sysconf(_SC_PAGESIZE); |
| 220 | } |
| 221 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 222 | |
Dan Albert | af4713e | 2015-09-04 12:59:53 -0700 | [diff] [blame] | 223 | long syscall(long __number, ...); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 224 | |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 225 | int daemon(int __no_chdir, int __no_close); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 226 | |
Elliott Hughes | a6ecba4 | 2014-02-10 18:37:02 -0800 | [diff] [blame] | 227 | #if defined(__arm__) || (defined(__mips__) && !defined(__LP64__)) |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 228 | int cacheflush(long __addr, long __nbytes, long __cache); |
Elliott Hughes | a6ecba4 | 2014-02-10 18:37:02 -0800 | [diff] [blame] | 229 | /* __attribute__((deprecated("use __builtin___clear_cache instead"))); */ |
| 230 | #endif |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 231 | |
Elliott Hughes | 3b2096a | 2016-07-22 18:57:12 -0700 | [diff] [blame] | 232 | pid_t tcgetpgrp(int __fd); |
| 233 | int tcsetpgrp(int __fd, pid_t __pid); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 234 | |
Elliott Hughes | cf399f7 | 2009-10-05 13:19:05 -0700 | [diff] [blame] | 235 | /* Used to retry syscalls that can return EINTR. */ |
| 236 | #define TEMP_FAILURE_RETRY(exp) ({ \ |
Dan Albert | a7821b7 | 2014-05-21 20:33:28 -0700 | [diff] [blame] | 237 | __typeof__(exp) _rc; \ |
Elliott Hughes | cf399f7 | 2009-10-05 13:19:05 -0700 | [diff] [blame] | 238 | do { \ |
| 239 | _rc = (exp); \ |
| 240 | } while (_rc == -1 && errno == EINTR); \ |
| 241 | _rc; }) |
| 242 | |
Elliott Hughes | bda6f3b | 2017-08-25 15:07:05 -0700 | [diff] [blame] | 243 | int getdomainname(char* __buf, size_t __buf_size) __INTRODUCED_IN(26); |
| 244 | int setdomainname(const char* __name, size_t __n) __INTRODUCED_IN(26); |
Greg Hackmann | e2faf07 | 2016-03-03 08:37:53 -0800 | [diff] [blame] | 245 | |
Elliott Hughes | fa386e0 | 2017-10-18 13:34:32 -0700 | [diff] [blame] | 246 | void swab(const void* __src, void* __dst, ssize_t __byte_count) __INTRODUCED_IN_FUTURE; |
| 247 | |
George Burgess IV | b97049c | 2017-07-24 15:05:05 -0700 | [diff] [blame] | 248 | #if defined(__BIONIC_INCLUDE_FORTIFY_HEADERS) |
| 249 | #include <bits/fortify/unistd.h> |
George Burgess IV | 7cc779f | 2017-02-09 00:00:31 -0800 | [diff] [blame] | 250 | #endif |
Daniel Micay | 9101b00 | 2015-05-20 15:31:26 -0400 | [diff] [blame] | 251 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 252 | __END_DECLS |
| 253 | |
| 254 | #endif /* _UNISTD_H_ */ |