about summary refs log tree commit diff
path: root/include/unistd.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-08-15 15:35:32 -0400
committerRich Felker <dalias@aerifal.cx>2012-08-15 15:35:32 -0400
commit3f80afc50577dada3940b66ef5b67da2f43cc00a (patch)
treef003e434702753eaf0441b5791e687d13c4dbbb8 /include/unistd.h
parent7650390de8f72822ec0d4a9fb5b52efcf0be4698 (diff)
downloadmusl-3f80afc50577dada3940b66ef5b67da2f43cc00a.tar.gz
musl-3f80afc50577dada3940b66ef5b67da2f43cc00a.tar.xz
musl-3f80afc50577dada3940b66ef5b67da2f43cc00a.zip
improve headers to better deal with removed-in-posix-2008 features
with this patch, setting _POSIX_SOURCE, or setting _POSIX_C_SOURCE or
_XOPEN_SOURCE to an old version, will bring back the interfaces that
were removed in POSIX 2008 - at least the ones i've covered so far,
which are gethostby*, usleep, and ualarm. if there are other functions
still in widespread use that were removed for which similar changes
would be beneficial, they can be added just like this.
Diffstat (limited to 'include/unistd.h')
-rw-r--r--include/unistd.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/unistd.h b/include/unistd.h
index 17fe5e7c..12d153b8 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -144,6 +144,12 @@ void encrypt(char *, int);
 void swab(const void *, void *, ssize_t);
 #endif
 
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
+ || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE < 700)
+int usleep(unsigned);
+unsigned ualarm(unsigned, unsigned);
+#endif
+
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define L_SET 0
 #define L_INCR 1
@@ -157,8 +163,6 @@ int getpagesize(void);
 int getdtablesize(void);
 int sethostname(const char *, size_t);
 int getdomainname(char *, size_t);
-int usleep(unsigned);
-unsigned ualarm(unsigned, unsigned);
 int setgroups(size_t, const gid_t []);
 char *getpass(const char *);
 int daemon(int, int);