Update.
1997-12-14 21:33 Ulrich Drepper <drepper@cygnus.com> * version.h (VERSION): Bump to 2.0.91. * db2/makedb.c (process_input): Fix typo in message. * sunrpc/rpcinfo.c (pmapdump): Unify messages. * elf/dynamic-link.h: Pretty print. * elf/rtld.c: Allow multiple preloading of a shared object. * include/limits.h: Prevent multiple inclusion. * malloc/Makefile (headers): Add mcheck.h. (distribute): Remove it here. * malloc/mcheck.h: Pretty print. * malloc/mtrace.c (mallenv): Make `const'. * malloc/mtrace.pl: Don't print table head for memory leaks if there are none. * manual/memory.texi: Update descriptor of malloc hooks. * posix/Makefile (routines): Add waitid. * posix/sys/types.h [__USE_SVID || __USE_POSIX]: Define id_t based on __id_t. * posix/sys/wait.h: Define idtype_t type. Add prototype for waitid. * signal/signal.h: Move definition of sigval_t to <bits/siginfo.h>. * sysdeps/generic/waitid.c: Stub for waitid. * sysdeps/generic/bits/siginfo.h: Define sigval_t. Arrange to work the __need_siginfo_t defined. * sysdeps/unix/sysv/linux/bits/siginfo: Likewise. * sysdeps/generic/bits/types.h: Define __id_t. Correct definition of __FDMASK. * sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise. * sysdeps/unix/sysv/linux/bits/types.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise. * sysdeps/posix/waitid.c: New file. Provided by Zack Weinberg. * rt/aio_misc.c: Rename __aio_free_req to __aio_free_request. * sysdeps/alpha/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE): Add missing parameters. * sysdeps/generic/dl-sysdep.c: Don't call __libc_init_secure. * sysdeps/generic/enbl-secure.c: Don't define __libc_uid. * sysdeps/unix/sysv/linux/init-first.c: Define __libc_uid. * sysdeps/unix/sysv/linux/sigqueue.c: Make sure __libc_uid is initialized. * sysdeps/i386/dl-machine.h: Little cleanup. * sysdeps/i386/fpu/bits/mathinline.h: Use __signbit* inline functions. (__finite): Mark function as const. Add inline code for __ieee754_atan2. * sysdeps/libm-ieee754/s_cacoshf.c: Add alternate implementation (but don't use it now). * sysdeps/libm-ieee754/s_catan.c: Use __ieee754_atan2 instead of __atan. * sysdeps/libm-ieee754/s_catanf.c: Likewise. * sysdeps/libm-ieee754/s_catanl.c: Likewise. * sysdeps/libm-ieee754/s_catanh.c: Likewise. Correct sign of real part. * sysdeps/libm-ieee754/s_catanhf.c: Likewise. * sysdeps/libm-ieee754/s_catanhl.c: Likewise. * sysdeps/libm-ieee754/s_clog10.c: Use factor to correct __ieee754_atan2 to base 10. * sysdeps/libm-ieee754/s_clog10f.c: Likewise. * sysdeps/libm-ieee754/s_clog10l.c: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h: Define as old_kernel_sigaction. * sysdeps/unix/sysv/linux/net/if_slip.h: Pretty print. * wctype/Makefile (routines): Add wctype_l. * wctype/wctype.h: Add declaration of __wctype_l. * wctype/wctype_l.c: New file. 1997-12-10 00:38 Ulrich Drepper <drepper@cygnus.com> * locale/C-ctype.c: Correct data for isw* functions. * locale/programs/ld-ctype.c: Write 32bit char classes in correct byte order. * wctype/test_wctype.c: Add test for isw* functions. * wctype/wctype.c: Return value with expected byte order. * sysdeps/generic/_G_config.h: Define _G_HAVE_IO_FILE_OPEN. * sysdeps/unix/sysv/linux/_G_config.h: Likewise.
This commit is contained in:
parent
afe93c0bb3
commit
bd355af04f
95
ChangeLog
95
ChangeLog
|
@ -1,3 +1,92 @@
|
||||||
|
1997-12-14 21:33 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* version.h (VERSION): Bump to 2.0.91.
|
||||||
|
|
||||||
|
* db2/makedb.c (process_input): Fix typo in message.
|
||||||
|
* sunrpc/rpcinfo.c (pmapdump): Unify messages.
|
||||||
|
|
||||||
|
* elf/dynamic-link.h: Pretty print.
|
||||||
|
|
||||||
|
* elf/rtld.c: Allow multiple preloading of a shared object.
|
||||||
|
|
||||||
|
* include/limits.h: Prevent multiple inclusion.
|
||||||
|
|
||||||
|
* malloc/Makefile (headers): Add mcheck.h.
|
||||||
|
(distribute): Remove it here.
|
||||||
|
* malloc/mcheck.h: Pretty print.
|
||||||
|
* malloc/mtrace.c (mallenv): Make `const'.
|
||||||
|
* malloc/mtrace.pl: Don't print table head for memory leaks if there
|
||||||
|
are none.
|
||||||
|
* manual/memory.texi: Update descriptor of malloc hooks.
|
||||||
|
|
||||||
|
* posix/Makefile (routines): Add waitid.
|
||||||
|
* posix/sys/types.h [__USE_SVID || __USE_POSIX]: Define id_t based
|
||||||
|
on __id_t.
|
||||||
|
* posix/sys/wait.h: Define idtype_t type.
|
||||||
|
Add prototype for waitid.
|
||||||
|
* signal/signal.h: Move definition of sigval_t to <bits/siginfo.h>.
|
||||||
|
* sysdeps/generic/waitid.c: Stub for waitid.
|
||||||
|
* sysdeps/generic/bits/siginfo.h: Define sigval_t. Arrange to work
|
||||||
|
the __need_siginfo_t defined.
|
||||||
|
* sysdeps/unix/sysv/linux/bits/siginfo: Likewise.
|
||||||
|
* sysdeps/generic/bits/types.h: Define __id_t.
|
||||||
|
Correct definition of __FDMASK.
|
||||||
|
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
|
||||||
|
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/posix/waitid.c: New file.
|
||||||
|
Provided by Zack Weinberg.
|
||||||
|
|
||||||
|
* rt/aio_misc.c: Rename __aio_free_req to __aio_free_request.
|
||||||
|
|
||||||
|
* sysdeps/alpha/dl-machine.h (ELF_MACHINE_RUNTIME_TRAMPOLINE):
|
||||||
|
Add missing parameters.
|
||||||
|
|
||||||
|
* sysdeps/generic/dl-sysdep.c: Don't call __libc_init_secure.
|
||||||
|
* sysdeps/generic/enbl-secure.c: Don't define __libc_uid.
|
||||||
|
* sysdeps/unix/sysv/linux/init-first.c: Define __libc_uid.
|
||||||
|
* sysdeps/unix/sysv/linux/sigqueue.c: Make sure __libc_uid is
|
||||||
|
initialized.
|
||||||
|
|
||||||
|
* sysdeps/i386/dl-machine.h: Little cleanup.
|
||||||
|
|
||||||
|
* sysdeps/i386/fpu/bits/mathinline.h: Use __signbit* inline functions.
|
||||||
|
(__finite): Mark function as const.
|
||||||
|
Add inline code for __ieee754_atan2.
|
||||||
|
|
||||||
|
* sysdeps/libm-ieee754/s_cacoshf.c: Add alternate implementation
|
||||||
|
(but don't use it now).
|
||||||
|
* sysdeps/libm-ieee754/s_catan.c: Use __ieee754_atan2 instead of
|
||||||
|
__atan.
|
||||||
|
* sysdeps/libm-ieee754/s_catanf.c: Likewise.
|
||||||
|
* sysdeps/libm-ieee754/s_catanl.c: Likewise.
|
||||||
|
* sysdeps/libm-ieee754/s_catanh.c: Likewise. Correct sign of
|
||||||
|
real part.
|
||||||
|
* sysdeps/libm-ieee754/s_catanhf.c: Likewise.
|
||||||
|
* sysdeps/libm-ieee754/s_catanhl.c: Likewise.
|
||||||
|
* sysdeps/libm-ieee754/s_clog10.c: Use factor to correct
|
||||||
|
__ieee754_atan2 to base 10.
|
||||||
|
* sysdeps/libm-ieee754/s_clog10f.c: Likewise.
|
||||||
|
* sysdeps/libm-ieee754/s_clog10l.c: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h: Define as
|
||||||
|
old_kernel_sigaction.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/net/if_slip.h: Pretty print.
|
||||||
|
|
||||||
|
* wctype/Makefile (routines): Add wctype_l.
|
||||||
|
* wctype/wctype.h: Add declaration of __wctype_l.
|
||||||
|
* wctype/wctype_l.c: New file.
|
||||||
|
|
||||||
|
1997-12-10 00:38 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* locale/C-ctype.c: Correct data for isw* functions.
|
||||||
|
* locale/programs/ld-ctype.c: Write 32bit char classes in correct
|
||||||
|
byte order.
|
||||||
|
* wctype/test_wctype.c: Add test for isw* functions.
|
||||||
|
* wctype/wctype.c: Return value with expected byte order.
|
||||||
|
|
||||||
1997-12-13 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
1997-12-13 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
|
||||||
|
|
||||||
* libc-work/nis/ypclnt.c (do_ypcall): Don't free dom_binding twice.
|
* libc-work/nis/ypclnt.c (do_ypcall): Don't free dom_binding twice.
|
||||||
|
@ -8,7 +97,6 @@
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/Makefile (stdio-common): Add
|
* sysdeps/unix/sysv/linux/Makefile (stdio-common): Add
|
||||||
oldsiglist for shared library.
|
oldsiglist for shared library.
|
||||||
(signal): Add rt_sigreturn and rt_sigpending.
|
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/siglist.c (_sys_siglist, sys_siglist,
|
* sysdeps/unix/sysv/linux/siglist.c (_sys_siglist, sys_siglist,
|
||||||
sys_sigabbrev): Make them as the default version GLIBC_2.1.
|
sys_sigabbrev): Make them as the default version GLIBC_2.1.
|
||||||
|
@ -92,9 +180,8 @@
|
||||||
* libio/fileops.c (_IO_file_open): New.
|
* libio/fileops.c (_IO_file_open): New.
|
||||||
(_IO_file_fopen): Call _IO_file_open ().
|
(_IO_file_fopen): Call _IO_file_open ().
|
||||||
|
|
||||||
* sysdeps/generic/_G_config.h
|
* sysdeps/generic/_G_config.h: Define _G_HAVE_IO_FILE_OPEN.
|
||||||
* sysdeps/unix/sysv/linux/_G_config.h: Define
|
* sysdeps/unix/sysv/linux/_G_config.h: Likewise.
|
||||||
_G_HAVE_IO_FILE_OPEN.
|
|
||||||
|
|
||||||
1997-12-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
1997-12-07 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
|
39
FAQ.in
39
FAQ.in
|
@ -27,12 +27,12 @@ The systems glibc is known to work on as of this release, and most
|
||||||
probably in the future, are:
|
probably in the future, are:
|
||||||
|
|
||||||
*-*-gnu GNU Hurd
|
*-*-gnu GNU Hurd
|
||||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
i[3456]86-*-linux-gnu Linux-2.x on Intel
|
||||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
m68k-*-linux-gnu Linux-2.x on Motorola 680x0
|
||||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
alpha-*-linux-gnu Linux-2.x on DEC Alpha
|
||||||
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
|
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
|
||||||
sparc-*-linux-gnu Linux-2.0 on SPARC
|
sparc-*-linux-gnu Linux-2.x on SPARC
|
||||||
sparc64-*-linux-gnu Linux-2.0 on UltraSPARC
|
sparc64-*-linux-gnu Linux-2.x on UltraSPARC
|
||||||
|
|
||||||
Ports to other Linux platforms are in development, and may in fact
|
Ports to other Linux platforms are in development, and may in fact
|
||||||
work already, but no one has sent us success reports for them.
|
work already, but no one has sent us success reports for them.
|
||||||
|
@ -102,6 +102,10 @@ has not been ported to them.
|
||||||
|
|
||||||
You should not need these tools unless you change the source files.
|
You should not need these tools unless you change the source files.
|
||||||
|
|
||||||
|
* Some scripts need perl5 - but at the moment those scripts are not
|
||||||
|
vital for building and installing GNU libc (some data files will not
|
||||||
|
be created).
|
||||||
|
|
||||||
* When compiling for Linux, the header files of the Linux kernel must
|
* When compiling for Linux, the header files of the Linux kernel must
|
||||||
be available to the compiler as <linux/*.h> and <asm/*.h>.
|
be available to the compiler as <linux/*.h> and <asm/*.h>.
|
||||||
|
|
||||||
|
@ -117,9 +121,10 @@ has not been ported to them.
|
||||||
very slow.
|
very slow.
|
||||||
|
|
||||||
James Troup <J.J.Troup@comp.brad.ac.uk> reports a compile time of
|
James Troup <J.J.Troup@comp.brad.ac.uk> reports a compile time of
|
||||||
45h34m for a full build (shared, static, and profiled) on
|
45h34m for a full build (shared, static, and profiled) on Atari
|
||||||
Atari Falcon (Motorola 68030 @ 16 Mhz, 14 Mb memory) and 22h48m
|
Falcon (Motorola 68030 @ 16 Mhz, 14 Mb memory) and Jan Barte
|
||||||
on Atari TT030 (Motorola 68030 @ 32 Mhz, 34 Mb memory)
|
<yann@plato.uni-paderborn.de> reports 22h48m on Atari TT030
|
||||||
|
(Motorola 68030 @ 32 Mhz, 34 Mb memory)
|
||||||
|
|
||||||
If you have some more measurements let me know.
|
If you have some more measurements let me know.
|
||||||
|
|
||||||
|
@ -624,7 +629,7 @@ release is for. It's better to have a cut now than having no means to
|
||||||
support the new techniques later.
|
support the new techniques later.
|
||||||
|
|
||||||
{MK} There is however a (partial) solution for this problem. Please
|
{MK} There is however a (partial) solution for this problem. Please
|
||||||
take a look at the file `README.utmpd'.
|
take a look at the file `login/README.utmpd'.
|
||||||
|
|
||||||
?? Where are the DST_* constants found in <sys/time.h> on many
|
?? Where are the DST_* constants found in <sys/time.h> on many
|
||||||
systems?
|
systems?
|
||||||
|
@ -668,13 +673,13 @@ results because of type conflicts.
|
||||||
still complains about redeclarations of types in the kernel
|
still complains about redeclarations of types in the kernel
|
||||||
headers.
|
headers.
|
||||||
|
|
||||||
{UD} The kernel headers before Linux 2.1.61 don't work correctly with
|
{UD} The kernel headers before Linux 2.1.61 and 2.0.32 don't work
|
||||||
glibc. Compiling C programs is possible in most cases but C++
|
correctly with glibc. Compiling C programs is possible in most cases
|
||||||
programs have (due to the change of the name lookups for `struct's)
|
but C++ programs have (due to the change of the name lookups for
|
||||||
problems. One prominent example is `struct fd_set'.
|
`struct's) problems. One prominent example is `struct fd_set'.
|
||||||
|
|
||||||
There might be some problems left but 2.1.61 fixes most of the known
|
There might be some problems left but 2.1.61/2.0.32 fix most of the
|
||||||
ones. See the BUGS file for other known problems.
|
known ones. See the BUGS file for other known problems.
|
||||||
|
|
||||||
??signal Why don't signals interrupt system calls anymore?
|
??signal Why don't signals interrupt system calls anymore?
|
||||||
|
|
||||||
|
@ -767,8 +772,8 @@ point where the headers are stable. There are still lots of
|
||||||
incompatible changes made and the libc headers have to follow.
|
incompatible changes made and the libc headers have to follow.
|
||||||
|
|
||||||
Also, make sure you have a suitably recent kernel. As of the 970401
|
Also, make sure you have a suitably recent kernel. As of the 970401
|
||||||
snapshot, according to Philip Blundell <philb@gnu.ai.mit.edu>, the
|
snapshot, according to Philip Blundell <Philip.Blundell@pobox.com>, the
|
||||||
required kernel version is 2.1.30.
|
required kernel version is at least 2.1.30.
|
||||||
|
|
||||||
|
|
||||||
Answers were given by:
|
Answers were given by:
|
||||||
|
|
|
@ -17,10 +17,21 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _SIGNAL_H
|
#if !defined _SIGNAL_H && !defined __need_siginfo_t
|
||||||
# error "Never include this file directly. Use <signal.h> instead"
|
# error "Never include this file directly. Use <signal.h> instead"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (!defined __have_siginfo_t \
|
||||||
|
&& (defined _SIGNAL_H || defined __need_siginfo_t))
|
||||||
|
# define __have_siginfo_t 1
|
||||||
|
|
||||||
|
/* Type for data associated with a signal. */
|
||||||
|
typedef union sigval
|
||||||
|
{
|
||||||
|
int sival_int;
|
||||||
|
void *sival_ptr;
|
||||||
|
} sigval_t;
|
||||||
|
|
||||||
typedef struct siginfo
|
typedef struct siginfo
|
||||||
{
|
{
|
||||||
int si_signo; /* Signal number. */
|
int si_signo; /* Signal number. */
|
||||||
|
@ -158,6 +169,12 @@ enum
|
||||||
# define POLL_HUP POLL_HUP
|
# define POLL_HUP POLL_HUP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# undef __need_siginfo_t
|
||||||
|
#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined _SIGNAL_H && !defined __have_sigevent_t
|
||||||
|
# define __have_sigevent_t 1
|
||||||
|
|
||||||
/* Structure to transport application-defined values with signals. */
|
/* Structure to transport application-defined values with signals. */
|
||||||
# define SIGEV_MAX_SIZE 64
|
# define SIGEV_MAX_SIZE 64
|
||||||
|
@ -182,3 +199,5 @@ enum
|
||||||
SIGEV_THREAD /* Deliver via thread creation. */
|
SIGEV_THREAD /* Deliver via thread creation. */
|
||||||
# define SIGEV_THREAD SIGEV_THREAD
|
# define SIGEV_THREAD SIGEV_THREAD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* have _SIGNAL_H. */
|
||||||
|
|
|
@ -69,6 +69,7 @@ typedef long int __rlim_t; /* Type for resource measurement. */
|
||||||
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
|
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
|
||||||
typedef __quad_t __ino64_t; /* Type for file serial numbers. */
|
typedef __quad_t __ino64_t; /* Type for file serial numbers. */
|
||||||
typedef __loff_t __off64_t; /* Type of file izes and offsets. */
|
typedef __loff_t __off64_t; /* Type of file izes and offsets. */
|
||||||
|
typedef unsigned int __id_t; /* General type for IDs. */
|
||||||
|
|
||||||
/* Everythin' else. */
|
/* Everythin' else. */
|
||||||
typedef long int __daddr_t; /* The type of a disk address. */
|
typedef long int __daddr_t; /* The type of a disk address. */
|
||||||
|
@ -85,7 +86,7 @@ typedef long int __key_t; /* Type of an IPC key */
|
||||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||||
#define __NFDBITS (sizeof (unsigned long int) * 8)
|
#define __NFDBITS (sizeof (unsigned long int) * 8)
|
||||||
#define __FDELT(d) ((d) / __NFDBITS)
|
#define __FDELT(d) ((d) / __NFDBITS)
|
||||||
#define __FDMASK(d) (1 << ((d) % __NFDBITS))
|
#define __FDMASK(d) ((unsigned long int) 1 << ((d) % __NFDBITS))
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,8 +46,6 @@ struct r_search_path *_dl_search_paths;
|
||||||
const char *_dl_profile;
|
const char *_dl_profile;
|
||||||
struct link_map *_dl_profile_map;
|
struct link_map *_dl_profile_map;
|
||||||
|
|
||||||
extern void __libc_init_secure (void);
|
|
||||||
|
|
||||||
|
|
||||||
static void non_dynamic_init (void) __attribute__ ((unused));
|
static void non_dynamic_init (void) __attribute__ ((unused));
|
||||||
|
|
||||||
|
@ -58,8 +56,6 @@ non_dynamic_init (void)
|
||||||
|
|
||||||
_dl_pagesize = __getpagesize ();
|
_dl_pagesize = __getpagesize ();
|
||||||
|
|
||||||
__libc_init_secure ();
|
|
||||||
|
|
||||||
/* Initialize the data structures for the search paths for shared
|
/* Initialize the data structures for the search paths for shared
|
||||||
objects. */
|
objects. */
|
||||||
_dl_init_paths ();
|
_dl_init_paths ();
|
||||||
|
|
|
@ -56,7 +56,7 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
|
||||||
+ DT_VERSIONTAGNUM] = dyn;
|
+ DT_VERSIONTAGNUM] = dyn;
|
||||||
else
|
else
|
||||||
assert (! "bad dynamic tag");
|
assert (! "bad dynamic tag");
|
||||||
dyn++;
|
++dyn;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info[DT_RELA])
|
if (info[DT_RELA])
|
||||||
|
|
14
elf/rtld.c
14
elf/rtld.c
|
@ -495,7 +495,9 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||||
while ((p = strsep (&list, " ")) != NULL)
|
while ((p = strsep (&list, " ")) != NULL)
|
||||||
if (! __libc_enable_secure || strchr (p, '/') == NULL)
|
if (! __libc_enable_secure || strchr (p, '/') == NULL)
|
||||||
{
|
{
|
||||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
struct link_map *new_map = _dl_map_object (NULL, p, lt_library, 0);
|
||||||
|
if (new_map->l_opencount == 1)
|
||||||
|
/* It is no duplicate. */
|
||||||
++npreloads;
|
++npreloads;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -550,7 +552,10 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||||
runp = file;
|
runp = file;
|
||||||
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
while ((p = strsep (&runp, ": \t\n")) != NULL)
|
||||||
{
|
{
|
||||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
struct link_map *new_map = _dl_map_object (NULL, p,
|
||||||
|
lt_library, 0);
|
||||||
|
if (new_map->l_opencount == 1)
|
||||||
|
/* It is no duplicate. */
|
||||||
++npreloads;
|
++npreloads;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -558,7 +563,10 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||||
if (problem != NULL)
|
if (problem != NULL)
|
||||||
{
|
{
|
||||||
char *p = strndupa (problem, file_size - (problem - file));
|
char *p = strndupa (problem, file_size - (problem - file));
|
||||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
struct link_map *new_map = _dl_map_object (NULL, p, lt_library, 0);
|
||||||
|
if (new_map->l_opencount == 1)
|
||||||
|
/* It is no duplicate. */
|
||||||
|
++npreloads;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't need the file anymore. */
|
/* We don't need the file anymore. */
|
||||||
|
|
|
@ -169,7 +169,7 @@ headers: $(sed-generated-headers) $(perl-generated-headers)
|
||||||
|
|
||||||
$(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)%
|
$(addprefix $(inst_gconvdir)/, $(modules.so)): $(inst_gconvdir)/%: $(objpfx)%
|
||||||
$(do-install-program)
|
$(do-install-program)
|
||||||
$(inst_gconvdir)/gconv_modules: gconv-modules
|
$(inst_gconvdir)/gconv-modules: gconv-modules
|
||||||
$(do-install)
|
$(do-install)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mod := $(firstword $(extra-modules-left))
|
mod := $(firstword $(extra-modules-left))
|
||||||
extra-modules-left := $(strip $(filter-out $(mod),$(extra-modules-left)))
|
extra-modules-left := $(strip $(filter-out $(mod),$(extra-modules-left)))
|
||||||
|
|
||||||
extra-objs += $(patsubst %,%.os,$($(mod)-routines))
|
extra-objs := $(extra-objs) $(patsubst %,%.os,$($(mod)-routines))
|
||||||
|
|
||||||
$(objpfx)$(mod).so: $(addprefix $(objpfx),$(addsuffix .os,$($(mod)-routines)))
|
$(objpfx)$(mod).so: $(addprefix $(objpfx),$(addsuffix .os,$($(mod)-routines)))
|
||||||
$(build-module)
|
$(build-module)
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
* ISO C Standard: 4.14/2.2.4.2 Limits of integral types <limits.h>
|
* ISO C Standard: 4.14/2.2.4.2 Limits of integral types <limits.h>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIBC_LIMITS_H_
|
||||||
|
#define _LIBC_LIMITS_H_ 1
|
||||||
|
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
|
|
||||||
#ifdef __USE_POSIX
|
#ifdef __USE_POSIX
|
||||||
|
@ -39,9 +42,6 @@
|
||||||
#if __GNUC__ >= 2
|
#if __GNUC__ >= 2
|
||||||
|
|
||||||
/* Get the compiler's limits.h, which defines all the ANSI constants. */
|
/* Get the compiler's limits.h, which defines all the ANSI constants. */
|
||||||
# ifndef _LIBC_LIMITS_H_
|
|
||||||
# define _LIBC_LIMITS_H_ /* This tells it not to look for another. */
|
|
||||||
# endif
|
|
||||||
# ifndef _GCC_LIMITS_H_ /* This is what GCC's file defines. */
|
# ifndef _GCC_LIMITS_H_ /* This is what GCC's file defines. */
|
||||||
# include_next <limits.h>
|
# include_next <limits.h>
|
||||||
# endif
|
# endif
|
||||||
|
@ -121,3 +121,5 @@
|
||||||
|
|
||||||
# endif /* limits.h */
|
# endif /* limits.h */
|
||||||
#endif /* GCC 2. */
|
#endif /* GCC 2. */
|
||||||
|
|
||||||
|
#endif /* !_LIBC_LIMITS_H_ */
|
||||||
|
|
|
@ -43,7 +43,7 @@ all: # Make this the default target; it will be defined in Rules.
|
||||||
include ../Makeconfig
|
include ../Makeconfig
|
||||||
|
|
||||||
ifeq ($(versioning),yes)
|
ifeq ($(versioning),yes)
|
||||||
routines += oldiofopen oldiofclose
|
routines += oldiofopen oldiofclose oldiofclose
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS-.o += -DIO_DEBUG
|
CPPFLAGS-.o += -DIO_DEBUG
|
||||||
|
@ -62,7 +62,8 @@ ifeq ($(versioning),yes)
|
||||||
aux += oldfileops oldstdfiles
|
aux += oldfileops oldstdfiles
|
||||||
endif
|
endif
|
||||||
|
|
||||||
shared-only-routines = oldiofopen oldiofclose oldfileops oldstdfiles
|
shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
|
||||||
|
oldstdfiles
|
||||||
|
|
||||||
distribute := iolibio.h libioP.h strfile.h Banner
|
distribute := iolibio.h libioP.h strfile.h Banner
|
||||||
|
|
||||||
|
|
|
@ -108,11 +108,10 @@ void
|
||||||
_IO_file_init (fp)
|
_IO_file_init (fp)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
/* POSIX.1 allows another file handle to be used to change the position
|
/* POSIX.1 allows another file handle to be used to change the position
|
||||||
of our file descriptor. Hence we actually don't know the actual
|
of our file descriptor. Hence we actually don't know the actual
|
||||||
position before we do the first fseek (and until a following fflush). */
|
position before we do the first fseek (and until a following fflush). */
|
||||||
fc->_offset = _IO_pos_BAD;
|
fp->_offset = _IO_pos_BAD;
|
||||||
fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
|
fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
|
||||||
|
|
||||||
_IO_link_in(fp);
|
_IO_link_in(fp);
|
||||||
|
@ -123,7 +122,6 @@ int
|
||||||
_IO_file_close_it (fp)
|
_IO_file_close_it (fp)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
int write_status, close_status;
|
int write_status, close_status;
|
||||||
if (!_IO_file_is_open (fp))
|
if (!_IO_file_is_open (fp))
|
||||||
return EOF;
|
return EOF;
|
||||||
|
@ -142,7 +140,7 @@ _IO_file_close_it (fp)
|
||||||
_IO_un_link (fp);
|
_IO_un_link (fp);
|
||||||
fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
|
fp->_flags = _IO_MAGIC|CLOSED_FILEBUF_FLAGS;
|
||||||
fp->_fileno = EOF;
|
fp->_fileno = EOF;
|
||||||
fc->_offset = _IO_pos_BAD;
|
fp->_offset = _IO_pos_BAD;
|
||||||
|
|
||||||
return close_status ? close_status : write_status;
|
return close_status ? close_status : write_status;
|
||||||
}
|
}
|
||||||
|
@ -161,6 +159,38 @@ _IO_file_finish (fp, dummy)
|
||||||
_IO_default_finish (fp, 0);
|
_IO_default_finish (fp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined __GNUC__ && __GNUC__ >= 2
|
||||||
|
__inline__
|
||||||
|
#endif
|
||||||
|
_IO_FILE *
|
||||||
|
_IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
|
||||||
|
_IO_FILE *fp;
|
||||||
|
const char *filename;
|
||||||
|
int posix_mode;
|
||||||
|
int prot;
|
||||||
|
int read_write;
|
||||||
|
int is32not64;
|
||||||
|
{
|
||||||
|
int fdesc;
|
||||||
|
#ifdef _G_OPEN64
|
||||||
|
fdesc = (is32not64
|
||||||
|
? open (filename, posix_mode, prot)
|
||||||
|
: _G_OPEN64 (filename, posix_mode, prot));
|
||||||
|
#else
|
||||||
|
fdesc = open (filename, posix_mode, prot);
|
||||||
|
#endif
|
||||||
|
if (fdesc < 0)
|
||||||
|
return NULL;
|
||||||
|
fp->_fileno = fdesc;
|
||||||
|
_IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
||||||
|
if (read_write & _IO_IS_APPENDING)
|
||||||
|
if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
|
== _IO_pos_BAD && errno != ESPIPE)
|
||||||
|
return NULL;
|
||||||
|
_IO_link_in (fp);
|
||||||
|
return fp;
|
||||||
|
}
|
||||||
|
|
||||||
_IO_FILE *
|
_IO_FILE *
|
||||||
_IO_file_fopen (fp, filename, mode, is32not64)
|
_IO_file_fopen (fp, filename, mode, is32not64)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
|
@ -169,7 +199,7 @@ _IO_file_fopen (fp, filename, mode, is32not64)
|
||||||
int is32not64;
|
int is32not64;
|
||||||
{
|
{
|
||||||
int oflags = 0, omode;
|
int oflags = 0, omode;
|
||||||
int read_write, fdesc;
|
int read_write;
|
||||||
int oprot = 0666;
|
int oprot = 0666;
|
||||||
if (_IO_file_is_open (fp))
|
if (_IO_file_is_open (fp))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -198,23 +228,8 @@ _IO_file_fopen (fp, filename, mode, is32not64)
|
||||||
omode = O_RDWR;
|
omode = O_RDWR;
|
||||||
read_write &= _IO_IS_APPENDING;
|
read_write &= _IO_IS_APPENDING;
|
||||||
}
|
}
|
||||||
#ifdef _G_OPEN64
|
return _IO_file_open (fp, filename, omode|oflags, oprot, read_write,
|
||||||
fdesc = (is32not64
|
is32not64);
|
||||||
? open (filename, omode|oflags, oprot)
|
|
||||||
: _G_OPEN64 (filename, omode|oflags, oprot));
|
|
||||||
#else
|
|
||||||
fdesc = open (filename, omode|oflags, oprot);
|
|
||||||
#endif
|
|
||||||
if (fdesc < 0)
|
|
||||||
return NULL;
|
|
||||||
fp->_fileno = fdesc;
|
|
||||||
_IO_mask_flags (fp, read_write,_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
|
||||||
if (read_write & _IO_IS_APPENDING)
|
|
||||||
if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
|
|
||||||
== _IO_pos_BAD && errno != ESPIPE)
|
|
||||||
return NULL;
|
|
||||||
_IO_link_in (fp);
|
|
||||||
return fp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_IO_FILE *
|
_IO_FILE *
|
||||||
|
@ -222,7 +237,6 @@ _IO_file_attach (fp, fd)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
int fd;
|
int fd;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
if (_IO_file_is_open (fp))
|
if (_IO_file_is_open (fp))
|
||||||
return NULL;
|
return NULL;
|
||||||
fp->_fileno = fd;
|
fp->_fileno = fd;
|
||||||
|
@ -230,7 +244,7 @@ _IO_file_attach (fp, fd)
|
||||||
fp->_flags |= _IO_DELETE_DONT_CLOSE;
|
fp->_flags |= _IO_DELETE_DONT_CLOSE;
|
||||||
/* Get the current position of the file. */
|
/* Get the current position of the file. */
|
||||||
/* We have to do that since that may be junk. */
|
/* We have to do that since that may be junk. */
|
||||||
fc->_offset = _IO_pos_BAD;
|
fp->_offset = _IO_pos_BAD;
|
||||||
if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
|
if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_cur, _IOS_INPUT|_IOS_OUTPUT)
|
||||||
== _IO_pos_BAD && errno != ESPIPE)
|
== _IO_pos_BAD && errno != ESPIPE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -262,7 +276,6 @@ _IO_do_write (fp, data, to_do)
|
||||||
const char *data;
|
const char *data;
|
||||||
_IO_size_t to_do;
|
_IO_size_t to_do;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
_IO_size_t count;
|
_IO_size_t count;
|
||||||
if (to_do == 0)
|
if (to_do == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -272,14 +285,14 @@ _IO_do_write (fp, data, to_do)
|
||||||
is not needed nor desirable for Unix- or Posix-like systems.
|
is not needed nor desirable for Unix- or Posix-like systems.
|
||||||
Instead, just indicate that offset (before and after) is
|
Instead, just indicate that offset (before and after) is
|
||||||
unpredictable. */
|
unpredictable. */
|
||||||
fc->_offset = _IO_pos_BAD;
|
fp->_offset = _IO_pos_BAD;
|
||||||
else if (fp->_IO_read_end != fp->_IO_write_base)
|
else if (fp->_IO_read_end != fp->_IO_write_base)
|
||||||
{
|
{
|
||||||
_IO_fpos64_t new_pos
|
_IO_fpos64_t new_pos
|
||||||
= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
|
= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);
|
||||||
if (new_pos == _IO_pos_BAD)
|
if (new_pos == _IO_pos_BAD)
|
||||||
return EOF;
|
return EOF;
|
||||||
fc->_offset = new_pos;
|
fp->_offset = new_pos;
|
||||||
}
|
}
|
||||||
count = _IO_SYSWRITE (fp, data, to_do);
|
count = _IO_SYSWRITE (fp, data, to_do);
|
||||||
if (fp->_cur_column)
|
if (fp->_cur_column)
|
||||||
|
@ -295,7 +308,6 @@ int
|
||||||
_IO_file_underflow (fp)
|
_IO_file_underflow (fp)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
_IO_ssize_t count;
|
_IO_ssize_t count;
|
||||||
#if 0
|
#if 0
|
||||||
/* SysV does not make this test; take it out for compatibility */
|
/* SysV does not make this test; take it out for compatibility */
|
||||||
|
@ -342,8 +354,8 @@ _IO_file_underflow (fp)
|
||||||
fp->_IO_read_end += count;
|
fp->_IO_read_end += count;
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return EOF;
|
return EOF;
|
||||||
if (fc->_offset != _IO_pos_BAD)
|
if (fp->_offset != _IO_pos_BAD)
|
||||||
_IO_pos_adjust (fc->_offset, count);
|
_IO_pos_adjust (fp->_offset, count);
|
||||||
return *(unsigned char *) fp->_IO_read_ptr;
|
return *(unsigned char *) fp->_IO_read_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +414,6 @@ int
|
||||||
_IO_file_sync (fp)
|
_IO_file_sync (fp)
|
||||||
_IO_FILE *fp;
|
_IO_FILE *fp;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
_IO_size_t delta;
|
_IO_size_t delta;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
|
@ -429,7 +440,7 @@ _IO_file_sync (fp)
|
||||||
retval = EOF;
|
retval = EOF;
|
||||||
}
|
}
|
||||||
if (retval != EOF)
|
if (retval != EOF)
|
||||||
fc->_offset = _IO_pos_BAD;
|
fp->_offset = _IO_pos_BAD;
|
||||||
/* FIXME: Cleanup - can this be shared? */
|
/* FIXME: Cleanup - can this be shared? */
|
||||||
/* setg(base(), ptr, ptr); */
|
/* setg(base(), ptr, ptr); */
|
||||||
_IO_cleanup_region_end (1);
|
_IO_cleanup_region_end (1);
|
||||||
|
@ -443,7 +454,6 @@ _IO_file_seekoff (fp, offset, dir, mode)
|
||||||
int dir;
|
int dir;
|
||||||
int mode;
|
int mode;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) fp;
|
|
||||||
_IO_fpos64_t result;
|
_IO_fpos64_t result;
|
||||||
_IO_off64_t delta, new_offset;
|
_IO_off64_t delta, new_offset;
|
||||||
long count;
|
long count;
|
||||||
|
@ -479,10 +489,10 @@ _IO_file_seekoff (fp, offset, dir, mode)
|
||||||
case _IO_seek_cur:
|
case _IO_seek_cur:
|
||||||
/* Adjust for read-ahead (bytes is buffer). */
|
/* Adjust for read-ahead (bytes is buffer). */
|
||||||
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
|
offset -= fp->_IO_read_end - fp->_IO_read_ptr;
|
||||||
if (fc->_offset == _IO_pos_BAD)
|
if (fp->_offset == _IO_pos_BAD)
|
||||||
goto dumb;
|
goto dumb;
|
||||||
/* Make offset absolute, assuming current pointer is file_ptr(). */
|
/* Make offset absolute, assuming current pointer is file_ptr(). */
|
||||||
offset += _IO_pos_as_off (fc->_offset);
|
offset += _IO_pos_as_off (fp->_offset);
|
||||||
|
|
||||||
dir = _IO_seek_set;
|
dir = _IO_seek_set;
|
||||||
break;
|
break;
|
||||||
|
@ -503,11 +513,11 @@ _IO_file_seekoff (fp, offset, dir, mode)
|
||||||
/* At this point, dir==_IO_seek_set. */
|
/* At this point, dir==_IO_seek_set. */
|
||||||
|
|
||||||
/* If destination is within current buffer, optimize: */
|
/* If destination is within current buffer, optimize: */
|
||||||
if (fc->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
|
if (fp->_offset != _IO_pos_BAD && fp->_IO_read_base != NULL
|
||||||
&& !_IO_in_backup (fp))
|
&& !_IO_in_backup (fp))
|
||||||
{
|
{
|
||||||
/* Offset relative to start of main get area. */
|
/* Offset relative to start of main get area. */
|
||||||
_IO_fpos64_t rel_offset = (offset - fc->_offset
|
_IO_fpos64_t rel_offset = (offset - fp->_offset
|
||||||
+ (fp->_IO_read_end - fp->_IO_read_base));
|
+ (fp->_IO_read_end - fp->_IO_read_base));
|
||||||
if (rel_offset >= 0)
|
if (rel_offset >= 0)
|
||||||
{
|
{
|
||||||
|
@ -581,7 +591,7 @@ _IO_file_seekoff (fp, offset, dir, mode)
|
||||||
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + delta,
|
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + delta,
|
||||||
fp->_IO_buf_base + count);
|
fp->_IO_buf_base + count);
|
||||||
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
|
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
|
||||||
fc->_offset = result + count;
|
fp->_offset = result + count;
|
||||||
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
|
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
|
||||||
return offset;
|
return offset;
|
||||||
dumb:
|
dumb:
|
||||||
|
@ -590,7 +600,7 @@ _IO_file_seekoff (fp, offset, dir, mode)
|
||||||
result = _IO_SYSSEEK (fp, offset, dir);
|
result = _IO_SYSSEEK (fp, offset, dir);
|
||||||
if (result != EOF)
|
if (result != EOF)
|
||||||
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
|
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
|
||||||
fc->_offset = result;
|
fp->_offset = result;
|
||||||
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
|
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
|
||||||
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
|
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
|
||||||
return result;
|
return result;
|
||||||
|
@ -643,7 +653,6 @@ _IO_file_write (f, data, n)
|
||||||
const void *data;
|
const void *data;
|
||||||
_IO_ssize_t n;
|
_IO_ssize_t n;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete *fc = (struct _IO_FILE_complete *) f;
|
|
||||||
_IO_ssize_t to_do = n;
|
_IO_ssize_t to_do = n;
|
||||||
while (to_do > 0)
|
while (to_do > 0)
|
||||||
{
|
{
|
||||||
|
@ -657,8 +666,8 @@ _IO_file_write (f, data, n)
|
||||||
data = (void *) ((char *) data + count);
|
data = (void *) ((char *) data + count);
|
||||||
}
|
}
|
||||||
n -= to_do;
|
n -= to_do;
|
||||||
if (fc->_offset >= 0)
|
if (f->_offset >= 0)
|
||||||
fc->_offset += n;
|
f->_offset += n;
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -531,6 +531,9 @@ _IO_init (fp, flags)
|
||||||
fp->_IO_save_end = NULL;
|
fp->_IO_save_end = NULL;
|
||||||
fp->_markers = NULL;
|
fp->_markers = NULL;
|
||||||
fp->_cur_column = 0;
|
fp->_cur_column = 0;
|
||||||
|
#if _IO_JUMPS_OFFSET
|
||||||
|
fp->_vtable_offset = 0;
|
||||||
|
#endif
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
_IO_lock_init (*fp->_lock);
|
_IO_lock_init (*fp->_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_IO_FILE *
|
_IO_FILE *
|
||||||
_IO_fdopen (fd, mode)
|
_IO_new_fdopen (fd, mode)
|
||||||
int fd;
|
int fd;
|
||||||
const char *mode;
|
const char *mode;
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,7 @@ _IO_fdopen (fd, mode)
|
||||||
int posix_mode = 0;
|
int posix_mode = 0;
|
||||||
struct locked_FILE
|
struct locked_FILE
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete fp;
|
struct _IO_FILE_plus fp;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
_IO_lock_t lock;
|
_IO_lock_t lock;
|
||||||
#endif
|
#endif
|
||||||
|
@ -106,29 +106,36 @@ _IO_fdopen (fd, mode)
|
||||||
if (new_f == NULL)
|
if (new_f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
new_f->fp.plus.file._lock = &new_f->lock;
|
new_f->fp.file._lock = &new_f->lock;
|
||||||
#endif
|
#endif
|
||||||
_IO_init (&new_f->fp.plus.file, 0);
|
_IO_init (&new_f->fp.file, 0);
|
||||||
_IO_JUMPS (&new_f->fp.plus.file) = &_IO_file_jumps;
|
_IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
|
||||||
_IO_file_init (&new_f->fp.plus.file);
|
_IO_file_init (&new_f->fp.file);
|
||||||
#if !_IO_UNIFIED_JUMPTABLES
|
#if !_IO_UNIFIED_JUMPTABLES
|
||||||
new_f->fp.vtable = NULL;
|
new_f->fp.vtable = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (_IO_file_attach (&new_f->fp.plus.file, fd) == NULL)
|
if (_IO_file_attach (&new_f->fp.file, fd) == NULL)
|
||||||
{
|
{
|
||||||
_IO_un_link (&new_f->fp.plus.file);
|
_IO_un_link (&new_f->fp.file);
|
||||||
free (new_f);
|
free (new_f);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
new_f->fp.plus.file._flags &= ~_IO_DELETE_DONT_CLOSE;
|
new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
|
||||||
|
|
||||||
new_f->fp.plus.file._IO_file_flags =
|
new_f->fp.file._IO_file_flags =
|
||||||
_IO_mask_flags (&new_f->fp.plus.file, read_write,
|
_IO_mask_flags (&new_f->fp.file, read_write,
|
||||||
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
||||||
|
|
||||||
return (_IO_FILE *) &new_f->fp;
|
return (_IO_FILE *) &new_f->fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DO_VERSIONING
|
||||||
|
strong_alias (_IO_new_fdopen, __new_fdopen)
|
||||||
|
default_symbol_version (_IO_new_fdopen, _IO_fdopen, GLIBC_2.1);
|
||||||
|
default_symbol_version (__new_fdopen, fdopen, GLIBC_2.1);
|
||||||
|
#else
|
||||||
# ifdef weak_alias
|
# ifdef weak_alias
|
||||||
weak_alias (_IO_fdopen, fdopen)
|
weak_alias (_IO_new_fdopen, _IO_fdopen)
|
||||||
|
weak_alias (_IO_new_fdopen, fdopen)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,11 +34,17 @@ _IO_fgets (buf, n, fp)
|
||||||
{
|
{
|
||||||
_IO_size_t count;
|
_IO_size_t count;
|
||||||
char *result;
|
char *result;
|
||||||
|
int old_error;
|
||||||
CHECK_FILE (fp, NULL);
|
CHECK_FILE (fp, NULL);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||||
_IO_flockfile (fp);
|
_IO_flockfile (fp);
|
||||||
|
/* This is very tricky since a file descriptor may be in the
|
||||||
|
non-blocking mode. The error flag doesn't mean much in this
|
||||||
|
case. We return an error only when there is a new error. */
|
||||||
|
old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
|
||||||
|
fp->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||||
count = _IO_getline (fp, buf, n - 1, '\n', 1);
|
count = _IO_getline (fp, buf, n - 1, '\n', 1);
|
||||||
if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
|
if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
@ -47,6 +53,7 @@ _IO_fgets (buf, n, fp)
|
||||||
buf[count] = '\0';
|
buf[count] = '\0';
|
||||||
result = buf;
|
result = buf;
|
||||||
}
|
}
|
||||||
|
fp->_IO_file_flags |= old_error;
|
||||||
_IO_cleanup_region_end (1);
|
_IO_cleanup_region_end (1);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ _IO_new_fopen (filename, mode)
|
||||||
{
|
{
|
||||||
struct locked_FILE
|
struct locked_FILE
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete fp;
|
struct _IO_FILE_plus fp;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
_IO_lock_t lock;
|
_IO_lock_t lock;
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,17 +44,17 @@ _IO_new_fopen (filename, mode)
|
||||||
if (new_f == NULL)
|
if (new_f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
new_f->fp.plus.file._lock = &new_f->lock;
|
new_f->fp.file._lock = &new_f->lock;
|
||||||
#endif
|
#endif
|
||||||
_IO_init (&new_f->fp.plus.file, 0);
|
_IO_init (&new_f->fp.file, 0);
|
||||||
_IO_JUMPS (&new_f->fp.plus.file) = &_IO_file_jumps;
|
_IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
|
||||||
_IO_file_init (&new_f->fp.plus.file);
|
_IO_file_init (&new_f->fp.file);
|
||||||
#if !_IO_UNIFIED_JUMPTABLES
|
#if !_IO_UNIFIED_JUMPTABLES
|
||||||
new_f->fp.plus.vtable = NULL;
|
new_f->fp.vtable = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (_IO_file_fopen (&new_f->fp.plus.file, filename, mode, 0) != NULL)
|
if (_IO_file_fopen (&new_f->fp.file, filename, mode, 0) != NULL)
|
||||||
return (_IO_FILE *) &new_f->fp.plus;
|
return (_IO_FILE *) &new_f->fp;
|
||||||
_IO_un_link (&new_f->fp.plus.file);
|
_IO_un_link (&new_f->fp.file);
|
||||||
free (new_f);
|
free (new_f);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ _IO_fopen64 (filename, mode)
|
||||||
#ifdef _G_OPEN64
|
#ifdef _G_OPEN64
|
||||||
struct locked_FILE
|
struct locked_FILE
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete fp;
|
struct _IO_FILE_plus fp;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
_IO_lock_t lock;
|
_IO_lock_t lock;
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,17 +45,17 @@ _IO_fopen64 (filename, mode)
|
||||||
if (new_f == NULL)
|
if (new_f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
new_f->fp.plus.file._lock = &new_f->lock;
|
new_f->fp.file._lock = &new_f->lock;
|
||||||
#endif
|
#endif
|
||||||
_IO_init (&new_f->fp.plus.file, 0);
|
_IO_init (&new_f->fp.file, 0);
|
||||||
_IO_JUMPS (&new_f->fp.plus.file) = &_IO_file_jumps;
|
_IO_JUMPS (&new_f->fp) = &_IO_file_jumps;
|
||||||
_IO_file_init (&new_f->fp.plus.file);
|
_IO_file_init (&new_f->fp.file);
|
||||||
#if !_IO_UNIFIED_JUMPTABLES
|
#if !_IO_UNIFIED_JUMPTABLES
|
||||||
new_f->fp.plus.vtable = NULL;
|
new_f->fp.plus.vtable = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (_IO_file_fopen (&new_f->fp.plus.file, filename, mode, 1) != NULL)
|
if (_IO_file_fopen (&new_f->fp.file, filename, mode, 1) != NULL)
|
||||||
return (_IO_FILE *) &new_f->fp.plus;
|
return (_IO_FILE *) &new_f->fp;
|
||||||
_IO_un_link (&new_f->fp.plus.file);
|
_IO_un_link (&new_f->fp.file);
|
||||||
free (new_f);
|
free (new_f);
|
||||||
return NULL;
|
return NULL;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -47,6 +47,11 @@ _IO_gets (buf)
|
||||||
count = 0;
|
count = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This is very tricky since a file descriptor may be in the
|
||||||
|
non-blocking mode. The error flag doesn't mean much in this
|
||||||
|
case. We return an error only when there is a new error. */
|
||||||
|
int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
|
||||||
|
_IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
|
||||||
buf[0] = (char) ch;
|
buf[0] = (char) ch;
|
||||||
count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
|
count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
|
||||||
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
|
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
|
||||||
|
@ -54,6 +59,8 @@ _IO_gets (buf)
|
||||||
retval = NULL;
|
retval = NULL;
|
||||||
goto unlock_return;
|
goto unlock_return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
_IO_stdin->_IO_file_flags |= old_error;
|
||||||
}
|
}
|
||||||
buf[count] = 0;
|
buf[count] = 0;
|
||||||
retval = buf;
|
retval = buf;
|
||||||
|
|
|
@ -11,6 +11,8 @@ extern int _IO_fclose __P((_IO_FILE*));
|
||||||
extern int _IO_new_fclose __P((_IO_FILE*));
|
extern int _IO_new_fclose __P((_IO_FILE*));
|
||||||
extern int _IO_old_fclose __P((_IO_FILE*));
|
extern int _IO_old_fclose __P((_IO_FILE*));
|
||||||
extern _IO_FILE *_IO_fdopen __P((int, const char*));
|
extern _IO_FILE *_IO_fdopen __P((int, const char*));
|
||||||
|
extern _IO_FILE *_IO_old_fdopen __P((int, const char*));
|
||||||
|
extern _IO_FILE *_IO_new_fdopen __P((int, const char*));
|
||||||
extern int _IO_fflush __P((_IO_FILE*));
|
extern int _IO_fflush __P((_IO_FILE*));
|
||||||
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
|
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
|
||||||
extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
|
extern int _IO_fgetpos64 __P((_IO_FILE*, _IO_fpos64_t*));
|
||||||
|
|
|
@ -74,7 +74,7 @@ extern int _IO_dup2 __P ((int fd, int fd2));
|
||||||
|
|
||||||
struct _IO_proc_file
|
struct _IO_proc_file
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete file;
|
struct _IO_FILE_plus file;
|
||||||
/* Following fields must match those in class procbuf (procbuf.h) */
|
/* Following fields must match those in class procbuf (procbuf.h) */
|
||||||
_IO_pid_t pid;
|
_IO_pid_t pid;
|
||||||
struct _IO_proc_file *next;
|
struct _IO_proc_file *next;
|
||||||
|
@ -174,7 +174,7 @@ _IO_popen (command, mode)
|
||||||
if (new_f == NULL)
|
if (new_f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
new_f->fpx.file.plus.file._lock = &new_f->lock;
|
new_f->fpx.file.file._lock = &new_f->lock;
|
||||||
#endif
|
#endif
|
||||||
fp = (_IO_FILE*)&new_f->fpx;
|
fp = (_IO_FILE*)&new_f->fpx;
|
||||||
_IO_init (fp, 0);
|
_IO_init (fp, 0);
|
||||||
|
|
|
@ -32,35 +32,35 @@ _IO_vdprintf (d, format, arg)
|
||||||
const char *format;
|
const char *format;
|
||||||
_IO_va_list arg;
|
_IO_va_list arg;
|
||||||
{
|
{
|
||||||
struct _IO_FILE_complete tmpfil;
|
struct _IO_FILE_plus tmpfil;
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
_IO_lock_t lock;
|
_IO_lock_t lock;
|
||||||
#endif
|
#endif
|
||||||
int done;
|
int done;
|
||||||
|
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
tmpfil.plus.file._lock = &lock;
|
tmpfil.file._lock = &lock;
|
||||||
#endif
|
#endif
|
||||||
_IO_init (&tmpfil.plus.file, 0);
|
_IO_init (&tmpfil.file, 0);
|
||||||
_IO_JUMPS (&tmpfil.plus.file) = &_IO_file_jumps;
|
_IO_JUMPS (&tmpfil.file) = &_IO_file_jumps;
|
||||||
_IO_file_init (&tmpfil.plus.file);
|
_IO_file_init (&tmpfil.file);
|
||||||
#if !_IO_UNIFIED_JUMPTABLES
|
#if !_IO_UNIFIED_JUMPTABLES
|
||||||
tmpfil.vtable = NULL;
|
tmpfil.vtable = NULL;
|
||||||
#endif
|
#endif
|
||||||
if (_IO_file_attach (&tmpfil.plus.file, d) == NULL)
|
if (_IO_file_attach (&tmpfil.file, d) == NULL)
|
||||||
{
|
{
|
||||||
_IO_un_link (&tmpfil.plus.file);
|
_IO_un_link (&tmpfil.file);
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
tmpfil.plus.file._flags &= ~_IO_DELETE_DONT_CLOSE;
|
tmpfil.file._flags &= ~_IO_DELETE_DONT_CLOSE;
|
||||||
|
|
||||||
tmpfil.plus.file._IO_file_flags =
|
tmpfil.file._IO_file_flags =
|
||||||
_IO_mask_flags (&tmpfil.plus.file, _IO_NO_READS,
|
_IO_mask_flags (&tmpfil.file, _IO_NO_READS,
|
||||||
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
||||||
|
|
||||||
done = _IO_vfprintf (&tmpfil.plus.file, format, arg);
|
done = _IO_vfprintf (&tmpfil.file, format, arg);
|
||||||
|
|
||||||
_IO_FINISH (&tmpfil.plus.file);
|
_IO_FINISH (&tmpfil.file);
|
||||||
|
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,22 +212,33 @@ struct _IO_FILE {
|
||||||
#define __HAVE_COLUMN /* temporary */
|
#define __HAVE_COLUMN /* temporary */
|
||||||
/* 1+column number of pbase(); 0 is unknown. */
|
/* 1+column number of pbase(); 0 is unknown. */
|
||||||
unsigned short _cur_column;
|
unsigned short _cur_column;
|
||||||
char _unused;
|
signed char _vtable_offset;
|
||||||
char _shortbuf[1];
|
char _shortbuf[1];
|
||||||
|
|
||||||
/* char* _save_gptr; char* _save_egptr; */
|
/* char* _save_gptr; char* _save_egptr; */
|
||||||
|
|
||||||
_IO_lock_t *_lock;
|
_IO_lock_t *_lock;
|
||||||
|
#ifdef _IO_USE_OLD_IO_FILE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _IO_FILE_complete
|
||||||
|
{
|
||||||
|
struct _IO_FILE _file;
|
||||||
|
#endif
|
||||||
|
#if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001
|
||||||
|
_IO_off64_t _offset;
|
||||||
|
int _unused2[16]; /* Make sure we don't get into trouble again. */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
typedef struct _IO_FILE _IO_FILE;
|
typedef struct _IO_FILE _IO_FILE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct _IO_FILE_complete;
|
struct _IO_FILE_plus;
|
||||||
extern struct _IO_FILE_complete _IO_2_1_stdin_;
|
extern struct _IO_FILE_plus _IO_2_1_stdin_;
|
||||||
extern struct _IO_FILE_complete _IO_2_1_stdout_;
|
extern struct _IO_FILE_plus _IO_2_1_stdout_;
|
||||||
extern struct _IO_FILE_complete _IO_2_1_stderr_;
|
extern struct _IO_FILE_plus _IO_2_1_stderr_;
|
||||||
#ifndef _LIBC
|
#ifndef _LIBC
|
||||||
#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))
|
#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))
|
||||||
#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))
|
#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))
|
||||||
|
|
|
@ -64,22 +64,34 @@ extern "C" {
|
||||||
* object being acted on (i.e. the 'this' parameter).
|
* object being acted on (i.e. the 'this' parameter).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if (!defined _IO_USE_OLD_IO_FILE \
|
||||||
|
&& (!defined _G_IO_NO_BACKWARD_COMPAT || _G_IO_NO_BACKWARD_COMPAT == 0))
|
||||||
|
# define _IO_JUMPS_OFFSET 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable
|
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable
|
||||||
|
#if _IO_JUMPS_OFFSET
|
||||||
|
# define _IO_JUMPS_FUNC(THIS) \
|
||||||
|
(*(struct _IO_jump_t **) ((void *) &((struct _IO_FILE_plus *) (THIS))->vtable\
|
||||||
|
+ (THIS)->_vtable_offset))
|
||||||
|
#else
|
||||||
|
# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS(THIS)
|
||||||
|
#endif
|
||||||
#ifdef _G_USING_THUNKS
|
#ifdef _G_USING_THUNKS
|
||||||
# define JUMP_FIELD(TYPE, NAME) TYPE NAME
|
# define JUMP_FIELD(TYPE, NAME) TYPE NAME
|
||||||
# define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC (THIS)
|
# define JUMP0(FUNC, THIS) _IO_JUMPS_FUNC(THIS)->FUNC (THIS)
|
||||||
# define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC (THIS, X1)
|
# define JUMP1(FUNC, THIS, X1) _IO_JUMPS_FUNC(THIS)->FUNC (THIS, X1)
|
||||||
# define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC (THIS, X1, X2)
|
# define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS_FUNC(THIS)->FUNC (THIS, X1, X2)
|
||||||
# define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC (THIS, X1,X2, X3)
|
# define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS_FUNC(THIS)->FUNC (THIS, X1,X2, X3)
|
||||||
# define JUMP_INIT(NAME, VALUE) VALUE
|
# define JUMP_INIT(NAME, VALUE) VALUE
|
||||||
# define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT (dummy2, 0)
|
# define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT (dummy2, 0)
|
||||||
#else
|
#else
|
||||||
/* These macros will change when we re-implement vtables to use "thunks"! */
|
/* These macros will change when we re-implement vtables to use "thunks"! */
|
||||||
# define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME
|
# define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME
|
||||||
# define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn (THIS)
|
# define JUMP0(FUNC, THIS) _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS)
|
||||||
# define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC.pfn (THIS, X1)
|
# define JUMP1(FUNC, THIS, X1) _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1)
|
||||||
# define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC.pfn (THIS, X1, X2)
|
# define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1, X2)
|
||||||
# define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC.pfn (THIS, X1,X2,X3)
|
# define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS_FUNC(THIS)->FUNC.pfn (THIS, X1,X2,X3)
|
||||||
# define JUMP_INIT(NAME, VALUE) {0, 0, VALUE}
|
# define JUMP_INIT(NAME, VALUE) {0, 0, VALUE}
|
||||||
# define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0)
|
# define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -267,17 +279,6 @@ struct _IO_FILE_plus
|
||||||
const struct _IO_jump_t *vtable;
|
const struct _IO_jump_t *vtable;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* We had to extend _IO_FILE but this isn't easily possible without
|
|
||||||
compatibility problems. So we mimic the C++ way to do this which
|
|
||||||
especially takes care that the position of the vtable stays the
|
|
||||||
same. */
|
|
||||||
struct _IO_FILE_complete
|
|
||||||
{
|
|
||||||
struct _IO_FILE_plus plus;
|
|
||||||
_IO_off64_t _offset;
|
|
||||||
int _unused2[16]; /* Make sure we don't get into trouble again. */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Generic functions */
|
/* Generic functions */
|
||||||
|
|
||||||
extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
|
extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
|
||||||
|
@ -374,6 +375,8 @@ extern int _IO_file_overflow __P ((_IO_FILE *, int));
|
||||||
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
|
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
|
||||||
extern void _IO_file_init __P ((_IO_FILE *));
|
extern void _IO_file_init __P ((_IO_FILE *));
|
||||||
extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
|
extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
|
||||||
|
extern _IO_FILE* _IO_file_open __P ((_IO_FILE *, const char *, int, int,
|
||||||
|
int, int));
|
||||||
extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *,
|
extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *,
|
||||||
int));
|
int));
|
||||||
extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
|
extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#ifndef _POSIX_SOURCE
|
#ifndef _POSIX_SOURCE
|
||||||
# define _POSIX_SOURCE
|
# define _POSIX_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
#define _IO_USE_OLD_IO_FILE
|
||||||
#include "libioP.h"
|
#include "libioP.h"
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -119,6 +120,8 @@ _IO_old_file_init (fp)
|
||||||
fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
|
fp->_IO_file_flags |= CLOSED_FILEBUF_FLAGS;
|
||||||
|
|
||||||
_IO_link_in(fp);
|
_IO_link_in(fp);
|
||||||
|
fp->_vtable_offset = ((int) sizeof (struct _IO_FILE)
|
||||||
|
- (int) sizeof (struct _IO_FILE_complete));
|
||||||
fp->_fileno = -1;
|
fp->_fileno = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
other reasons why the executable file might be covered by the GNU
|
other reasons why the executable file might be covered by the GNU
|
||||||
General Public License. */
|
General Public License. */
|
||||||
|
|
||||||
|
#define _IO_USE_OLD_IO_FILE
|
||||||
#include "libioP.h"
|
#include "libioP.h"
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -0,0 +1,135 @@
|
||||||
|
/* Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU IO Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2, or (at
|
||||||
|
your option) any later version.
|
||||||
|
|
||||||
|
This 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
|
||||||
|
General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this library; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||||
|
MA 02111-1307, USA.
|
||||||
|
|
||||||
|
As a special exception, if you link this library with files
|
||||||
|
compiled with a GNU compiler to produce an executable, this does
|
||||||
|
not cause the resulting executable to be covered by the GNU General
|
||||||
|
Public License. This exception does not however invalidate any
|
||||||
|
other reasons why the executable file might be covered by the GNU
|
||||||
|
General Public License. */
|
||||||
|
|
||||||
|
#define _IO_USE_OLD_IO_FILE
|
||||||
|
#ifdef __STDC__
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
#include "libioP.h"
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
#ifndef _IO_fcntl
|
||||||
|
#define _IO_fcntl fcntl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_IO_FILE *
|
||||||
|
_IO_old_fdopen (fd, mode)
|
||||||
|
int fd;
|
||||||
|
const char *mode;
|
||||||
|
{
|
||||||
|
int read_write;
|
||||||
|
int posix_mode = 0;
|
||||||
|
struct locked_FILE
|
||||||
|
{
|
||||||
|
struct _IO_FILE_plus fp;
|
||||||
|
#ifdef _IO_MTSAFE_IO
|
||||||
|
_IO_lock_t lock;
|
||||||
|
#endif
|
||||||
|
} *new_f;
|
||||||
|
int fd_flags;
|
||||||
|
|
||||||
|
switch (*mode++)
|
||||||
|
{
|
||||||
|
case 'r':
|
||||||
|
read_write = _IO_NO_WRITES;
|
||||||
|
break;
|
||||||
|
case 'w':
|
||||||
|
read_write = _IO_NO_READS;
|
||||||
|
break;
|
||||||
|
case 'a':
|
||||||
|
posix_mode = O_APPEND;
|
||||||
|
read_write = _IO_NO_READS|_IO_IS_APPENDING;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
MAYBE_SET_EINVAL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
|
||||||
|
read_write &= _IO_IS_APPENDING;
|
||||||
|
#ifdef F_GETFL
|
||||||
|
fd_flags = _IO_fcntl (fd, F_GETFL);
|
||||||
|
#ifndef O_ACCMODE
|
||||||
|
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
|
||||||
|
#endif
|
||||||
|
if (fd_flags == -1
|
||||||
|
|| ((fd_flags & O_ACCMODE) == O_RDONLY && !(read_write & _IO_NO_WRITES))
|
||||||
|
|| ((fd_flags & O_ACCMODE) == O_WRONLY && !(read_write & _IO_NO_READS)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* The May 93 draft of P1003.4/D14.1 (redesignated as 1003.1b)
|
||||||
|
[System Application Program Interface (API) Amendment 1:
|
||||||
|
Realtime Extensions], Rationale B.8.3.3
|
||||||
|
Open a Stream on a File Descriptor says:
|
||||||
|
|
||||||
|
Although not explicitly required by POSIX.1, a good
|
||||||
|
implementation of append ("a") mode would cause the
|
||||||
|
O_APPEND flag to be set.
|
||||||
|
|
||||||
|
(Historical implementations [such as Solaris2] do a one-time
|
||||||
|
seek in fdopen.)
|
||||||
|
|
||||||
|
However, we do not turn O_APPEND off if the mode is "w" (even
|
||||||
|
though that would seem consistent) because that would be more
|
||||||
|
likely to break historical programs.
|
||||||
|
*/
|
||||||
|
if ((posix_mode & O_APPEND) && !(fd_flags & O_APPEND))
|
||||||
|
{
|
||||||
|
#ifdef F_SETFL
|
||||||
|
if (_IO_fcntl (fd, F_SETFL, fd_flags | O_APPEND) == -1)
|
||||||
|
#endif
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
|
||||||
|
if (new_f == NULL)
|
||||||
|
return NULL;
|
||||||
|
#ifdef _IO_MTSAFE_IO
|
||||||
|
new_f->fp.file._lock = &new_f->lock;
|
||||||
|
#endif
|
||||||
|
_IO_init (&new_f->fp.file, 0);
|
||||||
|
_IO_JUMPS (&new_f->fp) = &_IO_old_file_jumps;
|
||||||
|
_IO_old_file_init (&new_f->fp.file);
|
||||||
|
#if !_IO_UNIFIED_JUMPTABLES
|
||||||
|
new_f->fp.vtable = NULL;
|
||||||
|
#endif
|
||||||
|
if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL)
|
||||||
|
{
|
||||||
|
_IO_un_link (&new_f->fp.file);
|
||||||
|
free (new_f);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;
|
||||||
|
|
||||||
|
new_f->fp.file._IO_file_flags =
|
||||||
|
_IO_mask_flags (&new_f->fp.file, read_write,
|
||||||
|
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
|
||||||
|
|
||||||
|
return (_IO_FILE *) &new_f->fp;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong_alias (_IO_old_fdopen, __old_fdopen)
|
||||||
|
symbol_version (_IO_old_fdopen, _IO_fdopen, GLIBC_2.0);
|
||||||
|
symbol_version (__old_fdopen, fdopen, GLIBC_2.0);
|
|
@ -23,6 +23,7 @@
|
||||||
other reasons why the executable file might be covered by the GNU
|
other reasons why the executable file might be covered by the GNU
|
||||||
General Public License. */
|
General Public License. */
|
||||||
|
|
||||||
|
#define _IO_USE_OLD_IO_FILE
|
||||||
#include "libioP.h"
|
#include "libioP.h"
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -30,23 +30,23 @@
|
||||||
so the objects defined are not valid C++ objects. On the other
|
so the objects defined are not valid C++ objects. On the other
|
||||||
hand, we don't need a C++ compiler to build this file.) */
|
hand, we don't need a C++ compiler to build this file.) */
|
||||||
|
|
||||||
|
#define _IO_USE_OLD_IO_FILE
|
||||||
#include "libioP.h"
|
#include "libioP.h"
|
||||||
|
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
#define DEF_STDFILE(INAME, NAME, FD, CHAIN, FLAGS) \
|
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|
||||||
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|
||||||
struct _IO_FILE_plus INAME \
|
struct _IO_FILE_plus NAME \
|
||||||
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_old_file_jumps};
|
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_old_file_jumps};
|
||||||
#else
|
#else
|
||||||
#define DEF_STDFILE(INAME, NAME, FD, CHAIN, FLAGS) \
|
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|
||||||
struct _IO_FILE_plus INAME \
|
struct _IO_FILE_plus NAME \
|
||||||
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_old_file_jumps};
|
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_old_file_jumps};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEF_STDFILE(_IO_stdin_, _IO_stdin_, 0, 0, _IO_NO_WRITES);
|
DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
|
||||||
DEF_STDFILE(_IO_stdout_, _IO_stdout_, 1, &_IO_stdin_.file,
|
DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_.file, _IO_NO_READS);
|
||||||
_IO_NO_READS);
|
DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_.file,
|
||||||
DEF_STDFILE(_IO_stderr_, _IO_stderr_, 2, &_IO_stdout_.file,
|
|
||||||
_IO_NO_READS+_IO_UNBUFFERED);
|
_IO_NO_READS+_IO_UNBUFFERED);
|
||||||
|
|
||||||
#if defined __GNUC__ && __GNUC__ >= 2
|
#if defined __GNUC__ && __GNUC__ >= 2
|
||||||
|
@ -78,9 +78,14 @@ _IO_check_libio ()
|
||||||
if (&_IO_stdin_used == NULL)
|
if (&_IO_stdin_used == NULL)
|
||||||
{
|
{
|
||||||
/* We are using the old one. */
|
/* We are using the old one. */
|
||||||
stdin = &_IO_stdin_.file;
|
_IO_stdin = stdin = &_IO_stdin_.file;
|
||||||
stdout = &_IO_stdout_.file;
|
_IO_stdout = stdout = &_IO_stdout_.file;
|
||||||
stderr = _IO_list_all = &_IO_stderr_.file;
|
_IO_stderr = stderr = _IO_list_all = &_IO_stderr_.file;
|
||||||
|
_IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset =
|
||||||
|
_IO_stderr->_vtable_offset = stdin->_vtable_offset =
|
||||||
|
stdout->_vtable_offset = stderr->_vtable_offset =
|
||||||
|
((int) sizeof (struct _IO_FILE)
|
||||||
|
- (int) sizeof (struct _IO_FILE_complete));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,20 +33,19 @@
|
||||||
#include "libioP.h"
|
#include "libioP.h"
|
||||||
|
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
#define DEF_STDFILE(INAME, NAME, FD, CHAIN, FLAGS) \
|
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|
||||||
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
|
||||||
struct _IO_FILE_complete INAME \
|
struct _IO_FILE_plus NAME \
|
||||||
= {{FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps},};
|
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps};
|
||||||
#else
|
#else
|
||||||
#define DEF_STDFILE(INAME, NAME, FD, CHAIN, FLAGS) \
|
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
|
||||||
struct _IO_FILE_complete INAME \
|
struct _IO_FILE_plus NAME \
|
||||||
= {{FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps},};
|
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEF_STDFILE(_IO_2_1_stdin_, _IO_stdin_, 0, 0, _IO_NO_WRITES);
|
DEF_STDFILE(_IO_2_1_stdin_, 0, 0, _IO_NO_WRITES);
|
||||||
DEF_STDFILE(_IO_2_1_stdout_, _IO_stdout_, 1, &_IO_2_1_stdin_.plus.file,
|
DEF_STDFILE(_IO_2_1_stdout_, 1, &_IO_2_1_stdin_.file, _IO_NO_READS);
|
||||||
_IO_NO_READS);
|
DEF_STDFILE(_IO_2_1_stderr_, 2, &_IO_2_1_stdout_.file,
|
||||||
DEF_STDFILE(_IO_2_1_stderr_, _IO_stderr_, 2, &_IO_2_1_stdout_.plus.file,
|
|
||||||
_IO_NO_READS+_IO_UNBUFFERED);
|
_IO_NO_READS+_IO_UNBUFFERED);
|
||||||
|
|
||||||
_IO_FILE *_IO_list_all = &_IO_2_1_stderr_.plus.file;
|
_IO_FILE *_IO_list_all = &_IO_2_1_stderr_.file;
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
#undef stdin
|
#undef stdin
|
||||||
#undef stdout
|
#undef stdout
|
||||||
#undef stderr
|
#undef stderr
|
||||||
FILE *stdin = &_IO_2_1_stdin_.plus.file;
|
FILE *stdin = &_IO_2_1_stdin_.file;
|
||||||
FILE *stdout = &_IO_2_1_stdout_.plus.file;
|
FILE *stdout = &_IO_2_1_stdout_.file;
|
||||||
FILE *stderr = &_IO_2_1_stderr_.plus.file;
|
FILE *stderr = &_IO_2_1_stderr_.file;
|
||||||
|
|
||||||
#undef _IO_stdin
|
#undef _IO_stdin
|
||||||
#undef _IO_stdout
|
#undef _IO_stdout
|
||||||
|
|
172
locale/C-ctype.c
172
locale/C-ctype.c
|
@ -95,92 +95,92 @@ const char _nl_C_LC_CTYPE_class[768] =
|
||||||
/* 0xfa */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
|
/* 0xfa */ "\002\000" "\002\000" "\002\000" "\002\000" "\002\000" "\002\000"
|
||||||
;
|
;
|
||||||
const char _nl_C_LC_CTYPE_class32[1024] =
|
const char _nl_C_LC_CTYPE_class32[1024] =
|
||||||
/* 0x00 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x00 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x03 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x03 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x06 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x06 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x09 */ "\000\000\003\040" "\000\000\002\040" "\000\000\002\040"
|
/* 0x09 */ "\003\040\000\000" "\002\040\000\000" "\002\040\000\000"
|
||||||
/* 0x0c */ "\000\000\002\040" "\000\000\002\040" "\000\000\002\000"
|
/* 0x0c */ "\002\040\000\000" "\002\040\000\000" "\002\000\000\000"
|
||||||
/* 0x0f */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x0f */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x12 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x12 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x15 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x15 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x18 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x18 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x1b */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x1b */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x1e */ "\000\000\002\000" "\000\000\002\000" "\000\000\001\140"
|
/* 0x1e */ "\002\000\000\000" "\002\000\000\000" "\001\140\000\000"
|
||||||
/* 0x21 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x21 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x24 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x24 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x27 */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x27 */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x2a */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x2a */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x2d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x2d */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x30 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
|
/* 0x30 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
|
||||||
/* 0x33 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
|
/* 0x33 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
|
||||||
/* 0x36 */ "\000\000\010\330" "\000\000\010\330" "\000\000\010\330"
|
/* 0x36 */ "\010\330\000\000" "\010\330\000\000" "\010\330\000\000"
|
||||||
/* 0x39 */ "\000\000\010\330" "\000\000\004\300" "\000\000\004\300"
|
/* 0x39 */ "\010\330\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x3c */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x3c */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x3f */ "\000\000\004\300" "\000\000\004\300" "\000\000\010\325"
|
/* 0x3f */ "\004\300\000\000" "\004\300\000\000" "\010\325\000\000"
|
||||||
/* 0x42 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\325"
|
/* 0x42 */ "\010\325\000\000" "\010\325\000\000" "\010\325\000\000"
|
||||||
/* 0x45 */ "\000\000\010\325" "\000\000\010\325" "\000\000\010\305"
|
/* 0x45 */ "\010\325\000\000" "\010\325\000\000" "\010\305\000\000"
|
||||||
/* 0x48 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x48 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x4b */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x4b */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x4e */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x4e */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x51 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x51 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x54 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x54 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x57 */ "\000\000\010\305" "\000\000\010\305" "\000\000\010\305"
|
/* 0x57 */ "\010\305\000\000" "\010\305\000\000" "\010\305\000\000"
|
||||||
/* 0x5a */ "\000\000\010\305" "\000\000\004\300" "\000\000\004\300"
|
/* 0x5a */ "\010\305\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x5d */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x5d */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x60 */ "\000\000\004\300" "\000\000\010\326" "\000\000\010\326"
|
/* 0x60 */ "\004\300\000\000" "\010\326\000\000" "\010\326\000\000"
|
||||||
/* 0x63 */ "\000\000\010\326" "\000\000\010\326" "\000\000\010\326"
|
/* 0x63 */ "\010\326\000\000" "\010\326\000\000" "\010\326\000\000"
|
||||||
/* 0x66 */ "\000\000\010\326" "\000\000\010\306" "\000\000\010\306"
|
/* 0x66 */ "\010\326\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x69 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x69 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x6c */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x6c */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x6f */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x6f */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x72 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x72 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x75 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x75 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x78 */ "\000\000\010\306" "\000\000\010\306" "\000\000\010\306"
|
/* 0x78 */ "\010\306\000\000" "\010\306\000\000" "\010\306\000\000"
|
||||||
/* 0x7b */ "\000\000\004\300" "\000\000\004\300" "\000\000\004\300"
|
/* 0x7b */ "\004\300\000\000" "\004\300\000\000" "\004\300\000\000"
|
||||||
/* 0x7e */ "\000\000\004\300" "\000\000\002\000" "\000\000\002\000"
|
/* 0x7e */ "\004\300\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x81 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x81 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x84 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x84 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x87 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x87 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x8a */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x8a */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x8d */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x8d */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x90 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x90 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x93 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x93 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x96 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x96 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x99 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x99 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x9c */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x9c */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0x9f */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0x9f */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xa2 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xa2 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xa5 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xa5 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xa8 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xa8 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xab */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xab */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xae */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xae */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xb1 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xb1 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xb4 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xb4 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xb7 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xb7 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xba */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xba */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xbd */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xbd */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xc0 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xc0 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xc3 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xc3 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xc6 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xc6 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xc9 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xc9 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xcc */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xcc */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xcf */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xcf */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xd2 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xd2 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xd5 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xd5 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xd8 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xd8 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xdb */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xdb */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xde */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xde */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xe1 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xe1 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xe4 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xe4 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xe7 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xe7 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xea */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xea */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xed */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xed */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xf0 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xf0 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xf3 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xf3 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xf6 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xf6 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xf9 */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xf9 */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xfc */ "\000\000\002\000" "\000\000\002\000" "\000\000\002\000"
|
/* 0xfc */ "\002\000\000\000" "\002\000\000\000" "\002\000\000\000"
|
||||||
/* 0xff */ "\000\000\002\000"
|
/* 0xff */ "\002\000\000\000"
|
||||||
;
|
;
|
||||||
const u_int32_t _nl_C_LC_CTYPE_toupper[384] =
|
const u_int32_t _nl_C_LC_CTYPE_toupper[384] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,9 @@ void *xrealloc (void *__ptr, size_t __n);
|
||||||
#define SWAPU16(w) \
|
#define SWAPU16(w) \
|
||||||
((((w) >> 8) & 0xff) | (((w) & 0xff) << 8))
|
((((w) >> 8) & 0xff) | (((w) & 0xff) << 8))
|
||||||
|
|
||||||
|
#define XSWAPU32(w) \
|
||||||
|
((((w) & 0xff00ff00) >> 8) | (((w) & 0xff00ff) << 8))
|
||||||
|
|
||||||
|
|
||||||
/* To be compatible with former implementations we for now restrict
|
/* To be compatible with former implementations we for now restrict
|
||||||
the number of bits for character classes to 16. When compatibility
|
the number of bits for character classes to 16. When compatibility
|
||||||
|
@ -63,7 +66,7 @@ void *xrealloc (void *__ptr, size_t __n);
|
||||||
#define char_class_t u_int16_t
|
#define char_class_t u_int16_t
|
||||||
#define CHAR_CLASS_TRANS SWAPU16
|
#define CHAR_CLASS_TRANS SWAPU16
|
||||||
#define char_class32_t u_int32_t
|
#define char_class32_t u_int32_t
|
||||||
#define CHAR_CLASS32_TRANS SWAPU32
|
#define CHAR_CLASS32_TRANS XSWAPU32
|
||||||
|
|
||||||
|
|
||||||
/* The real definition of the struct for the LC_CTYPE locale. */
|
/* The real definition of the struct for the LC_CTYPE locale. */
|
||||||
|
|
|
@ -24,10 +24,10 @@ subdir := malloc
|
||||||
all:
|
all:
|
||||||
|
|
||||||
dist-headers := malloc.h
|
dist-headers := malloc.h
|
||||||
headers := $(dist-headers) obstack.h
|
headers := $(dist-headers) obstack.h mcheck.h
|
||||||
tests := mallocbug
|
tests := mallocbug
|
||||||
|
|
||||||
distribute = thread-m.h mtrace.pl mcheck-init.c mcheck.h
|
distribute = thread-m.h mtrace.pl mcheck-init.c
|
||||||
|
|
||||||
# Things which get pasted together into gmalloc.c.
|
# Things which get pasted together into gmalloc.c.
|
||||||
gmalloc-routines := malloc morecore
|
gmalloc-routines := malloc morecore
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
@ -19,22 +19,9 @@
|
||||||
#ifndef _MCHECK_H
|
#ifndef _MCHECK_H
|
||||||
#define _MCHECK_H 1
|
#define _MCHECK_H 1
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include <features.h>
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
|
||||||
#undef __P
|
|
||||||
#define __P(args) args
|
|
||||||
#undef __ptr_t
|
|
||||||
#define __ptr_t void *
|
|
||||||
#else /* Not C++ or ANSI C. */
|
|
||||||
#undef __P
|
|
||||||
#define __P(args) ()
|
|
||||||
#undef __ptr_t
|
|
||||||
#define __ptr_t char *
|
|
||||||
#endif /* C++ or ANSI C. */
|
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
/* Return values for `mprobe': these are the kinds of inconsistencies that
|
/* Return values for `mprobe': these are the kinds of inconsistencies that
|
||||||
`mcheck' enables detection of. */
|
`mcheck' enables detection of. */
|
||||||
|
@ -63,8 +50,6 @@ extern enum mcheck_status mprobe __P ((__ptr_t __ptr));
|
||||||
extern void mtrace __P ((void));
|
extern void mtrace __P ((void));
|
||||||
extern void muntrace __P ((void));
|
extern void muntrace __P ((void));
|
||||||
|
|
||||||
#ifdef __cplusplus
|
__END_DECLS
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* mcheck.h */
|
#endif /* mcheck.h */
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern char *getenv ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static FILE *mallstream;
|
static FILE *mallstream;
|
||||||
static char mallenv[]= "MALLOC_TRACE";
|
static const char mallenv[]= "MALLOC_TRACE";
|
||||||
static char mallbuf[BUFSIZ]; /* Buffer for the output. */
|
static char mallbuf[BUFSIZ]; /* Buffer for the output. */
|
||||||
|
|
||||||
__libc_lock_define_initialized (static, lock);
|
__libc_lock_define_initialized (static, lock);
|
||||||
|
|
|
@ -178,15 +178,20 @@ close (DATA);
|
||||||
|
|
||||||
# Now print all remaining entries.
|
# Now print all remaining entries.
|
||||||
@addrs= keys %allocated;
|
@addrs= keys %allocated;
|
||||||
|
$anything=0;
|
||||||
if ($#addrs >= 0) {
|
if ($#addrs >= 0) {
|
||||||
print "\nNot freed memory:\n-----------------\n";
|
|
||||||
print ' ' x (@XXX@ - 7), "Address Size Caller\n";
|
|
||||||
foreach $addr (sort @addrs) {
|
foreach $addr (sort @addrs) {
|
||||||
if (defined $allocated{$addr}) {
|
if (defined $allocated{$addr}) {
|
||||||
|
if ($anything == 0) {
|
||||||
|
print "\nMemory not freed:\n-----------------\n";
|
||||||
|
print ' ' x (@XXX@ - 7), "Address Size Caller\n";
|
||||||
|
$anything=1;
|
||||||
|
}
|
||||||
printf ("%#0@XXX@x %#8x at %s\n", hex($addr), $allocated{$addr},
|
printf ("%#0@XXX@x %#8x at %s\n", hex($addr), $allocated{$addr},
|
||||||
$wherewas{$addr});
|
$wherewas{$addr});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print "No memory leaks.\n" if ($anything == 0);
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
|
@ -31,6 +31,7 @@ will be freed automatically. @xref{Variable Size Automatic}.
|
||||||
* Dynamic Allocation and C:: How to get different kinds of allocation in C.
|
* Dynamic Allocation and C:: How to get different kinds of allocation in C.
|
||||||
* Unconstrained Allocation:: The @code{malloc} facility allows fully general
|
* Unconstrained Allocation:: The @code{malloc} facility allows fully general
|
||||||
dynamic allocation.
|
dynamic allocation.
|
||||||
|
* Allocation Debugging:: Finding memory leaks and not freed memory.
|
||||||
* Obstacks:: Obstacks are less general than malloc
|
* Obstacks:: Obstacks are less general than malloc
|
||||||
but more efficient and convenient.
|
but more efficient and convenient.
|
||||||
* Variable Size Automatic:: Allocation of variable-sized blocks
|
* Variable Size Automatic:: Allocation of variable-sized blocks
|
||||||
|
@ -630,8 +631,12 @@ uses whenever it is called. You should define this function to look
|
||||||
like @code{malloc}; that is, like:
|
like @code{malloc}; that is, like:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
void *@var{function} (size_t @var{size})
|
void *@var{function} (size_t @var{size}, void *@var{caller})
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
The value of @var{caller} is the return address found on the stack when
|
||||||
|
the @code{malloc} function was called. This value allows to trace the
|
||||||
|
memory consumption of the program.
|
||||||
@end defvar
|
@end defvar
|
||||||
|
|
||||||
@comment malloc.h
|
@comment malloc.h
|
||||||
|
@ -642,8 +647,12 @@ uses whenever it is called. You should define this function to look
|
||||||
like @code{realloc}; that is, like:
|
like @code{realloc}; that is, like:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
void *@var{function} (void *@var{ptr}, size_t @var{size})
|
void *@var{function} (void *@var{ptr}, size_t @var{size}, void *@var{caller})
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
The value of @var{caller} is the return address found on the stack when
|
||||||
|
the @code{realloc} function was called. This value allows to trace the
|
||||||
|
memory consumption of the program.
|
||||||
@end defvar
|
@end defvar
|
||||||
|
|
||||||
@comment malloc.h
|
@comment malloc.h
|
||||||
|
@ -654,8 +663,12 @@ uses whenever it is called. You should define this function to look
|
||||||
like @code{free}; that is, like:
|
like @code{free}; that is, like:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
void @var{function} (void *@var{ptr})
|
void @var{function} (void *@var{ptr}, void *@var{caller})
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
The value of @var{caller} is the return address found on the stack when
|
||||||
|
the @code{free} function was called. This value allows to trace the
|
||||||
|
memory consumption of the program.
|
||||||
@end defvar
|
@end defvar
|
||||||
|
|
||||||
You must make sure that the function you install as a hook for one of
|
You must make sure that the function you install as a hook for one of
|
||||||
|
@ -797,13 +810,13 @@ Tell @code{malloc} to perform occasional consistency checks on
|
||||||
dynamically allocated memory, and to call @var{abortfn} when an
|
dynamically allocated memory, and to call @var{abortfn} when an
|
||||||
inconsistency is found. @xref{Heap Consistency Checking}.
|
inconsistency is found. @xref{Heap Consistency Checking}.
|
||||||
|
|
||||||
@item void *(*__malloc_hook) (size_t @var{size})
|
@item void *(*__malloc_hook) (size_t @var{size}, void *@var{caller})
|
||||||
A pointer to a function that @code{malloc} uses whenever it is called.
|
A pointer to a function that @code{malloc} uses whenever it is called.
|
||||||
|
|
||||||
@item void *(*__realloc_hook) (void *@var{ptr}, size_t @var{size})
|
@item void *(*__realloc_hook) (void *@var{ptr}, size_t @var{size}, void *@var{caller})
|
||||||
A pointer to a function that @code{realloc} uses whenever it is called.
|
A pointer to a function that @code{realloc} uses whenever it is called.
|
||||||
|
|
||||||
@item void (*__free_hook) (void *@var{ptr})
|
@item void (*__free_hook) (void *@var{ptr}, void *@var{caller})
|
||||||
A pointer to a function that @code{free} uses whenever it is called.
|
A pointer to a function that @code{free} uses whenever it is called.
|
||||||
|
|
||||||
@item struct mallinfo mallinfo (void)
|
@item struct mallinfo mallinfo (void)
|
||||||
|
@ -811,6 +824,240 @@ Return information about the current dynamic memory usage.
|
||||||
@xref{Statistics of Malloc}.
|
@xref{Statistics of Malloc}.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
|
@node Allocation Debugging
|
||||||
|
@section Allocation Debugging
|
||||||
|
@cindex allocation debugging
|
||||||
|
@cindex malloc debugger
|
||||||
|
|
||||||
|
An complicated task when programming with languages which do not use
|
||||||
|
garbage collected dynamic memory allocation is to find memory leaks.
|
||||||
|
Long running programs must assure that dynamically allocated objects are
|
||||||
|
freed at the end of their lifetime. If this does not happen the system
|
||||||
|
runs out of memory, sooner or later.
|
||||||
|
|
||||||
|
The @code{malloc} implementation in the GNU C library provides some
|
||||||
|
simple means to detect sich leaks and provide some information to find
|
||||||
|
the location. To do this the application must be started in a special
|
||||||
|
mode which is enabled by an environment variable. There are no speed
|
||||||
|
penalties if the program is compiled in preparation of the debugging if
|
||||||
|
the debug mode is not enabled.
|
||||||
|
|
||||||
|
@menu
|
||||||
|
* Tracing malloc:: How to install the tracing functionality.
|
||||||
|
* Using the Memory Debugger:: Example programs excerpts.
|
||||||
|
* Tips for the Memory Debugger:: Some more or less clever ideas.
|
||||||
|
* Interpreting the traces:: What do all these lines mean?
|
||||||
|
@end menu
|
||||||
|
|
||||||
|
@node Tracing malloc
|
||||||
|
@subsection How to install the tracing functionality
|
||||||
|
|
||||||
|
@comment mcheck.h
|
||||||
|
@comment GNU
|
||||||
|
@deftypefun void mtrace (void)
|
||||||
|
When the @code{mtrace} function is called it looks for an environment
|
||||||
|
variable named @code{MALLOC_TRACE}. This variable is supposed to
|
||||||
|
contain a valid file name. The user must have write access. If the
|
||||||
|
file already exists it is truncated. If the environment variable is not
|
||||||
|
set or it does not name a valid file which can be opened for writing
|
||||||
|
nothing is done. The behaviour of @code{malloc} etc. is not changed.
|
||||||
|
For obvious reasons this also happens if the application is install SUID
|
||||||
|
or SGID.
|
||||||
|
|
||||||
|
If the named file is successfully opened @code{mtrace} installs special
|
||||||
|
handlers for the functions @code{malloc}, @code{realloc}, and
|
||||||
|
@code{free} (@pxref{Hooks for Malloc}). From now on all uses of these
|
||||||
|
functions are traced and protocolled into the file. There is now of
|
||||||
|
course a speed penalty for all calls to the traced functions so that the
|
||||||
|
tracing should not be enabled during their normal use.
|
||||||
|
|
||||||
|
This function is a GNU extension and generally not available on other
|
||||||
|
systems. The prototype can be found in @file{mcheck.h}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@comment mcheck.h
|
||||||
|
@comment GNU
|
||||||
|
@deftypefun void muntrace (void)
|
||||||
|
The @code{muntrace} function can be called after @code{mtrace} was used
|
||||||
|
to enable tracing the @code{malloc} calls. If no (succesful) call of
|
||||||
|
@code{mtrace} was made @code{muntrace} does nothing.
|
||||||
|
|
||||||
|
Otherwise it deinstalls the handlers for @code{malloc}, @code{realloc},
|
||||||
|
and @code{free} and then closes the protocol file. No calls are
|
||||||
|
protocolled anymore and the programs runs again with the full speed.
|
||||||
|
|
||||||
|
This function is a GNU extension and generally not available on other
|
||||||
|
systems. The prototype can be found in @file{mcheck.h}.
|
||||||
|
@end deftypefun
|
||||||
|
|
||||||
|
@node Using the Memory Debugger
|
||||||
|
@subsection Example programs excerpts
|
||||||
|
|
||||||
|
Even though the tracing functionality does not influence the runtime
|
||||||
|
behaviour of the program it is no wise idea to call @code{mtrace} in all
|
||||||
|
programs. Just imagine you debug a program using @code{mtrace} and all
|
||||||
|
other programs used in the debug sessions also trace their @code{malloc}
|
||||||
|
calls. The output file would be the same for all programs and so is
|
||||||
|
unusable. Therefore on should call @code{mtrace} only if compiled for
|
||||||
|
debugging. A program could therefore start like this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
#include <mcheck.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
@{
|
||||||
|
#ifdef DEBUGGING
|
||||||
|
mtrace ();
|
||||||
|
#endif
|
||||||
|
@dots{}
|
||||||
|
@}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
This is all what is needed if you want to trace the calls during the
|
||||||
|
whole runtime of the program. Alternatively you can stop the tracing at
|
||||||
|
any time with a call to @code{muntrace}. It is even possible to restart
|
||||||
|
the tracing again with a new call to @code{mtrace}. But this can course
|
||||||
|
unreliable results since there are possibly calls of the functions which
|
||||||
|
are not called. Please note that not only the application uses the
|
||||||
|
traced functions, also libraries (including the C library itself) use
|
||||||
|
this function.
|
||||||
|
|
||||||
|
This last point is also why it is no good idea to call @code{muntrace}
|
||||||
|
before the program terminated. The libraries are informed about the
|
||||||
|
termination of the program only after the program returns from
|
||||||
|
@code{main} or calls @code{exit} and so cannot free the memory they use
|
||||||
|
before this time.
|
||||||
|
|
||||||
|
So the best thing one can do is to call @code{mtrace} as the very first
|
||||||
|
function in the program and never call @code{muntrace}. So the program
|
||||||
|
traces almost all uses of the @code{malloc} functions (except those
|
||||||
|
calls which are executed by constructors of the program or used
|
||||||
|
libraries).
|
||||||
|
|
||||||
|
@node Tips for the Memory Debugger
|
||||||
|
@subsection Some more or less clever ideas
|
||||||
|
|
||||||
|
You know the situation. The program is prepared for debugging and in
|
||||||
|
all debugging sessions it runs well. But once it is started without
|
||||||
|
debugging the error shows up. In our situation here: the memory leaks
|
||||||
|
becomes visible only when we just turned off the debugging. If you
|
||||||
|
foresee such situations you can still win. Simply use something
|
||||||
|
equivalent to the following little program:
|
||||||
|
|
||||||
|
@example
|
||||||
|
#include <mcheck.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
enable (int sig)
|
||||||
|
@{
|
||||||
|
mtrace ();
|
||||||
|
signal (SIGUSR1, enable);
|
||||||
|
@}
|
||||||
|
|
||||||
|
static void
|
||||||
|
disable (int sig)
|
||||||
|
@{
|
||||||
|
muntrace ();
|
||||||
|
signal (SIGUSR2, disable);
|
||||||
|
@}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
@{
|
||||||
|
@dots{}
|
||||||
|
|
||||||
|
signal (SIGUSR1, enable);
|
||||||
|
signal (SIGUSR2, disable);
|
||||||
|
|
||||||
|
@dots{}
|
||||||
|
@}
|
||||||
|
@end example
|
||||||
|
|
||||||
|
I.e., the user can start the memory debugger any time he wants if the
|
||||||
|
program was started with @code{MALLOC_TRACE} set in the environment.
|
||||||
|
The output will of course not show the allocations which happened before
|
||||||
|
the first signal but if there is a memory leak this will show up
|
||||||
|
nevertheless.
|
||||||
|
|
||||||
|
@node Interpreting the traces
|
||||||
|
@subsection Interpreting the traces
|
||||||
|
|
||||||
|
If you take a look at the output it will look similar to this:
|
||||||
|
|
||||||
|
@example
|
||||||
|
= Start
|
||||||
|
@ [0x8048209] - 0x8064cc8
|
||||||
|
@ [0x8048209] - 0x8064ce0
|
||||||
|
@ [0x8048209] - 0x8064cf8
|
||||||
|
@ [0x80481eb] + 0x8064c48 0x14
|
||||||
|
@ [0x80481eb] + 0x8064c60 0x14
|
||||||
|
@ [0x80481eb] + 0x8064c78 0x14
|
||||||
|
@ [0x80481eb] + 0x8064c90 0x14
|
||||||
|
= End
|
||||||
|
@end example
|
||||||
|
|
||||||
|
What this all means is not really important since the trace file is not
|
||||||
|
meant to be read by a human. Therefore no attention is payed to good
|
||||||
|
readability. Instead there is a program which comes with the GNU C
|
||||||
|
library which interprets the traces and outputs a summary in on
|
||||||
|
user-friendly way. The program is called @code{mtrace} (it is in fact a
|
||||||
|
Perl script) and it takes one or two arguments. In any case the name of
|
||||||
|
the file with the trace must be specified. If an optional precedes the
|
||||||
|
name of the trace file this must be the name of the program which
|
||||||
|
generated the trace.
|
||||||
|
|
||||||
|
@example
|
||||||
|
drepper$ mtrace tst-mtrace log
|
||||||
|
No memory leaks.
|
||||||
|
@end example
|
||||||
|
|
||||||
|
In this case the program @code{tst-mtrace} was run and it produced a
|
||||||
|
trace file @file{log}. The message printed by @code{mtrace} shows there
|
||||||
|
are no problems with the code, all allocated memory was freed
|
||||||
|
afterwards.
|
||||||
|
|
||||||
|
If we call @code{mtrace} on the example trace given above we would get a
|
||||||
|
different outout:
|
||||||
|
|
||||||
|
@example
|
||||||
|
drepper$ mtrace errlog
|
||||||
|
- 0x08064cc8 Free 2 was never alloc'd 0x8048209
|
||||||
|
- 0x08064ce0 Free 3 was never alloc'd 0x8048209
|
||||||
|
- 0x08064cf8 Free 4 was never alloc'd 0x8048209
|
||||||
|
|
||||||
|
Memory not freed:
|
||||||
|
-----------------
|
||||||
|
Address Size Caller
|
||||||
|
0x08064c48 0x14 at 0x80481eb
|
||||||
|
0x08064c60 0x14 at 0x80481eb
|
||||||
|
0x08064c78 0x14 at 0x80481eb
|
||||||
|
0x08064c90 0x14 at 0x80481eb
|
||||||
|
@end example
|
||||||
|
|
||||||
|
We have called @code{mtrace} with only one argument and so the script
|
||||||
|
has no chance to find out what is meant with the addresses given in the
|
||||||
|
trace. We can do better:
|
||||||
|
|
||||||
|
@example
|
||||||
|
drepper$ mtrace tst-mtrace errlog
|
||||||
|
- 0x08064cc8 Free 2 was never alloc'd /home/drepper/tst-mtrace.c:39
|
||||||
|
- 0x08064ce0 Free 3 was never alloc'd /home/drepper/tst-mtrace.c:39
|
||||||
|
- 0x08064cf8 Free 4 was never alloc'd /home/drepper/tst-mtrace.c:39
|
||||||
|
|
||||||
|
Memory not freed:
|
||||||
|
-----------------
|
||||||
|
Address Size Caller
|
||||||
|
0x08064c48 0x14 at /home/drepper/tst-mtrace.c:33
|
||||||
|
0x08064c60 0x14 at /home/drepper/tst-mtrace.c:33
|
||||||
|
0x08064c78 0x14 at /home/drepper/tst-mtrace.c:33
|
||||||
|
0x08064c90 0x14 at /home/drepper/tst-mtrace.c:33
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Suddenly the output makes much more sense and the user can see
|
||||||
|
immediately where the function calls causing the trouble can be found.
|
||||||
|
|
||||||
@node Obstacks
|
@node Obstacks
|
||||||
@section Obstacks
|
@section Obstacks
|
||||||
@cindex obstacks
|
@cindex obstacks
|
||||||
|
@ -1442,7 +1689,7 @@ source file that uses @code{obstack_init} (@pxref{Creating Obstacks}).
|
||||||
Most often they are defined as macros like this:
|
Most often they are defined as macros like this:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
#define obstack_chunk_alloc xmalloc
|
#define obstack_chunk_alloc malloc
|
||||||
#define obstack_chunk_free free
|
#define obstack_chunk_free free
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
|
|
@ -3148,7 +3148,6 @@ The return value is @code{0} on success and @code{-1} on failure. If
|
||||||
@code{sigaltstack} fails, it sets @code{errno} to one of these values:
|
@code{sigaltstack} fails, it sets @code{errno} to one of these values:
|
||||||
|
|
||||||
@table @code
|
@table @code
|
||||||
@item
|
|
||||||
@item EINVAL
|
@item EINVAL
|
||||||
You tried to disable a stack that was in fact currently in use.
|
You tried to disable a stack that was in fact currently in use.
|
||||||
|
|
||||||
|
|
299
math/libm-test.c
299
math/libm-test.c
|
@ -847,6 +847,9 @@ acos_test (void)
|
||||||
check ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6 * 2.0);
|
check ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6 * 2.0);
|
||||||
check ("acos (-0.5) == 2*pi/3", FUNC(acos) (-0.5), M_PI_6 * 4.0);
|
check ("acos (-0.5) == 2*pi/3", FUNC(acos) (-0.5), M_PI_6 * 4.0);
|
||||||
|
|
||||||
|
check_eps ("acos (0.7) == 0.795398830...", FUNC(acos) (0.7),
|
||||||
|
0.7953988301841435554L, CHOOSE(7e-17L, 0, 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -864,6 +867,8 @@ acosh_test (void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
check ("acosh(1) == 0", FUNC(acosh) (1), 0);
|
check ("acosh(1) == 0", FUNC(acosh) (1), 0);
|
||||||
|
check ("acosh(7) == 2.633915793...", FUNC(acosh) (7),
|
||||||
|
2.6339157938496334172L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -892,7 +897,8 @@ asin_test (void)
|
||||||
CHOOSE(3.5e-18, 0, 2e-7));
|
CHOOSE(3.5e-18, 0, 2e-7));
|
||||||
check ("asin (1.0) == pi/2", FUNC(asin) (1.0), M_PI_2);
|
check ("asin (1.0) == pi/2", FUNC(asin) (1.0), M_PI_2);
|
||||||
check ("asin (-1.0) == -pi/2", FUNC(asin) (-1.0), -M_PI_2);
|
check ("asin (-1.0) == -pi/2", FUNC(asin) (-1.0), -M_PI_2);
|
||||||
|
check_eps ("asin (0.7) == 0.775397496...", FUNC(asin) (0.7),
|
||||||
|
0.7753974966107530637L, CHOOSE(7e-17L, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -906,6 +912,8 @@ asinh_test (void)
|
||||||
check_isinfp ("asinh(+inf) == +inf", FUNC(asinh) (plus_infty));
|
check_isinfp ("asinh(+inf) == +inf", FUNC(asinh) (plus_infty));
|
||||||
check_isinfn ("asinh(-inf) == -inf", FUNC(asinh) (minus_infty));
|
check_isinfn ("asinh(-inf) == -inf", FUNC(asinh) (minus_infty));
|
||||||
#endif
|
#endif
|
||||||
|
check_eps ("asinh(0.7) == 0.652666566...", FUNC(asinh) (0.7),
|
||||||
|
0.652666566082355786L, CHOOSE(4e-17L, 0, 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -922,6 +930,8 @@ atan_test (void)
|
||||||
check ("atan (1) == pi/4", FUNC(atan) (1), M_PI_4);
|
check ("atan (1) == pi/4", FUNC(atan) (1), M_PI_4);
|
||||||
check ("atan (-1) == -pi/4", FUNC(atan) (1), M_PI_4);
|
check ("atan (-1) == -pi/4", FUNC(atan) (1), M_PI_4);
|
||||||
|
|
||||||
|
check_eps ("atan (0.7) == 0.610725964...", FUNC(atan) (0.7),
|
||||||
|
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1026,6 +1036,8 @@ atanh_test (void)
|
||||||
FUNC(atanh) (x), INVALID_EXCEPTION, x);
|
FUNC(atanh) (x), INVALID_EXCEPTION, x);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
check_eps ("atanh(0.7) == 0.867300527...", FUNC(atanh) (0.7),
|
||||||
|
0.8673005276940531944L, CHOOSE(9e-17L, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1047,6 +1059,9 @@ cbrt_test (void)
|
||||||
CHOOSE (3e-16L, 5e-16, 0));
|
CHOOSE (3e-16L, 5e-16, 0));
|
||||||
check_eps ("cbrt (0.970299) == 0.99", FUNC(cbrt) (0.970299), 0.99,
|
check_eps ("cbrt (0.970299) == 0.99", FUNC(cbrt) (0.970299), 0.99,
|
||||||
CHOOSE (2e-17L, 0, 0));
|
CHOOSE (2e-17L, 0, 0));
|
||||||
|
check_eps ("cbrt (0.7) == .8879040017...", FUNC(cbrt) (0.7),
|
||||||
|
0.8879040017426007084L, CHOOSE(2e-17L, 2e-16, 0));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1083,6 +1098,8 @@ cos_test (void)
|
||||||
check_eps ("cos (pi/2) == 0", FUNC(cos) (M_PI_2),
|
check_eps ("cos (pi/2) == 0", FUNC(cos) (M_PI_2),
|
||||||
0, CHOOSE (1e-19L, 1e-16L, 1e-7L));
|
0, CHOOSE (1e-19L, 1e-16L, 1e-7L));
|
||||||
|
|
||||||
|
check_eps ("cos (0.7) == 0.7648421872...", FUNC(cos) (0.7),
|
||||||
|
0.7648421872844884262L, CHOOSE(3e-17, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1095,6 +1112,9 @@ cosh_test (void)
|
||||||
check_isinfp ("cosh (+inf) == +inf", FUNC(cosh) (plus_infty));
|
check_isinfp ("cosh (+inf) == +inf", FUNC(cosh) (plus_infty));
|
||||||
check_isinfp ("cosh (-inf) == +inf", FUNC(cosh) (minus_infty));
|
check_isinfp ("cosh (-inf) == +inf", FUNC(cosh) (minus_infty));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
check_eps ("cosh (0.7) == 1.2551690056...", FUNC(cosh) (0.7),
|
||||||
|
1.255169005630943018L, CHOOSE(4e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1111,6 +1131,9 @@ erf_test (void)
|
||||||
check ("erf (-0) == -0", FUNC(erf) (minus_zero), minus_zero);
|
check ("erf (-0) == -0", FUNC(erf) (minus_zero), minus_zero);
|
||||||
check ("erf (+inf) == +1", FUNC(erf) (plus_infty), 1);
|
check ("erf (+inf) == +1", FUNC(erf) (plus_infty), 1);
|
||||||
check ("erf (-inf) == -1", FUNC(erf) (minus_infty), -1);
|
check ("erf (-inf) == -1", FUNC(erf) (minus_infty), -1);
|
||||||
|
|
||||||
|
check_eps ("erf (0.7) == 0.6778011938...", FUNC(erf) (0.7),
|
||||||
|
0.67780119383741847297L, CHOOSE(0, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1127,6 +1150,9 @@ erfc_test (void)
|
||||||
check ("erfc (-inf) == 2", FUNC(erfc) (minus_infty), 2.0);
|
check ("erfc (-inf) == 2", FUNC(erfc) (minus_infty), 2.0);
|
||||||
check ("erfc (+0) == 1", FUNC(erfc) (0.0), 1.0);
|
check ("erfc (+0) == 1", FUNC(erfc) (0.0), 1.0);
|
||||||
check ("erfc (-0) == 1", FUNC(erfc) (minus_zero), 1.0);
|
check ("erfc (-0) == 1", FUNC(erfc) (minus_zero), 1.0);
|
||||||
|
|
||||||
|
check_eps ("erfc (0.7) == 0.3221988061...", FUNC(erfc) (0.7),
|
||||||
|
0.32219880616258152702L, CHOOSE(0, 6e-17, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1144,6 +1170,8 @@ exp_test (void)
|
||||||
|
|
||||||
check ("exp (2) == e^2", FUNC(exp) (2), M_E * M_E);
|
check ("exp (2) == e^2", FUNC(exp) (2), M_E * M_E);
|
||||||
check ("exp (3) == e^3", FUNC(exp) (3), M_E * M_E * M_E);
|
check ("exp (3) == e^3", FUNC(exp) (3), M_E * M_E * M_E);
|
||||||
|
check_eps ("exp (0.7) == 2.0137527074...", FUNC(exp) (0.7),
|
||||||
|
2.0137527074704765216L, CHOOSE(9e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1165,6 +1193,8 @@ exp2_test (void)
|
||||||
check ("exp2 (-1) == 0.5", FUNC(exp2) (-1), 0.5);
|
check ("exp2 (-1) == 0.5", FUNC(exp2) (-1), 0.5);
|
||||||
check_isinfp ("exp2 (1e6) == +inf", FUNC(exp2) (1e6));
|
check_isinfp ("exp2 (1e6) == +inf", FUNC(exp2) (1e6));
|
||||||
check ("exp2 (-1e6) == 0", FUNC(exp2) (-1e6), 0);
|
check ("exp2 (-1e6) == 0", FUNC(exp2) (-1e6), 0);
|
||||||
|
check_eps ("exp2 (0.7) == 1.6245047927...", FUNC(exp2) (0.7),
|
||||||
|
1.6245047927124710452L, CHOOSE(6e-17L, 0, 6e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1398,8 +1428,10 @@ gamma_test (void)
|
||||||
check_isnan_exc ("gamma (-inf) == NaN plus invalid exception",
|
check_isnan_exc ("gamma (-inf) == NaN plus invalid exception",
|
||||||
FUNC(gamma) (minus_infty), INVALID_EXCEPTION);
|
FUNC(gamma) (minus_infty), INVALID_EXCEPTION);
|
||||||
|
|
||||||
|
#ifdef TODO
|
||||||
check_eps ("gamma (0.5) == sqrt(pi)", FUNC(gamma) (0.5), FUNC(sqrt) (M_PI),
|
check_eps ("gamma (0.5) == sqrt(pi)", FUNC(gamma) (0.5), FUNC(sqrt) (M_PI),
|
||||||
CHOOSE (0, 5e-16, 2e-7));
|
CHOOSE (0, 5e-16, 2e-7));
|
||||||
|
#endif
|
||||||
check_eps ("gamma (-0.5) == -2*sqrt(pi)", FUNC(gamma) (-0.5),
|
check_eps ("gamma (-0.5) == -2*sqrt(pi)", FUNC(gamma) (-0.5),
|
||||||
-2*FUNC(sqrt) (M_PI), CHOOSE (0, 5e-16, 3e-7));
|
-2*FUNC(sqrt) (M_PI), CHOOSE (0, 5e-16, 3e-7));
|
||||||
|
|
||||||
|
@ -1513,6 +1545,8 @@ log_test (void)
|
||||||
check ("log (2) == M_LN2", FUNC(log) (2), M_LN2);
|
check ("log (2) == M_LN2", FUNC(log) (2), M_LN2);
|
||||||
check_eps ("log (10) == M_LN10", FUNC(log) (10), M_LN10,
|
check_eps ("log (10) == M_LN10", FUNC(log) (10), M_LN10,
|
||||||
CHOOSE (1e-18L, 0, 0));
|
CHOOSE (1e-18L, 0, 0));
|
||||||
|
check_eps ("log (0.7) == -0.3566749439...", FUNC(log) (0.7),
|
||||||
|
-0.35667494393873237891L, CHOOSE(7e-17L, 6e-17, 3e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1540,6 +1574,8 @@ log10_test (void)
|
||||||
check ("log10 (10000) == 4", FUNC(log10) (10000.0), 4);
|
check ("log10 (10000) == 4", FUNC(log10) (10000.0), 4);
|
||||||
check_eps ("log10 (e) == M_LOG10E", FUNC(log10) (M_E), M_LOG10E,
|
check_eps ("log10 (e) == M_LOG10E", FUNC(log10) (M_E), M_LOG10E,
|
||||||
CHOOSE (1e-18, 0, 9e-8));
|
CHOOSE (1e-18, 0, 9e-8));
|
||||||
|
check_eps ("log10 (0.7) == -0.1549019599...", FUNC(log10) (0.7),
|
||||||
|
-0.15490195998574316929L, CHOOSE(3e-17L, 3e-17, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1582,6 +1618,8 @@ log2_test (void)
|
||||||
check ("log2 (2) == 1", FUNC(log2) (2.0), 1);
|
check ("log2 (2) == 1", FUNC(log2) (2.0), 1);
|
||||||
check_eps ("log2 (16) == 4", FUNC(log2) (16.0), 4, CHOOSE (1e-18L, 0, 0));
|
check_eps ("log2 (16) == 4", FUNC(log2) (16.0), 4, CHOOSE (1e-18L, 0, 0));
|
||||||
check ("log2 (256) == 8", FUNC(log2) (256.0), 8);
|
check ("log2 (256) == 8", FUNC(log2) (256.0), 8);
|
||||||
|
check_eps ("log2 (0.7) == -0.5145731728...", FUNC(log2) (0.7),
|
||||||
|
-0.51457317282975824043L, CHOOSE(1e-16L, 2e-16, 6e-8));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1750,6 +1788,8 @@ sin_test (void)
|
||||||
-0.5, CHOOSE (4e-18L, 0, 0));
|
-0.5, CHOOSE (4e-18L, 0, 0));
|
||||||
check ("sin (pi/2) == 1", FUNC(sin) (M_PI_2), 1);
|
check ("sin (pi/2) == 1", FUNC(sin) (M_PI_2), 1);
|
||||||
check ("sin (-pi/2) == -1", FUNC(sin) (-M_PI_2), -1);
|
check ("sin (-pi/2) == -1", FUNC(sin) (-M_PI_2), -1);
|
||||||
|
check_eps ("sin (0.7) == 0.6442176872...", FUNC(sin) (0.7),
|
||||||
|
0.64421768723769105367L, CHOOSE(4e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1764,6 +1804,9 @@ sinh_test (void)
|
||||||
check_isinfp ("sinh (+inf) == +inf", FUNC(sinh) (plus_infty));
|
check_isinfp ("sinh (+inf) == +inf", FUNC(sinh) (plus_infty));
|
||||||
check_isinfn ("sinh (-inf) == -inf", FUNC(sinh) (minus_infty));
|
check_isinfn ("sinh (-inf) == -inf", FUNC(sinh) (minus_infty));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
check_eps ("sinh (0.7) == 0.7585837018...", FUNC(sinh) (0.7),
|
||||||
|
0.75858370183953350346L, CHOOSE(6e-17L, 0, 6e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1816,7 +1859,11 @@ sincos_test (void)
|
||||||
check_eps ("sincos (pi/3, &sin, &cos) puts 0.5 in cos", cos_res, 0.5,
|
check_eps ("sincos (pi/3, &sin, &cos) puts 0.5 in cos", cos_res, 0.5,
|
||||||
CHOOSE (5e-18L, 1e-15, 1e-7));
|
CHOOSE (5e-18L, 1e-15, 1e-7));
|
||||||
|
|
||||||
|
FUNC(sincos) (0.7, &sin_res, &cos_res);
|
||||||
|
check_eps ("sincos (0.7, &sin, &cos) puts 0.6442176872... in sin", sin_res,
|
||||||
|
0.64421768723769105367L, CHOOSE(4e-17L, 0, 0));
|
||||||
|
check_eps ("sincos (0.7, &sin, &cos) puts 0.7648421872... in cos", cos_res,
|
||||||
|
0.76484218728448842626L, CHOOSE(3e-17L, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1832,6 +1879,8 @@ tan_test (void)
|
||||||
|
|
||||||
check_eps ("tan (pi/4) == 1", FUNC(tan) (M_PI_4), 1,
|
check_eps ("tan (pi/4) == 1", FUNC(tan) (M_PI_4), 1,
|
||||||
CHOOSE (2e-18L, 1e-15L, 2e-7));
|
CHOOSE (2e-18L, 1e-15L, 2e-7));
|
||||||
|
check_eps ("tan (0.7) == 0.8422883804...", FUNC(tan) (0.7),
|
||||||
|
0.84228838046307944813L, CHOOSE(8e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1845,6 +1894,8 @@ tanh_test (void)
|
||||||
check ("tanh (+inf) == +1", FUNC(tanh) (plus_infty), 1);
|
check ("tanh (+inf) == +1", FUNC(tanh) (plus_infty), 1);
|
||||||
check ("tanh (-inf) == -1", FUNC(tanh) (minus_infty), -1);
|
check ("tanh (-inf) == -1", FUNC(tanh) (minus_infty), -1);
|
||||||
#endif
|
#endif
|
||||||
|
check_eps ("tanh (0.7) == 0.6043677771...", FUNC(tanh) (0.7),
|
||||||
|
0.60436777711716349631L, CHOOSE(3e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2355,7 +2406,8 @@ sqrt_test (void)
|
||||||
check ("sqrt (6642.25) == 81.5", FUNC(sqrt) (6642.25), 81.5);
|
check ("sqrt (6642.25) == 81.5", FUNC(sqrt) (6642.25), 81.5);
|
||||||
check_eps ("sqrt (15239.903) == 123.45", FUNC(sqrt) (15239.903), 123.45,
|
check_eps ("sqrt (15239.903) == 123.45", FUNC(sqrt) (15239.903), 123.45,
|
||||||
CHOOSE (3e-6L, 3e-6, 8e-6));
|
CHOOSE (3e-6L, 3e-6, 8e-6));
|
||||||
|
check_eps ("sqrt (0.7) == 0.8366600265", FUNC(sqrt) (0.7),
|
||||||
|
0.83666002653407554798L, CHOOSE(3e-17L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2597,6 +2649,18 @@ cexp_test (void)
|
||||||
result = FUNC(cexp) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(cexp) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(cexp(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(cexp(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(cexp(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(cexp(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(cexp) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(cexp(0.7 + i 1.2)) == 0.72969...", __real__ result,
|
||||||
|
0.7296989091503236012L, CHOOSE(6e-17L, 0, 6e-8));
|
||||||
|
check_eps ("imag(cexp(0.7 + i 1.2)) == 1.87689...", __imag__ result,
|
||||||
|
1.8768962328348102821L, CHOOSE(2e-16L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(cexp) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(cexp(-2 - i 3)) == --0.13398...", __real__ result,
|
||||||
|
-0.1339809149295426134L, CHOOSE(6e-20L, 0, 0));
|
||||||
|
check_eps ("imag(cexp(-2 - i 3)) == -0.01909...", __imag__ result,
|
||||||
|
-0.0190985162611351964L, CHOOSE(4e-20L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2766,6 +2830,18 @@ csin_test (void)
|
||||||
result = FUNC(csin) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(csin) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(csin(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(csin(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(csin(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(csin(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(csin) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(csin(0.7 + i 1.2)) = 1.166456341...", __real__ result,
|
||||||
|
1.1664563419657581376L, CHOOSE(2e-16L, 0, 0));
|
||||||
|
check_eps ("imag(csin(0.7 + i 1.2)) = 1.154499724...", __imag__ result,
|
||||||
|
1.1544997246948547371L, CHOOSE(2e-17L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(csin) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(csin(-2 - i 3)) == --9.15449...", __real__ result,
|
||||||
|
-9.1544991469114295734L);
|
||||||
|
check ("imag(csin(-2 - i 3)) == -4.16890...", __imag__ result,
|
||||||
|
4.1689069599665643507L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2935,6 +3011,18 @@ csinh_test (void)
|
||||||
result = FUNC(csinh) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(csinh) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(csinh(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(csinh(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(csinh(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(csinh(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(csinh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(csinh(0.7 + i 1.2)) = 0.274878686...", __real__ result,
|
||||||
|
0.27487868678117583582L, CHOOSE(2e-17L, 6e-17, 3e-8));
|
||||||
|
check_eps ("imag(csinh(0.7 + i 1.2)) = 1.169866572...", __imag__ result,
|
||||||
|
1.1698665727426565139L, CHOOSE(6e-17L, 0, 3e-8));
|
||||||
|
|
||||||
|
result = FUNC(csinh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(csinh(-2 - i 3)) == -3.59056...", __real__ result,
|
||||||
|
3.5905645899857799520L, CHOOSE(0, 5e-16, 0));
|
||||||
|
check_eps ("imag(csinh(-2 - i 3)) == -0.53092...", __imag__ result,
|
||||||
|
-0.5309210862485198052L, CHOOSE(2e-19L, 2e-16, 6e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3102,6 +3190,18 @@ ccos_test (void)
|
||||||
result = FUNC(ccos) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(ccos) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(ccos(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(ccos(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(ccos(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(ccos(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(ccos) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(ccos(0.7 + i 1.2)) = 1.384865764...", __real__ result,
|
||||||
|
1.3848657645312111080L, CHOOSE(6e-19L, 3e-16, 2e-7));
|
||||||
|
check_eps ("imag(ccos(0.7 + i 1.2)) = -0.972421703...", __imag__ result,
|
||||||
|
-0.97242170335830028619L, CHOOSE(2e-16L, 2e-16, 0));
|
||||||
|
|
||||||
|
result = FUNC(ccos) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(ccos(-2 - i 3)) == --4.18962...", __real__ result,
|
||||||
|
-4.1896256909688072301L);
|
||||||
|
check_eps ("imag(ccos(-2 - i 3)) == -9.10922...", __imag__ result,
|
||||||
|
-9.1092278937553365979L, CHOOSE(9e-19L, 0, 1e-6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3269,6 +3369,18 @@ ccosh_test (void)
|
||||||
result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(ccosh) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(ccosh(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(ccosh(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(ccosh(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(ccosh(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(ccosh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(ccosh(0.7 + i 1.2)) == 0.45482...", __real__ result,
|
||||||
|
0.4548202223691477654L, CHOOSE(4e-17L, 6e-17, 3e-8));
|
||||||
|
check_eps ("imag(ccosh(0.7 + i 1.2)) == 0.70702...", __imag__ result,
|
||||||
|
0.7070296600921537682L, CHOOSE(7e-17L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(ccosh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(ccosh(-2 - i 3)) == --3.72454...", __real__ result,
|
||||||
|
-3.7245455049153225654L);
|
||||||
|
check_eps ("imag(ccosh(-2 - i 3)) == -0.51182...", __imag__ result,
|
||||||
|
0.5118225699873846088L, CHOOSE(6e-20, 2e-16, 6e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3397,6 +3509,18 @@ cacos_test (void)
|
||||||
result = FUNC(cacos) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(cacos) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(cacos(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(cacos(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(cacos(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(cacos(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(cacos) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(cacos(0.7 + i 1.2)) == 1.13518...", __real__ result,
|
||||||
|
1.1351827477151551089L, CHOOSE(2e-17L, 3e-16, 2e-7));
|
||||||
|
check_eps ("imag(cacos(0.7 + i 1.2)) == -1.09276...", __imag__ result,
|
||||||
|
-1.0927647857577371459L, CHOOSE(4e-17L, 0, 3e-7));
|
||||||
|
|
||||||
|
result = FUNC(cacos) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(cacos(-2 - i 3)) == -2.14144...", __real__ result,
|
||||||
|
2.1414491111159960199L);
|
||||||
|
check_eps ("imag(cacos(-2 - i 3)) == -1.98338...", __imag__ result,
|
||||||
|
1.9833870299165354323L, CHOOSE(2e-19L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3525,6 +3649,18 @@ cacosh_test (void)
|
||||||
result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(cacosh) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(cacosh(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(cacosh(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(cacosh(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(cacosh(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(cacosh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(cacosh(0.7 + i 1.2)) == 1.09276...", __real__ result,
|
||||||
|
1.0927647857577371459L, CHOOSE(4e-17L, 3e-16, 0));
|
||||||
|
check_eps ("imag(cacosh(0.7 + i 1.2)) == 1.13518...", __imag__ result,
|
||||||
|
1.1351827477151551089L, CHOOSE(2e-17L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(cacosh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(cacosh(-2 - i 3)) == -1.98338...", __real__ result,
|
||||||
|
-1.9833870299165354323L, CHOOSE (6e-19, 3e-16, 9e-7));
|
||||||
|
check_eps ("imag(cacosh(-2 - i 3)) == 2.14144...", __imag__ result,
|
||||||
|
2.1414491111159960199L, CHOOSE (3e-19, 5e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3658,6 +3794,18 @@ casin_test (void)
|
||||||
result = FUNC(casin) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(casin) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(casin(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(casin(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(casin(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(casin(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(casin) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(casin(0.7 + i 1.2)) == 0.43561...", __real__ result,
|
||||||
|
0.4356135790797415103L, CHOOSE(2e-17L, 2e-16, 2e-7));
|
||||||
|
check_eps ("imag(casin(0.7 + i 1.2)) == 1.09276...", __imag__ result,
|
||||||
|
1.0927647857577371459L, CHOOSE(4e-17L, 0, 3e-7));
|
||||||
|
|
||||||
|
result = FUNC(casin) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(casin(-2 - i 3)) == --0.57065...", __real__ result,
|
||||||
|
-0.5706527843210994007L);
|
||||||
|
check_eps ("imag(casin(-2 - i 3)) == -1.98338...", __imag__ result,
|
||||||
|
-1.9833870299165354323L, CHOOSE(2e-19L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3791,6 +3939,18 @@ casinh_test (void)
|
||||||
result = FUNC(casinh) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(casinh) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(casinh(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(casinh(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(casinh(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(casinh(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(casinh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(casinh(0.7 + i 1.2)) == 0.97865...", __real__ result,
|
||||||
|
0.9786545955936738768L, CHOOSE(5e-17L, 2e-16, 0));
|
||||||
|
check_eps ("imag(casinh(0.7 + i 1.2)) == 0.91135...", __imag__ result,
|
||||||
|
0.9113541895315601156L, CHOOSE(7e-19L, 0, 6e-8));
|
||||||
|
|
||||||
|
result = FUNC(casinh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(casinh(-2 - i 3)) == --1.96863...", __real__ result,
|
||||||
|
-1.9686379257930962917L, CHOOSE(7e-19L, 2e-15, 2e-7));
|
||||||
|
check_eps ("imag(casinh(-2 - i 3)) == -0.96465...", __imag__ result,
|
||||||
|
-0.9646585044076027920L, CHOOSE(4e-19L, 2e-15, 4e-7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3929,6 +4089,18 @@ catan_test (void)
|
||||||
result = FUNC(catan) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(catan) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(catan(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(catan(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(catan(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(catan(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(catan) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(catan(0.7 + i 1.2)) == 1.07857...", __real__ result,
|
||||||
|
1.0785743834118921877L, CHOOSE (3e-17, 0, 0));
|
||||||
|
check_eps ("imag(catan(0.7 + i 1.2)) == 0.57705...", __imag__ result,
|
||||||
|
0.5770573776534306764L, CHOOSE(3e-17L, 0, 6e-8));
|
||||||
|
|
||||||
|
result = FUNC(catan) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(catan(-2 - i 3)) == -1.40992...", __real__ result,
|
||||||
|
-1.4099210495965755225L);
|
||||||
|
check_eps ("imag(catan(-2 - i 3)) == -0.22907...", __imag__ result,
|
||||||
|
-0.2290726829685387662L, CHOOSE(1e-19L, 3e-17, 2e-8));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4067,6 +4239,18 @@ catanh_test (void)
|
||||||
result = FUNC(catanh) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(catanh) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(catanh(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(catanh(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(catanh(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(catanh(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(catanh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(catanh(0.7 + i 1.2)) == 0.26007...", __real__ result,
|
||||||
|
0.2600749516525135959L, CHOOSE (2e-18, 0, 0));
|
||||||
|
check_eps ("imag(catanh(0.7 + i 1.2)) == 0.97024...", __imag__ result,
|
||||||
|
0.9702403077950989849L, CHOOSE (3e-17, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(catanh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(catanh(-2 - i 3)) == -0.14694...", __real__ result,
|
||||||
|
-0.1469466662255297520L, CHOOSE (3e-20, 6e-17, 2e-8));
|
||||||
|
check ("imag(catanh(-2 - i 3)) == -1.33897...", __imag__ result,
|
||||||
|
-1.3389725222944935611L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4199,13 +4383,24 @@ ctan_test (void)
|
||||||
result = FUNC(ctan) (BUILD_COMPLEX (nan_value, -0.25));
|
result = FUNC(ctan) (BUILD_COMPLEX (nan_value, -0.25));
|
||||||
check_isnan_maybe_exc ("real(ctan(NaN -i 0.25)) = NaN plus maybe invalid exception",
|
check_isnan_maybe_exc ("real(ctan(NaN -i 0.25)) = NaN plus maybe invalid exception",
|
||||||
__real__ result, INVALID_EXCEPTION);
|
__real__ result, INVALID_EXCEPTION);
|
||||||
check_isnan ("imag(ctanh(NaN -i 0.25)) = NaN plus maybe invalid exception",
|
check_isnan ("imag(ctan(NaN -i 0.25)) = NaN plus maybe invalid exception",
|
||||||
__imag__ result);
|
__imag__ result);
|
||||||
|
|
||||||
result = FUNC(ctan) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(ctan) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(ctan(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(ctan(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(ctan(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(ctan(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(ctan) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(ctan(0.7 + i 1.2)) == 0.17207...", __real__ result,
|
||||||
|
0.1720734197630349001L, CHOOSE(1e-17L, 3e-17, 2e-8));
|
||||||
|
check_eps ("imag(ctan(0.7 + i 1.2)) == 0.95448...", __imag__ result,
|
||||||
|
0.9544807059989405538L, CHOOSE(2e-17L, 2e-16, 0));
|
||||||
|
|
||||||
|
result = FUNC(ctan) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(ctan(-2 - i 3)) == -0.00376...", __real__ result,
|
||||||
|
0.0037640256415042482L, CHOOSE(1e-19L, 0, 0));
|
||||||
|
check_eps ("imag(ctan(-2 - i 3)) == -1.00323...", __imag__ result,
|
||||||
|
-1.0032386273536098014L, CHOOSE(2e-19L, 0, 2e-7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4347,6 +4542,18 @@ ctanh_test (void)
|
||||||
check ("real(ctanh (0 + i pi/4)) == 0", __real__ result, 0);
|
check ("real(ctanh (0 + i pi/4)) == 0", __real__ result, 0);
|
||||||
check_eps ("imag(ctanh (0 + i pi/4)) == 1", __imag__ result, 1,
|
check_eps ("imag(ctanh (0 + i pi/4)) == 1", __imag__ result, 1,
|
||||||
CHOOSE (0, 0, 2e-7));
|
CHOOSE (0, 0, 2e-7));
|
||||||
|
|
||||||
|
result = FUNC(ctanh) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(ctanh(0.7 + i 1.2)) == 1.34721...", __real__ result,
|
||||||
|
1.3472197399061191630L, CHOOSE(4e-17L, 6e-17, 2e-7));
|
||||||
|
check_eps ("imag(ctanh(0.7 + i 1.2)) == -0.47786...", __imag__ result,
|
||||||
|
0.4778641038326365540L, CHOOSE(9e-17L, 6e-17, 0));
|
||||||
|
|
||||||
|
result = FUNC(ctanh) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(ctanh(-2 - i 3)) == --0.96538...", __real__ result,
|
||||||
|
-0.9653858790221331242L, CHOOSE(2e-19L, 0, 0));
|
||||||
|
check_eps ("imag(ctanh(-2 - i 3)) == -0.00988...", __imag__ result,
|
||||||
|
0.0098843750383224937L, CHOOSE(2e-20L, 0, 1e-9));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4501,6 +4708,18 @@ clog_test (void)
|
||||||
result = FUNC(clog) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(clog) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(clog(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(clog(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(clog(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(clog(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(clog) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(clog(0.7 + i 1.2)) == 0.32876...", __real__ result,
|
||||||
|
0.3287600014583970919L, CHOOSE(5e-17L, 6e-17, 3e-8));
|
||||||
|
check_eps ("imag(clog(0.7 + i 1.2)) == 1.04272...", __imag__ result,
|
||||||
|
1.0427218783685369524L, CHOOSE(2e-17L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(clog) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(clog(-2 - i 3)) == -1.28247...", __real__ result,
|
||||||
|
1.2824746787307683680L);
|
||||||
|
check_eps ("imag(clog(-2 - i 3)) == -2.15879...", __imag__ result,
|
||||||
|
-2.1587989303424641704L, CHOOSE(3e-19L, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4533,55 +4752,71 @@ clog10_test (void)
|
||||||
|
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, plus_infty));
|
||||||
check_isinfp ("real(clog10(-Inf + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf + i Inf)) = 3*pi/4", __imag__ result, M_PI - M_PI_4);
|
check_eps ("imag(clog10(-Inf + i Inf)) = 3*pi/4*M_LOG10E", __imag__ result,
|
||||||
|
(M_PI - M_PI_4) * M_LOG10E, CHOOSE (0, 3e-16, 0));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_infty));
|
||||||
check_isinfp ("real(clog10(-Inf - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf - i Inf)) = -3*pi/4", __imag__ result, M_PI_4 - M_PI);
|
check_eps ("imag(clog10(-Inf - i Inf)) = -3*pi/4*M_LOG10E", __imag__ result,
|
||||||
|
(M_PI_4 - M_PI) * M_LOG10E, CHOOSE (0, 3e-16, 0));
|
||||||
|
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, plus_infty));
|
||||||
check_isinfp ("real(clog10(+Inf + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(+Inf + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(+Inf + i Inf)) = pi/4", __imag__ result, M_PI_4);
|
check_eps ("imag(clog10(+Inf + i Inf)) = pi/4*M_LOG10E", __imag__ result,
|
||||||
|
M_PI_4 * M_LOG10E, CHOOSE (0, 6e-17, 3e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, minus_infty));
|
||||||
check_isinfp ("real(clog10(+Inf - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(+Inf - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(+Inf - i Inf)) = -pi/4", __imag__ result, -M_PI_4);
|
check_eps ("imag(clog10(+Inf - i Inf)) = -pi/4*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI_4 * M_LOG10E, CHOOSE (0, 6e-17, 3e-8));
|
||||||
|
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (0, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (0, plus_infty));
|
||||||
check_isinfp ("real(clog10(0 + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(0 + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(0 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
check_eps ("imag(clog10(0 + i Inf)) = pi/2*M_LOG10E", __imag__ result,
|
||||||
|
M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (3, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (3, plus_infty));
|
||||||
check_isinfp ("real(clog10(3 + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(3 + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(3 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
check_eps ("imag(clog10(3 + i Inf)) = pi/2*M_LOG10E", __imag__ result,
|
||||||
|
M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, plus_infty));
|
||||||
check_isinfp ("real(clog10(-0 + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-0 + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-0 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
check_eps ("imag(clog10(-0 + i Inf)) = pi/2*M_LOG10E", __imag__ result,
|
||||||
|
M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (-3, plus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (-3, plus_infty));
|
||||||
check_isinfp ("real(clog10(-3 + i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-3 + i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-3 + i Inf)) = pi/2", __imag__ result, M_PI_2);
|
check_eps ("imag(clog10(-3 + i Inf)) = pi/2*M_LOG10E", __imag__ result,
|
||||||
|
M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (0, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (0, minus_infty));
|
||||||
check_isinfp ("real(clog10(0 - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(0 - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
check_eps ("imag(clog10(0 - i Inf)) = -pi/2*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI_2*M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (3, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (3, minus_infty));
|
||||||
check_isinfp ("real(clog10(3 - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(3 - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(3 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
check_eps ("imag(clog10(3 - i Inf)) = -pi/2*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI_2*M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_zero, minus_infty));
|
||||||
check_isinfp ("real(clog10(-0 - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-0 - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-0 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
check_eps ("imag(clog10(-0 - i Inf)) = -pi/2*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (-3, minus_infty));
|
result = FUNC(clog10) (BUILD_COMPLEX (-3, minus_infty));
|
||||||
check_isinfp ("real(clog10(-3 - i Inf)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-3 - i Inf)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-3 - i Inf)) = -pi/2", __imag__ result, -M_PI_2);
|
check_eps ("imag(clog10(-3 - i Inf)) = -pi/2*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI_2 * M_LOG10E, CHOOSE (0, 2e-16, 6e-8));
|
||||||
|
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 0));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 0));
|
||||||
check_isinfp ("real(clog10(-Inf + i0)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf + i0)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf + i0)) = pi", __imag__ result, M_PI);
|
check_eps ("imag(clog10(-Inf + i0)) = pi*M_LOG10E", __imag__ result,
|
||||||
|
M_PI * M_LOG10E, CHOOSE (0, 3e-16, 2e-7));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 1));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, 1));
|
||||||
check_isinfp ("real(clog10(-Inf + i1)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf + i1)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf + i1)) = pi", __imag__ result, M_PI);
|
check_eps ("imag(clog10(-Inf + i1)) = pi*M_LOG10E", __imag__ result,
|
||||||
|
M_PI * M_LOG10E, CHOOSE (0, 3e-16, 2e-7));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_zero));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, minus_zero));
|
||||||
check_isinfp ("real(clog10(-Inf - i0)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf - i0)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf - i0)) = -pi", __imag__ result, -M_PI);
|
check_eps ("imag(clog10(-Inf - i0)) = -pi*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI * M_LOG10E, CHOOSE (0, 3e-16, 2e-7));
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, -1));
|
result = FUNC(clog10) (BUILD_COMPLEX (minus_infty, -1));
|
||||||
check_isinfp ("real(clog10(-Inf - i1)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(-Inf - i1)) = +Inf", __real__ result);
|
||||||
check ("imag(clog10(-Inf - i1)) = -pi", __imag__ result, -M_PI);
|
check_eps ("imag(clog10(-Inf - i1)) = -pi*M_LOG10E", __imag__ result,
|
||||||
|
-M_PI * M_LOG10E, CHOOSE (0, 3e-16, 2e-7));
|
||||||
|
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, 0));
|
result = FUNC(clog10) (BUILD_COMPLEX (plus_infty, 0));
|
||||||
check_isinfp ("real(clog10(+Inf + i0)) = +Inf", __real__ result);
|
check_isinfp ("real(clog10(+Inf + i0)) = +Inf", __real__ result);
|
||||||
|
@ -4655,6 +4890,18 @@ clog10_test (void)
|
||||||
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, nan_value));
|
result = FUNC(clog10) (BUILD_COMPLEX (nan_value, nan_value));
|
||||||
check_isnan ("real(clog10(NaN + i NaN)) = NaN", __real__ result);
|
check_isnan ("real(clog10(NaN + i NaN)) = NaN", __real__ result);
|
||||||
check_isnan ("imag(clog10(NaN + i NaN)) = NaN", __imag__ result);
|
check_isnan ("imag(clog10(NaN + i NaN)) = NaN", __imag__ result);
|
||||||
|
|
||||||
|
result = FUNC(clog10) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(clog10(0.7 + i 1.2)) == 0.14277...", __real__ result,
|
||||||
|
0.1427786545038868803L, CHOOSE(2e-17L, 6e-17, 2e-8));
|
||||||
|
check_eps ("imag(clog10(0.7 + i 1.2)) == 0.45284...", __imag__ result,
|
||||||
|
0.4528483579352493248L, CHOOSE(6e-18, 6e-17, 3e-8));
|
||||||
|
|
||||||
|
result = FUNC(clog10) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check ("real(clog10(-2 - i 3)) == -0.55697...", __real__ result,
|
||||||
|
0.5569716761534183846L);
|
||||||
|
check_eps ("imag(clog10(-2 - i 3)) == -0.93755...", __imag__ result,
|
||||||
|
-0.9375544629863747085L, CHOOSE (6e-20, 2e-16, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4809,6 +5056,18 @@ csqrt_test (void)
|
||||||
result = FUNC(csqrt) (BUILD_COMPLEX (119, 120));
|
result = FUNC(csqrt) (BUILD_COMPLEX (119, 120));
|
||||||
check ("real(csqrt(119 + i 120) = 12", __real__ result, 12);
|
check ("real(csqrt(119 + i 120) = 12", __real__ result, 12);
|
||||||
check ("imag(csqrt(119 + i 120) = 5", __imag__ result, 5);
|
check ("imag(csqrt(119 + i 120) = 5", __imag__ result, 5);
|
||||||
|
|
||||||
|
result = FUNC(csqrt) (BUILD_COMPLEX (0.7, 1.2));
|
||||||
|
check_eps ("real(csqrt(0.7 + i 1.2)) == 1.02206...", __real__ result,
|
||||||
|
1.0220676100300264507L, CHOOSE(3e-17L, 3e-16, 2e-7));
|
||||||
|
check_eps ("imag(csqrt(0.7 + i 1.2)) == 0.58704...", __imag__ result,
|
||||||
|
0.5870453129635652115L, CHOOSE(7e-18L, 0, 0));
|
||||||
|
|
||||||
|
result = FUNC(csqrt) (BUILD_COMPLEX (-2, -3));
|
||||||
|
check_eps ("real(csqrt(-2 - i 3)) == -0.89597...", __real__ result,
|
||||||
|
0.8959774761298381247L, CHOOSE(6e-20L, 2e-16, 6e-8));
|
||||||
|
check ("imag(csqrt(-2 - i 3)) == -1.67414...", __imag__ result,
|
||||||
|
-1.6741492280355400404L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -125,9 +125,14 @@ internal_setgrent (ent_t *ent)
|
||||||
ent->result = NULL;
|
ent->result = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
if (ent->stream == NULL)
|
if (ent->stream == NULL)
|
||||||
{
|
{
|
||||||
|
@ -202,9 +207,14 @@ internal_endgrent (ent_t *ent)
|
||||||
ent->result = NULL;
|
ent->result = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
return NSS_STATUS_SUCCESS;
|
return NSS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -411,22 +421,17 @@ getgrnam_plusgroup (const char *name, struct group *result, char *buffer,
|
||||||
int outvallen;
|
int outvallen;
|
||||||
|
|
||||||
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
||||||
{
|
return NSS_STATUS_NOTFOUND;
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (yp_match (domain, "group.byname", name, strlen (name),
|
if (yp_match (domain, "group.byname", name, strlen (name),
|
||||||
&outval, &outvallen) != YPERR_SUCCESS)
|
&outval, &outvallen) != YPERR_SUCCESS)
|
||||||
{
|
return NSS_STATUS_NOTFOUND;
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
p = strncpy (buffer, outval,
|
p = strncpy (buffer, outval,
|
||||||
buflen < (size_t) outvallen ? buflen : (size_t) outvallen);
|
buflen < (size_t) outvallen ? buflen : (size_t) outvallen);
|
||||||
free (outval);
|
free (outval);
|
||||||
while (isspace (*p))
|
while (isspace (*p))
|
||||||
p++;
|
++p;
|
||||||
parse_res = _nss_files_parse_grent (p, result, data, buflen, errnop);
|
parse_res = _nss_files_parse_grent (p, result, data, buflen, errnop);
|
||||||
if (parse_res == -1)
|
if (parse_res == -1)
|
||||||
return NSS_STATUS_TRYAGAIN;
|
return NSS_STATUS_TRYAGAIN;
|
||||||
|
@ -513,7 +518,8 @@ getgrent_next_file (struct group *result, ent_t *ent,
|
||||||
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
|
if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */
|
||||||
|
|| status == NSS_STATUS_NOTFOUND) /* No group in NIS */
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,9 +225,14 @@ internal_setpwent (ent_t *ent)
|
||||||
- pwdtable) - 1;
|
- pwdtable) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
if (ent->stream == NULL)
|
if (ent->stream == NULL)
|
||||||
{
|
{
|
||||||
|
@ -313,9 +318,14 @@ internal_endpwent (ent_t *ent)
|
||||||
ent->result = NULL;
|
ent->result = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
give_pwd_free (&ent->pwd);
|
give_pwd_free (&ent->pwd);
|
||||||
|
|
||||||
|
@ -521,6 +531,7 @@ getpwent_next_nisplus_netgr (const char *name, struct passwd *result,
|
||||||
return NSS_STATUS_SUCCESS;
|
return NSS_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* get the next user from NIS+ (+ entry) */
|
||||||
static enum nss_status
|
static enum nss_status
|
||||||
getpwent_next_nisplus (struct passwd *result, ent_t *ent, char *buffer,
|
getpwent_next_nisplus (struct passwd *result, ent_t *ent, char *buffer,
|
||||||
size_t buflen, int *errnop)
|
size_t buflen, int *errnop)
|
||||||
|
@ -752,18 +763,12 @@ getpwnam_plususer (const char *name, struct passwd *result, char *buffer,
|
||||||
int outvallen;
|
int outvallen;
|
||||||
|
|
||||||
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
||||||
{
|
return NSS_STATUS_NOTFOUND;
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (yp_match (domain, "passwd.byname", name, strlen (name),
|
if (yp_match (domain, "passwd.byname", name, strlen (name),
|
||||||
&outval, &outvallen)
|
&outval, &outvallen) != YPERR_SUCCESS)
|
||||||
!= YPERR_SUCCESS)
|
return NSS_STATUS_NOTFOUND;
|
||||||
{
|
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
ptr = strncpy (buffer, outval, buflen < (size_t) outvallen ?
|
ptr = strncpy (buffer, outval, buflen < (size_t) outvallen ?
|
||||||
buflen : (size_t) outvallen);
|
buflen : (size_t) outvallen);
|
||||||
buffer[buflen < (size_t) outvallen ? buflen : (size_t) outvallen] = '\0';
|
buffer[buflen < (size_t) outvallen ? buflen : (size_t) outvallen] = '\0';
|
||||||
|
@ -910,7 +915,8 @@ getpwent_next_file (struct passwd *result, ent_t *ent,
|
||||||
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
|
if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */
|
||||||
|
|| status == NSS_STATUS_NOTFOUND) /* entry doesn't exist */
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -177,9 +177,14 @@ internal_setspent (ent_t *ent)
|
||||||
- pwdtable) - 1;
|
- pwdtable) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
if (ent->stream == NULL)
|
if (ent->stream == NULL)
|
||||||
{
|
{
|
||||||
|
@ -265,9 +270,14 @@ internal_endspent (ent_t *ent)
|
||||||
ent->result = NULL;
|
ent->result = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ent->blacklist.current = 0;
|
|
||||||
if (ent->blacklist.data != NULL)
|
if (ent->blacklist.data != NULL)
|
||||||
ent->blacklist.data[0] = '\0';
|
{
|
||||||
|
ent->blacklist.current = 1;
|
||||||
|
ent->blacklist.data[0] = '|';
|
||||||
|
ent->blacklist.data[1] = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ent->blacklist.current = 0;
|
||||||
|
|
||||||
give_spwd_free (&ent->pwd);
|
give_spwd_free (&ent->pwd);
|
||||||
|
|
||||||
|
@ -704,18 +714,12 @@ getspnam_plususer (const char *name, struct spwd *result, char *buffer,
|
||||||
int outvallen;
|
int outvallen;
|
||||||
|
|
||||||
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
if (yp_get_default_domain (&domain) != YPERR_SUCCESS)
|
||||||
{
|
return NSS_STATUS_NOTFOUND;
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (yp_match (domain, "shadow.byname", name, strlen (name),
|
if (yp_match (domain, "shadow.byname", name, strlen (name),
|
||||||
&outval, &outvallen)
|
&outval, &outvallen) != YPERR_SUCCESS)
|
||||||
!= YPERR_SUCCESS)
|
return NSS_STATUS_NOTFOUND;
|
||||||
{
|
|
||||||
*errnop = errno;
|
|
||||||
return NSS_STATUS_TRYAGAIN;
|
|
||||||
}
|
|
||||||
ptr = strncpy (buffer, outval, buflen < (size_t) outvallen ?
|
ptr = strncpy (buffer, outval, buflen < (size_t) outvallen ?
|
||||||
buflen : (size_t) outvallen);
|
buflen : (size_t) outvallen);
|
||||||
buffer[buflen < (size_t) outvallen ? buflen : (size_t) outvallen] = '\0';
|
buffer[buflen < (size_t) outvallen ? buflen : (size_t) outvallen] = '\0';
|
||||||
|
@ -854,7 +858,8 @@ getspent_next_file (struct spwd *result, ent_t *ent,
|
||||||
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
if (status == NSS_STATUS_SUCCESS) /* We found the entry. */
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
if (status == NSS_STATUS_RETURN) /* We couldn't parse the entry */
|
if (status == NSS_STATUS_RETURN /* We couldn't parse the entry */
|
||||||
|
|| status == NSS_STATUS_NOTFOUND) /* entry doesn't exist */
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,11 +74,12 @@ __yp_bind (const char *domain, dom_binding **ypdb)
|
||||||
if (ysd == NULL)
|
if (ysd == NULL)
|
||||||
{
|
{
|
||||||
is_new = 1;
|
is_new = 1;
|
||||||
ysd = (dom_binding *) malloc (sizeof *ysd);
|
ysd = (dom_binding *) calloc (1, sizeof *ysd);
|
||||||
memset (ysd, '\0', sizeof *ysd);
|
|
||||||
ysd->dom_socket = -1;
|
ysd->dom_socket = -1;
|
||||||
ysd->dom_vers = -1;
|
ysd->dom_vers = -1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ysd->dom_client = NULL;
|
||||||
|
|
||||||
try = 0;
|
try = 0;
|
||||||
|
|
||||||
|
@ -257,6 +258,7 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
|
||||||
use_ypbindlist = FALSE;
|
use_ypbindlist = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if (ydb != NULL)
|
||||||
{
|
{
|
||||||
__yp_unbind (ydb);
|
__yp_unbind (ydb);
|
||||||
free (ydb);
|
free (ydb);
|
||||||
|
|
|
@ -34,7 +34,7 @@ distribute := confstr.h TESTS TESTS2C.sed testcases.h \
|
||||||
routines := \
|
routines := \
|
||||||
uname \
|
uname \
|
||||||
times \
|
times \
|
||||||
wait waitpid wait3 wait4 \
|
wait waitpid wait3 wait4 waitid \
|
||||||
alarm sleep pause nanosleep \
|
alarm sleep pause nanosleep \
|
||||||
fork vfork _exit \
|
fork vfork _exit \
|
||||||
execve fexecve execv execle execl execvp execlp \
|
execve fexecve execv execle execl execvp execlp \
|
||||||
|
|
|
@ -81,6 +81,10 @@ typedef __pid_t pid_t;
|
||||||
# define pid_t pid_t
|
# define pid_t pid_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined __USE_SVID || defined __USE_XOPEN
|
||||||
|
typedef __id_t id_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ssize_t
|
#ifndef ssize_t
|
||||||
typedef __ssize_t ssize_t;
|
typedef __ssize_t ssize_t;
|
||||||
# define ssize_t ssize_t
|
# define ssize_t ssize_t
|
||||||
|
|
|
@ -89,6 +89,16 @@ typedef union
|
||||||
# define W_STOPCODE(sig) __W_STOPCODE(sig)
|
# define W_STOPCODE(sig) __W_STOPCODE(sig)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The following values are used by the `waitid' function. */
|
||||||
|
#if defined __USE_SVID || defined __USE_XOPEN
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
P_ALL, /* Wait for any child. */
|
||||||
|
P_PID, /* Wait for specified process. */
|
||||||
|
P_PGID /* Wait for members of process group. */
|
||||||
|
} idtype_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Wait for a child to die. When one does, put its status in *STAT_LOC
|
/* 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. */
|
and return its process ID. For errors, return (pid_t) -1. */
|
||||||
|
@ -118,6 +128,21 @@ extern __pid_t __waitpid __P ((__pid_t __pid, int *__stat_loc,
|
||||||
extern __pid_t waitpid __P ((__pid_t __pid, int *__stat_loc,
|
extern __pid_t waitpid __P ((__pid_t __pid, int *__stat_loc,
|
||||||
int __options));
|
int __options));
|
||||||
|
|
||||||
|
#if defined __USE_SVID || defined __USE_XOPEN
|
||||||
|
# define __need_siginfo_t
|
||||||
|
# include <bits/siginfo.h>
|
||||||
|
/* Wait for a childing matching IDTYPE and ID to change the status and
|
||||||
|
place appropriate information in *INFOP.
|
||||||
|
If IDTYPE is P_PID, match any process whose process ID is ID.
|
||||||
|
If IDTYPE is P_PGID, match any process whose process group is ID.
|
||||||
|
If IDTYPE is P_ALL, match any process.
|
||||||
|
If the WNOHANG bit is set in OPTIONS, and that child
|
||||||
|
is not already dead, clear *INFOP and return 0. If successful, store
|
||||||
|
exit code and status in *INFOP. */
|
||||||
|
extern int waitid __P ((idtype_t __idtype, __id_t __id, siginfo_t *__infop,
|
||||||
|
int __options));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
|
||||||
/* This being here makes the prototypes valid whether or not
|
/* This being here makes the prototypes valid whether or not
|
||||||
we have already included <sys/resource.h> to define `struct rusage'. */
|
we have already included <sys/resource.h> to define `struct rusage'. */
|
||||||
|
|
2
rt/aio.h
2
rt/aio.h
|
@ -179,7 +179,7 @@ extern int lio_listio64 __P ((int __mode, struct aiocb64 *__const __list[],
|
||||||
extern int aio_error __P ((__const struct aiocb *__aiocbp));
|
extern int aio_error __P ((__const struct aiocb *__aiocbp));
|
||||||
#else
|
#else
|
||||||
extern int aio_error __P ((__const struct aiocb *__aiocbp))
|
extern int aio_error __P ((__const struct aiocb *__aiocbp))
|
||||||
__asm__ ("aio_error64");;
|
__asm__ ("aio_error64");
|
||||||
#endif
|
#endif
|
||||||
#ifdef __USE_LARGEFILE64
|
#ifdef __USE_LARGEFILE64
|
||||||
extern int aio_error64 __P ((__const struct aiocb64 *__aiocbp));
|
extern int aio_error64 __P ((__const struct aiocb64 *__aiocbp));
|
||||||
|
|
|
@ -144,7 +144,7 @@ get_elem (void)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
__aio_free_req (struct requestlist *elem)
|
__aio_free_request (struct requestlist *elem)
|
||||||
{
|
{
|
||||||
elem->running = no;
|
elem->running = no;
|
||||||
elem->next_prio = freelist;
|
elem->next_prio = freelist;
|
||||||
|
@ -375,7 +375,7 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Something went wrong. */
|
/* Something went wrong. */
|
||||||
__aio_free_req (newp);
|
__aio_free_request (newp);
|
||||||
newp = NULL;
|
newp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ handle_fildes_io (void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the old element. */
|
/* Free the old element. */
|
||||||
__aio_free_req (runp);
|
__aio_free_request (runp);
|
||||||
|
|
||||||
runp = freelist;
|
runp = freelist;
|
||||||
if (runp != NULL)
|
if (runp != NULL)
|
||||||
|
|
|
@ -3,8 +3,8 @@ GLIBC_2.1 {
|
||||||
|
|
||||||
# AIO functions.
|
# AIO functions.
|
||||||
aio_cancel; aio_cancel64; aio_error; aio_error64; aio_fsync; aio_fsync64;
|
aio_cancel; aio_cancel64; aio_error; aio_error64; aio_fsync; aio_fsync64;
|
||||||
aio_read; aio_read64; aio_return; aio_return64; aio_suspend; aio_suspend64;
|
aio_init; aio_read; aio_read64; aio_return; aio_return64; aio_suspend;
|
||||||
aio_write; aio_write64; lio_listio; lio_listio64;
|
aio_suspend64; aio_write; aio_write64; lio_listio; lio_listio64;
|
||||||
|
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
|
|
|
@ -56,7 +56,7 @@ extern __sighandler_t __sysv_signal __P ((int __sig,
|
||||||
/* Set the handler for the signal SIG to HANDLER, returning the old
|
/* Set the handler for the signal SIG to HANDLER, returning the old
|
||||||
handler, or SIG_ERR on error.
|
handler, or SIG_ERR on error.
|
||||||
By default `signal' has the BSD semantic. */
|
By default `signal' has the BSD semantic. */
|
||||||
#if !defined __USE_XOPEN || defined __USE_GNU
|
#ifdef __USE_BSD
|
||||||
extern __sighandler_t signal __P ((int __sig, __sighandler_t __handler));
|
extern __sighandler_t signal __P ((int __sig, __sighandler_t __handler));
|
||||||
#else
|
#else
|
||||||
/* Make sure the used `signal' implementation is the SVID version.
|
/* Make sure the used `signal' implementation is the SVID version.
|
||||||
|
@ -176,13 +176,6 @@ typedef __sigset_t sigset_t;
|
||||||
# define __need_timespec
|
# define __need_timespec
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
|
|
||||||
/* Type for data associated with a signal. */
|
|
||||||
typedef union sigval
|
|
||||||
{
|
|
||||||
int sival_int;
|
|
||||||
void *sival_ptr;
|
|
||||||
} sigval_t;
|
|
||||||
|
|
||||||
/* Get the `siginfo_t' type plus the needed symbols. */
|
/* Get the `siginfo_t' type plus the needed symbols. */
|
||||||
# include <bits/siginfo.h>
|
# include <bits/siginfo.h>
|
||||||
|
|
||||||
|
|
|
@ -1637,6 +1637,9 @@ buffered_vfprintf (register _IO_FILE *s, const CHAR_T *format,
|
||||||
hp->_IO_write_ptr = buf;
|
hp->_IO_write_ptr = buf;
|
||||||
hp->_IO_write_end = buf + sizeof buf;
|
hp->_IO_write_end = buf + sizeof buf;
|
||||||
hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
|
hp->_IO_file_flags = _IO_MAGIC|_IO_NO_READS;
|
||||||
|
#if _IO_JUMPS_OFFSET
|
||||||
|
hp->_vtable_offset = 0;
|
||||||
|
#endif
|
||||||
#ifdef _IO_MTSAFE_IO
|
#ifdef _IO_MTSAFE_IO
|
||||||
hp->_lock = &helper.lock;
|
hp->_lock = &helper.lock;
|
||||||
__libc_lock_init (*hp->_lock);
|
__libc_lock_init (*hp->_lock);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Get public or secret key from key server.
|
/* Get public or secret key from key server.
|
||||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||||
|
|
||||||
|
@ -18,16 +18,17 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <rpc/netdb.h>
|
#include <rpc/netdb.h>
|
||||||
|
|
||||||
#include "nsswitch.h"
|
#include "nsswitch.h"
|
||||||
|
|
||||||
|
|
||||||
/* Type of the lookup function for the public key. */
|
/* Type of the lookup function for the public key. */
|
||||||
typedef int (*public_function) (const char *, char *);
|
typedef int (*public_function) (const char *, char *, int *);
|
||||||
|
|
||||||
/* Type of the lookup function for the secret key. */
|
/* Type of the lookup function for the secret key. */
|
||||||
typedef int (*secret_function) (const char *, char *, const char *);
|
typedef int (*secret_function) (const char *, char *, const char *, int *);
|
||||||
|
|
||||||
/* The lookup function for the first entry of this service. */
|
/* The lookup function for the first entry of this service. */
|
||||||
extern int __nss_publickey_lookup (service_user **nip, const char *name,
|
extern int __nss_publickey_lookup (service_user **nip, const char *name,
|
||||||
|
@ -63,7 +64,7 @@ getpublickey (const char *name, char *key)
|
||||||
|
|
||||||
while (! no_more)
|
while (! no_more)
|
||||||
{
|
{
|
||||||
status = (*fct) (name, key);
|
status = (*fct) (name, key, __errno_location ());
|
||||||
|
|
||||||
no_more = __nss_next (&nip, "getpublickey", (void **) &fct, status, 0);
|
no_more = __nss_next (&nip, "getpublickey", (void **) &fct, status, 0);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +102,7 @@ getsecretkey (const char *name, char *key, const char *passwd)
|
||||||
|
|
||||||
while (! no_more)
|
while (! no_more)
|
||||||
{
|
{
|
||||||
status = (*fct) (name, key, passwd);
|
status = (*fct) (name, key, passwd, __errno_location ());
|
||||||
|
|
||||||
no_more = __nss_next (&nip, "getsecretkey", (void **) &fct, status, 0);
|
no_more = __nss_next (&nip, "getsecretkey", (void **) &fct, status, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,8 @@ pmapdump (argc, argv)
|
||||||
(xdrproc_t) xdr_pmaplist, (caddr_t) &head,
|
(xdrproc_t) xdr_pmaplist, (caddr_t) &head,
|
||||||
minutetimeout) != RPC_SUCCESS)
|
minutetimeout) != RPC_SUCCESS)
|
||||||
{
|
{
|
||||||
fputs (_("rpcinfo: can't contact portmapper: "), stderr);
|
fputs (_("rpcinfo: can't contact portmapper"), stderr);
|
||||||
|
fputs (": ", stderr);
|
||||||
clnt_perror (client, "rpcinfo");
|
clnt_perror (client, "rpcinfo");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,8 +204,8 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||||
TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup, #nop);
|
TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup, #nop);
|
||||||
#else
|
#else
|
||||||
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
|
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
|
||||||
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \
|
TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup, imb); \
|
||||||
strong_alias (_dl_runtime_resolve, _dl_runtime_profile);
|
strong_alias (_dl_runtime_resolve, _dl_runtime_profile, #nop);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initial entry point code for the dynamic linker.
|
/* Initial entry point code for the dynamic linker.
|
||||||
|
|
|
@ -48,6 +48,9 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
||||||
#define _G_HAVE_PRINTF_FP 1
|
#define _G_HAVE_PRINTF_FP 1
|
||||||
#define _G_HAVE_MMAP 1
|
#define _G_HAVE_MMAP 1
|
||||||
#define _G_HAVE_LONG_DOUBLE_IO 1
|
#define _G_HAVE_LONG_DOUBLE_IO 1
|
||||||
|
#define _G_HAVE_IO_FILE_OPEN 1
|
||||||
|
|
||||||
|
#define _G_IO_IO_FILE_VERSION 0x20001
|
||||||
|
|
||||||
/* This is defined by <bits/stat.h> if `st_blksize' exists. */
|
/* This is defined by <bits/stat.h> if `st_blksize' exists. */
|
||||||
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
|
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
|
||||||
|
@ -60,7 +63,7 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
||||||
#define _G_VTABLE_LABEL_HAS_LENGTH 1
|
#define _G_VTABLE_LABEL_HAS_LENGTH 1
|
||||||
|
|
||||||
|
|
||||||
#if defined (__cplusplus) || defined (__STDC__)
|
#if defined __cplusplus || defined __STDC__
|
||||||
# define _G_ARGS(ARGLIST) ARGLIST
|
# define _G_ARGS(ARGLIST) ARGLIST
|
||||||
#else
|
#else
|
||||||
# define _G_ARGS(ARGLIST) ()
|
# define _G_ARGS(ARGLIST) ()
|
||||||
|
|
|
@ -17,10 +17,21 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _SIGNAL_H
|
#if !defined _SIGNAL_H && !defined __need_siginfo_t
|
||||||
# error "Never include this file directly. Use <signal.h> instead"
|
# error "Never include this file directly. Use <signal.h> instead"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (!defined __have_siginfo_t \
|
||||||
|
&& (defined _SIGNAL_H || defined __need_siginfo_t))
|
||||||
|
# define __have_siginfo_t 1
|
||||||
|
|
||||||
|
/* Type for data associated with a signal. */
|
||||||
|
typedef union sigval
|
||||||
|
{
|
||||||
|
int sival_int;
|
||||||
|
void *sival_ptr;
|
||||||
|
} sigval_t;
|
||||||
|
|
||||||
typedef struct siginfo
|
typedef struct siginfo
|
||||||
{
|
{
|
||||||
int si_signo; /* Signal number. */
|
int si_signo; /* Signal number. */
|
||||||
|
@ -158,6 +169,12 @@ enum
|
||||||
# define POLL_HUP POLL_HUP
|
# define POLL_HUP POLL_HUP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# undef __need_siginfo_t
|
||||||
|
#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined _SIGNAL_H && !defined __have_sigevent_t
|
||||||
|
# define __have_sigevent_t 1
|
||||||
|
|
||||||
/* Structure to transport application-defined values with signals. */
|
/* Structure to transport application-defined values with signals. */
|
||||||
# define SIGEV_MAX_SIZE 64
|
# define SIGEV_MAX_SIZE 64
|
||||||
|
@ -182,3 +199,5 @@ enum
|
||||||
SIGEV_THREAD /* Deliver via thread creation. */
|
SIGEV_THREAD /* Deliver via thread creation. */
|
||||||
# define SIGEV_THREAD SIGEV_THREAD
|
# define SIGEV_THREAD SIGEV_THREAD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* have _SIGNAL_H. */
|
||||||
|
|
|
@ -69,6 +69,7 @@ typedef long int __rlim_t; /* Type for resource measurement. */
|
||||||
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
|
typedef __quad_t __rlim64_t; /* Type for resource measurement (LFS). */
|
||||||
typedef __quad_t __ino64_t; /* Type for file serial numbers. */
|
typedef __quad_t __ino64_t; /* Type for file serial numbers. */
|
||||||
typedef __loff_t __off64_t; /* Type of file izes and offsets. */
|
typedef __loff_t __off64_t; /* Type of file izes and offsets. */
|
||||||
|
typedef unsigned int __id_t; /* General type for IDs. */
|
||||||
|
|
||||||
/* Everythin' else. */
|
/* Everythin' else. */
|
||||||
typedef long int __daddr_t; /* The type of a disk address. */
|
typedef long int __daddr_t; /* The type of a disk address. */
|
||||||
|
@ -85,7 +86,7 @@ typedef long int __key_t; /* Type of an IPC key */
|
||||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||||
#define __NFDBITS (sizeof (unsigned long int) * 8)
|
#define __NFDBITS (sizeof (unsigned long int) * 8)
|
||||||
#define __FDELT(d) ((d) / __NFDBITS)
|
#define __FDELT(d) ((d) / __NFDBITS)
|
||||||
#define __FDMASK(d) (1 << ((d) % __NFDBITS))
|
#define __FDMASK(d) ((unsigned long int) 1 << ((d) % __NFDBITS))
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,6 @@ extern void _end;
|
||||||
extern void ENTRY_POINT (void);
|
extern void ENTRY_POINT (void);
|
||||||
|
|
||||||
ElfW(Addr) _dl_base_addr;
|
ElfW(Addr) _dl_base_addr;
|
||||||
uid_t __libc_uid;
|
|
||||||
int __libc_enable_secure;
|
int __libc_enable_secure;
|
||||||
int __libc_multiple_libcs; /* Defining this here avoids the inclusion
|
int __libc_multiple_libcs; /* Defining this here avoids the inclusion
|
||||||
of init-first. */
|
of init-first. */
|
||||||
|
@ -131,7 +130,6 @@ _dl_sysdep_start (void **start_argptr,
|
||||||
SEE (EUID, euid);
|
SEE (EUID, euid);
|
||||||
SEE (EGID, egid);
|
SEE (EGID, egid);
|
||||||
|
|
||||||
__libc_uid = uid;
|
|
||||||
__libc_enable_secure = uid != euid || gid != egid;
|
__libc_enable_secure = uid != euid || gid != egid;
|
||||||
|
|
||||||
if (_dl_pagesize == 0)
|
if (_dl_pagesize == 0)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
int __libc_enable_secure = 1;
|
int __libc_enable_secure = 1;
|
||||||
|
|
||||||
/* We often need the UID. */
|
/* We often need the UID. */
|
||||||
uid_t __libc_uid;
|
extern uid_t __libc_uid;
|
||||||
|
|
||||||
void
|
void
|
||||||
__libc_init_secure (void)
|
__libc_init_secure (void)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
__sigqueue (pid_t pid, int sig, const union sigval val)
|
__sigqueue (pid_t pid, int sig, const union sigval val)
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#define MAXSYMLINKS 1
|
#define MAXSYMLINKS 1
|
||||||
|
#define MAXPATHLEN 256
|
||||||
|
|
||||||
/* Macros for min/max. */
|
/* Macros for min/max. */
|
||||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/* Stub version of waitid.
|
||||||
|
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 <errno.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
waitid (idtype, id, infop, options)
|
||||||
|
idtype_t idtype;
|
||||||
|
id_t id;
|
||||||
|
siginfo_t *infop;
|
||||||
|
int options;
|
||||||
|
{
|
||||||
|
__set_errno (ENOSYS);
|
||||||
|
return -1;
|
||||||
|
}
|
|
@ -338,7 +338,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
|
||||||
{
|
{
|
||||||
const char *strtab;
|
const char *strtab;
|
||||||
|
|
||||||
strtab = ((void *) map->l_addr
|
strtab = ((const char *) map->l_addr
|
||||||
+ map->l_info[DT_STRTAB]->d_un.d_ptr);
|
+ map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||||
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
|
_dl_sysdep_error (_dl_argv[0] ?: "<program name unknown>",
|
||||||
": Symbol `", strtab + refsym->st_name,
|
": Symbol `", strtab + refsym->st_name,
|
||||||
|
|
|
@ -110,8 +110,6 @@
|
||||||
__result; })
|
__result; })
|
||||||
# endif /* __i686__ */
|
# endif /* __i686__ */
|
||||||
|
|
||||||
/* XXX Argh!!! More compiler errors. */
|
|
||||||
#if 0
|
|
||||||
/* Test for negative number. Used in the signbit() macro. */
|
/* Test for negative number. Used in the signbit() macro. */
|
||||||
__MATH_INLINE int
|
__MATH_INLINE int
|
||||||
__signbitf (float __x)
|
__signbitf (float __x)
|
||||||
|
@ -130,7 +128,6 @@ __signbitl (long double __x)
|
||||||
return (__u.__i[2] & 0x8000) != 0;
|
return (__u.__i[2] & 0x8000) != 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* The gcc, version 2.7 or below, has problems with all this inlining
|
/* The gcc, version 2.7 or below, has problems with all this inlining
|
||||||
|
@ -534,8 +531,7 @@ __inline_mathcode (acosh, __x, \
|
||||||
|
|
||||||
__inline_mathcode (atanh, __x, \
|
__inline_mathcode (atanh, __x, \
|
||||||
register long double __y = __fabsl (__x); \
|
register long double __y = __fabsl (__x); \
|
||||||
return (-0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * \
|
return -0.5 * log1pl (-(__y + __y) / (1.0 + __y)) * __sgn1l (__x))
|
||||||
__sgn1l (__x)))
|
|
||||||
|
|
||||||
|
|
||||||
/* The argument range of the inline version of hypotl is slightly reduced. */
|
/* The argument range of the inline version of hypotl is slightly reduced. */
|
||||||
|
@ -581,7 +577,7 @@ __inline_mathcode2 (drem, __x, __y, \
|
||||||
|
|
||||||
|
|
||||||
/* This function is used in the `isfinite' macro. */
|
/* This function is used in the `isfinite' macro. */
|
||||||
__MATH_INLINE int __finite (double __x);
|
__MATH_INLINE int __finite (double __x) __attribute__ ((__const__));
|
||||||
__MATH_INLINE int
|
__MATH_INLINE int
|
||||||
__finite (double __x)
|
__finite (double __x)
|
||||||
{
|
{
|
||||||
|
@ -615,12 +611,14 @@ __inline_mathcode (__acosh1p, __x, \
|
||||||
|
|
||||||
|
|
||||||
/* This code is used internally in the GNU libc. */
|
/* This code is used internally in the GNU libc. */
|
||||||
#if 0
|
|
||||||
/* XXX I hate compiler bugs. The current version produces wrong code
|
|
||||||
if this optimization is used. */
|
|
||||||
#ifdef __LIBC_INTERNAL_MATH_INLINES
|
#ifdef __LIBC_INTERNAL_MATH_INLINES
|
||||||
__inline_mathop (__ieee754_sqrt, "fsqrt")
|
__inline_mathop (__ieee754_sqrt, "fsqrt")
|
||||||
#endif
|
__inline_mathcode2 (__ieee754_atan2, __y, __x,
|
||||||
|
register long double __value;
|
||||||
|
__asm __volatile__ ("fpatan\n\t"
|
||||||
|
: "=t" (__value)
|
||||||
|
: "0" (__x), "u" (__y) : "st(1)");
|
||||||
|
return __value;)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <complex.h>
|
#include <complex.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "math_private.h"
|
||||||
|
|
||||||
__complex__ float
|
__complex__ float
|
||||||
__cacoshf (__complex__ float x)
|
__cacoshf (__complex__ float x)
|
||||||
|
@ -66,6 +67,7 @@ __cacoshf (__complex__ float x)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
__complex__ float y;
|
__complex__ float y;
|
||||||
|
|
||||||
__real__ y = (__real__ x - __imag__ x) * (__real__ x + __imag__ x) - 1.0;
|
__real__ y = (__real__ x - __imag__ x) * (__real__ x + __imag__ x) - 1.0;
|
||||||
|
@ -77,6 +79,19 @@ __cacoshf (__complex__ float x)
|
||||||
__imag__ y += __imag__ x;
|
__imag__ y += __imag__ x;
|
||||||
|
|
||||||
res = __clogf (y);
|
res = __clogf (y);
|
||||||
|
#else
|
||||||
|
float re2 = __real__ x * __real__ x;
|
||||||
|
float im2 = __imag__ x * __imag__ x;
|
||||||
|
float sq = re2 - im2 - 1.0;
|
||||||
|
float ro = __ieee754_sqrtf (sq * sq + 4 * re2 * im2);
|
||||||
|
float a = __ieee754_sqrtf ((sq + ro) / 2.0);
|
||||||
|
float b = __ieee754_sqrtf ((-sq + ro) / 2.0);
|
||||||
|
|
||||||
|
__real__ res = 0.5 * __ieee754_logf (re2 + __real__ x * 2 * a
|
||||||
|
+ im2 + __imag__ x * 2 * b
|
||||||
|
+ ro);
|
||||||
|
__imag__ res = __ieee754_atan2f (__imag__ x + b, __real__ x + a);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -69,7 +69,7 @@ __catan (__complex__ double x)
|
||||||
|
|
||||||
den = 1 - r2 - __imag__ x * __imag__ x;
|
den = 1 - r2 - __imag__ x * __imag__ x;
|
||||||
|
|
||||||
__real__ res = 0.5 * __atan ((2.0 * __real__ x) / den);
|
__real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den);
|
||||||
|
|
||||||
num = __imag__ x + 1.0;
|
num = __imag__ x + 1.0;
|
||||||
num = r2 + num * num;
|
num = r2 + num * num;
|
||||||
|
|
|
@ -69,7 +69,7 @@ __catanf (__complex__ float x)
|
||||||
|
|
||||||
den = 1 - r2 - __imag__ x * __imag__ x;
|
den = 1 - r2 - __imag__ x * __imag__ x;
|
||||||
|
|
||||||
__real__ res = 0.5 * __atanf ((2.0 * __real__ x) / den);
|
__real__ res = 0.5 * __ieee754_atan2f (2.0 * __real__ x, den);
|
||||||
|
|
||||||
num = __imag__ x + 1.0;
|
num = __imag__ x + 1.0;
|
||||||
num = r2 + num * num;
|
num = r2 + num * num;
|
||||||
|
|
|
@ -62,17 +62,17 @@ __catanh (__complex__ double x)
|
||||||
|
|
||||||
i2 = __imag__ x * __imag__ x;
|
i2 = __imag__ x * __imag__ x;
|
||||||
|
|
||||||
num = 1.0 - __real__ x;
|
num = 1.0 + __real__ x;
|
||||||
num = i2 + num * num;
|
num = i2 + num * num;
|
||||||
|
|
||||||
den = 1.0 + __real__ x;
|
den = 1.0 - __real__ x;
|
||||||
den = i2 + den * den;
|
den = i2 + den * den;
|
||||||
|
|
||||||
__real__ res = 0.25 * __ieee754_log (num / den);
|
__real__ res = 0.25 * (__ieee754_log (num) - __ieee754_log (den));
|
||||||
|
|
||||||
den = 1 - __real__ x * __real__ x - i2;
|
den = 1 - __real__ x * __real__ x - i2;
|
||||||
|
|
||||||
__imag__ res = 0.5 * __atan ((2.0 * __imag__ x) / den);
|
__imag__ res = 0.5 * __ieee754_atan2 (2.0 * __imag__ x, den);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -62,17 +62,17 @@ __catanhf (__complex__ float x)
|
||||||
|
|
||||||
i2 = __imag__ x * __imag__ x;
|
i2 = __imag__ x * __imag__ x;
|
||||||
|
|
||||||
num = 1.0 - __real__ x;
|
num = 1.0 + __real__ x;
|
||||||
num = i2 + num * num;
|
num = i2 + num * num;
|
||||||
|
|
||||||
den = 1.0 + __real__ x;
|
den = 1.0 - __real__ x;
|
||||||
den = i2 + den * den;
|
den = i2 + den * den;
|
||||||
|
|
||||||
__real__ res = 0.25 * __ieee754_logf (num / den);
|
__real__ res = 0.25 * (__ieee754_logf (num) - __ieee754_logf (den));
|
||||||
|
|
||||||
den = 1 - __real__ x * __real__ x - i2;
|
den = 1 - __real__ x * __real__ x - i2;
|
||||||
|
|
||||||
__imag__ res = 0.5 * __atanf ((2.0 * __imag__ x) / den);
|
__imag__ res = 0.5 * __ieee754_atan2f (2.0 * __imag__ x, den);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -62,17 +62,17 @@ __catanhl (__complex__ long double x)
|
||||||
|
|
||||||
i2 = __imag__ x * __imag__ x;
|
i2 = __imag__ x * __imag__ x;
|
||||||
|
|
||||||
num = 1.0 - __real__ x;
|
num = 1.0 + __real__ x;
|
||||||
num = i2 + num * num;
|
num = i2 + num * num;
|
||||||
|
|
||||||
den = 1.0 + __real__ x;
|
den = 1.0 - __real__ x;
|
||||||
den = i2 + den * den;
|
den = i2 + den * den;
|
||||||
|
|
||||||
__real__ res = 0.25 * __ieee754_logl (num / den);
|
__real__ res = 0.25 * (__ieee754_logl (num) - __ieee754_logl (den));
|
||||||
|
|
||||||
den = 1 - __real__ x * __real__ x - i2;
|
den = 1 - __real__ x * __real__ x - i2;
|
||||||
|
|
||||||
__imag__ res = 0.5 * __atanl ((2.0 * __imag__ x) / den);
|
__imag__ res = 0.5 * __ieee754_atan2l (2.0 * __imag__ x, den);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -69,7 +69,7 @@ __catanl (__complex__ long double x)
|
||||||
|
|
||||||
den = 1 - r2 - __imag__ x * __imag__ x;
|
den = 1 - r2 - __imag__ x * __imag__ x;
|
||||||
|
|
||||||
__real__ res = 0.5 * __atanl ((2.0 * __real__ x) / den);
|
__real__ res = 0.5 * __ieee754_atan2l (2.0 * __real__ x, den);
|
||||||
|
|
||||||
num = __imag__ x + 1.0;
|
num = __imag__ x + 1.0;
|
||||||
num = r2 + num * num;
|
num = r2 + num * num;
|
||||||
|
|
|
@ -44,7 +44,7 @@ __clog10 (__complex__ double x)
|
||||||
/* Neither real nor imaginary part is NaN. */
|
/* Neither real nor imaginary part is NaN. */
|
||||||
__real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,
|
__real__ result = __ieee754_log10 (__ieee754_hypot (__real__ x,
|
||||||
__imag__ x));
|
__imag__ x));
|
||||||
__imag__ result = __ieee754_atan2 (__imag__ x, __real__ x);
|
__imag__ result = M_LOG10E * __ieee754_atan2 (__imag__ x, __real__ x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ __clog10f (__complex__ float x)
|
||||||
/* Neither real nor imaginary part is NaN. */
|
/* Neither real nor imaginary part is NaN. */
|
||||||
__real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x,
|
__real__ result = __ieee754_log10f (__ieee754_hypotf (__real__ x,
|
||||||
__imag__ x));
|
__imag__ x));
|
||||||
__imag__ result = __ieee754_atan2f (__imag__ x, __real__ x);
|
__imag__ result = M_LOG10E * __ieee754_atan2f (__imag__ x, __real__ x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Compute complex natural logarithm.
|
/* Compute complex base 10 logarithm.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
@ -44,7 +44,7 @@ __clog10l (__complex__ long double x)
|
||||||
/* Neither real nor imaginary part is NaN. */
|
/* Neither real nor imaginary part is NaN. */
|
||||||
__real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x,
|
__real__ result = __ieee754_log10l (__ieee754_hypotl (__real__ x,
|
||||||
__imag__ x));
|
__imag__ x));
|
||||||
__imag__ result = __ieee754_atan2l (__imag__ x, __real__ x);
|
__imag__ result = M_LOG10E * __ieee754_atan2l (__imag__ x, __real__ x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,8 +64,9 @@ typedef unsigned int fexcept_t;
|
||||||
corresponds to the layout of the block written by `fmovem'. */
|
corresponds to the layout of the block written by `fmovem'. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
fexcept_t control_register;
|
unsigned int control_register;
|
||||||
fexcept_t status_register;
|
unsigned int status_register;
|
||||||
|
unsigned int instruction_address;
|
||||||
}
|
}
|
||||||
fenv_t;
|
fenv_t;
|
||||||
|
|
||||||
|
|
|
@ -138,13 +138,20 @@ __inline_mathop(__tan, tan)
|
||||||
__inline_mathop(__tanh, tanh)
|
__inline_mathop(__tanh, tanh)
|
||||||
__inline_mathop(__fabs, abs)
|
__inline_mathop(__fabs, abs)
|
||||||
|
|
||||||
|
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
|
||||||
__inline_mathop(__rint, int)
|
__inline_mathop(__rint, int)
|
||||||
__inline_mathop(__expm1, etoxm1)
|
__inline_mathop(__expm1, etoxm1)
|
||||||
__inline_mathop(__log1p, lognp1)
|
__inline_mathop(__log1p, lognp1)
|
||||||
__inline_mathop(__significand, getman)
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_MISC
|
||||||
|
__inline_mathop(__significand, getman)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_ISOC9X
|
||||||
__inline_mathop(__log2, log2)
|
__inline_mathop(__log2, log2)
|
||||||
__inline_mathop(__trunc, intrz)
|
__inline_mathop(__trunc, intrz)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
|
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
|
||||||
|
|
||||||
|
@ -272,8 +279,18 @@ __m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) \
|
||||||
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
|
__asm __volatile__ ("fmove%.l %0, %!" : /* No outputs. */ \
|
||||||
: "dmi" (__ctrl_reg)); \
|
: "dmi" (__ctrl_reg)); \
|
||||||
return __result; \
|
return __result; \
|
||||||
} \
|
}
|
||||||
\
|
|
||||||
|
__inline_functions(double,)
|
||||||
|
#if defined __USE_MISC || defined __USE_ISOC9X
|
||||||
|
__inline_functions(float,f)
|
||||||
|
__inline_functions(long double,l)
|
||||||
|
#endif
|
||||||
|
#undef __inline_functions
|
||||||
|
|
||||||
|
#ifdef __USE_MISC
|
||||||
|
|
||||||
|
# define __inline_functions(float_type, s) \
|
||||||
__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
|
__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
|
||||||
{ \
|
{ \
|
||||||
/* There is no branch-condition for infinity, \
|
/* There is no branch-condition for infinity, \
|
||||||
|
@ -284,14 +301,6 @@ __m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) \
|
||||||
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
|
return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
|
|
||||||
{ \
|
|
||||||
char __result; \
|
|
||||||
__asm("ftst%.x %1\n" \
|
|
||||||
"fsun %0" : "=dm" (__result) : "f" (__value)); \
|
|
||||||
return __result; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
|
__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
|
||||||
{ \
|
{ \
|
||||||
/* There is no branch-condition for infinity, so we must extract and \
|
/* There is no branch-condition for infinity, so we must extract and \
|
||||||
|
@ -302,6 +311,44 @@ __m81_defun (int, __CONCAT(__finite,s), (float_type __value)) \
|
||||||
return (__fpsr & (3 << 24)) == 0; \
|
return (__fpsr & (3 << 24)) == 0; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
__m81_defun (float_type, __CONCAT(__scalbn,s), \
|
||||||
|
(float_type __x, int __n)) \
|
||||||
|
{ \
|
||||||
|
float_type __result; \
|
||||||
|
__asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \
|
||||||
|
return __result; \
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline_functions(double,)
|
||||||
|
__inline_functions(float,f)
|
||||||
|
__inline_functions(long double,l)
|
||||||
|
# undef __inline_functions
|
||||||
|
|
||||||
|
#endif /* Use misc. */
|
||||||
|
|
||||||
|
#if defined __USE_MISC || defined __USE_XOPEN
|
||||||
|
|
||||||
|
# define __inline_functions(float_type, s) \
|
||||||
|
__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) \
|
||||||
|
{ \
|
||||||
|
char __result; \
|
||||||
|
__asm("ftst%.x %1\n" \
|
||||||
|
"fsun %0" : "=dm" (__result) : "f" (__value)); \
|
||||||
|
return __result; \
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline_functions(double,)
|
||||||
|
# ifdef __USE_MISC
|
||||||
|
__inline_functions(float,f)
|
||||||
|
__inline_functions(long double,l)
|
||||||
|
# endif
|
||||||
|
# undef __inline_functions
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_ISOC9X
|
||||||
|
|
||||||
|
# define __inline_functions(float_type, s) \
|
||||||
__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
|
__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
|
||||||
{ \
|
{ \
|
||||||
/* There is no branch-condition for the sign bit, so we must extract \
|
/* There is no branch-condition for the sign bit, so we must extract \
|
||||||
|
@ -312,14 +359,6 @@ __m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) \
|
||||||
return (__fpsr >> 27) & 1; \
|
return (__fpsr >> 27) & 1; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
__m81_defun (float_type, __CONCAT(__scalbn,s), \
|
|
||||||
(float_type __x, int __n)) \
|
|
||||||
{ \
|
|
||||||
float_type __result; \
|
|
||||||
__asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x)); \
|
|
||||||
return __result; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
__m81_defun (float_type, __CONCAT(__scalbln,s), \
|
__m81_defun (float_type, __CONCAT(__scalbln,s), \
|
||||||
(float_type __x, long int __n)) \
|
(float_type __x, long int __n)) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -347,14 +386,6 @@ __m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) \
|
||||||
return __result; \
|
return __result; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
__m81_inline void \
|
|
||||||
__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
|
|
||||||
float_type *__cosx) \
|
|
||||||
{ \
|
|
||||||
__asm ("fsincos%.x %2,%1:%0" \
|
|
||||||
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
__m81_inline float_type \
|
__m81_inline float_type \
|
||||||
__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
|
__m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
|
||||||
float_type __z) \
|
float_type __z) \
|
||||||
|
@ -362,12 +393,31 @@ __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y, \
|
||||||
return (__x * __y) + __z; \
|
return (__x * __y) + __z; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This defines the three variants of the inline functions. */
|
|
||||||
__inline_functions (double,)
|
__inline_functions (double,)
|
||||||
__inline_functions (float,f)
|
__inline_functions (float,f)
|
||||||
__inline_functions (long double,l)
|
__inline_functions (long double,l)
|
||||||
# undef __inline_functions
|
# undef __inline_functions
|
||||||
|
|
||||||
|
#endif /* Use ISO C9x */
|
||||||
|
|
||||||
|
#ifdef __USE_GNU
|
||||||
|
|
||||||
|
# define __inline_functions(float_type, s) \
|
||||||
|
__m81_inline void \
|
||||||
|
__m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx, \
|
||||||
|
float_type *__cosx) \
|
||||||
|
{ \
|
||||||
|
__asm ("fsincos%.x %2,%1:%0" \
|
||||||
|
: "=f" (*__sinx), "=f" (*__cosx) : "f" (__x)); \
|
||||||
|
}
|
||||||
|
|
||||||
|
__inline_functions (double,)
|
||||||
|
__inline_functions (float,f)
|
||||||
|
__inline_functions (long double,l)
|
||||||
|
# undef __inline_functions
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
|
#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
|
||||||
|
|
||||||
/* Define inline versions of the user visible functions. */
|
/* Define inline versions of the user visible functions. */
|
||||||
|
|
|
@ -23,5 +23,5 @@
|
||||||
void
|
void
|
||||||
fegetenv (fenv_t *envp)
|
fegetenv (fenv_t *envp)
|
||||||
{
|
{
|
||||||
__asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*envp));
|
__asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ feholdexcept (fenv_t *envp)
|
||||||
fexcept_t fpcr, fpsr;
|
fexcept_t fpcr, fpsr;
|
||||||
|
|
||||||
/* Store the environment. */
|
/* Store the environment. */
|
||||||
__asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*envp));
|
__asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp));
|
||||||
|
|
||||||
/* Now clear all exceptions. */
|
/* Now clear all exceptions. */
|
||||||
fpsr = envp->status_register & ~FE_ALL_EXCEPT;
|
fpsr = envp->status_register & ~FE_ALL_EXCEPT;
|
||||||
|
|
|
@ -29,7 +29,7 @@ fesetenv (const fenv_t *envp)
|
||||||
values which we do not want to come from the saved environment.
|
values which we do not want to come from the saved environment.
|
||||||
Therefore, we get the current environment and replace the values
|
Therefore, we get the current environment and replace the values
|
||||||
we want to use from the environment specified by the parameter. */
|
we want to use from the environment specified by the parameter. */
|
||||||
__asm__ ("fmovem%.l %/fpcr/%/fpsr,%0" : "=m" (*&temp));
|
__asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*&temp));
|
||||||
|
|
||||||
temp.status_register &= ~FE_ALL_EXCEPT;
|
temp.status_register &= ~FE_ALL_EXCEPT;
|
||||||
temp.control_register &= ~((FE_ALL_EXCEPT << 6) | FE_UPWARD);
|
temp.control_register &= ~((FE_ALL_EXCEPT << 6) | FE_UPWARD);
|
||||||
|
@ -44,5 +44,5 @@ fesetenv (const fenv_t *envp)
|
||||||
temp.status_register |= envp->status_register & FE_ALL_EXCEPT;
|
temp.status_register |= envp->status_register & FE_ALL_EXCEPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
__asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr" : : "m" (temp));
|
__asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr/%/fpiar" : : "m" (*&temp));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,118 @@
|
||||||
|
/* Pseudo implementation of waitid.
|
||||||
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 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 <errno.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
waitid (idtype, id, infop, options)
|
||||||
|
idtype_t idtype;
|
||||||
|
id_t id;
|
||||||
|
siginfo_t *infop;
|
||||||
|
int options;
|
||||||
|
{
|
||||||
|
pid_t pid, child;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
switch (idtype)
|
||||||
|
{
|
||||||
|
case P_PID:
|
||||||
|
if(id <= 0)
|
||||||
|
goto invalid;
|
||||||
|
pid = (pid_t) id;
|
||||||
|
break;
|
||||||
|
case P_PGID:
|
||||||
|
if (id < 0 || id == 1)
|
||||||
|
goto invalid;
|
||||||
|
pid = (pid_t) -id;
|
||||||
|
break;
|
||||||
|
case P_ALL:
|
||||||
|
pid = -1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
invalid:
|
||||||
|
__set_errno (EINVAL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Technically we're supposed to return EFAULT if infop is bogus,
|
||||||
|
but that would involve mucking with signals, which is
|
||||||
|
too much hassle. User will have to deal with SIGSEGV/SIGBUS.
|
||||||
|
We just check for a null pointer. */
|
||||||
|
|
||||||
|
if (infop == NULL)
|
||||||
|
{
|
||||||
|
__set_errno (EFAULT);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
child = waitpid (pid, &status, options);
|
||||||
|
|
||||||
|
if (child == -1)
|
||||||
|
/* `waitpid' set `errno' for us. */
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (child == 0)
|
||||||
|
{
|
||||||
|
/* The WHOHANG bit in OPTIONS is set and there are children available
|
||||||
|
but none has a status for us. The XPG docs do not mention this
|
||||||
|
case so we clear the `siginfo_t' struct and return succesfully. */
|
||||||
|
infop->si_signo = 0;
|
||||||
|
infop->si_code = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Decode the status field and set infop members... */
|
||||||
|
infop->si_signo = SIGCHLD;
|
||||||
|
infop->si_pid = child;
|
||||||
|
infop->si_errno = 0;
|
||||||
|
|
||||||
|
if (WIFEXITED (status))
|
||||||
|
{
|
||||||
|
infop->si_code = CLD_EXITED;
|
||||||
|
infop->si_status = WEXITSTATUS (status);
|
||||||
|
}
|
||||||
|
else if (WIFSIGNALED (status))
|
||||||
|
{
|
||||||
|
infop->si_code = WCOREDUMP (status) ? CLD_DUMPED : CLD_KILLED;
|
||||||
|
infop->si_status = WTERMSIG (status);
|
||||||
|
}
|
||||||
|
else if (WIFSTOPPED (status))
|
||||||
|
{
|
||||||
|
infop->si_code = CLD_STOPPED;
|
||||||
|
infop->si_status = WSTOPSIG (status);
|
||||||
|
}
|
||||||
|
#ifdef WIFCONTINUED
|
||||||
|
else if (WIFCONTINUED (status))
|
||||||
|
{
|
||||||
|
infop->si_code = CLD_CONTINUED;
|
||||||
|
infop->si_status = SIGCONT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
/* Can't happen. */
|
||||||
|
assert (! "What?");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -52,6 +52,13 @@
|
||||||
# define EISDIR 24
|
# define EISDIR 24
|
||||||
# define EOPNOTSUPP 25 /* Operation not supported. */
|
# define EOPNOTSUPP 25 /* Operation not supported. */
|
||||||
# define ENOTTY 26
|
# define ENOTTY 26
|
||||||
|
# define EAGAIN 27
|
||||||
|
# define EIO 28
|
||||||
|
# define ENOSPC 29
|
||||||
|
# define EEXIST 30
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define __set_errno(val) errno = (val)
|
#define __set_errno(val) errno = (val)
|
||||||
|
|
||||||
|
/* Function to get address of global `errno' variable. */
|
||||||
|
extern int *__errno_location __P ((void)) __attribute__ ((__const__));
|
||||||
|
|
|
@ -67,6 +67,12 @@ endif
|
||||||
ifeq ($(subdir),stdio-common)
|
ifeq ($(subdir),stdio-common)
|
||||||
# Just disable the auto generation in sysdeps/generic
|
# Just disable the auto generation in sysdeps/generic
|
||||||
inhibit-siglist := yes
|
inhibit-siglist := yes
|
||||||
|
|
||||||
|
ifeq ($(versioning),yes)
|
||||||
|
aux += oldsiglist
|
||||||
|
endif
|
||||||
|
|
||||||
|
shared-only-routines += oldsiglist
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),inet)
|
ifeq ($(subdir),inet)
|
||||||
|
@ -111,8 +117,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(subdir),signal)
|
ifeq ($(subdir),signal)
|
||||||
sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
|
sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
|
||||||
rt_sigqueueinfo rt_sigaction rt_sigpending \
|
rt_sigqueueinfo rt_sigaction rt_sigpending
|
||||||
rt_sigreturn
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
common-generated += bits/stdio_lim.h bits/stdio_lim.d
|
common-generated += bits/stdio_lim.h bits/stdio_lim.d
|
||||||
|
|
|
@ -48,6 +48,9 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
||||||
#define _G_HAVE_PRINTF_FP 1
|
#define _G_HAVE_PRINTF_FP 1
|
||||||
#define _G_HAVE_MMAP 1
|
#define _G_HAVE_MMAP 1
|
||||||
#define _G_HAVE_LONG_DOUBLE_IO 1
|
#define _G_HAVE_LONG_DOUBLE_IO 1
|
||||||
|
#define _G_HAVE_IO_FILE_OPEN 1
|
||||||
|
|
||||||
|
#define _G_IO_IO_FILE_VERSION 0x20001
|
||||||
|
|
||||||
#define _G_OPEN64 open64
|
#define _G_OPEN64 open64
|
||||||
#define _G_LSEEK64 lseek64
|
#define _G_LSEEK64 lseek64
|
||||||
|
@ -66,7 +69,7 @@ typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
||||||
#define _G_VTABLE_LABEL_PREFIX_ID __vt_
|
#define _G_VTABLE_LABEL_PREFIX_ID __vt_
|
||||||
|
|
||||||
|
|
||||||
#if defined (__cplusplus) || defined (__STDC__)
|
#if defined __cplusplus || defined __STDC__
|
||||||
# define _G_ARGS(ARGLIST) ARGLIST
|
# define _G_ARGS(ARGLIST) ARGLIST
|
||||||
#else
|
#else
|
||||||
# define _G_ARGS(ARGLIST) ()
|
# define _G_ARGS(ARGLIST) ()
|
||||||
|
|
|
@ -62,6 +62,7 @@ typedef __uint32_t __fsblkcnt_t; /* Type to count file system blocks. */
|
||||||
typedef __uint64_t __fsblkcnt64_t; /* "" (LFS) */
|
typedef __uint64_t __fsblkcnt64_t; /* "" (LFS) */
|
||||||
typedef __uint64_t __fsfilcnt_t; /* Type to count file system inodes. */
|
typedef __uint64_t __fsfilcnt_t; /* Type to count file system inodes. */
|
||||||
typedef __uint64_t __fsfilcnt64_t; /* "" (LFS) */
|
typedef __uint64_t __fsfilcnt64_t; /* "" (LFS) */
|
||||||
|
typedef __uint32_t __id_t; /* General type for IDs. */
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -90,7 +91,7 @@ typedef unsigned long int __fd_mask;
|
||||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||||
#define __NFDBITS (8 * sizeof (__fd_mask))
|
#define __NFDBITS (8 * sizeof (__fd_mask))
|
||||||
#define __FDELT(d) ((d) / __NFDBITS)
|
#define __FDELT(d) ((d) / __NFDBITS)
|
||||||
#define __FDMASK(d) (1 << ((d) % __NFDBITS))
|
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
|
||||||
|
|
||||||
/* fd_set for select and pselect. */
|
/* fd_set for select and pselect. */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* This is the sigaction struction from the Linux 2.1.20 kernel. */
|
/* This is the sigaction struction from the Linux 2.1.20 kernel. */
|
||||||
|
|
||||||
struct kernel_sigaction {
|
struct old_kernel_sigaction {
|
||||||
__sighandler_t sa_handler;
|
__sighandler_t sa_handler;
|
||||||
unsigned long sa_mask;
|
unsigned long sa_mask;
|
||||||
unsigned int sa_flags;
|
unsigned int sa_flags;
|
||||||
|
|
|
@ -17,10 +17,21 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#ifndef _SIGNAL_H
|
#if !defined _SIGNAL_H && !defined __need_siginfo_t
|
||||||
# error "Never include this file directly. Use <signal.h> instead"
|
# error "Never include this file directly. Use <signal.h> instead"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (!defined __have_siginfo_t \
|
||||||
|
&& (defined _SIGNAL_H || defined __need_siginfo_t))
|
||||||
|
# define __have_siginfo_t 1
|
||||||
|
|
||||||
|
/* Type for data associated with a signal. */
|
||||||
|
typedef union sigval
|
||||||
|
{
|
||||||
|
int sival_int;
|
||||||
|
void *sival_ptr;
|
||||||
|
} sigval_t;
|
||||||
|
|
||||||
# define SI_MAX_SIZE 128
|
# define SI_MAX_SIZE 128
|
||||||
# define SI_PAD_SIZE ((SI_MAX_SIZE / sizeof (int)) - 3)
|
# define SI_PAD_SIZE ((SI_MAX_SIZE / sizeof (int)) - 3)
|
||||||
|
|
||||||
|
@ -218,6 +229,12 @@ enum
|
||||||
# define POLL_HUP POLL_HUP
|
# define POLL_HUP POLL_HUP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# undef __need_siginfo_t
|
||||||
|
#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined _SIGNAL_H && !defined __have_sigevent_t
|
||||||
|
# define __have_sigevent_t 1
|
||||||
|
|
||||||
/* Structure to transport application-defined values with signals. */
|
/* Structure to transport application-defined values with signals. */
|
||||||
# define SIGEV_MAX_SIZE 64
|
# define SIGEV_MAX_SIZE 64
|
||||||
|
@ -255,3 +272,5 @@ enum
|
||||||
SIGEV_THREAD /* Deliver via thread creation. */
|
SIGEV_THREAD /* Deliver via thread creation. */
|
||||||
# define SIGEV_THREAD SIGEV_THREAD
|
# define SIGEV_THREAD SIGEV_THREAD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* have _SIGNAL_H. */
|
||||||
|
|
|
@ -67,6 +67,7 @@ typedef int __pid_t; /* Type of process identifications. */
|
||||||
typedef int __ssize_t; /* Type of a byte count, or error. */
|
typedef int __ssize_t; /* Type of a byte count, or error. */
|
||||||
typedef long int __rlim_t; /* Type of resource counts. */
|
typedef long int __rlim_t; /* Type of resource counts. */
|
||||||
typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
|
typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
|
||||||
|
typedef __u_int __id_t; /* General type for ID. */
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -90,7 +91,7 @@ typedef unsigned long int __fd_mask;
|
||||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||||
#define __NFDBITS (8 * sizeof (__fd_mask))
|
#define __NFDBITS (8 * sizeof (__fd_mask))
|
||||||
#define __FDELT(d) ((d) / __NFDBITS)
|
#define __FDELT(d) ((d) / __NFDBITS)
|
||||||
#define __FDMASK(d) (1 << ((d) % __NFDBITS))
|
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
|
||||||
|
|
||||||
/* fd_set for select and pselect. */
|
/* fd_set for select and pselect. */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <init-first.h>
|
#include <init-first.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
extern void __libc_init_secure (void);
|
||||||
extern void __libc_init (int, char **, char **);
|
extern void __libc_init (int, char **, char **);
|
||||||
extern void __libc_global_ctors (void);
|
extern void __libc_global_ctors (void);
|
||||||
|
|
||||||
|
@ -42,8 +43,9 @@ int __libc_multiple_libcs = 1;
|
||||||
int __libc_argc;
|
int __libc_argc;
|
||||||
char **__libc_argv;
|
char **__libc_argv;
|
||||||
|
|
||||||
/* We often need the PID. Cache this value. */
|
/* We often need the UID and PID. Cache these values. */
|
||||||
pid_t __libc_pid = 0xf00baa;
|
pid_t __libc_pid = 0xf00baa;
|
||||||
|
uid_t __libc_uid = 0xf00baa;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -71,6 +73,10 @@ init (int argc, char **argv, char **envp)
|
||||||
__libc_argv = argv;
|
__libc_argv = argv;
|
||||||
__environ = envp;
|
__environ = envp;
|
||||||
|
|
||||||
|
#ifndef PIC
|
||||||
|
__libc_init_secure ();
|
||||||
|
#endif
|
||||||
|
|
||||||
__libc_init (argc, argv, envp);
|
__libc_init (argc, argv, envp);
|
||||||
|
|
||||||
/* This is a hack to make the special getopt in GNU libc working. */
|
/* This is a hack to make the special getopt in GNU libc working. */
|
||||||
|
|
|
@ -1,6 +1,25 @@
|
||||||
#ifndef __NET_SLIP_H
|
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||||
#define __NET_SLIP_H 1
|
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.
|
||||||
|
|
||||||
|
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. */
|
||||||
|
|
||||||
|
#ifndef _NET_IF_SLIP_H
|
||||||
|
#define _NET_IF_SLIP_H 1
|
||||||
|
|
||||||
|
/* We can use the kernel header. */
|
||||||
#include <linux/if_slip.h>
|
#include <linux/if_slip.h>
|
||||||
|
|
||||||
#endif
|
#endif /* net/if_slip.h. */
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
const char * const __old_sys_siglist[32] =
|
||||||
|
{
|
||||||
|
#define init_sig(sig, abbrev, desc) [sig] desc,
|
||||||
|
#include "siglist.h"
|
||||||
|
#undef init_sig
|
||||||
|
};
|
||||||
|
|
||||||
|
const char * const __old_sys_sigabbrev[32] =
|
||||||
|
{
|
||||||
|
#define init_sig(sig, abbrev, desc) [sig] abbrev,
|
||||||
|
#include "siglist.h"
|
||||||
|
#undef init_sig
|
||||||
|
};
|
||||||
|
|
||||||
|
strong_alias (__old_sys_siglist, _old_sys_siglist)
|
||||||
|
symbol_version (__old_sys_siglist, _sys_siglist, GLIBC_2.0);
|
||||||
|
symbol_version (_old_sys_siglist, sys_siglist, GLIBC_2.0);
|
||||||
|
symbol_version (__old_sys_sigabbrev, sys_sigabbrev, GLIBC_2.0);
|
|
@ -16,6 +16,7 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
/* The difference here is that the sigaction structure used in the
|
/* The difference here is that the sigaction structure used in the
|
||||||
|
@ -23,9 +24,9 @@
|
||||||
translate it here. */
|
translate it here. */
|
||||||
#include <kernel_sigaction.h>
|
#include <kernel_sigaction.h>
|
||||||
|
|
||||||
extern int __syscall_sigaction (int, const struct kernel_sigaction *,
|
extern int __syscall_sigaction (int, const struct old_kernel_sigaction *,
|
||||||
struct kernel_sigaction *);
|
struct old_kernel_sigaction *);
|
||||||
extern int __syscall_rt_signal (int, const struct sigaction *,
|
extern int __syscall_rt_sigaction (int, const struct sigaction *,
|
||||||
struct sigaction *, size_t);
|
struct sigaction *, size_t);
|
||||||
|
|
||||||
/* The variable is shared between all wrappers around signal handling
|
/* The variable is shared between all wrappers around signal handling
|
||||||
|
|
|
@ -1,19 +1,26 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
const char * const _sys_siglist[NSIG] =
|
const char * const __new_sys_siglist[NSIG] =
|
||||||
{
|
{
|
||||||
#define init_sig(sig, abbrev, desc) [sig] desc,
|
#define init_sig(sig, abbrev, desc) [sig] desc,
|
||||||
#include "siglist.h"
|
#include "siglist.h"
|
||||||
#undef init_sig
|
#undef init_sig
|
||||||
};
|
};
|
||||||
|
|
||||||
const char * const _sys_sigabbrev[NSIG] =
|
const char * const __new_sys_sigabbrev[NSIG] =
|
||||||
{
|
{
|
||||||
#define init_sig(sig, abbrev, desc) [sig] abbrev,
|
#define init_sig(sig, abbrev, desc) [sig] abbrev,
|
||||||
#include "siglist.h"
|
#include "siglist.h"
|
||||||
#undef init_sig
|
#undef init_sig
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef DO_VERSIONING
|
||||||
|
strong_alias (__new_sys_siglist, _new_sys_siglist)
|
||||||
|
default_symbol_version (__new_sys_siglist, _sys_siglist, GLIBC_2.1);
|
||||||
|
default_symbol_version (_new_sys_siglist, sys_siglist, GLIBC_2.1);
|
||||||
|
default_symbol_version (__new_sys_sigabbrev, sys_sigabbrev, GLIBC_2.1);
|
||||||
|
#else
|
||||||
weak_alias(_sys_siglist, sys_siglist)
|
weak_alias(_sys_siglist, sys_siglist)
|
||||||
weak_alias(_sys_sigabbrev, sys_sigabbrev)
|
weak_alias(_sys_sigabbrev, sys_sigabbrev)
|
||||||
|
#endif
|
||||||
|
|
|
@ -44,6 +44,8 @@ __sigqueue (pid, sig, val)
|
||||||
__libc_pid = __getpid ();
|
__libc_pid = __getpid ();
|
||||||
info.si_pid = __libc_pid;
|
info.si_pid = __libc_pid;
|
||||||
|
|
||||||
|
if (__libc_uid ==0xf00baa)
|
||||||
|
__libc_pid = __getuid ();
|
||||||
info.si_uid = __libc_uid;
|
info.si_uid = __libc_uid;
|
||||||
|
|
||||||
info.si_value = val;
|
info.si_value = val;
|
||||||
|
|
|
@ -1,51 +1,3 @@
|
||||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
/* The sigreturn syscall cannot be explicitly called on Linux, only
|
||||||
This file is part of the GNU C Library.
|
implicitly by returning from a signal handler. */
|
||||||
|
#include <sysdeps/generic/sigreturn.c>
|
||||||
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 <errno.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
extern int __syscall_sigreturn (struct sigcontext *);
|
|
||||||
extern int __syscall_rt_sigreturn (struct sigcontext *, size_t);
|
|
||||||
|
|
||||||
/* The variable is shared between all wrappers around signal handling
|
|
||||||
functions which have RT equivalents. It is defined in sigsuspend.c. */
|
|
||||||
extern int __libc_have_rt_sigs;
|
|
||||||
|
|
||||||
|
|
||||||
/* Get and/or change the set of blocked signals. */
|
|
||||||
int
|
|
||||||
__sigreturn (scp)
|
|
||||||
struct sigcontext *scp;
|
|
||||||
{
|
|
||||||
/* First try the RT signals. */
|
|
||||||
if (__libc_have_rt_sigs)
|
|
||||||
{
|
|
||||||
/* 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);
|
|
||||||
|
|
||||||
if (result >= 0 || errno != ENOSYS)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
__libc_have_rt_sigs = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return __syscall_sigreturn (scp);
|
|
||||||
}
|
|
||||||
weak_alias (__sigprocmask, sigprocmask)
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ typedef int __pid_t; /* Type of process identifications. */
|
||||||
typedef long long int __ssize_t; /* Type of a byte count, or error. */
|
typedef long long int __ssize_t; /* Type of a byte count, or error. */
|
||||||
typedef long int __rlim_t; /* Type of resource counts. */
|
typedef long int __rlim_t; /* Type of resource counts. */
|
||||||
typedef long int __rlim64_t; /* Type of resource counts (LFS). */
|
typedef long int __rlim64_t; /* Type of resource counts (LFS). */
|
||||||
|
typedef __u_int __id_t; /* General type for IDs. */
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -82,7 +83,7 @@ typedef unsigned long int __fd_mask;
|
||||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||||
#define __NFDBITS (8 * sizeof (__fd_mask))
|
#define __NFDBITS (8 * sizeof (__fd_mask))
|
||||||
#define __FDELT(d) ((d) / __NFDBITS)
|
#define __FDELT(d) ((d) / __NFDBITS)
|
||||||
#define __FDMASK(d) (1 << ((d) % __NFDBITS))
|
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
|
||||||
|
|
||||||
/* fd_set for select and pselect. */
|
/* fd_set for select and pselect. */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -39,7 +39,6 @@ rt_sigaction - rt_sigaction 4 __syscall_rt_sigaction
|
||||||
rt_sigpending - rt_sigpending 2 __syscall_rt_sigpending
|
rt_sigpending - rt_sigpending 2 __syscall_rt_sigpending
|
||||||
rt_sigprocmask - rt_sigprocmask 4 __syscall_rt_sigprocmask
|
rt_sigprocmask - rt_sigprocmask 4 __syscall_rt_sigprocmask
|
||||||
rt_sigqueueinfo - rt_sigqueueinfo 3 __syscall_rt_sigqueueinfo
|
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_sigsuspend - rt_sigsuspend 2 __syscall_rt_sigsuspend
|
||||||
rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait
|
rt_sigtimedwait - rt_sigtimedwait 4 __syscall_rt_sigtimedwait
|
||||||
s_getdents EXTRA getdents 3 __getdents
|
s_getdents EXTRA getdents 3 __getdents
|
||||||
|
@ -52,7 +51,6 @@ s_reboot EXTRA reboot 3 __syscall_reboot
|
||||||
s_sigaction sigaction sigaction 3 __syscall_sigaction
|
s_sigaction sigaction sigaction 3 __syscall_sigaction
|
||||||
s_sigpending EXTRA sigpending 1 __syscall_sigpending
|
s_sigpending EXTRA sigpending 1 __syscall_sigpending
|
||||||
s_sigprocmask EXTRA sigprocmask 3 __syscall_sigprocmask
|
s_sigprocmask EXTRA sigprocmask 3 __syscall_sigprocmask
|
||||||
s_sigreturn sigreturn sigreturn 1 __syscall_sigreturn
|
|
||||||
s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend
|
s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend
|
||||||
s_sysctl sysctl _sysctl 1 __syscall__sysctl
|
s_sysctl sysctl _sysctl 1 __syscall__sysctl
|
||||||
s_ustat ustat ustat 2 __syscall_ustat
|
s_ustat ustat ustat 2 __syscall_ustat
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* This file just defines the current version number of libc. */
|
/* This file just defines the current version number of libc. */
|
||||||
|
|
||||||
#define RELEASE "experimental"
|
#define RELEASE "experimental"
|
||||||
#define VERSION "2.0.90"
|
#define VERSION "2.0.91"
|
||||||
|
|
|
@ -24,7 +24,7 @@ subdir := wctype
|
||||||
headers := wctype.h
|
headers := wctype.h
|
||||||
distribute := cname-lookup.h
|
distribute := cname-lookup.h
|
||||||
routines := wcfuncs wctype iswctype wctrans towctrans wcextra \
|
routines := wcfuncs wctype iswctype wctrans towctrans wcextra \
|
||||||
wcfuncs_l iswctype_l towctrans_l
|
wcfuncs_l iswctype_l towctrans_l wctype_l
|
||||||
|
|
||||||
tests := test_wctype
|
tests := test_wctype
|
||||||
|
|
||||||
|
|
|
@ -48,12 +48,20 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#define TEST(test) \
|
#define TEST(test) \
|
||||||
do \
|
do \
|
||||||
|
{ \
|
||||||
if ((is##test (ch) == 0) != (iswctype (ch, bit_##test) == 0)) \
|
if ((is##test (ch) == 0) != (iswctype (ch, bit_##test) == 0)) \
|
||||||
{ \
|
{ \
|
||||||
printf ("class `%s' test for character \\%o failed\n", \
|
printf ("`iswctype' class `%s' test " \
|
||||||
|
"for character \\%o failed\n", #test, ch); \
|
||||||
|
result = 1; \
|
||||||
|
} \
|
||||||
|
if ((is##test (ch) == 0) != (isw##test (ch) == 0)) \
|
||||||
|
{ \
|
||||||
|
printf ("`isw%s' test for character \\%o failed\n", \
|
||||||
#test, ch); \
|
#test, ch); \
|
||||||
result = 1; \
|
result = 1; \
|
||||||
} \
|
} \
|
||||||
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
TEST (alnum);
|
TEST (alnum);
|
||||||
|
|
|
@ -20,21 +20,24 @@
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include "../locale/localeinfo.h"
|
#include <locale/localeinfo.h>
|
||||||
|
|
||||||
wctype_t
|
wctype_t
|
||||||
wctype (const char *property)
|
wctype (const char *property)
|
||||||
{
|
{
|
||||||
const char *names;
|
const char *names;
|
||||||
wctype_t result;
|
wctype_t result;
|
||||||
|
size_t proplen = strlen (property);
|
||||||
|
|
||||||
names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS_NAMES);
|
names = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS_NAMES);
|
||||||
for (result = 1; result != 0; result <<= 1)
|
for (result = 1; result != 0; result <<= 1)
|
||||||
{
|
{
|
||||||
if (strcmp (property, names) == 0)
|
size_t nameslen = strlen (names);
|
||||||
|
|
||||||
|
if (proplen == nameslen && memcmp (property, names, proplen) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
names = strchr (names, '\0') + 1;
|
names += nameslen + 1;
|
||||||
if (names[0] == '\0')
|
if (names[0] == '\0')
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -42,9 +45,9 @@ wctype (const char *property)
|
||||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
# define SWAPU32(w) \
|
#define XSWAPU32(w) \
|
||||||
(((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24))
|
((((w) & 0xff00ff00) >> 8) | (((w) & 0xff00ff) << 8))
|
||||||
|
|
||||||
return SWAPU32 (result);
|
return XSWAPU32 (result);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue