]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 25 Oct 1998 09:11:53 +0000 (09:11 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 25 Oct 1998 09:11:53 +0000 (09:11 +0000)
1998-10-25  Ulrich Drepper  <drepper@cygnus.com>

* include/features.h: Define __USE_POSIS199506 is _POSIX_C_SOURCE is
greater or equal than 199506L.

* sysdeps/generic/bits/types.h (__fd_set): Define element as fds_bits
only is __USE_XOPEN.  Otherwise use __fds_bits.
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
* sysdeps/unix/sysv/sysv4/solaris2/bits/types.h: Likewise.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* locale/programs/charmap.c (parse_charmap): Accept tok_string
for <code_set_name>.

1998-10-25  H.J. Lu  <hjl@gnu.org>

* locale/programs/ld-ctype.c (ctype_finish): Also check
<space>.

1998-10-25  Ulrich Drepper  <drepper@cygnus.com>

* signal/signal.h: Include bits/sigthread.h only if __USE_POSIX199506.

* sysdeps/unix/sysv/linux/bits/types.h: Include pthreadtypes.h only
if __USE_POSIX199506 or __USE_UNIX98.

1998-10-24 22:34 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>

* string/bits/string2.h: Inline strdup+friends only if
__USE_MISC || __USE_GNU (prevents namespace pollution).

1998-10-24  H.J. Lu  <hjl@gnu.org>

* sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (LOCK_SH,
LOCK_EX, LOCK_NB, LOCK_UN): Protect with __USE_BSD.
* sysdeps/unix/sysv/linux/i386/bits/fcntl.h (LOCK_SH, LOCK_EX,
LOCK_NB, LOCK_UN): Likewise.
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h (LOCK_SH, LOCK_EX,
LOCK_NB, LOCK_UN): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (LOCK_SH, LOCK_EX,
LOCK_NB, LOCK_UN): Likewise.
* sysdeps/unix/sysv/linux/bits/fcntl.h (LOCK_SH, LOCK_EX,
LOCK_NB, LOCK_UN): Likewise.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* libio/ioseekoff.c (_IO_seekoff): Check the valid dir value.

* libio/rewind.c (rewind): Clear the error.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* grp/grp.h (getgrent_r, getgrgid_r, getgrnam_r): Add "__" to
"buffer".

1998-10-24  H.J. Lu  <hjl@gnu.org>

* sysdeps/unix/sysv/linux/alpha/bits/time.h (timeval): Protect
with __need_timeval.
* sysdeps/unix/sysv/linux/mips/bits/time.h (timeval): Likewise.
* sysdeps/unix/sysv/linux/bits/time.h (timeval): Likewise.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* signal/signal.h (timespec, siginfo_t, sigwaitinfo, sigtimedwait,
sigqueue): Protect with __USE_POSIX199309.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* time/time.h (timespec): Protect with __USE_POSIX199309 instead of
__USE_POSIX.

1998-10-24  H.J. Lu  <hjl@gnu.org>

* libio/fileops.c (_IO_new_file_seekoff): Always resync with
the kernel file offset.
* libio/oldfileops.c (_IO_old_file_seekoff): Likewise.

27 files changed:
ChangeLog
bits/types.h
grp/grp.h
include/features.h
libio/fileops.c
libio/ioseekoff.c
libio/oldfileops.c
libio/rewind.c
locale/programs/charmap.c
locale/programs/ld-ctype.c
signal/signal.h
string/bits/string2.h
sysdeps/generic/bits/types.h
sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
sysdeps/unix/sysv/linux/alpha/bits/time.h
sysdeps/unix/sysv/linux/alpha/bits/types.h
sysdeps/unix/sysv/linux/bits/fcntl.h
sysdeps/unix/sysv/linux/bits/time.h
sysdeps/unix/sysv/linux/bits/types.h
sysdeps/unix/sysv/linux/i386/bits/fcntl.h
sysdeps/unix/sysv/linux/mips/bits/fcntl.h
sysdeps/unix/sysv/linux/mips/bits/time.h
sysdeps/unix/sysv/linux/mips/bits/types.h
sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h
sysdeps/unix/sysv/sysv4/solaris2/bits/types.h
time/time.h

index 5ebef7bc3fab7f68131b0900da358adea2a31608..bcf3cfef773190660c9962399a6aa22529876c0c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,85 @@
+1998-10-25  Ulrich Drepper  <drepper@cygnus.com>
+
+       * include/features.h: Define __USE_POSIS199506 is _POSIX_C_SOURCE is
+       greater or equal than 199506L.
+
+       * sysdeps/generic/bits/types.h (__fd_set): Define element as fds_bits
+       only is __USE_XOPEN.  Otherwise use __fds_bits.
+       * sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/types.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/types.h: Likewise.
+       * sysdeps/unix/sysv/sysv4/solaris2/bits/types.h: Likewise.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * locale/programs/charmap.c (parse_charmap): Accept tok_string
+       for <code_set_name>.
+
+1998-10-25  H.J. Lu  <hjl@gnu.org>
+
+       * locale/programs/ld-ctype.c (ctype_finish): Also check
+       <space>.
+
+1998-10-25  Ulrich Drepper  <drepper@cygnus.com>
+
+       * signal/signal.h: Include bits/sigthread.h only if __USE_POSIX199506.
+
+       * sysdeps/unix/sysv/linux/bits/types.h: Include pthreadtypes.h only
+       if __USE_POSIX199506 or __USE_UNIX98.
+
+1998-10-24 22:34 -0400  Zack Weinberg  <zack@rabi.phys.columbia.edu>
+
+       * string/bits/string2.h: Inline strdup+friends only if
+       __USE_MISC || __USE_GNU (prevents namespace pollution).
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (LOCK_SH,
+       LOCK_EX, LOCK_NB, LOCK_UN): Protect with __USE_BSD.
+       * sysdeps/unix/sysv/linux/i386/bits/fcntl.h (LOCK_SH, LOCK_EX,
+       LOCK_NB, LOCK_UN): Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/fcntl.h (LOCK_SH, LOCK_EX,
+       LOCK_NB, LOCK_UN): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (LOCK_SH, LOCK_EX,
+       LOCK_NB, LOCK_UN): Likewise.
+       * sysdeps/unix/sysv/linux/bits/fcntl.h (LOCK_SH, LOCK_EX,
+       LOCK_NB, LOCK_UN): Likewise.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * libio/ioseekoff.c (_IO_seekoff): Check the valid dir value.
+
+       * libio/rewind.c (rewind): Clear the error.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * grp/grp.h (getgrent_r, getgrgid_r, getgrnam_r): Add "__" to
+       "buffer".
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * sysdeps/unix/sysv/linux/alpha/bits/time.h (timeval): Protect
+       with __need_timeval.
+       * sysdeps/unix/sysv/linux/mips/bits/time.h (timeval): Likewise.
+       * sysdeps/unix/sysv/linux/bits/time.h (timeval): Likewise.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * signal/signal.h (timespec, siginfo_t, sigwaitinfo, sigtimedwait,
+       sigqueue): Protect with __USE_POSIX199309.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * time/time.h (timespec): Protect with __USE_POSIX199309 instead of
+       __USE_POSIX.
+
+1998-10-24  H.J. Lu  <hjl@gnu.org>
+
+       * libio/fileops.c (_IO_new_file_seekoff): Always resync with
+       the kernel file offset.
+       * libio/oldfileops.c (_IO_old_file_seekoff): Likewise.
+
 1998-10-24  H.J. Lu  <hjl@gnu.org>
 
        * time/tzfile.c (__tzfile_default): Set num_types to 2.
index d79851c22aad750508494f460871c26a2936d3bb..2b3edab5e40a3c63697d146f61066d9796caea43 100644 (file)
@@ -98,8 +98,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#else
+    __fd_mask __fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#endif
   } __fd_set;
 
 
index 1059df089f414081a88ad7a83edf297edc4a2649..9b71df8eb7d11422bce3d83dee98c14e76ea1d33 100644 (file)
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -99,25 +99,25 @@ extern struct group *getgrnam __P ((__const char *__name));
    POSIX people would choose.  */
 
 # if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-extern int getgrent_r __P ((struct group *__resultbuf, char *buffer,
+extern int getgrent_r __P ((struct group *__resultbuf, char *__buffer,
                            size_t __buflen, struct group **__result));
 # endif
 
 /* Search for an entry with a matching group ID.  */
 extern int getgrgid_r __P ((__gid_t __gid, struct group *__resultbuf,
-                           char *buffer, size_t __buflen,
+                           char *__buffer, size_t __buflen,
                            struct group **__result));
 
 /* Search for an entry with a matching group name.  */
 extern int getgrnam_r __P ((__const char *__name, struct group *__resultbuf,
-                           char *buffer, size_t __buflen,
+                           char *__buffer, size_t __buflen,
                            struct group **__result));
 
 # ifdef        __USE_SVID
 /* Read a group entry from STREAM.  This function is not standardized
    an probably never will.  */
 extern int fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
-                            char *buffer, size_t __buflen,
+                            char *__buffer, size_t __buflen,
                             struct group **__result));
 # endif
 
index 8cfc990f692263528ef3278a8f199241c97404e9..c0edd106ee62701c2dd7c1e2cbbd63bc813e7bfe 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,7 +51,8 @@
    __USE_ISOC9X                Define ISO C 9X things.
    __USE_POSIX         Define IEEE Std 1003.1 things.
    __USE_POSIX2                Define IEEE Std 1003.2 things.
-   __USE_POSIX199309   Define IEEE Std 1003.1b things.
+   __USE_POSIX199309   Define IEEE Std 1003.1, and .1b things.
+   __USE_POSIX199506   Define IEEE Std 1003.1, .1b, .1c and .1i things.
    __USE_XOPEN         Define XPG things.
    __USE_XOPEN_EXTENDED        Define X/Open Unix things.
    __USE_UNIX98                Define Single Unix V2 things.
@@ -81,6 +82,7 @@
 #undef __USE_POSIX
 #undef __USE_POSIX2
 #undef __USE_POSIX199309
+#undef __USE_POSIX199506
 #undef __USE_XOPEN
 #undef __USE_XOPEN_EXTENDED
 #undef __USE_UNIX98
 # define __USE_POSIX199309     1
 #endif
 
+#if (_POSIX_C_SOURCE - 0) >= 199506L
+# define __USE_POSIX199506     1
+#endif
+
 #ifdef _XOPEN_SOURCE
 # define __USE_XOPEN   1
 # if (_XOPEN_SOURCE - 0) == 500
index be65d42fb2ac254f421748be5ee1d2f40bc3c42a..8930f6f3cd22b6f4baa4131e628c80b9e3e3e93b 100644 (file)
@@ -567,7 +567,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
              _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
              {
                _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
-               return offset;
+               goto resync;
              }
            }
 #ifdef TODO
@@ -579,7 +579,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
                if (ignore (to_skip) != to_skip)
                  goto dumb;
                _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
-               return offset;
+               goto resync;
              }
 #endif
        }
@@ -590,7 +590,7 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
            _IO_switch_to_backup_area (fp);
          gbump (fp->_IO_read_end + rel_offset - fp->_IO_read_ptr);
          _IO_mask_flags (fp, 0, _IO_EOF_SEEN);
-         return offset;
+         goto resync;
        }
 #endif
     }
@@ -646,6 +646,16 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
       _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
     }
   return result;
+
+resync:
+  /* We need to do it since it is possible that the file offset in
+     the kernel may be changed behind our back. It may happen when
+     we fopen a file and then do a fork. One process may access the
+     the file and the kernel file offset will be changed. */
+  if (fp->_offset >= 0)
+    _IO_SYSSEEK (fp, fp->_offset, 0);
+
+  return offset;
 }
 
 _IO_ssize_t
