From e7fd8a39abd3a9c9d2139e686b17efb5dc3bf444 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 27 Mar 1997 01:59:53 +0000 Subject: Update. 1997-03-27 02:28 Ulrich Drepper * gmon/gmon.c (monstartup): Mark all messages. (write_call_graph): Rewrite to use larger I/O vector for writev call to reduce syscall overhead. (write_bb_counts): Simplify writev handling. * inet/rexec.c: Make string parameters `const'. * resolv/netdb.h: Add prototypes for rcmd, rexec, ruserok, and rresvport. * math/Makefile: Don't define CFLAGS-* macros to prevent inlining in libm-test. * math/libm-test.c (this_does_nothing): Remove functions. It's notuseful on any platform but ix86. (inverse_func_pair_test): Don't use this_does_nothing. Use memory reference. (identities1_test): Likewise. (identities2_test): Likewise. (identities3_test): Likewise. (basic_test): Likewise. Patch by Andreas Schwab. (BUILD_COMPLEX): New macro. Create complex number from real and imaginary parts. This works around bugs/inefficiencies in current gcc. (cexp_test): Use BUILD_COMPLEX. Add more tests. * nss/nsswitch.c: Fix typo. * posix/glob.h: Add declaration for glob_pattern_p. * posix/glob.c: Rename glob_pattern_p to __glob_pattern_p and make glob_pattern_p a weak alias. This function is used in other packages (e.g. bash). * signal/Makefile (routines): Add sigisempty, sigandset, and sigorset. * signal/signal.h: Add prototypes for sigisempty, sigandset, and sigorset. * signal/sigisempty.c: New file. * signal/sigandset.c: New file. * signal/sigorset.c: New file. * sysdeps/generic/sigset.h: Define __sigisemptyset, __sigandset, and __sigorset. * sysdeps/unix/sysv/linux/sigset.h: Likewise. * stdlib/strtod.c: Handle `n-char-sequence' in NaN parsing. It determines the bits in the mantissa part of the NaN. * stdlib/strtof.c: Define SET_MANTISSA for float type. * wcsmbs/wcstof.c: Define SET_MANTISSA for float type. * stdlib/strtold.c: Define SET_MANTISSA for long double type. * wcsmbs/wcstold.c: Define SET_MANTISSA for long double type. * sysdeps/libm-ieee754/s_cexp.c: Use explicit assignment to complex number components. Some more corrects for special cases. * sysdeps/libm-ieee754/s_cexpf.c: Likewise. * sysdeps/libm-ieee754/s_cexpl.c: Likewise. * sysdeps/sparc/elf/start.S: Remove as per request of Miguel de Icaza. * sysdeps/unix/sysv/linux/netinet/icmp.h: Remove since we have ip_icmp.h. Reported by HJ Lu. 1997-03-25 03:50 Andreas Schwab * sysdeps/m68k/Makefile (CFLAGS-rtld.c): Add -Wno-unused. * sysdeps/m68k/dl-machine.h (elf_machine_rela): Rewritten as for i386. (elf_machine_lookup_noexec_p, elf_machine_lookup_noplt_p, ELF_MACHINE_RELOC_NOPLT): Define. 1997-03-25 03:48 Andreas Schwab * grp/grp.h: Include only once. 1997-03-25 09:38 Andreas Schwab * sysdeps/unix/sysv/linux/termbits.h (OXTABS): Don't define. * sysdeps/unix/sysv/linux/alpha/termbits.h (OXTABS): Likewise. * termios/sys/ttydefaults.h (TTYDEF_OFLAG): Use either OXTABS or TAB3, if one of them is defined. 1997-03-26 04:53 Ulrich Drepper * posix/glob.c (next_brace_sub): Decrement depth counter when '}' is found. Patch by Dennis Henriksen . 1997-03-25 16:25 Thorsten Kukuk * sunrpc/Makefile: Comment gccwarn out. * sunrpc/auth_none.c: Fix prototypes and parameters for compiling with enabled warnings. * sunrpc/auth_unix.c: Likewise. * sunrpc/authuxprot.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/clnt_gen.c: Likewise. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_simp.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/get_myaddr.c: Likewise. * sunrpc/getrpcport.c: Likewise. * sunrpc/pm_getmaps.c: Likewise. * sunrpc/pm_getport.c: Likewise. * sunrpc/pmap_clnt.c: Likewise. * sunrpc/pmap_prot.c: Likewise. * sunrpc/pmap_prot2.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/rpc/auth.h: Likewise. * sunrpc/rpc/clnt.h: Likewise. * sunrpc/rpc/pmap_clnt.h: Likewise. * sunrpc/rpc/svc.h: Likewise. * sunrpc/rpc/svc_auth.h: Likewise. * sunrpc/rpc/types.h: Likewise. * sunrpc/rpc/xdr.h: Likewise. * sunrpc/rpc_clntout.c: Likewise. * sunrpc/rpc_cmsg.c: Likewise. * sunrpc/rpc_dtable.c: Likewise. * sunrpc/rpc_prot.c: Likewise. * sunrpc/svc.c: Likewise. * sunrpc/svc_auth.c: Likewise. * sunrpc/svc_authux.c: Likewise. * sunrpc/svc_raw.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/xdr.c: Likewise. * sunrpc/xdr_array.c: Likewise. * sunrpc/xdr_mem.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * sunrpc/xdr_stdio.c: Likewise. 1997-03-25 13:39 Ulrich Drepper * math/libm-test.c (log2_test): Compile this function and call it. (exp2_test): Likewise, but check whether function really exists before testing. * math/Makefile (libm-calls): Add s_log2 and s_exp2. 1997-03-25 04:50 Ulrich Drepper Implement exp2 function. * sysdeps/libm-i387/s_exp2.S: New file. * sysdeps/libm-i387/s_exp2f.S: New file. * sysdeps/libm-i387/s_exp2l.S: New file. Implement log2 function. * sysdeps/libm-i387/s_log2.S: New file. * sysdeps/libm-i387/s_log2f.S: New file. * sysdeps/libm-i387/s_log2l.S: New file. * sysdeps/libm-ieee754/s_log2.c: New file. * sysdeps/libm-ieee754/s_log2f.c: New file. * sysdeps/stub/s_log2.c: New file. Stub version. --- ChangeLog | 160 ++++ PROJECTS | 2 +- gmon/gmon.c | 53 +- grp/grp.h | 3 - inet/rexec.c | 2 +- math/Makefile | 5 +- math/libm-test.c | 147 ++- nss/nsswitch.c | 4 +- posix/glob.c | 16 +- posix/glob.h | 12 +- resolv/netdb.h | 33 + signal/Makefile | 3 +- signal/sigandset.c | 36 + signal/sigisempty.c | 34 + signal/signal.h | 13 + signal/sigorset.c | 36 + stdlib/strtod.c | 25 +- stdlib/strtof.c | 6 + stdlib/strtold.c | 7 + sunrpc/Makefile | 16 +- sunrpc/auth_none.c | 135 +-- sunrpc/auth_unix.c | 415 ++++----- sunrpc/authuxprot.c | 36 +- sunrpc/bindrsvprt.c | 68 +- sunrpc/clnt_gen.c | 168 ++-- sunrpc/clnt_perr.c | 406 ++++---- sunrpc/clnt_raw.c | 313 ++++--- sunrpc/clnt_simp.c | 164 ++-- sunrpc/clnt_tcp.c | 682 +++++++------- sunrpc/clnt_udp.c | 647 ++++++------- sunrpc/get_myaddr.c | 69 +- sunrpc/getrpcport.c | 48 +- sunrpc/pm_getmaps.c | 53 +- sunrpc/pm_getport.c | 71 +- sunrpc/pmap_clnt.c | 99 +- sunrpc/pmap_prot.c | 26 +- sunrpc/pmap_prot2.c | 94 +- sunrpc/pmap_rmt.c | 568 ++++++------ sunrpc/rpc/auth.h | 38 +- sunrpc/rpc/clnt.h | 133 ++- sunrpc/rpc/pmap_clnt.h | 26 +- sunrpc/rpc/svc.h | 56 +- sunrpc/rpc/svc_auth.h | 1 + sunrpc/rpc/types.h | 20 +- sunrpc/rpc/xdr.h | 184 ++-- sunrpc/rpc_clntout.c | 291 +++--- sunrpc/rpc_cmsg.c | 309 ++++--- sunrpc/rpc_dtable.c | 17 +- sunrpc/rpc_prot.c | 328 ++++--- sunrpc/rpc_sample.c | 315 ++++--- sunrpc/rpc_scan.c | 764 +++++++++------- sunrpc/rpc_svcout.c | 1477 ++++++++++++++++-------------- sunrpc/rpc_tblout.c | 214 +++-- sunrpc/rpc_util.c | 563 ++++++------ sunrpc/rpcinfo.c | 1130 ++++++++++++----------- sunrpc/svc.c | 527 ++++++----- sunrpc/svc_auth.c | 75 +- sunrpc/svc_authux.c | 145 +-- sunrpc/svc_raw.c | 173 ++-- sunrpc/svc_run.c | 46 +- sunrpc/svc_simple.c | 184 ++-- sunrpc/svc_tcp.c | 530 +++++------ sunrpc/svc_udp.c | 642 ++++++------- sunrpc/xdr.c | 819 +++++++++-------- sunrpc/xdr_array.c | 152 +-- sunrpc/xdr_mem.c | 196 ++-- sunrpc/xdr_rec.c | 821 +++++++++-------- sunrpc/xdr_ref.c | 91 +- sunrpc/xdr_stdio.c | 155 ++-- sysdeps/generic/sigset.h | 10 +- sysdeps/libm-i387/s_exp2.S | 38 + sysdeps/libm-i387/s_exp2f.S | 38 + sysdeps/libm-i387/s_exp2l.S | 38 + sysdeps/libm-i387/s_log2.S | 59 ++ sysdeps/libm-i387/s_log2f.S | 59 ++ sysdeps/libm-i387/s_log2l.S | 59 ++ sysdeps/libm-ieee754/s_cexpf.c | 37 +- sysdeps/libm-ieee754/s_cexpl.c | 45 +- sysdeps/libm-ieee754/s_log2.c | 129 +++ sysdeps/libm-ieee754/s_log2f.c | 90 ++ sysdeps/m68k/Makefile | 2 +- sysdeps/m68k/dl-machine.h | 103 +-- sysdeps/sparc/elf/start.S | 112 --- sysdeps/stub/s_log2l.c | 11 + sysdeps/unix/sysv/linux/alpha/termbits.h | 4 - sysdeps/unix/sysv/linux/netinet/icmp.h | 25 - sysdeps/unix/sysv/linux/sigset.h | 35 +- sysdeps/unix/sysv/linux/termbits.h | 4 - termios/sys/ttydefaults.h | 18 +- wcsmbs/wcstof.c | 6 + wcsmbs/wcstold.c | 7 + 91 files changed, 8777 insertions(+), 7249 deletions(-) create mode 100644 signal/sigandset.c create mode 100644 signal/sigisempty.c create mode 100644 signal/sigorset.c create mode 100644 sysdeps/libm-i387/s_exp2.S create mode 100644 sysdeps/libm-i387/s_exp2f.S create mode 100644 sysdeps/libm-i387/s_exp2l.S create mode 100644 sysdeps/libm-i387/s_log2.S create mode 100644 sysdeps/libm-i387/s_log2f.S create mode 100644 sysdeps/libm-i387/s_log2l.S create mode 100644 sysdeps/libm-ieee754/s_log2.c create mode 100644 sysdeps/libm-ieee754/s_log2f.c delete mode 100644 sysdeps/sparc/elf/start.S create mode 100644 sysdeps/stub/s_log2l.c delete mode 100644 sysdeps/unix/sysv/linux/netinet/icmp.h diff --git a/ChangeLog b/ChangeLog index 7534c9fd6f..f9dd5c7be1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,163 @@ +1997-03-27 02:28 Ulrich Drepper + + * gmon/gmon.c (monstartup): Mark all messages. + (write_call_graph): Rewrite to use larger I/O vector for writev + call to reduce syscall overhead. + (write_bb_counts): Simplify writev handling. + + * inet/rexec.c: Make string parameters `const'. + * resolv/netdb.h: Add prototypes for rcmd, rexec, ruserok, and + rresvport. + + * math/Makefile: Don't define CFLAGS-* macros to prevent inlining + in libm-test. + * math/libm-test.c (this_does_nothing): Remove functions. It's + notuseful on any platform but ix86. + (inverse_func_pair_test): Don't use this_does_nothing. Use + memory reference. + (identities1_test): Likewise. + (identities2_test): Likewise. + (identities3_test): Likewise. + (basic_test): Likewise. + Patch by Andreas Schwab. + (BUILD_COMPLEX): New macro. Create complex number from real and + imaginary parts. This works around bugs/inefficiencies in current + gcc. + (cexp_test): Use BUILD_COMPLEX. Add more tests. + + * nss/nsswitch.c: Fix typo. + + * posix/glob.h: Add declaration for glob_pattern_p. + * posix/glob.c: Rename glob_pattern_p to __glob_pattern_p and + make glob_pattern_p a weak alias. This function is used in other + packages (e.g. bash). + + * signal/Makefile (routines): Add sigisempty, sigandset, and + sigorset. + * signal/signal.h: Add prototypes for sigisempty, sigandset, and + sigorset. + * signal/sigisempty.c: New file. + * signal/sigandset.c: New file. + * signal/sigorset.c: New file. + * sysdeps/generic/sigset.h: Define __sigisemptyset, __sigandset, + and __sigorset. + * sysdeps/unix/sysv/linux/sigset.h: Likewise. + + * stdlib/strtod.c: Handle `n-char-sequence' in NaN parsing. It + determines the bits in the mantissa part of the NaN. + * stdlib/strtof.c: Define SET_MANTISSA for float type. + * wcsmbs/wcstof.c: Define SET_MANTISSA for float type. + * stdlib/strtold.c: Define SET_MANTISSA for long double type. + * wcsmbs/wcstold.c: Define SET_MANTISSA for long double type. + + * sysdeps/libm-ieee754/s_cexp.c: Use explicit assignment to + complex number components. Some more corrects for special cases. + * sysdeps/libm-ieee754/s_cexpf.c: Likewise. + * sysdeps/libm-ieee754/s_cexpl.c: Likewise. + + * sysdeps/sparc/elf/start.S: Remove as per request of Miguel de Icaza. + + * sysdeps/unix/sysv/linux/netinet/icmp.h: Remove since we have + ip_icmp.h. Reported by HJ Lu. + +1997-03-25 03:50 Andreas Schwab + + * sysdeps/m68k/Makefile (CFLAGS-rtld.c): Add -Wno-unused. + + * sysdeps/m68k/dl-machine.h (elf_machine_rela): Rewritten as for + i386. + (elf_machine_lookup_noexec_p, elf_machine_lookup_noplt_p, + ELF_MACHINE_RELOC_NOPLT): Define. + +1997-03-25 03:48 Andreas Schwab + + * grp/grp.h: Include only once. + +1997-03-25 09:38 Andreas Schwab + + * sysdeps/unix/sysv/linux/termbits.h (OXTABS): Don't define. + * sysdeps/unix/sysv/linux/alpha/termbits.h (OXTABS): Likewise. + + * termios/sys/ttydefaults.h (TTYDEF_OFLAG): Use either OXTABS or + TAB3, if one of them is defined. + +1997-03-26 04:53 Ulrich Drepper + + * posix/glob.c (next_brace_sub): Decrement depth counter when '}' + is found. + Patch by Dennis Henriksen . + +1997-03-25 16:25 Thorsten Kukuk + + * sunrpc/Makefile: Comment gccwarn out. + * sunrpc/auth_none.c: Fix prototypes and parameters for compiling + with enabled warnings. + * sunrpc/auth_unix.c: Likewise. + * sunrpc/authuxprot.c: Likewise. + * sunrpc/bindrsvprt.c: Likewise. + * sunrpc/clnt_gen.c: Likewise. + * sunrpc/clnt_perr.c: Likewise. + * sunrpc/clnt_raw.c: Likewise. + * sunrpc/clnt_simp.c: Likewise. + * sunrpc/clnt_tcp.c: Likewise. + * sunrpc/clnt_udp.c: Likewise. + * sunrpc/get_myaddr.c: Likewise. + * sunrpc/getrpcport.c: Likewise. + * sunrpc/pm_getmaps.c: Likewise. + * sunrpc/pm_getport.c: Likewise. + * sunrpc/pmap_clnt.c: Likewise. + * sunrpc/pmap_prot.c: Likewise. + * sunrpc/pmap_prot2.c: Likewise. + * sunrpc/pmap_rmt.c: Likewise. + * sunrpc/rpc/auth.h: Likewise. + * sunrpc/rpc/clnt.h: Likewise. + * sunrpc/rpc/pmap_clnt.h: Likewise. + * sunrpc/rpc/svc.h: Likewise. + * sunrpc/rpc/svc_auth.h: Likewise. + * sunrpc/rpc/types.h: Likewise. + * sunrpc/rpc/xdr.h: Likewise. + * sunrpc/rpc_clntout.c: Likewise. + * sunrpc/rpc_cmsg.c: Likewise. + * sunrpc/rpc_dtable.c: Likewise. + * sunrpc/rpc_prot.c: Likewise. + * sunrpc/svc.c: Likewise. + * sunrpc/svc_auth.c: Likewise. + * sunrpc/svc_authux.c: Likewise. + * sunrpc/svc_raw.c: Likewise. + * sunrpc/svc_run.c: Likewise. + * sunrpc/svc_simple.c: Likewise. + * sunrpc/svc_tcp.c: Likewise. + * sunrpc/svc_udp.c: Likewise. + * sunrpc/xdr.c: Likewise. + * sunrpc/xdr_array.c: Likewise. + * sunrpc/xdr_mem.c: Likewise. + * sunrpc/xdr_rec.c: Likewise. + * sunrpc/xdr_ref.c: Likewise. + * sunrpc/xdr_stdio.c: Likewise. + +1997-03-25 13:39 Ulrich Drepper + + * math/libm-test.c (log2_test): Compile this function and call it. + (exp2_test): Likewise, but check whether function really exists + before testing. + + * math/Makefile (libm-calls): Add s_log2 and s_exp2. + +1997-03-25 04:50 Ulrich Drepper + + Implement exp2 function. + * sysdeps/libm-i387/s_exp2.S: New file. + * sysdeps/libm-i387/s_exp2f.S: New file. + * sysdeps/libm-i387/s_exp2l.S: New file. + + Implement log2 function. + * sysdeps/libm-i387/s_log2.S: New file. + * sysdeps/libm-i387/s_log2f.S: New file. + * sysdeps/libm-i387/s_log2l.S: New file. + * sysdeps/libm-ieee754/s_log2.c: New file. + * sysdeps/libm-ieee754/s_log2f.c: New file. + * sysdeps/stub/s_log2.c: New file. Stub version. + 1997-03-24 19:58 Richard Henderson * stdlib/tst-strtol.c (tests): Correct 64-bit entry. diff --git a/PROJECTS b/PROJECTS index db5a25f485..dc0a6701e9 100644 --- a/PROJECTS +++ b/PROJECTS @@ -1,6 +1,6 @@ Open jobs for finishing GNU libc: --------------------------------- -Status: January 1997 +Status: March 1997 If you have time and talent to take over any of the jobs below please contact diff --git a/gmon/gmon.c b/gmon/gmon.c index f1ecb9e459..e8ad327937 100644 --- a/gmon/gmon.c +++ b/gmon/gmon.c @@ -125,7 +125,7 @@ monstartup (lowpc, highpc) cp = malloc (p->kcountsize + p->fromssize + p->tossize); if (! cp) { - ERR("monstartup: out of memory\n"); + ERR(_("monstartup: out of memory\n")); return; } bzero(cp, p->kcountsize + p->fromssize + p->tossize); @@ -194,25 +194,25 @@ static void write_call_graph (fd) int fd; { +#define NARCS_PER_WRITEV 32 u_char tag = GMON_TAG_CG_ARC; - struct gmon_cg_arc_record raw_arc[4] + struct gmon_cg_arc_record raw_arc[NARCS_PER_WRITEV] __attribute__ ((aligned (__alignof__ (char*)))); int from_index, to_index, from_len; u_long frompc; + struct iovec iov[2 * NARCS_PER_WRITEV]; + int nfilled; - struct iovec iov[8] = + for (nfilled = 0; nfilled < NARCS_PER_WRITEV; ++nfilled) { - { &tag, sizeof (tag) }, - { &raw_arc[0], sizeof (struct gmon_cg_arc_record) }, - { &tag, sizeof (tag) }, - { &raw_arc[1], sizeof (struct gmon_cg_arc_record) }, - { &tag, sizeof (tag) }, - { &raw_arc[2], sizeof (struct gmon_cg_arc_record) }, - { &tag, sizeof (tag) }, - { &raw_arc[3], sizeof (struct gmon_cg_arc_record) }, - }; - int nfilled = 0; + iov[2 * nfilled].iov_base = &tag; + iov[2 * nfilled].iov_len = sizeof (tag); + iov[2 * nfilled + 1].iov_base = &raw_arc[nfilled]; + iov[2 * nfilled + 1].iov_len = sizeof (struct gmon_cg_arc_record); + } + + nfilled = 0; from_len = _gmonparam.fromssize / sizeof (*_gmonparam.froms); for (from_index = 0; from_index < from_len; ++from_index) { @@ -226,19 +226,20 @@ write_call_graph (fd) to_index != 0; to_index = _gmonparam.tos[to_index].link) { - if (nfilled > 3) + *(char **) raw_arc[nfilled].from_pc = (char *) frompc; + *(char **) raw_arc[nfilled].self_pc = + (char *)_gmonparam.tos[to_index].selfpc; + *(int *) raw_arc[nfilled].count = _gmonparam.tos[to_index].count; + + if (++nfilled == NARCS_PER_WRITEV) { __writev (fd, iov, 2 * nfilled); nfilled = 0; } - *(char **) raw_arc[nfilled].from_pc = (char *)frompc; - *(char **) raw_arc[nfilled].self_pc = - (char *)_gmonparam.tos[to_index].selfpc; - *(int *) raw_arc[nfilled].count = _gmonparam.tos[to_index].count; - ++nfilled; } } - __writev (fd, iov, 2 * nfilled); + if (nfilled > 0) + __writev (fd, iov, 2 * nfilled); } @@ -268,17 +269,11 @@ write_bb_counts (fd) /* Write each group of basic-block info (all basic-blocks in a compilation unit form a single group). */ - nfilled = 0; for (grp = __bb_head; grp; grp = grp->next) { ncounts = grp->ncounts; - if (nfilled > 0) - { - __writev (fd, bbbody, nfilled); - nfilled = 0; - } __writev (fd, bbhead, 2); - for (i = 0; i < ncounts; ++i) + for (nfilled = i = 0; i < ncounts; ++i) { if (nfilled > (sizeof (bbbody) / sizeof (bbbody[0])) - 2) { @@ -289,9 +284,9 @@ write_bb_counts (fd) bbbody[nfilled++].iov_base = (char *) &grp->addresses[i]; bbbody[nfilled++].iov_base = &grp->counts[i]; } + if (nfilled > 0) + __writev (fd, bbbody, nfilled); } - if (nfilled > 0) - __writev (fd, bbbody, nfilled); } diff --git a/grp/grp.h b/grp/grp.h index b44f97fe87..292bd26ec0 100644 --- a/grp/grp.h +++ b/grp/grp.h @@ -32,9 +32,6 @@ __BEGIN_DECLS #define __need_size_t #include -#define __need_size_t -#include - /* The group structure. */ struct group diff --git a/inet/rexec.c b/inet/rexec.c index 611ff57287..72df066b03 100644 --- a/inet/rexec.c +++ b/inet/rexec.c @@ -53,7 +53,7 @@ int rexec(ahost, rport, name, pass, cmd, fd2p) char **ahost; int rport; - char *name, *pass, *cmd; + const char *name, *pass, *cmd; int *fd2p; { struct sockaddr_in sin, sin2, from; diff --git a/math/Makefile b/math/Makefile index d0c05835f5..2578dbf839 100644 --- a/math/Makefile +++ b/math/Makefile @@ -48,7 +48,7 @@ libm-calls = e_acos e_acosh e_asin e_atan2 e_atanh e_cosh e_exp e_fmod \ w_gamma_r w_hypot w_j0 w_j1 w_jn w_lgamma w_lgamma_r \ w_log w_log10 w_pow w_remainder w_scalb w_sinh w_sqrt \ s_signbit s_fpclassify s_fmax s_fmin s_fdim s_nan s_trunc \ - s_remquo \ + s_remquo s_log2 s_exp2 \ conj cimag creal cabs s_cexp libm-routines = $(libm-support) $(libm-calls) \ $(patsubst %_rf,%f_r,$(libm-calls:=f)) \ @@ -73,9 +73,6 @@ tests = test-float test-double $(test-longdouble-$(long-double-fcts)) # XXX This test is disabled for now since the functions are too buggy. #test-longdouble-yes = test-longdouble -CFLAGS-test-float.c = -fno-inline -CFLAGS-test-double.c = -fno-inline -CFLAGS-test-longdouble.c = -fno-inline LDLIBS-test-float = libm LDLIBS-test-double = libm LDLIBS-test-longdouble = libm diff --git a/math/libm-test.c b/math/libm-test.c index 05acca2c53..a575cc66a8 100644 --- a/math/libm-test.c +++ b/math/libm-test.c @@ -63,10 +63,6 @@ -s,--silent outputs only the error count (equals --verbose=0) */ -/* Define if the following ISO C 9X functions are implemented: exp2, - log2. */ -#undef ISO_9X_IMPLEMENTED - #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif @@ -103,6 +99,12 @@ static MATHTYPE plus_infty, minus_infty, nan_value; typedef MATHTYPE (*mathfunc) (MATHTYPE); +#define BUILD_COMPLEX(real, imag) \ + ({ __complex__ MATHTYPE __retval; \ + __real__ __retval = (real); \ + __imag__ __retval = (imag); \ + __retval; }) + #define ISINF(x) \ (sizeof (x) == sizeof (float) ? \ @@ -135,18 +137,6 @@ asm ("fnstsw":"=a" (sw)); } -/* - Call to an external function so that floating point registers - get moved to memory - */ -static void -this_does_nothing (void) -{ - clock_t dummy; - - dummy = clock (); -} - /* Get a random value x with min_value < x < max_value and min_value, max_value finite, @@ -644,10 +634,15 @@ exp_test (void) } -#ifdef ISO_9X_IMPLEMENTED static void exp2_test (void) { + errno = 0; + exp2(0); + if (errno == ENOSYS) + /* Function not implemented. */ + return; + check ("exp2 (+0) == 1", FUNC(exp2) (0), 1); check ("exp2 (-0) == 1", FUNC(exp2) (minus_zero), 1); @@ -655,7 +650,6 @@ exp2_test (void) check ("exp2 (-inf) == 0", FUNC(exp2) (minus_infty), 0); check ("exp2 (10) == 1024", FUNC(exp2) (10), 1024); } -#endif static void @@ -892,7 +886,6 @@ log1p_test (void) } -#ifdef ISO_9X_IMPLEMENTED static void log2_test (void) { @@ -914,7 +907,6 @@ log2_test (void) check ("log2 (256) == 8", FUNC(log2) (256.0), 8); } -#endif static void @@ -1540,32 +1532,92 @@ cexp_test (void) { __complex__ MATHTYPE result; - result = FUNC(cexp) (plus_zero + 1.0i * plus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (plus_zero, plus_zero)); check ("real(cexp(0 + 0i)) = 1", __real__ result, 1); check ("imag(cexp(0 + 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (minus_zero + 1.0i * plus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (minus_zero, plus_zero)); check ("real(cexp(-0 + 0i)) = 1", __real__ result, 1); check ("imag(cexp(-0 + 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (plus_zero + 1.0i * minus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (plus_zero, minus_zero)); check ("real(cexp(0 - 0i)) = 1", __real__ result, 1); - check ("imag(cexp(0 - 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (minus_zero + 1.0i * minus_zero); + check ("imag(cexp(0 - 0i)) = -0", __imag__ result, minus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (minus_zero, minus_zero)); check ("real(cexp(-0 - 0i)) = 1", __real__ result, 1); - check ("imag(cexp(-0 - 0i)) = 0", __imag__ result, 0); + check ("imag(cexp(-0 - 0i)) = -0", __imag__ result, minus_zero); - result = FUNC(cexp) (plus_infty + 1.0i * plus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, plus_zero)); check_isinfp ("real(cexp(+inf + 0i)) = +inf", __real__ result); check ("imag(cexp(+inf + 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (plus_infty + 1.0i * minus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, minus_zero)); check_isinfp ("real(cexp(+inf - 0i)) = +inf", __real__ result); check ("imag(cexp(+inf - 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (minus_infty + 1.0i * plus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, plus_zero)); check ("real(cexp(-inf + 0i)) = 0", __real__ result, 0); check ("imag(cexp(-inf + 0i)) = 0", __imag__ result, 0); - result = FUNC(cexp) (minus_infty + 1.0i * minus_zero); + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, minus_zero)); check ("real(cexp(-inf - 0i)) = 0", __real__ result, 0); - check ("imag(cexp(-inf - 0i)) = 0", __imag__ result, 0); + check ("imag(cexp(-inf - 0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(cexp) (BUILD_COMPLEX (100.0, plus_infty)); + check_isnan ("real(cexp(x + i inf)) = NaN", __real__ result); + check_isnan ("imag(cexp(x + i inf)) = NaN", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (100.0, minus_infty)); + check_isnan ("real(cexp(x - i inf)) = NaN", __real__ result); + check_isnan ("imag(cexp(x - i inf)) = NaN", __imag__ result); + + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, 2.0)); + check ("real(cexp(-inf + 2.0i)) = -0", __real__ result, minus_zero); + check ("imag(cexp(-inf + 2.0i)) = 0", __imag__ result, 0); + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, 4.0)); + check ("real(cexp(-inf + 4.0i)) = -0", __real__ result, minus_zero); + check ("imag(cexp(-inf + 4.0i)) = -0", __imag__ result, minus_zero); + + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, 2.0)); + check_isinfn ("real(cexp(+inf + 2.0i)) = -0", __real__ result); + check_isinfp ("imag(cexp(+inf + 2.0i)) = 0", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, 4.0)); + check_isinfn ("real(cexp(+inf + 4.0i)) = -0", __real__ result); + check_isinfn ("imag(cexp(+inf + 4.0i)) = -0", __imag__ result); + + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, plus_infty)); + check_isinfp ("real(cexp(+inf + i inf)) = +inf", __real__ result); + check_isnan ("imag(cexp(+inf + i inf)) = NaN", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, minus_infty)); + check_isinfp ("real(cexp(+inf - i inf)) = +inf", __real__ result); + check_isnan ("imag(cexp(+inf - i inf)) = NaN", __imag__ result); + + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, plus_infty)); + check ("real(cexp(-inf + i inf)) = 0", __real__ result, 0); + check ("imag(cexp(-inf + i inf)) = 0", __imag__ result, 0); + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, minus_infty)); + check ("real(cexp(-inf - i inf)) = 0", __real__ result, 0); + check ("imag(cexp(-inf - i inf)) = 0", __imag__ result, 0); + + result = FUNC(cexp) (BUILD_COMPLEX (minus_infty, nan_value)); + check ("real(cexp(-inf + i NaN)) = 0", __real__ result, 0); + check ("imag(cexp(-inf + i NaN)) = 0", fabs (__imag__ result), 0); + + result = FUNC(cexp) (BUILD_COMPLEX (plus_infty, nan_value)); + check_isinfp ("real(cexp(+inf + i NaN)) = +inf", __real__ result); + check_isnan ("imag(cexp(+inf + i NaN)) = NaN", __imag__ result); + + result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); + check_isnan ("real(cexp(NaN + 1i)) = NaN", __real__ result); + check_isnan ("imag(cexp(NaN + 1i)) = NaN", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); + check_isnan ("real(cexp(NaN + i inf)) = NaN", __real__ result); + check_isnan ("imag(cexp(NaN + i inf)) = NaN", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (nan_value, 1.0)); + check_isnan ("real(cexp(NaN + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cexp(NaN + i NaN)) = NaN", __imag__ result); + + result = FUNC(cexp) (BUILD_COMPLEX (0, nan_value)); + check_isnan ("real(cexp(0 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cexp(0 + i NaN)) = NaN", __imag__ result); + result = FUNC(cexp) (BUILD_COMPLEX (1, nan_value)); + check_isnan ("real(cexp(1 + i NaN)) = NaN", __real__ result); + check_isnan ("imag(cexp(1 + i NaN)) = NaN", __imag__ result); } @@ -1578,9 +1630,9 @@ inverse_func_pair_test (const char *test_name, int result; a = f1 (x); - this_does_nothing (); + (void) &a; b = inverse (a); - this_does_nothing (); + (void) &b; result = check_equal (b, x, epsilon, &difference); output_result (test_name, result, @@ -1630,11 +1682,11 @@ identities1_test (MATHTYPE x, MATHTYPE epsilon) int result; res1 = FUNC(sin) (x); - this_does_nothing (); + (void) &res1; res2 = FUNC(cos) (x); - this_does_nothing (); + (void) &res2; res3 = res1 * res1 + res2 * res2; - this_does_nothing (); + (void) &res3; result = check_equal (res3, 1.0, epsilon, &diff); output_result_ext ("sin^2 + cos^2 == 1", result, @@ -1650,13 +1702,13 @@ identities2_test (MATHTYPE x, MATHTYPE epsilon) int result; res1 = FUNC(sin) (x); - this_does_nothing (); + (void) &res1; res2 = FUNC(cos) (x); - this_does_nothing (); + (void) &res2; res3 = FUNC(tan) (x); - this_does_nothing (); + (void) &res3; res4 = res1 / res2; - this_does_nothing (); + (void) &res4; result = check_equal (res4, res3, epsilon, &diff); output_result_ext ("sin/cos == tan", result, @@ -1672,11 +1724,11 @@ identities3_test (MATHTYPE x, MATHTYPE epsilon) int result; res1 = FUNC(sinh) (x); - this_does_nothing (); + (void) &res1; res2 = FUNC(cosh) (x); - this_does_nothing (); + (void) &res2; res3 = res2 * res2 - res1 * res1; - this_does_nothing (); + (void) &res3; result = check_equal (res3, 1.0, epsilon, &diff); output_result_ext ("cosh^2 - sinh^2 == 1", result, @@ -1721,7 +1773,10 @@ basic_tests (void) NaN_var = nan_value; Inf_var = one_var / zero_var; - this_does_nothing (); + (void) &zero_var; + (void) &one_var; + (void) &NaN_var; + (void) &Inf_var; check_isinfp ("isinf (inf) == +1", Inf_var); check_isinfn ("isinf (-inf) == -1", -Inf_var); @@ -1854,9 +1909,7 @@ main (int argc, char *argv[]) cos_test (); cosh_test (); exp_test (); -#ifdef ISO_9X_IMPLEMENTED exp2_test (); -#endif expm1_test (); frexp_test (); ilogb_test (); @@ -1864,9 +1917,7 @@ main (int argc, char *argv[]) log_test (); log10_test (); log1p_test (); -#ifdef ISO_9X_IMPLEMENTED log2_test (); -#endif logb_test (); modf_test (); scalb_test (); diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 9c7a2d7909..5bcacf296d 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -106,8 +106,8 @@ __nss_database_lookup (const char *database, const char *alternate_name, *ni = entry->service; if (*ni == NULL && alternate_name != NULL) - /* We haven't found a an entry so far. Try to find it with - the alternative name. */ + /* We haven't found an entry so far. Try to find it with the + alternative name. */ for (entry = service_table->entry; entry != NULL; entry = entry->next) if (strcmp (alternate_name, entry->name) == 0) *ni = entry->service; diff --git a/posix/glob.c b/posix/glob.c index 86a79b08a1..44e548493c 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -250,7 +250,6 @@ extern char *alloca (); #undef GLOB_PERIOD #include -static int glob_pattern_p __P ((const char *pattern, int quote)); static int glob_in_dir __P ((const char *pattern, const char *directory, int flags, int (*errfunc) __P ((const char *, int)), @@ -288,7 +287,7 @@ next_brace_sub (const char *begin) while (*cp != '\0' && (*cp != '}' || depth > 0)) { if (*cp == '}') - ++depth; + --depth; ++cp; } if (*cp == '\0') @@ -617,7 +616,7 @@ glob (pattern, flags, errfunc, pglob) } #endif /* Not VMS. */ - if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) + if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE))) { /* The directory name contains metacharacters, so we have to glob for the directory, and then glob for @@ -844,8 +843,8 @@ prefix_array (dirname, array, n) /* Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ -static int -glob_pattern_p (pattern, quote) +int +__glob_pattern_p (pattern, quote) const char *pattern; int quote; { @@ -876,6 +875,9 @@ glob_pattern_p (pattern, quote) return 0; } +#ifdef _LIBC +weak_alias (__glob_pattern_p, glob_pattern_p) +#endif /* Like `glob', but PATTERN is a final pathname component, @@ -900,7 +902,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) struct globlink *names = NULL; size_t nfound = 0; - if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) + if (!__glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) { stream = NULL; flags |= GLOB_NOCHECK; @@ -958,7 +960,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) } if (nfound == 0 && (flags & GLOB_NOMAGIC) && - ! glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) + ! __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE))) flags |= GLOB_NOCHECK; if (nfound == 0 && (flags & GLOB_NOCHECK)) diff --git a/posix/glob.h b/posix/glob.h index 778bb602a4..49a7b7cfe6 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. @@ -104,6 +104,16 @@ extern int glob __P ((const char *__pattern, int __flags, extern void globfree __P ((glob_t *__pglob)); +#ifdef _GNU_SOURCE +/* Return nonzero if PATTERN contains any metacharacters. + Metacharacters can be quoted with backslashes if QUOTE is nonzero. + + This function is not part of the interface specified by POSIX.2 + but several programs want to use it. */ +extern int __glob_pattern_p __P ((__const char *__pattern, int __quote)); +extern int glob_pattern_p __P ((__const char *__pattern, int __quote)); +#endif + #ifdef __cplusplus } #endif diff --git a/resolv/netdb.h b/resolv/netdb.h index a0a682fe06..8f96528504 100644 --- a/resolv/netdb.h +++ b/resolv/netdb.h @@ -364,6 +364,39 @@ extern int getnetgrent_r __P ((char **__hostp, char **__userp, #endif /* misc */ +#ifdef __USE_BSD +/* Call `rshd' at port RPORT on remote machine *AHOST to execute CMD. + The local user is LOCUSER, on the remote machine the command is + executed as REMUSER. In *FD2P the descriptor to the socket for the + connection is returned. The caller must have the right to use a + reserved port. When the function returns *AHOST contains the + official host name. */ +extern int rcmd __P ((char **__ahost, unsigned short int __rport, + __const char *__locuser, __const char *__remuser, + __const char *__cmd, int *__fd2p)); + +/* Call `rexecd' at port RPORT on remote machine *AHOST to execute + CMD. The process runs at the remote machine using the ID of user + NAME whose cleartext password is PASSWD. In *FD2P the descriptor + to the socket for the connection is returned. When the function + returns *AHOST contains the official host name. */ +extern int rexec __P ((char **__ahost, int __rport, __const char *__name, + __const char *__pass, __const char *__cmd, + int *__fd2p)); + +/* Check whether user REMUSER on system RHOST is allowed to login as LOCUSER. + If SUSER is not zero the user tries to become superuser. Return 0 if + it is possible. */ +extern int ruserok __P ((__const char *__rhost, int __suser, + __const char *__remuser, __const char *__locuser)); + +/* Try to allocate reserved port, returning a descriptor for a socket opened + at this port or -1 if unsuccessful. The search for an available port + will start at ALPORT and continues with lower numbers. */ +extern int rresvport __P ((int *__alport)); +#endif + + /* Extension from POSIX.1g. */ #ifdef __USE_POSIX /* Structure to contain information about address of a service provider. */ diff --git a/signal/Makefile b/signal/Makefile index 2d99437208..a8e26ed239 100644 --- a/signal/Makefile +++ b/signal/Makefile @@ -30,7 +30,8 @@ routines := signal raise killpg \ sigstack sigaltstack sigintr \ sigsetops sigempty sigfillset sigaddset sigdelset sigismem \ sigreturn \ - siggetmask sysv_signal + siggetmask sysv_signal \ + sigisempty sigandset sigorset tests := tst-signal diff --git a/signal/sigandset.c b/signal/sigandset.c new file mode 100644 index 0000000000..bb3747c19d --- /dev/null +++ b/signal/sigandset.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + 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 +#include + +/* Combine sets LEFT and RIGHT by logical AND and place result in DEST. */ +int +sigandset (dest, left, right) + sigset_t *dest; + const sigset_t *left; + const sigset_t *right; +{ + if (dest == NULL || left == NULL || right == NULL) + { + __set_errno (EINVAL); + return -1; + } + + return __sigandset (dest, left, right); +} diff --git a/signal/sigisempty.c b/signal/sigisempty.c new file mode 100644 index 0000000000..50dc343491 --- /dev/null +++ b/signal/sigisempty.c @@ -0,0 +1,34 @@ +/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + 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 +#include + +/* Test whether SET is empty. */ +int +sigisemptyset (set) + const sigset_t *set; +{ + if (set == NULL) + { + __set_errno (EINVAL); + return -1; + } + + return __sigisemptyset (set); +} diff --git a/signal/signal.h b/signal/signal.h index b1953e5133..df54e7940d 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -183,6 +183,19 @@ extern int sigdelset __P ((sigset_t *__set, int __signo)); /* Return 1 if SIGNO is in SET, 0 if not. */ extern int sigismember __P ((__const sigset_t *__set, int __signo)); +#ifdef __USE_GNU +/* Return non-empty value is SET is not empty. */ +extern int sigisemptyset __P ((__const sigset_t *__set)); + +/* Build new signal set by combining the two inputs set using logical AND. */ +extern int sigandset __P ((sigset_t *__set, __const sigset_t *__left, + __const sigset_t *__right)); + +/* Build new signal set by combining the two inputs set using logical OR. */ +extern int sigorset __P ((sigset_t *__set, __const sigset_t *__left, + __const sigset_t *__right)); +#endif /* GNU */ + /* Get the system-specific definitions of `struct sigaction' and the `SA_*' and `SIG_*'. constants. */ #include diff --git a/signal/sigorset.c b/signal/sigorset.c new file mode 100644 index 0000000000..e8ae22fd5a --- /dev/null +++ b/signal/sigorset.c @@ -0,0 +1,36 @@ +/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + 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 +#include + +/* Combine sets LEFT and RIGHT by logical OR and place result in DEST. */ +int +sigorset (dest, left, right) + sigset_t *dest; + const sigset_t *left; + const sigset_t *right; +{ + if (dest == NULL || left == NULL || right == NULL) + { + __set_errno (EINVAL); + return -1; + } + + return __sigorset (dest, left, right); +} diff --git a/stdlib/strtod.c b/stdlib/strtod.c index cff75bd4ad..760ecd26a7 100644 --- a/stdlib/strtod.c +++ b/stdlib/strtod.c @@ -31,6 +31,12 @@ # endif # define MPN2FLOAT __mpn_construct_double # define FLOAT_HUGE_VAL HUGE_VAL +# define SET_MANTISSA(flt, mant) \ + do { union ieee754_double u; \ + u.d = (flt); \ + u.ieee.mantissa0 = ((mant) >> 32) & 0xfffff; \ + u.ieee.mantissa1 = (mant) & 0xffffffff; \ + } while (0) #endif #ifdef USE_WIDE_CHAR @@ -44,6 +50,7 @@ # define ISXDIGIT(Ch) iswxdigit (Ch) # define TOLOWER(Ch) towlower (Ch) # define STRNCASECMP(S1, S2, N) __wcsncasecmp ((S1), (S2), (N)) +# define STRTOULL(S, E, B) wcstoull ((S), (E), (B)) #else # define STRING_TYPE char # define CHAR_TYPE char @@ -53,6 +60,7 @@ # define ISXDIGIT(Ch) isxdigit (Ch) # define TOLOWER(Ch) tolower (Ch) # define STRNCASECMP(S1, S2, N) __strncasecmp ((S1), (S2), (N)) +# define STRTOULL(S, E, B) strtoull ((S), (E), (B)) #endif /* End of configuration part. */ @@ -461,6 +469,8 @@ INTERNAL (STRTOF) (nptr, endptr, group) if (TOLOWER (c) == L_('n') && STRNCASECMP (cp, L_("an"), 2) == 0) { + FLOAT retval = NAN; + /* Return NaN. */ if (endptr != NULL) { @@ -480,12 +490,25 @@ INTERNAL (STRTOF) (nptr, endptr, group) /* The closing brace is missing. Only match the NAN part. */ cp = startp; + else + { + /* This is a system-dependent way to specify the + bitmask used for the NaN. We expect it to be + a number which is put in the mantissa of the + number. */ + STRING_TYPE *endp; + unsigned long long int mant; + + mant = STRTOULL (startp, &endp, 0); + if (endp == cp) + SET_MANTISSA (retval, mant); + } } *endptr = (STRING_TYPE *) cp; } - return NAN; + return retval; } /* It is really a text we do not recognize. */ diff --git a/stdlib/strtof.c b/stdlib/strtof.c index 8692a3ac8f..0a0046daf9 100644 --- a/stdlib/strtof.c +++ b/stdlib/strtof.c @@ -6,5 +6,11 @@ #define STRTOF strtof #define MPN2FLOAT __mpn_construct_float #define FLOAT_HUGE_VAL HUGE_VALF +#define SET_MANTISSA(flt, mant) \ + do { union ieee754_float u; \ + u.f = (flt); \ + u.ieee.mantissa = (mant) & 0x7fffff; \ + (flt) = u.f; \ + } while (0) #include "strtod.c" diff --git a/stdlib/strtold.c b/stdlib/strtold.c index 9d80543377..1dc0ac37c2 100644 --- a/stdlib/strtold.c +++ b/stdlib/strtold.c @@ -6,5 +6,12 @@ #define STRTOF strtold #define MPN2FLOAT __mpn_construct_long_double #define FLOAT_HUGE_VAL HUGE_VALL +#define SET_MANTISSA(flt, mant) \ + do { union ieee854_long_double u; \ + u.d = (flt); \ + u.ieee.mantissa0 = ((mant) >> 32) & 0x7fffffff; \ + u.ieee.mantissa1 = (mant) & 0xffffffff; \ + (flt) = u.d; \ + } while (0) #include "strtod.c" diff --git a/sunrpc/Makefile b/sunrpc/Makefile index 1981c75941..9feff64c53 100644 --- a/sunrpc/Makefile +++ b/sunrpc/Makefile @@ -80,9 +80,6 @@ extra-objs = $(rpcgen-objs) all: # Make this the default target; it will be defined in Rules. -# Sun's code is not too clean. -override +gccwarn := -w - include ../Makeconfig ifeq (no,$(cross-compiling)) @@ -96,6 +93,19 @@ librpcsvc-inhibit-o = .so # Build no shared rpcsvc library. omit-deps = $(librpcsvc-routines) endif +CFLAGS-xbootparam.c = -Wno-unused +CFLAGS-xnlm_prot.c = -Wno-unused +CFLAGS-xrstat.c = -Wno-unused +CFLAGS-xyppasswd.c = -Wno-unused +CFLAGS-xklm_prot.c = -Wno-unused +CFLAGS-xrex.c = -Wno-unused +CFLAGS-xsm_inter.c = -Wno-unused +CFLAGS-xmount.c = -Wno-unused +CFLAGS-xrusers.c = -Wno-unused +CFLAGS-xspray.c = -Wno-unused +CFLAGS-xnfs_prot.c = -Wno-unused +CFLAGS-xrquote.c = -Wno-unused + include ../Rules $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a diff --git a/sunrpc/auth_none.c b/sunrpc/auth_none.c index 630037fb47..a7c1524ef5 100644 --- a/sunrpc/auth_none.c +++ b/sunrpc/auth_none.c @@ -6,23 +6,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -33,101 +33,104 @@ static char sccsid[] = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; /* * auth_none.c - * Creates a client authentication handle for passing "null" - * credentials and verifiers to remote systems. - * - * Copyright (C) 1984, Sun Microsystems, Inc. + * Creates a client authentication handle for passing "null" + * credentials and verifiers to remote systems. + * + * Copyright (C) 1984, Sun Microsystems, Inc. */ #include -#include #include + #define MAX_MARSHEL_SIZE 20 +extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); + /* * Authenticator operations routines */ -static void authnone_verf(); -static void authnone_destroy(); -static bool_t authnone_marshal(); -static bool_t authnone_validate(); -static bool_t authnone_refresh(); +static void authnone_verf (AUTH *); +static void authnone_destroy (AUTH *); +static bool_t authnone_marshal (AUTH *, XDR *); +static bool_t authnone_validate (AUTH *, struct opaque_auth *); +static bool_t authnone_refresh (AUTH *); -static struct auth_ops ops = { - authnone_verf, - authnone_marshal, - authnone_validate, - authnone_refresh, - authnone_destroy +static struct auth_ops ops = +{ + authnone_verf, + authnone_marshal, + authnone_validate, + authnone_refresh, + authnone_destroy }; -static struct authnone_private { - AUTH no_client; - char marshalled_client[MAX_MARSHEL_SIZE]; - u_int mcnt; -} *authnone_private; +static struct authnone_private + { + AUTH no_client; + char marshalled_client[MAX_MARSHEL_SIZE]; + u_int mcnt; + } + *authnone_private; AUTH * -authnone_create() +authnone_create (void) { - register struct authnone_private *ap = authnone_private; - XDR xdr_stream; - register XDR *xdrs; + struct authnone_private *ap = authnone_private; + XDR xdr_stream; + XDR *xdrs; - if (ap == 0) { - ap = (struct authnone_private *)calloc(1, sizeof (*ap)); - if (ap == 0) - return (0); - authnone_private = ap; - } - if (!ap->mcnt) { - ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; - ap->no_client.ah_ops = &ops; - xdrs = &xdr_stream; - xdrmem_create(xdrs, ap->marshalled_client, (u_int)MAX_MARSHEL_SIZE, - XDR_ENCODE); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); - ap->mcnt = XDR_GETPOS(xdrs); - XDR_DESTROY(xdrs); - } - return (&ap->no_client); + if (ap == 0) + { + ap = (struct authnone_private *) calloc (1, sizeof (*ap)); + if (ap == 0) + return NULL; + authnone_private = ap; + } + if (!ap->mcnt) + { + ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; + ap->no_client.ah_ops = &ops; + xdrs = &xdr_stream; + xdrmem_create (xdrs, ap->marshalled_client, (u_int) MAX_MARSHEL_SIZE, + XDR_ENCODE); + (void) xdr_opaque_auth (xdrs, &ap->no_client.ah_cred); + (void) xdr_opaque_auth (xdrs, &ap->no_client.ah_verf); + ap->mcnt = XDR_GETPOS (xdrs); + XDR_DESTROY (xdrs); + } + return (&ap->no_client); } -/*ARGSUSED*/ +/*ARGSUSED */ static bool_t -authnone_marshal(client, xdrs) - AUTH *client; - XDR *xdrs; +authnone_marshal (AUTH *client, XDR *xdrs) { - register struct authnone_private *ap = authnone_private; + struct authnone_private *ap = authnone_private; - if (ap == 0) - return (0); - return ((*xdrs->x_ops->x_putbytes)(xdrs, - ap->marshalled_client, ap->mcnt)); + if (ap == 0) + return (0); + return ((*xdrs->x_ops->x_putbytes) (xdrs, + ap->marshalled_client, ap->mcnt)); } -static void -authnone_verf() +static void +authnone_verf (AUTH *auth) { } static bool_t -authnone_validate() +authnone_validate (AUTH *auth, struct opaque_auth *oa) { - - return (TRUE); + return TRUE; } static bool_t -authnone_refresh() +authnone_refresh (AUTH *auth) { - - return (FALSE); + return FALSE; } static void -authnone_destroy() +authnone_destroy (AUTH *auth) { } diff --git a/sunrpc/auth_unix.c b/sunrpc/auth_unix.c index 8890a926ba..5e5dc995ca 100644 --- a/sunrpc/auth_unix.c +++ b/sunrpc/auth_unix.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro"; #include #include +#include #include #include @@ -53,36 +54,40 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro"; #include #include +extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); + /* * Unix authenticator operations vector */ -static void authunix_nextverf(); -static bool_t authunix_marshal(); -static bool_t authunix_validate(); -static bool_t authunix_refresh(); -static void authunix_destroy(); - -static struct auth_ops auth_unix_ops = { - authunix_nextverf, - authunix_marshal, - authunix_validate, - authunix_refresh, - authunix_destroy +static void authunix_nextverf (AUTH *); +static bool_t authunix_marshal (AUTH *, XDR *); +static bool_t authunix_validate (AUTH *, struct opaque_auth *); +static bool_t authunix_refresh (AUTH *); +static void authunix_destroy (AUTH *); + +static struct auth_ops auth_unix_ops = +{ + authunix_nextverf, + authunix_marshal, + authunix_validate, + authunix_refresh, + authunix_destroy }; /* * This struct is pointed to by the ah_private field of an auth_handle. */ -struct audata { - struct opaque_auth au_origcred; /* original credentials */ - struct opaque_auth au_shcred; /* short hand cred */ - u_long au_shfaults; /* short hand cache faults */ - char au_marshed[MAX_AUTH_BYTES]; - u_int au_mpos; /* xdr pos at end of marshed */ -}; +struct audata + { + struct opaque_auth au_origcred; /* original credentials */ + struct opaque_auth au_shcred; /* short hand cred */ + u_long au_shfaults; /* short hand cache faults */ + char au_marshed[MAX_AUTH_BYTES]; + u_int au_mpos; /* xdr pos at end of marshed */ + }; #define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) -static bool_t marshal_new_auth(); +static bool_t marshal_new_auth (AUTH *); /* @@ -90,77 +95,72 @@ static bool_t marshal_new_auth(); * Returns an auth handle with the given stuff in it. */ AUTH * -authunix_create(machname, uid, gid, len, aup_gids) - char *machname; - uid_t uid; - gid_t gid; - register int len; - gid_t *aup_gids; +authunix_create (machname, uid, gid, len, aup_gids) + char *machname; + uid_t uid; + gid_t gid; + int len; + gid_t *aup_gids; { - struct authunix_parms aup; - char mymem[MAX_AUTH_BYTES]; - struct timeval now; - XDR xdrs; - register AUTH *auth; - register struct audata *au; - - /* - * Allocate and set up auth handle - */ - auth = (AUTH *)mem_alloc(sizeof(*auth)); -#ifndef KERNEL - if (auth == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); - return (NULL); - } -#endif - au = (struct audata *)mem_alloc(sizeof(*au)); -#ifndef KERNEL - if (au == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); - return (NULL); - } -#endif - auth->ah_ops = &auth_unix_ops; - auth->ah_private = (caddr_t)au; - auth->ah_verf = au->au_shcred = _null_auth; - au->au_shfaults = 0; - - /* - * fill in param struct from the given params - */ - (void)gettimeofday(&now, (struct timezone *)0); - aup.aup_time = now.tv_sec; - aup.aup_machname = machname; - aup.aup_uid = uid; - aup.aup_gid = gid; - aup.aup_len = (u_int)len; - aup.aup_gids = aup_gids; - - /* - * Serialize the parameters into origcred - */ - xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE); - if (! xdr_authunix_parms(&xdrs, &aup)) - abort(); - au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); - au->au_origcred.oa_flavor = AUTH_UNIX; -#ifdef KERNEL - au->au_origcred.oa_base = mem_alloc((u_int) len); -#else - if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { - (void)fprintf(stderr, "authunix_create: out of memory\n"); - return (NULL); - } -#endif - bcopy(mymem, au->au_origcred.oa_base, (u_int)len); - - /* - * set auth handle to reflect new cred. - */ - auth->ah_cred = au->au_origcred; - marshal_new_auth(auth); - return (auth); + struct authunix_parms aup; + char mymem[MAX_AUTH_BYTES]; + struct timeval now; + XDR xdrs; + AUTH *auth; + struct audata *au; + + /* + * Allocate and set up auth handle + */ + auth = (AUTH *) mem_alloc (sizeof (*auth)); + if (auth == NULL) + { + (void) fprintf (stderr, _("authunix_create: out of memory\n")); + return NULL; + } + au = (struct audata *) mem_alloc (sizeof (*au)); + if (au == NULL) + { + (void) fprintf (stderr, _("authunix_create: out of memory\n")); + return NULL; + } + auth->ah_ops = &auth_unix_ops; + auth->ah_private = (caddr_t) au; + auth->ah_verf = au->au_shcred = _null_auth; + au->au_shfaults = 0; + + /* + * fill in param struct from the given params + */ + (void) gettimeofday (&now, (struct timezone *) 0); + aup.aup_time = now.tv_sec; + aup.aup_machname = machname; + aup.aup_uid = uid; + aup.aup_gid = gid; + aup.aup_len = (u_int) len; + aup.aup_gids = aup_gids; + + /* + * Serialize the parameters into origcred + */ + xdrmem_create (&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE); + if (!xdr_authunix_parms (&xdrs, &aup)) + abort (); + au->au_origcred.oa_length = len = XDR_GETPOS (&xdrs); + au->au_origcred.oa_flavor = AUTH_UNIX; + if ((au->au_origcred.oa_base = mem_alloc ((u_int) len)) == NULL) + { + (void) fprintf (stderr, _("authunix_create: out of memory\n")); + return NULL; + } + bcopy (mymem, au->au_origcred.oa_base, (u_int) len); + + /* + * set auth handle to reflect new cred. + */ + auth->ah_cred = au->au_origcred; + marshal_new_auth (auth); + return auth; } /* @@ -168,27 +168,27 @@ authunix_create(machname, uid, gid, len, aup_gids) * syscalls. */ AUTH * -authunix_create_default() +authunix_create_default (void) { - register int len; - char machname[MAX_MACHINE_NAME + 1]; - register uid_t uid; - register gid_t gid; - int max_nr_groups = sysconf (_SC_NGROUPS_MAX); - gid_t gids[max_nr_groups]; - - if (gethostname(machname, MAX_MACHINE_NAME) == -1) - abort(); - machname[MAX_MACHINE_NAME] = 0; - uid = geteuid(); - gid = getegid(); - - if ((len = getgroups(max_nr_groups, gids)) < 0) - abort(); - /* This braindamaged Sun code forces us here to truncate the - list of groups to NGRPS members since the code in - authuxprot.c transforms a fixed array. Grrr. */ - return (authunix_create(machname, uid, gid, MIN (NGRPS, len), gids)); + int len; + char machname[MAX_MACHINE_NAME + 1]; + uid_t uid; + gid_t gid; + int max_nr_groups = sysconf (_SC_NGROUPS_MAX); + gid_t gids[max_nr_groups]; + + if (gethostname (machname, MAX_MACHINE_NAME) == -1) + abort (); + machname[MAX_MACHINE_NAME] = 0; + uid = geteuid (); + gid = getegid (); + + if ((len = getgroups (max_nr_groups, gids)) < 0) + abort (); + /* This braindamaged Sun code forces us here to truncate the + list of groups to NGRPS members since the code in + authuxprot.c transforms a fixed array. Grrr. */ + return authunix_create (machname, uid, gid, MIN (NGRPS, len), gids); } /* @@ -196,113 +196,112 @@ authunix_create_default() */ static void -authunix_nextverf(auth) - AUTH *auth; +authunix_nextverf (AUTH *auth) { - /* no action necessary */ + /* no action necessary */ } static bool_t -authunix_marshal(auth, xdrs) - AUTH *auth; - XDR *xdrs; +authunix_marshal (AUTH *auth, XDR *xdrs) { - register struct audata *au = AUTH_PRIVATE(auth); + struct audata *au = AUTH_PRIVATE (auth); - return (XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos)); + return XDR_PUTBYTES (xdrs, au->au_marshed, au->au_mpos); } static bool_t -authunix_validate(auth, verf) - register AUTH *auth; - struct opaque_auth *verf; +authunix_validate (AUTH *auth, struct opaque_auth *verf) { - register struct audata *au; - XDR xdrs; - - if (verf->oa_flavor == AUTH_SHORT) { - au = AUTH_PRIVATE(auth); - xdrmem_create(&xdrs, verf->oa_base, verf->oa_length, - XDR_DECODE); - - if (au->au_shcred.oa_base != NULL) { - mem_free(au->au_shcred.oa_base, - au->au_shcred.oa_length); - au->au_shcred.oa_base = NULL; - } - if (xdr_opaque_auth(&xdrs, &au->au_shcred)) { - auth->ah_cred = au->au_shcred; - } else { - xdrs.x_op = XDR_FREE; - (void)xdr_opaque_auth(&xdrs, &au->au_shcred); - au->au_shcred.oa_base = NULL; - auth->ah_cred = au->au_origcred; - } - marshal_new_auth(auth); + struct audata *au; + XDR xdrs; + + if (verf->oa_flavor == AUTH_SHORT) + { + au = AUTH_PRIVATE (auth); + xdrmem_create (&xdrs, verf->oa_base, verf->oa_length, + XDR_DECODE); + + if (au->au_shcred.oa_base != NULL) + { + mem_free (au->au_shcred.oa_base, + au->au_shcred.oa_length); + au->au_shcred.oa_base = NULL; + } + if (xdr_opaque_auth (&xdrs, &au->au_shcred)) + { + auth->ah_cred = au->au_shcred; } - return (TRUE); + else + { + xdrs.x_op = XDR_FREE; + (void) xdr_opaque_auth (&xdrs, &au->au_shcred); + au->au_shcred.oa_base = NULL; + auth->ah_cred = au->au_origcred; + } + marshal_new_auth (auth); + } + return TRUE; } static bool_t -authunix_refresh(auth) - register AUTH *auth; +authunix_refresh (AUTH *auth) { - register struct audata *au = AUTH_PRIVATE(auth); - struct authunix_parms aup; - struct timeval now; - XDR xdrs; - register int stat; - - if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { - /* there is no hope. Punt */ - return (FALSE); - } - au->au_shfaults ++; - - /* first deserialize the creds back into a struct authunix_parms */ - aup.aup_machname = NULL; - aup.aup_gids = (gid_t *)NULL; - xdrmem_create(&xdrs, au->au_origcred.oa_base, - au->au_origcred.oa_length, XDR_DECODE); - stat = xdr_authunix_parms(&xdrs, &aup); - if (! stat) - goto done; - - /* update the time and serialize in place */ - (void)gettimeofday(&now, (struct timezone *)0); - aup.aup_time = now.tv_sec; - xdrs.x_op = XDR_ENCODE; - XDR_SETPOS(&xdrs, 0); - stat = xdr_authunix_parms(&xdrs, &aup); - if (! stat) - goto done; - auth->ah_cred = au->au_origcred; - marshal_new_auth(auth); + struct audata *au = AUTH_PRIVATE (auth); + struct authunix_parms aup; + struct timeval now; + XDR xdrs; + int stat; + + if (auth->ah_cred.oa_base == au->au_origcred.oa_base) + { + /* there is no hope. Punt */ + return FALSE; + } + au->au_shfaults++; + + /* first deserialize the creds back into a struct authunix_parms */ + aup.aup_machname = NULL; + aup.aup_gids = (gid_t *) NULL; + xdrmem_create (&xdrs, au->au_origcred.oa_base, + au->au_origcred.oa_length, XDR_DECODE); + stat = xdr_authunix_parms (&xdrs, &aup); + if (!stat) + goto done; + + /* update the time and serialize in place */ + (void) gettimeofday (&now, (struct timezone *) 0); + aup.aup_time = now.tv_sec; + xdrs.x_op = XDR_ENCODE; + XDR_SETPOS (&xdrs, 0); + stat = xdr_authunix_parms (&xdrs, &aup); + if (!stat) + goto done; + auth->ah_cred = au->au_origcred; + marshal_new_auth (auth); done: - /* free the struct authunix_parms created by deserializing */ - xdrs.x_op = XDR_FREE; - (void)xdr_authunix_parms(&xdrs, &aup); - XDR_DESTROY(&xdrs); - return (stat); + /* free the struct authunix_parms created by deserializing */ + xdrs.x_op = XDR_FREE; + (void) xdr_authunix_parms (&xdrs, &aup); + XDR_DESTROY (&xdrs); + return stat; } static void -authunix_destroy(auth) - register AUTH *auth; +authunix_destroy (AUTH *auth) { - register struct audata *au = AUTH_PRIVATE(auth); + struct audata *au = AUTH_PRIVATE (auth); - mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length); + mem_free (au->au_origcred.oa_base, au->au_origcred.oa_length); - if (au->au_shcred.oa_base != NULL) - mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length); + if (au->au_shcred.oa_base != NULL) + mem_free (au->au_shcred.oa_base, au->au_shcred.oa_length); - mem_free(auth->ah_private, sizeof(struct audata)); + mem_free (auth->ah_private, sizeof (struct audata)); - if (auth->ah_verf.oa_base != NULL) - mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length); + if (auth->ah_verf.oa_base != NULL) + mem_free (auth->ah_verf.oa_base, auth->ah_verf.oa_length); - mem_free((caddr_t)auth, sizeof(*auth)); + me