Browse Source

Update to accomodate the header file changes

Eric Andersen 22 years ago
parent
commit
2512c84745
100 changed files with 1121 additions and 679 deletions
  1. 1 1
      libc/Makefile
  2. 1 4
      libc/inet/getnetbyad.c
  3. 42 3
      libc/inet/resolv.c
  4. 1 1
      libc/inet/rpc/bindresvport.c
  5. 2 0
      libc/inet/rpc/svc.c
  6. 21 1
      libc/inet/socketcalls.c
  7. 1 1
      libc/misc/lsearch/lsearch.c
  8. 1 1
      libc/misc/mntent/mntent.c
  9. 1 1
      libc/misc/sysvipc/ftok.c
  10. 1 0
      libc/misc/sysvipc/shm.c
  11. 1 0
      libc/misc/time/ctime.c
  12. 1 0
      libc/misc/time/ctime_r.c
  13. 1 0
      libc/misc/time/localtime.c
  14. 1 0
      libc/misc/time/localtime_r.c
  15. 3 2
      libc/misc/time/utimes.c
  16. 7 5
      libc/misc/utmp/utent.c
  17. 9 0
      libc/pwd_grp/config.h
  18. 1 0
      libc/pwd_grp/fgetgrent.c
  19. 1 0
      libc/pwd_grp/fgetpwent.c
  20. 1 0
      libc/pwd_grp/getgrgid.c
  21. 1 0
      libc/pwd_grp/getgrnam.c
  22. 1 0
      libc/pwd_grp/getpwnam.c
  23. 1 0
      libc/pwd_grp/getpwuid.c
  24. 1 0
      libc/pwd_grp/grent.c
  25. 1 0
      libc/pwd_grp/pwent.c
  26. 2 1
      libc/signal/sigaddset.c
  27. 0 1
      libc/signal/sigblock.c
  28. 4 2
      libc/signal/sigdelset.c
  29. 0 1
      libc/signal/siggtmsk.c
  30. 4 2
      libc/signal/sigismem.c
  31. 0 1
      libc/signal/sigstmsk.c
  32. 1 0
      libc/stdio/getline.c
  33. 1 0
      libc/stdio/perror.c
  34. 1 0
      libc/stdio/scanf.c
  35. 1 0
      libc/stdlib/atexit.c
  36. 1 1
      libc/stdlib/getpt.c
  37. 1 1
      libc/stdlib/grantpt.c
  38. 1 1
      libc/stdlib/malloc/malloc.c
  39. 1 1
      libc/stdlib/ptsname.c
  40. 1 2
      libc/stdlib/putenv.c
  41. 2 1
      libc/stdlib/setenv.c
  42. 1 0
      libc/stdlib/strto_ll.c
  43. 1 1
      libc/stdlib/unix_grantpt.c
  44. 3 3
      libc/string/strsignal.c
  45. 29 14
      libc/sysdeps/linux/arm/bits/byteswap.h
  46. 200 45
      libc/sysdeps/linux/arm/bits/confname.h
  47. 11 20
      libc/sysdeps/linux/arm/bits/dirent.h
  48. 8 10
      libc/sysdeps/linux/arm/bits/dlfcn.h
  49. 9 11
      libc/sysdeps/linux/arm/bits/errno.h
  50. 66 27
      libc/sysdeps/linux/arm/bits/fcntl.h
  51. 8 8
      libc/sysdeps/linux/arm/bits/huge_val.h
  52. 27 14
      libc/sysdeps/linux/arm/bits/in.h
  53. 10 9
      libc/sysdeps/linux/arm/bits/ioctl-types.h
  54. 8 8
      libc/sysdeps/linux/arm/bits/ioctls.h
  55. 21 15
      libc/sysdeps/linux/arm/bits/ipc.h
  56. 25 3
      libc/sysdeps/linux/arm/bits/local_lim.h
  57. 9 21
      libc/sysdeps/linux/arm/bits/mathcalls.h
  58. 8 8
      libc/sysdeps/linux/arm/bits/mathdef.h
  59. 8 8
      libc/sysdeps/linux/arm/bits/mman.h
  60. 8 8
      libc/sysdeps/linux/arm/bits/msq.h
  61. 9 12
      libc/sysdeps/linux/arm/bits/poll.h
  62. 11 11
      libc/sysdeps/linux/arm/bits/posix1_lim.h
  63. 14 23
      libc/sysdeps/linux/arm/bits/posix2_lim.h
  64. 35 4
      libc/sysdeps/linux/arm/bits/posix_opt.h
  65. 8 8
      libc/sysdeps/linux/arm/bits/resource.h
  66. 11 11
      libc/sysdeps/linux/arm/bits/select.h
  67. 8 8
      libc/sysdeps/linux/arm/bits/sem.h
  68. 8 8
      libc/sysdeps/linux/arm/bits/setjmp.h
  69. 31 22
      libc/sysdeps/linux/arm/bits/shm.h
  70. 11 11
      libc/sysdeps/linux/arm/bits/sigaction.h
  71. 8 8
      libc/sysdeps/linux/arm/bits/sigcontext.h
  72. 49 22
      libc/sysdeps/linux/arm/bits/siginfo.h
  73. 8 8
      libc/sysdeps/linux/arm/bits/signum.h
  74. 9 11
      libc/sysdeps/linux/arm/bits/sigset.h
  75. 11 11
      libc/sysdeps/linux/arm/bits/sigstack.h
  76. 6 9
      libc/sysdeps/linux/arm/bits/sigthread.h
  77. 9 16
      libc/sysdeps/linux/arm/bits/sockaddr.h
  78. 39 30
      libc/sysdeps/linux/arm/bits/socket.h
  79. 26 19
      libc/sysdeps/linux/arm/bits/stat.h
  80. 12 9
      libc/sysdeps/linux/arm/bits/statfs.h
  81. 16 12
      libc/sysdeps/linux/arm/bits/stdio_lim.h
  82. 9 8
      libc/sysdeps/linux/arm/bits/termios.h
  83. 25 15
      libc/sysdeps/linux/arm/bits/time.h
  84. 25 32
      libc/sysdeps/linux/arm/bits/types.h
  85. 8 8
      libc/sysdeps/linux/arm/bits/uio.h
  86. 9 9
      libc/sysdeps/linux/arm/bits/waitflags.h
  87. 10 10
      libc/sysdeps/linux/arm/bits/waitstatus.h
  88. 8 8
      libc/sysdeps/linux/arm/bits/wordsize.h
  89. 67 19
      libc/sysdeps/linux/arm/bits/xopen_lim.h
  90. 3 3
      libc/sysdeps/linux/arm/setjmp.S
  91. 2 2
      libc/sysdeps/linux/common/errno.c
  92. 2 1
      libc/sysdeps/linux/common/getdnnm.c
  93. 5 2
      libc/sysdeps/linux/common/getdtablesize.c
  94. 3 1
      libc/sysdeps/linux/common/getpagesize.c
  95. 1 0
      libc/sysdeps/linux/common/setegid.c
  96. 1 0
      libc/sysdeps/linux/common/seteuid.c
  97. 3 3
      libc/sysdeps/linux/common/statfix.c
  98. 1 1
      libc/sysdeps/linux/common/statfix.h
  99. 15 16
      libc/sysdeps/linux/common/syscalls.c
  100. 1 0
      libc/sysdeps/linux/common/wait.c

+ 1 - 1
libc/Makefile

@@ -54,7 +54,7 @@ shared: $(TOPDIR)lib/$(LIBNAME)
 		    -Wl,-soname,$(SHARED_MAJORNAME) -Wl,--whole-archive \
 		    ./$(LIBNAME) $(LDSO)  -Wl,-dynamic-linker,$(DYNAMIC_LINKER); \
 	fi
-	@rm -rf tmp
+	@/bin/true #rm -rf tmp
 	install -d $(TOPDIR)lib
 	rm -f $(TOPDIR)lib/$(SHARED_FULLNAME)
 	install -m 644 $(SHARED_FULLNAME) $(TOPDIR)lib

+ 1 - 4
libc/inet/getnetbyad.c

@@ -19,10 +19,7 @@
 
 extern int _net_stayopen;
 
