From 2512c847453c24b928c34beed88902fbb6877b7a Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 27 Sep 2001 05:24:26 +0000 Subject: Update to accomodate the header file changes --- libc/Makefile | 2 +- libc/inet/getnetbyad.c | 5 +- libc/inet/resolv.c | 45 +++- libc/inet/rpc/bindresvport.c | 2 +- libc/inet/rpc/svc.c | 2 + libc/inet/socketcalls.c | 22 +- libc/misc/lsearch/lsearch.c | 2 +- libc/misc/mntent/mntent.c | 2 +- libc/misc/sysvipc/ftok.c | 2 +- libc/misc/sysvipc/shm.c | 1 + libc/misc/time/ctime.c | 1 + libc/misc/time/ctime_r.c | 1 + libc/misc/time/localtime.c | 1 + libc/misc/time/localtime_r.c | 1 + libc/misc/time/utimes.c | 5 +- libc/misc/utmp/utent.c | 12 +- libc/pwd_grp/config.h | 9 + libc/pwd_grp/fgetgrent.c | 1 + libc/pwd_grp/fgetpwent.c | 1 + libc/pwd_grp/getgrgid.c | 1 + libc/pwd_grp/getgrnam.c | 1 + libc/pwd_grp/getpwnam.c | 1 + libc/pwd_grp/getpwuid.c | 1 + libc/pwd_grp/grent.c | 1 + libc/pwd_grp/pwent.c | 1 + libc/signal/sigaddset.c | 3 +- libc/signal/sigblock.c | 1 - libc/signal/sigdelset.c | 6 +- libc/signal/siggtmsk.c | 1 - libc/signal/sigismem.c | 6 +- libc/signal/sigstmsk.c | 1 - libc/stdio/getline.c | 1 + libc/stdio/perror.c | 1 + libc/stdio/scanf.c | 1 + libc/stdlib/atexit.c | 1 + libc/stdlib/getpt.c | 2 +- libc/stdlib/grantpt.c | 2 +- libc/stdlib/malloc/malloc.c | 2 +- libc/stdlib/ptsname.c | 2 +- libc/stdlib/putenv.c | 3 +- libc/stdlib/setenv.c | 3 +- libc/stdlib/strto_ll.c | 1 + libc/stdlib/unix_grantpt.c | 2 +- libc/string/strsignal.c | 6 +- libc/sysdeps/linux/arm/bits/byteswap.h | 43 ++-- libc/sysdeps/linux/arm/bits/confname.h | 245 ++++++++++++++++---- libc/sysdeps/linux/arm/bits/dirent.h | 31 +-- libc/sysdeps/linux/arm/bits/dlfcn.h | 18 +- libc/sysdeps/linux/arm/bits/errno.h | 20 +- libc/sysdeps/linux/arm/bits/fcntl.h | 93 +++++--- libc/sysdeps/linux/arm/bits/huge_val.h | 16 +- libc/sysdeps/linux/arm/bits/in.h | 41 ++-- libc/sysdeps/linux/arm/bits/ioctl-types.h | 19 +- libc/sysdeps/linux/arm/bits/ioctls.h | 16 +- libc/sysdeps/linux/arm/bits/ipc.h | 36 +-- libc/sysdeps/linux/arm/bits/local_lim.h | 28 ++- libc/sysdeps/linux/arm/bits/mathcalls.h | 30 +-- libc/sysdeps/linux/arm/bits/mathdef.h | 16 +- libc/sysdeps/linux/arm/bits/mman.h | 16 +- libc/sysdeps/linux/arm/bits/msq.h | 16 +- libc/sysdeps/linux/arm/bits/poll.h | 21 +- libc/sysdeps/linux/arm/bits/posix1_lim.h | 22 +- libc/sysdeps/linux/arm/bits/posix2_lim.h | 37 ++- libc/sysdeps/linux/arm/bits/posix_opt.h | 39 +++- libc/sysdeps/linux/arm/bits/resource.h | 16 +- libc/sysdeps/linux/arm/bits/select.h | 22 +- libc/sysdeps/linux/arm/bits/sem.h | 16 +- libc/sysdeps/linux/arm/bits/setjmp.h | 16 +- libc/sysdeps/linux/arm/bits/shm.h | 53 +++-- libc/sysdeps/linux/arm/bits/sigaction.h | 22 +- libc/sysdeps/linux/arm/bits/sigcontext.h | 16 +- libc/sysdeps/linux/arm/bits/siginfo.h | 71 ++++-- libc/sysdeps/linux/arm/bits/signum.h | 16 +- libc/sysdeps/linux/arm/bits/sigset.h | 20 +- libc/sysdeps/linux/arm/bits/sigstack.h | 22 +- libc/sysdeps/linux/arm/bits/sigthread.h | 15 +- libc/sysdeps/linux/arm/bits/sockaddr.h | 25 +- libc/sysdeps/linux/arm/bits/socket.h | 69 +++--- libc/sysdeps/linux/arm/bits/stat.h | 45 ++-- libc/sysdeps/linux/arm/bits/statfs.h | 21 +- libc/sysdeps/linux/arm/bits/stdio_lim.h | 28 ++- libc/sysdeps/linux/arm/bits/termios.h | 17 +- libc/sysdeps/linux/arm/bits/time.h | 40 ++-- libc/sysdeps/linux/arm/bits/types.h | 57 ++--- libc/sysdeps/linux/arm/bits/uio.h | 16 +- libc/sysdeps/linux/arm/bits/waitflags.h | 18 +- libc/sysdeps/linux/arm/bits/waitstatus.h | 20 +- libc/sysdeps/linux/arm/bits/wordsize.h | 16 +- libc/sysdeps/linux/arm/bits/xopen_lim.h | 86 +++++-- libc/sysdeps/linux/arm/setjmp.S | 6 +- libc/sysdeps/linux/common/errno.c | 4 +- libc/sysdeps/linux/common/getdnnm.c | 3 +- libc/sysdeps/linux/common/getdtablesize.c | 7 +- libc/sysdeps/linux/common/getpagesize.c | 4 +- libc/sysdeps/linux/common/setegid.c | 1 + libc/sysdeps/linux/common/seteuid.c | 1 + libc/sysdeps/linux/common/statfix.c | 6 +- libc/sysdeps/linux/common/statfix.h | 2 +- libc/sysdeps/linux/common/syscalls.c | 31 ++- libc/sysdeps/linux/common/wait.c | 1 + libc/sysdeps/linux/common/waitpid.c | 3 +- libc/sysdeps/linux/i386/Makefile | 2 + libc/sysdeps/linux/i386/bits/byteswap.h | 39 +++- libc/sysdeps/linux/i386/bits/cmathcalls.h | 34 ++- libc/sysdeps/linux/i386/bits/confname.h | 245 ++++++++++++++++---- libc/sysdeps/linux/i386/bits/dirent.h | 31 +-- libc/sysdeps/linux/i386/bits/dlfcn.h | 48 ++-- libc/sysdeps/linux/i386/bits/elfclass.h | 3 + libc/sysdeps/linux/i386/bits/environments.h | 48 ++-- libc/sysdeps/linux/i386/bits/errno.h | 28 +-- libc/sysdeps/linux/i386/bits/fcntl.h | 96 +++++--- libc/sysdeps/linux/i386/bits/fenv.h | 22 +- libc/sysdeps/linux/i386/bits/huge_val.h | 79 ++++--- libc/sysdeps/linux/i386/bits/in.h | 41 ++-- libc/sysdeps/linux/i386/bits/ioctl-types.h | 19 +- libc/sysdeps/linux/i386/bits/ioctls.h | 16 +- libc/sysdeps/linux/i386/bits/ipc.h | 36 +-- libc/sysdeps/linux/i386/bits/libc-lock.h | 147 ++++++++++-- libc/sysdeps/linux/i386/bits/local_lim.h | 28 ++- libc/sysdeps/linux/i386/bits/locale.h | 16 +- libc/sysdeps/linux/i386/bits/mathcalls.h | 58 +++-- libc/sysdeps/linux/i386/bits/mathdef.h | 30 +-- libc/sysdeps/linux/i386/bits/mathinline.h | 343 +++++++++++++++------------- libc/sysdeps/linux/i386/bits/mman.h | 36 ++- libc/sysdeps/linux/i386/bits/msq.h | 47 ++-- libc/sysdeps/linux/i386/bits/nan.h | 16 +- libc/sysdeps/linux/i386/bits/netdb.h | 33 +++ libc/sysdeps/linux/i386/bits/poll.h | 21 +- libc/sysdeps/linux/i386/bits/posix1_lim.h | 22 +- libc/sysdeps/linux/i386/bits/posix2_lim.h | 37 ++- libc/sysdeps/linux/i386/bits/posix_opt.h | 47 +++- libc/sysdeps/linux/i386/bits/pthreadtypes.h | 26 ++- libc/sysdeps/linux/i386/bits/resource.h | 32 +-- libc/sysdeps/linux/i386/bits/sched.h | 26 +-- libc/sysdeps/linux/i386/bits/select.h | 24 +- libc/sysdeps/linux/i386/bits/sem.h | 29 ++- libc/sysdeps/linux/i386/bits/setjmp.h | 19 +- libc/sysdeps/linux/i386/bits/shm.h | 53 +++-- libc/sysdeps/linux/i386/bits/sigaction.h | 22 +- libc/sysdeps/linux/i386/bits/sigcontext.h | 16 +- libc/sysdeps/linux/i386/bits/siginfo.h | 71 ++++-- libc/sysdeps/linux/i386/bits/signum.h | 16 +- libc/sysdeps/linux/i386/bits/sigset.h | 19 +- libc/sysdeps/linux/i386/bits/sigstack.h | 22 +- libc/sysdeps/linux/i386/bits/sigthread.h | 15 +- libc/sysdeps/linux/i386/bits/sockaddr.h | 25 +- libc/sysdeps/linux/i386/bits/socket.h | 69 +++--- libc/sysdeps/linux/i386/bits/stat.h | 45 ++-- libc/sysdeps/linux/i386/bits/statfs.h | 21 +- libc/sysdeps/linux/i386/bits/statvfs.h | 51 +++-- libc/sysdeps/linux/i386/bits/stdio-lock.h | 15 +- libc/sysdeps/linux/i386/bits/stdio.h | 41 ++-- libc/sysdeps/linux/i386/bits/stdio_lim.h | 28 ++- libc/sysdeps/linux/i386/bits/string.h | 52 ++++- libc/sysdeps/linux/i386/bits/string2.h | 88 ++++--- libc/sysdeps/linux/i386/bits/stropts.h | 46 ++-- libc/sysdeps/linux/i386/bits/termios.h | 17 +- libc/sysdeps/linux/i386/bits/time.h | 46 ++-- libc/sysdeps/linux/i386/bits/types.h | 59 ++--- libc/sysdeps/linux/i386/bits/uio.h | 16 +- libc/sysdeps/linux/i386/bits/ustat.h | 16 +- libc/sysdeps/linux/i386/bits/utmp.h | 17 +- libc/sysdeps/linux/i386/bits/utmpx.h | 25 +- libc/sysdeps/linux/i386/bits/utsname.h | 16 +- libc/sysdeps/linux/i386/bits/waitflags.h | 18 +- libc/sysdeps/linux/i386/bits/waitstatus.h | 20 +- libc/sysdeps/linux/i386/bits/wordsize.h | 16 +- libc/sysdeps/linux/i386/bits/xopen_lim.h | 86 +++++-- libc/sysdeps/linux/i386/longjmp.c | 3 +- libc/sysdeps/linux/i386/sbrk.c | 3 +- libc/sysdeps/linux/i386/setjmp.S | 6 +- libc/sysdeps/linux/i386/vm86.h | 34 +++ libc/termios/tcsetattr.c | 2 +- libc/termios/termios.c | 1 + libc/unistd/sleep.c | 4 +- libc/unistd/sysconf.c | 7 +- 176 files changed, 2971 insertions(+), 1783 deletions(-) create mode 100644 libc/sysdeps/linux/i386/bits/netdb.h create mode 100644 libc/sysdeps/linux/i386/vm86.h diff --git a/libc/Makefile b/libc/Makefile index c647984d4..4001f2b2c 100644 --- a/libc/Makefile +++ b/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 diff --git a/libc/inet/getnetbyad.c b/libc/inet/getnetbyad.c index f1c2328f2..38fe03cc6 100644 --- a/libc/inet/getnetbyad.c +++ b/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; diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 034bb80db..e5558fbde 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -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]; diff --git a/libc/inet/rpc/bindresvport.c b/libc/inet/rpc/bindresvport.c index e71dff7f4..800398ae4 100644 --- a/libc/inet/rpc/bindresvport.c +++ b/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); } diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c index 0436e3042..780a33725 100644 --- a/libc/inet/rpc/svc.c +++ b/libc/inet/rpc/svc.c @@ -40,11 +40,13 @@ * Copyright (C) 1984, Sun Microsystems, Inc. */ +#define __USE_XOPEN #include #include #include #ifdef __linux__ #include +#include #endif extern int errno; diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 7b968cdb6..f73eeb0ec 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -3,10 +3,30 @@ #include #include #include -#include + 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) { diff --git a/libc/misc/lsearch/lsearch.c b/libc/misc/lsearch/lsearch.c index aed4b1e7d..ace739211 100644 --- a/libc/misc/lsearch/lsearch.c +++ b/libc/misc/lsearch/lsearch.c @@ -8,6 +8,7 @@ * "It's not reality that's important, but how you perceive things." */ +#include #include 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); diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index 2bdd3c7a6..9e8fda613 100644 --- a/libc/misc/mntent/mntent.c +++ b/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 */ diff --git a/libc/misc/sysvipc/ftok.c b/libc/misc/sysvipc/ftok.c index 06843edda..b0199acda 100644 --- a/libc/misc/sysvipc/ftok.c +++ b/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) diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c index 5fdfe6ca7..c916993d0 100644 --- a/libc/misc/sysvipc/shm.c +++ b/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 #include #include #include "ipc.h" diff --git a/libc/misc/time/ctime.c b/libc/misc/time/ctime.c index ddcde6111..8783d284e 100644 --- a/libc/misc/time/ctime.c +++ b/libc/misc/time/ctime.c @@ -1,5 +1,6 @@ #include +#include extern void __tm_conv(); extern void __asctime(); diff --git a/libc/misc/time/ctime_r.c b/libc/misc/time/ctime_r.c index 85677b681..b608098ae 100644 --- a/libc/misc/time/ctime_r.c +++ b/libc/misc/time/ctime_r.c @@ -1,5 +1,6 @@ #include +#include extern void __tm_conv(); extern void __asctime(); diff --git a/libc/misc/time/localtime.c b/libc/misc/time/localtime.c index 1f538ab7a..bedbb8ea7 100644 --- a/libc/misc/time/localtime.c +++ b/libc/misc/time/localtime.c @@ -1,5 +1,6 @@ #include +#include extern void __tm_conv(); diff --git a/libc/misc/time/localtime_r.c b/libc/misc/time/localtime_r.c index d084f2b1e..139864506 100644 --- a/libc/misc/time/localtime_r.c +++ b/libc/misc/time/localtime_r.c @@ -1,5 +1,6 @@ #include +#include extern void __tm_conv(); diff --git a/libc/misc/time/utimes.c b/libc/misc/time/utimes.c index 364bf83e7..86dff6bea 100644 --- a/libc/misc/time/utimes.c +++ b/libc/misc/time/utimes.c @@ -1,7 +1,8 @@ +#include #include #include -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); } diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index f9d098fb3..220bd6db6 100644 --- a/libc/misc/utmp/utent.c +++ b/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 #include #include #include @@ -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; } diff --git a/libc/pwd_grp/config.h b/libc/pwd_grp/config.h index eb029a31a..5a5272999 100644 --- a/libc/pwd_grp/config.h +++ b/libc/pwd_grp/config.h @@ -22,6 +22,15 @@ #ifndef _CONFIG_GRP_H #define _CONFIG_GRP_H +#include +#include + +/* 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, diff --git a/libc/pwd_grp/fgetgrent.c b/libc/pwd_grp/fgetgrent.c index 50aa01722..7c08ea68e 100644 --- a/libc/pwd_grp/fgetgrent.c +++ b/libc/pwd_grp/fgetgrent.c @@ -21,6 +21,7 @@ #include #include #include +#include "config.h" struct group *fgetgrent(FILE * file) { diff --git a/libc/pwd_grp/fgetpwent.c b/libc/pwd_grp/fgetpwent.c index aab1ec744..ae43cdad8 100644 --- a/libc/pwd_grp/fgetpwent.c +++ b/libc/pwd_grp/fgetpwent.c @@ -21,6 +21,7 @@ #include #include #include +#include "config.h" #define PWD_BUFFER_SIZE 256 diff --git a/libc/pwd_grp/getgrgid.c b/libc/pwd_grp/getgrgid.c index fa74a9644..70e7152ce 100644 --- a/libc/pwd_grp/getgrgid.c +++ b/libc/pwd_grp/getgrgid.c @@ -22,6 +22,7 @@ #include #include #include +#include "config.h" struct group *getgrgid(const gid_t gid) { diff --git a/libc/pwd_grp/getgrnam.c b/libc/pwd_grp/getgrnam.c index 6f2634cee..705342489 100644 --- a/libc/pwd_grp/getgrnam.c +++ b/libc/pwd_grp/getgrnam.c @@ -23,6 +23,7 @@ #include #include #include +#include "config.h" struct group *getgrnam(const char *name) { diff --git a/libc/pwd_grp/getpwnam.c b/libc/pwd_grp/getpwnam.c index 5cb4f64f8..f5ad9ca1d 100644 --- a/libc/pwd_grp/getpwnam.c +++ b/libc/pwd_grp/getpwnam.c @@ -23,6 +23,7 @@ #include #include #include +#include "config.h" #define PWD_BUFFER_SIZE 256 diff --git a/libc/pwd_grp/getpwuid.c b/libc/pwd_grp/getpwuid.c index 307f840e1..101d668ae 100644 --- a/libc/pwd_grp/getpwuid.c +++ b/libc/pwd_grp/getpwuid.c @@ -22,6 +22,7 @@ #include #include #include +#include "config.h" #define PWD_BUFFER_SIZE 256 diff --git a/libc/pwd_grp/grent.c b/libc/pwd_grp/grent.c index aab878a89..8e4af5143 100644 --- a/libc/pwd_grp/grent.c +++ b/libc/pwd_grp/grent.c @@ -27,6 +27,7 @@ #include #include #include +#include "config.h" static int grp_fd = -1; diff --git a/libc/pwd_grp/pwent.c b/libc/pwd_grp/pwent.c index 6f81f1ea6..e4a17e2b3 100644 --- a/libc/pwd_grp/pwent.c +++ b/libc/pwd_grp/pwent.c @@ -23,6 +23,7 @@ #include #include #include +#include "config.h" /* * setpwent(), endpwent(), and getpwent() are included in the same object diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c index 269f7d367..8300dd7ca 100644 --- a/libc/signal/sigaddset.c +++ b/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 #include #include -#include "signal.h" +#include /* Add SIGNO to SET. */ diff --git a/libc/signal/sigblock.c b/libc/signal/sigblock.c index 8edfe0df2..dd7a23f96 100644 --- a/libc/signal/sigblock.c +++ b/libc/signal/sigblock.c @@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#define __USE_BSD #include /* Block signals in MASK, returning the old mask. */ diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c index 958f1d44a..6698ff6c4 100644 --- a/libc/signal/sigdelset.c +++ b/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 +#include +#include +#include /* Add SIGNO to SET. */ int sigdelset ( sigset_t *set, int signo) diff --git a/libc/signal/siggtmsk.c b/libc/signal/siggtmsk.c index 517cb49fb..1ee776b40 100644 --- a/libc/signal/siggtmsk.c +++ b/libc/signal/siggtmsk.c @@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#define __USE_BSD #include /* Get the mask of blocked signals. */ diff --git a/libc/signal/sigismem.c b/libc/signal/sigismem.c index 64b14f37e..89d88647d 100644 --- a/libc/signal/sigismem.c +++ b/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 +#include +#include #define _EXTERN_INLINE #define __USE_EXTERN_INLINES 1 -#include "signal.h" +#include /* Return 1 if SIGNO is in SET, 0 if not. */ int sigismember ( const sigset_t *set, int signo) diff --git a/libc/signal/sigstmsk.c b/libc/signal/sigstmsk.c index 6b1876b32..c537d19c3 100644 --- a/libc/signal/sigstmsk.c +++ b/libc/signal/sigstmsk.c @@ -17,7 +17,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#define __USE_BSD #include /* Set the mask of blocked signals to MASK, returning the old mask. */ diff --git a/libc/stdio/getline.c b/libc/stdio/getline.c index 870f6ed4a..8b3331703 100644 --- a/libc/stdio/getline.c +++ b/libc/stdio/getline.c @@ -22,6 +22,7 @@ */ #include +#include #define __USE_GNU #include diff --git a/libc/stdio/perror.c b/libc/stdio/perror.c index 04cd688d8..33b5e08b0 100644 --- a/libc/stdio/perror.c +++ b/libc/stdio/perror.c @@ -1,3 +1,4 @@ +#include #include #include diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 0b9e8007c..c8b487ed1 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -33,6 +33,7 @@ #include #include +#define __USE_ISOC99 #include #include #include diff --git a/libc/stdlib/atexit.c b/libc/stdlib/atexit.c index 1ff8d9004..503e3da1f 100644 --- a/libc/stdlib/atexit.c +++ b/libc/stdlib/atexit.c @@ -20,6 +20,7 @@ * __stdio_close_all. */ +#include #include #include diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c index 74f009a95..0ee2d90d6 100644 --- a/libc/stdlib/getpt.c +++ b/libc/stdlib/getpt.c @@ -86,4 +86,4 @@ getpt (void) #define PTYNAME2 "0123456789abcdef"; #define __getpt __bsd_getpt -#include +#include "bsd_getpt.c" diff --git a/libc/stdlib/grantpt.c b/libc/stdlib/grantpt.c index 63f423b8f..7aa49fcd5 100644 --- a/libc/stdlib/grantpt.c +++ b/libc/stdlib/grantpt.c @@ -63,4 +63,4 @@ grantpt (int fd) } #define grantpt __unix_grantpt -#include +#include "unix_grantpt.c" diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c index 95dda3da5..432f893e8 100644 --- a/libc/stdlib/malloc/malloc.c +++ b/libc/stdlib/malloc/malloc.c @@ -53,9 +53,9 @@ * Converted INIT_BLOCK() and FREE_MEM_DEL_BLOCK() from macros to functions. */ +#include #define _POSIX_SOURCE #define _XOPEN_SOURCE -#include #include #include #include diff --git a/libc/stdlib/ptsname.c b/libc/stdlib/ptsname.c index 2fbc6be49..fd50da047 100644 --- a/libc/stdlib/ptsname.c +++ b/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 diff --git a/libc/stdlib/putenv.c b/libc/stdlib/putenv.c index 5f27e57d7..b5a202bfd 100644 --- a/libc/stdlib/putenv.c +++ b/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; diff --git a/libc/stdlib/setenv.c b/libc/stdlib/setenv.c index 25eb641ba..d304cb4ac 100644 --- a/libc/stdlib/setenv.c +++ b/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; } diff --git a/libc/stdlib/strto_ll.c b/libc/stdlib/strto_ll.c index c3a5439b3..76a1a95b3 100644 --- a/libc/stdlib/strto_ll.c +++ b/libc/stdlib/strto_ll.c @@ -40,6 +40,7 @@ #endif #include +#define __USE_GNU #include #include diff --git a/libc/stdlib/unix_grantpt.c b/libc/stdlib/unix_grantpt.c index c8d70ad64..3dce71b6f 100644 --- a/libc/stdlib/unix_grantpt.c +++ b/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. */ diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c index ba2524ffd..e482512f1 100644 --- a/libc/string/strsignal.c +++ b/libc/string/strsignal.c @@ -23,12 +23,12 @@ */ #define WANT_SIGLIST 1 - -#include +#include #include #include - #include +#define __USE_GNU +#include #if (INT_MAX >> 31) /* We're set up for 32 bit ints */ diff --git a/libc/sysdeps/linux/arm/bits/byteswap.h b/libc/sysdeps/linux/arm/bits/byteswap.h index 6b5115658..7866abe9c 100644 --- a/libc/sysdeps/linux/arm/bits/byteswap.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/confname.h b/libc/sysdeps/linux/arm/bits/confname.h index a649e52f2..ba8868af4 100644 --- a/libc/sysdeps/linux/arm/bits/confname.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/dirent.h b/libc/sysdeps/linux/arm/bits/dirent.h index 1754c7cbe..01fbf54dd 100644 --- a/libc/sysdeps/linux/arm/bits/dirent.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/dlfcn.h b/libc/sysdeps/linux/arm/bits/dlfcn.h index f724d0fdf..2525fa3d9 100644 --- a/libc/sysdeps/linux/arm/bits/dlfcn.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/errno.h b/libc/sysdeps/linux/arm/bits/errno.h index ba3049599..ac59d4c9d 100644 --- a/libc/sysdeps/linux/arm/bits/errno.h +++ b/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 */ diff --git a/libc/sysdeps/linux/arm/bits/fcntl.h b/libc/sysdeps/linux/arm/bits/fcntl.h index 0c94c6b9a..152858d9f 100644 --- a/libc/sysdeps/linux/arm/bits/fcntl.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/huge_val.h b/libc/sysdeps/linux/arm/bits/huge_val.h index 841b4b0d6..625cdc5c3 100644 --- a/libc/sysdeps/linux/arm/bits/huge_val.h +++ b/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 directly; include instead." diff --git a/libc/sysdeps/linux/arm/bits/in.h b/libc/sysdeps/linux/arm/bits/in.h index 38e2a2e00..e6cf57574 100644 --- a/libc/sysdeps/linux/arm/bits/in.h +++ b/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. */ diff --git a/libc/sysdeps/linux/arm/bits/ioctl-types.h b/libc/sysdeps/linux/arm/bits/ioctl-types.h index 59c79df81..e856a04b4 100644 --- a/libc/sysdeps/linux/arm/bits/ioctl-types.h +++ b/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 directly; include 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 */ diff --git a/libc/sysdeps/linux/arm/bits/ioctls.h b/libc/sysdeps/linux/arm/bits/ioctls.h index c103645f6..b49ca2076 100644 --- a/libc/sysdeps/linux/arm/bits/ioctls.h +++ b/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 directly; include instead." diff --git a/libc/sysdeps/linux/arm/bits/ipc.h b/libc/sysdeps/linux/arm/bits/ipc.h index c4e37358e..f1a043fe5 100644 --- a/libc/sysdeps/linux/arm/bits/ipc.h +++ b/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 directly; include instead." #endif -#include +#include /* 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; }; diff --git a/libc/sysdeps/linux/arm/bits/local_lim.h b/libc/sysdeps/linux/arm/bits/local_lim.h index 545a90b2e..0a7c83706 100644 --- a/libc/sysdeps/linux/arm/bits/local_lim.h +++ b/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 @@ -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 diff --git a/libc/sysdeps/linux/arm/bits/mathcalls.h b/libc/sysdeps/linux/arm/bits/mathcalls.h index a3ab88785..c1181f737 100644 --- a/libc/sysdeps/linux/arm/bits/mathcalls.h +++ b/libc/sysdeps/linux/arm/bits/mathcalls.h @@ -1,21 +1,21 @@ /* Prototype declarations for math functions; helper file for . - 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 , 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 diff --git a/libc/sysdeps/linux/arm/bits/mathdef.h b/libc/sysdeps/linux/arm/bits/mathdef.h index 426fec724..44d7f0dde 100644 --- a/libc/sysdeps/linux/arm/bits/mathdef.h +++ b/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 directly; include instead" diff --git a/libc/sysdeps/linux/arm/bits/mman.h b/libc/sysdeps/linux/arm/bits/mman.h index fbb58c89d..715e0f04c 100644 --- a/libc/sysdeps/linux/arm/bits/mman.h +++ b/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 instead" diff --git a/libc/sysdeps/linux/arm/bits/msq.h b/libc/sysdeps/linux/arm/bits/msq.h index 7088ae209..32a49b592 100644 --- a/libc/sysdeps/linux/arm/bits/msq.h +++ b/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 directly; include instead." diff --git a/libc/sysdeps/linux/arm/bits/poll.h b/libc/sysdeps/linux/arm/bits/poll.h index 4aec021fe..dccb8b666 100644 --- a/libc/sysdeps/linux/arm/bits/poll.h +++ b/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 directly; include 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 diff --git a/libc/sysdeps/linux/arm/bits/posix1_lim.h b/libc/sysdeps/linux/arm/bits/posix1_lim.h index ee84b94a7..e16f4674d 100644 --- a/libc/sysdeps/linux/arm/bits/posix1_lim.h +++ b/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 @@ -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 diff --git a/libc/sysdeps/linux/arm/bits/posix2_lim.h b/libc/sysdeps/linux/arm/bits/posix2_lim.h index eaaf67129..24483a09d 100644 --- a/libc/sysdeps/linux/arm/bits/posix2_lim.h +++ b/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 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. */ diff --git a/libc/sysdeps/linux/arm/bits/posix_opt.h b/libc/sysdeps/linux/arm/bits/posix_opt.h index 15683b77e..9e39d8d21 100644 --- a/libc/sysdeps/linux/arm/bits/posix_opt.h +++ b/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 */ diff --git a/libc/sysdeps/linux/arm/bits/resource.h b/libc/sysdeps/linux/arm/bits/resource.h index db3848b26..3da13beb2 100644 --- a/libc/sysdeps/linux/arm/bits/resource.h +++ b/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 directly; include instead." diff --git a/libc/sysdeps/linux/arm/bits/select.h b/libc/sysdeps/linux/arm/bits/select.h index 4513135af..47e7dedc3 100644 --- a/libc/sysdeps/linux/arm/bits/select.h +++ b/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 directly; include 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)) diff --git a/libc/sysdeps/linux/arm/bits/sem.h b/libc/sysdeps/linux/arm/bits/sem.h index c5c04bad1..6193501e2 100644 --- a/libc/sysdeps/linux/arm/bits/sem.h +++ b/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 directly; use instead." diff --git a/libc/sysdeps/linux/arm/bits/setjmp.h b/libc/sysdeps/linux/arm/bits/setjmp.h index a9fb9f32b..dd8524303 100644 --- a/libc/sysdeps/linux/arm/bits/setjmp.h +++ b/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. */ diff --git a/libc/sysdeps/linux/arm/bits/shm.h b/libc/sysdeps/linux/arm/bits/shm.h index c7070595b..18246c3bd 100644 --- a/libc/sysdeps/linux/arm/bits/shm.h +++ b/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 directly; use instead." #endif -#include +#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ @@ -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 diff --git a/libc/sysdeps/linux/arm/bits/sigaction.h b/libc/sysdeps/linux/arm/bits/sigaction.h index e721183b9..48cc5312f 100644 --- a/libc/sysdeps/linux/arm/bits/sigaction.h +++ b/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 directly; use 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'. */ diff --git a/libc/sysdeps/linux/arm/bits/sigcontext.h b/libc/sysdeps/linux/arm/bits/sigcontext.h index 97cbf4b30..67dcf9498 100644 --- a/libc/sysdeps/linux/arm/bits/sigcontext.h +++ b/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 directly; include instead." diff --git a/libc/sysdeps/linux/arm/bits/siginfo.h b/libc/sysdeps/linux/arm/bits/siginfo.h index 0ed54f267..70a8c217e 100644 --- a/libc/sysdeps/linux/arm/bits/siginfo.h +++ b/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 instead" #endif -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 +#include + +#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; diff --git a/libc/sysdeps/linux/arm/bits/signum.h b/libc/sysdeps/linux/arm/bits/signum.h index fb26703d0..74259b492 100644 --- a/libc/sysdeps/linux/arm/bits/signum.h +++ b/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 diff --git a/libc/sysdeps/linux/arm/bits/sigset.h b/libc/sysdeps/linux/arm/bits/sigset.h index 0c751af50..7ccadda45 100644 --- a/libc/sysdeps/linux/arm/bits/sigset.h +++ b/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 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. */ diff --git a/libc/sysdeps/linux/arm/bits/sigstack.h b/libc/sysdeps/linux/arm/bits/sigstack.h index 905e87fd9..7f260367b 100644 --- a/libc/sysdeps/linux/arm/bits/sigstack.h +++ b/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 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; diff --git a/libc/sysdeps/linux/arm/bits/sigthread.h b/libc/sysdeps/linux/arm/bits/sigthread.h index c213614be..b86e75f20 100644 --- a/libc/sysdeps/linux/arm/bits/sigthread.h +++ b/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 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 */ diff --git a/libc/sysdeps/linux/arm/bits/sockaddr.h b/libc/sysdeps/linux/arm/bits/sockaddr.h index 8078963a8..3e1d1312d 100644 --- a/libc/sysdeps/linux/arm/bits/sockaddr.h +++ b/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 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 */ diff --git a/libc/sysdeps/linux/arm/bits/socket.h b/libc/sysdeps/linux/arm/bits/socket.h index dc2d58cfc..6ad4a5ed9 100644 --- a/libc/sysdeps/linux/arm/bits/socket.h +++ b/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 /* 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; diff --git a/libc/sysdeps/linux/arm/bits/stat.h b/libc/sysdeps/linux/arm/bits/stat.h index c175668a0..f446a91db 100644 --- a/libc/sysdeps/linux/arm/bits/stat.h +++ b/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 directly; use 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. */ diff --git a/libc/sysdeps/linux/arm/bits/statfs.h b/libc/sysdeps/linux/arm/bits/statfs.h index 31ae564b4..78c9bdbbc 100644 --- a/libc/sysdeps/linux/arm/bits/statfs.h +++ b/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 directly; use instead." @@ -59,3 +59,6 @@ struct statfs64 int f_spare[6]; }; #endif + +/* Tell code we have this member. */ +#define _STATFS_F_NAMELEN diff --git a/libc/sysdeps/linux/arm/bits/stdio_lim.h b/libc/sysdeps/linux/arm/bits/stdio_lim.h index 9787b4358..ea6d693f5 100644 --- a/libc/sysdeps/linux/arm/bits/stdio_lim.h +++ b/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 directly; use 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 diff --git a/libc/sysdeps/linux/arm/bits/termios.h b/libc/sysdeps/linux/arm/bits/termios.h index a5ba1d258..887b309ad 100644 --- a/libc/sysdeps/linux/arm/bits/termios.h +++ b/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 directly; use 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 */ diff --git a/libc/sysdeps/linux/arm/bits/time.h b/libc/sysdeps/linux/arm/bits/time.h index 274d61677..2a6873f00 100644 --- a/libc/sysdeps/linux/arm/bits/time.h +++ b/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 instead. @@ -31,18 +31,28 @@ /* CAE XSH, Issue 4, Version 2: 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 +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 */ diff --git a/libc/sysdeps/linux/arm/bits/types.h b/libc/sysdeps/linux/arm/bits/types.h index 2b6504d91..bdda9388a 100644 --- a/libc/sysdeps/linux/arm/bits/types.h +++ b/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 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 #endif diff --git a/libc/sysdeps/linux/arm/bits/uio.h b/libc/sysdeps/linux/arm/bits/uio.h index 38ac17baa..84b4805fe 100644 --- a/libc/sysdeps/linux/arm/bits/uio.h +++ b/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 directly; use instead." diff --git a/libc/sysdeps/linux/arm/bits/waitflags.h b/libc/sysdeps/linux/arm/bits/waitflags.h index afc8b2229..1303c6c36 100644 --- a/libc/sysdeps/linux/arm/bits/waitflags.h +++ b/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 directly; use instead." #endif diff --git a/libc/sysdeps/linux/arm/bits/waitstatus.h b/libc/sysdeps/linux/arm/bits/waitstatus.h index 1ec55107f..982c9dbb2 100644 --- a/libc/sysdeps/linux/arm/bits/waitstatus.h +++ b/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 directly; use instead." #endif diff --git a/libc/sysdeps/linux/arm/bits/wordsize.h b/libc/sysdeps/linux/arm/bits/wordsize.h index 62dad0c71..ba643b60a 100644 --- a/libc/sysdeps/linux/arm/bits/wordsize.h +++ b/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 diff --git a/libc/sysdeps/linux/arm/bits/xopen_lim.h b/libc/sysdeps/linux/arm/bits/xopen_lim.h index 9f22e44e2..7f3611860 100644 --- a/libc/sysdeps/linux/arm/bits/xopen_lim.h +++ b/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 instead. @@ -30,7 +30,7 @@ #ifndef _XOPEN_LIM_H #define _XOPEN_LIM_H 1 -#define __need_FOPEN_MAX +#define __need_IOV_MAX #include /* 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 +# if __WORDSIZE == 64 +# define LONG_BIT 64 +# else +# define LONG_BIT 32 +# endif +#endif + #endif /* bits/xopen_lim.h */ diff --git a/libc/sysdeps/linux/arm/setjmp.S b/libc/sysdeps/linux/arm/setjmp.S index 8e290c0f8..a993f8c59 100644 --- a/libc/sysdeps/linux/arm/setjmp.S +++ b/libc/sysdeps/linux/arm/setjmp.S @@ -22,10 +22,10 @@ #include /* Binary compatibility entry point. */ -.globl setjmp; -.type setjmp,#function +.globl _setjmp; +.type _setjmp,#function .align 4; -setjmp: +_setjmp: mov r1, #0 diff --git a/libc/sysdeps/linux/common/errno.c b/libc/sysdeps/linux/common/errno.c index e6a8ae875..0d500dc8f 100644 --- a/libc/sysdeps/linux/common/errno.c +++ b/libc/sysdeps/linux/common/errno.c @@ -1,8 +1,8 @@ -#include +//#include int errno = 0; -int * __errno_location ( void ) +int * __attribute__ ((__weak__)) __errno_location ( void ) { return &errno; } diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c index 46751b1e7..5e1f97b95 100644 --- a/libc/sysdeps/linux/common/getdnnm.c +++ b/libc/sysdeps/linux/common/getdnnm.c @@ -1,7 +1,8 @@ #include #include -#include #include +#define __USE_GNU +#include int getdomainname(char *name, size_t len) diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c index 664881f2a..016e6f62e 100644 --- a/libc/sysdeps/linux/common/getdtablesize.c +++ b/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 +#include #include #include +#include + +#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; } diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c index 708fdd06e..362dd7b2b 100644 --- a/libc/sysdeps/linux/common/getpagesize.c +++ b/libc/sysdeps/linux/common/getpagesize.c @@ -17,10 +17,11 @@ Boston, MA 02111-1307, USA. */ #include +#include #include /* 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); diff --git a/libc/sysdeps/linux/common/setegid.c b/libc/sysdeps/linux/common/setegid.c index 19d8e3f9c..0869119e7 100644 --- a/libc/sysdeps/linux/common/setegid.c +++ b/libc/sysdeps/linux/common/setegid.c @@ -1,4 +1,5 @@ #include +#include int setegid(gid_t gid) { diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c index cbb43ce85..fbf60909d 100644 --- a/libc/sysdeps/linux/common/seteuid.c +++ b/libc/sysdeps/linux/common/seteuid.c @@ -1,6 +1,7 @@ #include #include #include +#include int seteuid(uid_t uid) { diff --git a/libc/sysdeps/linux/common/statfix.c b/libc/sysdeps/linux/common/statfix.c index 07facd0c7..d06b9448e 100644 --- a/libc/sysdeps/linux/common/statfix.c +++ b/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 - * , + * Copyright (C) 2000, 2001 by Lineo, inc. + * Written by Erik Andersen , * * 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" diff --git a/libc/sysdeps/linux/common/statfix.h b/libc/sysdeps/linux/common/statfix.h index eaf623b0e..0d1dbfa89 100644 --- a/libc/sysdeps/linux/common/statfix.h +++ b/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 diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c index 1ecb2e64f..613374688 100644 --- a/libc/sysdeps/linux/common/syscalls.c +++ b/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 -_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 -_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 -_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 +#include _syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz); #endif //#define __NR_settimeofday 79 #ifdef L_settimeofday -#include +#include _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 -_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 -_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 -_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 _syscall3(int, sigprocmask, int, how, const sigset_t *, set, sigset_t *, - oldset); #endif diff --git a/libc/sysdeps/linux/common/wait.c b/libc/sysdeps/linux/common/wait.c index 6520013f0..13f9e148e 100644 --- a/libc/sysdeps/linux/common/wait.c +++ b/libc/sysdeps/linux/common/wait.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/libc/sysdeps/linux/common/waitpid.c b/libc/sysdeps/linux/common/waitpid.c index 255a3c84e..a912e5179 100644 --- a/libc/sysdeps/linux/common/waitpid.c +++ b/libc/sysdeps/linux/common/waitpid.c @@ -1,4 +1,5 @@ -#include +#include +#include #include #include #include diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile index c346885a1..3cdadbd32 100644 --- a/libc/sysdeps/linux/i386/Makefile +++ b/libc/sysdeps/linux/i386/Makefile @@ -73,6 +73,8 @@ $(COBJS): %.o : %.c headers: @(TOPDIR=$(TOPDIR) CC=$(CC) /bin/sh $(TOPDIR)/extra/scripts/gen_bits_syscall_h.sh > bits/syscall.h ) + cd $(TOPDIR)/include/sys;ln -fs ../../libc/sysdeps/linux/i386/vm86.h . + clean: rm -f *.[oa] *~ core diff --git a/libc/sysdeps/linux/i386/bits/byteswap.h b/libc/sysdeps/linux/i386/bits/byteswap.h index a1ba6b874..c76b0814d 100644 --- a/libc/sysdeps/linux/i386/bits/byteswap.h +++ b/libc/sysdeps/linux/i386/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 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 directly; include instead." @@ -84,12 +84,27 @@ #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 { __extension__ unsigned long long int __ll; \ unsigned long int __l[2]; } __w, __r; \ - __w.__ll = (x); \ - __r.__l[0] = __bswap_32 (__w.__l[1]); \ - __r.__l[1] = __bswap_32 (__w.__l[0]); \ + 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 diff --git a/libc/sysdeps/linux/i386/bits/cmathcalls.h b/libc/sysdeps/linux/i386/bits/cmathcalls.h index c1b0781b0..c680c6d8e 100644 --- a/libc/sysdeps/linux/i386/bits/cmathcalls.h +++ b/libc/sysdeps/linux/i386/bits/cmathcalls.h @@ -1,22 +1,22 @@ /* Prototype declarations for complex math functions; helper file for . - 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. */ /* NOTE: Because of the special way this file is used by , this file must NOT be protected from multiple inclusion as header files @@ -47,7 +47,6 @@ #define _Mdouble_complex_ _Mdouble_ _Complex -__BEGIN_DECLS /* Trigonometric functions. */ @@ -131,30 +130,29 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z)); /* Now some optimized versions. GCC has handy notations for these - functions. */ -#if defined __GNUC__ && defined __OPTIMIZE__ + functions. Recent GCC handles these as builtin functions so does + not need inlines. */ +#if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__ /* Imaginary part of Z. */ extern __inline _Mdouble_ -__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) +__MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW { return __imag__ __z; } /* Real part of Z. */ extern __inline _Mdouble_ -__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) +__MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW { return __real__ __z; } /* Complex conjugate of Z. */ extern __inline _Mdouble_complex_ -__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) +__MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW { - return ~__z; + return __extension__ ~__z; } #endif - -__END_DECLS diff --git a/libc/sysdeps/linux/i386/bits/confname.h b/libc/sysdeps/linux/i386/bits/confname.h index a649e52f2..ba8868af4 100644 --- a/libc/sysdeps/linux/i386/bits/confname.h +++ b/libc/sysdeps/linux/i386/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 directly; include 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 diff --git a/libc/sysdeps/linux/i386/bits/dirent.h b/libc/sysdeps/linux/i386/bits/dirent.h index 1754c7cbe..e299c7784 100644 --- a/libc/sysdeps/linux/i386/bits/dirent.h +++ b/libc/sysdeps/linux/i386/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 directly; include 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 +#undef _DIRENT_HAVE_D_TYPE diff --git a/libc/sysdeps/linux/i386/bits/dlfcn.h b/libc/sysdeps/linux/i386/bits/dlfcn.h index f5983d706..2525fa3d9 100644 --- a/libc/sysdeps/linux/i386/bits/dlfcn.h +++ b/libc/sysdeps/linux/i386/bits/dlfcn.h @@ -1,37 +1,59 @@ /* System dependent definitions for run-time dynamic loading. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 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 - 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 directly; include instead." #endif /* The MODE argument to `dlopen' contains one of the following: */ -#define RTLD_LAZY 0x001 /* Lazy function call binding. */ -#define RTLD_NOW 0x002 /* Immediate function call binding. */ -#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ +#define RTLD_LAZY 0x00001 /* Lazy function call binding. */ +#define RTLD_NOW 0x00002 /* Immediate function call binding. */ +#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */ +#define RTLD_NOLOAD 0x00004 /* Do not load the object. */ /* If the following bit is set in the MODE argument to `dlopen', the symbols of the loaded object and its dependencies are made visible as if the object were linked directly into the program. */ -#define RTLD_GLOBAL 0x100 +#define RTLD_GLOBAL 0x00100 /* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL. The implementation does this by default and so we can define the value to zero. */ #define RTLD_LOCAL 0 + +/* Do not delete object when closed. */ +#define RTLD_NODELETE 0x01000 + +#ifdef __USE_GNU +/* To support profiling of shared objects it is a good idea to call + the function found using `dlsym' using the following macro since + these calls do not use the PLT. But this would mean the dynamic + loader has no chance to find out when the function is called. The + macro applies the necessary magic so that profiling is possible. + Rewrite + foo = (*fctp) (arg1, arg2); + into + foo = DL_CALL_FCT (fctp, (arg1, arg2)); +*/ +# define DL_CALL_FCT(fctp, args) \ + (_dl_mcount_wrapper_check (fctp), (*(fctp)) args) + +/* This function calls the profiling functions. */ +extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; +#endif diff --git a/libc/sysdeps/linux/i386/bits/elfclass.h b/libc/sysdeps/linux/i386/bits/elfclass.h index bb4dd545c..180227d9e 100644 --- a/libc/sysdeps/linux/i386/bits/elfclass.h +++ b/libc/sysdeps/linux/i386/bits/elfclass.h @@ -9,3 +9,6 @@ #include #define __ELF_NATIVE_CLASS __WORDSIZE + +/* The entries in the .hash table always have a size of 32 bits. */ +typedef uint32_t Elf_Symndx; diff --git a/libc/sysdeps/linux/i386/bits/environments.h b/libc/sysdeps/linux/i386/bits/environments.h index f3af20655..c3829927b 100644 --- a/libc/sysdeps/linux/i386/bits/environments.h +++ b/libc/sysdeps/linux/i386/bits/environments.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 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 _UNISTD_H # error "Never include this file directly. Use instead" @@ -27,32 +27,48 @@ `-1' means it is never supported. Undefined means it cannot be statically decided. - _XBS5_ILP32_OFF32 32bit int, long, pointers, and off_t type - _XBS5_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type + _POSIX_V6_ILP32_OFF32 32bit int, long, pointers, and off_t type + _POSIX_V6_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type - _XBS5_LP64_OFF32 64bit long and pointers and 32bit off_t type - _XBS5_LPBIG_OFFBIG 64bit long and pointers and large off_t type + _POSIX_V6_LP64_OFF32 64bit long and pointers and 32bit off_t type + _POSIX_V6_LPBIG_OFFBIG 64bit long and pointers and large off_t type + + The macros _XBS5_ILP32_OFF32, _XBS5_ILP32_OFFBIG, _XBS5_LP64_OFF32, and + _XBS5_LPBIG_OFFBIG were used in previous versions of the Unix standard + and are available only for compatibility. */ #if __WORDSIZE == 64 /* We can never provide environments with 32-bit wide pointers. */ +# define _POSIX_V6_ILP32_OFF32 -1 +# define _POSIX_V6_ILP32_OFFBIG -1 # define _XBS5_ILP32_OFF32 -1 # define _XBS5_ILP32_OFFBIG -1 +/* We also have no use (for now) for an environment with bigger pointers + and offsets. */ +# define _POSIX_V6_LPBIG_OFFBIG -1 +# define _XBS5_LPBIG_OFFBIG -1 /* By default we have 64-bit wide `long int', pointers and `off_t'. */ -# define _XBS5_LP64_OFF32 1 -# define _XBS5_LPBIG_OFFBIG 1 +# define _POSIX_V6_LP64_OFF64 1 +# define _XBS5_LP64_OFF64 1 #else /* __WORDSIZE == 32 */ -/* By default we have 32-bit wide `int', `long int', pointers and `off_t'. */ +/* By default we have 32-bit wide `int', `long int', pointers and `off_t' + and all platforms support LFS. */ +# define _POSIX_V6_ILP32_OFF32 1 +# define _POSIX_V6_ILP32_OFFBIG 1 # define _XBS5_ILP32_OFF32 1 +# define _XBS5_ILP32_OFFBIG 1 /* We optionally provide an environment with the above size but an 64-bit side `off_t'. Therefore we don't define _XBS5_ILP32_OFFBIG. */ /* We can never provide environments with 64-bit wide pointers. */ +# define _POSIX_V6_LP64_OFF64 -1 +# define _POSIX_V6_LPBIG_OFFBIG -1 # define _XBS5_LP64_OFF64 -1 # define _XBS5_LPBIG_OFFBIG -1 diff --git a/libc/sysdeps/linux/i386/bits/errno.h b/libc/sysdeps/linux/i386/bits/errno.h index 992358eb7..ac59d4c9d 100644 --- a/libc/sysdeps/linux/i386/bits/errno.h +++ b/libc/sysdeps/linux/i386/bits/errno.h @@ -1,21 +1,21 @@ /* Error constants. Linux specific version. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 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. */ #ifdef _ERRNO_H @@ -24,8 +24,6 @@ # undef ERANGE # include -__BEGIN_DECLS - /* Linux has no ENOTSUP error code. */ # define ENOTSUP EOPNOTSUPP @@ -38,7 +36,7 @@ __BEGIN_DECLS extern int errno; /* Function to get address of global `errno' variable. */ -extern int *__errno_location __P ((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. */ @@ -52,12 +50,10 @@ extern int *__errno_location __P ((void)) __attribute__ ((__const__)); # endif /* !__ASSEMBLER__ */ #endif /* _ERRNO_H */ -__END_DECLS - #if !defined _ERRNO_H && defined __need_Emath /* This is ugly but the kernel header is not clean enough. We must - define only the values EDOM and ERANGE in case __need_Emath is - defined. The value is the same for all Linux ports. */ + define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is + defined. */ # define EDOM 33 /* Math argument out of domain of function. */ # define EILSEQ 84 /* Illegal byte sequence. */ # define ERANGE 34 /* Math result not representable. */ diff --git a/libc/sysdeps/linux/i386/bits/fcntl.h b/libc/sysdeps/linux/i386/bits/fcntl.h index d47a66191..36b504a54 100644 --- a/libc/sysdeps/linux/i386/bits/fcntl.h +++ b/libc/sysdeps/linux/i386/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, 1996, 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 _FCNTL_H # error "Never use directly; include instead." @@ -42,17 +42,17 @@ #define O_ASYNC 020000 #ifdef __USE_GNU -# define O_DIRECT 040000 /* Direct disk access. */ -# define O_DIRECTORY 0200000 /* Must be a directory. */ -# define O_NOFOLLOW 0400000 /* Do not follow links. */ +# define O_DIRECT 040000 /* Direct disk access. */ +# define O_DIRECTORY 0200000 /* Must be a directory. */ +# define O_NOFOLLOW 0400000 /* Do not follow links. */ #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 #ifdef __USE_LARGEFILE64 @@ -65,16 +65,20 @@ #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,20 +88,26 @@ # 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 () */ +/* For old implementation of bsd flock(). */ #define F_EXLCK 4 /* or 3 */ #define F_SHLCK 8 /* or 4 */ #ifdef __USE_BSD -/* operations for bsd flock(), also used by the kernel implementation */ +/* Operations for bsd flock(), also used by the kernel implementation. */ # define LOCK_SH 1 /* shared lock */ # define LOCK_EX 2 /* exclusive lock */ # define LOCK_NB 4 /* or'd with one of the above to prevent @@ -105,9 +115,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 +150,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 +167,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 diff --git a/libc/sysdeps/linux/i386/bits/fenv.h b/libc/sysdeps/linux/i386/bits/fenv.h index 08bf67609..ef3fcb384 100644 --- a/libc/sysdeps/linux/i386/bits/fenv.h +++ b/libc/sysdeps/linux/i386/bits/fenv.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 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 - 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 _FENV_H # error "Never use directly; include instead." @@ -82,9 +82,9 @@ typedef struct fenv_t; /* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1) +#define FE_DFL_ENV ((__const fenv_t *) -1) #ifdef __USE_GNU /* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((fenv_t *) -2) +# define FE_NOMASK_ENV ((__const fenv_t *) -2) #endif diff --git a/libc/sysdeps/linux/i386/bits/huge_val.h b/libc/sysdeps/linux/i386/bits/huge_val.h index 23127b403..43f576d8a 100644 --- a/libc/sysdeps/linux/i386/bits/huge_val.h +++ b/libc/sysdeps/linux/i386/bits/huge_val.h @@ -1,22 +1,22 @@ /* `HUGE_VAL' constants for ix86 (where it is infinity). Used by and functions for overflow. - Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 1995, 1996, 1997, 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 _MATH_H # error "Never use directly; include instead." @@ -26,43 +26,56 @@ /* IEEE positive infinity (-HUGE_VAL is negative infinity). */ -#define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } +#if __GNUC_PREREQ(2,96) +# define HUGE_VAL (__extension__ 0x1.0p2047) +#else +# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } -#define __huge_val_t union { unsigned char __c[8]; double __d; } -#ifdef __GNUC__ -# define HUGE_VAL (__extension__ \ +# define __huge_val_t union { unsigned char __c[8]; double __d; } +# ifdef __GNUC__ +# define HUGE_VAL (__extension__ \ ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) -#else /* Not GCC. */ +# else /* Not GCC. */ static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; -# define HUGE_VAL (__huge_val.__d) -#endif /* GCC. */ +# define HUGE_VAL (__huge_val.__d) +# endif /* GCC. */ +#endif /* GCC 2.95 */ -/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ +/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */ -#ifdef __USE_ISOC9X +#ifdef __USE_ISOC99 -# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } +# if __GNUC_PREREQ(2,96) -# define __huge_valf_t union { unsigned char __c[4]; float __f; } -# ifdef __GNUC__ -# define HUGE_VALF (__extension__ \ +# define HUGE_VALF (__extension__ 0x1.0p255f) +# define HUGE_VALL (__extension__ 0x1.0p32767L) + +# else + +# define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } + +# define __huge_valf_t union { unsigned char __c[4]; float __f; } +# ifdef __GNUC__ +# define HUGE_VALF (__extension__ \ ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) -# else /* Not GCC. */ +# else /* Not GCC. */ static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; -# define HUGE_VALF (__huge_valf.__f) -# endif /* GCC. */ +# define HUGE_VALF (__huge_valf.__f) +# endif /* GCC. */ -# define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } +# define __HUGE_VALL_bytes { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } -# define __huge_vall_t union { unsigned char __c[12]; long double __ld; } -# ifdef __GNUC__ -# define HUGE_VALL (__extension__ \ +# define __huge_vall_t union { unsigned char __c[12]; long double __ld; } +# ifdef __GNUC__ +# define HUGE_VALL (__extension__ \ ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld) -# else /* Not GCC. */ +# else /* Not GCC. */ static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes }; -# define HUGE_VALL (__huge_vall.__ld) -# endif /* GCC. */ +# define HUGE_VALL (__huge_vall.__ld) +# endif /* GCC. */ + +# endif /* GCC 2.95 */ -#endif /* __USE_ISOC9X. */ +#endif /* __USE_ISOC99. */ diff --git a/libc/sysdeps/linux/i386/bits/in.h b/libc/sysdeps/linux/i386/bits/in.h index 38e2a2e00..e6cf57574 100644 --- a/libc/sysdeps/linux/i386/bits/in.h +++ b/libc/sysdeps/linux/i386/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. */ diff --git a/libc/sysdeps/linux/i386/bits/ioctl-types.h b/libc/sysdeps/linux/i386/bits/ioctl-types.h index 59c79df81..e856a04b4 100644 --- a/libc/sysdeps/linux/i386/bits/ioctl-types.h +++ b/libc/sysdeps/linux/i386/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 directly; include 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 */ diff --git a/libc/sysdeps/linux/i386/bits/ioctls.h b/libc/sysdeps/linux/i386/bits/ioctls.h index c103645f6..b49ca2076 100644 --- a/libc/sysdeps/linux/i386/bits/ioctls.h +++ b/libc/sysdeps/linux/i386/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 directly; include instead." diff --git a/libc/sysdeps/linux/i386/bits/ipc.h b/libc/sysdeps/linux/i386/bits/ipc.h index c4e37358e..f1a043fe5 100644 --- a/libc/sysdeps/linux/i386/bits/ipc.h +++ b/libc/sysdeps/linux/i386/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 directly; include instead." #endif -#include +#include /* 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; }; diff --git a/libc/sysdeps/linux/i386/bits/libc-lock.h b/libc/sysdeps/linux/i386/bits/libc-lock.h index a14cea1aa..dbd9cc14f 100644 --- a/libc/sysdeps/linux/i386/bits/libc-lock.h +++ b/libc/sysdeps/linux/i386/bits/libc-lock.h @@ -1,5 +1,5 @@ /* libc-internal interface for mutex locks. LinuxThreads version. - 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 @@ -25,8 +25,10 @@ /* Mutex type. */ #ifdef _LIBC typedef pthread_mutex_t __libc_lock_t; +typedef pthread_rwlock_t __libc_rwlock_t; #else typedef struct __libc_lock_opaque__ __libc_lock_t; +typedef struct __libc_rwlock_opaque__ __libc_rwlock_t; #endif /* Type for key to thread-specific data. */ @@ -41,15 +43,28 @@ typedef pthread_key_t __libc_key_t; of libc. */ #define __libc_lock_define(CLASS,NAME) \ CLASS __libc_lock_t NAME; +#define __libc_rwlock_define(CLASS,NAME) \ + CLASS __libc_rwlock_t NAME; /* Define an initialized lock variable NAME with storage class CLASS. - For the C library we take a deeper look at the initializer. For this - implementation all fields are initialized to zero. Therefore we - don't initialize the variable which allows putting it into the BSS - section. */ -#define __libc_lock_define_initialized(CLASS,NAME) \ + For the C library we take a deeper look at the initializer. For + this implementation all fields are initialized to zero. Therefore + we don't initialize the variable which allows putting it into the + BSS section. (Except on PA-RISC and other odd architectures, where + initialized locks must be set to one due to the lack of normal + atomic operations.) */ + +#if __LT_SPINLOCK_INIT == 0 +# define __libc_lock_define_initialized(CLASS,NAME) \ CLASS __libc_lock_t NAME; +#else +# define __libc_lock_define_initialized(CLASS,NAME) \ + CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER; +#endif + +#define __libc_rwlock_define_initialized(CLASS,NAME) \ + CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER; /* Define an initialized recursive lock variable NAME with storage class CLASS. */ @@ -60,6 +75,8 @@ typedef pthread_key_t __libc_key_t; state. */ #define __libc_lock_init(NAME) \ (__pthread_mutex_init != NULL ? __pthread_mutex_init (&(NAME), NULL) : 0); +#define __libc_rwlock_init(NAME) \ + (__pthread_rwlock_init != NULL ? __pthread_rwlock_init (&(NAME), NULL) : 0); /* Same as last but this time we initialize a recursive mutex. */ #define __libc_lock_init_recursive(NAME) \ @@ -79,6 +96,8 @@ typedef pthread_key_t __libc_key_t; called on a lock variable before the containing storage is reused. */ #define __libc_lock_fini(NAME) \ (__pthread_mutex_destroy != NULL ? __pthread_mutex_destroy (&(NAME)) : 0); +#define __libc_rwlock_fini(NAME) \ + (__pthread_rwlock_destroy != NULL ? __pthread_rwlock_destroy (&(NAME)) : 0); /* Finalize recursive named lock. */ #define __libc_lock_fini_recursive(NAME) __libc_lock_fini (NAME) @@ -86,6 +105,10 @@ typedef pthread_key_t __libc_key_t; /* Lock the named lock variable. */ #define __libc_lock_lock(NAME) \ (__pthread_mutex_lock != NULL ? __pthread_mutex_lock (&(NAME)) : 0); +#define __libc_rwlock_rdlock(NAME) \ + (__pthread_rwlock_rdlock != NULL ? __pthread_rwlock_rdlock (&(NAME)) : 0); +#define __libc_rwlock_wrlock(NAME) \ + (__pthread_rwlock_wrlock != NULL ? __pthread_rwlock_wrlock (&(NAME)) : 0); /* Lock the recursive named lock variable. */ #define __libc_lock_lock_recursive(NAME) __libc_lock_lock (NAME) @@ -93,6 +116,12 @@ typedef pthread_key_t __libc_key_t; /* Try to lock the named lock variable. */ #define __libc_lock_trylock(NAME) \ (__pthread_mutex_trylock != NULL ? __pthread_mutex_trylock (&(NAME)) : 0) +#define __libc_rwlock_tryrdlock(NAME) \ + (__pthread_rwlock_tryrdlock != NULL \ + ? __pthread_rwlock_tryrdlock (&(NAME)) : 0) +#define __libc_rwlock_trywrlock(NAME) \ + (__pthread_rwlock_trywrlock != NULL \ + ? __pthread_rwlock_trywrlock (&(NAME)) : 0) /* Try to lock the recursive named lock variable. */ #define __libc_lock_trylock_recursive(NAME) __libc_lock_trylock (NAME) @@ -100,6 +129,8 @@ typedef pthread_key_t __libc_key_t; /* Unlock the named lock variable. */ #define __libc_lock_unlock(NAME) \ (__pthread_mutex_unlock != NULL ? __pthread_mutex_unlock (&(NAME)) : 0); +#define __libc_rwlock_unlock(NAME) \ + (__pthread_rwlock_unlock != NULL ? __pthread_rwlock_unlock (&(NAME)) : 0); /* Unlock the recursive named lock variable. */ #define __libc_lock_unlock_recursive(NAME) __libc_lock_unlock (NAME) @@ -121,9 +152,9 @@ typedef pthread_key_t __libc_key_t; do { \ if (__pthread_once != NULL) \ __pthread_once (&(ONCE_CONTROL), (INIT_FUNCTION)); \ - else if ((ONCE_CONTROL) == 0) { \ + else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \ INIT_FUNCTION (); \ - (ONCE_CONTROL) = 1; \ + (ONCE_CONTROL) = !PTHREAD_ONCE_INIT; \ } \ } while (0) @@ -166,27 +197,93 @@ typedef pthread_key_t __libc_key_t; #define __libc_atfork(PREPARE, PARENT, CHILD) \ (__pthread_atfork != NULL ? __pthread_atfork (PREPARE, PARENT, CHILD) : 0) +/* Functions that are used by this file and are internal to the GNU C + library. */ + +extern int __pthread_mutex_init (pthread_mutex_t *__mutex, + __const pthread_mutexattr_t *__mutex_attr); + +extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex); + +extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex); + +extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); + +extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); + +extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr); + +extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr); + +extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr, + int __kind); + +#ifdef __USE_UNIX98 +extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock, + __const pthread_rwlockattr_t *__attr); + +extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); + +extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); + +extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); + +extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); + +extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); + +extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); +#endif + +extern int __pthread_key_create (pthread_key_t *__key, + void (*__destr_function) (void *)); + +extern int __pthread_setspecific (pthread_key_t __key, + __const void *__pointer); + +extern void *__pthread_getspecific (pthread_key_t __key); + +extern int __pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)); + +extern int __pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)); + + /* Make the pthread functions weak so that we can elide them from single-threaded processes. */ #ifndef __NO_WEAK_PTHREAD_ALIASES # ifdef weak_extern -weak_extern (__pthread_mutex_init) -weak_extern (__pthread_mutex_destroy) -weak_extern (__pthread_mutex_lock) -weak_extern (__pthread_mutex_trylock) -weak_extern (__pthread_mutex_unlock) -weak_extern (__pthread_mutexattr_init) -weak_extern (__pthread_mutexattr_destroy) -weak_extern (__pthread_mutexattr_settype) -weak_extern (__pthread_key_create) -weak_extern (__pthread_setspecific) -weak_extern (__pthread_getspecific) -weak_extern (__pthread_once) +# if _LIBC +# include +# else +# define BP_SYM (sym) sym +# endif +weak_extern (BP_SYM (__pthread_mutex_init)) +weak_extern (BP_SYM (__pthread_mutex_destroy)) +weak_extern (BP_SYM (__pthread_mutex_lock)) +weak_extern (BP_SYM (__pthread_mutex_trylock)) +weak_extern (BP_SYM (__pthread_mutex_unlock)) +weak_extern (BP_SYM (__pthread_mutexattr_init)) +weak_extern (BP_SYM (__pthread_mutexattr_destroy)) +weak_extern (BP_SYM (__pthread_mutexattr_settype)) +weak_extern (BP_SYM (__pthread_rwlock_init)) +weak_extern (BP_SYM (__pthread_rwlock_destroy)) +weak_extern (BP_SYM (__pthread_rwlock_rdlock)) +weak_extern (BP_SYM (__pthread_rwlock_tryrdlock)) +weak_extern (BP_SYM (__pthread_rwlock_wrlock)) +weak_extern (BP_SYM (__pthread_rwlock_trywrlock)) +weak_extern (BP_SYM (__pthread_rwlock_unlock)) +weak_extern (BP_SYM (__pthread_key_create)) +weak_extern (BP_SYM (__pthread_setspecific)) +weak_extern (BP_SYM (__pthread_getspecific)) +weak_extern (BP_SYM (__pthread_once)) weak_extern (__pthread_initialize) weak_extern (__pthread_atfork) -weak_extern (_pthread_cleanup_push_defer) -weak_extern (_pthread_cleanup_pop_restore) +weak_extern (BP_SYM (_pthread_cleanup_push_defer)) +weak_extern (BP_SYM (_pthread_cleanup_pop_restore)) # else # pragma weak __pthread_mutex_init # pragma weak __pthread_mutex_destroy @@ -196,6 +293,12 @@ weak_extern (_pthread_cleanup_pop_restore) # pragma weak __pthread_mutexattr_init # pragma weak __pthread_mutexattr_destroy # pragma weak __pthread_mutexattr_settype +# pragma weak __pthread_rwlock_destroy +# pragma weak __pthread_rwlock_rdlock +# pragma weak __pthread_rwlock_tryrdlock +# pragma weak __pthread_rwlock_wrlock +# pragma weak __pthread_rwlock_trywrlock +# pragma weak __pthread_rwlock_unlock # pragma weak __pthread_key_create # pragma weak __pthread_setspecific # pragma weak __pthread_getspecific diff --git a/libc/sysdeps/linux/i386/bits/local_lim.h b/libc/sysdeps/linux/i386/bits/local_lim.h index 545a90b2e..0a7c83706 100644 --- a/libc/sysdeps/linux/i386/bits/local_lim.h +++ b/libc/sysdeps/linux/i386/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 @@ -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 diff --git a/libc/sysdeps/linux/i386/bits/locale.h b/libc/sysdeps/linux/i386/bits/locale.h index b15a9b0d7..50064b53e 100644 --- a/libc/sysdeps/linux/i386/bits/locale.h +++ b/libc/sysdeps/linux/i386/bits/locale.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. */ #if !defined _LOCALE_H && !defined _LANGINFO_H # error "Never use directly; include instead." diff --git a/libc/sysdeps/linux/i386/bits/mathcalls.h b/libc/sysdeps/linux/i386/bits/mathcalls.h index f261ace0f..c1181f737 100644 --- a/libc/sysdeps/linux/i386/bits/mathcalls.h +++ b/libc/sysdeps/linux/i386/bits/mathcalls.h @@ -1,21 +1,21 @@ /* Prototype declarations for math functions; helper file for . - 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 - 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 , this file must NOT be protected from multiple inclusion as header files @@ -47,7 +47,6 @@ #error "Never include directly; include instead." #endif -__BEGIN_DECLS /* Trigonometric functions. */ @@ -82,7 +81,7 @@ __MATHCALL (sinh,, (_Mdouble_ __x)); /* Hyperbolic tangent of X. */ __MATHCALL (tanh,, (_Mdouble_ __x)); -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Hyperbolic arc cosine of X. */ __MATHCALL (acosh,, (_Mdouble_ __x)); /* Hyperbolic arc sine of X. */ @@ -118,7 +117,7 @@ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)); -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return exp(X) - 1. */ __MATHCALL (expm1,, (_Mdouble_ __x)); @@ -129,7 +128,7 @@ __MATHCALL (log1p,, (_Mdouble_ __x)); __MATHCALL (logb,, (_Mdouble_ __x)); #endif -#ifdef __USE_ISOC9X +#ifdef __USE_ISOC99 /* Compute base-2 exponential of X. */ __MATHCALL (exp2,, (_Mdouble_ __x)); @@ -146,12 +145,12 @@ __MATHCALL (pow,, (_Mdouble_ __x, _Mdouble_ __y)); /* Return the square root of X. */ __MATHCALL (sqrt,, (_Mdouble_ __x)); -#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 /* Return `sqrt(X*X + Y*Y)'. */ __MATHCALL (hypot,, (_Mdouble_ __x, _Mdouble_ __y)); #endif -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the cube root of X. */ __MATHCALL (cbrt,, (_Mdouble_ __x)); #endif @@ -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)); @@ -203,12 +194,12 @@ __MATHCALL (drem,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL (significand,, (_Mdouble_ __x)); #endif /* Use misc. */ -#if defined __USE_MISC || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_ISOC99 /* Return X with its signed changed to Y's. */ __MATHCALLX (copysign,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); #endif -#ifdef __USE_ISOC9X +#ifdef __USE_ISOC99 /* Return representation of NaN for double type. */ __MATHCALLX (nan,, (__const char *__tagb), (__const__)); #endif @@ -231,11 +222,14 @@ __MATHCALL (yn,, (int, _Mdouble_)); #endif -#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99 /* Error and gamma functions. */ __MATHCALL (erf,, (_Mdouble_)); __MATHCALL (erfc,, (_Mdouble_)); __MATHCALL (lgamma,, (_Mdouble_)); +#endif + +#ifdef __USE_ISOC99 __MATHCALL (tgamma,, (_Mdouble_)); #endif @@ -252,14 +246,14 @@ __MATHCALL (lgamma,_r, (_Mdouble_, int *__signgamp)); #endif -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 /* Return the integer nearest X in the direction of the prevailing rounding mode. */ __MATHCALL (rint,, (_Mdouble_ __x)); /* Return X + epsilon if X < Y, X - epsilon if X > Y. */ __MATHCALLX (nextafter,, (_Mdouble_ __x, _Mdouble_ __y), (__const__)); -# ifdef __USE_ISOC9X +# ifdef __USE_ISOC99 __MATHCALLX (nexttoward,, (_Mdouble_ __x, long double __y), (__const__)); # endif @@ -271,14 +265,16 @@ __MATHCALL (remainder,, (_Mdouble_ __x, _Mdouble_ __y)); __MATHCALL (scalb,, (_Mdouble_ __x, _Mdouble_ __n)); # endif +# if defined __USE_MISC || defined __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbn,, (_Mdouble_ __x, int __n)); +# endif /* Return the binary exponent of X, which must be nonzero. */ __MATHDECL (int,ilogb,, (_Mdouble_ __x)); #endif -#ifdef __USE_ISOC9X +#ifdef __USE_ISOC99 /* Return X times (2 to the Nth power). */ __MATHCALL (scalbln,, (_Mdouble_ __x, long int __n)); @@ -334,6 +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 C 9X. */ - -__END_DECLS +#endif /* Use ISO C99. */ diff --git a/libc/sysdeps/linux/i386/bits/mathdef.h b/libc/sysdeps/linux/i386/bits/mathdef.h index 58b116e8d..fe928daa6 100644 --- a/libc/sysdeps/linux/i386/bits/mathdef.h +++ b/libc/sysdeps/linux/i386/bits/mathdef.h @@ -1,26 +1,26 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 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 - 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 directly; include instead" #endif -#if defined __USE_ISOC9X && defined _MATH_H && !defined _MATH_H_MATHDEF +#if defined __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF # define _MATH_H_MATHDEF 1 /* The ix87 FPUs evaluate all values in the 80 bit floating-point format @@ -31,17 +31,11 @@ typedef long double float_t; /* `float' expressions are evaluated as typedef long double double_t; /* `double' expressions are evaluated as `long double'. */ -/* Signal that both types are `long double'. */ -# define FLT_EVAL_METHOD 2 - /* Define `INFINITY' as value of type `float'. */ # define INFINITY HUGE_VALF /* The values returned by `ilogb' for 0 and NaN respectively. */ -# define FP_ILOGB0 0x80000000 -# define FP_ILOGBNAN 0x80000000 - -/* Number of decimal digits for the `long double' type. */ -# define DECIMAL_DIG 18 +# define FP_ILOGB0 (-2147483647 - 1) +# define FP_ILOGBNAN (-2147483647 - 1) #endif /* ISO C99 */ diff --git a/libc/sysdeps/linux/i386/bits/mathinline.h b/libc/sysdeps/linux/i386/bits/mathinline.h index acc3aa998..e8091df68 100644 --- a/libc/sysdeps/linux/i386/bits/mathinline.h +++ b/libc/sysdeps/linux/i386/bits/mathinline.h @@ -1,22 +1,22 @@ /* Inline math functions for i387. - Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by John C. Bowman , 1995. 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 directly; include instead." @@ -29,105 +29,115 @@ #endif -#if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2 -/* ISO C 9X defines some macros to perform unordered comparisons. The +#if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2 +# if __GNUC_PREREQ (2,97) +/* GCC 2.97 and up have builtins that actually can be used. */ +# define isgreater(x, y) __builtin_isgreater (x, y) +# define isgreaterequal(x, y) __builtin_isgreaterequal (x, y) +# define isless(x, y) __builtin_isless (x, y) +# define islessequal(x, y) __builtin_islessequal (x, y) +# define islessgreater(x, y) __builtin_islessgreater (x, y) +# define isunordered(x, y) __builtin_isunordered (x, y) +# else +/* ISO C99 defines some macros to perform unordered comparisons. The ix87 FPU supports this with special opcodes and we should use them. These must not be inline functions since we have to be able to handle all floating-point types. */ -# ifdef __i686__ +# ifdef __i686__ /* For the PentiumPro and more recent processors we can provide better code. */ -# define isgreater(x, y) \ +# define isgreater(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; seta %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \ __result; }) -# define isgreaterequal(x, y) \ +# define isgreaterequal(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; setae %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \ __result; }) -# define isless(x, y) \ +# define isless(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; seta %%al" \ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \ __result; }) -# define islessequal(x, y) \ +# define islessequal(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; setae %%al" \ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st"); \ __result; }) -# define islessgreater(x, y) \ +# define islessgreater(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; setne %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \ __result; }) -# define isunordered(x, y) \ +# define isunordered(x, y) \ ({ register char __result; \ __asm__ ("fucomip %%st(1), %%st; setp %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \ __result; }) -# else +# else /* This is the dumb, portable code for i386 and above. */ -# define isgreater(x, y) \ +# define isgreater(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \ __result; }) -# define isgreaterequal(x, y) \ +# define isgreaterequal(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \ __result; }) -# define isless(x, y) \ +# define isless(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \ __result; }) -# define islessequal(x, y) \ +# define islessequal(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \ : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \ __result; }) -# define islessgreater(x, y) \ +# define islessgreater(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \ __result; }) -# define isunordered(x, y) \ +# define isunordered(x, y) \ ({ register char __result; \ __asm__ ("fucompp; fnstsw; sahf; setp %%al" \ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \ __result; }) -# endif /* __i686__ */ +# endif /* __i686__ */ +# endif /* GCC 2.97 */ /* The gcc, version 2.7 or below, has problems with all this inlining code. So disable it for this version of the compiler. */ -# if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)) +# if __GNUC_PREREQ (2, 8) /* Test for negative number. Used in the signbit() macro. */ __MATH_INLINE int -__signbitf (float __x) +__signbitf (float __x) __THROW { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; } __MATH_INLINE int -__signbit (double __x) +__signbit (double __x) __THROW { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[1] < 0; } __MATH_INLINE int -__signbitl (long double __x) +__signbitl (long double __x) __THROW { __extension__ union { long double __l; int __i[3]; } __u = { __l: __x }; return (__u.__i[2] & 0x8000) != 0; @@ -138,7 +148,7 @@ __signbitl (long double __x) /* The gcc, version 2.7 or below, has problems with all this inlining code. So disable it for this version of the compiler. */ -#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)) +#if __GNUC_PREREQ (2, 8) #if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \ && defined __OPTIMIZE__) @@ -146,35 +156,54 @@ __signbitl (long double __x) /* A macro to define float, double, and long double versions of various math functions for the ix87 FPU. FUNC is the function name (which will be suffixed with f and l for the float and long double version, - respectively). OP is the name of the FPU operation. */ + respectively). OP is the name of the FPU operation. + We define two sets of macros. The set with the additional NP + doesn't add a prototype declaration. */ -#if defined __USE_MISC || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_ISOC99 # define __inline_mathop(func, op) \ __inline_mathop_ (double, func, op) \ __inline_mathop_ (float, __CONCAT(func,f), op) \ __inline_mathop_ (long double, __CONCAT(func,l), op) +# define __inline_mathopNP(func, op) \ + __inline_mathopNP_ (double, func, op) \ + __inline_mathopNP_ (float, __CONCAT(func,f), op) \ + __inline_mathopNP_ (long double, __CONCAT(func,l), op) #else # define __inline_mathop(func, op) \ __inline_mathop_ (double, func, op) +# define __inline_mathopNP(func, op) \ + __inline_mathopNP_ (double, func, op) #endif #define __inline_mathop_(float_type, func, op) \ __inline_mathop_decl_ (float_type, func, op, "0" (__x)) +#define __inline_mathopNP_(float_type, func, op) \ + __inline_mathop_declNP_ (float_type, func, op, "0" (__x)) -#if defined __USE_MISC || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_ISOC99 # define __inline_mathop_decl(func, op, params...) \ __inline_mathop_decl_ (double, func, op, params) \ __inline_mathop_decl_ (float, __CONCAT(func,f), op, params) \ __inline_mathop_decl_ (long double, __CONCAT(func,l), op, params) +# define __inline_mathop_declNP(func, op, params...) \ + __inline_mathop_declNP_ (double, func, op, params) \ + __inline_mathop_declNP_ (float, __CONCAT(func,f), op, params) \ + __inline_mathop_declNP_ (long double, __CONCAT(func,l), op, params) #else # define __inline_mathop_decl(func, op, params...) \ __inline_mathop_decl_ (double, func, op, params) +# define __inline_mathop_declNP(func, op, params...) \ + __inline_mathop_declNP_ (double, func, op, params) #endif #define __inline_mathop_decl_(float_type, func, op, params...) \ - __MATH_INLINE float_type func (float_type); \ - __MATH_INLINE float_type func (float_type __x) \ + __MATH_INLINE float_type func (float_type) __THROW; \ + __inline_mathop_declNP_ (float_type, func, op, params) + +#define __inline_mathop_declNP_(float_type, func, op, params...) \ + __MATH_INLINE float_type func (float_type __x) __THROW \ { \ register float_type __result; \ __asm __volatile__ (op : "=t" (__result) : params); \ @@ -182,46 +211,74 @@ __signbitl (long double __x) } -#if defined __USE_MISC || defined __USE_ISOC9X +#if defined __USE_MISC || defined __USE_ISOC99 # define __inline_mathcode(func, arg, code) \ __inline_mathcode_ (double, func, arg, code) \ __inline_mathcode_ (float, __CONCAT(func,f), arg, code) \ __inline_mathcode_ (long double, __CONCAT(func,l), arg, code) +# define __inline_mathcodeNP(func, arg, code) \ + __inline_mathcodeNP_ (double, func, arg, code) \ + __inline_mathcodeNP_ (float, __CONCAT(func,f), arg, code) \ + __inline_mathcodeNP_ (long double, __CONCAT(func,l), arg, code) # define __inline_mathcode2(func, arg1, arg2, code) \ __inline_mathcode2_ (double, func, arg1, arg2, code) \ __inline_mathcode2_ (float, __CONCAT(func,f), arg1, arg2, code) \ __inline_mathcode2_ (long double, __CONCAT(func,l), arg1, arg2, code) +# define __inline_mathcodeNP2(func, arg1, arg2, code) \ + __inline_mathcodeNP2_ (double, func, arg1, arg2, code) \ + __inline_mathcodeNP2_ (float, __CONCAT(func,f), arg1, arg2, code) \ + __inline_mathcodeNP2_ (long double, __CONCAT(func,l), arg1, arg2, code) # define __inline_mathcode3(func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \ __inline_mathcode3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code) +# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \ + __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) \ + __inline_mathcodeNP3_ (float, __CONCAT(func,f), arg1, arg2, arg3, code) \ + __inline_mathcodeNP3_ (long double, __CONCAT(func,l), arg1, arg2, arg3, code) #else # define __inline_mathcode(func, arg, code) \ __inline_mathcode_ (double, func, (arg), code) +# define __inline_mathcodeNP(func, arg, code) \ + __inline_mathcodeNP_ (double, func, (arg), code) # define __inline_mathcode2(func, arg1, arg2, code) \ __inline_mathcode2_ (double, func, arg1, arg2, code) +# define __inline_mathcodeNP2(func, arg1, arg2, code) \ + __inline_mathcodeNP2_ (double, func, arg1, arg2, code) # define __inline_mathcode3(func, arg1, arg2, arg3, code) \ __inline_mathcode3_ (double, func, arg1, arg2, arg3, code) +# define __inline_mathcodeNP3(func, arg1, arg2, arg3, code) \ + __inline_mathcodeNP3_ (double, func, arg1, arg2, arg3, code) #endif #define __inline_mathcode_(float_type, func, arg, code) \ - __MATH_INLINE float_type func (float_type); \ - __MATH_INLINE float_type func (float_type arg) \ + __MATH_INLINE float_type func (float_type) __THROW; \ + __inline_mathcodeNP_(float_type, func, arg, code) + +#define __inline_mathcodeNP_(float_type, func, arg, code) \ + __MATH_INLINE float_type func (float_type arg) __THROW \ { \ code; \ } + #define __inline_mathcode2_(float_type, func, arg1, arg2, code) \ - __MATH_INLINE float_type func (float_type, float_type); \ - __MATH_INLINE float_type func (float_type arg1, float_type arg2) \ + __MATH_INLINE float_type func (float_type, float_type) __THROW; \ + __inline_mathcodeNP2_ (float_type, func, arg1, arg2, code) + +#define __inline_mathcodeNP2_(float_type, func, arg1, arg2, code) \ + __MATH_INLINE float_type func (float_type arg1, float_type arg2) __THROW \ { \ code; \ } #define __inline_mathcode3_(float_type, func, arg1, arg2, arg3, code) \ - __MATH_INLINE float_type func (float_type, float_type, float_type); \ + __MATH_INLINE float_type func (float_type, float_type, float_type) __THROW; \ + __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) + +#define __inline_mathcodeNP3_(float_type, func, arg1, arg2, arg3, code) \ __MATH_INLINE float_type func (float_type arg1, float_type arg2, \ - float_type arg3) \ + float_type arg3) __THROW \ { \ code; \ } @@ -234,6 +291,8 @@ __signbitl (long double __x) __inline_mathcode (__sgn, __x, \ return __x == 0.0 ? 0.0 : (__x > 0.0 ? 1.0 : -1.0)) +/* __FAST_MATH__ is defined by gcc -ffast-math. */ +#ifdef __FAST_MATH__ __inline_mathcode (__pow2, __x, \ register long double __value; \ register long double __exponent; \ @@ -258,7 +317,8 @@ __inline_mathcode (__pow2, __x, \ : "=t" (__value) : "0" (__value), "u" (__exponent)); \ return __value) -#define __sincos_code \ +# ifdef __USE_GNU +# define __sincos_code \ register long double __cosr; \ register long double __sinr; \ __asm __volatile__ \ @@ -280,33 +340,30 @@ __inline_mathcode (__pow2, __x, \ *__sinx = __sinr; \ *__cosx = __cosr -__MATH_INLINE void __sincos (double __x, double *__sinx, double *__cosx); __MATH_INLINE void -__sincos (double __x, double *__sinx, double *__cosx) +__sincos (double __x, double *__sinx, double *__cosx) __THROW { __sincos_code; } -__MATH_INLINE void __sincosf (float __x, float *__sinx, float *__cosx); __MATH_INLINE void -__sincosf (float __x, float *__sinx, float *__cosx) +__sincosf (float __x, float *__sinx, float *__cosx) __THROW { __sincos_code; } -__MATH_INLINE void __sincosl (long double __x, long double *__sinx, - long double *__cosx); __MATH_INLINE void -__sincosl (long double __x, long double *__sinx, long double *__cosx) +__sincosl (long double __x, long double *__sinx, long double *__cosx) __THROW { __sincos_code; } +# endif /* Optimized inline implementation, sometimes with reduced precision and/or argument range. */ -#define __expm1_code \ +# define __expm1_code \ register long double __value; \ register long double __exponent; \ register long double __temp; \ @@ -324,11 +381,11 @@ __sincosl (long double __x, long double *__sinx, long double *__cosx) ("fscale # 2^int(x * log2(e))\n\t" \ : "=t" (__temp) : "0" (1.0), "u" (__exponent)); \ __temp -= 1.0; \ - return __temp + __value -__inline_mathcode_ (long double, __expm1l, __x, __expm1_code) + return __temp + __value ?: __x +__inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code) -#define __exp_code \ +# define __exp_code \ register long double __value; \ register long double __exponent; \ __asm __volatile__ \ @@ -345,17 +402,18 @@ __inline_mathcode_ (long double, __expm1l, __x, __expm1_code) ("fscale" \ : "=t" (__value) : "0" (__value), "u" (__exponent)); \ return __value -__inline_mathcode (exp, __x, __exp_code) -__inline_mathcode_ (long double, __expl, __x, __exp_code) +__inline_mathcodeNP (exp, __x, __exp_code) +__inline_mathcodeNP_ (long double, __expl, __x, __exp_code) -__inline_mathcode (tan, __x, \ +__inline_mathcodeNP (tan, __x, \ register long double __value; \ register long double __value2 __attribute__ ((__unused__)); \ __asm __volatile__ \ ("fptan" \ : "=t" (__value2), "=u" (__value) : "0" (__x)); \ return __value) +#endif /* __FAST_MATH__ */ #define __atan2_code \ @@ -364,11 +422,11 @@ __inline_mathcode (tan, __x, \ ("fpatan" \ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); \ return __value -__inline_mathcode2 (atan2, __y, __x, __atan2_code) -__inline_mathcode2_ (long double, __atan2l, __y, __x, __atan2_code) +__inline_mathcodeNP2 (atan2, __y, __x, __atan2_code) +__inline_mathcodeNP2_ (long double, __atan2l, __y, __x, __atan2_code) -__inline_mathcode2 (fmod, __x, __y, \ +__inline_mathcodeNP2 (fmod, __x, __y, \ register long double __value; \ __asm __volatile__ \ ("1: fprem\n\t" \ @@ -379,93 +437,59 @@ __inline_mathcode2 (fmod, __x, __y, \ return __value) -__inline_mathcode2 (pow, __x, __y, \ - register long double __value; \ - register long double __exponent; \ - __extension__ long long int __p = (long long int) __y; \ - if (__x == 0.0 && __y > 0.0) \ - return 0.0; \ - if (__y == (double) __p) \ - { \ - long double __r = 1.0; \ - if (__p == 0) \ - return 1.0; \ - if (__p < 0) \ - { \ - __p = -__p; \ - __x = 1.0 / __x; \ - } \ - while (1) \ - { \ - if (__p & 1) \ - __r *= __x; \ - __p >>= 1; \ - if (__p == 0) \ - return __r; \ - __x *= __x; \ - } \ - /* NOTREACHED */ \ - } \ - __asm __volatile__ \ - ("fyl2x" : "=t" (__value) : "0" (__x), "u" (1.0) : "st(1)"); \ - __asm __volatile__ \ - ("fmul %%st(1) # y * log2(x)\n\t" \ - "fst %%st(1)\n\t" \ - "frndint # int(y * log2(x))\n\t" \ - "fxch\n\t" \ - "fsub %%st(1) # fract(y * log2(x))\n\t" \ - "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" \ - : "=t" (__value), "=u" (__exponent) : "0" (__y), "1" (__value)); \ - __value += 1.0; \ - __asm __volatile__ \ - ("fscale" \ - : "=t" (__value) : "0" (__value), "u" (__exponent)); \ - return __value) - - -__inline_mathop (sqrt, "fsqrt") -__inline_mathop_ (long double, __sqrtl, "fsqrt") +__inline_mathopNP (sqrt, "fsqrt") +__inline_mathopNP_ (long double, __sqrtl, "fsqrt") -#if defined __GNUC__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 8) -__inline_mathcode_ (double, fabs, __x, return __builtin_fabs (__x)) -__inline_mathcode_ (float, fabsf, __x, return __builtin_fabsf (__x)) -__inline_mathcode_ (long double, fabsl, __x, return __builtin_fabsl (__x)) -__inline_mathcode_ (long double, __fabsl, __x, return __builtin_fabsl (__x)) +#if __GNUC_PREREQ (2, 8) +__inline_mathcodeNP_ (double, fabs, __x, return __builtin_fabs (__x)) +__inline_mathcodeNP_ (float, fabsf, __x, return __builtin_fabsf (__x)) +__inline_mathcodeNP_ (long double, fabsl, __x, return __builtin_fabsl (__x)) +__inline_mathcodeNP_ (long double, __fabsl, __x, return __builtin_fabsl (__x)) #else __inline_mathop (fabs, "fabs") __inline_mathop_ (long double, __fabsl, "fabs") #endif +#ifdef __FAST_MATH__ /* The argument range of this inline version is reduced. */ -__inline_mathop (sin, "fsin") +__inline_mathopNP (sin, "fsin") /* The argument range of this inline version is reduced. */ -__inline_mathop (cos, "fcos") +__inline_mathopNP (cos, "fcos") -__inline_mathop_decl (atan, "fld1; fpatan", "0" (__x) : "st(1)") -__inline_mathop_decl (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)") -__inline_mathop_decl (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)") +__inline_mathop_declNP (log, "fldln2; fxch; fyl2x", "0" (__x) : "st(1)") +__inline_mathop_declNP (log10, "fldlg2; fxch; fyl2x", "0" (__x) : "st(1)") -__inline_mathcode (asin, __x, return __atan2l (__x, __sqrtl (1.0 - __x * __x))) -__inline_mathcode (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), __x)) +__inline_mathcodeNP (asin, __x, return __atan2l (__x, __sqrtl (1.0 - __x * __x))) +__inline_mathcodeNP (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), __x)) +#endif /* __FAST_MATH__ */ -__inline_mathcode_ (long double, __sgn1l, __x, return __x >= 0.0 ? 1.0 : -1.0) +__inline_mathop_declNP (atan, "fld1; fpatan", "0" (__x) : "st(1)") +__inline_mathcode_ (long double, __sgn1l, __x, \ + __extension__ union { long double __xld; unsigned int __xi[3]; } __n = \ + { __xld: __x }; \ + __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff; \ + __n.__xi[1] = 0x80000000; \ + __n.__xi[0] = 0; \ + return __n.__xld) + +#ifdef __FAST_MATH__ /* The argument range of the inline version of sinhl is slightly reduced. */ -__inline_mathcode (sinh, __x, \ +__inline_mathcodeNP (sinh, __x, \ register long double __exm1 = __expm1l (__fabsl (__x)); \ return 0.5 * (__exm1 / (__exm1 + 1.0) + __exm1) * __sgn1l (__x)) -__inline_mathcode (cosh, __x, \ +__inline_mathcodeNP (cosh, __x, \ register long double __ex = __expl (__x); \ return 0.5 * (__ex + 1.0 / __ex)) -__inline_mathcode (tanh, __x, \ +__inline_mathcodeNP (tanh, __x, \ register long double __exm1 = __expm1l (-__fabsl (__x + __x)); \ return __exm1 / (__exm1 + 2.0) * __sgn1l (-__x)) +#endif - -__inline_mathcode (floor, __x, \ +__inline_mathcodeNP (floor, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ @@ -476,7 +500,7 @@ __inline_mathcode (floor, __x, \ __asm __volatile ("fldcw %0" : : "m" (__cw)); \ return __value) -__inline_mathcode (ceil, __x, \ +__inline_mathcodeNP (ceil, __x, \ register long double __value; \ __volatile unsigned short int __cw; \ __volatile unsigned short int __cwtmp; \ @@ -494,24 +518,25 @@ __inline_mathcode (ceil, __x, \ : "=t" (__value) : "0" (__x), "u" ((long double) __y)); \ return __value -__MATH_INLINE double ldexp (double __x, int __y); __MATH_INLINE double -ldexp (double __x, int __y) +ldexp (double __x, int __y) __THROW { __ldexp_code; } /* Optimized versions for some non-standardized functions. */ -#if defined __USE_ISOC9X || defined __USE_MISC +#if defined __USE_ISOC99 || defined __USE_MISC -__inline_mathcode (expm1, __x, __expm1_code) +# ifdef __FAST_MATH__ +__inline_mathcodeNP (expm1, __x, __expm1_code) +# endif /* We cannot rely on M_SQRT being defined. So we do it for ourself here. */ # define __M_SQRT2 1.41421356237309504880L /* sqrt(2) */ -__inline_mathcode (log1p, __x, \ +__inline_mathcodeNP (log1p, __x, \ register long double __value; \ if (__fabsl (__x) >= 1.0 - 0.5 * __M_SQRT2) \ __value = logl (1.0 + __x); \ @@ -525,22 +550,22 @@ __inline_mathcode (log1p, __x, \ /* The argument range of the inline version of asinhl is slightly reduced. */ -__inline_mathcode (asinh, __x, \ +__inline_mathcodeNP (asinh, __x, \ register long double __y = __fabsl (__x); \ return (log1pl (__y * __y / (__sqrtl (__y * __y + 1.0) + 1.0) + __y) \ * __sgn1l (__x))) -__inline_mathcode (acosh, __x, \ +__inline_mathcodeNP (acosh, __x, \ return logl (__x + __sqrtl (__x - 1.0) * __sqrtl (__x + 1.0))) -__inline_mathcode (atanh, __x, \ +__inline_mathcodeNP (atanh, __x, \ register long double __y = __fabsl (__x); \ return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x)) /* The argument range of the inline version of hypotl is slightly reduced. */ -__inline_mathcode2 (hypot, __x, __y, return __sqrtl (__x * __x + __y * __y)) +__inline_mathcodeNP2 (hypot, __x, __y, return __sqrtl (__x * __x + __y * __y)) -__inline_mathcode(logb, __x, \ +__inline_mathcodeNP(logb, __x, \ register long double __value; \ register long double __junk; \ __asm __volatile__ \ @@ -550,26 +575,28 @@ __inline_mathcode(logb, __x, \ #endif -#ifdef __USE_ISOC9X -__inline_mathop_decl (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)") +#ifdef __USE_ISOC99 +#ifdef __FAST_MATH__ +__inline_mathop_declNP (log2, "fld1; fxch; fyl2x", "0" (__x) : "st(1)") +#endif /* __FAST_MATH__ */ -__MATH_INLINE float ldexpf (float __x, int __y); __MATH_INLINE float -ldexpf (float __x, int __y) +ldexpf (float __x, int __y) __THROW { __ldexp_code; } -__MATH_INLINE long double ldexpl (long double __x, int __y); __MATH_INLINE long double -ldexpl (long double __x, int __y) +ldexpl (long double __x, int __y) __THROW { __ldexp_code; } -__inline_mathcode3 (fma, __x, __y, __z, return (__x * __y) + __z) +#ifdef __FAST_MATH__ +__inline_mathcodeNP3 (fma, __x, __y, __z, return (__x * __y) + __z) -__inline_mathop(rint, "frndint") +__inline_mathopNP (rint, "frndint") +#endif /* __FAST_MATH__ */ #define __lrint_code \ long int __lrintres; \ @@ -578,17 +605,17 @@ __inline_mathop(rint, "frndint") : "=m" (__lrintres) : "t" (__x) : "st"); \ return __lrintres __MATH_INLINE long int -lrintf (float __x) +lrintf (float __x) __THROW { __lrint_code; } __MATH_INLINE long int -lrint (double __x) +lrint (double __x) __THROW { __lrint_code; } __MATH_INLINE long int -lrintl (long double __x) +lrintl (long double __x) __THROW { __lrint_code; } @@ -601,17 +628,17 @@ lrintl (long double __x) : "=m" (__llrintres) : "t" (__x) : "st"); \ return __llrintres __MATH_INLINE long long int -llrintf (float __x) +llrintf (float __x) __THROW { __llrint_code; } __MATH_INLINE long long int -llrint (double __x) +llrint (double __x) __THROW { __llrint_code; } __MATH_INLINE long long int -llrintl (long double __x) +llrintl (long double __x) __THROW { __llrint_code; } @@ -622,7 +649,7 @@ llrintl (long double __x) #ifdef __USE_MISC -__inline_mathcode2 (drem, __x, __y, \ +__inline_mathcodeNP2 (drem, __x, __y, \ register double __value; \ register int __clobbered; \ __asm __volatile__ \ @@ -635,9 +662,8 @@ __inline_mathcode2 (drem, __x, __y, \ /* This function is used in the `isfinite' macro. */ -__MATH_INLINE int __finite (double __x) __attribute__ ((__const__)); __MATH_INLINE int -__finite (double __x) +__finite (double __x) __THROW { return (__extension__ (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] @@ -645,7 +671,7 @@ __finite (double __x) } /* Miscellaneous functions */ - +#ifdef __FAST_MATH__ __inline_mathcode (__coshm1, __x, \ register long double __exm1 = __expm1l (__fabsl (__x)); \ return 0.5 * (__exm1 / (__exm1 + 1.0)) * __exm1) @@ -653,13 +679,16 @@ __inline_mathcode (__coshm1, __x, \ __inline_mathcode (__acosh1p, __x, \ return log1pl (__x + __sqrtl (__x) * __sqrtl (__x + 2.0))) +#endif /* __FAST_MATH__ */ #endif /* __USE_MISC */ /* Undefine some of the large macros which are not used anymore. */ -#undef __expm1_code -#undef __exp_code #undef __atan2_code -#undef __sincos_code +#ifdef __FAST_MATH__ +# undef __expm1_code +# undef __exp_code +# undef __sincos_code +#endif /* __FAST_MATH__ */ #endif /* __NO_MATH_INLINES */ diff --git a/libc/sysdeps/linux/i386/bits/mman.h b/libc/sysdeps/linux/i386/bits/mman.h index 8738e98c3..0778afbb5 100644 --- a/libc/sysdeps/linux/i386/bits/mman.h +++ b/libc/sysdeps/linux/i386/bits/mman.h @@ -1,21 +1,21 @@ /* Definitions for POSIX memory map interface. Linux/i386 version. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 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_MMAN_H # error "Never use directly; include instead." @@ -73,3 +73,21 @@ #ifdef __USE_GNU # define MREMAP_MAYMOVE 1 #endif + +/* Advice to `madvise'. */ +#ifdef __USE_BSD +# define MADV_NORMAL 0 /* No further special treatment. */ +# define MADV_RANDOM 1 /* Expect random page references. */ +# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define MADV_WILLNEED 3 /* Will need these pages. */ +# define MADV_DONTNEED 4 /* Don't need these pages. */ +#endif + +/* The POSIX people had to invent similar names for the same things. */ +#ifdef __USE_XOPEN2K +# define POSIX_MADV_NORMAL 0 /* No further special treatment. */ +# define POSIX_MADV_RANDOM 1 /* Expect random page references. */ +# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */ +# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */ +# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */ +#endif diff --git a/libc/sysdeps/linux/i386/bits/msq.h b/libc/sysdeps/linux/i386/bits/msq.h index d7a8e5ee0..32a49b592 100644 --- a/libc/sysdeps/linux/i386/bits/msq.h +++ b/libc/sysdeps/linux/i386/bits/msq.h @@ -1,30 +1,36 @@ -/* 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_MSG_H # error "Never use directly; include instead." #endif -#include +#include /* Define options for message queue functions. */ #define MSG_NOERROR 010000 /* no error if message is too big */ -#define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#ifdef __USE_GNU +# define MSG_EXCEPT 020000 /* recv any msg except of specified type */ +#endif + +/* Types used in the structure definition. */ +typedef unsigned long int msgqnum_t; +typedef unsigned long int msglen_t; /* Structure of record for one message inside the kernel. @@ -32,18 +38,19 @@ struct msqid_ds { struct ipc_perm msg_perm; /* structure describing operation permission */ - struct msg *__msg_first; /* pointer to first message on queue */ - struct msg *__msg_last; /* pointer to last message on queue */ __time_t msg_stime; /* time of last msgsnd command */ + unsigned long int __unused1; __time_t msg_rtime; /* time of last msgrcv command */ + unsigned long int __unused2; __time_t msg_ctime; /* time of last change */ - struct wait_queue *__wwait; /* ??? */ - struct wait_queue *__rwait; /* ??? */ - unsigned short int __msg_cbytes;/* current number of bytes on queue */ - unsigned short int msg_qnum; /* number of messages currently on queue */ - unsigned short int msg_qbytes;/* max number of bytes allowed on queue */ - __ipc_pid_t msg_lspid; /* pid of last msgsnd() */ - __ipc_pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused3; + unsigned long int __msg_cbytes; /* current number of bytes on queue */ + msgqnum_t msg_qnum; /* number of messages currently on queue */ + msglen_t msg_qbytes; /* max number of bytes allowed on queue */ + __pid_t msg_lspid; /* pid of last msgsnd() */ + __pid_t msg_lrpid; /* pid of last msgrcv() */ + unsigned long int __unused4; + unsigned long int __unused5; }; #ifdef __USE_MISC diff --git a/libc/sysdeps/linux/i386/bits/nan.h b/libc/sysdeps/linux/i386/bits/nan.h index fbabd7e29..6d88b551b 100644 --- a/libc/sysdeps/linux/i386/bits/nan.h +++ b/libc/sysdeps/linux/i386/bits/nan.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 _MATH_H # error "Never use directly; include instead." diff --git a/libc/sysdeps/linux/i386/bits/netdb.h b/libc/sysdeps/linux/i386/bits/netdb.h new file mode 100644 index 000000000..41dc73193 --- /dev/null +++ b/libc/sysdeps/linux/i386/bits/netdb.h @@ -0,0 +1,33 @@ +/* Copyright (C) 1996, 1997, 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 + 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 + 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 _NETDB_H +# error "Never include directly; use instead." +#endif + + +/* Description of data base entry for a single network. NOTE: here a + poor assumption is made. The network number is expected to fit + into an unsigned long int variable. */ +struct netent +{ + char *n_name; /* Official name of network. */ + char **n_aliases; /* Alias list. */ + int n_addrtype; /* Net address type. */ + uint32_t n_net; /* Network number. */ +}; diff --git a/libc/sysdeps/linux/i386/bits/poll.h b/libc/sysdeps/linux/i386/bits/poll.h index 4aec021fe..dccb8b666 100644 --- a/libc/sysdeps/linux/i386/bits/poll.h +++ b/libc/sysdeps/linux/i386/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 directly; include 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 diff --git a/libc/sysdeps/linux/i386/bits/posix1_lim.h b/libc/sysdeps/linux/i386/bits/posix1_lim.h index ee84b94a7..e16f4674d 100644 --- a/libc/sysdeps/linux/i386/bits/posix1_lim.h +++ b/libc/sysdeps/linux/i386/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 @@ -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 diff --git a/libc/sysdeps/linux/i386/bits/posix2_lim.h b/libc/sysdeps/linux/i386/bits/posix2_lim.h index eaaf67129..24483a09d 100644 --- a/libc/sysdeps/linux/i386/bits/posix2_lim.h +++ b/libc/sysdeps/linux/i386/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 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. */ diff --git a/libc/sysdeps/linux/i386/bits/posix_opt.h b/libc/sysdeps/linux/i386/bits/posix_opt.h index 15683b77e..38203b41d 100644 --- a/libc/sysdeps/linux/i386/bits/posix_opt.h +++ b/libc/sysdeps/linux/i386/bits/posix_opt.h @@ -1,5 +1,5 @@ -/* Define POSIX options for Linux. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Define POSIX options for Linux/ix86. + 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,40 @@ #define _LFS64_LARGEFILE 1 #define _LFS64_STDIO 1 +/* POSIX shared memory objects are implemented. */ +#define _POSIX_SHARED_MEMORY_OBJECTS 1 + +/* CPU-time clocks supported. */ +#define _POSIX_CPUTIME 200912L + +/* We support the clock also in threads. */ +#define _POSIX_THREAD_CPUTIME 200912L + +/* 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 */ diff --git a/libc/sysdeps/linux/i386/bits/pthreadtypes.h b/libc/sysdeps/linux/i386/bits/pthreadtypes.h index db4c3790c..3ee5c4813 100644 --- a/libc/sysdeps/linux/i386/bits/pthreadtypes.h +++ b/libc/sysdeps/linux/i386/bits/pthreadtypes.h @@ -25,8 +25,9 @@ /* Fast locks (not abstract because mutexes and conditions aren't abstract). */ struct _pthread_fastlock { - long int __status; /* "Free" or "taken" or head of waiting list */ - int __spinlock; /* For compare-and-swap emulation */ + long int __status; /* "Free" or "taken" or head of waiting list */ + int __spinlock; /* Used by compare_and_swap emulation. Also, + adaptive SMP lock stores spin count here. */ }; #ifndef _PTHREAD_DESCR_DEFINED @@ -37,7 +38,7 @@ typedef struct _pthread_descr_struct *_pthread_descr; /* Attributes for threads. */ -typedef struct +typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; @@ -115,6 +116,25 @@ typedef struct } pthread_rwlockattr_t; #endif +#ifdef __USE_XOPEN2K +/* POSIX spinlock data type. */ +typedef volatile int pthread_spinlock_t; + +/* POSIX barrier. */ +typedef struct { + struct _pthread_fastlock __ba_lock; /* Lock to guarantee mutual exclusion */ + int __ba_required; /* Threads needed for completion */ + int __ba_present; /* Threads waiting */ + _pthread_descr __ba_waiting; /* Queue of waiting threads */ +} pthread_barrier_t; + +/* barrier attribute */ +typedef struct { + int __pshared; +} pthread_barrierattr_t; + +#endif + /* Thread identifiers */ typedef unsigned long int pthread_t; diff --git a/libc/sysdeps/linux/i386/bits/resource.h b/libc/sysdeps/linux/i386/bits/resource.h index b8a492373..06ecca45a 100644 --- a/libc/sysdeps/linux/i386/bits/resource.h +++ b/libc/sysdeps/linux/i386/bits/resource.h @@ -1,21 +1,21 @@ -/* Bit values & structures for resource limits. Linux version. - Copyright (C) 1994, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Bit values & structures for resource limits. Linux/x86 version. + Copyright (C) 1994,1996,1997,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 - 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 directly; include instead." @@ -76,7 +76,11 @@ enum __rlimit_resource RLIMIT_MEMLOCK = 8, #define RLIMIT_MEMLOCK RLIMIT_MEMLOCK - RLIMIT_NLIMITS = 10, + /* Maximum number of file locks. */ + RLIMIT_LOCKS = 10, +#define RLIMIT_LOCKS RLIMIT_LOCKS + + RLIMIT_NLIMITS = 11, RLIM_NLIMITS = RLIMIT_NLIMITS #define RLIMIT_NLIMITS RLIMIT_NLIMITS #define RLIM_NLIMITS RLIM_NLIMITS @@ -84,13 +88,13 @@ enum __rlimit_resource /* Value to indicate that there is no limit. */ #ifndef __USE_FILE_OFFSET64 -# define RLIM_INFINITY ((long int) (~0UL >> 1)) +# define RLIM_INFINITY ((unsigned long int)(~0UL)) #else -# define RLIM_INFINITY 0x7fffffffffffffffLL +# define RLIM_INFINITY 0xffffffffffffffffuLL #endif #ifdef __USE_LARGEFILE64 -# define RLIM64_INFINITY 0x7fffffffffffffffLL +# define RLIM64_INFINITY 0xffffffffffffffffuLL #endif /* We can represent all limits. */ diff --git a/libc/sysdeps/linux/i386/bits/sched.h b/libc/sysdeps/linux/i386/bits/sched.h index 7e3c40eb4..5c10d85d4 100644 --- a/libc/sysdeps/linux/i386/bits/sched.h +++ b/libc/sysdeps/linux/i386/bits/sched.h @@ -1,22 +1,22 @@ /* Definitions of constants and data structure for POSIX 1003.1b-1993 scheduling interface. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 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 __need_schedparam @@ -46,15 +46,15 @@ /* The official definition. */ struct sched_param { - int sched_priority; + int __sched_priority; }; __BEGIN_DECLS /* Clone current process. */ #ifdef __USE_MISC -extern int clone __P ((int (*__fn) (void *__arg), void *__child_stack, - int __flags, void *__arg)); +extern int clone (int (*__fn) (void *__arg), void *__child_stack, + int __flags, void *__arg) __THROW; #endif __END_DECLS @@ -67,7 +67,7 @@ __END_DECLS /* Data structure to describe a process' schedulability. */ struct __sched_param { - int sched_priority; + int __sched_priority; }; # undef __need_schedparam #endif diff --git a/libc/sysdeps/linux/i386/bits/select.h b/libc/sysdeps/linux/i386/bits/select.h index 6acfc5b9a..972bfb685 100644 --- a/libc/sysdeps/linux/i386/bits/select.h +++ b/libc/sysdeps/linux/i386/bits/select.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 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_SELECT_H # error "Never use directly; include instead." @@ -28,7 +28,7 @@ int __d0, __d1; \ __asm__ __volatile__ ("cld; rep; stosl" \ : "=c" (__d0), "=D" (__d1) \ - : "a" (0), "0" (sizeof (__fd_set) \ + : "a" (0), "0" (sizeof (fd_set) \ / sizeof (__fd_mask)), \ "1" (&__FDS_BITS (fdsp)[0]) \ : "memory"); \ @@ -61,8 +61,8 @@ # define __FD_ZERO(set) \ do { \ unsigned int __i; \ - __fd_set *__arr = (set); \ - for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ + fd_set *__arr = (set); \ + for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \ __FDS_BITS (__arr)[__i] = 0; \ } while (0) # define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d)) diff --git a/libc/sysdeps/linux/i386/bits/sem.h b/libc/sysdeps/linux/i386/bits/sem.h index 3d113a74f..6193501e2 100644 --- a/libc/sysdeps/linux/i386/bits/sem.h +++ b/libc/sysdeps/linux/i386/bits/sem.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 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_SEM_H # error "Never include directly; use instead." @@ -40,15 +40,14 @@ struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ __time_t sem_otime; /* last semop() time */ + unsigned long int __unused1; __time_t sem_ctime; /* last time changed by semctl() */ - struct sem *__sembase; /* ptr to first semaphore in array */ - struct sem_queue *__sem_pending; /* pending operations */ - struct sem_queue *__sem_pending_last; /* last pending operation */ - struct sem_undo *__undo; /* ondo requests on this array */ - unsigned short int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused2; + unsigned long int sem_nsems; /* number of semaphores in set */ + unsigned long int __unused3; + unsigned long int __unused4; }; - /* The user should define a union like the following to use it for arguments for `semctl'. diff --git a/libc/sysdeps/linux/i386/bits/setjmp.h b/libc/sysdeps/linux/i386/bits/setjmp.h index 2f5b44531..e5e493bca 100644 --- a/libc/sysdeps/linux/i386/bits/setjmp.h +++ b/libc/sysdeps/linux/i386/bits/setjmp.h @@ -1,20 +1,20 @@ -/* 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. */ /* Define the machine-dependent type `jmp_buf'. Intel 386 version. */ @@ -29,6 +29,7 @@ # define JB_BP 3 # define JB_SP 4 # define JB_PC 5 +# define JB_SIZE 24 #endif #ifndef _ASM diff --git a/libc/sysdeps/linux/i386/bits/shm.h b/libc/sysdeps/linux/i386/bits/shm.h index c7070595b..18246c3bd 100644 --- a/libc/sysdeps/linux/i386/bits/shm.h +++ b/libc/sysdeps/linux/i386/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 directly; use instead." #endif -#include +#include /* Permission flag for shmget. */ #define SHM_R 0400 /* or S_IRUGO from */ @@ -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 diff --git a/libc/sysdeps/linux/i386/bits/sigaction.h b/libc/sysdeps/linux/i386/bits/sigaction.h index e74eac22d..48cc5312f 100644 --- a/libc/sysdeps/linux/i386/bits/sigaction.h +++ b/libc/sysdeps/linux/i386/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 directly; use 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) __PMT ((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) __PMT ((void)); + void (*sa_restorer) (void); }; /* Bits in `sa_flags'. */ diff --git a/libc/sysdeps/linux/i386/bits/sigcontext.h b/libc/sysdeps/linux/i386/bits/sigcontext.h index 97cbf4b30..67dcf9498 100644 --- a/libc/sysdeps/linux/i386/bits/sigcontext.h +++ b/libc/sysdeps/linux/i386/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 directly; include instead." diff --git a/libc/sysdeps/linux/i386/bits/siginfo.h b/libc/sysdeps/linux/i386/bits/siginfo.h index 66e626199..70a8c217e 100644 --- a/libc/sysdeps/linux/i386/bits/siginfo.h +++ b/libc/sysdeps/linux/i386/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 instead" #endif -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 +#include + +#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) __PMT ((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; diff --git a/libc/sysdeps/linux/i386/bits/signum.h b/libc/sysdeps/linux/i386/bits/signum.h index fb26703d0..74259b492 100644 --- a/libc/sysdeps/linux/i386/bits/signum.h +++ b/libc/sysdeps/linux/i386/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 diff --git a/libc/sysdeps/linux/i386/bits/sigset.h b/libc/sysdeps/linux/i386/bits/sigset.h index de852a8a0..7ccadda45 100644 --- a/libc/sysdeps/linux/i386/bits/sigset.h +++ b/libc/sysdeps/linux/i386/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 @@ -97,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. */ @@ -123,6 +121,5 @@ __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) # undef __SIGSETFN # endif -__END_DECLS #endif /* ! _SIGSET_H_fns. */ diff --git a/libc/sysdeps/linux/i386/bits/sigstack.h b/libc/sysdeps/linux/i386/bits/sigstack.h index 905e87fd9..7f260367b 100644 --- a/libc/sysdeps/linux/i386/bits/sigstack.h +++ b/libc/sysdeps/linux/i386/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 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; diff --git a/libc/sysdeps/linux/i386/bits/sigthread.h b/libc/sysdeps/linux/i386/bits/sigthread.h index a63319c52..b86e75f20 100644 --- a/libc/sysdeps/linux/i386/bits/sigthread.h +++ b/libc/sysdeps/linux/i386/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,7 +17,7 @@ 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 @@ -26,16 +26,13 @@ /* Functions for handling signals. */ -__BEGIN_DECLS - /* 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 */ diff --git a/libc/sysdeps/linux/i386/bits/sockaddr.h b/libc/sysdeps/linux/i386/bits/sockaddr.h index 1cddab4d8..3e1d1312d 100644 --- a/libc/sysdeps/linux/i386/bits/sockaddr.h +++ b/libc/sysdeps/linux/i386/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 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 */ diff --git a/libc/sysdeps/linux/i386/bits/socket.h b/libc/sysdeps/linux/i386/bits/socket.h index dc2d58cfc..6ad4a5ed9 100644 --- a/libc/sysdeps/linux/i386/bits/socket.h +++ b/libc/sysdeps/linux/i386/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 /* 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; diff --git a/libc/sysdeps/linux/i386/bits/stat.h b/libc/sysdeps/linux/i386/bits/stat.h index c175668a0..f446a91db 100644 --- a/libc/sysdeps/linux/i386/bits/stat.h +++ b/libc/sysdeps/linux/i386/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 directly; use 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. */ diff --git a/libc/sysdeps/linux/i386/bits/statfs.h b/libc/sysdeps/linux/i386/bits/statfs.h index 31ae564b4..78c9bdbbc 100644 --- a/libc/sysdeps/linux/i386/bits/statfs.h +++ b/libc/sysdeps/linux/i386/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 directly; use instead." @@ -59,3 +59,6 @@ struct statfs64 int f_spare[6]; }; #endif + +/* Tell code we have this member. */ +#define _STATFS_F_NAMELEN diff --git a/libc/sysdeps/linux/i386/bits/statvfs.h b/libc/sysdeps/linux/i386/bits/statvfs.h index fc6380684..32e03f31e 100644 --- a/libc/sysdeps/linux/i386/bits/statvfs.h +++ b/libc/sysdeps/linux/i386/bits/statvfs.h @@ -1,26 +1,26 @@ -/* 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. */ #ifndef _SYS_STATVFS_H # error "Never include directly; use instead." #endif -#include /* For __fsid_t, __fsblkcnt_t and __fsfilcnt_t. */ +#include /* For __fsblkcnt_t and __fsfilcnt_t. */ struct statvfs { @@ -41,11 +41,13 @@ struct statvfs __fsfilcnt64_t f_ffree; __fsfilcnt64_t f_favail; #endif - __fsid_t f_fsid; + unsigned long int f_fsid; + int __f_unused; unsigned long int f_flag; unsigned long int f_namemax; - int f_spare[6]; + int __f_spare[6]; }; +#define _STATVFSBUF_F_UNUSED #ifdef __USE_LARGEFILE64 struct statvfs64 @@ -58,10 +60,11 @@ struct statvfs64 __fsfilcnt64_t f_files; __fsfilcnt64_t f_ffree; __fsfilcnt64_t f_favail; - __fsid_t f_fsid; + unsigned long int f_fsid; + int __f_unused; unsigned long int f_flag; unsigned long int f_namemax; - int f_spare[6]; + int __f_spare[6]; }; #endif @@ -73,22 +76,24 @@ enum #define ST_RDONLY ST_RDONLY ST_NOSUID = 2, /* Ignore suid and sgid bits. */ #define ST_NOSUID ST_NOSUID +#ifdef __USE_GNU ST_NODEV = 4, /* Disallow access to device special files. */ -#define ST_NODEV ST_NODEV +# define ST_NODEV ST_NODEV ST_NOEXEC = 8, /* Disallow program execution. */ -#define ST_NOEXEC ST_NOEXEC +# define ST_NOEXEC ST_NOEXEC ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ -#define ST_SYNCHRONOUS ST_SYNCHRONOUS +# define ST_SYNCHRONOUS ST_SYNCHRONOUS ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ -#define ST_MANDLOCK ST_MANDLOCK +# define ST_MANDLOCK ST_MANDLOCK ST_WRITE = 128, /* Write on file/directory/symlink. */ -#define ST_WRITE ST_WRITE +# define ST_WRITE ST_WRITE ST_APPEND = 256, /* Append-only file. */ -#define ST_APPEND ST_APPEND +# define ST_APPEND ST_APPEND ST_IMMUTABLE = 512, /* Immutable file. */ -#define ST_IMMUTABLE ST_IMMUTABLE +# define ST_IMMUTABLE ST_IMMUTABLE ST_NOATIME = 1024, /* Do not update access times. */ -#define ST_NOATIME ST_NOATIME +# define ST_NOATIME ST_NOATIME ST_NODIRATIME /* Do not update directory access times. */ -#define ST_NODIRATIME ST_NODIRATIME +# define ST_NODIRATIME ST_NODIRATIME +#endif /* Use GNU. */ }; diff --git a/libc/sysdeps/linux/i386/bits/stdio-lock.h b/libc/sysdeps/linux/i386/bits/stdio-lock.h index edc69f6cf..a1893c8bd 100644 --- a/libc/sysdeps/linux/i386/bits/stdio-lock.h +++ b/libc/sysdeps/linux/i386/bits/stdio-lock.h @@ -1,5 +1,5 @@ /* Thread package specific definitions of stream lock type. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 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 @@ -26,7 +26,18 @@ typedef pthread_mutex_t _IO_lock_t; #define _IO_cleanup_region_start(_fct, _fp) \ - __libc_cleanup_region_start (_fct, _fp) + { struct _pthread_cleanup_buffer _buffer; \ + int _avail = (((_fp)->_flags & _IO_USER_LOCK) == 0 \ + && _pthread_cleanup_push_defer != NULL); \ + if (_avail) { \ + _pthread_cleanup_push_defer (&_buffer, (_fct), (_fp)); \ + } +#define _IO_cleanup_region_start_noarg(_fct) \ + { struct _pthread_cleanup_buffer _buffer; \ + int _avail = _pthread_cleanup_push_defer != NULL; \ + if (_avail) { \ + _pthread_cleanup_push_defer (&_buffer, (_fct), NULL); \ + } #define _IO_cleanup_region_end(_doit) \ __libc_cleanup_region_end (_doit) #define _IO_lock_init(_name) \ diff --git a/libc/sysdeps/linux/i386/bits/stdio.h b/libc/sysdeps/linux/i386/bits/stdio.h index c58643461..118118adc 100644 --- a/libc/sysdeps/linux/i386/bits/stdio.h +++ b/libc/sysdeps/linux/i386/bits/stdio.h @@ -1,20 +1,21 @@ /* Optimizing macros and inline functions for stdio functions. - Copyright (C) 198 Free Software Foundation, Inc. + Copyright (C) 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 _STDIO_H # error "Never include directly; use instead." @@ -30,14 +31,14 @@ #ifdef __USE_EXTERN_INLINES /* Write formatted output to stdout from argument list ARG. */ __STDIO_INLINE int -vprintf (__const char *__restrict __fmt, _G_va_list __arg) +vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW { return vfprintf (stdout, __fmt, __arg); } /* Read a character from stdin. */ __STDIO_INLINE int -getchar (void) +getchar (void) __THROW { return _IO_getc (stdin); } @@ -46,14 +47,14 @@ getchar (void) # if defined __USE_POSIX || defined __USE_MISC /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int -getc_unlocked (FILE *__fp) +getc_unlocked (FILE *__fp) __THROW { return _IO_getc_unlocked (__fp); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int -getchar_unlocked (void) +getchar_unlocked (void) __THROW { return _IO_getc_unlocked (stdin); } @@ -62,7 +63,7 @@ getchar_unlocked (void) /* Write a character to stdout. */ __STDIO_INLINE int -putchar (int __c) +putchar (int __c) __THROW { return _IO_putc (__c, stdout); } @@ -71,7 +72,7 @@ putchar (int __c) # ifdef __USE_MISC /* Faster version when locking is not necessary. */ __STDIO_INLINE int -fputc_unlocked (int __c, FILE *__stream) +fputc_unlocked (int __c, FILE *__stream) __THROW { return _IO_putc_unlocked (__c, __stream); } @@ -81,14 +82,14 @@ fputc_unlocked (int __c, FILE *__stream) # if defined __USE_POSIX || defined __USE_MISC /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int -putc_unlocked (int __c, FILE *__stream) +putc_unlocked (int __c, FILE *__stream) __THROW { return _IO_putc_unlocked (__c, __stream); } /* This is defined in POSIX.1:1996. */ __STDIO_INLINE int -putchar_unlocked (int __c) +putchar_unlocked (int __c) __THROW { return _IO_putc_unlocked (__c, stdout); } @@ -98,7 +99,7 @@ putchar_unlocked (int __c) # ifdef __USE_GNU /* Like `getdelim', but reads up to a newline. */ __STDIO_INLINE _IO_ssize_t -getline (char **__lineptr, size_t *__n, FILE *__stream) +getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW { return __getdelim (__lineptr, __n, '\n', __stream); } @@ -108,14 +109,14 @@ getline (char **__lineptr, size_t *__n, FILE *__stream) # ifdef __USE_MISC /* Faster versions when locking is not required. */ __STDIO_INLINE int -feof_unlocked (FILE *__stream) +feof_unlocked (FILE *__stream) __THROW { return _IO_feof_unlocked (__stream); } /* Faster versions when locking is not required. */ __STDIO_INLINE int -ferror_unlocked (FILE *__stream) +ferror_unlocked (FILE *__stream) __THROW { return _IO_ferror_unlocked (__stream); } diff --git a/libc/sysdeps/linux/i386/bits/stdio_lim.h b/libc/sysdeps/linux/i386/bits/stdio_lim.h index 9787b4358..ea6d693f5 100644 --- a/libc/sysdeps/linux/i386/bits/stdio_lim.h +++ b/libc/sysdeps/linux/i386/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 directly; use 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 diff --git a/libc/sysdeps/linux/i386/bits/string.h b/libc/sysdeps/linux/i386/bits/string.h index 44d6f8ba4..79bd40b97 100644 --- a/libc/sysdeps/linux/i386/bits/string.h +++ b/libc/sysdeps/linux/i386/bits/string.h @@ -1,21 +1,21 @@ /* Optimized, inlined string functions. i386 version. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 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 - 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 _STRING_H # error "Never use directly; include instead." @@ -28,7 +28,7 @@ /* We only provide optimizations if the user selects them and if GNU CC is used. */ #if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \ - && defined __GNUC__ && __GNUC__ >= 2 + && defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__ #ifndef __STRING_INLINE # ifdef __cplusplus @@ -176,6 +176,7 @@ memmove (void *__dest, __const void *__src, size_t __n) /* Set N bytes of S to C. */ #define _HAVE_STRING_ARCH_memset 1 +#define _USE_STRING_ARCH_memset 1 #define memset(s, c, n) \ (__extension__ (__builtin_constant_p (c) \ ? (__builtin_constant_p (n) \ @@ -300,11 +301,37 @@ memchr (__const void *__s, int __c, size_t __n) "movl $1,%0\n" "1:" : "=D" (__res), "=&c" (__d0) - : "a" (__c), "0" (__s), "1" (__n)); + : "a" (__c), "0" (__s), "1" (__n) + : "cc"); return __res - 1; } #endif +#define _HAVE_STRING_ARCH_memrchr 1 +#ifndef _FORCE_INLINES +__STRING_INLINE void * +__memrchr (__const void *__s, int __c, size_t __n) +{ + register unsigned long int __d0; + register void *__res; + if (__n == 0) + return NULL; + __asm__ __volatile__ + ("std\n\t" + "repne; scasb\n\t" + "je 1f\n\t" + "orl $-1,%0\n" + "1:\tcld" + : "=D" (__res), "=&c" (__d0) + : "a" (__c), "0" (__s + __n - 1), "1" (__n) + : "cc"); + return __res + 1; +} +# ifdef __USE_GNU +# define memrchr(s, c, n) __memrchr (s, c, n) +# endif +#endif + /* Return the length of S. */ #define _HAVE_STRING_ARCH_strlen 1 #ifndef _FORCE_INLINES @@ -444,7 +471,7 @@ strcmp (__const char *__s1, __const char *__s2) "jmp 3f\n" "2:\n\t" "sbbl %%eax,%%eax\n\t" - "orb $1,%%eax\n" + "orb $1,%%al\n" "3:" : "=a" (__res), "=&S" (__d0), "=&D" (__d1) : "1" (__s1), "2" (__s2) @@ -487,6 +514,7 @@ strncmp (__const char *__s1, __const char *__s2, size_t __n) /* Find the first occurrence of C in S. */ #define _HAVE_STRING_ARCH_strchr 1 +#define _USE_STRING_ARCH_strchr 1 #define strchr(s, c) \ (__extension__ (__builtin_constant_p (c) \ ? __strchr_c (s, ((c) & 0xff) << 8) \ diff --git a/libc/sysdeps/linux/i386/bits/string2.h b/libc/sysdeps/linux/i386/bits/string2.h index 734f5b0e3..e2e5c0053 100644 --- a/libc/sysdeps/linux/i386/bits/string2.h +++ b/libc/sysdeps/linux/i386/bits/string2.h @@ -1,28 +1,28 @@ /* Machine-independant string function optimizations. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. 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 _STRING_H # error "Never use directly; include instead." #endif -#ifndef __NO_STRING_INLINES +#if !defined __NO_STRING_INLINES && !defined __BOUNDED_POINTERS__ /* Unlike the definitions in the header the definitions contained here are not optimized down to assembler @@ -186,8 +186,7 @@ __STRING2_COPY_TYPE (8); /* GCC optimizes memset(s, 0, n) but not bzero(s, n). The optimization is broken before EGCS 1.1. */ -# if defined __GNUC__ \ - && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 90)) +# if __GNUC_PREREQ (2, 91) # define __bzero(s, n) __builtin_memset (s, '\0', n) # endif @@ -209,8 +208,8 @@ __STRING2_COPY_TYPE (8); # if _STRING_ARCH_unaligned # define __mempcpy_args(src) \ - ((char *) (src))[0], ((char *) (src))[2], ((char *) (src))[4], \ - ((char *) (src))[6], \ + ((__const char *) (src))[0], ((__const char *) (src))[2], \ + ((__const char *) (src))[4], ((__const char *) (src))[6], \ __extension__ __STRING2_SMALL_GET16 (src, 0), \ __extension__ __STRING2_SMALL_GET16 (src, 4), \ __extension__ __STRING2_SMALL_GET32 (src, 0), \ @@ -369,7 +368,7 @@ __mempcpy_small (void *__dest, char __src1, /* Return pointer to C in S. */ #ifndef _HAVE_STRING_ARCH_strchr -extern __ptr_t __rawmemchr (const __ptr_t __s, int __c); +extern void *__rawmemchr (const void *__s, int __c); # define strchr(s, c) \ (__extension__ (__builtin_constant_p (c) && (c) == '\0' \ ? (char *) __rawmemchr (s, c) \ @@ -699,7 +698,7 @@ __stpcpy_small (char *__dest, /* Copy no more than N characters of SRC to DEST. */ #ifndef _HAVE_STRING_ARCH_strncpy -# if defined _HAVE_STRING_ARCH_memset && defined _HAVE_STRING_ARCH_mempcpy +# if defined _USE_STRING_ARCH_memset && defined _USE_STRING_ARCH_mempcpy # define strncpy(dest, src, n) \ (__extension__ ({ char *__dest = (dest); \ __builtin_constant_p (src) && __builtin_constant_p (n) \ @@ -722,13 +721,14 @@ __stpcpy_small (char *__dest, /* Append no more than N characters from SRC onto DEST. */ #ifndef _HAVE_STRING_ARCH_strncat -# ifdef _HAVE_STRING_ARCH_strchr +# ifdef _USE_STRING_ARCH_strchr # define strncat(dest, src, n) \ (__extension__ ({ char *__dest = (dest); \ __builtin_constant_p (src) && __builtin_constant_p (n) \ ? (strlen (src) < ((size_t) (n)) \ ? strcat (__dest, src) \ - : (memcpy (strchr (__dest, '\0'), src, n), __dest)) \ + : (*((char *) __mempcpy (strchr (__dest, '\0'), \ + src, n)) = '\0', __dest)) \ : strncat (dest, src, n); })) # else # define strncat(dest, src, n) \ @@ -915,7 +915,7 @@ __strcspn_c3 (__const char *__s, char __reject1, char __reject2, ({ char __a0, __a1, __a2; \ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \ ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \ - ? 0 \ + ? ((void) (s), 0) \ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \ ? __strspn_c1 (s, __a0) \ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \ @@ -970,7 +970,7 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3) ({ char __a0, __a1, __a2; \ (__builtin_constant_p (accept) && __string2_1bptr_p (accept) \ ? ((__a0 = ((__const char *) (accept))[0], __a0 == '\0') \ - ? NULL \ + ? ((void) (s), NULL) \ : ((__a1 = ((__const char *) (accept))[1], __a1 == '\0') \ ? strchr (s, __a0) \ : ((__a2 = ((__const char *) (accept))[2], __a2 == '\0') \ @@ -980,10 +980,10 @@ __strspn_c3 (__const char *__s, char __accept1, char __accept2, char __accept3) : strpbrk (s, accept))))) \ : strpbrk (s, accept)); }) -__STRING_INLINE char *__strpbrk_c2 (__const char *__s, char __accept1, - char __accept2); +__STRING_INLINE char *__strpbrk_c2 (__const char *__s, int __accept1, + int __accept2); __STRING_INLINE char * -__strpbrk_c2 (__const char *__s, char __accept1, char __accept2) +__strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { /* Please note that __accept1 and __accept2 never can be '\0'. */ while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) @@ -991,11 +991,11 @@ __strpbrk_c2 (__const char *__s, char __accept1, char __accept2) return *__s == '\0' ? NULL : (char *) (size_t) __s; } -__STRING_INLINE char *__strpbrk_c3 (__const char *__s, char __accept1, - char __accept2, char __accept3); +__STRING_INLINE char *__strpbrk_c3 (__const char *__s, int __accept1, + int __accept2, int __accept3); __STRING_INLINE char * -__strpbrk_c3 (__const char *__s, char __accept1, char __accept2, - char __accept3) +__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, + int __accept3) { /* Please note that __accept1 to __accept3 never can be '\0'. */ while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 @@ -1006,8 +1006,9 @@ __strpbrk_c3 (__const char *__s, char __accept1, char __accept2, #endif -/* Find the first occurrence of NEEDLE in HAYSTACK. */ -#ifndef _HAVE_STRING_ARCH_strstr +/* Find the first occurrence of NEEDLE in HAYSTACK. Newer gcc versions + do this itself. */ +#if !defined _HAVE_STRING_ARCH_strstr && !__GNUC_PREREQ (2, 97) # define strstr(haystack, needle) \ (__extension__ (__builtin_constant_p (needle) && __string2_1bptr_p (needle) \ ? (((__const char *) (needle))[0] == '\0' \ @@ -1189,6 +1190,7 @@ __strsep_g (char **__s, __const char *__reject) # ifndef _HAVE_STRING_ARCH_strdup +extern char *__strdup (__const char *__string) __THROW __attribute_malloc__; # define __strdup(s) \ (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) \ ? (((__const char *) (s))[0] == '\0' \ @@ -1205,6 +1207,34 @@ __strsep_g (char **__s, __const char *__reject) # endif # endif +# ifndef _HAVE_STRING_ARCH_strndup + +extern char *__strndup (__const char *__string, size_t __n) + __THROW __attribute_malloc__; +# define __strndup(s, n) \ + (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s) \ + ? (((__const char *) (s))[0] == '\0' \ + ? (char *) calloc (1, 1) \ + : ({ size_t __len = strlen (s) + 1; \ + size_t __n = (n); \ + char *__retval; \ + if (__n < __len) \ + __len = __n; \ + __retval = (char *) malloc (__len); \ + if (__retval != NULL) \ + { \ + __retval[__len - 1] = '\0'; \ + __retval = (char *) memcpy (__retval, s, \ + __len - 1); \ + } \ + __retval; })) \ + : __strndup ((s), (n)))) + +# ifdef __USE_GNU +# define strndup(s, n) __strndup ((s), (n)) +# endif +# endif + #endif /* Use misc. or use GNU. */ #ifndef _FORCE_INLINES diff --git a/libc/sysdeps/linux/i386/bits/stropts.h b/libc/sysdeps/linux/i386/bits/stropts.h index ed807473c..21538c31d 100644 --- a/libc/sysdeps/linux/i386/bits/stropts.h +++ b/libc/sysdeps/linux/i386/bits/stropts.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1998, 1999 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 - 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_STROPTS_H #define _BITS_STROPTS_H 1 @@ -61,7 +61,7 @@ of a STREAMS pipe. */ #define I_RECVFD (__SID |14) /* Non-EFT definition. */ #define I_SWROPT (__SID |19) /* Set the write mode. */ -#define I_GWRSET (__SID |20) /* Return the current write mode setting. */ +#define I_GWROPT (__SID |20) /* Return the current write mode setting. */ #define I_LIST (__SID |21) /* List all the module names on the STREAM, up to and including the topmost driver name. */ #define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent @@ -91,7 +91,9 @@ #define FLUSHR 0x01 /* Flush read queues. */ #define FLUSHW 0x02 /* Flush write queues. */ #define FLUSHRW 0x03 /* Flush read and write queues. */ -#define FLUSHBAND 0x04 /* Flush only specified band. */ +#ifdef __USE_GNU +# define FLUSHBAND 0x04 /* Flush only specified band. */ +#endif /* Possible arguments for `I_SETSIG'. */ #define S_INPUT 0x0001 /* A message, other than a high-priority @@ -129,13 +131,17 @@ #define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message containing a control part is at the front of the STREAM head read queue. */ -#define RPROTMASK 0x001C /* The RPROT bits */ +#ifdef __USE_GNU +# define RPROTMASK 0x001C /* The RPROT bits */ +#endif /* Possible mode for `I_SWROPT'. */ #define SNDZERO 0x001 /* Send a zero-length message downstream when a `write' of 0 bytes occurs. */ -#define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if +#ifdef __USE_GNU +# define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if sd_werror is set. */ +#endif /* Arguments for `I_ATMARK'. */ #define ANYMARK 0x01 /* Check if the message is marked. */ @@ -143,8 +149,10 @@ on the queue. */ /* Argument for `I_UNLINK'. */ -#define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM +#ifdef __USE_GNU +# define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM associated with `fildes'. */ +#endif /* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */ @@ -176,14 +184,14 @@ struct strpeek { struct strbuf ctlbuf; struct strbuf databuf; - __t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ + t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ }; struct strfdinsert { struct strbuf ctlbuf; struct strbuf databuf; - __t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ + t_uscalar_t flags; /* UnixWare/Solaris compatibility. */ int fildes; int offset; }; @@ -199,9 +207,9 @@ struct strioctl struct strrecvfd { int fd; - __uid_t uid; - __gid_t gid; - char fill[8]; /* UnixWare/Solaris compatibility */ + uid_t uid; + gid_t gid; + char __fill[8]; /* UnixWare/Solaris compatibility */ }; diff --git a/libc/sysdeps/linux/i386/bits/termios.h b/libc/sysdeps/linux/i386/bits/termios.h index a5ba1d258..887b309ad 100644 --- a/libc/sysdeps/linux/i386/bits/termios.h +++ b/libc/sysdeps/linux/i386/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 directly; use 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 */ diff --git a/libc/sysdeps/linux/i386/bits/time.h b/libc/sysdeps/linux/i386/bits/time.h index 274d61677..a1b1abc8f 100644 --- a/libc/sysdeps/linux/i386/bits/time.h +++ b/libc/sysdeps/linux/i386/bits/time.h @@ -1,21 +1,21 @@ -/* System-dependent timing definitions. Linux version. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* System-dependent timing definitions. Linux/x86 version. + 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 instead. @@ -31,18 +31,32 @@ /* CAE XSH, Issue 4, Version 2: 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 +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 +/* High-resolution timer from the CPU. */ +# define CLOCK_PROCESS_CPUTIME_ID 2 +/* Thread-specific CPU-time clock. */ +# define CLOCK_THREAD_CPUTIME_ID 3 + +/* 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 +67,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 */ diff --git a/libc/sysdeps/linux/i386/bits/types.h b/libc/sysdeps/linux/i386/bits/types.h index 52174d421..2b0c6ba56 100644 --- a/libc/sysdeps/linux/i386/bits/types.h +++ b/libc/sysdeps/linux/i386/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 instead. @@ -81,36 +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. */ -#ifndef __NFDBITS -#define __NFDBITS (8 * sizeof (__fd_mask)) -#define __FDELT(d) ((d) / __NFDBITS) -#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) -#endif -/* 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; @@ -119,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. */ @@ -134,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; @@ -146,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 _POSIX_THREADS && (defined __USE_POSIX199506 || defined __USE_UNIX98) # include #endif diff --git a/libc/sysdeps/linux/i386/bits/uio.h b/libc/sysdeps/linux/i386/bits/uio.h index 38ac17baa..84b4805fe 100644 --- a/libc/sysdeps/linux/i386/bits/uio.h +++ b/libc/sysdeps/linux/i386/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 directly; use instead." diff --git a/libc/sysdeps/linux/i386/bits/ustat.h b/libc/sysdeps/linux/i386/bits/ustat.h index 526069a7f..aeafc22a5 100644 --- a/libc/sysdeps/linux/i386/bits/ustat.h +++ b/libc/sysdeps/linux/i386/bits/ustat.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. */ #include diff --git a/libc/sysdeps/linux/i386/bits/utmp.h b/libc/sysdeps/linux/i386/bits/utmp.h index d07486e9c..2ed29bbb4 100644 --- a/libc/sysdeps/linux/i386/bits/utmp.h +++ b/libc/sysdeps/linux/i386/bits/utmp.h @@ -1,20 +1,21 @@ /* The `struct utmp' type, describing entries in the utmp file. GNU version. Copyright (C) 1993, 1996, 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. */ #ifndef _UTMP_H # error "Never include directly; use instead." diff --git a/libc/sysdeps/linux/i386/bits/utmpx.h b/libc/sysdeps/linux/i386/bits/utmpx.h index 74befe59e..99735370b 100644 --- a/libc/sysdeps/linux/i386/bits/utmpx.h +++ b/libc/sysdeps/linux/i386/bits/utmpx.h @@ -1,20 +1,21 @@ -/* Structures and defenitions for the user accounting database. GNU version. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Structures and definitions for the user accounting database. GNU version. + 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. */ #ifndef _UTMPX_H # error "Never include directly; use instead." @@ -71,7 +72,9 @@ struct utmpx /* Values for the `ut_type' field of a `struct utmpx'. */ #define EMPTY 0 /* No valid user accounting information. */ -#define RUN_LVL 1 /* The system's runlevel. */ +#ifdef __USE_GNU +# define RUN_LVL 1 /* The system's runlevel. */ +#endif #define BOOT_TIME 2 /* Time of system boot. */ #define NEW_TIME 3 /* Time after system clock changed. */ #define OLD_TIME 4 /* Time when system clock changed. */ diff --git a/libc/sysdeps/linux/i386/bits/utsname.h b/libc/sysdeps/linux/i386/bits/utsname.h index 8f4bf16f5..35e71e3ba 100644 --- a/libc/sysdeps/linux/i386/bits/utsname.h +++ b/libc/sysdeps/linux/i386/bits/utsname.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_UTSNAME_H # error "Never include directly; use instead." diff --git a/libc/sysdeps/linux/i386/bits/waitflags.h b/libc/sysdeps/linux/i386/bits/waitflags.h index afc8b2229..1303c6c36 100644 --- a/libc/sysdeps/linux/i386/bits/waitflags.h +++ b/libc/sysdeps/linux/i386/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 directly; use instead." #endif diff --git a/libc/sysdeps/linux/i386/bits/waitstatus.h b/libc/sysdeps/linux/i386/bits/waitstatus.h index 1ec55107f..982c9dbb2 100644 --- a/libc/sysdeps/linux/i386/bits/waitstatus.h +++ b/libc/sysdeps/linux/i386/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 directly; use instead." #endif diff --git a/libc/sysdeps/linux/i386/bits/wordsize.h b/libc/sysdeps/linux/i386/bits/wordsize.h index 62dad0c71..ba643b60a 100644 --- a/libc/sysdeps/linux/i386/bits/wordsize.h +++ b/libc/sysdeps/linux/i386/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 diff --git a/libc/sysdeps/linux/i386/bits/xopen_lim.h b/libc/sysdeps/linux/i386/bits/xopen_lim.h index 9f22e44e2..7f3611860 100644 --- a/libc/sysdeps/linux/i386/bits/xopen_lim.h +++ b/libc/sysdeps/linux/i386/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 instead. @@ -30,7 +30,7 @@ #ifndef _XOPEN_LIM_H #define _XOPEN_LIM_H 1 -#define __need_FOPEN_MAX +#define __need_IOV_MAX #include /* 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 +# if __WORDSIZE == 64 +# define LONG_BIT 64 +# else +# define LONG_BIT 32 +# endif +#endif + #endif /* bits/xopen_lim.h */ diff --git a/libc/sysdeps/linux/i386/longjmp.c b/libc/sysdeps/linux/i386/longjmp.c index 08fc6f0ff..46e48f569 100644 --- a/libc/sysdeps/linux/i386/longjmp.c +++ b/libc/sysdeps/linux/i386/longjmp.c @@ -18,6 +18,7 @@ #include #include +#define __USE_GNU #include @@ -40,7 +41,7 @@ __uClibc_siglongjmp (sigjmp_buf env, int val) if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ diff --git a/libc/sysdeps/linux/i386/sbrk.c b/libc/sysdeps/linux/i386/sbrk.c index ca987aa8c..39db14945 100644 --- a/libc/sysdeps/linux/i386/sbrk.c +++ b/libc/sysdeps/linux/i386/sbrk.c @@ -8,8 +8,7 @@ extern void * ___brk_addr; extern int __init_brk (void); -void * -sbrk(ptrdiff_t increment) +void *sbrk(intptr_t increment) { if (__init_brk () == 0) { diff --git a/libc/sysdeps/linux/i386/setjmp.S b/libc/sysdeps/linux/i386/setjmp.S index 13c640bfd..729414390 100644 --- a/libc/sysdeps/linux/i386/setjmp.S +++ b/libc/sysdeps/linux/i386/setjmp.S @@ -21,10 +21,10 @@ #define _SETJMP_H #include -.globl __setjmp; -.type __setjmp,@function +.globl _setjmp; +.type _setjmp,@function .align 4; \ -__setjmp: +_setjmp: popl %eax /* Pop return address. */ popl %ecx /* Pop jmp_buf. */ pushl $0 /* Push zero argument. */ diff --git a/libc/sysdeps/linux/i386/vm86.h b/libc/sysdeps/linux/i386/vm86.h new file mode 100644 index 000000000..8faeed7f1 --- /dev/null +++ b/libc/sysdeps/linux/i386/vm86.h @@ -0,0 +1,34 @@ +/* Copyright (C) 1996, 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 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 + 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 _SYS_VM86_H + +#define _SYS_VM86_H 1 +#include + +/* Get constants and data types from kernel header file. */ +#include + +__BEGIN_DECLS + +/* Enter virtual 8086 mode. */ +extern int vm86 (struct vm86_struct *__info) __THROW; + +__END_DECLS + +#endif /* _SYS_VM86_H */ diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c index bb8c84d5c..9637c0fa6 100644 --- a/libc/termios/tcsetattr.c +++ b/libc/termios/tcsetattr.c @@ -25,7 +25,7 @@ /* The difference here is that the termios structure used in the kernel is not the same as we use in the libc. Therefore we must translate it here. */ -#include +#include "kernel_termios.h" /* This is a gross hack around a kernel bug. If the cfsetispeed functions diff --git a/libc/termios/termios.c b/libc/termios/termios.c index e0c3743d0..43b4cb647 100644 --- a/libc/termios/termios.c +++ b/libc/termios/termios.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/libc/unistd/sleep.c b/libc/unistd/sleep.c index e11770563..b6c410fb5 100644 --- a/libc/unistd/sleep.c +++ b/libc/unistd/sleep.c @@ -4,13 +4,13 @@ #include #include -void usleep(unsigned int usec) +int usleep (__useconds_t usec) { struct timeval tv; tv.tv_sec = usec / 1000000; tv.tv_usec = usec % 1000000; - select(0, 0, 0, 0, &tv); + return(select(0, 0, 0, 0, &tv)); } unsigned int sleep(unsigned int sec) diff --git a/libc/unistd/sysconf.c b/libc/unistd/sysconf.c index 702046874..92fa42765 100644 --- a/libc/unistd/sysconf.c +++ b/libc/unistd/sysconf.c @@ -16,6 +16,7 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#define _XOPEN_SOURCE #include #include #include @@ -29,6 +30,9 @@ #include #include +extern int getpagesize (void); +extern int getdtablesize (void); + /***********************************************************************/ /* * Manuel Novoa III Jan 2001 @@ -61,7 +65,7 @@ #endif /* _UCLIBC_GENERATE_SYSCONF_ARCH */ /* Get the value of the system variable NAME. */ -long int sysconf(int name) +long int __sysconf(int name) { switch (name) { @@ -889,6 +893,7 @@ long int sysconf(int name) #endif } } +weak_alias(__sysconf, sysconf); #endif /* _UCLIBC_GENERATE_SYSCONF_MAIN */ /***********************************************************************/ -- cgit v1.2.3