]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Wed May 29 00:57:37 1996 David Mosberger-Tang <davidm@azstarnet.com>
authorRoland McGrath <roland@gnu.org>
Sun, 2 Jun 1996 18:50:07 +0000 (18:50 +0000)
committerRoland McGrath <roland@gnu.org>
Sun, 2 Jun 1996 18:50:07 +0000 (18:50 +0000)
* time/Makefile (tests): Add test-tz.

* time/test-tz.c: New test.

* time/clocktest.c: Rewrite to test more meaningfully.

* sysdeps/unix/sysv/linux/syscalls.list: Add bdflush,
  create_module, delete_module, get_kernel_syms, init_module,
  klogctl.

* sysdeps/unix/sysv/linux/sys/param.h (MAXSYMLINKS): Define as 5
instead of SYMLOOP_MAX, which is nowhere to be found.

* sysdeps/unix/sysv/linux/sys/msq_buf.h,
  sysdeps/unix/sysv/linux/sys/sem_buf.h,
  sysdeps/unix/sysv/linux/sys/shm_buf.h [__USE_MISC]: Add more
  control ops and datastructures.

* sysdeps/unix/sysv/linux/sys/io.h: New file declaring low-level
  I/O related functions.

* sysdeps/unix/sysv/linux/sys/kdaemon.h: New file declaring kernel
daemon related functions/operations.

* sysdeps/unix/sysv/linux/sys/klog.h: New file declaring kernel
logging related functions/operations.

* sysdeps/unix/sysv/linux/sys/module.h: New file declaring kernel
module related functions/operations.

* sysdeps/unix/sysv/linux/speed.c: Only do "mention this twice" hack
for non-Alpha based Linux systems.

* sysdeps/unix/sysv/linux/alpha/speed.c: Remove.

* sysdeps/unix/sysv/linux/Makefile (headers): Add sys/module.h,
sys/io.h, sys/klog.h, and sys/kdaemon.h.

* sysdeps/unix/sysdep.h (END): Define empty END macro for
  platforms that don't need some sort of end directive at the
end of functions.

* sysdeps/unix/make-syscalls.sh: Emit END($strong) at end of
  syscall wrapper to allow correct generation of debugging
  information.

* sysdeps/unix/alpha/sysdep.h (END): Redefine to use .end
  directive for both ELF and ECOFF.
(ret): Delete macro.  It was a dangerous macro and unnecessary
  since the Alpha assemblers recognizes "ret" as a macro themselves.

* sysdeps/gnu/utmpbits.h (struct utmp): Move ut_tv behind
  ut_session to guarantee long alignment.  This is important for
  Linux/Alpha since ut_tv.tv_sec is 32 bits and time_t is 64 bits.
   This will all get cleaned up as programs start to use ut_tv
  instead ut_time.

* sysdeps/alpha/divrem.h: Include <sysdep.h> instead of <*/regdef.h>.

* sysdeps/alpha/bsd-_setjmp.S (setjmp): Renamed entry point to
_setjmp.

* sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
  sysdeps/alpha/bsd-_setjmp.S, sysdeps/alpha/bsd-setjmp.S,
  sysdeps/alpha/copysign.S, sysdeps/alpha/divrem.h,
  sysdeps/alpha/fabs.S, sysdeps/alpha/ffs.S, sysdeps/alpha/htonl.S,
  sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
  sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
  sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
  sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
  sysdeps/unix/sysv/linux/alpha/llseek.S,
  sysdeps/unix/sysv/linux/alpha/pipe.S,
  sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
  sysdeps/unix/sysv/linux/alpha/sysdep.S: Use END macro instead of
  .end directive.

* csu/initfini.c (_fini): Tell gcc that _fini is not a leaf
  function by having it contain a dummy function call.

* configure.in (config_machine): Don't make ELF the default for
  Linux/Alpha just yet (use --with-elf instead).
(.init/.fini check): Generate .text to ensure function start and
  end are in same section.

* sysdeps/unix/bsd/osf/alpha/brk.S,
  sysdeps/unix/sysv/linux/alpha/brk.S (__curbrk): Store the entire
  break value, not just the low 32 bits to accomodate large
  memories.

Tue May 28 10:46:04 1996  Richard Henderson  <rth@tamu.edu>

* sysdeps/unix/sysv/linux/alpha/brk.S: Rather than attempt to
dynamically resolve _end for initializing __curbrk, support the
brk(0) query idiom.

* sysdeps/alpha/bb_init_func.S: Don't make `init' an external symbol.

* sysdeps/alpha/bsd-_setjmp.S: The function is _setjmp not setjmp.

Sun May 26 22:17:38 1996  Richard Henderson  <rth@tamu.edu>

* stdlib/lcong48_r.c, stdlib/seed48_r.c, stdlib/strtod.c,
stdlib/strtol.c: Include <string.h> for mem* and str* fns used.

Thu May 23 02:15:56 1996  David Mosberger-Tang  <davidm@azstarnet.com>

* sysdeps/unix/sysv/linux/Makefile (headers): Add sys/io.h,
  sys/klog.h, and sys/kdaemon.h.

* sysdeps/unix/sysv/linux/sys/io.h: New file.
* sysdeps/unix/sysv/linux/sys/klog.h: Ditto.
* sysdeps/unix/sysv/linux/sys/kdaemon.h: Ditto.

* sysdeps/unix/alpha/sysdep.h (ret): Remove macro.  It is
  dangerous and unnecessary since both OSF/1 as and gas define "ret"
  as a pseudo-instruction.

Sat Jun  1 17:18:21 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

* time/tzset.c (__tzset): Clear tz_rules name pointers after freeing
them.  Bug found by David Mosberger-Tang.

* sysdeps/posix/tempname.c (__stdio_gen_tempname): Use __ptr_t instead
of PTR.

* extra-lib.mk (extra-objs): Use patsubst intead of $(A:=B) syntax
to work around Make bug when A contains var ref.

Fri May 31 18:27:52 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

* string/string.h [__USE_MISC]: Declare basename; OSF/1 puts it here.

* sysdeps/unix/sysv/linux/syscalls.list (getpgid, setpgid): Define __
strong names and [gs]etpgid as weak aliases.

* math/math_private.h (GET_LDOUBLE_EXP): Add missing backslash.