index 54a8d19f0d02d5a890eea60b98df19719701b3e6..4a951dd7c11fff4fdeef8dd668aa8a98132ebf1e 100644 (file)
    General Public License.  */
 
 #include <libioP.h>
+#include <errno.h> 
+#ifndef errno 
+extern int errno; 
+#endif 
+#ifndef __set_errno 
+# define __set_errno(Val) errno = (Val)  
+#endif 
 
 _IO_fpos64_t
 _IO_seekoff (fp, offset, dir, mode)
@@ -34,13 +41,18 @@ _IO_seekoff (fp, offset, dir, mode)
 {
   _IO_fpos64_t retval;
 
+  if (dir != _IO_seek_cur && dir != _IO_seek_set && dir != _IO_seek_end) 
+    { 
+      __set_errno (EINVAL); 
+      return EOF; 
+    }
+
   /* If we have a backup buffer, get rid of it, since the __seekoff
      callback may not know to do the right thing about it.
      This may be over-kill, but it'll do for now. TODO */
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
 
-
   if (mode != 0 && _IO_have_backup (fp))
     {
       if (dir == _IO_seek_cur && _IO_in_backup (fp))
index 59de8d8818453f3575cb7498bc4c69644d2805f5..e0f8e65255ea8a180ad965c5f84f56a861fca7ac 100644 (file)
@@ -514,7 +514,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
              _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + rel_offset,
                        fp->_IO_read_end);
              _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
-             return offset;
+             goto resync;
            }
 #ifdef TODO
            /* If we have streammarkers, seek forward by reading ahead. */
@@ -524,7 +524,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
                  - (fp->_IO_read_ptr - fp->_IO_read_base);
                if (ignore (to_skip) != to_skip)
                  goto dumb;
-               return offset;
+               goto resync;
              }
 #endif
        }
@@ -534,7 +534,7 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
          if (!_IO_in_backup (fp))
            _IO_switch_to_backup_area (fp);
          gbump (fp->_IO_read_end + rel_offset - fp->_IO_read_ptr);
-         return offset;
+         goto resync;
        }
 #endif
     }
@@ -590,6 +590,16 @@ _IO_old_file_seekoff (fp, offset, dir, mode)
       _IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
     }
   return result;
+
+resync:
+  /* We need to do it since it is possible that the file offset in
+     the kernel may be changed behind our back. It may happen when
+     we fopen a file and then do a fork. One process may access the
+     the file and the kernel file offset will be changed. */
+  if (fp->_old_offset >= 0)
+    _IO_SYSSEEK (fp, fp->_old_offset, 0);
+
+  return offset;
 }
 
 _IO_ssize_t
index fb6afbc77afb6571122283c289c71e4615958c11..a9ea36edb63e8e641333332ce273cc58ac8541a0 100644 (file)
@@ -34,6 +34,7 @@ rewind (fp)
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
   _IO_rewind (fp);
+  _IO_clearerr (fp);
   _IO_funlockfile (fp);
   _IO_cleanup_region_end (0);
 }
