summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/dlfcn.h6
-rw-r--r--include/fcntl.h2
-rw-r--r--include/iconv.h4
-rw-r--r--include/setjmp.h19
-rw-r--r--include/stdio.h51
-rw-r--r--include/stdlib.h2
-rw-r--r--include/sys/cdefs.h24
-rw-r--r--include/sys/wait.h18
-rw-r--r--include/ucontext.h6
-rw-r--r--include/unistd.h75
-rw-r--r--include/wchar.h8
-rw-r--r--libc/sysdeps/linux/common/getrusage.c1
-rw-r--r--libpthread/linuxthreads.old/semaphore.h4
-rw-r--r--libpthread/linuxthreads.old/sysdeps/pthread/pthread.h36
-rw-r--r--libpthread/linuxthreads/semaphore.h4
-rw-r--r--libpthread/linuxthreads/sysdeps/pthread/pthread.h36
-rw-r--r--libpthread/nptl/semaphore.h4
-rw-r--r--libpthread/nptl/sysdeps/pthread/pthread.h64
18 files changed, 202 insertions, 162 deletions
diff --git a/include/dlfcn.h b/include/dlfcn.h
index 41d0d6fa4..241ec5480 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -55,11 +55,11 @@ __BEGIN_DECLS
/* Open the shared object FILE and map it in; return a handle that can be
passed to `dlsym' to get symbol values from it. */
-extern void *dlopen (const char *__file, int __mode) __THROW;
+extern void *dlopen (const char *__file, int __mode) __THROWNL;
/* Unmap and close a shared object opened by `dlopen'.
The handle cannot be used again after calling `dlclose'. */
-extern int dlclose (void *__handle) __THROW __nonnull ((1));
+extern int dlclose (void *__handle) __THROWNL __nonnull ((1));
/* Find the run-time address in the shared object HANDLE refers to
of the symbol called NAME. */
@@ -68,7 +68,7 @@ extern void *dlsym (void *__restrict __handle,
#if 0 /*def __USE_GNU*/
/* Like `dlopen', but request object to be allocated in a new namespace. */
-extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) __THROW;
+extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) __THROWNL;
/* Find the run-time address in the shared object HANDLE refers to
of the symbol called NAME with VERSION. */
diff --git a/include/fcntl.h b/include/fcntl.h
index 04fc2c06d..11000ddb5 100644
--- a/include/fcntl.h
+++ b/include/fcntl.h
@@ -221,7 +221,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
/* Reserve storage for the data of the file associated with FD.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
diff --git a/include/iconv.h b/include/iconv.h
index d850de56e..5ab4c6cb9 100644
--- a/include/iconv.h
+++ b/include/iconv.h
@@ -36,7 +36,7 @@ typedef void *iconv_t;
/* Allocate descriptor for code conversion from codeset FROMCODE to
codeset TOCODE.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern iconv_t iconv_open (const char *__tocode, const char *__fromcode);
@@ -50,7 +50,7 @@ extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
/* Free resources allocated for descriptor CD for code conversion.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int iconv_close (iconv_t __cd);
diff --git a/include/setjmp.h b/include/setjmp.h
index c9501379e..71c1d35cb 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -49,19 +49,20 @@ typedef struct __jmp_buf_tag jmp_buf[1];
/* Store the calling environment in ENV, also saving the signal mask.
Return 0. */
-extern int setjmp (jmp_buf __env) __THROW;
+extern int setjmp (jmp_buf __env) __THROWNL;
__END_NAMESPACE_STD
/* Store the calling environment in ENV, also saving the
signal mask if SAVEMASK is nonzero. Return 0.
This is the internal name for `sigsetjmp'. */
-extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
+ __THROWNL;
#ifndef __FAVOR_BSD
/* Store the calling environment in ENV, not saving the signal mask.
Return 0. */
-extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROW;
+extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL;
/* Do not save the signal mask. This is equivalent to the `_setjmp'
BSD function. */
@@ -79,7 +80,7 @@ __BEGIN_NAMESPACE_STD
/* Jump to the environment saved in ENV, making the
`setjmp' call there return VAL, or 1 if VAL is 0. */
extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROW __attribute__ ((__noreturn__));
+ __THROWNL __attribute__ ((__noreturn__));
__END_NAMESPACE_STD
@@ -88,7 +89,7 @@ __END_NAMESPACE_STD
the signal mask. But it is how ENV was saved that determines whether
`longjmp' restores the mask; `_longjmp' is just an alias. */
extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROW __attribute__ ((__noreturn__));
+ __THROWNL __attribute__ ((__noreturn__));
#endif
@@ -107,16 +108,16 @@ typedef struct __jmp_buf_tag sigjmp_buf[1];
Restore the signal mask if that sigsetjmp call saved it.
This is just an alias `longjmp'. */
extern void siglongjmp (sigjmp_buf __env, int __val)
- __THROW __attribute__ ((__noreturn__));
+ __THROWNL __attribute__ ((__noreturn__));
#endif /* Use POSIX. */
__END_DECLS
#ifdef _LIBC
-extern void __longjmp(__jmp_buf __env, int __val) attribute_noreturn;
+extern void __longjmp(__jmp_buf __env, int __val) __THROWNL attribute_noreturn;
libc_hidden_proto(__longjmp)
-extern __typeof(longjmp) __libc_longjmp attribute_noreturn;
-extern __typeof(siglongjmp) __libc_siglongjmp attribute_noreturn;
+extern __typeof(longjmp) __libc_longjmp __THROWNL attribute_noreturn;
+extern __typeof(siglongjmp) __libc_siglongjmp __THROWNL attribute_noreturn;
extern void _longjmp_unwind(jmp_buf __env, int __val);
libc_hidden_proto(_longjmp_unwind)
extern int __sigjmp_save(sigjmp_buf __env, int __savemask) attribute_hidden;
diff --git a/include/stdio.h b/include/stdio.h
index 75c146482..9aae5abf4 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -157,7 +157,7 @@ libc_hidden_proto(renameat)
__BEGIN_NAMESPACE_STD
/* Create a temporary file and open it read/write.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
#ifndef __USE_FILE_OFFSET64
extern FILE *tmpfile (void) __wur;
@@ -345,8 +345,8 @@ extern int printf (const char *__restrict __format, ...);
libc_hidden_proto(printf)
/* Write formatted output to S. */
extern int sprintf (char *__restrict __s,
- const char *__restrict __format, ...)
- __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+ const char *__restrict __format, ...) __THROWNL
+ __attribute__ ((__format__ (__printf__, 2, 3)));
libc_hidden_proto(sprintf)
/* Write formatted output to S from argument list ARG.
@@ -363,8 +363,8 @@ libc_hidden_proto(vfprintf)
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
/* Write formatted output to S from argument list ARG. */
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
- __gnuc_va_list __arg)
- __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
+ __gnuc_va_list __arg) __THROWNL
+ __attribute__ ((__format__ (__printf__, 2, 0)));
__END_NAMESPACE_STD
#if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98
@@ -372,12 +372,12 @@ __BEGIN_NAMESPACE_C99
/* Maximum chars of output to write in MAXLEN. */
extern int snprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, ...)
- __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
+ __THROWNL __attribute__ ((__format__ (__printf__, 3, 4)));
libc_hidden_proto(snprintf)
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, __gnuc_va_list __arg)
- __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
+ __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));
libc_hidden_proto(vsnprintf)
__END_NAMESPACE_C99
#endif
@@ -387,26 +387,24 @@ __END_NAMESPACE_C99
Store the address of the string in *PTR. */
extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
__gnuc_va_list __arg)
- __THROW __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
+ __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
libc_hidden_proto(vasprintf)
#if 0 /* uClibc: disabled */
extern int __asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
- __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+ __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
#endif
extern int asprintf (char **__restrict __ptr,
const char *__restrict __fmt, ...)
- __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+ __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
libc_hidden_proto(asprintf)
#endif
#ifdef __USE_XOPEN2K8
/* Write formatted output to a file descriptor.
- These functions are not part of POSIX and therefore no official
- cancellation point. But due to similarity with an POSIX interface
- or due to the implementation they are cancellation points and
- therefore not marked with __THROW. */
+ This function is a possible cancellation point and therefore not
+ marked with __THROW. */
extern int vdprintf (int __fd, const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
@@ -570,12 +568,21 @@ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
__wur;
libc_hidden_proto(fgets)
+#if !defined __USE_ISOC11 \
+ || (defined __cplusplus && __cplusplus <= 201103L)
/* Get a newline-terminated string from stdin, removing the newline.
DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
+ The function has been officially removed in ISO C11. This opportunity
+ is used to also remove it from the GNU feature list. It is now only
+ available when explicitly using an old ISO C, Unix, or POSIX standard.
+ GCC defines _GNU_SOURCE when building C++ code and the function is still
+ in C++11, so it is also available for C++.
+
This function is a possible cancellation point and therefore not
marked with __THROW. */
-extern char *gets (char *__s) __wur;
+extern char *gets (char *__s) __wur __attribute_deprecated__;
+#endif
__END_NAMESPACE_STD
#ifdef __USE_GNU
@@ -628,21 +635,21 @@ libc_hidden_proto(getline)
__BEGIN_NAMESPACE_STD
/* Write a string to STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
libc_hidden_proto(fputs)
/* Write a string, followed by a newline, to stdout.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int puts (const char *__s);
/* Push a character back onto the input buffer of STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int ungetc (int __c, FILE *__stream);
libc_hidden_proto(ungetc)
@@ -650,14 +657,14 @@ libc_hidden_proto(ungetc)
/* Read chunks of generic data from STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) __wur;
libc_hidden_proto(fread)
/* Write chunks of generic data to STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) __wur;
@@ -860,11 +867,11 @@ struct obstack; /* See <obstack.h>. */
/* Write formatted output to an obstack. */
extern int obstack_printf (struct obstack *__restrict __obstack,
const char *__restrict __format, ...)
- __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
+ __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));
extern int obstack_vprintf (struct obstack *__restrict __obstack,
const char *__restrict __format,
__gnuc_va_list __args)
- __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
+ __THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));
libc_hidden_proto(obstack_vprintf)
#endif /* USE_GNU && UCLIBC_HAS_OBSTACK. */
diff --git a/include/stdlib.h b/include/stdlib.h
index b2d70204e..2065dfa2d 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -38,7 +38,7 @@ __BEGIN_DECLS
#ifndef __need_malloc_and_calloc
#define _STDLIB_H 1
-#if defined __USE_XOPEN && !defined _SYS_WAIT_H
+#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H
/* XPG requires a few symbols from <sys/wait.h> being defined. */
# include <bits/waitflags.h>
# include <bits/waitstatus.h>
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 6f81b6a7c..4da981f9a 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -37,20 +37,33 @@
#ifdef __GNUC__
+/* All functions, except those with callbacks or those that
+ synchronize memory, are leaf functions. */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+# define __LEAF , __leaf__
+# define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+# define __LEAF
+# define __LEAF_ATTR
+# endif
+
/* GCC can always grok prototypes. For C++ programs we add throw()
to help it optimize the function calls. But this works only with
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
as non-throwing using a function attribute since programs can use
the -fexceptions options for C code as well. */
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
-# define __THROW __attribute__ ((__nothrow__))
-# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+# define __THROW __attribute__ ((__nothrow__ __LEAF))
+# define __THROWNL __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
# else
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
-# define __NTH(fct) fct throw ()
+# define __THROWNL throw ()
+# define __NTH(fct) __LEAF_ATTR fct throw ()
# else
# define __THROW
+# define __THROWNL
# define __NTH(fct) fct
# endif
# endif
@@ -60,6 +73,7 @@
# define __inline /* No inline functions. */
# define __THROW
+# define __THROWNL
# define __NTH(fct) fct
#endif /* GCC. */
@@ -165,9 +179,13 @@
# ifdef __cplusplus
# define __REDIRECT_NTH(name, proto, alias) \
name proto __THROW __asm__ (__ASMNAME (#alias))
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __THROWNL __asm__ (__ASMNAME (#alias))
# else
# define __REDIRECT_NTH(name, proto, alias) \
name proto __asm__ (__ASMNAME (#alias)) __THROW
+# define __REDIRECT_NTHNL(name, proto, alias) \
+ name proto __asm__ (__ASMNAME (#alias)) __THROWNL
# endif
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
diff --git a/include/sys/wait.h b/include/sys/wait.h
index b3c2b973a..f7a420b93 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -28,10 +28,9 @@
__BEGIN_DECLS
#include <signal.h>
-#include <sys/resource.h>
/* These macros could also be defined in <stdlib.h>. */
-#if !defined _STDLIB_H || !defined __USE_XOPEN
+#if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
# include <bits/waitflags.h>
@@ -97,7 +96,7 @@ typedef union
#endif
/* The following values are used by the `waitid' function. */
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
typedef enum
{
P_ALL, /* Wait for any child. */
@@ -141,9 +140,15 @@ extern __typeof(waitpid) __waitpid_nocancel attribute_hidden;
libc_hidden_proto(waitpid)
#endif
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+# ifndef __id_t_defined
+# include <bits/types.h>
+ typedef __id_t id_t;
+# define __id_t_defined
+# endif
# define __need_siginfo_t
# include <bits/siginfo.h>
+
/* Wait for a childing matching IDTYPE and ID to change the status and
place appropriate information in *INFOP.
If IDTYPE is P_PID, match any process whose process ID is ID.
@@ -160,19 +165,20 @@ extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+struct rusage;
/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
return its process ID. For errors return (pid_t) -1. If USAGE is not
nil, store information about the child's resource usage there. If the
WUNTRACED bit is set in OPTIONS, return status for stopped children;
otherwise don't. */
extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
- struct rusage * __usage) __THROW;
+ struct rusage * __usage) __THROWNL;
#endif
#ifdef __USE_BSD
/* PID is like waitpid. Other args are like wait3. */
extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
- struct rusage *__usage) __THROW;
+ struct rusage *__usage) __THROWNL;
#endif /* Use BSD. */
#ifdef _LIBC
diff --git a/include/ucontext.h b/include/ucontext.h
index f11db7794..4ce114ef1 100644
--- a/include/ucontext.h
+++ b/include/ucontext.h
@@ -31,15 +31,15 @@
__BEGIN_DECLS
/* Get user context and store it in variable pointed to by UCP. */
-extern int getcontext (ucontext_t *__ucp) __THROW;
+extern int getcontext (ucontext_t *__ucp) __THROWNL;
/* Set user context from information of variable pointed to by UCP. */
-extern int setcontext (const ucontext_t *__ucp) __THROW;
+extern int setcontext (const ucontext_t *__ucp) __THROWNL;
/* Save current context in context variable pointed to by OUCP and set
context from variable pointed to by UCP. */
extern int swapcontext (ucontext_t *__restrict __oucp,
- const ucontext_t *__restrict __ucp) __THROW;
+ const ucontext_t *__restrict __ucp) __THROWNL;
/* Manipulate user context UCP to continue with calling functions FUNC
and the ARGC-1 parameters following ARGC when the context is used
diff --git a/include/unistd.h b/include/unistd.h
index 967e058a3..3793d2d3e 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -206,7 +206,7 @@ __BEGIN_DECLS
#include <bits/uClibc_posix_opt.h>
/* Get the environment definitions from Unix98. */
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
# include <bits/environments.h>
#endif
@@ -266,7 +266,7 @@ typedef __pid_t pid_t;
# endif
#endif /* X/Open */
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
# ifndef __intptr_t_defined
typedef __intptr_t intptr_t;
# define __intptr_t_defined
@@ -387,7 +387,7 @@ extern __typeof(write) __write_nocancel attribute_hidden;
libc_hidden_proto(write)
#endif
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
# ifndef __USE_FILE_OFFSET64
/* Read NBYTES into BUF from FD at the given position OFFSET without
changing the file pointer. Return the number read, -1 for errors
@@ -469,8 +469,9 @@ libc_hidden_proto(alarm)
extern unsigned int sleep (unsigned int __seconds);
libc_hidden_proto(sleep)
-#if (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \
- && defined __UCLIBC_SUSV3_LEGACY__
+#if (defined __USE_BSD \
+ || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8) \
+ ) && defined __UCLIBC_SUSV3_LEGACY__
/* Set an alarm to go off (generating a SIGALRM signal) in VALUE
microseconds. If INTERVAL is nonzero, when the alarm goes off, the
timer is reset to go off every INTERVAL microseconds thereafter.
@@ -500,7 +501,7 @@ extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
__THROW __nonnull ((1)) __wur;
libc_hidden_proto(chown)
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
/* Change the owner and group of the file that FD is open on. */
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur;
@@ -525,7 +526,7 @@ libc_hidden_proto(fchownat)
extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur;
libc_hidden_proto(chdir)
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
/* Change the process's working directory to the one FD is open on. */
extern int fchdir (int __fd) __THROW __wur;
libc_hidden_proto(fchdir)
@@ -548,7 +549,7 @@ libc_hidden_proto(getcwd)
extern char *get_current_dir_name (void) __THROW;
#endif
-#if 0 /*defined __USE_BSD || defined __USE_XOPEN_EXTENDED*/
+#if 0 /*defined __USE_BSD || (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8)*/
/* Put the absolute pathname of the current working directory in BUF.
If successful, return BUF. If not, put an error message in
BUF and return NULL. BUF should be at least PATH_MAX bytes long. */
@@ -581,52 +582,53 @@ extern char **environ;
/* Replace the current process, executing PATH with arguments ARGV and
environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
extern int execve (const char *__path, char *const __argv[],
- char *const __envp[]) __THROW __nonnull ((1));
+ char *const __envp[]) __THROW __nonnull ((1, 2));
libc_hidden_proto(execve)
#if 0 /*def __USE_XOPEN2K8*/
/* Execute the file FD refers to, overlaying the running program image.
ARGV and ENVP are passed to the new program, as for `execve'. */
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
- __THROW;
+ __THROW __nonnull ((2));
#endif
/* Execute PATH with arguments ARGV and environment from `environ'. */
extern int execv (const char *__path, char *const __argv[])
- __THROW __nonnull ((1));
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execv)
/* Execute PATH with all arguments after PATH until a NULL pointer,
and the argument after that for environment. */
extern int execle (const char *__path, const char *__arg, ...)
- __THROW __nonnull ((1));
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execle)
/* Execute PATH with all arguments after PATH until
a NULL pointer and environment from `environ'. */
extern int execl (const char *__path, const char *__arg, ...)
- __THROW __nonnull ((1));
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execl)
/* Execute FILE, searching in the `PATH' environment variable if it contains
no slashes, with arguments ARGV and environment from `environ'. */
extern int execvp (const char *__file, char *const __argv[])
- __THROW __nonnull ((1));
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execvp)
/* Execute FILE, searching in the `PATH' environment variable if
it contains no slashes, with all arguments after FILE until a
NULL pointer and environment from `environ'. */
extern int execlp (const char *__file, const char *__arg, ...)
- __THROW __nonnull ((1));
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execlp)
#ifdef __USE_GNU
/* Execute FILE, searching in the `PATH' environment variable if it contains
no slashes, with arguments ARGV and environment from a pointer */
-extern int execvpe (__const char *__file, char *__const __argv[], char *__const __envp[])
- __THROW __nonnull ((1));
+extern int execvpe (const char *__file, char *const __argv[],
+ char *const __envp[])
+ __THROW __nonnull ((1, 2));
libc_hidden_proto(execvpe)
#endif
@@ -685,7 +687,7 @@ extern __pid_t __REDIRECT_NTH (getpgrp, (__pid_t __pid), __getpgid);
/* Get the process group ID of process PID. */
extern __pid_t __getpgid (__pid_t __pid) __THROW;
-#ifdef __USE_XOPEN_EXTENDED
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
extern __pid_t getpgid (__pid_t __pid) __THROW;
#endif
@@ -731,7 +733,7 @@ extern int __REDIRECT_NTH (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid);
extern __pid_t setsid (void) __THROW;
libc_hidden_proto(setsid)
-#ifdef __USE_XOPEN_EXTENDED
+#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
/* Return the session ID of the given process. */
extern __pid_t getsid (__pid_t __pid) __THROW;
libc_hidden_proto(getsid)
@@ -768,37 +770,37 @@ extern int group_member (__gid_t __gid) __THROW;
If the calling process is the super-user, set the real
and effective user IDs, and the saved set-user-ID to UID;
if not, the effective user ID is set to UID. */
-extern int setuid (__uid_t __uid) __THROW;
+extern int setuid (__uid_t __uid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real user ID of the calling process to RUID,
and the effective user ID of the calling process to EUID. */
-extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW;
+extern int setreuid (__uid_t __ruid, __uid_t __euid) __THROW __wur;
libc_hidden_proto(setreuid)
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective user ID of the calling process to UID. */
-extern int seteuid (__uid_t __uid) __THROW;
+extern int seteuid (__uid_t __uid) __THROW __wur;
libc_hidden_proto(seteuid)
-#endif /* Use BSD. */
+#endif
/* Set the group ID of the calling process to GID.
If the calling process is the super-user, set the real
and effective group IDs, and the saved set-group-ID to GID;
if not, the effective group ID is set to GID. */
-extern int setgid (__gid_t __gid) __THROW;
+extern int setgid (__gid_t __gid) __THROW __wur;
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Set the real group ID of the calling process to RGID,
and the effective group ID of the calling process to EGID. */
-extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW;
+extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW __wur;
libc_hidden_proto(setregid)
#endif
#if defined __USE_BSD || defined __USE_XOPEN2K
/* Set the effective group ID of the calling process to GID. */
-extern int setegid (__gid_t __gid) __THROW;
+extern int setegid (__gid_t __gid) __THROW __wur;
#endif /* Use BSD. */
#ifdef __USE_GNU
@@ -816,14 +818,14 @@ extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid)
/* Set the real user ID, effective user ID, and saved-set user ID,
of the calling process to RUID, EUID, and SUID, respectively. */
extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid)
- __THROW;
+ __THROW __wur;
libc_hidden_proto(setresuid)
#endif
/* Set the real group ID, effective group ID, and saved-set group ID,
of the calling process to RGID, EGID, and SGID, respectively. */
extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid)
- __THROW;
+ __THROW __wur;
libc_hidden_proto(setresgid)
#endif
@@ -832,7 +834,7 @@ libc_hidden_proto(setresgid)
/* Clone the calling process, creating an exact copy.
Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
-extern __pid_t fork (void) __THROW;
+extern __pid_t fork (void) __THROWNL;
# ifdef _LIBC
# ifdef __UCLIBC_HAS_THREADS__
extern __typeof(fork) __libc_fork;
@@ -903,7 +905,7 @@ extern ssize_t readlink (const char *__restrict __path,
char *__restrict __buf, size_t __len)
__THROW __nonnull ((1, 2)) __wur;
libc_hidden_proto(readlink)
-#endif /* Use BSD. */
+#endif /* Use POSIX.1-2001. */
#ifdef __USE_ATFILE
/* Like symlink but a relative path in TO is interpreted relative to TOFD. */
@@ -944,7 +946,7 @@ extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
/* Return the login name of the user.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern char *getlogin (void);
libc_hidden_proto(getlogin)
@@ -953,7 +955,7 @@ libc_hidden_proto(getlogin)
If it cannot be determined or some other error occurred, return the error
code. Otherwise return 0.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
#endif
@@ -974,7 +976,7 @@ extern int setlogin (const char *__name) __THROW __nonnull ((1));
#endif
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Put the name of the current host in no more than LEN bytes of NAME.
The result is null-terminated if LEN is large enough for the full
name and the terminator. */
@@ -1071,6 +1073,11 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
extern int fsync (int __fd);
#endif /* Use BSD || X/Open || Unix98. */
+#if 0 /*def __USE_GNU */
+/* Make all changes done to all files on the file system associated
+ * with FD actually appear on disk. */
+extern int syncfs (int __fd) __THROW;
+#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -1263,7 +1270,7 @@ extern void swab (const void *__restrict __from, void *__restrict __to,
/* The Single Unix specification demands this prototype to be here.
It is also found in <stdio.h>. */
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN && !defined __USE_XOPEN2K
/* Return the name of the controlling terminal. */
extern char *ctermid (char *__s) __THROW;
#endif
diff --git a/include/wchar.h b/include/wchar.h
index 4ddd258f0..67f44b763 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -660,7 +660,7 @@ extern wint_t putwc (wchar_t __wc, __FILE *__stream);
/* Write a character to stdout.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern wint_t putwchar (wchar_t __wc);
@@ -668,14 +668,14 @@ extern wint_t putwchar (wchar_t __wc);
/* Get a newline-terminated wide character string of finite length
from STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
__FILE *__restrict __stream);
/* Write a string to STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern int fputws (const wchar_t *__restrict __ws,
__FILE *__restrict __stream);
@@ -684,7 +684,7 @@ libc_hidden_proto(fputws)
/* Push a character back onto the input buffer of STREAM.
- This function is a possible cancellation points and therefore not
+ This function is a possible cancellation point and therefore not
marked with __THROW. */
extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
libc_hidden_proto(ungetwc)
diff --git a/libc/sysdeps/linux/common/getrusage.c b/libc/sysdeps/linux/common/getrusage.c
index 3e719f294..fb7614be8 100644
--- a/libc/sysdeps/linux/common/getrusage.c
+++ b/libc/sysdeps/linux/common/getrusage.c
@@ -10,4 +10,5 @@
#include <sys/syscall.h>
#include <unistd.h>
#include <wait.h>
+#include <sys/resource.h>
_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *, usage)
diff --git a/libpthread/linuxthreads.old/semaphore.h b/libpthread/linuxthreads.old/semaphore.h
index 9a9b72c9e..3924a471d 100644
--- a/libpthread/linuxthreads.old/semaphore.h
+++ b/libpthread/linuxthreads.old/semaphore.h
@@ -82,10 +82,10 @@ extern int sem_timedwait (sem_t *__restrict __sem,
#endif
/* Test whether SEM is posted. */
-extern int sem_trywait (sem_t *__sem) __THROW;
+extern int sem_trywait (sem_t *__sem) __THROWNL;
/* Post SEM. */
-extern int sem_post (sem_t *__sem) __THROW;
+extern int sem_post (sem_t *__sem) __THROWNL;
/* Get current value of SEM and store it in *SVAL. */
extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
diff --git a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h
index 46c1010c6..879bcea4e 100644
--- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h
@@ -163,7 +163,7 @@ enum
extern int pthread_create (pthread_t *__restrict __threadp,
const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
- void *__restrict __arg) __THROW;
+ void *__restrict __arg) __THROWNL;
/* Obtain the identifier of the current thread. */
extern pthread_t pthread_self (void) __THROW;
@@ -340,20 +340,20 @@ extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW;
/* Try to lock MUTEX. */
-extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROWNL;
/* Wait until lock for MUTEX becomes available and lock it. */
-extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROWNL;
#ifdef __USE_XOPEN2K
/* Wait until lock becomes available, or specified time passes. */
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
#endif
/* Unlock MUTEX. */
-extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROWNL;
/* Functions for handling mutex attributes. */
@@ -401,11 +401,11 @@ extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW;
libpthread_hidden_proto(pthread_cond_destroy)
/* Wake up one thread waiting for condition variable COND. */
-extern int pthread_cond_signal (pthread_cond_t *__cond) __THROW;
+extern int pthread_cond_signal (pthread_cond_t *__cond) __THROWNL;
libpthread_hidden_proto(pthread_cond_signal)
/* Wake up all threads waiting for condition variables COND. */
-extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW;
+extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROWNL;
libpthread_hidden_proto(pthread_cond_broadcast)
/* Wait for condition variable COND to be signaled or broadcast.
@@ -457,33 +457,33 @@ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW;
/* Acquire read lock for RWLOCK. */
-extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Try to acquire read lock for RWLOCK. */
-extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL;
# ifdef __USE_XOPEN2K
/* Try to acquire read lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
# endif
/* Acquire write lock for RWLOCK. */
-extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Try to acquire write lock for RWLOCK. */
-extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL;
# ifdef __USE_XOPEN2K
/* Try to acquire write lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
# endif
/* Unlock RWLOCK. */
-extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Functions for handling read-write lock attributes. */
@@ -528,13 +528,13 @@ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW;
/* Wait until spinlock LOCK is retrieved. */
-extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROWNL;
/* Try to lock spinlock LOCK. */
-extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROWNL;
/* Release spinlock LOCK. */
-extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROWNL;
/* Barriers are a also a new feature in 1003.1j-2000. */
@@ -556,7 +556,7 @@ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
int __pshared) __THROW;
-extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROW;
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROWNL;
#endif
#endif
diff --git a/libpthread/linuxthreads/semaphore.h b/libpthread/linuxthreads/semaphore.h
index 7f3dbadfb..7ab772bfa 100644
--- a/libpthread/linuxthreads/semaphore.h
+++ b/libpthread/linuxthreads/semaphore.h
@@ -82,10 +82,10 @@ extern int sem_timedwait (sem_t *__restrict __sem,
#endif
/* Test whether SEM is posted. */
-extern int sem_trywait (sem_t *__sem) __THROW;
+extern int sem_trywait (sem_t *__sem) __THROWNL;
/* Post SEM. */
-extern int sem_post (sem_t *__sem) __THROW;
+extern int sem_post (sem_t *__sem) __THROWNL;
/* Get current value of SEM and store it in *SVAL. */
extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
index 94ed95c99..df01c111f 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
@@ -163,7 +163,7 @@ enum
extern int pthread_create (pthread_t *__restrict __threadp,
const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
- void *__restrict __arg) __THROW;
+ void *__restrict __arg) __THROWNL;
/* Obtain the identifier of the current thread. */
extern pthread_t pthread_self (void) __THROW;
@@ -331,20 +331,20 @@ extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW;
/* Try to lock MUTEX. */
-extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROWNL;
/* Wait until lock for MUTEX becomes available and lock it. */
-extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROWNL;
#ifdef __USE_XOPEN2K
/* Wait until lock becomes available, or specified time passes. */
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
#endif
/* Unlock MUTEX. */
-extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROWNL;
/* Functions for handling mutex attributes. */
@@ -390,10 +390,10 @@ extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW;
/* Wake up one thread waiting for condition variable COND. */
-extern int pthread_cond_signal (pthread_cond_t *__cond) __THROW;
+extern int pthread_cond_signal (pthread_cond_t *__cond) __THROWNL;
/* Wake up all threads waiting for condition variables COND. */
-extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW;
+extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROWNL;
/* Wait for condition variable COND to be signaled or broadcast.
MUTEX is assumed to be locked before. */
@@ -440,33 +440,33 @@ extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW;
/* Acquire read lock for RWLOCK. */
-extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Try to acquire read lock for RWLOCK. */
-extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROWNL;
# ifdef __USE_XOPEN2K
/* Try to acquire read lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
# endif
/* Acquire write lock for RWLOCK. */
-extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Try to acquire write lock for RWLOCK. */
-extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROWNL;
# ifdef __USE_XOPEN2K
/* Try to acquire write lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW;
+ __abstime) __THROWNL;
# endif
/* Unlock RWLOCK. */
-extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROW;
+extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __THROWNL;
/* Functions for handling read-write lock attributes. */
@@ -508,13 +508,13 @@ extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __THROW;
/* Wait until spinlock LOCK is retrieved. */
-extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_lock (pthread_spinlock_t *__lock) __THROWNL;
/* Try to lock spinlock LOCK. */
-extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __THROWNL;
/* Release spinlock LOCK. */
-extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW;
+extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROWNL;
/* Barriers are a also a new feature in 1003.1j-2000. */
@@ -536,7 +536,7 @@ extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *
extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
int __pshared) __THROW;
-extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROW;
+extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __THROWNL;
#endif
diff --git a/libpthread/nptl/semaphore.h b/libpthread/nptl/semaphore.h
index aa0f9294e..c7f195bdf 100644
--- a/libpthread/nptl/semaphore.h
+++ b/libpthread/nptl/semaphore.h
@@ -63,10 +63,10 @@ extern int sem_timedwait (sem_t *__restrict __sem,
#endif
/* Test whether SEM is posted. */
-extern int sem_trywait (sem_t *__sem) __THROW;
+extern int sem_trywait (sem_t *__sem) __THROWNL;
/* Post SEM. */
-extern int sem_post (sem_t *__sem) __THROW;
+extern int sem_post (sem_t *__sem) __THROWNL;
/* Get current value of SEM and store it in *SVAL. */
extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
diff --git a/libpthread/nptl/sysdeps/pthread/pthread.h b/libpthread/nptl/sysdeps/pthread/pthread.h
index 896fb1bf5..4103a06ad 100644
--- a/libpthread/nptl/sysdeps/pthread/pthread.h
+++ b/libpthread/nptl/sysdeps/pthread/pthread.h
@@ -229,7 +229,7 @@ __BEGIN_DECLS
extern int pthread_create (pthread_t *__restrict __newthread,
const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
- void *__restrict __arg) __THROW __nonnull ((1, 3));
+ void *__restrict __arg) __THROWNL __nonnull ((1, 3));
/* Terminate calling thread.
@@ -271,7 +271,8 @@ extern int pthread_detach (pthread_t __th) __THROW;
extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
/* Compare two thread identifiers. */
-extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
+extern int pthread_equal (pthread_t __thread1, pthread_t __thread2)
+ __THROW __attribute__ ((__const__));
/* Thread attribute handling. */
@@ -308,8 +309,7 @@ extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
/* Return in *PARAM the scheduling parameters of *ATTR. */
-extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict
- __attr,
+extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
struct sched_param *__restrict __param)
__THROW __nonnull ((1, 2));
@@ -643,9 +643,9 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
__pthread_unwind_buf_t __cancel_buf; \
void (*__cancel_routine) (void *) = (routine); \
void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
+ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
__cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
+ if (__builtin_expect (__not_first_call, 0)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
@@ -678,9 +678,9 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
__pthread_unwind_buf_t __cancel_buf; \
void (*__cancel_routine) (void *) = (routine); \
void *__cancel_arg = (arg); \
- int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
+ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \
__cancel_buf.__cancel_jmp_buf, 0); \
- if (__builtin_expect (not_first_call, 0)) \
+ if (__builtin_expect (__not_first_call, 0)) \
{ \
__cancel_routine (__cancel_arg); \
__pthread_unwind_next (&__cancel_buf); \
@@ -717,7 +717,7 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
/* Function used in the macros. */
struct __jmp_buf_tag;
-extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL;
/* Mutex handling. */
@@ -733,22 +733,22 @@ extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
/* Try locking a mutex. */
extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Lock a mutex. */
extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
#ifdef __USE_XOPEN2K
/* Wait until lock becomes available, or specified time passes. */
extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
+ __abstime) __THROWNL __nonnull ((1, 2));
#endif
/* Unlock a mutex. */
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Get the priority ceiling of MUTEX. */
@@ -872,37 +872,37 @@ extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
/* Acquire read lock for RWLOCK. */
extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Try to acquire read lock for RWLOCK. */
extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
# ifdef __USE_XOPEN2K
/* Try to acquire read lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
+ __abstime) __THROWNL __nonnull ((1, 2));
# endif
/* Acquire write lock for RWLOCK. */
extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Try to acquire write lock for RWLOCK. */
extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
# ifdef __USE_XOPEN2K
/* Try to acquire write lock for RWLOCK or return after specfied time. */
extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
const struct timespec *__restrict
- __abstime) __THROW __nonnull ((1, 2));
+ __abstime) __THROWNL __nonnull ((1, 2));
# endif
/* Unlock RWLOCK. */
extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Functions for handling read-write lock attributes. */
@@ -943,8 +943,8 @@ extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
/* Initialize condition variable COND using attributes ATTR, or use
the default values if later is NULL. */
extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
- const pthread_condattr_t *__restrict
- __cond_attr) __THROW __nonnull ((1));
+ const pthread_condattr_t *__restrict __cond_attr)
+ __THROW __nonnull ((1));
/* Destroy condition variable COND. */
extern int pthread_cond_destroy (pthread_cond_t *__cond)
@@ -952,11 +952,11 @@ extern int pthread_cond_destroy (pthread_cond_t *__cond)
/* Wake up one thread waiting for condition variable COND. */
extern int pthread_cond_signal (pthread_cond_t *__cond)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Wake up all threads waiting for condition variables COND. */
extern int pthread_cond_broadcast (pthread_cond_t *__cond)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Wait for condition variable COND to be signaled or broadcast.
MUTEX is assumed to be locked before.
@@ -976,8 +976,8 @@ extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
__THROW. */
extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
pthread_mutex_t *__restrict __mutex,
- const struct timespec *__restrict
- __abstime) __nonnull ((1, 2, 3));
+ const struct timespec *__restrict __abstime)
+ __nonnull ((1, 2, 3));
/* Functions for handling condition variable attributes. */
@@ -1000,13 +1000,13 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
int __pshared) __THROW __nonnull ((1));
#ifdef __USE_XOPEN2K
-/* Get the clock selected for the conditon variable attribute ATTR. */
+/* Get the clock selected for the condition variable attribute ATTR. */
extern int pthread_condattr_getclock (const pthread_condattr_t *
__restrict __attr,
__clockid_t *__restrict __clock_id)
__THROW __nonnull ((1, 2));
-/* Set the clock selected for the conditon variable attribute ATTR. */
+/* Set the clock selected for the condition variable attribute ATTR. */
extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
__clockid_t __clock_id)
__THROW __nonnull ((1));
@@ -1027,15 +1027,15 @@ extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
/* Wait until spinlock LOCK is retrieved. */
extern int pthread_spin_lock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Try to lock spinlock LOCK. */
extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Release spinlock LOCK. */
extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Functions to handle barriers. */
@@ -1053,7 +1053,7 @@ extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
/* Wait on barrier BARRIER. */
extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
- __THROW __nonnull ((1));
+ __THROWNL __nonnull ((1));
/* Initialize barrier attribute ATTR. */