51 files changed:
ChangeLog
configure.in
csu/initfini.c
extra-lib.mk
math/math_private.h
stdlib/lcong48_r.c
stdlib/seed48_r.c
stdlib/strtod.c
stdlib/strtol.c
string/string.h
sysdeps/alpha/_mcount.S
sysdeps/alpha/bb_init_func.S
sysdeps/alpha/bsd-_setjmp.S
sysdeps/alpha/bsd-setjmp.S
sysdeps/alpha/copysign.S
sysdeps/alpha/divrem.h
sysdeps/alpha/fabs.S
sysdeps/alpha/ffs.S
sysdeps/alpha/htonl.S
sysdeps/alpha/htons.S
sysdeps/alpha/memchr.S
sysdeps/alpha/setjmp.S
sysdeps/alpha/strlen.S
sysdeps/gnu/utmpbits.h
sysdeps/posix/tempname.c
sysdeps/unix/alpha/sysdep.h
sysdeps/unix/bsd/osf/alpha/brk.S
sysdeps/unix/make-syscalls.sh
sysdeps/unix/sysdep.h
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/alpha/brk.S
sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
sysdeps/unix/sysv/linux/alpha/llseek.S
sysdeps/unix/sysv/linux/alpha/pipe.S
sysdeps/unix/sysv/linux/alpha/sigsuspend.S
sysdeps/unix/sysv/linux/alpha/speed.c [deleted file]
sysdeps/unix/sysv/linux/speed.c
sysdeps/unix/sysv/linux/sys/io.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/kdaemon.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/klog.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/module.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/sys/msq_buf.h
sysdeps/unix/sysv/linux/sys/param.h
sysdeps/unix/sysv/linux/sys/sem_buf.h
sysdeps/unix/sysv/linux/sys/shm_buf.h
sysdeps/unix/sysv/linux/syscalls.list
time/Makefile
time/clocktest.c
time/test-tz.c [new file with mode: 0644]
time/tzset.c

index 25eb06877949fbf423c34c0c3996ac063c7ecc54..ff74cae6350fbe68f941f7bda2957404db60caf8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,144 @@
+Wed May 29 00:57:37 1996  David Mosberger-Tang  <davidm@azstarnet.com>
+
+       * time/Makefile (tests): Add test-tz.
+
+       * time/test-tz.c: New test.
+
+       * time/clocktest.c: Rewrite to test more meaningfully.
+
+       * sysdeps/unix/sysv/linux/syscalls.list: Add bdflush,
+       create_module, delete_module, get_kernel_syms, init_module,
+       klogctl.
+
+       * sysdeps/unix/sysv/linux/sys/param.h (MAXSYMLINKS): Define as 5
+       instead of SYMLOOP_MAX, which is nowhere to be found.
+
+       * sysdeps/unix/sysv/linux/sys/msq_buf.h,
+       sysdeps/unix/sysv/linux/sys/sem_buf.h,
+       sysdeps/unix/sysv/linux/sys/shm_buf.h [__USE_MISC]: Add more
+       control ops and datastructures.
+
+       * sysdeps/unix/sysv/linux/sys/io.h: New file declaring low-level
+       I/O related functions.
+
+       * sysdeps/unix/sysv/linux/sys/kdaemon.h: New file declaring kernel
+       daemon related functions/operations.
+
+       * sysdeps/unix/sysv/linux/sys/klog.h: New file declaring kernel
+       logging related functions/operations.
+
+       * sysdeps/unix/sysv/linux/sys/module.h: New file declaring kernel
+       module related functions/operations.
+
+       * sysdeps/unix/sysv/linux/speed.c: Only do "mention this twice" hack
+       for non-Alpha based Linux systems.
+
+       * sysdeps/unix/sysv/linux/alpha/speed.c: Remove.
+
+       * sysdeps/unix/sysv/linux/Makefile (headers): Add sys/module.h,
+       sys/io.h, sys/klog.h, and sys/kdaemon.h.
+
+       * sysdeps/unix/sysdep.h (END): Define empty END macro for
+       platforms that don't need some sort of end directive at the
+       end of functions.
+
+       * sysdeps/unix/make-syscalls.sh: Emit END($strong) at end of
+       syscall wrapper to allow correct generation of debugging
+       information.
+
+       * sysdeps/unix/alpha/sysdep.h (END): Redefine to use .end
+       directive for both ELF and ECOFF.
+       (ret): Delete macro.  It was a dangerous macro and unnecessary
+       since the Alpha assemblers recognizes "ret" as a macro themselves.
+
+       * sysdeps/gnu/utmpbits.h (struct utmp): Move ut_tv behind
+       ut_session to guarantee long alignment.  This is important for
+       Linux/Alpha since ut_tv.tv_sec is 32 bits and time_t is 64 bits.
+       This will all get cleaned up as programs start to use ut_tv
+       instead ut_time.
+
+       * sysdeps/alpha/divrem.h: Include <sysdep.h> instead of <*/regdef.h>.
+
+       * sysdeps/alpha/bsd-_setjmp.S (setjmp): Renamed entry point to
+       _setjmp.
+
+       * sysdeps/alpha/_mcount.S, sysdeps/alpha/bb_init_func.S,
+       sysdeps/alpha/bsd-_setjmp.S, sysdeps/alpha/bsd-setjmp.S,
+       sysdeps/alpha/copysign.S, sysdeps/alpha/divrem.h,
+       sysdeps/alpha/fabs.S, sysdeps/alpha/ffs.S, sysdeps/alpha/htonl.S,
+       sysdeps/alpha/htons.S, sysdeps/alpha/memchr.S,
+       sysdeps/alpha/setjmp.S, sysdeps/alpha/strlen.S,
+       sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
+       sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
+       sysdeps/unix/sysv/linux/alpha/llseek.S,
+       sysdeps/unix/sysv/linux/alpha/pipe.S,
+       sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
+       sysdeps/unix/sysv/linux/alpha/sysdep.S: Use END macro instead of
+       .end directive.
+
+       * csu/initfini.c (_fini): Tell gcc that _fini is not a leaf
+       function by having it contain a dummy function call.
+
+       * configure.in (config_machine): Don't make ELF the default for
+       Linux/Alpha just yet (use --with-elf instead).
+       (.init/.fini check): Generate .text to ensure function start and
+       end are in same section.
+
+       * sysdeps/unix/bsd/osf/alpha/brk.S,
+       sysdeps/unix/sysv/linux/alpha/brk.S (__curbrk): Store the entire
+       break value, not just the low 32 bits to accomodate large
+       memories.
+
+Tue May 28 10:46:04 1996  Richard Henderson  <rth@tamu.edu>
+
+       * sysdeps/unix/sysv/linux/alpha/brk.S: Rather than attempt to
+       dynamically resolve _end for initializing __curbrk, support the
+       brk(0) query idiom.
+
+       * sysdeps/alpha/bb_init_func.S: Don't make `init' an external symbol.
+
+       * sysdeps/alpha/bsd-_setjmp.S: The function is _setjmp not setjmp.
+
+Sun May 26 22:17:38 1996  Richard Henderson  <rth@tamu.edu>
+
+       * stdlib/lcong48_r.c, stdlib/seed48_r.c, stdlib/strtod.c,
+       stdlib/strtol.c: Include <string.h> for mem* and str* fns used.
+
+Thu May 23 02:15:56 1996  David Mosberger-Tang  <davidm@azstarnet.com>
+
+       * sysdeps/unix/sysv/linux/Makefile (headers): Add sys/io.h,
+       sys/klog.h, and sys/kdaemon.h.
+
+       * sysdeps/unix/sysv/linux/sys/io.h: New file.
+       * sysdeps/unix/sysv/linux/sys/klog.h: Ditto.
+       * sysdeps/unix/sysv/linux/sys/kdaemon.h: Ditto.
+
+       * sysdeps/unix/alpha/sysdep.h (ret): Remove macro.  It is
+       dangerous and unnecessary since both OSF/1 as and gas define "ret"
+       as a pseudo-instruction.
+
+Sat Jun  1 17:18:21 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>
+
+       * time/tzset.c (__tzset): Clear tz_rules name pointers after freeing
+       them.  Bug found by David Mosberger-Tang.
+
+       * sysdeps/posix/tempname.c (__stdio_gen_tempname): Use __ptr_t instead
+       of PTR.
+
+       * extra-lib.mk (extra-objs): Use patsubst intead of $(A:=B) syntax
+       to work around Make bug when A contains var ref.
+
+Fri May 31 18:27:52 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>
+
+       * string/string.h [__USE_MISC]: Declare basename; OSF/1 puts it here.
+
+       * sysdeps/unix/sysv/linux/syscalls.list (getpgid, setpgid): Define __
+       strong names and [gs]etpgid as weak aliases.
+
 Thu May 30 11:24:05 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>
 
