aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--include/sys/time.h4
-rw-r--r--inet/arpa/inet.h8
-rw-r--r--io/sys/stat.h18
-rw-r--r--io/sys/statvfs.h9
-rw-r--r--libio/stdio.h2
-rw-r--r--linuxthreads/ChangeLog6
-rw-r--r--linuxthreads/semaphore.h6
-rw-r--r--linuxthreads/sysdeps/pthread/pthread.h128
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/bits/sigthread.h9
-rw-r--r--misc/search.h3
-rw-r--r--misc/sys/cdefs.h6
-rw-r--r--misc/sys/select.h24
-rw-r--r--posix/glob.h23
-rw-r--r--posix/regex.h10
-rw-r--r--posix/spawn.h64
-rw-r--r--posix/unistd.h6
-rw-r--r--rt/aio.h9
-rw-r--r--signal/signal.h28
-rw-r--r--socket/sys/socket.h27
-rw-r--r--stdlib/ucontext.h5
-rw-r--r--streams/stropts.h10
-rw-r--r--string/string.h3
-rw-r--r--time/sys/time.h7
-rw-r--r--time/time.h12
25 files changed, 287 insertions, 166 deletions
diff --git a/ChangeLog b/ChangeLog
index b137f794bc..ccffcd7873 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
2000-08-20 Ulrich Drepper <drepper@redhat.com>
+ * misc/sys/cdefs.h: Define __restrict_arr.
+ * include/sys/time.h: Add restrict where required by AGd4.
+ * inet/arpa/inet.h: Likewise.
+ * io/sys/stat.h: Likewise.
+ * io/sys/statvfs.h: Likewise.
+ * misc/search.h: Likewise.
+ * misc/sys/select.h: Likewise.
+ * posix/glob.h: Likewise.
+ * posix/regex.h: Likewise.
+ * posix/spawn.h: Likewise.
+ * posix/unistd.h: Likewise.
+ * rt/aio.h: Likewise.
+ * signal/signal.h: Likewise.
+ * socket/sys/socket.h: Likewise.
+ * stdlib/ucontext.h: Likewise.
+ * streams/stropts.h: Likewise.
+ * string/string.h: Likewise.
+ * time/time.h: Likewise.
+ * time/sys/time.h: Likewise.
+
+ * posix/spawn.h: Add declarations for posix_spawnattr_getscheparam
+ and posix_spawnattr_setscheparam.
+
+ * libio/stdio.h: Make cuserid prototype again available for all
+ XPG versions.
+
* argp/argp-help.c: Unify use of function aliases to make more compact
PLT.
* include/libintl.h: Likewise.
diff --git a/include/sys/time.h b/include/sys/time.h
index e21cca43ec..0350573b6b 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -11,7 +11,7 @@ extern int __adjtime (__const struct timeval *__delta,
extern int __getitimer (enum __itimer_which __which,
struct itimerval *__value);
extern int __setitimer (enum __itimer_which __which,
- __const struct itimerval *__new,
- struct itimerval *__old);
+ __const struct itimerval *__restrict __new,
+ struct itimerval *__restrict __old);
extern int __utimes (__const char *__file, const struct timeval __tvp[2]);
#endif
diff --git a/inet/arpa/inet.h b/inet/arpa/inet.h
index 72a90ba3da..a9381de6da 100644
--- a/inet/arpa/inet.h
+++ b/inet/arpa/inet.h
@@ -51,13 +51,15 @@ extern char *inet_ntoa (struct in_addr __in) __THROW;
/* Convert from presentation format of an Internet number in buffer
starting at CP to the binary network format and store result for
interface type AF in buffer starting at BUF. */
-extern int inet_pton (int __af, __const char *__cp, void *__buf) __THROW;
+extern int inet_pton (int __af, __const char *__restrict __cp,
+ void *__restrict __buf) __THROW;
/* Convert a Internet address in binary network format for interface
type AF in buffer starting at CP to presentation form and place
result in buffer of length LEN astarting at BUF. */
-extern __const char *inet_ntop (int __af, __const void *__cp,
- char *__buf, socklen_t __len) __THROW;
+extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
+ char *__restrict __buf, socklen_t __len)
+ __THROW;
/* The following functions are not part of XNS 5.2. */
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 7a8c8b3e1e..32268a0b43 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -196,7 +196,8 @@ __BEGIN_DECLS
#ifndef __USE_FILE_OFFSET64
/* Get file attributes for FILE and put them in BUF. */
-extern int stat (__const char *__file, struct stat *__buf) __THROW;
+extern int stat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW;
/* Get file attributes for the file, device, pipe, or socket
that file descriptor FD is open on and put them in BUF. */
@@ -204,7 +205,8 @@ extern int fstat (int __fd, struct stat *__buf) __THROW;
#else
# ifdef __REDIRECT
extern int __REDIRECT (stat,
- (__const char *__file, struct stat *__buf) __THROW,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW,
stat64);
extern int __REDIRECT (fstat, (int __fd, struct stat *__buf) __THROW, fstat64);
# else
@@ -213,7 +215,8 @@ extern int __REDIRECT (fstat, (int __fd, struct stat *__buf) __THROW, fstat64);
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int stat64 (__const char *__file, struct stat64 *__buf) __THROW;
+extern int stat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW;
extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
#endif
@@ -221,18 +224,21 @@ extern int fstat64 (int __fd, struct stat64 *__buf) __THROW;
# ifndef __USE_FILE_OFFSET64
/* Get file attributes about FILE and put them in BUF.
If FILE is a symbolic link, do not follow it. */
-extern int lstat (__const char *__file, struct stat *__buf) __THROW;
+extern int lstat (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW;
# else
# ifdef __REDIRECT
extern int __REDIRECT (lstat,
- (__const char *__file, struct stat *__buf) __THROW,
+ (__const char *__restrict __file,
+ struct stat *__restrict __buf) __THROW,
lstat64);
# else
# define lstat lstat64
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int lstat64 (__const char *__file, struct stat64 *__buf) __THROW;
+extern int lstat64 (__const char *__restrict __file,
+ struct stat64 *__restrict __buf) __THROW;
# endif
#endif
diff --git a/io/sys/statvfs.h b/io/sys/statvfs.h
index 71335f324f..9134cb4cd9 100644
--- a/io/sys/statvfs.h
+++ b/io/sys/statvfs.h
@@ -49,18 +49,21 @@ __BEGIN_DECLS
/* Return information about the filesystem on which FILE resides. */
#ifndef __USE_FILE_OFFSET64
-extern int statvfs (__const char *__file, struct statvfs *__buf) __THROW;
+extern int statvfs (__const char *__restrict __file,
+ struct statvfs *__restrict __buf) __THROW;
#else
# ifdef __REDIRECT
extern int __REDIRECT (statvfs,
- (__const char *__file, struct statvfs *__buf) __THROW,
+ (__const char *__restrict __file,
+ struct statvfs *__restrict __buf) __THROW,
statvfs64);
# else
# define statvfs statvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int statvfs64 (__const char *__file, struct statvfs64 *__buf) __THROW;
+extern int statvfs64 (__const char *__restrict __file,
+ struct statvfs64 *__restrict __buf) __THROW;
#endif
/* Return information about the filesystem containing the file FILDES
diff --git a/libio/stdio.h b/libio/stdio.h
index b43826e037..7a18261586 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -581,7 +581,7 @@ extern char *ctermid (char *__s) __THROW;
#endif /* Use POSIX. */
-#if defined __USE_XOPEN && !defined __USE_XOPEN2K
+#ifdef __USE_XOPEN
/* Return the name of the current user. */
extern char *cuserid (char *__s) __THROW;
#endif /* Use X/Open, but not issue 6. */
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 187d3a571b..498cebb415 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-20 Ulrich Drepper <drepper@redhat.com>
+
+ * semaphore.h: Add restrict where required by AGd4.
+ * sysdeps/pthread/pthread.h: Likewise.
+ * sysdeps/pthread/unix/sysv/linux/bits/sigthread.h: Likewise.
+
2000-08-15 Ulrich Drepper <drepper@redhat.com>
* Makefile (tests): Add ex12. Add rule to build it.
diff --git a/linuxthreads/semaphore.h b/linuxthreads/semaphore.h
index 583b65ea18..f611f48323 100644
--- a/linuxthreads/semaphore.h
+++ b/linuxthreads/semaphore.h
@@ -72,7 +72,8 @@ extern int sem_wait (sem_t *__sem) __THROW;
#ifdef __USE_XOPEN2K
/* Similar to `sem_wait' but wait only until ABSTIME. */
-extern int sem_timedwait (sem_t *__sem, __const struct timespec *__abstime)
+extern int sem_timedwait (sem_t *__restrict __sem,
+ __const struct timespec *__restrict __abstime)
__THROW;
#endif
@@ -83,7 +84,8 @@ extern int sem_trywait (sem_t *__sem) __THROW;
extern int sem_post (sem_t *__sem) __THROW;
/* Get current value of SEM and store it in *SVAL. */
-extern int sem_getvalue (sem_t *__sem, int *__sval) __THROW;
+extern int sem_getvalue (sem_t *__restrict __sem, int *__restrict __sval)
+ __THROW;
__END_DECLS
diff --git a/linuxthreads/sysdeps/pthread/pthread.h b/linuxthreads/sysdeps/pthread/pthread.h
index b017007f80..28c8354b37 100644
--- a/linuxthreads/sysdeps/pthread/pthread.h
+++ b/linuxthreads/sysdeps/pthread/pthread.h
@@ -155,10 +155,10 @@ enum
/* Create a thread with given attributes ATTR (or default attributes
if ATTR is NULL), and call function START_ROUTINE with given
arguments ARG. */
-extern int pthread_create (pthread_t *__thread,
- __const pthread_attr_t *__attr,
+extern int pthread_create (pthread_t *__restrict __thread,
+ __const pthread_attr_t *__restrict __attr,
void *(*__start_routine) (void *),
- void *__arg) __THROW;
+ void *__restrict __arg) __THROW;
/* Obtain the identifier of the current thread. */
extern pthread_t pthread_self (void) __THROW;
@@ -201,37 +201,41 @@ extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
int *__detachstate) __THROW;
/* Set scheduling parameters (priority, etc) in *ATTR according to PARAM. */
-extern int pthread_attr_setschedparam (pthread_attr_t *__attr,
- __const struct sched_param *__param)
- __THROW;
+extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
+ __const struct sched_param *__restrict
+ __param) __THROW;
/* Return in *PARAM the scheduling parameters of *ATTR. */
-extern int pthread_attr_getschedparam (__const pthread_attr_t *__attr,
- struct sched_param *__param) __THROW;
+extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
+ __attr,
+ struct sched_param *__restrict __param)
+ __THROW;
/* Set scheduling policy in *ATTR according to POLICY. */
extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
__THROW;
/* Return in *POLICY the scheduling policy of *ATTR. */
-extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__attr,
- int *__policy) __THROW;
+extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __policy)
+ __THROW;
/* Set scheduling inheritance mode in *ATTR according to INHERIT. */
extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
int __inherit) __THROW;
/* Return in *INHERIT the scheduling inheritance mode of *ATTR. */
-extern int pthread_attr_getinheritsched (__const pthread_attr_t *__attr,
- int *__inherit) __THROW;
+extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
+ __attr, int *__restrict __inherit)
+ __THROW;
/* Set scheduling contention scope in *ATTR according to SCOPE. */
extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
__THROW;
/* Return in *SCOPE the scheduling contention scope of *ATTR. */
-extern int pthread_attr_getscope (__const pthread_attr_t *__attr,
- int *__scope) __THROW;
+extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
+ int *__restrict __scope) __THROW;
#ifdef __USE_UNIX98
/* Set the size of the guard area at the bottom of the thread. */
@@ -239,8 +243,9 @@ extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
size_t __guardsize) __THROW;
/* Get the size of the guard area at the bottom of the thread. */
-extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
- size_t *__guardsize) __THROW;
+extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __guardsize)
+ __THROW;
#endif
/* Set the starting address of the stack of the thread to be created.
@@ -251,8 +256,9 @@ extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
void *__stackaddr) __THROW;
/* Return the previously set address for the stack. */
-extern int pthread_attr_getstackaddr (__const pthread_attr_t *__attr,
- void **__stackaddr) __THROW;
+extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
+ __attr, void **__restrict __stackaddr)
+ __THROW;
/* Add information about the minimum stack size needed for the thread
to be started. This size must never be less than PTHREAD_STACK_SIZE
@@ -261,8 +267,9 @@ extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
size_t __stacksize) __THROW;
/* Return the currently used minimal stack size. */
-extern int pthread_attr_getstacksize (__const pthread_attr_t *__attr,
- size_t *__stacksize) __THROW;
+extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
+ __attr, size_t *__restrict __stacksize)
+ __THROW;
/* Functions for scheduling control. */
@@ -273,8 +280,10 @@ extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
__THROW;
/* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */
-extern int pthread_getschedparam (pthread_t __target_thread, int *__policy,
- struct sched_param *__param) __THROW;
+extern int pthread_getschedparam (pthread_t __target_thread,
+ int *__restrict __policy,
+ struct sched_param *__restrict __param)
+ __THROW;
#ifdef __USE_UNIX98
/* Determine level of concurrency. */
@@ -296,9 +305,9 @@ extern int pthread_yield (void) __THROW;
/* Initialize MUTEX using attributes in *MUTEX_ATTR, or use the
default values if later is NULL. */
-extern int pthread_mutex_init (pthread_mutex_t *__mutex,
- __const pthread_mutexattr_t *__mutex_attr)
- __THROW;
+extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
+ __const pthread_mutexattr_t *__restrict
+ __mutex_attr) __THROW;
/* Destroy MUTEX. */
extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __THROW;
@@ -311,9 +320,9 @@ extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW;
#ifdef __USE_XOPEN2K
/* Wait until lock becomes available, or specified time passes. */
-extern int pthread_mutex_timedlock (pthread_mutex_t *__mutex,
- __const struct timespec *__abstime)
- __THROW;
+extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
#endif
/* Unlock MUTEX. */
@@ -330,8 +339,9 @@ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW;
extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW;
/* Get the process-shared flag of the mutex attribute ATTR. */
-extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *__attr,
- int *__pshared) __THROW;
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
/* Set the process-shared flag of the mutex attribute ATTR. */
extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
@@ -345,8 +355,8 @@ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
__THROW;
/* Return in *KIND the mutex kind attribute in *ATTR. */
-extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__attr,
- int *__kind) __THROW;
+extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
+ __attr, int *__restrict __kind) __THROW;
#endif
@@ -354,8 +364,9 @@ extern int pthread_mutexattr_gettype (__const pthread_mutexattr_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 *__cond,
- __const pthread_condattr_t *__cond_attr) __THROW;
+extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
+ __const pthread_condattr_t *__restrict
+ __cond_attr) __THROW;
/* Destroy condition variable COND. */
extern int pthread_cond_destroy (pthread_cond_t *__cond) __THROW;
@@ -368,16 +379,17 @@ extern int pthread_cond_broadcast (pthread_cond_t *__cond) __THROW;
/* Wait for condition variable COND to be signaled or broadcast.
MUTEX is assumed to be locked before. */
-extern int pthread_cond_wait (pthread_cond_t *__cond,
- pthread_mutex_t *__mutex) __THROW;
+extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex) __THROW;
/* Wait for condition variable COND to be signaled or broadcast until
ABSTIME. MUTEX is assumed to be locked before. ABSTIME is an
absolute time specification; zero is the beginning of the epoch
(00:00:00 GMT, January 1, 1970). */
-extern int pthread_cond_timedwait (pthread_cond_t *__cond,
- pthread_mutex_t *__mutex,
- __const struct timespec *__abstime) __THROW;
+extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
+ pthread_mutex_t *__restrict __mutex,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
/* Functions for handling condition variable attributes. */
@@ -388,8 +400,9 @@ extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW;
extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW;
/* Get the process-shared flag of the condition variable attribute ATTR. */
-extern int pthread_condattr_getpshared (__const pthread_condattr_t *__attr,
- int *__pshared) __THROW;
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
/* Set the process-shared flag of the condition variable attribute ATTR. */
extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
@@ -401,8 +414,9 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
/* Initialize read-write lock RWLOCK using attributes ATTR, or use
the default values if later is NULL. */
-extern int pthread_rwlock_init (pthread_rwlock_t *__rwlock,
- __const pthread_rwlockattr_t *__attr) __THROW;
+extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
+ __const pthread_rwlockattr_t *__restrict
+ __attr) __THROW;
/* Destroy read-write lock RWLOCK. */
extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __THROW;
@@ -415,9 +429,9 @@ extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __THROW;
#ifdef __USE_XOPEN2K
/* Try to acquire read lock for RWLOCK or return after specfied time. */
-extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__rwlock,
- __const struct timespec *__abstime)
- __THROW;
+extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
#endif
/* Acquire write lock for RWLOCK. */
@@ -428,9 +442,9 @@ extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __THROW;
#ifdef __USE_XOPEN2K
/* Try to acquire write lock for RWLOCK or return after specfied time. */
-extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock,
- __const struct timespec *__abstime)
- __THROW;
+extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
+ __const struct timespec *__restrict
+ __abstime) __THROW;
#endif
/* Unlock RWLOCK. */
@@ -446,8 +460,9 @@ extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __THROW;
extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __THROW;
/* Return current setting of process-shared attribute of ATTR in PSHARED. */
-extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *__attr,
- int *__pshared) __THROW;
+extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
+ __restrict __attr,
+ int *__restrict __pshared) __THROW;
/* Set process-shared attribute of ATTR to PSHARED. */
extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
@@ -486,9 +501,9 @@ extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __THROW;