-struct netent *
-getnetbyaddr(net, type)
-	register long net;
-	register int type;
+struct netent *getnetbyaddr (uint32_t net, int type)
 {
 	register struct netent *p;
 

+ 42 - 3
libc/inet/resolv.c

@@ -50,7 +50,6 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <cfgfile.h>
 #include <resolv.h>
 #include <netdb.h>
 #include <ctype.h>
@@ -72,6 +71,31 @@
 #endif /* DEBUG */
 
 
+struct resolv_header {
+	int id;
+	int qr,opcode,aa,tc,rd,ra,rcode;
+	int qdcount;
+	int ancount;
+	int nscount;
+	int arcount;
+};
+
+struct resolv_question {
+	char * dotted;
+	int qtype;
+	int qclass;
+};
+
+struct resolv_answer {
+	char * dotted;
+	int atype;
+	int aclass;
+	int ttl;
+	int rdlength;
+	unsigned char * rdata;
+	int rdoffset;
+};
+
 extern int nameservers;
 extern char * nameserver[MAX_SERVERS];
 extern int searchdomains;
@@ -86,6 +110,22 @@ extern int resolve_mailbox(const char * address, int nscount,
 extern int dns_lookup(const char * name, int type, int nscount, 
 	char ** nsip, unsigned char ** outpacket, struct resolv_answer * a);
 
+int encode_dotted(const char * dotted, unsigned char * dest, int maxlen);
+int decode_dotted(const unsigned char * message, int offset, 
+	char * dest, int maxlen);
+int length_dotted(const unsigned char * message, int offset);
+int encode_header(struct resolv_header * h, unsigned char * dest, int maxlen);
+int decode_header(unsigned char * data, struct resolv_header * h);
+int encode_question(struct resolv_question * q,
+	unsigned char * dest, int maxlen);
+int decode_question(unsigned char * message, int offset,
+	struct resolv_question * q);
+int encode_answer(struct resolv_answer * a,
+	unsigned char * dest, int maxlen);
+int decode_answer(unsigned char * message, int offset,
+	struct resolv_answer * a);
+int length_question(unsigned char * message, int offset);
+extern int open_nameservers(void);
 
 
 #ifdef L_encodeh
@@ -1141,8 +1181,7 @@ int res_query(const char *dname, int class, int type,
 
 
 #ifdef L_gethostbyaddr
-
-struct hostent *gethostbyaddr(const char *addr, int len, int type)
+struct hostent *gethostbyaddr (const void *addr, __socklen_t len, int type)
 {
 	static struct hostent h;
 	static char namebuf[256];

+ 1 - 1
libc/inet/rpc/bindresvport.c

@@ -75,7 +75,7 @@ struct sockaddr_in *sin;
 		if (port > ENDPORT) {
 			port = STARTPORT;
 		}
-		res = bind(sd, sin, sizeof(struct sockaddr_in));
+		res = bind(sd, (struct sockaddr *)sin, (socklen_t)sizeof(struct sockaddr_in));
 	}
 	return (res);
 }

+ 2 - 0
libc/inet/rpc/svc.c

@@ -40,11 +40,13 @@
  * Copyright (C) 1984, Sun Microsystems, Inc.
  */
 
+#define __USE_XOPEN
 #include <sys/errno.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
 #ifdef __linux__
 #include <sys/types.h>
+#include <sys/select.h>
 #endif
 
 extern int errno;

+ 21 - 1
libc/inet/socketcalls.c

@@ -3,10 +3,30 @@
 #include <errno.h>
 #include <syscall.h>
 #include <sys/socket.h>
-#include <sys/socketcall.h>
+
 
 extern int socketcall(int call, unsigned long *args);
 
+/* Various socketcall numbers */
+#define SYS_SOCKET      1
+#define SYS_BIND        2
+#define SYS_CONNECT     3
+#define SYS_LISTEN      4
+#define SYS_ACCEPT      5
+#define SYS_GETSOCKNAME 6
+#define SYS_GETPEERNAME 7
+#define SYS_SOCKETPAIR  8
+#define SYS_SEND        9
+#define SYS_RECV        10
+#define SYS_SENDTO      11
+#define SYS_RECVFROM    12
+#define SYS_SHUTDOWN    13
+#define SYS_SETSOCKOPT  14
+#define SYS_GETSOCKOPT  15
+#define SYS_SENDMSG     16
+#define SYS_RECVMSG     17
+
+
 #ifdef L_accept
 int accept(int s, struct sockaddr *addr, socklen_t * addrlen)
 {

+ 1 - 1
libc/misc/lsearch/lsearch.c

@@ -8,6 +8,7 @@
  *  "It's not reality that's important, but how you perceive things."
  */
 
+#include <string.h>
 #include <stdio.h>
 
 char *lfind(key, base, num, size, cmp)
@@ -33,7 +34,6 @@ register unsigned int size;
 int (*cmp) ();
 {
 	register char *p;
-	char *memcpy();
 
 	if ((p = lfind(key, base, num, size, cmp)) == NULL) {
 		p = memcpy((base + (size * (*num))), key, size);

+ 1 - 1
libc/misc/mntent/mntent.c

@@ -8,7 +8,7 @@
 struct mntent *getmntent(FILE * filep)
 {
 	char *cp, *sep = " \t\n";
-	static char buff[MNTMAXSTR];
+	static char buff[BUFSIZ];
 	static struct mntent mnt;
 
 	/* Loop on the file, skipping comment lines. - FvK 03/07/93 */

+ 1 - 1
libc/misc/sysvipc/ftok.c

@@ -28,7 +28,7 @@ ftok (pathname, proj_id)
   struct stat st;
   key_t key;
 
-  if (_xstat (_STAT_VER, pathname, &st) < 0)
+  if (__xstat (_STAT_VER, pathname, &st) < 0)
     return (key_t) -1;
 
   key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)

+ 1 - 0
libc/misc/sysvipc/shm.c

@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <stdlib.h>
 #include <errno.h>
 #include <sys/shm.h>
 #include "ipc.h"

+ 1 - 0
libc/misc/time/ctime.c

@@ -1,5 +1,6 @@
 
 #include <time.h>
+#include <sys/time.h>
 
 extern void __tm_conv();
 extern void __asctime();

+ 1 - 0
libc/misc/time/ctime_r.c

@@ -1,5 +1,6 @@
 
 #include <time.h>
+#include <sys/time.h>
 
 extern void __tm_conv();
 extern void __asctime();

+ 1 - 0
libc/misc/time/localtime.c

@@ -1,5 +1,6 @@
 
 #include <time.h>
+#include <sys/time.h>
 
 extern void __tm_conv();
 

+ 1 - 0
libc/misc/time/localtime_r.c

@@ -1,5 +1,6 @@
 
 #include <time.h>
+#include <sys/time.h>
 
 extern void __tm_conv();
 

+ 3 - 2
libc/misc/time/utimes.c

@@ -1,7 +1,8 @@
+#include <stdlib.h>
 #include <utime.h>
 #include <sys/time.h>
 
-int utimes(const char *path, struct timeval tvp[2])
+int utimes (const char *file, const struct timeval tvp[2])
 {
 	struct utimbuf buf, *times;
 
@@ -12,5 +13,5 @@ int utimes(const char *path, struct timeval tvp[2])
 	}
 	else
 		times = NULL;
-	return utime(path, times);
+	return utime(file, times);
 }

+ 7 - 5
libc/misc/utmp/utent.c

@@ -7,6 +7,7 @@
    have to call endutent() to close the file even if you've not called
    setutent -- getutid and family use the same file descriptor. */
 
+#include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <paths.h>
@@ -53,7 +54,7 @@ struct utmp *getutent(void)
 	return __getutent(ut_fd);
 }
 
-struct utmp *getutid(struct utmp *utmp_entry)
+struct utmp *getutid (const struct utmp *utmp_entry)
 {
 	struct utmp *utmp;
 
@@ -78,7 +79,7 @@ struct utmp *getutid(struct utmp *utmp_entry)
 	return NULL;
 }
 
-struct utmp *getutline(struct utmp *utmp_entry)
+struct utmp *getutline(const struct utmp *utmp_entry)
 {
 	struct utmp *utmp;
 
@@ -102,7 +103,7 @@ struct utmp *getutline(struct utmp *utmp_entry)
 	return NULL;
 }
 
-struct utmp *pututline(struct utmp *utmp_entry)
+struct utmp *pututline (const struct utmp *utmp_entry)
 {
 	struct utmp *ut;
 
@@ -122,14 +123,15 @@ struct utmp *pututline(struct utmp *utmp_entry)
 			return NULL;
 	}
 
-	return utmp_entry;
+	return (struct utmp *)utmp_entry;
 }
 
-void utmpname(const char *new_ut_name)
+int utmpname (const char *new_ut_name)
 {
 	if (new_ut_name != NULL)
 		ut_name = new_ut_name;
 
 	if (ut_fd != -1)
 		close(ut_fd);
+	return 0;
 }

+ 9 - 0
libc/pwd_grp/config.h

@@ -22,6 +22,15 @@
 #ifndef _CONFIG_GRP_H
 #define _CONFIG_GRP_H
 
+#include <pwd.h>
+#include <grp.h>
+
+/* These are used internally to uClibc */
+extern struct group * __getgrent __P ((int grp_fd));
+
+extern int __getpwent_r(struct passwd * passwd, char * line_buff, 
+	size_t buflen, int pwd_fd);
+  
 /*
  * Define GR_SCALE_DYNAMIC if you want grp to dynamically scale its read buffer
  * so that lines of any length can be used.  On very very small systems,

+ 1 - 0
libc/pwd_grp/fgetgrent.c

@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <grp.h>
+#include "config.h"
 
 struct group *fgetgrent(FILE * file)
 {

+ 1 - 0
libc/pwd_grp/fgetpwent.c

@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <pwd.h>
+#include "config.h"
 
 #define PWD_BUFFER_SIZE 256
 

+ 1 - 0
libc/pwd_grp/getgrgid.c

@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <grp.h>
+#include "config.h"
 
 struct group *getgrgid(const gid_t gid)
 {

+ 1 - 0
libc/pwd_grp/getgrnam.c

@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <grp.h>
+#include "config.h"
 
 struct group *getgrnam(const char *name)
 {

+ 1 - 0
libc/pwd_grp/getpwnam.c

@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <pwd.h>
+#include "config.h"
 
 
 #define PWD_BUFFER_SIZE 256

+ 1 - 0
libc/pwd_grp/getpwuid.c

@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <pwd.h>
+#include "config.h"
 
 
 #define PWD_BUFFER_SIZE 256

+ 1 - 0
libc/pwd_grp/grent.c

@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <grp.h>
+#include "config.h"
 
 static int grp_fd = -1;
 

+ 1 - 0
libc/pwd_grp/pwent.c

@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <pwd.h>
 #include <fcntl.h>
+#include "config.h"
 
 /*
  * setpwent(), endpwent(), and getpwent() are included in the same object

+ 2 - 1
libc/signal/sigaddset.c

@@ -16,9 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <stdlib.h>
 #include <errno.h>
 #include <features.h>
-#include "signal.h"
+#include <signal.h>
 
 
 /* Add SIGNO to SET.  */

+ 0 - 1
libc/signal/sigblock.c

@@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <errno.h>
-#define __USE_BSD
 #include <signal.h>
 
 /* Block signals in MASK, returning the old mask.  */

+ 4 - 2
libc/signal/sigdelset.c

@@ -16,8 +16,10 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "errno.h"
-#include "signal.h"
+#include <stdlib.h>
+#include <errno.h>
+#include <features.h>
+#include <signal.h>
 
 /* Add SIGNO to SET.  */
 int sigdelset ( sigset_t *set, int signo)

+ 0 - 1
libc/signal/siggtmsk.c

@@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <errno.h>
-#define __USE_BSD
 #include <signal.h>
 
 /* Get the mask of blocked signals.  */

+ 4 - 2
libc/signal/sigismem.c

@@ -16,10 +16,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "errno.h"
+#include <stdlib.h>
+#include <errno.h>
+#include <features.h>
 #define _EXTERN_INLINE
 #define __USE_EXTERN_INLINES   1
-#include "signal.h"
+#include <signal.h>
 
 /* Return 1 if SIGNO is in SET, 0 if not.  */
 int sigismember ( const sigset_t *set, int signo)

+ 0 - 1
libc/signal/sigstmsk.c

@@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <errno.h>
-#define __USE_BSD
 #include <signal.h>
 
 /* Set the mask of blocked signals to MASK, returning the old mask.  */

+ 1 - 0
libc/stdio/getline.c

@@ -22,6 +22,7 @@
  */
 
 #include <stddef.h>
+#include <sys/types.h>
 #define __USE_GNU
 #include <stdio.h>
 

+ 1 - 0
libc/stdio/perror.c

@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdio.h>
 #include <errno.h>
 

+ 1 - 0
libc/stdio/scanf.c

@@ -33,6 +33,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#define __USE_ISOC99
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>

+ 1 - 0
libc/stdlib/atexit.c

@@ -20,6 +20,7 @@
  *      __stdio_close_all.
  */
 
+#include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
 

+ 1 - 1
libc/stdlib/getpt.c

@@ -86,4 +86,4 @@ getpt (void)
 #define PTYNAME2 "0123456789abcdef";
 
 #define __getpt __bsd_getpt
-#include <bsd_getpt.c>
+#include "bsd_getpt.c"

+ 1 - 1
libc/stdlib/grantpt.c

@@ -63,4 +63,4 @@ grantpt (int fd)
 }
 
 #define grantpt __unix_grantpt
-#include <unix_grantpt.c>
+#include "unix_grantpt.c"

+ 1 - 1
libc/stdlib/malloc/malloc.c

@@ -53,9 +53,9 @@
  *   Converted INIT_BLOCK() and FREE_MEM_DEL_BLOCK() from macros to functions.
  */
 
+#include <features.h>
 #define _POSIX_SOURCE
 #define _XOPEN_SOURCE
-#include <features.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <limits.h>

+ 1 - 1
libc/stdlib/ptsname.c

@@ -145,7 +145,7 @@ int ptsname_r (int fd, char *buf, size_t buflen)
       p[2] = '\0';
     }
 
-  if (_xstat (_STAT_VER, buf, &st) < 0)
+  if (__xstat (_STAT_VER, buf, &st) < 0)
     return errno;
 
   /* Check if the name we're about to return really corresponds to a

+ 1 - 2
libc/stdlib/putenv.c

@@ -9,8 +9,7 @@
 
 #define ADD_NUM 4
 
-int putenv(var)
-const char *var;
+int putenv (char *var)
 {
 	static char **mall_env = 0;
 	static int extras = 0;

+ 2 - 1
libc/stdlib/setenv.c

@@ -122,7 +122,7 @@ do_return:
 }
 
 
-void unsetenv(const char *name)
+int unsetenv (const char *name)
 {
   register char **ep;
   register char **dp;
@@ -139,4 +139,5 @@ void unsetenv(const char *name)
   *dp = NULL;
 
   UNLOCK();
+  return 0;
 }

+ 1 - 0
libc/stdlib/strto_ll.c

@@ -40,6 +40,7 @@
 #endif
 
 #include <stdlib.h>
+#define __USE_GNU
 #include <limits.h>
 #include <ctype.h>
 

+ 1 - 1
libc/stdlib/unix_grantpt.c

@@ -106,7 +106,7 @@ grantpt (int fd)
   if (pts_name (fd, &buf, sizeof (_buf)))
     return -1;
 
-  if (_xstat (_STAT_VER, buf, &st) < 0)
+  if (__xstat (_STAT_VER, buf, &st) < 0)
     goto cleanup;
 
   /* Make sure that we own the device.  */

+ 3 - 3
libc/string/strsignal.c

@@ -23,12 +23,12 @@
  */
 
 #define WANT_SIGLIST       1
-
-#include <string.h>
+#include <stdlib.h>
 #include <malloc.h>
 #include <signal.h>
-
 #include <limits.h>
+#define __USE_GNU
+#include <string.h>
 
 #if (INT_MAX >> 31)
 /* We're set up for 32 bit ints */

+ 29 - 14
libc/sysdeps/linux/arm/bits/byteswap.h