index e11df1cf29a83f8f34f4b0c810318b5a13593109..fd9cc357e389f08f89ccc17ba3a6ce00ef62b60a 100644 (file)
@@ -290,7 +290,7 @@ parse_charmap (const char *filename)
          switch (nowtok)
            {
            case tok_code_set_name:
-             if (arg->tok != tok_ident)
+             if (arg->tok != tok_ident && arg->tok != tok_string)
                {
                badarg:
                  lr_error (cmfile, _("syntax error in prolog: %s"),
index a4dcd7680771594cc5ac830633e528f17ff5fb71..2fbefd9395dd63ba8a2aaa2ca9bbb1c83a44adc0 100644 (file)
@@ -312,6 +312,8 @@ character %s'%s' in class `%s' must not be in class `%s'"),
 
   /* ... and now test <SP> as a special case.  */
   space_value = charset_find_value (&charset->char_table, "SP", 2);
+  if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE)
+    space_value = charset_find_value (&charset->char_table, "space", 5);
   if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE)
     {
       if (!be_quiet)
index 62ccf196998861e09979417e1c25746157c0069c..efbe36d378fefb8db31c2963bc367afe88b26b2d 100644 (file)
@@ -179,12 +179,14 @@ typedef __sighandler_t sig_t;
 
 #ifdef __USE_POSIX
 
+# ifdef __USE_POSIX199309
 /* We need `struct timespec' later on.  */
 #  define __need_timespec
 #  include <time.h>
 
 /* Get the `siginfo_t' type plus the needed symbols.  */
 #  include <bits/siginfo.h>
+# endif
 
 /* Clear all signals from SET.  */
 extern int sigemptyset __P ((sigset_t *__set));
@@ -201,7 +203,7 @@ extern int sigdelset __P ((sigset_t *__set, int __signo));
 /* Return 1 if SIGNO is in SET, 0 if not.  */
 extern int sigismember __P ((__const sigset_t *__set, int __signo));
 
-#  ifdef __USE_GNU
+# ifdef __USE_GNU
 /* Return non-empty value is SET is not empty.  */
 extern int sigisemptyset __P ((__const sigset_t *__set));
 
@@ -212,11 +214,11 @@ extern int sigandset __P ((sigset_t *__set, __const sigset_t *__left,
 /* Build new signal set by combining the two inputs set using logical OR.  */
 extern int sigorset __P ((sigset_t *__set, __const sigset_t *__left,
                          __const sigset_t *__right));
-#  endif /* GNU */
+# endif /* GNU */
 
 /* Get the system-specific definitions of `struct sigaction'
    and the `SA_*' and `SIG_*'. constants.  */
-#  include <bits/sigaction.h>
+# include <bits/sigaction.h>
 
 /* Get and/or change the set of blocked signals.  */
 extern int sigprocmask __P ((int __how,
@@ -239,6 +241,7 @@ extern int sigpending __P ((sigset_t *__set));
 /* Select any of pending signals from SET or wait for any to arrive.  */
 extern int sigwait __P ((__const sigset_t *__set, int *__sig));
 
+# ifdef __USE_POSIX199309
 /* Select any of pending signals from SET and place information in INFO.  */
 extern int sigwaitinfo __P ((__const sigset_t *__set, siginfo_t *__info));
 
@@ -251,6 +254,7 @@ extern int sigtimedwait __P ((__const sigset_t *__set, siginfo_t *__info,
    signal.  */
 extern int sigqueue __P ((__pid_t __pid, int __sig,
                          __const union sigval __val));
+# endif        /* Use POSIX 199306.  */
 
 #endif /* Use POSIX.  */
 
@@ -333,7 +337,7 @@ extern int sigignore __P ((int __sig));
 extern __sighandler_t sigset __P ((int __sig, __sighandler_t __disp));
 #endif /* use Unix98 */
 
-#ifdef __USE_POSIX
+#ifdef __USE_POSIX199506
 /* Some of the functions for handling signals in threaded programs must
    be defined here.  */
 # include <bits/sigthread.h>
index fd431b8ece0461249e428e9e201d89bf036b2314..cfbcc18aa0ffd6e3ff5c1741578717e0b98bd7b3 100644 (file)
@@ -1011,18 +1011,18 @@ __strsep_g (char **__s, __const char *__reject)
 #endif
 
 /* We need the memory allocation functions for inline strdup().
-   Referring to stdlib.h (even minimally) is not allowed if
-   __STRICT_ANSI__. */
-#ifndef __STRICT_ANSI__
+   Referring to stdlib.h (even minimally) is not allowed 
+   in any of the tight standards compliant modes.  */
+#if defined __USE_MISC || defined __USE_GNU
 
-#if !defined _HAVE_STRING_ARCH_strdup || !defined _HAVE_STRING_ARCH_strndup
-# define __need_malloc_and_calloc
-# include <stdlib.h>
-#endif
+# if !defined _HAVE_STRING_ARCH_strdup || !defined _HAVE_STRING_ARCH_strndup
+#  define __need_malloc_and_calloc
+#  include <stdlib.h>
+# endif
 
-#ifndef _HAVE_STRING_ARCH_strdup
+# ifndef _HAVE_STRING_ARCH_strdup
 
-# define __strdup(s) \
+#  define __strdup(s) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)          \
                  ? (((__const char *) (s))[0] == '\0'                        \
                     ? (char *) calloc (1, 1)                                 \
@@ -1033,14 +1033,14 @@ __strsep_g (char **__s, __const char *__reject)
                          __retval; }))                                       \
                  : __strdup (s)))
 
-# if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-#  define strdup(s) __strdup (s)
+#  if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#   define strdup(s) __strdup (s)
+#  endif
 # endif
-#endif
 
-#ifndef _HAVE_STRING_ARCH_strndup
+# ifndef _HAVE_STRING_ARCH_strndup
 
-# define __strndup(s, n) \
+#  define __strndup(s, n) \
   (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)          \
                  ? (((__const char *) (s))[0] == '\0'                        \
                     ? (char *) calloc (1, 1)                                 \
@@ -1059,12 +1059,12 @@ __strsep_g (char **__s, __const char *__reject)
                          __retval; }))                                       \
                  : __strndup ((s), (n))))
 