+       * math/math_private.h (GET_LDOUBLE_EXP): Add missing backslash.
+
        * po/header.pot: Replace with exact boilerplate pinard dictates.
 
        * sysdeps/i386/strtok.S (Lillegal_argument): Remove this code to set
index 1f7a8ae6f995a9d88d1ab678d9f72266193c952c..e3154b6a7c95c27076c77e905321bf5c4c635810 100644 (file)
@@ -86,13 +86,10 @@ esac
 case "$host_os" in
 gnu* | linux* | sysv4* | solaris2*)
   # These systems always use the ELF format.
-  elf=yes ;;
-esac
-
-# Linux/Alpha does not use ELF yet.
-case "$host_cpu-$host_os" in
-alpha*-linux*)
-  gnu_ld=no elf=no ;;
+  if test "$host_cpu" != alpha; then   # Linux/Alpha is not fully ELF yet
+    elf=yes
+  fi
+  ;;
 esac
 
 machine=$config_machine
@@ -406,7 +403,8 @@ fi
 if test $elf != yes; then
   AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
                 [AC_TRY_COMPILE(, [asm (".section .init");
-                                   asm (".section .fini");],
+                                   asm (".section .fini");
+                                   asm (".text");],
                                 libc_cv_have_initfini=yes,
                                 libc_cv_have_initfini=no)])
   AC_SUBST(libc_cv_have_initfini)dnl
index a91c3de7a4035ee154d7c84803799d6d57fd02c5..2727596a4ce8e6474be28b6e9706b1261479905c 100644 (file)
@@ -98,6 +98,15 @@ _fini (void)
      Then fetch the .section directive just written and append that
      to crtn.s-new, followed by the function epilogue.  */
   asm ("\nEOF.crti.fini\
+\n\
+cat > /dev/null <<\\EOF.fini.skip");
+
+  /* Let GCC know that _fini is not a leaf function by having a dummy
+     function call here.  We arrange for this call to be omitted from
+     either crt file.  */
+  i_am_not_a_leaf();
+
+  asm ("\nEOF.fini.skip\
 \n\
        fgrep .fini crti.s-new >>crtn.s-new\n\
        cat >> crtn.s-new <<\\EOF.crtn.fini");
index 99fce5b1107dd9bbdd32f585ca18baa6261dcb6a..283da06b93d623685ecd3615109f4e73d9a24680 100644 (file)
@@ -19,7 +19,8 @@ extra-objs := $(extra-objs)
 
 # Add each flavor of library to the lists of things to build and install.
 install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
-extra-objs += $(foreach o,$(object-suffixes-$(lib)),$($(lib)-routines:=$o))
+extra-objs += $(foreach o,$(object-suffixes-$(lib)),\
+                       $(patsubst %,%$o,$($(lib)-routines)))
 alltypes-$(lib) := $(foreach o,$(object-suffixes-$(lib)),\
                             $(objpfx)$(patsubst %,$(libtype$o),\
                             $(lib:lib%=%)))