@@ -1,21 +1,21 @@
 /* Macros to swap the order of bytes in integer values.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #if !defined _BYTESWAP_H && !defined _NETINET_IN_H
 # error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
@@ -53,12 +53,27 @@ __bswap_32 (unsigned int __bsx)
 
 #if defined __GNUC__ && __GNUC__ >= 2
 /* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
 # define __bswap_64(x) \
      (__extension__							      \
-      ({ union { unsigned long long int __ll;				      \
-		 unsigned long int __l[2]; } __v, __r;			      \
-	 __v.__ll = (x);						      \
-	 __r.__l[0] = __bswap_32 (__v.__l[1]);				      \
-	 __r.__l[1] = __bswap_32 (__v.__l[0]);				      \
+      ({ union { __extension__ unsigned long long int __ll;		      \
+		 unsigned int __l[2]; } __w, __r;			      \
+         if (__builtin_constant_p (x))					      \
+	   __r.__ll = __bswap_constant_64 (x);				      \
+	 else								      \
+	   {								      \
+	     __w.__ll = (x);						      \
+	     __r.__l[0] = __bswap_32 (__w.__l[1]);			      \
+	     __r.__l[1] = __bswap_32 (__w.__l[0]);			      \
+	   }								      \
 	 __r.__ll; }))
 #endif

+ 200 - 45
libc/sysdeps/linux/arm/bits/confname.h

@@ -1,21 +1,21 @@
 /* `sysconf', `pathconf', and `confstr' NAME values.  Generic version.
-   Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1995-1998, 2000, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _UNISTD_H
 # error "Never use <bits/confname.h> directly; include <unistd.h> instead."
@@ -50,8 +50,20 @@ enum
 #define	_PC_PRIO_IO			_PC_PRIO_IO
     _PC_SOCK_MAXBUF,
 #define	_PC_SOCK_MAXBUF			_PC_SOCK_MAXBUF
-    _PC_FILESIZEBITS
+    _PC_FILESIZEBITS,
 #define _PC_FILESIZEBITS		_PC_FILESIZEBITS
+    _PC_REC_INCR_XFER_SIZE,
+#define _PC_REC_INCR_XFER_SIZE		_PC_REC_INCR_XFER_SIZE
+    _PC_REC_MAX_XFER_SIZE,
+#define _PC_REC_MAX_XFER_SIZE		_PC_REC_MAX_XFER_SIZE
+    _PC_REC_MIN_XFER_SIZE,
+#define _PC_REC_MIN_XFER_SIZE		_PC_REC_MIN_XFER_SIZE
+    _PC_REC_XFER_ALIGN,
+#define _PC_REC_XFER_ALIGN		_PC_REC_XFER_ALIGN
+    _PC_ALLOC_SIZE_MIN,
+#define _PC_ALLOC_SIZE_MIN		_PC_ALLOC_SIZE_MIN
+    _PC_SYMLINK_MAX
+#define _PC_SYMLINK_MAX			_PC_SYMLINK_MAX
   };
 
 /* Values for the argument to `sysconf'.  */
@@ -185,6 +197,8 @@ enum
 #define	_SC_SELECT			_SC_SELECT
     _SC_UIO_MAXIOV,
 #define	_SC_UIO_MAXIOV			_SC_UIO_MAXIOV
+    _SC_IOV_MAX = _SC_UIO_MAXIOV,
+#define _SC_IOV_MAX			_SC_IOV_MAX
     _SC_PII_INTERNET_STREAM,
 #define	_SC_PII_INTERNET_STREAM		_SC_PII_INTERNET_STREAM
     _SC_PII_INTERNET_DGRAM,
@@ -338,8 +352,114 @@ enum
     _SC_XOPEN_REALTIME_THREADS,
 #define _SC_XOPEN_REALTIME_THREADS	_SC_XOPEN_REALTIME_THREADS
 
-	/* MUST BE LAST VALUE!!! */
-	_UCLIBC_SYSCONF_NUM_VALID_ARGS
+    _SC_ADVISORY_INFO,
+#define _SC_ADVISORY_INFO		_SC_ADVISORY_INFO
+    _SC_BARRIERS,
+#define _SC_BARRIERS			_SC_BARRIERS
+    _SC_BASE,
+#define _SC_BASE			_SC_BASE
+    _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT		_SC_C_LANG_SUPPORT
+    _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R		_SC_C_LANG_SUPPORT_R
+    _SC_CLOCK_SELECTION,
+#define _SC_CLOCK_SELECTION		_SC_CLOCK_SELECTION
+    _SC_CPUTIME,
+#define _SC_CPUTIME			_SC_CPUTIME
+    _SC_THREAD_CPUTIME,
+#define _SC_THREAD_CPUTIME		_SC_THREAD_CPUTIME
+    _SC_DEVICE_IO,
+#define _SC_DEVICE_IO			_SC_DEVICE_IO
+    _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC		_SC_DEVICE_SPECIFIC
+    _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R		_SC_DEVICE_SPECIFIC_R
+    _SC_FD_MGMT,
+#define _SC_FD_MGMT			_SC_FD_MGMT
+    _SC_FIFO,
+#define _SC_FIFO			_SC_FIFO
+    _SC_PIPE,
+#define _SC_PIPE			_SC_PIPE
+    _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES		_SC_FILE_ATTRIBUTES
+    _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING		_SC_FILE_LOCKING
+    _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM			_SC_FILE_SYSTEM
+    _SC_MONOTONIC_CLOCK,
+#define _SC_MONOTONIC_CLOCK		_SC_MONOTONIC_CLOCK
+    _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS		_SC_MULTI_PROCESS
+    _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS		_SC_SINGLE_PROCESS
+    _SC_NETWORKING,
+#define _SC_NETWORKING			_SC_NETWORKING
+    _SC_READER_WRITER_LOCKS,
+#define _SC_READER_WRITER_LOCKS		_SC_READER_WRITER_LOCKS
+    _SC_SPIN_LOCKS,
+#define _SC_SPIN_LOCKS			_SC_SPIN_LOCKS
+    _SC_REGEXP,
+#define _SC_REGEXP			_SC_REGEXP
+    _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION		_SC_REGEX_VERSION
+    _SC_SHELL,
+#define _SC_SHELL			_SC_SHELL
+    _SC_SIGNALS,
+#define _SC_SIGNALS			_SC_SIGNALS
+    _SC_SPAWN,
+#define _SC_SPAWN			_SC_SPAWN
+    _SC_SPORADIC_SERVER,
+#define _SC_SPORADIC_SERVER		_SC_SPORADIC_SERVER
+    _SC_THREAD_SPORADIC_SERVER,
+#define _SC_THREAD_SPORADIC_SERVER	_SC_THREAD_SPORADIC_SERVER
+    _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE		_SC_SYSTEM_DATABASE
+    _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R		_SC_SYSTEM_DATABASE_R
+    _SC_TIMEOUTS,
+#define _SC_TIMEOUTS			_SC_TIMEOUTS
+    _SC_TYPED_MEMORY_OBJECTS,
+#define _SC_TYPED_MEMORY_OBJECTS	_SC_TYPED_MEMORY_OBJECTS
+    _SC_USER_GROUPS,
+#define _SC_USER_GROUPS			_SC_USER_GROUPS
+    _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R		_SC_USER_GROUPS_R
+    _SC_2_PBS,
+#define _SC_2_PBS			_SC_2_PBS
+    _SC_2_PBS_ACCOUNTING,
+#define _SC_2_PBS_ACCOUNTING		_SC_2_PBS_ACCOUNTING
+    _SC_2_PBS_LOCATE,
+#define _SC_2_PBS_LOCATE		_SC_2_PBS_LOCATE
+    _SC_2_PBS_MESSAGE,
+#define _SC_2_PBS_MESSAGE		_SC_2_PBS_MESSAGE
+    _SC_2_PBS_TRACK,
+#define _SC_2_PBS_TRACK			_SC_2_PBS_TRACK
+    _SC_SYMLOOP_MAX,
+#define _SC_SYMLOOP_MAX			_SC_SYMLOOP_MAX
+    _SC_STREAMS,
+#define _SC_STREAMS			_SC_STREAMS
+    _SC_2_PBS_CHECKPOINT,
+#define _SC_2_PBS_CHECKPOINT		_SC_2_PBS_CHECKPOINT
+
+    _SC_V6_ILP32_OFF32,
+#define _SC_V6_ILP32_OFF32		_SC_V6_ILP32_OFF32
+    _SC_V6_ILP32_OFFBIG,
+#define _SC_V6_ILP32_OFFBIG		_SC_V6_ILP32_OFFBIG
+    _SC_V6_LP64_OFF64,
+#define _SC_V6_LP64_OFF64		_SC_V6_LP64_OFF64
+    _SC_V6_LPBIG_OFFBIG,
+#define _SC_V6_LPBIG_OFFBIG		_SC_V6_LPBIG_OFFBIG
+
+    _SC_HOST_NAME_MAX,
+#define _SC_HOST_NAME_MAX		_SC_HOST_NAME_MAX
+    _SC_TRACE,
+#define _SC_TRACE			_SC_TRACE
+    _SC_TRACE_EVENT_FILTER,
+#define _SC_TRACE_EVENT_FILTER		_SC_TRACE_EVENT_FILTER
+    _SC_TRACE_INHERIT,
+#define _SC_TRACE_INHERIT		_SC_TRACE_INHERIT
+    _SC_TRACE_LOG
+#define _SC_TRACE_LOG			_SC_TRACE_LOG
   };
 
 #if (defined __USE_POSIX2 || defined __USE_UNIX98 \
@@ -348,64 +468,99 @@ enum
 /* Values for the NAME argument to `confstr'.  */
 enum
   {
-    _CS_PATH			/* The default search path.  */
+    _CS_PATH,			/* The default search path.  */
 #define _CS_PATH		_CS_PATH
 
-#if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+# if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
      || defined __USE_LARGEFILE)
-    ,
     _CS_LFS_CFLAGS = 1000,
-# define _CS_LFS_CFLAGS		_CS_LFS_CFLAGS
+#  define _CS_LFS_CFLAGS		_CS_LFS_CFLAGS
     _CS_LFS_LDFLAGS,
-# define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
+#  define _CS_LFS_LDFLAGS	_CS_LFS_LDFLAGS
     _CS_LFS_LIBS,
-# define _CS_LFS_LIBS		_CS_LFS_LIBS
+#  define _CS_LFS_LIBS		_CS_LFS_LIBS
     _CS_LFS_LINTFLAGS,
-# define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
+#  define _CS_LFS_LINTFLAGS	_CS_LFS_LINTFLAGS
     _CS_LFS64_CFLAGS,
-# define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
+#  define _CS_LFS64_CFLAGS	_CS_LFS64_CFLAGS
     _CS_LFS64_LDFLAGS,
-# define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
+#  define _CS_LFS64_LDFLAGS	_CS_LFS64_LDFLAGS
     _CS_LFS64_LIBS,
-# define _CS_LFS64_LIBS		_CS_LFS64_LIBS
-    _CS_LFS64_LINTFLAGS
-# define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
-#endif
+#  define _CS_LFS64_LIBS		_CS_LFS64_LIBS
+    _CS_LFS64_LINTFLAGS,
+#  define _CS_LFS64_LINTFLAGS	_CS_LFS64_LINTFLAGS
+# endif
 
-#ifdef __USE_UNIX98
-    ,
+# ifdef __USE_UNIX98
     _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
-# define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+#  define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
     _CS_XBS5_ILP32_OFF32_LDFLAGS,
-# define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+#  define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
     _CS_XBS5_ILP32_OFF32_LIBS,
-# define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+#  define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
     _CS_XBS5_ILP32_OFF32_LINTFLAGS,
-# define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+#  define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
     _CS_XBS5_ILP32_OFFBIG_CFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
     _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
     _CS_XBS5_ILP32_OFFBIG_LIBS,
-# define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+#  define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
     _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
-# define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+#  define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
     _CS_XBS5_LP64_OFF64_CFLAGS,
-# define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+#  define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
     _CS_XBS5_LP64_OFF64_LDFLAGS,
-# define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+#  define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
     _CS_XBS5_LP64_OFF64_LIBS,
-# define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+#  define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
     _CS_XBS5_LP64_OFF64_LINTFLAGS,
-# define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+#  define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
     _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
-# define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+#  define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
     _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
-# define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+#  define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
     _CS_XBS5_LPBIG_OFFBIG_LIBS,
-# define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
-    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
-# define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
-#endif
+#  define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+    _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
+#  define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+# endif
+# ifdef __USE_XOPEN2K
+    _CS_POSIX_V6_ILP32_OFF32_CFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFF32_LIBS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+    _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_ILP32_OFFBIG_LIBS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+    _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
+#  define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+    _CS_POSIX_V6_LP64_OFF64_CFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LDFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+    _CS_POSIX_V6_LP64_OFF64_LIBS,
+#  define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+    _CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
+#  define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+    _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
+#  define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+# endif
+
+    _CS_V6_WIDTH_RESTRICTED_ENVS
+# define _CS_V6_WIDTH_RESTRICTED_ENVS	_CS_V6_WIDTH_RESTRICTED_ENVS
   };
 #endif