-# ifdef __GNU_SOURCE
-#  define strndup(s, n) __strndup ((s), (n))
+#  ifdef __GNU_SOURCE
+#   define strndup(s, n) __strndup ((s), (n))
+#  endif
 # endif
-#endif
 
-#endif /* Strict ANSI */
+#endif /* Use misc. or use GNU.  */
 
 #undef __STRING_INLINE
 
index d79851c22aad750508494f460871c26a2936d3bb..2b3edab5e40a3c63697d146f61066d9796caea43 100644 (file)
@@ -98,8 +98,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#else
+    __fd_mask __fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#endif
   } __fd_set;
 
 
index 70ebbeba618a4cf1e2a72b0bc5f388d7c15d29a3..9f90ddf57c2663fd6330709315a46ce394b067e6 100644 (file)
 #define F_EXLCK                16      /* or 3 */
 #define F_SHLCK                32      /* or 4 */
 
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH                1       /* shared lock */
-#define LOCK_EX                2       /* exclusive lock */
-#define LOCK_NB                4       /* or'd with one of the above to prevent
+/* Operations for bsd flock(), also used by the kernel implementation */
+#ifdef __USE_BSD
+# define LOCK_SH       1       /* shared lock */
+# define LOCK_EX       2       /* exclusive lock */
+# define LOCK_NB       4       /* or'd with one of the above to prevent
                                   blocking */
-#define LOCK_UN                8       /* remove lock */
+# define LOCK_UN       8       /* remove lock */
+#endif
 
 /* We don't need to support __USE_FILE_OFFSET64.  */
 struct flock
index acb2b41f97bbec000484666638f531e4cdbd2b45..f44b5dcabcedd5937e15c9b802290e819695aff7 100644 (file)
 # endif        /* bits/time.h */
 #endif /* !__need_timeval */
 
-
-#ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL       1
-# include <bits/types.h>
+#ifdef __need_timeval 
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL      1
+#  include <bits/types.h>
 
 /* A time value that is accurate to the nearest
    microsecond but also has a range of years.  */
@@ -54,4 +55,5 @@ struct timeval
     __time_t tv_sec;           /* Seconds.  */
     __time_t tv_usec;          /* Microseconds.  */
   };