index c4ac85760720cbbb33a28bda5a7c372436405b72..850442ca950bbd1ccfd09bbc3618c7cea918f436 100644 (file)
@@ -219,7 +219,7 @@ do {                                                                \
 #define GET_LDOUBLE_EXP(exp,d)                                 \
 do {                                                           \
   ieee_long_double_shape_type ge_u;                            \
-  ge_u.value = (d);
+  ge_u.value = (d);                                            \
   (exp) = ge_u.parts.sign_exponent;                            \
 } while (0)
 
index f607bc5b8400975cb60f018a0883ec4eab04d03b..8584eddf0b087c05ada1c8df0e41f96694733455 100644 (file)
@@ -18,6 +18,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include <stdlib.h>
+#include <string.h>
 
 int
 lcong48_r (param, buffer)
index e45c3d2ad3d682cde29047da7592560895d126dc..24511343c7e2a38a24ec93cc398504155f8e275d 100644 (file)
@@ -18,6 +18,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include <stdlib.h>
+#include <string.h>
 
 int
 seed48_r (seed16v, buffer)
index f32ffc616223cade55a5989afe62c6b22f4d737a..aff0045542aa6f4c09957a334f317ab1e12d4004 100644 (file)
@@ -57,6 +57,7 @@ Boston, MA 02111-1307, USA.  */
 #include "../locale/localeinfo.h"
 #include <math.h>
 #include <stdlib.h>
+#include <string.h>
 
 /* The gmp headers need some configuration frobs.  */
 #define HAVE_ALLOCA 1
index dd92fb250cc3feec4739778a50f745be33c2d8f7..06639a763ade9188dc3f4dfd1e40dbe100aab4ae 100644 (file)
@@ -39,6 +39,7 @@ extern int errno;
 #ifdef STDC_HEADERS
 # include <stddef.h>
 # include <stdlib.h>
+# include <string.h>
 #else
 # ifndef NULL
 #  define NULL 0
index 0df63d0653c3ef1f0c23056369dcd17cfe346929..905eb7e3c98101fd4b549497c1463a510a5c33f1 100644 (file)
@@ -213,6 +213,11 @@ extern char *strfry __P ((char *__string));
 extern __ptr_t memfrob __P ((__ptr_t __s, size_t __n));
 #endif
 
+#ifdef __USE_MISC
+/* Return the file name within directory of FILENAME.  */
+extern char *basename __P ((__const char *filename));
+#endif
+
 __END_DECLS
 
 #endif /* string.h  */
index 7944544e18494e99c2ff3a8cce68e77417dc2576..17307603162f37ac27107f7a8164e42ac8bf6cad 100644 (file)
@@ -106,4 +106,4 @@ LEAF(_mcount, 0xb0)
        addq    sp, 0xb0, sp
        ret     zero,($at),1
 
-       .end _mcount
+       END(_mcount)
index cd860b830352c595b82ac6428baa70c7730023db..dfa8c1d07b5f263cd98134d6cad9dd59830b756f 100644 (file)
@@ -41,10 +41,11 @@ ENTRY(__bb_init_func)
        beq     t0, init                /* not initialized yet -> */
        ret
        
-       .end __bb_init_func
+END(__bb_init_func)
 
-
-LEAF(init, 0x38)
+.ent init
+init:
+       .frame  sp, 0x38, ra, 0
        subq    sp, 0x38, sp
        .prologue 0
 
@@ -84,4 +85,4 @@ leave:        ldq     pv, 0x30(sp)
        addq    sp, 0x38, sp
        ret
 
-       .end init
+.end init
index 16709dfc09bfae70d6089445b8f9f95c66c4f20e..da60442c23b034c3a0a61a642fae174e6d26a699 100644 (file)
@@ -23,8 +23,8 @@ Cambridge, MA 02139, USA.  */
 
 #include <sysdep.h>
 
-ENTRY(setjmp)
+ENTRY(_setjmp)
        lda     $27, __sigsetjmp        /* Load address to jump to.  */
        bis     $31, $31, $17           /* Pass a second argument of zero.  */
        jmp     $31, ($27), __sigsetjmp /* Call __sigsetjmp.  */
-       .end setjmp
+       END(_setjmp)
index 113bc47c888f26aa7876dae5ab5f4dcfd895a340..fc73815a8497cc1bd91605b6bba0dd7ae3f89fcc 100644 (file)
@@ -27,4 +27,4 @@ ENTRY(setjmp)
        lda     $27, __sigsetjmp        /* Load address to jump to.  */
        bis     $31, 1, $17             /* Pass a second argument of one.  */
        jmp     $31, ($27), __sigsetjmp /* Call __sigsetjmp.  */
-       .end setjmp
+       END(setjmp)
index 9e9dff3ed0594074f0e716896189f61fe60fe7a4..95eb6086660e80ed5236ae265092893f731af53d 100644 (file)
@@ -24,6 +24,6 @@ ENTRY(__copysign)
        cpys    $f17,$f16,$f0
        ret
 
-       .end __copysign
+       END(__copysign)
 
 weak_alias(__copysign, copysign)
index ee7f64ef1e31cd49b7a7d1eaa9df0b6f2fdb7835..f296179e99bf23197dd6ee4b9c1ab81a6e43cd78 100644 (file)
@@ -32,12 +32,12 @@ sequence, these expect their arguments in registers t10 and t11, and
 return the result in t12 (aka pv). Registers AT and v0 may be
 clobbered (assembly temporary), anything else must be saved.  */
 
+#include <sysdep.h>
+
 #ifdef __linux__
-# include <alpha/regdef.h>
 # include <asm/gentrap.h>
 # include <asm/pal.h>
 #else
-# include <regdef.h>
 # include <machine/pal.h>
 #endif
 
@@ -185,4 +185,4 @@ divbyzero:
        ldq     arg1,0x00(sp)
        br      done
 
-       .end FUNC_NAME
+       END(FUNC_NAME)
index 88e64b471896d5002b6c2345369be8efcb560817..dff8390b5ac07ab2562b49806b77fefebaab64e2 100644 (file)
@@ -24,4 +24,4 @@ ENTRY(fabs)
        cpys    $f31,$f16,$f0
        ret
 
-       .end fabs
+       END(fabs)
index 7cf6281682cf0869297669c5a5faf8e43f08ee6c..e4dd87c9f14b9f4962297b1b53c99d884ee11dbf 100644 (file)
@@ -63,4 +63,4 @@ ENTRY(ffs)
 
 done:   ret
 
-        .end    ffs
+        END(ffs)
index 8c1c7002120708eff8f39473b74101854f9ba3c3..9777e461cc5db0a77d579292a7e1d6b36fc15c76 100644 (file)
@@ -31,7 +31,7 @@ ENTRY(__htonl)
        or      t2, v0, v0      # v0 = ddccbbaa
        ret
 
-       .end    __htonl
+       END(__htonl)
 
 strong_alias_asm(__htonl, __ntohl)
 weak_alias(__htonl, htonl)
index cb22b216611e3a69ff3d09cdfa736f58e72c3d12..7717636782813457019185d1ee614327ed848471 100644 (file)
@@ -25,7 +25,7 @@ ENTRY(__htons)
        bis     v0, t1, v0      # v0 = bbaa
        ret
 
-       .end    __htons
+       END(__htons)
 
 strong_alias_asm(__htons, __ntohs)
 weak_alias(__htons, htons)
index 2f786974187343debb305f6d717468cf45ad2b47..2d21247174ae3425a590ca1d810bfbe5dc2260c3 100644 (file)
@@ -157,4 +157,4 @@ not_found:
        mov     zero, v0
        ret
 
-        .end    memchr
+        END(memchr)
index b165d2c2c8125988dc36f374ab64fef0e332cd40..da71a3292a2fe931f226dc3f90586dd3bd264ad4 100644 (file)
@@ -30,4 +30,4 @@ ENTRY (__sigsetjmp)
        bis     $15, $15, $19           /* Pass FP as 4th arg.  */
        jmp     $31, ($27), __sigsetjmp_aux /* Call __sigsetjmp_aux.  */
 
-       .end __sigsetjmp
+       END(__sigsetjmp)
index c64126164ab3660ad3ae4cdd507a648e23d7f7a1..15c78cde648e85cbc23cd445ef98ae4f984067cb 100644 (file)
@@ -67,4 +67,4 @@ found:  blbs    t1, done        # make aligned case fast
 done:   subq    v0, a0, v0
         ret
 
-        .end    strlen
+        END(strlen)
index e8c41f881461882654bd56406ddb91f5e66a5a2b..2244ecbf755efc64e4d8ad635eaa2187bd0b7615 100644 (file)
@@ -69,8 +69,8 @@ struct utmp
   char ut_user[UT_NAMESIZE];   /* Username (not NUL terminated).  */
   char ut_host[UT_HOSTSIZE];   /* Hostname for remote login.  */
   int ut_exit;                 /* Process termination/exit status.  */
-  struct timeval ut_tv;                /* Time entry was made.  */
   long ut_session;             /* Session ID, used for windowing.  */
+  struct timeval ut_tv;                /* Time entry was made.  */
   int32_t ut_addr;             /* Internet address of remote host.  */
   char pad[32];                        /* Reserved for future use.  */
 };
