diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-03-12 15:53:03 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2023-05-05 21:21:39 -0500 |
commit | bc4d9cb354363141247f7bc6ab8b0fee563dae97 (patch) | |
tree | 8bb03aab79fcc68bbc37a4ffe9e956652ab5b4d6 | |
parent | cf01e033fb7bd0322af3bb11881ae2656f50ab48 (diff) | |
download | musl-bc4d9cb354363141247f7bc6ab8b0fee563dae97.tar.gz musl-bc4d9cb354363141247f7bc6ab8b0fee563dae97.tar.bz2 musl-bc4d9cb354363141247f7bc6ab8b0fee563dae97.tar.xz musl-bc4d9cb354363141247f7bc6ab8b0fee563dae97.zip |
unistd: namespace pollution fixes
These interfaces are all scheduled for addition in Issue 8.
They cannot be available if _XOPEN_SOURCE is <= 700, or
_POSIX_C_SOURCE is <= 200809L.
-rw-r--r-- | include/unistd.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/unistd.h b/include/unistd.h index 0ee0e922..e6bf2ca7 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -37,16 +37,23 @@ extern "C" { #include <bits/alltypes.h> int pipe(int [2]); -int pipe2(int [2], int); int close(int); -int posix_close(int, int); int dup(int); int dup2(int, int); -int dup3(int, int, int); off_t lseek(int, off_t, int); int fsync(int); int fdatasync(int); +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \ + || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 > 700) \ + || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 > 200809L) +int pipe2(int [2], int); +int dup3(int, int, int); +int posix_close(int, int); + +#define POSIX_CLOSE_RESTART 0 +#endif + ssize_t read(int, void *, size_t); ssize_t write(int, const void *, size_t); ssize_t pread(int, void *, size_t, off_t); @@ -208,8 +215,6 @@ pid_t gettid(void); #define off64_t off_t #endif -#define POSIX_CLOSE_RESTART 0 - #define _XOPEN_VERSION 700 #define _XOPEN_UNIX 1 #define _XOPEN_ENH_I18N 1 |