-#endif /* struct timeval */
+# endif        /* struct timeval */
+#endif /* need timeval */
index d4f2217f0596c1ff191c255ab5f97c058d3a7251..aee9d046ec56db5c85228570a76a5af0fcf0983e 100644 (file)
@@ -102,8 +102,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+#else
+    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+#endif
   } __fd_set;
 
 /* Used in XTI.  */
@@ -115,6 +120,8 @@ typedef long int __intptr_t;
 
 
 /* Now add the thread types.  */
-#include <bits/pthreadtypes.h>
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
 
 #endif /* bits/types.h */
index a2bbf29e03d28ae140da5272ace5833fc720c395..0c94c6b9a569837046fd44cbe7bddbe1b0888b31 100644 (file)
 #define F_EXLCK                4       /* or 3 */
 #define F_SHLCK                8       /* or 4 */
 
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH                1       /* shared lock */
-#define LOCK_EX                2       /* exclusive lock */
-#define LOCK_NB                4       /* or'd with one of the above to prevent
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH       1       /* shared lock */
+# define LOCK_EX       2       /* exclusive lock */
+# define LOCK_NB       4       /* or'd with one of the above to prevent
                                   blocking */
-#define LOCK_UN                8       /* remove lock */
+# define LOCK_UN       8       /* remove lock */
+#endif
 
 struct flock
   {
index 3c1b27a1bb780e5752f844c9fa7ef05282565052..274d6167773fdd07fa5ea9a18ba7de2b1d2ecb4e 100644 (file)
 # endif        /* bits/time.h */
 #endif
 
-#ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL       1
-# include <bits/types.h>
+#ifdef __need_timeval 
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL      1
+#  include <bits/types.h>
 
 /* A time value that is accurate to the nearest
    microsecond but also has a range of years.  */
@@ -53,4 +55,5 @@ struct timeval
     __time_t tv_sec;           /* Seconds.  */
     __time_t tv_usec;          /* Microseconds.  */
   };
-#endif /* struct timeval */
+# endif        /* struct timeval */
+#endif /* need timeval */ 
index 06206f3b55e3acd043071742eb4a876ce3953f69..1543ff7c34c17a1333bd6470e5640e6b5adacabd 100644 (file)
@@ -99,8 +99,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the global namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+#else
+    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+#endif
   } __fd_set;
 
 
@@ -139,6 +144,8 @@ typedef int __intptr_t;
 
 
 /* Now add the thread types.  */
-#include <bits/pthreadtypes.h>
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
 
 #endif /* bits/types.h */
index d4ef8e1096f98b2b8e2536dadaada613d002d653..d47a6619176150f29d610f6f8ed997f4d32963f4 100644 (file)
 #define F_EXLCK                4       /* or 3 */
 #define F_SHLCK                8       /* or 4 */
 
+#ifdef __USE_BSD
 /* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH                1       /* shared lock */
-#define LOCK_EX                2       /* exclusive lock */
-#define LOCK_NB                4       /* or'd with one of the above to prevent
+# define LOCK_SH       1       /* shared lock */
+# define LOCK_EX       2       /* exclusive lock */
+# define LOCK_NB       4       /* or'd with one of the above to prevent
                                   blocking */
