fix thread leak on timer_create(SIGEV_THREAD) failure
[musl] / include / unistd.h
index c17eace..0e8149e 100644 (file)
@@ -14,8 +14,12 @@ extern "C" {
 #define SEEK_SET 0
 #define SEEK_CUR 1
 #define SEEK_END 2
+#define SEEK_DATA 3
+#define SEEK_HOLE 4
 
-#ifdef __cplusplus
+#if __cplusplus >= 201103L
+#define NULL nullptr
+#elif defined(__cplusplus)
 #define NULL 0L
 #else
 #define NULL ((void*)0)
@@ -82,6 +86,7 @@ unsigned sleep(unsigned);
 int pause(void);
 
 pid_t fork(void);
+pid_t _Fork(void);
 int execve(const char *, char *const [], char *const []);
 int execv(const char *, char *const []);
 int execle(const char *, const char *, ...);
@@ -128,12 +133,11 @@ long fpathconf(int, int);
 long sysconf(int);
 size_t confstr(int, char *, size_t);
 
+#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define F_ULOCK 0
 #define F_LOCK  1
 #define F_TLOCK 2
 #define F_TEST  3
-
-#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 int setreuid(uid_t, uid_t);
 int setregid(gid_t, gid_t);
 int lockf(int, int, off_t);
@@ -177,6 +181,7 @@ long syscall(long, ...);
 int execvpe(const char *, char *const [], char *const []);
 int issetugid(void);
 int getentropy(void *, size_t);
+extern int optreset;
 #endif
 
 #ifdef _GNU_SOURCE
@@ -189,6 +194,8 @@ char *get_current_dir_name(void);
 int syncfs(int);
 int euidaccess(const char *, int);
 int eaccess(const char *, int);
+ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned);
+pid_t gettid(void);
 #endif
 
 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
@@ -418,6 +425,8 @@ int eaccess(const char *, int);
 #define _SC_XOPEN_STREAMS      246
 #define _SC_THREAD_ROBUST_PRIO_INHERIT 247
 #define _SC_THREAD_ROBUST_PRIO_PROTECT 248
+#define _SC_MINSIGSTKSZ        249
+#define _SC_SIGSTKSZ   250
 
 #define _CS_PATH       0
 #define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS     1
@@ -460,6 +469,8 @@ int eaccess(const char *, int);
 #define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS    1147
 #define _CS_V6_ENV     1148
 #define _CS_V7_ENV     1149
+#define _CS_POSIX_V7_THREADS_CFLAGS    1150
+#define _CS_POSIX_V7_THREADS_LDFLAGS   1151
 
 #ifdef __cplusplus
 }