index fdddae2d0c4015530f0ac83176ae0227dabd9981..5881febf810444890596a52dcb10dfd9918df346 100644 (file)
@@ -218,7 +218,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
                  errno = save;
                  return NULL;
                }
-             (*streamptr)->__cookie = (PTR) (long int) fd;
+             (*streamptr)->__cookie = (__ptr_t) (long int) fd;
              (*streamptr)->__mode.__write = 1;
              (*streamptr)->__mode.__read = 1;
              (*streamptr)->__mode.__binary = 1;
index 8a52f201e12960cc36f6bde81c111a8d663d24e4..6fed4a6adf24a660d9b20e0cc3154d3bcf101e42 100644 (file)
@@ -97,7 +97,9 @@ name/**/:                                     \
 3:
 #endif
 
-#define ret    ret     zero,(ra),1
+#undef END
+#define END(sym)       .end sym
+
 #define r0     v0
 #define r1     a4
 
index 6e4bd2cc71841b3728ffc1c6aa217bdc22774ae4..105e40100bc08c7a42c90b170b7eabb11122020a 100644 (file)
@@ -41,7 +41,7 @@ ENTRY(__brk)
 
        /* Update __curbrk and exit cleanly.  */
 /*     ldgp gp, 0(t12) */
-       stl a0, __curbrk
+       stq a0, __curbrk
 
        mov zero, v0
        ret
index ff4b082b11c8f4ea4276de2643dd1836218946f4..5251e84cb9c845718cb2b80601863cd85334799c 100644 (file)
@@ -61,7 +61,8 @@ EOF
 \$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o): \$(objpfx)s-proto.d
        (echo '#include <sysdep.h>'; \\
         echo 'PSEUDO ($strong, $syscall, $nargs)'; \\
-        echo ' ret'; \\"
+        echo ' ret'; \\
+        echo 'END($strong)'; \\"
 
   # Append any weak aliases defined for this syscall function.
   for name in $weak; do
index 456970638cafdc4d5308a67913f46ac7076a5fc5..0dde0b04a683e1e94677e9e77a07ac290cece5cd 100644 (file)
@@ -54,3 +54,7 @@ Cambridge, MA 02139, USA.  */
 #else
 #define SYS_ify(syscall_name) SYS_/**/syscall_name
 #endif
+
+/* Terminate a function named SYM.  This is used on some platforms to
+   generate correct debugging information.  */
+#define END(sym)
index 406c338025d9c932b17e72c66e2ac6251dd15ace..412227a320784dba0ab6d9bae793bfcd4c28c2f0 100644 (file)
@@ -17,7 +17,9 @@ endif
 ifeq ($(subdir), misc)
 sysdep_routines += mount umount xmknod s_ptrace s_sysctl sysctl llseek \
 setfsgid setfsuid sysinfo uselib s_reboot
-headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h
+
+headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h sys/module.h \
+       sys/io.h sys/klog.h sys/kdaemon.h
 
 install-others += $(includedir)/sys/syscall.h
 
index 4582539bc1b9cc36886a91eabcfc439ecc929a88..1c4a4f9217cb3f2322581d37adfa79e80b88d824 100644 (file)
@@ -23,17 +23,7 @@ break value (instead of the new, requested one).  */
 #include <sysdep.h>
 #include <errnos.h>
 
-#ifndef       HAVE_GNU_LD
-#define _end           end
-#endif
-
-       .extern _end,8
-
-       .data
-
-       .globl __curbrk
-__curbrk:
-       .quad _end
+.comm __curbrk, 8
 
        .text
 LEAF(__brk, 0)
@@ -42,11 +32,15 @@ LEAF(__brk, 0)
 
        ldi     v0, __NR_brk
        call_pal PAL_callsys
+
+       /* Correctly handle the brk(0) query case.  */
+       cmoveq  a0, v0, a0
+
        subq    a0, v0, t0
        bne     t0, error
 
        /* Update __curbrk and return cleanly.  */
-       stl     a0, __curbrk
+       stq     a0, __curbrk
        mov     zero, v0
        ret
 
@@ -54,6 +48,6 @@ LEAF(__brk, 0)
 error: ldi     v0, ENOMEM
        jmp     zero, syscall_error
 
-       .end __brk
+       END(__brk)
 
 weak_alias (__brk, brk)
index c3486acc1af01988e7329cba8cde7f4a0339df19..52c945aec2642120995f474c1609fdac9a66c9de 100644 (file)
@@ -41,6 +41,6 @@ error:        lda     sp, 8(sp)
 1:     ldgp    gp, 0(gp)
        jmp     zero, syscall_error
 
-       .end __ieee_get_fp_control
+       END(__ieee_get_fp_control)
 
 weak_alias (__ieee_get_fp_control, ieee_get_fp_control)
index 507b5d5cabfebd8a83e1b0cdfbfff5f822b0997d..d72585daf1874cf652217b6e8eddec36c9c15731 100644 (file)
@@ -39,6 +39,6 @@ error:        br      gp, 1f
 1:     ldgp    gp, 0(gp)
        jmp     zero, syscall_error
 
-       .end __ieee_set_fp_control
+       END(__ieee_set_fp_control)
 
 weak_alias (__ieee_set_fp_control, ieee_set_fp_control)
index 7f2a49172a1c8a61b2bdd90277ef7e5afdb69710..bd8c6595c9c3ad324bf36869d7a59819e81b6747 100644 (file)
@@ -46,4 +46,4 @@ error:        br      gp, 1f
 1:     ldgp    gp, 0(gp)
        jmp     zero, syscall_error
 
-       .end llseek
+       END(llseek)
index 40958466a42cdba49f13ea2c16596339b307c4f2..b23803cecd32823f847da160beb6a7f8a9ede1df 100644 (file)
@@ -37,6 +37,6 @@ error:        br      gp, 1f
 1:     ldgp    gp, 0(gp)
        jmp     zero, syscall_error
 
-       .end __pipe
+       END(__pipe)
 
 weak_alias (__pipe, pipe)
index 00c02de72bd6925bddb3f5c5d976ad1e82a2bb6b..26a1869783aef006dc771bebef5b49f4c40f17e4 100644 (file)
@@ -36,4 +36,4 @@ error:        br      gp, 1f
 1:     ldgp    gp, 0(gp)
        jmp     zero, syscall_error
 
-       .end sigsuspend
+       END(sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/alpha/speed.c b/sysdeps/unix/sysv/linux/alpha/speed.c
deleted file mode 100644 (file)
index 40bf6c5..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/* `struct termios' speed frobnication functions.  Linux version.
-Copyright (C) 1991, 1992, 1993, 1995 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
-
-#include <stddef.h>
-#include <errno.h>
-#include <termios.h>
-
-static const speed_t speeds[] =
-  {
-    0,
-    50,
-    75,
-    110,
-    134,
-    150,
-    200,
-    300,
-    600,
-    1200,
-    1800,
-    2400,
-    4800,
-    9600,
-    19200,
-    38400,
-    57600,
-    115200,
-    230400,
-    460800,
-  };
-
-
-/* Return the output baud rate stored in *TERMIOS_P.  */
-speed_t
-cfgetospeed (termios_p)
-     const struct termios *termios_p;
-{
-  speed_t retval = termios_p->c_cflag & (CBAUD | CBAUDEX);
-
-  if (retval & CBAUDEX)
-    {
-      retval &= ~CBAUDEX;
-      retval |= CBAUD + 1;
-    }
-
-  return retval;
-}
-
-/* Return the input baud rate stored in *TERMIOS_P.
-   For Linux there is no difference between input and output speed.  */
-strong_alias (cfgetospeed, cfgetispeed);
-
-/* Set the output baud rate stored in *TERMIOS_P to SPEED.  */
-int
-cfsetospeed  (termios_p, speed) 
-     struct termios *termios_p;
-     speed_t speed;
-{
-  register unsigned int i;
-
-  if (termios_p == NULL)
-    {
-      errno = EINVAL;
-      return -1;
-    }
-
-  /* This allows either B1200 or 1200 to work. XXX
-     Do we really want to try to support this, given that
-     fetching the speed must return one or the other?  */
-
-  for (i = 0; i < sizeof (speeds) / sizeof (speeds[0]); ++i)
-    if (i == speed || speeds[i] == speed)
-      {
-       termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
-       termios_p->c_cflag |= (i & CBAUD);
-       if (i & ~CBAUD)
-         termios_p->c_cflag |= CBAUDEX;
-       return 0;
-      }
-
-  errno = EINVAL;
-  return -1;
-}
-
-/* Set the input baud rate stored in *TERMIOS_P to SPEED.
-   For Linux there is no difference between input and output speed.  */
-strong_alias (cfsetospeed, cfsetispeed);
index d229f766f963e4fcd9bcc030723ec0b6c4e97fbf..0ad48a23d8460ed3289199f166a4e752f7f1fba3 100644 (file)
@@ -39,7 +39,9 @@ static const speed_t speeds[] =
     9600,
     19200,
     38400,
+#ifndef __alpha__
     38400,             /* Mention this twice here is a trick.  */
+#endif
     57600,
     115200,
     230400,
diff --git a/sysdeps/unix/sysv/linux/sys/io.h b/sysdeps/unix/sysv/linux/sys/io.h
new file mode 100644 (file)
index 0000000..d44850f
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996 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., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _SYS_IO_H
+#define _SYS_IO_H
+
+#include <asm/io.h>
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
+   permission off for that range.  This call requires root privileges.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+extern int ioperm __P((unsigned long __from, unsigned long __num,
+                      int __turn_on));
+
+/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl __P((int __level));
+
+#endif /* _SYS_IO_H */
diff --git a/sysdeps/unix/sysv/linux/sys/kdaemon.h b/sysdeps/unix/sysv/linux/sys/kdaemon.h
new file mode 100644 (file)
index 0000000..fce169f
--- /dev/null
@@ -0,0 +1,9 @@
+/* Interfaces to control the various kernel daemons.  */
+
+#ifndef _SYS_KDAEMON_H
+#define _SYS_KDAEMON_H
+
+/* Start, flush, or tune the kernel's buffer flushing daemon.  */
+extern int bdflush (int func, long data);
+
+#endif /* _SYS_KDAEMON_H */
diff --git a/sysdeps/unix/sysv/linux/sys/klog.h b/sysdeps/unix/sysv/linux/sys/klog.h
new file mode 100644 (file)
index 0000000..b8a39d6
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _SYS_KLOG_H
+#define _SYS_KLOG_H
+
+/* Control the kernel's logging facility.  This corresponds exactly to
+   the kernel's syslog system call, but that name is easily confused
+   with the user-level syslog facility, which is something completely
+   different.  */
+extern int klogctl __P((int type, char *bufp, int len));
+
+#endif /* _SYS_KLOG_H */
diff --git a/sysdeps/unix/sysv/linux/sys/module.h b/sysdeps/unix/sysv/linux/sys/module.h
new file mode 100644 (file)
index 0000000..5c4dbce
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef _SYS_MODULE_H
+#define _SYS_MODULE_H
+
+#include <features.h>
+
+#include <linux/module.h>
+
+/* Return number of kernel symbols if TABLE == NULL, otherwise, return
+   kernel symbols in TABLE.  TABLE must be large enough to hold all
+   kernel symbols.  */
+extern int get_kernel_syms __P((struct kernel_sym * table));
+
+/* Create a new module of name MODULE_NAME and of size SIZE bytes.
+   The return address is the starting address of the new module or -1L
+   if the module cannot be created (the return value needs to be cast
+   to (long) to detect the error condition).  */
+extern unsigned long create_module __P((const char * module_name,
+                                       size_t size));
+
+/* Initialize the module called MODULE_NAME with the CONTENTSSIZE
+   bytes starting at address CONTENTS.  CONTENTS normally contains the
+   text and data segment of the module (the bss is implicity zeroed).
+   After copying the contents, the function pointed to by
+   ROUTINES.init is executed.  When the module is no longer needed,
+   ROUTINES.cleanup is executed.  SYMTAB is NULL if the module does
+   not want to export symbols by itself, or a pointer to a symbol
+   table if the module wants to register its own symbols.  */
+extern int init_module __P((const char * module_name,
+                           const void * contents, size_t contentssize,
+                           struct mod_routines * routines,
+                           struct symbol_table * symtab));
+
+/* Delete the module named MODULE_NAME from the kernel.  */
+extern int delete_module __P((const char *module_name));
+
+#endif /* _SYS_MODULE_H */
index 92a52d515d1bbdd652d6ba9f31a5a4e71a4c4132..6e4435dc235f2353cc9d916e664f01a7d41b32c8 100644 (file)
@@ -49,6 +49,28 @@ struct msqid_ds
   __pid_t msg_lrpid;           /* pid of last msgrcv() */
 };
 
+#ifdef __USE_MISC
+
+#define msg_cbytes     __msg_cbytes
+
+/* ipcs ctl commands */
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo {
+    int msgpool;
+    int msgmap; 
+    int msgmax; 
+    int msgmnb; 
+    int msgmni; 
+    int msgssz; 
+    int msgtql; 
+    ushort  msgseg; 
+};
+
+#endif /* __USE_MISC */
+
 __END_DECLS
 
 #endif /* sys/msq_buf.h */
index 4950d58d3816f0ba89890162344c24bc7311eeb6..e4a8406e44c812abf75c755d3e85bca57a788fb7 100644 (file)
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #ifndef        NGROUPS
 #define        NGROUPS         NGROUPS_MAX
 #endif
-#define        MAXSYMLINKS     SYMLOOP_MAX
+#define        MAXSYMLINKS     5
 #define        CANBSIZ         MAX_CANON
 #define        NCARGS          ARG_MAX
 #define MAXPATHLEN      PATH_MAX
index d93002ad6ee92529e40c306fab0f4b82071fa7d4..bfac9141bfeca783e05a3583ee19c32d29b68735 100644 (file)
@@ -60,6 +60,27 @@ union semun
   struct seminfo *__buf;               /* buffer for IPC_INFO */
 };
 
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+struct  seminfo {
+    int semmap;
+    int semmni;
+    int semmns;
+    int semmnu;
+    int semmsl;
+    int semopm;
+    int semume;
+    int semusz;
+    int semvmx;
+    int semaem;
+};
+
+#endif /* __USE_MISC */
+
 __END_DECLS
 
 #endif /* sys/sem_buf.h */
index fa1e8235d89720802a7dd1df8f61a83cad018835..048aa64dc24dfa5f266e490bc7453caf51622263 100644 (file)
@@ -38,11 +38,11 @@ __BEGIN_DECLS
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
 {
-  struct ipc_perm sem_perm;            /* operation permisson struct */
+  struct ipc_perm shm_perm;            /* operation permisson struct */
   int shm_segsz;                       /* size of segment in bytes */
-  __time_t sem_atime;                  /* time of last shmat() */
-  __time_t sem_dtime;                  /* time of last shmdt() */
-  __time_t sem_ctime;                  /* time of last change by shmctl() */
+  __time_t shm_atime;                  /* time of last shmat() */
+  __time_t shm_dtime;                  /* time of last shmdt() */
+  __time_t shm_ctime;                  /* time of last change by shmctl() */
   __pid_t shm_cpid;                    /* pid of creator */
   __pid_t shm_lpid;                    /* pid of last shmop */
   unsigned short int shm_nattch;       /* number of current attaches */
@@ -51,6 +51,35 @@ struct shmid_ds
   struct vm_area_struct *__attaches;   /* descriptors for attaches */
 };
 
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+#define SHM_STAT       13
+#define SHM_INFO       14
+
+/* shm_mode upper byte flags */
+#define        SHM_DEST        01000   /* segment will be destroyed on last detach */
+#define SHM_LOCKED      02000   /* segment will not be swapped */
+
+struct shminfo {
+    int shmmax;        
+    int shmmin;        
+    int shmmni;        
+    int shmseg;        
+    int shmall;        
+};
+
+struct shm_info {
+       int   used_ids;
+       ulong shm_tot; /* total allocated shm */
+       ulong shm_rss; /* total resident shm */
+       ulong shm_swp; /* total swapped shm */
+       ulong swap_attempts;
+       ulong swap_successes;
+};
+
+#endif /* __USE_MISC */
+
 __END_DECLS
 
 #endif /* sys/shm_buf.h */
index f401bc8c602f7d95071e4df505075e100c7debcf..db27320c935b6a9150f66a8193fce73ae507549d 100644 (file)
@@ -1,15 +1,20 @@
 # File name    Caller  Syscall name    # args  Strong name     Weak names
 
 adjtimex       adjtime adjtimex        1       __adjtimex
+bdflush                -       bdflush         2       bdflush
+create_module  -       create_module   3       create_module
+delete_module  -       delete_module   3       delete_module
 fdatasync      -       fdatasync       1       fdatasync
 flock          -       flock           2       __flock         flock
 fork           -       fork            0       __fork          fork
+get_kernel_syms        -       get_kernel_syms 1       get_kernel_syms
 getegid                -       getegid         0       __getegid       getegid
 geteuid                -       geteuid         0       __geteuid       geteuid
-getpgid                -       getpgid         1       getpgid
+getpgid                -       getpgid         1       __getpgid       getpgid
 getpgrp                -       getpgrp         0       getpgrp
 getppid                -       getppid         0       __getppid       getppid
 getsid         -       getsid          1       getsid
+init_module    -       init_module     5       init_module
 ioperm         -       ioperm          3       ioperm
 iopl           -       iopl            1       iopl
 ipc            msgget  ipc             5       __ipc
@@ -37,11 +42,12 @@ sched_primin        -       sched_get_priority_min  1       __sched_get_priority_min        sched_get_prior
 sched_rr_gi    -       sched_rr_get_interval   2       __sched_rr_get_interval sched_rr_get_interval
 setfsgid       -       setfsgid        1       setfsgid
 setfsuid       -       setfsuid        1       setfsuid
-setpgid                -       setpgid         2       setpgid
+setpgid                -       setpgid         2       __setpgid       setpgid
 sigpending     -       sigpending      1       sigpending
 sigprocmask    -       sigprocmask     3       __sigprocmask   sigprocmask
 s_sysctl       sysctl  _sysctl         1       __syscall__sysctl
 sysinfo                -       sysinfo         1       sysinfo
+ksyslog_ctl    -       syslog          3       ksyslog_ctl
 umount         -       umount          1       __umount        umount
 uselib         -       uselib          1       uselib
 wait4          -       wait4           4       __wait4         wait4
index bd4d6b1c3ce584d203a57cba67a78109ea94bcee..dd5014104a6f4fb78ed67c88bb2ca0cdb20e94e4 100644 (file)
@@ -33,7 +33,7 @@ routines      := offtime asctime clock ctime difftime gmtime  \
                   strptime
 
 others := ap zdump zic
-tests  := test_time clocktest
+tests  := test_time clocktest test-tz
 
 tzfiles := africa antarctica asia australasia europe northamerica \
           southamerica etcetera factory systemv backward
index 0a248aa18136e149cf8c719ecc223d121e8681ca..570c194a8163ccf3eb6763a6a52b7295d87311d5 100644 (file)
@@ -1,16 +1,31 @@
+#include <signal.h>
 #include <stdio.h>
 #include <time.h>
+#include <unistd.h>
 
-main ()
+volatile int gotit = 0;
+
+void
+alarm_handler (int signal)
+{
+    gotit = 1;
+}
+
+
+int
+main (int argc, char ** argv)
 {
-  volatile int i;
-  double t1, t2, t;
+  clock_t start, stop;
 
-  t1 = (double) clock ();
-  for (i = 0; i < 100000; ++i) ;
-  t2 = (double) clock ();
+  signal(SIGALRM, alarm_handler);
+  alarm(1);
+  start = clock ();
+  while (!gotit);
+  stop = clock ();
 
-  t = (t2 - t1) / ((double) CLOCKS_PER_SEC);
-  printf ("%f - %f = %f\n",t2,t1,t);
+  printf ("%ld clock ticks per second (start=%ld,stop=%ld)\n",
+         stop - start, start, stop);
+  printf ("CLOCKS_PER_SEC=%d, sysconf(_SC_CLK_TCK)=%ld\n",
+         CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK));
   return 0;
 }
diff --git a/time/test-tz.c b/time/test-tz.c
new file mode 100644 (file)
index 0000000..47565ce
--- /dev/null
@@ -0,0 +1,57 @@
+#include <stdlib.h>
+#include <time.h>
+#include <string.h>
+#include <stdio.h>
+
+struct {
+  const char * env;
+  time_t       expected;
+} tests[] = {
+  {"TZ=MST",           832935315},
+  {"TZ=",              832910115},
+  {"TZ=:UTC",          832910115},
+  {"TZ=UTC",           832910115},
+  {"TZ=UTC0",          832910115}
+};
+
+
+int
+main(int argc, char ** argv)
+{
+  int errors = 0;
+  struct tm tm;
+  time_t t;
+  int i;
+
+  memset (&tm, 0, sizeof (tm));
+  tm.tm_isdst = 0;
+  tm.tm_year  = 96;    /* years since 1900 */
+  tm.tm_mon   = 4;
+  tm.tm_mday  = 24;
+  tm.tm_hour  =  3;
+  tm.tm_min   = 55;
+  tm.tm_sec   = 15;
+
+  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+    {
+      putenv (tests[i].env);
+      tzset ();
+      t = mktime(&tm);
+      if (t != tests[i].expected)
+       {
+         printf ("%s: flunked test %d (expected %lu, got %lu)\n",
+                 argv[0], i, (long) tests[i].expected, (long) t);
+         ++errors;
+       }
+    }
+  if (errors == 0)
+    {
+      puts ("No errors.");
+      exit (EXIT_SUCCESS);
+    }
+  else
+    {
+      printf ("%d errors.\n", errors);
+      exit (EXIT_FAILURE);
+    }
+}
index 007997f5411628a766f2b6e04c51489b9f4e3ad5..5f949dce5f6fff69613144a5b988369d15e682d2 100644 (file)
@@ -85,10 +85,16 @@ DEFUN_VOID(__tzset)
 
   /* Free old storage.  */
   if (tz_rules[0].name != NULL && *tz_rules[0].name != '\0')
-    free((PTR) tz_rules[0].name);
+    {
+      free((PTR) tz_rules[0].name);
+      tz_rules[0].name = NULL;
+    }
   if (tz_rules[1].name != NULL && *tz_rules[1].name != '\0' &&
       tz_rules[1].name != tz_rules[0].name)
-    free((PTR) tz_rules[1].name);
+    {
+      free((PTR) tz_rules[1].name);
+      tz_rules[1].name = NULL;
+    }
 
   /* Examine the TZ environment variable.  */
   tz = getenv ("TZ");