+ 11 - 20
libc/sysdeps/linux/arm/bits/dirent.h

@@ -2,29 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/*
- * June 25, 2001
- *
- * Removed d_type support for dirent and undefined _DIRENT_HAVE_D_TYPE;
- * i.e. match the kernel structs and avoid any translation for now.
- * Note: glibc fakes d_type for the dirent case.
- * Note: dirent64 still has the d_type field.
- */
+   Lesser General Public License for more details.
 
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _DIRENT_H
 # error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
@@ -40,6 +30,7 @@ struct dirent
     __off64_t d_off;
 #endif
     unsigned short int d_reclen;
+    //unsigned char d_type;
     char d_name[256];		/* We must not include limits.h! */
   };
 
@@ -49,7 +40,7 @@ struct dirent64
     __ino64_t d_ino;
     __off64_t d_off;
     unsigned short int d_reclen;
-    unsigned char d_type;
+    //unsigned char d_type;
     char d_name[256];		/* We must not include limits.h! */
   };
 #endif
@@ -59,4 +50,4 @@ struct dirent64
 #undef  _DIRENT_HAVE_D_NAMLEN
 #define _DIRENT_HAVE_D_RECLEN
 #define _DIRENT_HAVE_D_OFF
-#undef  _DIRENT_HAVE_D_TYPE
+#define _DIRENT_HAVE_D_TYPE

+ 8 - 10
libc/sysdeps/linux/arm/bits/dlfcn.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _DLFCN_H
 # error "Never use <bits/dlfcn.h> directly; include <dlfcn.h> instead."
@@ -55,7 +55,5 @@
   (_dl_mcount_wrapper_check (fctp), (*(fctp)) args)
 
 /* This function calls the profiling functions.  */
-__BEGIN_DECLS
 extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW;
-__END_DECLS
 #endif

+ 9 - 11
libc/sysdeps/linux/arm/bits/errno.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifdef _ERRNO_H
 
@@ -32,12 +32,11 @@
 # define ECANCELED	125
 
 # ifndef __ASSEMBLER__
-   __BEGIN_DECLS
 /* We now need a declaration of the `errno' variable.  */
 extern int errno;
 
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
 
 #  if defined _LIBC
 /* We wouldn't need a special macro anymore but it is history.  */
@@ -48,7 +47,6 @@ extern int *__errno_location (void) __attribute__ ((__const__));
 /* When using threads, errno is a per-thread value.  */
 #   define errno (*__errno_location ())
 #  endif
-   __END_DECLS
 # endif /* !__ASSEMBLER__ */
 #endif /* _ERRNO_H */
 

+ 66 - 27
libc/sysdeps/linux/arm/bits/fcntl.h

@@ -1,21 +1,21 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef	_FCNTL_H
 # error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
@@ -42,21 +42,21 @@
 #define O_ASYNC		020000
 
 #ifdef __USE_GNU
-# define O_DIRECTORY	040000	/* Must be a directory.  */
-# define O_NOFOLLOW	0100000	/* Do not follow links.  */
+# define O_DIRECTORY	040000	/* Must be a directory.	 */
+# define O_NOFOLLOW	0100000	/* Do not follow links.	 */
+# define O_DIRECT	0200000	/* Direct disk access.	*/
 #endif
 
-/* XXX missing */
 #ifdef __USE_LARGEFILE64
-# define O_LARGEFILE	0
+# define O_LARGEFILE	0400000
 #endif
 
 /* For now Linux has synchronisity options for data and read operations.
    We define the symbols here but let them do the same as O_SYNC since
-   this is a superset.  */
+   this is a superset.	*/
 #if defined __USE_POSIX199309 || defined __USE_UNIX98
 # define O_DSYNC	O_SYNC	/* Synchronize data.  */
-# define O_RSYNC	O_SYNC	/* Synchronize read operations.  */
+# define O_RSYNC	O_SYNC	/* Synchronize read operations.	 */
 #endif
 
 /* Values for the second argument to `fcntl'.  */
@@ -65,16 +65,21 @@
 #define F_SETFD		2	/* Set file descriptor flags.  */
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
-#define F_GETLK		5	/* Get record locking info.  */
-#define F_SETLK		6	/* Set record locking info (non-blocking).  */
-#define F_SETLKW	7	/* Set record locking info (blocking).  */
 
-/* XXX missing */
-#define F_GETLK64	5	/* Get record locking info.  */
-#define F_SETLK64	6	/* Set record locking info (non-blocking).  */
-#define F_SETLKW64	7	/* Set record locking info (blocking).  */
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK	5	/* Get record locking info.  */
+# define F_SETLK	6	/* Set record locking info (non-blocking).  */
+# define F_SETLKW	7	/* Set record locking info (blocking).	*/
+#else
+# define F_GETLK	F_GETLK64  /* Get record locking info.	*/
+# define F_SETLK	F_SETLK64  /* Set record locking info (non-blocking).*/
+# define F_SETLKW	F_SETLKW64 /* Set record locking info (blocking).  */
+#endif
+#define F_GETLK64	12	/* Get record locking info.  */
+#define F_SETLK64	13	/* Set record locking info (non-blocking).  */
+#define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_XOPEN2K
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
@@ -84,13 +89,19 @@
 # define F_GETSIG	11	/* Get number of signal to be sent.  */
 #endif
 
+#ifdef __USE_GNU
+# define F_SETLEASE	1024	/* Set a lease.	 */
+# define F_GETLEASE	1025	/* Enquire what lease is active.  */
+# define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+
 /* For F_[GET|SET]FL.  */
 #define FD_CLOEXEC	1	/* actually anything with low bit set goes */
 
 /* For posix fcntl() and `l_type' field of a `struct flock' for lockf().  */
 #define F_RDLCK		0	/* Read lock.  */
-#define F_WRLCK		1	/* Write lock.  */
-#define F_UNLCK		2	/* Remove lock.  */
+#define F_WRLCK		1	/* Write lock.	*/
+#define F_UNLCK		2	/* Remove lock.	 */
 
 /* for old implementation of bsd flock () */
 #define F_EXLCK		4	/* or 3 */
@@ -105,9 +116,27 @@
 # define LOCK_UN	8	/* remove lock */
 #endif
 
+#ifdef __USE_GNU
+# define LOCK_MAND	32	/* This is a mandatory flock:	*/
+# define LOCK_READ	64	/* ... which allows concurrent read operations.	 */
+# define LOCK_WRITE	128	/* ... which allows concurrent write operations.  */
+# define LOCK_RW	192	/* ... Which allows concurrent read & write operations.	 */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY.  */
+# define DN_ACCESS	0x00000001	/* File accessed.  */
+# define DN_MODIFY	0x00000002	/* File modified.  */
+# define DN_CREATE	0x00000004	/* File created.  */
+# define DN_DELETE	0x00000008	/* File removed.  */
+# define DN_RENAME	0x00000010	/* File renamed.  */
+# define DN_ATTRIB	0x00000020	/* File changed attibutes.  */
+# define DN_MULTISHOT	0x80000000	/* Don't remove notifier.  */
+#endif
+
 struct flock
   {
-    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
     short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
 #ifndef __USE_FILE_OFFSET64
     __off_t l_start;	/* Offset where the lock begins.  */
@@ -122,7 +151,7 @@ struct flock
 #ifdef __USE_LARGEFILE64
 struct flock64
   {
-    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.	*/
     short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
     __off64_t l_start;	/* Offset where the lock begins.  */
     __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
@@ -139,3 +168,13 @@ struct flock64
 # define FNONBLOCK	O_NONBLOCK
 # define FNDELAY	O_NDELAY
 #endif /* Use BSD.  */
+
+/* Advise to `posix_fadvise'.  */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL	0 /* No further special treatment.  */
+# define POSIX_FADV_RANDOM	1 /* Expect random page references.  */
+# define POSIX_FADV_SEQUENTIAL	2 /* Expect sequential page references.	 */
+# define POSIX_FADV_WILLNEED	3 /* Will need these pages.  */
+# define POSIX_FADV_DONTNEED	4 /* Don't need these pages.  */
+# define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
+#endif

+ 8 - 8
libc/sysdeps/linux/arm/bits/huge_val.h

@@ -5,19 +5,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _MATH_H
 # error "Never use <bits/huge_val.h> directly; include <math.h> instead."

+ 27 - 14
libc/sysdeps/linux/arm/bits/in.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* Linux version.  */
 
@@ -99,7 +99,7 @@ struct in_pktinfo
 #define IPV6_PKTINFO		2
 #define IPV6_HOPOPTS		3
 #define IPV6_DSTOPTS		4
-#define IPV6_RXSRCRT		5
+#define IPV6_RTHDR		5
 #define IPV6_PKTOPTIONS		6
 #define IPV6_CHECKSUM		7
 #define IPV6_HOPLIMIT		8
@@ -109,14 +109,21 @@ struct in_pktinfo
 #define IPV6_MULTICAST_IF	17
 #define IPV6_MULTICAST_HOPS	18
 #define IPV6_MULTICAST_LOOP	19
-#define IPV6_ADD_MEMBERSHIP	20
-#define IPV6_DROP_MEMBERSHIP	21
+#define IPV6_JOIN_GROUP		20
+#define IPV6_LEAVE_GROUP	21
 #define IPV6_ROUTER_ALERT	22
+#define IPV6_MTU_DISCOVER	23
+#define IPV6_MTU		24
+#define IPV6_RECVERR		25
 
 #define SCM_SRCRT		IPV6_RXSRCRT
 
-#define IPV6_RXHOPOPTS		IPV6_HOPOPTS	/* obsolete name */
-#define IPV6_RXDSTOPTS		IPV6_DSTOPTS	/* obsolete name */
+/* Obsolete synonyms for the above.  */
+#define IPV6_RXHOPOPTS		IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS		IPV6_DSTOPTS
+#define IPV6_ADD_MEMBERSHIP	IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP	IPV6_LEAVE_GROUP
+
 
 /* IPV6_MTU_DISCOVER values.  */
 #define IPV6_PMTUDISC_DONT	0	/* Never send DF frames.  */
@@ -126,3 +133,9 @@ struct in_pktinfo
 /* Socket level values for IPv6.  */
 #define SOL_IPV6        41
 #define SOL_ICMPV6      58
+
+/* Routing header options for IPv6.  */
+#define IPV6_RTHDR_LOOSE	0	/* Hop doesn't need to be neighbour. */
+#define IPV6_RTHDR_STRICT	1	/* Hop must be a neighbour.  */
+
+#define IPV6_RTHDR_TYPE_0	0	/* IPv6 Routing header type 0.  */

+ 10 - 9
libc/sysdeps/linux/arm/bits/ioctl-types.h

@@ -1,21 +1,21 @@
 /* Structure types for pre-termios terminal ioctls.  Linux version.
-   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_IOCTL_H
 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
@@ -75,3 +75,4 @@ struct termio
 #define N_SMSBLOCK	12	/* SMS block mode  */
 #define N_HDLC		13	/* synchronous HDLC  */
 #define N_SYNC_PPP	14	/* synchronous PPP  */
+#define	N_HCI		15	/* Bluetooth HCI UART  */

+ 8 - 8
libc/sysdeps/linux/arm/bits/ioctls.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_IOCTL_H
 # error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."

+ 21 - 15
libc/sysdeps/linux/arm/bits/ipc.h

@@ -1,26 +1,26 @@
-/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_IPC_H
 # error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* Mode bits for `msgget', `semget', and `shmget'.  */
 #define IPC_CREAT	01000		/* Create key if key does not exist. */
@@ -31,7 +31,9 @@
 #define IPC_RMID	0		/* Remove identifier.  */
 #define IPC_SET		1		/* Set `ipc_perm' options.  */
 #define IPC_STAT	2		/* Get `ipc_perm' options.  */
-#define IPC_INFO	3		/* See ipcs.  */
+#ifdef __USE_GNU
+# define IPC_INFO	3		/* See ipcs.  */
+#endif
 
 /* Special key values.  */
 #define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
@@ -41,10 +43,14 @@
 struct ipc_perm
   {
     __key_t __key;			/* Key.  */
-    unsigned short int uid;		/* Owner's user ID.  */
-    unsigned short int gid;		/* Owner's group ID.  */
-    unsigned short int cuid;		/* Creator's user ID.  */
-    unsigned short int cgid;		/* Creator's group ID.  */
+    __uid_t uid;			/* Owner's user ID.  */
+    __gid_t gid;			/* Owner's group ID.  */
+    __uid_t cuid;			/* Creator's user ID.  */
+    __gid_t cgid;			/* Creator's group ID.  */
     unsigned short int mode;		/* Read/write permission.  */
+    unsigned short int __pad1;
     unsigned short int __seq;		/* Sequence number.  */
+    unsigned short int __pad2;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
   };

+ 25 - 3
libc/sysdeps/linux/arm/bits/local_lim.h

@@ -1,5 +1,5 @@
 /* Minimum guaranteed maximum values for system limits.  Linux version.
-   Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1993, 94, 95, 96, 97, 98, 2000 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
@@ -17,11 +17,20 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* The kernel header pollutes the namespace with the NR_OPEN symbol.
-   Remove this after including the header if necessary.  */
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+   and defines LINK_MAX although filesystems have different maxima.  A
+   similar thing is true for OPEN_MAX: the limit can be changed at
+   runtime and therefore the macro must not be defined.  Remove this
+   after including the header if necessary.  */
 #ifndef NR_OPEN
 # define __undef_NR_OPEN
 #endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
 
 /* The kernel sources contain a file with all the needed information.  */
 #include <linux/limits.h>
@@ -31,6 +40,16 @@
 # undef NR_OPEN
 # undef __undef_NR_OPEN
 #endif
+/* Have to remove LINK_MAX?  */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX?  */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
 
 /* The number of data keys per process.  */
 #define _POSIX_THREAD_KEYS_MAX	128
@@ -53,3 +72,6 @@
 
 /* Minimum size for a thread.  We are free to choose a reasonable value.  */
 #define PTHREAD_STACK_MIN	16384
+
+/* Maximum number of POSIX timers available.  */
+#define TIMER_MAX	256

+ 9 - 21
libc/sysdeps/linux/arm/bits/mathcalls.h

@@ -1,21 +1,21 @@
 /* Prototype declarations for math functions; helper file for <math.h>.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* NOTE: Because of the special way this file is used by <math.h>, this
    file must NOT be protected from multiple inclusion as header files
@@ -48,7 +48,6 @@
 #endif
 
 
-__BEGIN_DECLS
 /* Trigonometric functions.  */
 
 /* Arc cosine of X.  */
@@ -187,14 +186,6 @@ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
 /* Return nonzero if VALUE is finite and not NaN.  */
 __MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
 
-/* Deal with an infinite or NaN result.
-   If ERROR is ERANGE, result is +Inf;
-   if ERROR is - ERANGE, result is -Inf;
-   otherwise result is NaN.
-   This will set `errno' to either ERANGE or EDOM,
-   and may return an infinity or NaN, or may do something else.  */
-__MATHCALLX (infnan,, (int __error), (__const__));
-
 /* Return the remainder of X/Y.  */
 __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y));
 
