diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-12-08 03:06:47 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-12-08 03:06:47 +0000 |
commit | d71b808a96f0fd1b6cd82c41698b518bf345692b (patch) | |
tree | 7b86cfd6b465c72888d7e85a61c08cafabf5747b /sysdeps | |
parent | 6195235142bd246d972cf1d88b4e208071a3e318 (diff) | |
download | glibc-d71b808a96f0fd1b6cd82c41698b518bf345692b.zip glibc-d71b808a96f0fd1b6cd82c41698b518bf345692b.tar.gz glibc-d71b808a96f0fd1b6cd82c41698b518bf345692b.tar.bz2 |
Update.cvs/libc-ud-971207
1997-12-08 03:24 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig: Define $(rt) to rt if linuxthreads is available.
* Makefile (subdirs): Replace rt by $(rt).
* shlib-versions: Use version .2 for NSS modules.
* grp/fgetgrent_r.c (LINE_PARSER): Call parse_line with extra
argument.
* pwd/fgetpwent_r.c: Likewise.
* spwd/fgetspent_r.c: Likewise.
* spwd/sgetspent_r.c: Likewise.
* hesiod/nss_hesiod/hesiod-grp.c (lookup): Add new argument.
Store error number in *ERRNOP. Little optimization.
* hesiod/nss_hesiod/hesiod-pwd.c: Likewise.
* hesiod/nss_hesiod/hesiod-service.c: Likewise.
* inet/getnetgrent_r.c (__internal_setnetgrent_reuse): Likewise.
(__internal_getnetgrent_r): New argument.
Call __internal_setnetgrent_reuse with new argument.
(__getnetgrent_r): Call __internal_getnetgrent_r with new argument.
* inet/netgroup.h: Add argument to prototypes.
* nis/nisplus-parser.h: Likewise.
* nis/nss_compat/compat-grp.c: Change everything to store error
code through provided pointer and not use errno.
* nis/nss_compat/compat-pwd.c: Likewise.
* nis/nss_compat/compat-spwd.c: Likewise.
* nis/nss_nis/nis-alias.c: Likewise.
* nis/nss_nis/nis-ethers.c: Likewise.
* nis/nss_nis/nis-grp.c: Likewise.
* nis/nss_nis/nis-hosts.c: Likewise.
* nis/nss_nis/nis-netgrp.c: Likewise.
* nis/nss_nis/nis-network.c: Likewise.
* nis/nss_nis/nis-proto.c: Likewise.
* nis/nss_nis/nis-publickey.c: Likewise.
* nis/nss_nis/nis-pwd.c: Likewise.
* nis/nss_nis/nis-rpc.c: Likewise.
* nis/nss_nis/nis-service.c: Likewise.
* nis/nss_nis/nis-spwd.c: Likewise.
* nis/nss_nisplus/nisplus-alias.c: Likewise.
* nis/nss_nisplus/nisplus-ethers.c: Likewise.
* nis/nss_nisplus/nisplus-grp.c: Likewise.
* nis/nss_nisplus/nisplus-hosts.c: Likewise.
* nis/nss_nisplus/nisplus-netgrp.c: Likewise.
* nis/nss_nisplus/nisplus-network.c: Likewise.
* nis/nss_nisplus/nisplus-parser.c: Likewise.
* nis/nss_nisplus/nisplus-proto.c: Likewise.
* nis/nss_nisplus/nisplus-publickey.c: Likewise.
* nis/nss_nisplus/nisplus-pwd.c: Likewise.
* nis/nss_nisplus/nisplus-rpc.c: Likewise.
* nis/nss_nisplus/nisplus-service.c: Likewise.
* nis/nss_nisplus/nisplus-spwd.c: Likewise.
* nss/nss_db/db-XXX.c: Likewise.
* nss/nss_db/db-alias.c: Likewise.
* nss/nss_db/db-netgrp.c: Likewise.
* nss/nss_files/files-XXX.c: Likewise
* nss/nss_files/files-alias.c: Likewise
* nss/nss_files/files-netgrp.c: Likewise
* nss/nss_files/files-parse.c: Likewise
* nss/getXXbyYY_r.c: Call with __errno_location() as value for new
parameter of get functions.
* nss/getXXent_r.c: Likewise.
* localedata/tst-fmon.c: Print debug info if test fails.
* rt/Makefile (routines): Add aio_notify.
* rt/aio.h: Remove non-public definitions. Add aioinit stuff.
* rt/aio_cancel.c: Rewrite to support lio_listio and aio_suspend.
* rt/aio_fsync.c: Likewise.
* rt/aio_misc.c: Likewise.
* rt/aio_misc.h: Likewise.
* rt/aio_read.c: Likewise.
* rt/aio_read64.c: Likewise.
* rt/aio_suspend.c: Likewise.
* rt/aio_write.c: Likewise.
* rt/aio_write64.c: Likewise.
* rt/lio_listio.c: Likewise.
* rt/lio_listio64.c: Likewise.
* rt/aio_notify.c: New file.
* sysdeps/generic/bits/sigset.h: Pretty print.
* sysdeps/posix/pwrite.c: Define weak alias only if function is
really defined as __pwrite.
* sysdeps/unix/sysv/linux/pread.c: Rewrite to use syscall directly
instead of pread64.
* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/Makefile [$(subdir)=signal]
(sysdep_routines): Add rt_sigpending and rt_sigreturn.
* sysdeps/unix/sysv/linux/sigaction.c: Use correct value for sigset_t
size in syscall.
* sysdeps/unix/sysv/linux/sigpending.c: Likewise.
* sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
* sysdeps/unix/sysv/linux/sigreturn.c: Likewise.
* sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
* sysdeps/unix/sysv/linux/sigtimedwait.c: Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c: Likewise.
* sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. Take care
for ACT being NULL.
* sysdeps/unix/sysv/linux/syscalls.list: Don't mention user for
RT signals.
* sysdeps/unix/sysv/linux/i386/s_pread64.s: Return ENOSYS if
__NR_pread is not defined.
* sysdeps/unix/sysv/linux/i386/s_pwrite64.s: Return ENOSYS if
__NR_pwrite is not defined.
1997-12-07 11:15 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* nis/nss_compat/compat-grp.c: If buffer is to small, set the file
handle for /etc/group back in some more cases.
* nis/nss_compat/compat-pwd.c: If buffer is to small, set the file
handle for /etc/passwd back in some more cases.
* nis/nss_compat/compat-spwd.c: If buffer is to small, set the file
handle for /etc/shadow back in some more cases.
1997-12-06 17:00 H.J. Lu <hjl@gnu.org>
* sysdeps/posix/sigblock.c (__sigblock): Don't check int mask
beyound its size.
* sysdeps/posix/sigsetmask.c (__sigsetmask): Ditto.
* sysdeps/posix/sigvec.c (convert_mask, __sigvec): Ditto.
1997-12-06 04:38 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/wordsize-32/inttypes.h: Rewrite {str,wcs}to{i,u}max
handling. Don't use macros, we need functions. Use inline functions
for optimization.
* sysdeps/wordsize-64/inttypes.h: Likewise.
* sysdeps/wordsize-32/Makefile: Add strtoimax, stroumax, wcstoimax,
and wcstoumax.
* sysdeps/wordsize-64/Makefile: Likewise.
* sysdeps/wordsize-32/Dist: Likewise.
* sysdeps/wordsize-64/Dist: Likewise.
* sysdeps/wordsize-32/strtoimax.c: New file.
* sysdeps/wordsize-32/strtoumax.c: New file.
* sysdeps/wordsize-32/wcstoimax.c: New file.
* sysdeps/wordsize-32/wcstoumax.c: New file.
* sysdeps/wordsize-64/strtoimax.c: New file.
* sysdeps/wordsize-64/strtoumax.c: New file.
* sysdeps/wordsize-64/wcstoimax.c: New file.
* sysdeps/wordsize-64/wcstoumax.c: New file.
1997-12-04 10:40 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/wait3.c (__wait3): Use ANSI-style definition so
that transparent union works.
* sysdeps/generic/wait4.c (__wait4): Likewise.
* sysdeps/generic/wait.c (__wait): Likewise.
* sysdeps/generic/getpeername.c (getpeername): Use socklen_t not
size_t.
* sysdeps/generic/syscall.c (syscall): Return value and arg are
long, to match prototype.
* malloc/malloc.c (HAVE_MREMAP): Set to 0 for ARM, as we don't
have mremap() yet.
* sysdeps/generic/usleep.c (usleep): Returns void, to match prototype.
* sysdeps/unix/sysv/linux/arm/syscalls.list: New file.
* sysdeps/generic/bits/time.h: Use __time_t not time_t.
* sysdeps/generic/bits/resource.h: Include <bits/types.h> for
__rlim_t.
* sysdeps/standalone/arm/bits/errno.h (ENOTTY): Added.
* sysdeps/generic/bits/dirent.h (struct dirent64): Added.
* io/sys/stat.h (S_ISLNK): Always false if we don't have
__S_IFLNK.
* sysdeps/standalone/close.c (_STDIO_H): Define before including
<bits/stdio_lim.h>.
* sysdeps/standalone/filedesc.h (_STDIO_H): Likewise.
1997-12-06 01:09 Ulrich Drepper <drepper@cygnus.com>
* posix/sys/wait.h: Don't use transparent unions in C++.
1997-12-05 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* time/time.h: Add strfxtime.
* libc.map: Add tcgetsid, strcasestr, wmemrtombs, wmemrtowcs,
sysv_signal, strfxtime, pread64, pwrite64.
1997-11-30 21:57 Richard Henderson <rth@cygnus.com>
Alpha changes for EGCS:
* config.h.in (ASM_ALPHA_NG_SYMBOL_PREFIX): New entry.
* configure.in (libc_cv_gcc_alpha_ng_prefix): New check.
* sysdeps/alpha/dl-machine.h (_dl_runtime_resolve): Care for prefix.
(_start): Likewise.
* sysdeps/unix/sysv/linux/alpha/init-first.h: Likewise.
Diffstat (limited to 'sysdeps')
47 files changed, 493 insertions, 121 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h index 3f65ae9..bc93087 100644 --- a/sysdeps/alpha/dl-machine.h +++ b/sysdeps/alpha/dl-machine.h @@ -166,7 +166,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) mov $26, $18 addq $17, $17, $17 /* Do the fixup */ - bsr $26, " #fixup_name "..ng + bsr $26, " ASM_ALPHA_NG_SYMBOL_PREFIX #fixup_name "..ng /* Move the destination address into position. */ mov $0, $27 /* Restore program registers. */ @@ -221,7 +221,7 @@ _start: 0: ldgp $gp, 0($gp) /* Pass pointer to argument block to _dl_start. */ mov $sp, $16 - bsr $26, _dl_start..ng + bsr $26, "ASM_ALPHA_NG_SYMBOL_PREFIX"_dl_start..ng .end _start /* FALLTHRU */ .globl _dl_start_user diff --git a/sysdeps/generic/bits/dirent.h b/sysdeps/generic/bits/dirent.h index 366cdf8..d074589 100644 --- a/sysdeps/generic/bits/dirent.h +++ b/sysdeps/generic/bits/dirent.h @@ -26,3 +26,12 @@ struct dirent char d_name[1]; /* Variable length. */ int d_fileno; }; + +#ifdef __USE_LARGEFILE64 +struct dirent64 + { + char d_name[1]; /* Variable length. */ + int d_fileno; + }; +#endif + diff --git a/sysdeps/generic/bits/resource.h b/sysdeps/generic/bits/resource.h index d0ebeb5..e72836d 100644 --- a/sysdeps/generic/bits/resource.h +++ b/sysdeps/generic/bits/resource.h @@ -21,6 +21,8 @@ # error "Never use <bits/resource.h> directly; include <sys/resource.h> instead." #endif +#include <bits/types.h> + /* These are the values for 4.4 BSD and GNU. Earlier BSD systems have a subset of these kinds of resource limit. In systems where `getrlimit' and `setrlimit' are not system calls, these are the values used by the C diff --git a/sysdeps/generic/bits/sigset.h b/sysdeps/generic/bits/sigset.h index 9fad453..c442d53 100644 --- a/sysdeps/generic/bits/sigset.h +++ b/sysdeps/generic/bits/sigset.h @@ -34,7 +34,7 @@ typedef unsigned long int __sigset_t; trouble can be caused by functions being defined (e.g., any global register vars declared later will cause compilation errors). */ -#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H) +#if !defined _SIGSET_H_fns && defined _SIGNAL_H #define _SIGSET_H_fns 1 #ifndef _EXTERN_INLINE diff --git a/sysdeps/generic/bits/time.h b/sysdeps/generic/bits/time.h index cdbd39f..f608e2c 100644 --- a/sysdeps/generic/bits/time.h +++ b/sysdeps/generic/bits/time.h @@ -39,8 +39,8 @@ microsecond but also has a range of years. */ struct timeval { - time_t tv_sec; /* Seconds. */ - time_t tv_usec; /* Microseconds. */ + __time_t tv_sec; /* Seconds. */ + __time_t tv_usec; /* Microseconds. */ }; # endif /* struct timeval */ #endif /* need timeval */ diff --git a/sysdeps/generic/getpeername.c b/sysdeps/generic/getpeername.c index bd38cb4..59e6b01 100644 --- a/sysdeps/generic/getpeername.c +++ b/sysdeps/generic/getpeername.c @@ -25,7 +25,7 @@ int getpeername (fd, addr, len) int fd; __SOCKADDR_ARG addr; - size_t *len; + socklen_t *len; { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/generic/syscall.c b/sysdeps/generic/syscall.c index 8c20b7e..6caf258 100644 --- a/sysdeps/generic/syscall.c +++ b/sysdeps/generic/syscall.c @@ -23,9 +23,9 @@ /* Do system call CALLNO, passing it the remaining arguments. This only makes sense in certain operating systems. */ -int +long int syscall (callno) - int callno; + long int callno; { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/generic/usleep.c b/sysdeps/generic/usleep.c index 8c0e851..9a8dada 100644 --- a/sysdeps/generic/usleep.c +++ b/sysdeps/generic/usleep.c @@ -16,16 +16,13 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <errno.h> #include <unistd.h> /* Sleep USECONDS microseconds, or until a previously set timer goes off. */ -unsigned int +void usleep (useconds) unsigned int useconds; { - __set_errno (ENOSYS); - return -1; } stub_warning (usleep) diff --git a/sysdeps/generic/wait.c b/sysdeps/generic/wait.c index 6f1db03..026447e 100644 --- a/sysdeps/generic/wait.c +++ b/sysdeps/generic/wait.c @@ -22,8 +22,7 @@ /* Wait for a child to die. When one does, put its status in *STAT_LOC and return its process ID. For errors, return (pid_t) -1. */ __pid_t -__wait (stat_loc) - __WAIT_STATUS_DEFN stat_loc; +__wait (__WAIT_STATUS_DEFN stat_loc) { __set_errno (ENOSYS); return -1; diff --git a/sysdeps/generic/wait3.c b/sysdeps/generic/wait3.c index 4df9d42..b15f024 100644 --- a/sysdeps/generic/wait3.c +++ b/sysdeps/generic/wait3.c @@ -26,10 +26,7 @@ there. If the WUNTRACED bit is set in OPTIONS, return status for stopped children; otherwise don't. */ pid_t -__wait3 (stat_loc, options, usage) - __WAIT_STATUS_DEFN stat_loc; - int options; - struct rusage *usage; +__wait3 (__WAIT_STATUS_DEFN stat_loc, int options, struct rusage *usage) { if ((options & ~(WNOHANG|WUNTRACED)) != 0) { diff --git a/sysdeps/generic/wait4.c b/sysdeps/generic/wait4.c index d29d80c..b2a9169 100644 --- a/sysdeps/generic/wait4.c +++ b/sysdeps/generic/wait4.c @@ -21,11 +21,8 @@ #include <errno.h> pid_t -__wait4 (pid, stat_loc, options, usage) - pid_t pid; - __WAIT_STATUS_DEFN stat_loc; - int options; - struct rusage *usage; +__wait4 (__pid_t pid, __WAIT_STATUS stat_loc, int options, + struct rusage *usage) { __set_errno (ENOSYS); return (pid_t) -1; diff --git a/sysdeps/posix/pwrite.c b/sysdeps/posix/pwrite.c index 65806a2..ef4a021 100644 --- a/sysdeps/posix/pwrite.c +++ b/sysdeps/posix/pwrite.c @@ -54,4 +54,7 @@ __pwrite (int fd, const void *buf, size_t nbyte, off_t offset) return result; } + +#ifndef __pwrite weak_alias (__pwrite, pwrite) +#endif diff --git a/sysdeps/posix/sigblock.c b/sysdeps/posix/sigblock.c index 777710b..efc559d 100644 --- a/sysdeps/posix/sigblock.c +++ b/sysdeps/posix/sigblock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1995, 1996, 1997 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 @@ -35,7 +35,7 @@ __sigblock (mask) else if (sizeof (unsigned long int) == sizeof (set)) *(unsigned long int *) &set = (unsigned int) mask; else - for (sig = 1; sig < NSIG; ++sig) + for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig) if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0) return -1; @@ -47,7 +47,7 @@ __sigblock (mask) else if (sizeof (unsigned long int) == sizeof (oset)) mask = *(unsigned long int*) &oset; else - for (sig = 1, mask = 0; sig < NSIG; ++sig) + for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof (mask) * 8; ++sig) if (__sigismember (&oset, sig)) mask |= sigmask (sig); diff --git a/sysdeps/posix/sigsetmask.c b/sysdeps/posix/sigsetmask.c index 0347198..fbbdafa 100644 --- a/sysdeps/posix/sigsetmask.c +++ b/sysdeps/posix/sigsetmask.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1995, 1996, 1997 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 @@ -34,7 +34,7 @@ __sigsetmask (int mask) else if (sizeof (unsigned long int) == sizeof (set)) *(unsigned long int *) &set = (unsigned int) mask; else - for (sig = 1; sig < NSIG; ++sig) + for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig) if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0) return -1; @@ -46,7 +46,7 @@ __sigsetmask (int mask) else if (sizeof (unsigned long int) == sizeof (oset)) mask = *(unsigned long int *) &oset; else - for (sig = 1, mask = 0; sig < NSIG; ++sig) + for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof (mask) * 8; ++sig) if (__sigismember (&oset, sig)) mask |= sigmask (sig); diff --git a/sysdeps/posix/sigvec.c b/sysdeps/posix/sigvec.c index 59d30f2..12285fa 100644 --- a/sysdeps/posix/sigvec.c +++ b/sysdeps/posix/sigvec.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 94, 95, 96, 97 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 @@ -62,7 +62,7 @@ convert_mask (set, mask) if (__sigemptyset (set) < 0) return -1; - for (sig = 1; sig < NSIG; ++sig) + for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig) if ((mask & sigmask (sig)) && __sigaddset (set, sig) < 0) return -1; } @@ -138,9 +138,9 @@ __sigvec (sig, vec, ovec) else if (sizeof (unsigned long int) == sizeof (sigset_t)) mask = *(unsigned long int *) &old.sa_mask; else - for (i = 1; i < NSIG; ++i) - if (__sigismember(&old.sa_mask, i)) - mask |= sigmask(i); + for (i = 1; i < NSIG && i <= sizeof (mask) * 8; ++i) + if (__sigismember (&old.sa_mask, i)) + mask |= sigmask (i); ovec->sv_mask = mask; ovec->sv_flags = 0; diff --git a/sysdeps/standalone/arm/bits/errno.h b/sysdeps/standalone/arm/bits/errno.h index f5020dc..97dbbd9 100644 --- a/sysdeps/standalone/arm/bits/errno.h +++ b/sysdeps/standalone/arm/bits/errno.h @@ -51,6 +51,7 @@ # define ESTALE 23 # define EISDIR 24 # define EOPNOTSUPP 25 /* Operation not supported. */ +# define ENOTTY 26 #endif #define __set_errno(val) errno = (val) diff --git a/sysdeps/standalone/close.c b/sysdeps/standalone/close.c index 2e33b3c..114d726 100644 --- a/sysdeps/standalone/close.c +++ b/sysdeps/standalone/close.c @@ -21,6 +21,7 @@ #include <errno.h> #include <unistd.h> +#define _STDIO_H #include <bits/stdio_lim.h> #include "filedesc.h" diff --git a/sysdeps/standalone/filedesc.h b/sysdeps/standalone/filedesc.h index a35d1cf..d6a12a6 100644 --- a/sysdeps/standalone/filedesc.h +++ b/sysdeps/standalone/filedesc.h @@ -26,6 +26,7 @@ #ifndef __FILEDESC_h #define __FILEDESC_h +#define _STDIO_H #include <bits/stdio_lim.h> #ifndef __DECLARE_FILE_DESCRIPTORS__ diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index ffea9ef..6903e0b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -111,7 +111,8 @@ endif ifeq ($(subdir),signal) sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \ - rt_sigqueueinfo rt_sigaction + rt_sigqueueinfo rt_sigaction rt_sigpending \ + rt_sigreturn endif common-generated += bits/stdio_lim.h bits/stdio_lim.d diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list new file mode 100644 index 0000000..392a257 --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -0,0 +1,6 @@ +# File name Caller Syscall name # args Strong name Weak names + +s_getgroups getgroups getgroups 2 __syscall_getgroups +s_llseek llseek _llseek 5 __sys_llseek +s_setgroups setgroups setgroups 2 __syscall_setgroups +vm86 - vm86 1 __vm86 vm86 diff --git a/sysdeps/unix/sysv/linux/i386/s_pread64.S b/sysdeps/unix/sysv/linux/i386/s_pread64.S index 22ce79b..9e14aa8 100644 --- a/sysdeps/unix/sysv/linux/i386/s_pread64.S +++ b/sysdeps/unix/sysv/linux/i386/s_pread64.S @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include <sysdep.h> +#include <asm/errno.h> /* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for more information about the value -4095 used below.*/ @@ -25,6 +26,13 @@ .text ENTRY (__syscall_pread64) +#ifndef __NR_pread + movl $-ENOSYS,%eax +# ifndef PIC + jmp syscall_error +# endif +#else + PUSHARGS_5 /* Save register contents. */ /* Load arguments. This is unfortunately a little bit of a problem @@ -41,5 +49,6 @@ ENTRY (__syscall_pread64) cmpl $-4095, %eax /* Check %eax for error. */ jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ +#endif PSEUDO_END (__syscall_pread64) diff --git a/sysdeps/unix/sysv/linux/i386/s_pwrite64.S b/sysdeps/unix/sysv/linux/i386/s_pwrite64.S index 6a1987b..a21fe2f 100644 --- a/sysdeps/unix/sysv/linux/i386/s_pwrite64.S +++ b/sysdeps/unix/sysv/linux/i386/s_pwrite64.S @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include <sysdep.h> +#include <asm/errno.h> /* Please consult the file sysdeps/unix/sysv/linux/i386/sysdep.h for more information about the value -4095 used below.*/ @@ -25,6 +26,13 @@ .text ENTRY (__syscall_pwrite64) +#ifndef __NR_pwrite + movl $-ENOSYS,%eax +# ifndef PIC + jmp syscall_error +# endif +#else + PUSHARGS_5 /* Save register contents. */ /* Load arguments. This is unfortunately a little bit of a problem @@ -41,5 +49,6 @@ ENTRY (__syscall_pwrite64) cmpl $-4095, %eax /* Check %eax for error. */ jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ +#endif PSEUDO_END (__syscall_pwrite64) diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c index 90d61a0..05d187c 100644 --- a/sysdeps/unix/sysv/linux/i386/sigaction.c +++ b/sysdeps/unix/sysv/linux/i386/sigaction.c @@ -47,19 +47,24 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact) /* First try the RT signals. */ if (__libc_have_rt_sigs) { - struct sigaction nact; + struct sigaction nact, *nactp; - nact.sa_handler = act->sa_handler; - memcpy (&nact.sa_mask, &act->sa_mask, sizeof (sigset_t)); - nact.sa_flags = act->sa_flags; + if (act) + { + nact.sa_handler = act->sa_handler; + memcpy (&nact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + nact.sa_flags = act->sa_flags; - nact.sa_restorer = ((act->sa_flags & SA_NOMASK) - ? &&restore_nomask : &&restore); + nact.sa_restorer = ((act->sa_flags & SA_NOMASK) + ? &&restore_nomask : &&restore); + nactp = &nact; + } + else + nactp = NULL; /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - result = __syscall_rt_sigaction (sig, &nact, oact, - _NSIG / (8 * sizeof (long int))); + result = __syscall_rt_sigaction (sig, nactp, oact, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c index eeb26eb..eb0d301 100644 --- a/sysdeps/unix/sysv/linux/pread.c +++ b/sysdeps/unix/sysv/linux/pread.c @@ -17,12 +17,36 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <errno.h> #include <unistd.h> +extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count, + off_t offset_hi, off_t offset_lo); + +static ssize_t __emulate_pread (int fd, void *buf, size_t count, + off_t offset) internal_function; + + ssize_t -__pread (int fd, void *buf, size_t nbytes, off_t offset) +__pread (fd, buf, count, offset) + int fd; + void *buf; + size_t count; + off_t offset; { - return __pread64 (fd, buf, nbytes, (off64_t) offset); + ssize_t result; + + /* First try the syscall. */ + result = __syscall_pread64 (fd, buf, count, 0, offset); + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread (fd, buf, count, offset); + + return result; } weak_alias (__pread, pread) + +#define __pread(fd, buf, count, offset) \ + static internal_function __emulate_pread (fd, buf, count, offset) +#include <sysdeps/posix/pread.c> diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c index d8695db..9ab3259 100644 --- a/sysdeps/unix/sysv/linux/pwrite.c +++ b/sysdeps/unix/sysv/linux/pwrite.c @@ -17,12 +17,36 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <errno.h> #include <unistd.h> +extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_t count, + off_t offset_hi, off_t offset_lo); + +static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count, + off_t offset) internal_function; + + ssize_t -__pwrite (int fd, const void *buf, size_t nbytes, off_t offset) +__pwrite (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off_t offset; { - return __pwrite64 (fd, buf, nbytes, (off64_t) offset); + ssize_t result; + + /* First try the syscall. */ + result = __syscall_pwrite64 (fd, buf, count, 0, offset); + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite (fd, buf, count, offset); + + return result; } weak_alias (__pwrite, pwrite) + +#define __pwrite(fd, buf, count, offset) \ + static internal_function __emulate_pwrite (fd, buf, count, offset) +#include <sysdeps/posix/pwrite.c> diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c index 161f1b0..1412c38 100644 --- a/sysdeps/unix/sysv/linux/sigaction.c +++ b/sysdeps/unix/sysv/linux/sigaction.c @@ -49,8 +49,7 @@ __sigaction (sig, act, oact) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - int result = __syscall_rt_sigaction (sig, act, oact, - _NSIG / (8 * sizeof (long int))); + int result = __syscall_rt_sigaction (sig, act, oact, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c index 7b26bfb..4cecb8d 100644 --- a/sysdeps/unix/sysv/linux/sigpending.c +++ b/sysdeps/unix/sysv/linux/sigpending.c @@ -40,8 +40,7 @@ sigpending (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - int result = __syscall_rt_sigpending (set, - _NSIG / (8 * sizeof (long int))); + int result = __syscall_rt_sigpending (set, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c index f436ba8..dc262c8 100644 --- a/sysdeps/unix/sysv/linux/sigprocmask.c +++ b/sysdeps/unix/sysv/linux/sigprocmask.c @@ -41,8 +41,7 @@ __sigprocmask (how, set, oset) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - int result = __syscall_rt_sigprocmask (how, set, oset, - _NSIG / (8 * sizeof (long int))); + int result = __syscall_rt_sigprocmask (how, set, oset, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/sigreturn.c b/sysdeps/unix/sysv/linux/sigreturn.c index ecef3d6..540dfdf 100644 --- a/sysdeps/unix/sysv/linux/sigreturn.c +++ b/sysdeps/unix/sysv/linux/sigreturn.c @@ -38,8 +38,7 @@ __sigreturn (scp) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - int result = __syscall_rt_sigreturn (scp, - _NSIG / (8 * sizeof (long int))); + int result = __syscall_rt_sigreturn (scp, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c index faea1c3..2cf34eb 100644 --- a/sysdeps/unix/sysv/linux/sigsuspend.c +++ b/sysdeps/unix/sysv/linux/sigsuspend.c @@ -21,7 +21,7 @@ #include <unistd.h> extern int __syscall_sigsuspend (int, unsigned long int, unsigned long int); -extern int __syscall_rt_sigsuspend (sigset_t *, size_t); +extern int __syscall_rt_sigsuspend (const sigset_t *, size_t); /* The variable is shared between all wrappers around signal handling @@ -40,8 +40,7 @@ __sigsuspend (set) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - int result = __syscall_rt_sigsuspend (set, - _NSIG / (8 * sizeof (long int))); + int result = __syscall_rt_sigsuspend (set, _NSIG / 8); if (result >= 0 || errno != ENOSYS) return result; diff --git a/sysdeps/unix/sysv/linux/sigtimedwait.c b/sysdeps/unix/sysv/linux/sigtimedwait.c index b022ec3..90854c6 100644 --- a/sysdeps/unix/sysv/linux/sigtimedwait.c +++ b/sysdeps/unix/sysv/linux/sigtimedwait.c @@ -31,7 +31,6 @@ __sigtimedwait (set, info, timeout) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return __syscall_rt_sigtimedwait (set, info, timeout, - _NSIG / (8 * sizeof (long int))); + return __syscall_rt_sigtimedwait (set, info, timeout, _NSIG / 8); } weak_alias (__sigtimedwait, sigtimedwait) diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c index ac98fb4..5f41ba0 100644 --- a/sysdeps/unix/sysv/linux/sigwaitinfo.c +++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c @@ -30,7 +30,6 @@ __sigwaitinfo (set, info) { /* XXX The size argument hopefully will have to be changed to the real size of the user-level sigset_t. */ - return __syscall_rt_sigtimedwait (set, info, NULL, - _NSIG / (8 * sizeof (long int))); + return __syscall_rt_sigtimedwait (set, info, NULL, _NSIG / 8); } weak_alias (__sigwaitinfo, sigwaitinfo) diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 08dceca..ed760af 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -35,13 +35,13 @@ pipe - pipe 1 __pipe pipe prctl EXTRA prctl 5 prctl query_module EXTRA query_module 5 query_module quotactl EXTRA quotactl 4 quotactl -rt_sigaction sigaction rt_sigaction 4 __syscall_rt_sigaction -rt_sigpending sigpendding rt_sigpending 2 __syscall_rt_sigpending -rt_sigprocmask sigprocmask rt_sigprocmask 4 __syscall_rt_sigprocmask -rt_sigqueueinfo sigqueue rt_sigqueueinfo 3 __syscall_rt_sigqueueinfo -rt_sigreturn sigreturn rt_sigreturn 1 __syscall_rt_sigreturn -rt_sigsuspend sigsuspend rt_sigsuspend 2 __syscall_rt_sigsuspend -rt_sigtimedwait sigtimedwait rt_sigtimedwait 4 __syscall_rt_sigtimedwait +rt_sigaction - rt_sigaction 4 __syscall_rt_sigaction +rt_sigpending - rt_sigpending 2 __syscall_rt_sigpending +rt_sigprocmask - rt_sigprocmask 4 __syscall_rt_sigprocmask +rt_sigqueueinfo - rt_sigqueueinfo 3 __syscall_rt_sigqueueinfo +rt_sigreturn - rt_sigreturn 1 __syscall_rt_sigreturn +rt_sigsuspend - rt_sigsuspend 2 __syscall_rt_sigsuspend +rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait s_getdents EXTRA getdents 3 __getdents s_getpriority getpriority getpriority 2 __syscall_getpriority s_poll poll poll 3 __syscall_poll diff --git a/sysdeps/wordsize-32/Dist b/sysdeps/wordsize-32/Dist index 5661d79..36bfb62 100644 --- a/sysdeps/wordsize-32/Dist +++ b/sysdeps/wordsize-32/Dist @@ -1 +1,5 @@ inttypes.h +strtoimax.c +strtoumax.c +wcstoimax.c +wcstoumax.c diff --git a/sysdeps/wordsize-32/Makefile b/sysdeps/wordsize-32/Makefile index 87ced71..b22eaee 100644 --- a/sysdeps/wordsize-32/Makefile +++ b/sysdeps/wordsize-32/Makefile @@ -1,3 +1,5 @@ ifeq ($(subdir),stdlib) sysdep_headers += inttypes.h + +sysdep_routines += strtoimax strtoumax wcstoimax wcstoumax endif diff --git a/sysdeps/wordsize-32/inttypes.h b/sysdeps/wordsize-32/inttypes.h index 371b40b..f569be5 100644 --- a/sysdeps/wordsize-32/inttypes.h +++ b/sysdeps/wordsize-32/inttypes.h @@ -373,57 +373,84 @@ typedef unsigned long long int uint_fast64_t; /* Macros for string conversion. */ /* Like `strtol' but convert to `intmax_t'. */ -#define strtoimax(nptr, endptr, base) \ - __strtoll_internal (nptr, endptr, base, 0) +extern intmax_t strtoimax __P ((__const char *__restrict __nptr, + char **__restrict __endptr, int __base)); -#ifndef __strtoll_internal_defined +/* Like `strtoul' but convert to `uintmax_t'. */ +extern uintmax_t strtoumax __P ((__const char * __restrict __nptr, + char ** __restrict __endptr, int __base)); + +/* Like `wcstol' but convert to `intmax_t'. */ +extern intmax_t wcstoimax __P ((__const wchar_t * __restrict __nptr, + wchar_t **__restrict __endptr, int __base)); + +/* Like `wcstoul' but convert to `uintmax_t'. */ +extern uintmax_t wcstoumax __P ((__const wchar_t * __restrict __nptr, + wchar_t ** __restrict __endptr, int __base)); + +#if defined __GNUC__ && __GNUC__ >= 2 && defined __OPTIMIZE__ + +/* Like `strtol' but convert to `intmax_t'. */ +# ifndef __strtoll_internal_defined extern long long int __strtoll_internal __P ((__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group)); -# define __strtoll_internal_defined 1 -#endif - +# define __strtoll_internal_defined 1 +# endif +extern __inline intmax_t +strtoimax (__const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoll_internal (nptr, endptr, base, 0); +} /* Like `strtoul' but convert to `uintmax_t'. */ -#define strtoumax(nptr, endptr, base) \ - __strtoull_internal (nptr, endptr, base, 0) - -#ifndef __strtoull_internal_defined +# ifndef __strtoull_internal_defined extern unsigned long long int __strtoull_internal __P ((__const char * __restrict __nptr, char ** __restrict __endptr, int __base, int __group)); -# define __strtoull_internal_defined 1 -#endif - +# define __strtoull_internal_defined 1 +# endif +extern __inline uintmax_t +strtoumax (__const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoull_internal (nptr, endptr, base, 0); +} /* Like `wcstol' but convert to `intmax_t'. */ -#define wcstoimax(nptr, endptr, base) \ - __wcstoll_internal (nptr, endptr, base, 0) - -#ifndef __wcstoll_internal_defined +# ifndef __wcstoll_internal_defined extern long long int __wcstoll_internal __P ((__const wchar_t * __restrict __nptr, wchar_t **__restrict __endptr, int __base, int __group)); -# define __wcstoll_internal_defined 1 -#endif +# define __wcstoll_internal_defined 1 +# endif +extern __inline intmax_t +wcstoimax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoll_internal (nptr, endptr, base, 0); +} /* Like `wcstoul' but convert to `uintmax_t'. */ -#define wcstoumax(nptr, endptr, base) \ - __wcstoull_internal (nptr, endptr, base, 0) - -#ifndef __wcstoull_internal_defined +# ifndef __wcstoull_internal_defined extern unsigned long long int __wcstoull_internal __P ((__const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, int __group)); -# define __wcstoull_internal_defined 1 -#endif +# define __wcstoull_internal_defined 1 +# endif +extern __inline uintmax_t +wcstoumax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoull_internal (nptr, endptr, base, 0); +} +#endif /* GCC and Optimization. */ #endif /* inttypes.h */ diff --git a/sysdeps/wordsize-32/strtoimax.c b/sysdeps/wordsize-32/strtoimax.c new file mode 100644 index 0000000..a57bc3a --- /dev/null +++ b/sysdeps/wordsize-32/strtoimax.c @@ -0,0 +1,28 @@ +/* Convert string to maximal integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <stdlib.h> + +intmax_t +strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoll_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-32/strtoumax.c b/sysdeps/wordsize-32/strtoumax.c new file mode 100644 index 0000000..6b05ad9 --- /dev/null +++ b/sysdeps/wordsize-32/strtoumax.c @@ -0,0 +1,28 @@ +/* Convert string to maximal unsigned integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <stdlib.h> + +uintmax_t +strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoull_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-32/wcstoimax.c b/sysdeps/wordsize-32/wcstoimax.c new file mode 100644 index 0000000..63e78d1 --- /dev/null +++ b/sysdeps/wordsize-32/wcstoimax.c @@ -0,0 +1,29 @@ +/* Convert wide-character string to maximal integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <wchar.h> + +intmax_t +wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoll_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-32/wcstoumax.c b/sysdeps/wordsize-32/wcstoumax.c new file mode 100644 index 0000000..b6f29f4 --- /dev/null +++ b/sysdeps/wordsize-32/wcstoumax.c @@ -0,0 +1,29 @@ +/* Convert wide-character string to maximal unsigned integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <wchar.h> + +uintmax_t +wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoull_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-64/Dist b/sysdeps/wordsize-64/Dist index 5661d79..36bfb62 100644 --- a/sysdeps/wordsize-64/Dist +++ b/sysdeps/wordsize-64/Dist @@ -1 +1,5 @@ inttypes.h +strtoimax.c +strtoumax.c +wcstoimax.c +wcstoumax.c diff --git a/sysdeps/wordsize-64/Makefile b/sysdeps/wordsize-64/Makefile index 87ced71..b22eaee 100644 --- a/sysdeps/wordsize-64/Makefile +++ b/sysdeps/wordsize-64/Makefile @@ -1,3 +1,5 @@ ifeq ($(subdir),stdlib) sysdep_headers += inttypes.h + +sysdep_routines += strtoimax strtoumax wcstoimax wcstoumax endif diff --git a/sysdeps/wordsize-64/inttypes.h b/sysdeps/wordsize-64/inttypes.h index 5f11fc9..c62d516 100644 --- a/sysdeps/wordsize-64/inttypes.h +++ b/sysdeps/wordsize-64/inttypes.h @@ -373,53 +373,80 @@ typedef unsigned long int uint_fast64_t; /* Macros for string conversion. */ /* Like `strtol' but convert to `intmax_t'. */ -#define strtoimax(nptr, endptr, base) \ - __strtol_internal (nptr, endptr, base, 0) +extern intmax_t strtoimax __P ((__const char *__restrict __nptr, + char **__restrict __endptr, int __base)); -#ifndef __strtol_internal_defined +/* Like `strtoul' but convert to `uintmax_t'. */ +extern uintmax_t strtoumax __P ((__const char * __restrict __nptr, + char ** __restrict __endptr, int __base)); + +/* Like `wcstol' but convert to `intmax_t'. */ +extern intmax_t wcstoimax __P ((__const wchar_t * __restrict __nptr, + wchar_t **__restrict __endptr, int __base)); + +/* Like `wcstoul' but convert to `uintmax_t'. */ +extern uintmax_t wcstoumax __P ((__const wchar_t * __restrict __nptr, + wchar_t ** __restrict __endptr, int __base)); + +#if defined __GNUC__ && __GNUC__ >= 2 && defined __OPTIMIZE__ + +/* Like `strtol' but convert to `intmax_t'. */ +# ifndef __strtol_internal_defined extern long int __strtol_internal __P ((__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group)); -# define __strtol_internal_defined 1 -#endif - +# define __strtol_internal_defined 1 +# endif +extern __inline intmax_t +strtoimax (__const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtol_internal (nptr, endptr, base, 0); +} /* Like `strtoul' but convert to `uintmax_t'. */ -#define strtoumax(nptr, endptr, base) \ - __strtoul_internal (nptr, endptr, base, 0) - -#ifndef __strtoul_internal_defined +# ifndef __strtoul_internal_defined extern unsigned long int __strtoul_internal __P ((__const char * __restrict __nptr, - char **__restrict __endptr, + char ** __restrict __endptr, int __base, int __group)); -# define __strtoul_internal_defined 1 -#endif - +# define __strtoul_internal_defined 1 +# endif +extern __inline uintmax_t +strtoumax (__const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoul_internal (nptr, endptr, base, 0); +} /* Like `wcstol' but convert to `intmax_t'. */ -#define wcstoimax(nptr, endptr, base) \ - __wcstol_internal (nptr, endptr, base, 0) - -#ifndef __wcstol_internal_defined -extern long int __wcstol_internal __P ((__const wchar_t *__restrict __nptr, +# ifndef __wcstol_internal_defined +extern long int __wcstol_internal __P ((__const wchar_t * __restrict __nptr, wchar_t **__restrict __endptr, int __base, int __group)); -# define __wcstol_internal_defined 1 -#endif +# define __wcstol_internal_defined 1 +# endif +extern __inline intmax_t +wcstoimax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstol_internal (nptr, endptr, base, 0); +} /* Like `wcstoul' but convert to `uintmax_t'. */ -#define wcstoumax(nptr, endptr, base) \ - __wcstoul_internal (nptr, endptr, base, 0) - -#ifndef __wcstoul_internal_defined +# ifndef __wcstoul_internal_defined extern unsigned long int __wcstoul_internal __P ((__const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, int __group)); -# define __wcstoul_internal_defined 1 -#endif +# define __wcstoul_internal_defined 1 +# endif +extern __inline uintmax_t +wcstoumax (__const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoul_internal (nptr, endptr, base, 0); +} +#endif /* GCC and Optimization. */ #endif /* inttypes.h */ diff --git a/sysdeps/wordsize-64/strtoimax.c b/sysdeps/wordsize-64/strtoimax.c new file mode 100644 index 0000000..f26f271 --- /dev/null +++ b/sysdeps/wordsize-64/strtoimax.c @@ -0,0 +1,28 @@ +/* Convert string to maximal integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <stdlib.h> + +intmax_t +strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtol_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-64/strtoumax.c b/sysdeps/wordsize-64/strtoumax.c new file mode 100644 index 0000000..90d9be9 --- /dev/null +++ b/sysdeps/wordsize-64/strtoumax.c @@ -0,0 +1,28 @@ +/* Convert string to maximal unsigned integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <stdlib.h> + +uintmax_t +strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) +{ + return __strtoul_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-64/wcstoimax.c b/sysdeps/wordsize-64/wcstoimax.c new file mode 100644 index 0000000..d6d992b --- /dev/null +++ b/sysdeps/wordsize-64/wcstoimax.c @@ -0,0 +1,29 @@ +/* Convert wide-character string to maximal integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <wchar.h> + +intmax_t +wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstol_internal (nptr, endptr, base, 0); +} diff --git a/sysdeps/wordsize-64/wcstoumax.c b/sysdeps/wordsize-64/wcstoumax.c new file mode 100644 index 0000000..c206525 --- /dev/null +++ b/sysdeps/wordsize-64/wcstoumax.c @@ -0,0 +1,29 @@ +/* Convert wide-character string to maximal unsigned integer. + Copyright (C) 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 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. + + 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. */ + +#include <inttypes.h> +#include <wchar.h> + +uintmax_t +wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, + int base) +{ + return __wcstoul_internal (nptr, endptr, base, 0); +} |