-#define LOCK_UN                8       /* remove lock */
+# define LOCK_UN       8       /* remove lock */
+#endif
 
 struct flock
   {
index 027347053b7157550d9171f0428358e00a0b37bb..0a21a59e0adc8933c23068ee9442acbfc50abdb4 100644 (file)
 #define F_EXLCK                4       /* or 3 */
 #define F_SHLCK                8       /* or 4 */
 
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH                1       /* shared lock */
-#define LOCK_EX                2       /* exclusive lock */
-#define LOCK_NB                4       /* or'd with one of the above to prevent                XXXXXXXXXXXXXXXXXX
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH       1       /* shared lock */
+# define LOCK_EX       2       /* exclusive lock */
+# define LOCK_NB       4       /* or'd with one of the above to prevent                XXXXXXXXXXXXXXXXXX
                                   blocking */
-#define LOCK_UN                8       /* remove lock */
+# define LOCK_UN       8       /* remove lock */
+#endif
 
 typedef struct flock
   {
index 91dc65c910da8dd225b45642fc11fcf0ea9d0551..15c7cb385225aa788f24ddb0ac96e9f4651f124f 100644 (file)
 # endif  /* bits/time.h */
 #endif
 
-#ifndef _STRUCT_TIMEVAL
-# define _STRUCT_TIMEVAL       1
+#ifdef __need_timeval 
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL      1
 /* A time value that is accurate to the nearest
    microsecond but also has a range of years.  */
 struct timeval
@@ -51,4 +53,5 @@ struct timeval
     long int tv_sec;           /* Seconds.  */
     long int tv_usec;          /* Microseconds.  */
   };
-#endif /* struct timeval */
+# endif        /* struct timeval */
+#endif /* need timeval */
index c716d5735d5db3c0b3bc6bc9665513821d885ae9..e32dadf57fc58378e40e43210e1521b53c70df59 100644 (file)
@@ -99,8 +99,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+#else
+    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+#endif
   } __fd_set;
 
 
@@ -139,6 +144,8 @@ typedef int __intptr_t;
 
 
 /* Now add the thread types.  */
-#include <bits/pthreadtypes.h>
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
 
 #endif /* bits/types.h */
index b86c65d99395a0042701f63eb6dd4a2921db467a..e42dfefef6c178d423f15686905e4ab95c20d980 100644 (file)
 #define F_EXLCK                4       /* or 3 */
 #define F_SHLCK                8       /* or 4 */
 
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH                1       /* shared lock */
-#define LOCK_EX                2       /* exclusive lock */
-#define LOCK_NB                4       /* or'd with one of the above to prevent
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH       1       /* shared lock */
+# define LOCK_EX       2       /* exclusive lock */
+# define LOCK_NB       4       /* or'd with one of the above to prevent
                                   blocking */
-#define LOCK_UN                8       /* remove lock */
+# define LOCK_UN       8       /* remove lock */
+#endif
 
 struct flock
   {
index c147dbe6e5a6d16ba53b23a6adbadd1548e1f4a3..6093eba084096399c3d1ff24f0c12432e6430774 100644 (file)
@@ -93,8 +93,13 @@ typedef unsigned long int __fd_mask;
 /* fd_set for select and pselect.  */
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+#else
+    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+#endif
   } __fd_set;
 
 
@@ -127,6 +132,8 @@ typedef long int __intptr_t;
 
 
 /* Now add the thread types.  */
-#include <bits/pthreadtypes.h>
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
 
 #endif /* bits/types.h */
index e25dec98fb2e1722241bc0dcb626a9884d933de3..aa73ebcb1994d5f07840307ca2789b995a004929 100644 (file)
@@ -90,8 +90,13 @@ typedef int __key_t;              /* Type of an IPC key */
 
 typedef struct
   {
-    /* XPG4.2 requires this member name.  */
+    /* XPG4.2 requires this member name.  Otherwise avoid the name
+       from the user namespace.  */
+#ifdef __USE_XOPEN
     unsigned long int fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#else
+    unsigned long int __fds_bits[(__FD_SETSIZE + (__NFDBITS - 1)) / __NFDBITS];
+#endif
   } __fd_set;
 
 typedef unsigned long int __fd_mask;
index 0af3eafddb4ce8339897481659599b0f8099e74a..374885290a0804aaabb6648013b590adf979e4da 100644 (file)
@@ -80,7 +80,7 @@ typedef __time_t time_t;
 
 
 #if !defined __timespec_defined && \
-    ((defined _TIME_H && defined __USE_POSIX) || defined __need_timespec)
+    ((defined _TIME_H && defined __USE_POSIX199309) || defined __need_timespec)
 # define __timespec_defined    1
 
 /* POSIX.4 structure for a time value.  This is like a `struct timeval' but