@@ -339,7 +330,4 @@ __MATHDECL_1 (int, __signbit,, (_Mdouble_ __value))
 
 /* Multiply-add function computed as a ternary operation.  */
 __MATHCALL (fma,, (_Mdouble_ __x, _Mdouble_ __y, _Mdouble_ __z));
-
 #endif /* Use ISO C99.  */
-
-__END_DECLS

+ 8 - 8
libc/sysdeps/linux/arm/bits/mathdef.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #if !defined _MATH_H && !defined _COMPLEX_H
 # error "Never use <bits/mathdef.h> directly; include <math.h> instead"

+ 8 - 8
libc/sysdeps/linux/arm/bits/mman.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_MMAN_H
 # error "Never include this file directly.  Use <sys/mman.h> instead"

+ 8 - 8
libc/sysdeps/linux/arm/bits/msq.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_MSG_H
 # error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."

+ 9 - 12
libc/sysdeps/linux/arm/bits/poll.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_POLL_H
 # error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
@@ -46,6 +46,3 @@
 #define POLLERR		0x008		/* Error condition.  */
 #define POLLHUP		0x010		/* Hung up.  */
 #define POLLNVAL	0x020		/* Invalid polling request.  */
-
-/* Canonical number of polling requests to read in at a time in poll.  */
-#define NPOLLFILE	30

+ 11 - 11
libc/sysdeps/linux/arm/bits/posix1_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,96,98,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  *	POSIX Standard: 2.9.2 Minimum Values	Added to <limits.h>
@@ -73,7 +73,7 @@
 #define	_POSIX_NAME_MAX		14
 
 /* Number of bytes in a pathname.  */
-#define	_POSIX_PATH_MAX		255
+#define	_POSIX_PATH_MAX		256
 
 /* Number of bytes than can be written atomically to a pipe.  */
 #define	_POSIX_PIPE_BUF		512
@@ -97,7 +97,7 @@
 #define	_POSIX_STREAM_MAX	8
 
 /* Maximum length of a timezone name (element of `tzname').  */
-#define	_POSIX_TZNAME_MAX	3
+#define	_POSIX_TZNAME_MAX	6
 
 /* Maximum number of connections that can be queued on a socket.  */
 #define	_POSIX_QLIMIT		1

+ 14 - 23
libc/sysdeps/linux/arm/bits/posix2_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1996, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 1999, 2000, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  * Never include this file directly; include <limits.h> instead.
@@ -37,14 +37,8 @@
 #define	_POSIX2_BC_STRING_MAX		1000
 
 /* The maximum number of weights that can be assigned to an entry of
-   the LC_COLLATE `order' keyword in the locale definition file.
-   We have no fixed limit, 255 is very high.  */
-#define	_POSIX2_COLL_WEIGHTS_MAX	255
-
-/* The maximum number of weights that can be assigned to an entry of
-   the LC_COLLATE category `order' keyword in a locale definition.
-   We have no fixed limit, 255 is a high number.  */
-#define	_POSIX2_EQUIV_CLASS_MAX		255
+   the LC_COLLATE `order' keyword in the locale definition file.  */
+#define	_POSIX2_COLL_WEIGHTS_MAX	2
 
 /* The maximum number of expressions that can be nested
    within parentheses by the `expr' utility.  */
@@ -59,7 +53,7 @@
 
 /* The maximum number of bytes in a character class name.  We have no
    fixed limit, 2048 is a high number.  */
-#define	_POSIX2_CHARCLASS_NAME_MAX	2048
+#define	_POSIX2_CHARCLASS_NAME_MAX	14
 
 
 /* These values are implementation-specific,
@@ -79,10 +73,7 @@
 #define	BC_STRING_MAX		_POSIX2_BC_STRING_MAX
 #endif
 #ifndef	COLL_WEIGHTS_MAX
-#define	COLL_WEIGHTS_MAX	_POSIX2_COLL_WEIGHTS_MAX
-#endif
-#ifndef	EQUIV_CLASS_MAX
-#define	EQUIV_CLASS_MAX		_POSIX2_EQUIV_CLASS_MAX
+#define	COLL_WEIGHTS_MAX	255
 #endif
 #ifndef	EXPR_NEST_MAX
 #define	EXPR_NEST_MAX		_POSIX2_EXPR_NEST_MAX
@@ -91,7 +82,7 @@
 #define	LINE_MAX		_POSIX2_LINE_MAX
 #endif
 #ifndef	CHARCLASS_NAME_MAX
-#define	CHARCLASS_NAME_MAX	_POSIX2_CHARCLASS_NAME_MAX
+#define	CHARCLASS_NAME_MAX	2048
 #endif
 
 /* This value is defined like this in regex.h.  */

+ 35 - 4
libc/sysdeps/linux/arm/bits/posix_opt.h

@@ -1,5 +1,5 @@
 /* Define POSIX options for Linux.
-   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2000,2001 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
@@ -67,13 +67,13 @@
 #define _XOPEN_REALTIME	1
 
 /* X/Open realtime thread support is available.  */
-#define _XOPEN_REALTIME_THREADS	1
+#undef _XOPEN_REALTIME_THREADS
 
 /* XPG4.2 shared memory is supported.  */
 #define	_XOPEN_SHM	1
 
 /* Tell we have POSIX threads.  */
-#define _POSIX_THREADS	1
+#undef _POSIX_THREADS
 
 /* We have the reentrant functions described in POSIX.  */
 #define _POSIX_REENTRANT_FUNCTIONS      1
@@ -89,13 +89,14 @@
 #define _POSIX_THREAD_ATTR_STACKADDR	1
 
 /* We support POSIX.1b semaphores, but only the non-shared form for now.  */
-/*#define _POSIX_SEMAPHORES	1	XXX We are not quite there now.  */
+#define _POSIX_SEMAPHORES	1
 
 /* Real-time signals are supported.  */
 #define _POSIX_REALTIME_SIGNALS	1
 
 /* We support asynchronous I/O.  */
 #define _POSIX_ASYNCHRONOUS_IO	1
+#define _POSIX_ASYNC_IO		1
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO	1
 
@@ -107,4 +108,34 @@
 #define _LFS64_LARGEFILE	1
 #define _LFS64_STDIO		1
 
+/* POSIX shared memory objects are implemented.  */
+#define _POSIX_SHARED_MEMORY_OBJECTS	1
+
+/* GNU libc provides regular expression handling.  */
+#define _POSIX_REGEXP	1
+
+/* Reader/Writer locks are available.  */
+#define _POSIX_READER_WRITER_LOCKS	200912L
+
+/* We have a POSIX shell.  */
+#define _POSIX_SHELL	1
+
+/* We support the Timeouts option.  */
+#define _POSIX_TIMEOUTS	200912L
+
+/* We support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	200912L
+
+/* The `spawn' function family is supported.  */
+#define _POSIX_SPAWN	200912L
+
+/* We have POSIX timers.  */
+#define _POSIX_TIMERS	1
+
+/* The barrier functions are available.  */
+#define _POSIX_BARRIERS	200912L
+
+/* POSIX message queues are not yet supported.  */
+#undef	_POSIX_MESSAGE_PASSING
+
 #endif /* posix_opt.h */

+ 8 - 8
libc/sysdeps/linux/arm/bits/resource.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_RESOURCE_H
 # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."

+ 11 - 11
libc/sysdeps/linux/arm/bits/select.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_SELECT_H
 # error "Never use <bits/select.h> directly; include <sys/select.h> instead."
@@ -26,8 +26,8 @@
 #define __FD_ZERO(s) \
   do {									      \
     unsigned int __i;							      \
-    __fd_set *__arr = (s);						      \
-    for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i)	      \
+    fd_set *__arr = (s);						      \
+    for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i)	      \
       __FDS_BITS (__arr)[__i] = 0;					      \
   } while (0)
 #define __FD_SET(d, s)     (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))

+ 8 - 8
libc/sysdeps/linux/arm/bits/sem.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."

+ 8 - 8
libc/sysdeps/linux/arm/bits/setjmp.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* Define the machine-dependent type `jmp_buf'.  ARM version. */
 

+ 31 - 22
libc/sysdeps/linux/arm/bits/shm.h

@@ -1,26 +1,26 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_SHM_H
 # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
 #endif
 
-#include <sys/types.h>
+#include <bits/types.h>
 
 /* Permission flag for shmget.  */
 #define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
@@ -36,20 +36,25 @@
 #define SHM_UNLOCK	12		/* unlock segment (root only) */
 
 
+/* Type to count number of attaches.  */
+typedef unsigned long int shmatt_t;
+
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
   {
     struct ipc_perm shm_perm;		/* operation permission struct */
-    int shm_segsz;			/* size of segment in bytes */
+    size_t shm_segsz;			/* size of segment in bytes */
     __time_t shm_atime;			/* time of last shmat() */
+    unsigned long int __unused1;
     __time_t shm_dtime;			/* time of last shmdt() */
+    unsigned long int __unused2;
     __time_t shm_ctime;			/* time of last change by shmctl() */
-    __ipc_pid_t shm_cpid;		/* pid of creator */
-    __ipc_pid_t shm_lpid;		/* pid of last shmop */
-    unsigned short int shm_nattch;	/* number of current attaches */
-    unsigned short int __shm_npages;	/* size of segment (pages) */
-    unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
-    struct vm_area_struct *__attaches;	/* descriptors for attaches */
+    unsigned long int __unused3;
+    __pid_t shm_cpid;			/* pid of creator */
+    __pid_t shm_lpid;			/* pid of last shmop */
+    shmatt_t shm_nattch;		/* number of current attaches */
+    unsigned long int __unused4;
+    unsigned long int __unused5;
   };
 
 #ifdef __USE_MISC
@@ -64,11 +69,15 @@ struct shmid_ds
 
 struct	shminfo
   {
-    int shmmax;
-    int shmmin;
-    int shmmni;
-    int shmseg;
-    int shmall;
+    unsigned long int shmmax;
+    unsigned long int shmmin;
+    unsigned long int shmmni;
+    unsigned long int shmseg;
+    unsigned long int shmall;
+    unsigned long int __unused1;
+    unsigned long int __unused2;
+    unsigned long int __unused3;
+    unsigned long int __unused4;
   };
 
 struct shm_info

+ 11 - 11
libc/sysdeps/linux/arm/bits/sigaction.h

@@ -1,21 +1,21 @@
 /* The proper definitions for Linux's sigaction.
-   Copyright (C) 1993, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SIGNAL_H
 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
@@ -31,7 +31,7 @@ struct sigaction
 	/* Used if SA_SIGINFO is not set.  */
 	__sighandler_t sa_handler;
 	/* Used if SA_SIGINFO is set.  */
-	void (*sa_sigaction) __P ((int, siginfo_t *, void *));
+	void (*sa_sigaction) (int, siginfo_t *, void *);
       }
     __sigaction_handler;
 # define sa_handler	__sigaction_handler.sa_handler
@@ -47,7 +47,7 @@ struct sigaction
     int sa_flags;
 
     /* Restore handler.  */
-    void (*sa_restorer) __P ((void));
+    void (*sa_restorer) (void);
   };
 
 /* Bits in `sa_flags'.  */

+ 8 - 8
libc/sysdeps/linux/arm/bits/sigcontext.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."

+ 49 - 22
libc/sysdeps/linux/arm/bits/siginfo.h

@@ -1,29 +1,33 @@
-/* siginfo_t, sigevent and constants.  Linux version.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* siginfo_t, sigevent and constants.  Linux/SPARC version.
+   Copyright (C) 1997, 1998, 1999, 2000, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
-#if !defined _SIGNAL_H && !defined __need_siginfo_t
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+    && !defined __need_sigevent_t
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#if (!defined __have_siginfo_t \
-     && (defined _SIGNAL_H || defined __need_siginfo_t))
-# define __have_siginfo_t	1
+#include <bits/wordsize.h>
+
+#if (!defined __have_sigval_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t \
+	 || defined __need_sigevent_t))
+# define __have_sigval_t	1
 
 /* Type for data associated with a signal.  */
 typedef union sigval
@@ -31,9 +35,18 @@ typedef union sigval
     int sival_int;
     void *sival_ptr;
   } sigval_t;
+#endif
+
+#if (!defined __have_siginfo_t \
+     && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t	1
 
 # define __SI_MAX_SIZE     128
-# define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# if __WORDSIZE == 64
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
 
 typedef struct siginfo
   {
@@ -87,7 +100,7 @@ typedef struct siginfo
 	/* SIGPOLL.  */
 	struct
 	  {
-	    int si_band;	/* Band event for SIGPOLL.  */
+	    long int si_band;	/* Band event for SIGPOLL.  */
 	    int si_fd;
 	  } _sigpoll;
       } _sifields;
@@ -97,6 +110,8 @@ typedef struct siginfo
 /* X/Open requires some more fields with fixed names.  */
 # define si_pid		_sifields._kill.si_pid
 # define si_uid		_sifields._kill.si_uid
+# define si_timer1	_sifields._timer._timer1
+# define si_timer2	_sifields._timer._timer2
 # define si_status	_sifields._sigchld.si_status
 # define si_utime	_sifields._sigchld.si_utime
 # define si_stime	_sifields._sigchld.si_stime
@@ -112,7 +127,9 @@ typedef struct siginfo
    signals.  */
 enum
 {
-  SI_SIGIO = -5,		/* Sent by queued SIGIO. */
+  SI_ASYNCNL = -6,		/* Sent by asynch name lookup completion.  */
+# define SI_ASYNCNL	SI_ASYNCNL
+  SI_SIGIO,			/* Sent by queued SIGIO. */
 # define SI_SIGIO	SI_SIGIO
   SI_ASYNCIO,			/* Sent by AIO completion.  */
 # define SI_ASYNCIO	SI_ASYNCIO
@@ -122,8 +139,10 @@ enum
 # define SI_TIMER	SI_TIMER
   SI_QUEUE,			/* Sent by sigqueue.  */
 # define SI_QUEUE	SI_QUEUE
-  SI_USER			/* Sent by kill, sigsend, raise.  */
+  SI_USER,			/* Sent by kill, sigsend, raise.  */
 # define SI_USER	SI_USER
+  SI_KERNEL = 0x80		/* Send by kernel.  */
+#define SI_KERNEL	SI_KERNEL
 };
 
 
@@ -236,12 +255,20 @@ enum
 #endif	/* !have siginfo_t && (have _SIGNAL_H || need siginfo_t).  */
 
 
-#if defined _SIGNAL_H && !defined __have_sigevent_t
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+    && !defined __have_sigevent_t
 # define __have_sigevent_t	1
 
 /* Structure to transport application-defined values with signals.  */
 # define __SIGEV_MAX_SIZE	64
-# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# if __WORDSIZE == 64
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+#  define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+/* Forward declaration of the `pthread_attr_t' type.  */
+struct __pthread_attr_s;
 
 typedef struct sigevent
   {
@@ -255,8 +282,8 @@ typedef struct sigevent
 
 	struct
 	  {
-	    void (*_function) __P ((sigval_t)); /* Function to start.  */
-	    void *_attribute;			  /* Really pthread_attr_t.  */
+	    void (*_function) (sigval_t);	  /* Function to start.  */
+	    struct __pthread_attr_s *_attribute;  /* Really pthread_attr_t.  */
 	  } _sigev_thread;
       } _sigev_un;
   } sigevent_t;

+ 8 - 8
libc/sysdeps/linux/arm/bits/signum.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifdef	_SIGNAL_H
 

+ 9 - 11
libc/sysdeps/linux/arm/bits/sigset.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef	_SIGSET_H_types
 # define _SIGSET_H_types	1
@@ -32,6 +32,7 @@ typedef struct
 
 #endif
 
+
 /* We only want to define these functions if <signal.h> was actually
    included; otherwise we were included just to define the types.  Since we
    are namespace-clean, it wouldn't hurt to define extra macros.  But
@@ -96,8 +97,6 @@ typedef struct
 #  endif
 # endif
 
-__BEGIN_DECLS
-
 /* These functions needn't check for a bogus signal number -- error
    checking is done in the non __ versions.  */
 
@@ -122,6 +121,5 @@ __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
 #  undef __SIGSETFN
 # endif
 
-__END_DECLS
 
 #endif /* ! _SIGSET_H_fns.  */

+ 11 - 11
libc/sysdeps/linux/arm/bits/sigstack.h

@@ -1,21 +1,21 @@
 /* sigstack, sigaltstack definitions.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SIGNAL_H
 # error "Never include this file directly.  Use <signal.h> instead"
@@ -25,7 +25,7 @@
 /* Structure describing a signal stack (obsolete).  */
 struct sigstack
   {
-    __ptr_t ss_sp;		/* Signal stack pointer.  */
+    void *ss_sp;		/* Signal stack pointer.  */
     int ss_onstack;		/* Nonzero if executing on this stack.  */
   };
 
@@ -49,7 +49,7 @@ enum
 /* Alternate, preferred interface.  */
 typedef struct sigaltstack
   {
-    __ptr_t ss_sp;
+    void *ss_sp;
     int ss_flags;
     size_t ss_size;
   } stack_t;

+ 6 - 9
libc/sysdeps/linux/arm/bits/sigthread.h

@@ -1,5 +1,5 @@
 /* Signal handling function for threaded programs.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 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
@@ -17,25 +17,22 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef _BITS_SIGTHREAD_H 
+#ifndef _BITS_SIGTHREAD_H
 #define _BITS_SIGTHREAD_H	1
 
 #if !defined _SIGNAL_H && !defined _PTHREAD_H
 # error "Never include this file directly.  Use <pthread.h> instead"
 #endif
 
-__BEGIN_DECLS
-
 /* Functions for handling signals. */
 
 /* Modify the signal mask for the calling thread.  The arguments have
    the same meaning as for sigprocmask(2). */
-extern int pthread_sigmask __P ((int __how, __const __sigset_t *__newmask,
-				 __sigset_t *__oldmask));
+extern int pthread_sigmask (int __how,
+			    __const __sigset_t *__restrict __newmask,
+			    __sigset_t *__restrict __oldmask)__THROW;
 
 /* Send signal SIGNO to the given thread. */
-extern int pthread_kill __P ((pthread_t __thread, int __signo));
-
-__END_DECLS
+extern int pthread_kill (pthread_t __thread, int __signo) __THROW;
 
 #endif	/* bits/sigthread.h */

+ 9 - 16
libc/sysdeps/linux/arm/bits/sockaddr.h

@@ -1,21 +1,21 @@
 /* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995,1996,1997,1998,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  * Never include this file directly; use <sys/socket.h> instead.
@@ -24,7 +24,6 @@
 #ifndef _BITS_SOCKADDR_H
 #define _BITS_SOCKADDR_H	1
 
-__BEGIN_DECLS
 
 /* POSIX.1g specifies this type name for the `sa_family' member.  */
 typedef unsigned short int sa_family_t;
@@ -38,10 +37,4 @@ typedef unsigned short int sa_family_t;
 
 #define __SOCKADDR_COMMON_SIZE	(sizeof (unsigned short int))
 
-/* Return the length of a `sockaddr' structure.  */
-#define SA_LEN(_x)	__libc_sa_len((_x)->sa_family)
-extern int __libc_sa_len __P ((sa_family_t __af));
-
-__END_DECLS
-
 #endif	/* bits/sockaddr.h */

+ 39 - 30
libc/sysdeps/linux/arm/bits/socket.h

@@ -1,21 +1,21 @@
 /* System-specific socket constants and types.  Linux version.
-   Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc.
+   Copyright (C) 1991,1992,1994-1999,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef __BITS_SOCKET_H
 #define __BITS_SOCKET_H
@@ -32,7 +32,10 @@
 #include <sys/types.h>
 
 /* Type for length arguments in socket calls.  */
-typedef unsigned int socklen_t;
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
 
 /* Types of sockets.  */
 enum __socket_type
@@ -82,7 +85,10 @@ enum __socket_type
 #define	PF_ECONET	19	/* Acorn Econet.  */
 #define	PF_ATMSVC	20	/* ATM SVCs.  */
 #define	PF_SNA		22	/* Linux SNA Project */
-#define PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_IRDA		23	/* IRDA sockets.  */
+#define	PF_PPPOX	24	/* PPPoX sockets.  */
+#define	PF_WANPIPE	25	/* Wanpipe API sockets.  */
+#define	PF_BLUETOOTH	31	/* Bluetooth sockets.  */
 #define	PF_MAX		32	/* For now..  */
 
 /* Address families.  */
@@ -111,7 +117,10 @@ enum __socket_type
 #define	AF_ECONET	PF_ECONET
 #define	AF_ATMSVC	PF_ATMSVC
 #define	AF_SNA		PF_SNA
-#define AF_IRDA		PF_IRDA
+#define	AF_IRDA		PF_IRDA
+#define	AF_PPPOX	PF_PPPOX
+#define	AF_WANPIPE	PF_WANPIPE
+#define	AF_BLUETOOTH	PF_BLUETOOTH
 #define	AF_MAX		PF_MAX
 
 /* Socket level values.  Others are defined in the appropriate headers.
@@ -152,7 +161,7 @@ struct sockaddr
 
 struct sockaddr_storage
   {
-    __SOCKADDR_COMMON (__ss_);	/* Address family, etc.  */
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
     __ss_aligntype __ss_align;	/* Force desired alignment.  */
     char __ss_padding[_SS_PADSIZE];
   };
@@ -188,14 +197,16 @@ enum
 #define	MSG_FIN		MSG_FIN
     MSG_SYN		= 0x400,
 #define	MSG_SYN		MSG_SYN
-    MSG_URG		= 0x800,
-#define	MSG_URG		MSG_URG
+    MSG_CONFIRM		= 0x800, /* Confirm path validity.  */
+#define	MSG_CONFIRM	MSG_CONFIRM
     MSG_RST		= 0x1000,
 #define	MSG_RST		MSG_RST
     MSG_ERRQUEUE	= 0x2000, /* Fetch message from error queue.  */
 #define	MSG_ERRQUEUE	MSG_ERRQUEUE
-    MSG_NOSIGNAL	= 0x4000  /* Do not generate SIGPIPE.  */
+    MSG_NOSIGNAL	= 0x4000, /* Do not generate SIGPIPE.  */
 #define	MSG_NOSIGNAL	MSG_NOSIGNAL
+    MSG_MORE		= 0x8000  /* Sender will send more.  */
+#define	MSG_MORE	MSG_MORE
   };
 
 
@@ -203,14 +214,14 @@ enum
    `sendmsg' and received by `recvmsg'.  */
 struct msghdr
   {
-    __ptr_t msg_name;		/* Address to send to/receive from.  */
+    void *msg_name;		/* Address to send to/receive from.  */
     socklen_t msg_namelen;	/* Length of address data.  */
 
     struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
-    size_t msg_iovlen;		/* Number of elements in the vector.  */
+    int msg_iovlen;		/* Number of elements in the vector.  */
 
-    __ptr_t msg_control;	/* Ancillary data (eg BSD filedesc passing). */
-    size_t msg_controllen;	/* Ancillary data buffer length.  */
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
 
     int msg_flags;		/* Flags on received message.  */
   };
@@ -222,10 +233,8 @@ struct cmsghdr
 				   of cmsghdr structure.  */
     int cmsg_level;		/* Originating protocol.  */
     int cmsg_type;		/* Protocol specific type.  */
-#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
-    unsigned char __cmsg_data[0]; /* Ancillary data.  */
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
     /* XXX Perhaps this should be removed.  */
-#endif
   };
 
 /* Ancillary data object manipulation macros.  */
@@ -239,19 +248,19 @@ struct cmsghdr
   ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
    ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
-			 & ~(sizeof (size_t) - 1))
+			 & (size_t) ~(sizeof (size_t) - 1))
 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
 #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
 
-extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
-					   struct cmsghdr *__cmsg));
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
 #ifdef __USE_EXTERN_INLINES
 # ifndef _EXTERN_INLINE
 #  define _EXTERN_INLINE extern __inline
 # endif
 _EXTERN_INLINE struct cmsghdr *
-__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
+__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
@@ -259,10 +268,10 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
-  if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
-					 + __mhdr->msg_controllen)
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
-	  >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
     return 0;
   return __cmsg;

+ 26 - 19
libc/sysdeps/linux/arm/bits/stat.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1992,95,96,97,98,99,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_STAT_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
@@ -40,7 +40,7 @@ struct stat
 #ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;			/* File serial number.	*/
 #else
-    __ino64_t st_ino;			/* File serial number.	*/
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
 #endif
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
@@ -53,7 +53,7 @@ struct stat
 #else
     __off64_t st_size;			/* Size of file, in bytes.  */
 #endif
-    unsigned long int st_blksize;	/* Optimal block size for I/O.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
 #ifndef __USE_FILE_OFFSET64
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
@@ -66,25 +66,29 @@ struct stat
     unsigned long int __unused2;
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int __unused3;
+#ifndef __USE_FILE_OFFSET64
     unsigned long int __unused4;
     unsigned long int __unused5;
+#else
+    __ino64_t st_ino;			/* File serial number.	*/
+#endif
   };
 
 #ifdef __USE_LARGEFILE64
 struct stat64
   {
     __dev_t st_dev;			/* Device.  */
-    unsigned short int __pad1;
+    unsigned int __pad1;
 
-    __ino64_t st_ino;			/* File serial number.	*/
+    __ino_t __st_ino;			/* 32bit file serial number.	*/
     __mode_t st_mode;			/* File mode.  */
     __nlink_t st_nlink;			/* Link count.  */
     __uid_t st_uid;			/* User ID of the file's owner.	*/
     __gid_t st_gid;			/* Group ID of the file's group.*/
     __dev_t st_rdev;			/* Device number, if device.  */
-    unsigned short int __pad2;
+    unsigned int __pad2;
     __off64_t st_size;			/* Size of file, in bytes.  */
-    unsigned long int st_blksize;	/* Optimal block size for I/O.  */
+    __blksize_t st_blksize;		/* Optimal block size for I/O.  */
 
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
     __time_t st_atime;			/* Time of last access.  */
@@ -93,8 +97,7 @@ struct stat64
     unsigned long int __unused2;
     __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int __unused3;
-    unsigned long int __unused4;
-    unsigned long int __unused5;
+    __ino64_t st_ino;			/* File serial number.		*/
   };
 #endif
 
@@ -112,11 +115,15 @@ struct stat64
 #define	__S_IFBLK	0060000	/* Block device.  */
 #define	__S_IFREG	0100000	/* Regular file.  */
 #define	__S_IFIFO	0010000	/* FIFO.  */
-
-/* These don't actually exist on System V, but having them doesn't hurt.  */
 #define	__S_IFLNK	0120000	/* Symbolic link.  */
 #define	__S_IFSOCK	0140000	/* Socket.  */
 
+/* POSIX.1b objects.  Note that these macros always evaluate to zero.  But
+   they do it by enforcing the correct use of the macros.  */
+#define __S_TYPEISMQ(buf)  ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
+#define __S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
+
 /* Protection bits.  */
 
 #define	__S_ISUID	04000	/* Set user ID on execution.  */

+ 12 - 9
libc/sysdeps/linux/arm/bits/statfs.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_STATFS_H
 # error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
@@ -59,3 +59,6 @@ struct statfs64
     int f_spare[6];
   };
 #endif
+
+/* Tell code we have this member.  */
+#define _STATFS_F_NAMELEN

+ 16 - 12
libc/sysdeps/linux/arm/bits/stdio_lim.h

@@ -1,29 +1,29 @@
-/* Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 1998, 1999 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
-#if !defined _STDIO_H && !defined __need_FOPEN_MAX
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX
 # error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
 #endif
 
 #ifdef _STDIO_H
 # define L_tmpnam 20
 # define TMP_MAX 238328
-# define FILENAME_MAX 255
+# define FILENAME_MAX 4095 
 
 # ifdef __USE_POSIX
 #  define L_ctermid 9
@@ -33,5 +33,9 @@
 
 #if defined __need_FOPEN_MAX || defined _STDIO_H
 # undef  FOPEN_MAX
-# define FOPEN_MAX 256 
+# define FOPEN_MAX 16
+#endif
+
+#if defined __need_IOV_MAX && !defined IOV_MAX
+# define IOV_MAX 1024 
 #endif

+ 9 - 8
libc/sysdeps/linux/arm/bits/termios.h

@@ -3,19 +3,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _TERMIOS_H
 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
@@ -165,6 +165,7 @@ struct termios
 #define  B3000000 0010015
 #define  B3500000 0010016
 #define  B4000000 0010017
+#define __MAX_BAUD B4000000
 #ifdef __USE_MISC
 # define CIBAUD	  002003600000		/* input baud rate (not used) */
 # define CRTSCTS  020000000000		/* flow control */

+ 25 - 15
libc/sysdeps/linux/arm/bits/time.h

@@ -1,21 +1,21 @@
 /* System-dependent timing definitions.  Linux version.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1999, 2000, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  * Never include this file directly; use <time.h> instead.
@@ -31,18 +31,28 @@
 /* CAE XSH, Issue 4, Version 2: <time.h>
    The value of CLOCKS_PER_SEC is required to be 1 million on all
    XSI-conformant systems. */
-#  define CLOCKS_PER_SEC  1000000
+#  define CLOCKS_PER_SEC  1000000l
 
-#  ifndef __STRICT_ANSI__
+#  if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
 /* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
    presents the real value for clock ticks per second for the system.  */
-#   define CLK_TCK 100
+#   include <bits/types.h>
+extern long int __sysconf (int);
+#   define CLK_TCK ((__clock_t) __sysconf (2))	/* 2 is _SC_CLK_TCK */
+#  endif
+
+#  ifdef __USE_POSIX199309
+/* Identifier for system-wide realtime clock.  */
+#   define CLOCK_REALTIME	0
+
+/* Flag to indicate time is absolute.  */
+#   define TIMER_ABSTIME	1
 #  endif
 
 # endif	/* bits/time.h */
 #endif
 
-#ifdef __need_timeval 
+#ifdef __need_timeval
 # undef __need_timeval
 # ifndef _STRUCT_TIMEVAL
 #  define _STRUCT_TIMEVAL	1
@@ -53,7 +63,7 @@
 struct timeval
   {
     __time_t tv_sec;		/* Seconds.  */
-    __time_t tv_usec;		/* Microseconds.  */
+    __suseconds_t tv_usec;	/* Microseconds.  */
   };
 # endif	/* struct timeval */
-#endif	/* need timeval */ 
+#endif	/* need timeval */

+ 25 - 32
libc/sysdeps/linux/arm/bits/types.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,92,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,1994-1999,2000,2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  * Never include this file directly; use <sys/types.h> instead.
@@ -81,34 +81,21 @@ typedef struct
 typedef int __daddr_t;			/* The type of a disk address.  */
 typedef char *__caddr_t;
 typedef long int __time_t;
+typedef unsigned int __useconds_t;
+typedef long int __suseconds_t;
 typedef long int __swblk_t;		/* Type of a swap block maybe?  */
 
 typedef long int __clock_t;
 
-/* One element in the file descriptor mask array.  */
-typedef unsigned long int __fd_mask;
+/* Clock ID used in clock and timer functions.  */
+typedef int __clockid_t;
 
-/* Number of descriptors that can fit in an `fd_set'.  */
-#define __FD_SETSIZE	1024
+/* Timer ID returned by `timer_create'.  */
+typedef int __timer_t;
 
-/* It's easier to assume 8-bit bytes than to get CHAR_BIT.  */
-#define __NFDBITS	(8 * sizeof (__fd_mask))
-#define	__FDELT(d)	((d) / __NFDBITS)
-#define	__FDMASK(d)	((__fd_mask) 1 << ((d) % __NFDBITS))
 
-/* fd_set for select and pselect.  */
-typedef struct
-  {
-    /* XPG4.2 requires this member name.  Otherwise avoid the name
-       from the global namespace.  */
-#ifdef __USE_XOPEN
-    __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
-# define __FDS_BITS(set) ((set)->fds_bits)
-#else
-    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
-# define __FDS_BITS(set) ((set)->__fds_bits)
-#endif
-  } __fd_set;
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define __FD_SETSIZE	1024
 
 
 typedef int __key_t;
@@ -117,6 +104,9 @@ typedef int __key_t;
 typedef unsigned short int __ipc_pid_t;
 
 
+/* Type to represent block size.  */
+typedef long int __blksize_t;
+
 /* Types from the Large File Support interface.  */
 
 /* Type to count number os disk blocks.  */
@@ -132,7 +122,7 @@ typedef __u_long __fsfilcnt_t;
 typedef __u_quad_t __fsfilcnt64_t;
 
 /* Type of file serial numbers.  */
-typedef __u_long __ino64_t;
+typedef __u_quad_t __ino64_t;
 
 /* Type of file sizes and offsets.  */
 typedef __loff_t __off64_t;
@@ -144,9 +134,12 @@ typedef unsigned long int __t_uscalar_t;
 /* Duplicates info from stdint.h but this is used in unistd.h.  */
 typedef int __intptr_t;
 
+/* Duplicate info from sys/socket.h.  */
+typedef unsigned int __socklen_t;
+
 
 /* Now add the thread types.  */
-#ifdef __USE_UNIX98
+#if defined __USE_POSIX199506 || defined __USE_UNIX98
 # include <bits/pthreadtypes.h>
 #endif
 

+ 8 - 8
libc/sysdeps/linux/arm/bits/uio.h

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #ifndef _SYS_UIO_H
 # error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."

+ 9 - 9
libc/sysdeps/linux/arm/bits/waitflags.h

@@ -3,21 +3,21 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
-#ifndef _SYS_WAIT_H
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
 # error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
 #endif
 

+ 10 - 10
libc/sysdeps/linux/arm/bits/waitstatus.h

@@ -1,23 +1,23 @@
 /* Definitions of status bits for `wait' et al.
-   Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1994, 1996, 1997, 2000 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
-#ifndef _SYS_WAIT_H
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
 # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
 #endif
 

+ 8 - 8
libc/sysdeps/linux/arm/bits/wordsize.h

@@ -2,18 +2,18 @@
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #define __WORDSIZE	32

+ 67 - 19
libc/sysdeps/linux/arm/bits/xopen_lim.h

@@ -1,20 +1,20 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999, 2001 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
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /*
  * Never include this file directly; use <limits.h> instead.
@@ -30,7 +30,7 @@
 #ifndef _XOPEN_LIM_H
 #define _XOPEN_LIM_H	1
 
-#define __need_FOPEN_MAX
+#define __need_IOV_MAX
 #include <bits/stdio_lim.h>
 
 /* We do not provide fixed values for
@@ -51,18 +51,14 @@
    PAGE_SIZE	Size of bytes of a page.
 
    PASS_MAX	Maximum number of significant bytes in a password.
-*/
-
 
-/* Maximum number of `iovec' structures that one process has available
-   for use with `readv' or writev'.  */
-#define IOV_MAX		_XOPEN_IOV_MAX
+   We only provide a fixed limit for
 
-/* The number of streams that one process can have open at one time.  */
-#define STREAM_MAX	FOPEN_MAX
+   IOV_MAX	Maximum number of `iovec' structures that one process has
+		available for use with `readv' or writev'.
 
-/* Maximum number of bytes supported for the name of a time zone.  */
-#define TZNAME_MAX	_POSIX_TZNAME_MAX
+   if this is indeed fixed by the underlying system.
+*/
 
 
 /* Maximum number of `iovec' structures that one process has available
@@ -93,4 +89,56 @@
 /* Default process priority.  */
 #define NZERO		20
 
+
+/* Number of bits in a word of type `int'.  */
+#ifdef INT_MAX
+# if INT_MAX == 32767
+#  define WORD_BIT	16
+# else
+#  if INT_MAX == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#elif defined __INT_MAX__
+# if __INT_MAX__ == 32767
+#  define WORD_BIT	16
+# else
+#  if __INT_MAX__ == 2147483647
+#   define WORD_BIT	32
+#  else
+/* Safe assumption.  */
+#   define WORD_BIT	64
+#  endif
+# endif
+#else
+# define WORD_BIT	32
+#endif
+
+/* Number of bits in a word of type `long int'.  */
+#ifdef LONG_MAX
+# if LONG_MAX == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#elif defined __LONG_MAX__
+# if __LONG_MAX__ == 2147483647
+#  define LONG_BIT	32
+# else
+/* Safe assumption.  */
+#  define LONG_BIT	64
+# endif
+#else
+# include <bits/wordsize.h>
+# if __WORDSIZE == 64
+#  define LONG_BIT	64
+# else
+#  define LONG_BIT	32
+# endif
+#endif
+
 #endif /* bits/xopen_lim.h */

+ 3 - 3
libc/sysdeps/linux/arm/setjmp.S

@@ -22,10 +22,10 @@
 #include <bits/setjmp.h>
 
 	/* Binary compatibility entry point.  */
-.globl setjmp;
-.type setjmp,#function
+.globl _setjmp;
+.type _setjmp,#function
 .align 4;
-setjmp:
+_setjmp:
 	mov	r1, #0
 
 

+ 2 - 2
libc/sysdeps/linux/common/errno.c

@@ -1,8 +1,8 @@
-#include <errno.h>
+//#include <errno.h>
 
 int errno = 0;
 
-int * __errno_location ( void )
+int * __attribute__ ((__weak__)) __errno_location ( void )
 {
   return &errno;
 }

+ 2 - 1
libc/sysdeps/linux/common/getdnnm.c

@@ -1,7 +1,8 @@
 #include <string.h>
 #include <unistd.h>
-#include <sys/utsname.h>
 #include <errno.h>
+#define __USE_GNU
+#include <sys/utsname.h>
 
 int
 getdomainname(char *name, size_t len)

+ 5 - 2
libc/sysdeps/linux/common/getdtablesize.c

@@ -16,9 +16,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <limits.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <sys/resource.h>
+#include <limits.h>
+
+#define __LOCAL_OPEN_MAX	    256
 
 /* Return the maximum number of file descriptors
    the current process could possibly have.  */
@@ -29,6 +32,6 @@ int getdtablesize (void)
   /* This should even work if `getrlimit' is not implemented.  POSIX.1
      does not define this function but we will generate a stub which
      returns -1.  */
-  return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? OPEN_MAX : ru.rlim_cur;
+  return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur;
 }
 

+ 3 - 1
libc/sysdeps/linux/common/getpagesize.c

@@ -17,10 +17,11 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <unistd.h>
+#include <features.h>
 #include <sys/param.h>
 
 /* Return the system page size.  */
-int getpagesize ()
+int __getpagesize()
 {
 #ifdef	EXEC_PAGESIZE
   return EXEC_PAGESIZE;
@@ -36,3 +37,4 @@ int getpagesize ()
 #endif	/* EXEC_PAGESIZE.  */
 }
 
+weak_alias(__getpagesize, getpagesize);

+ 1 - 0
libc/sysdeps/linux/common/setegid.c

@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <sys/types.h>
 
 int setegid(gid_t gid)
 {

+ 1 - 0
libc/sysdeps/linux/common/seteuid.c

@@ -1,6 +1,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <errno.h>
+#include <sys/types.h>
 
 int seteuid(uid_t uid)
 {

+ 3 - 3
libc/sysdeps/linux/common/statfix.c

@@ -2,8 +2,8 @@
 /*
  * Convert from the kernel's version of struct stat to libc's version
  *
- * Copyright (C) 2000 by Lineo, inc.  Written by Erik Andersen
- * <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 2000, 2001 by Lineo, inc.  
+ * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License as published by
@@ -22,7 +22,7 @@
  */
 
 /* Pull in whatever this particular arch's kernel thinks the kernel version of
- * struct stat should look like.  It turn out that each arch has a different
+ * struct stat should look like.  It turns out that each arch has a different
  * opinion on the subject.  Then pull in libc's version of struct stat... */
 #include "statfix.h"
 

+ 1 - 1
libc/sysdeps/linux/common/statfix.h

@@ -18,7 +18,7 @@
 #undef stat
 
 extern void statfix(struct libc_stat *libcstat, struct kernel_stat *kstat);
-extern int _fxstat(int version, int fd, struct libc_stat * statbuf);
+extern int __fxstat(int version, int fd, struct libc_stat * statbuf);
 
 #endif
 

+ 15 - 16
libc/sysdeps/linux/common/syscalls.c

@@ -143,7 +143,7 @@ _syscall1(time_t, time, time_t *, t);
 extern int mknod(const char *pathname, mode_t mode, dev_t dev);
 _syscall3(int, mknod, const char *, pathname, mode_t, mode, dev_t, dev);
 
-int _xmknod (int version, const char * path, mode_t mode, dev_t *dev)
+int __xmknod (int version, const char * path, mode_t mode, dev_t *dev)
 {
 	switch(version)
 	{
@@ -221,7 +221,7 @@ _syscall0(gid_t, getuid);
 //#define __NR_stime            25
 #ifdef L_stime
 #include <time.h>
-_syscall1(int, stime, time_t *, t);
+_syscall1(int, stime, const time_t *, t);
 #endif
 
 //#define __NR_ptrace           26
@@ -253,7 +253,7 @@ _syscall0(int, pause);
 //#define __NR_utime            30
 #ifdef L_utime
 #include <utime.h>
-_syscall2(int, utime, const char *, filename, struct utimbuf *, buf);
+_syscall2(int, utime, const char *, filename, const struct utimbuf *, buf);
 #endif
 
 //#define __NR_stty             31
@@ -277,7 +277,7 @@ _syscall1(int, nice, int, inc);
 //#define __NR_sync             36
 #ifdef L_sync
 #include <unistd.h>
-_syscall0(int, sync);
+_syscall0(void, sync);
 #endif
 
 //#define __NR_kill             37
@@ -560,13 +560,13 @@ _syscall2(int, getrusage, int, who, struct rusage *, usage);
 
 //#define __NR_gettimeofday     78
 #ifdef L_gettimeofday
-#include <unistd.h>
+#include <sys/time.h>
 _syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz);
 #endif
 
 //#define __NR_settimeofday     79
 #ifdef L_settimeofday
-#include <unistd.h>
+#include <sys/time.h>
 _syscall2(int, settimeofday, const struct timeval *, tv,
 		  const struct timezone *, tz);
 #endif
@@ -754,14 +754,14 @@ int klogctl(int type, char *buf, int len)
 //#define __NR_setitimer        104
 #ifdef L_setitimer
 #include <sys/time.h>
-_syscall3(int, setitimer, enum __itimer_which, which,
+_syscall3(int, setitimer, __itimer_which_t, which,
 		  const struct itimerval *, new, struct itimerval *, old);
 #endif
 
 //#define __NR_getitimer        105
 #ifdef L_getitimer
 #include <sys/time.h>
-_syscall2(int, getitimer, enum __itimer_which, which, struct itimerval *, value);
+_syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value);
 #endif
 
 //#define __NR_stat             106
@@ -775,7 +775,7 @@ _syscall2(int, getitimer, enum __itimer_which, which, struct itimerval *, value)
 extern int __stat(const char *file_name, struct kernel_stat *buf);
 _syscall2(int, __stat, const char *, file_name, struct kernel_stat *, buf);
 
-int _xstat(int version, const char * file_name, struct libc_stat * cstat)
+int __xstat(int version, const char * file_name, struct libc_stat * cstat)
 {
 	struct kernel_stat kstat;
 	int result = __stat(file_name, &kstat);
@@ -788,7 +788,7 @@ int _xstat(int version, const char * file_name, struct libc_stat * cstat)
 
 int stat(const char *file_name, struct libc_stat *buf)
 {
-	return(_xstat(0, file_name, buf));
+	return(__xstat(0, file_name, buf));
 }
 #endif
 
@@ -803,7 +803,7 @@ int stat(const char *file_name, struct libc_stat *buf)
 extern int __lstat(const char *file_name, struct kernel_stat *buf);
 _syscall2(int, __lstat, const char *, file_name, struct kernel_stat *, buf);
 
-int _lxstat(int version, const char * file_name, struct libc_stat * cstat)
+int __lxstat(int version, const char * file_name, struct libc_stat * cstat)
 {
 	struct kernel_stat kstat;
 	int result = __lstat(file_name, &kstat);
@@ -816,7 +816,7 @@ int _lxstat(int version, const char * file_name, struct libc_stat * cstat)
 
 int lstat(const char *file_name, struct libc_stat *buf)
 {
-	return(_lxstat(0, file_name, buf));
+	return(__lxstat(0, file_name, buf));
 }
 #endif
 
@@ -831,7 +831,7 @@ int lstat(const char *file_name, struct libc_stat *buf)
 extern int __fstat(int filedes, struct kernel_stat *buf);
 _syscall2(int, __fstat, int, filedes, struct kernel_stat *, buf);
 
-int _fxstat(int version, int fd, struct libc_stat * cstat)
+int __fxstat(int version, int fd, struct libc_stat * cstat)
 {
 	struct kernel_stat kstat;
 	int result = __fstat(fd, &kstat);
@@ -844,7 +844,7 @@ int _fxstat(int version, int fd, struct libc_stat * cstat)
 
 int fstat(int filedes, struct libc_stat *buf)
 {
-	return(_fxstat(0, filedes, buf));
+	return(__fxstat(0, filedes, buf));
 }
 #endif
 
@@ -936,14 +936,13 @@ _syscall1(int, adjtimex, struct timex *, buf);
 //#define __NR_mprotect         125
 #ifdef L_mprotect
 #include <sys/mman.h>
-_syscall3(int, mprotect, const void *, addr, size_t, len, int, prot);
+_syscall3(int, mprotect, void *, addr, size_t, len, int, prot);
 #endif
 
 //#define __NR_sigprocmask      126
 #ifdef L_sigprocmask
 #include <signal.h>
 _syscall3(int, sigprocmask, int, how, const sigset_t *, set, sigset_t *,
-
 		  oldset);
 #endif
 

+ 1 - 0
libc/sysdeps/linux/common/wait.c

@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <syscall.h>
 #include <sys/types.h>
 #include <sys/wait.h>

Some files were not shown because too many files changed in this diff