]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 11 Apr 1998 09:51:01 +0000 (09:51 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 11 Apr 1998 09:51:01 +0000 (09:51 +0000)
1998-04-11 09:33  Ulrich Drepper  <drepper@cygnus.com>

* Makeconfig (rtobjdir): New variable.
(rpath-link): Add rtobjdir and thread directory, if available.

* test-skeleton.c: Add support to remove temporary files.
Always define test_dir.  Improve message about expected signal.

* rt/Makefile (tests): Add tst-aio.
Add rules for tst-aio to be linked with librt and thread library.
* rt/aio_misc.c: Correct fundamental bugs.
* rt/aio_suspend.c: Correct bug in test for available request.
Initialize conditional variable.
* rt/lio_listio.c: Initialize conditional variable.
* rt/lio_listio64.c: Likewise.
* rt/tst-aio.c: New file.

* sysdeps/libm-ieee754/s_signgam.c: Undo last change.
* sysdeps/libm-ieee754/w_gamma.c: Likewise.  Adopt for ISO C 9x.
* sysdeps/libm-ieee754/w_gammaf.c: Likewise.
* sysdeps/libm-ieee754/w_gammal.c: Likewise.
* sysdeps/libm-ieee754/w_lgamma.c: Likewise.
* sysdeps/libm-ieee754/w_lgammaf.c: Likewise.
* sysdeps/libm-ieee754/w_lgammal.c: Likewise.

1998-04-11 14:49  Mark Kettenis  <kettenis@landau.phys.uva.nl>

* posix/regex.c [_LIBC] (__re_syntax_options): Initialize to 0.

* elf/dl-load.c (open_path): Use correct name for test whether
directory in load path exists.

* sysdeps/libm-ieee754/s_expm1.c: Remove variable one.
* sysdeps/libm-ieee754/e_pow.c: Fix typo.
Patches by Tom Rini <trini@kernel.crashing.org>.

* wcsmbs/wcstof_l.c: Declare ____wcstoull_l_internal.
* wcsmbs/wcstod_l.c: Likewise.
* wcsmbs/wcstold_l.c: Likewise.

25 files changed:
ChangeLog
Makeconfig
elf/dl-load.c
malloc/mtrace.c
math/math.h
posix/regex.c
rt/Makefile
rt/aio_misc.c
rt/aio_suspend.c
rt/lio_listio.c
rt/lio_listio64.c
rt/tst-aio.c [new file with mode: 0644]
sysdeps/libm-ieee754/e_pow.c
sysdeps/libm-ieee754/s_expm1.c
sysdeps/libm-ieee754/s_signgam.c
sysdeps/libm-ieee754/w_gamma.c
sysdeps/libm-ieee754/w_gammaf.c
sysdeps/libm-ieee754/w_gammal.c
sysdeps/libm-ieee754/w_lgamma.c
sysdeps/libm-ieee754/w_lgammaf.c
sysdeps/libm-ieee754/w_lgammal.c
test-skeleton.c
wcsmbs/wcstod_l.c
wcsmbs/wcstof_l.c
wcsmbs/wcstold_l.c

index 8b9281881e91ac03c5d4877ff2989a3bbb6f00ad..663971b2751235af50da6111b3422dd320b64c67 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,45 @@
+1998-04-11 09:33  Ulrich Drepper  <drepper@cygnus.com>
+
+       * Makeconfig (rtobjdir): New variable.
+       (rpath-link): Add rtobjdir and thread directory, if available.
+
+       * test-skeleton.c: Add support to remove temporary files.
+       Always define test_dir.  Improve message about expected signal.
+
+       * rt/Makefile (tests): Add tst-aio.
+       Add rules for tst-aio to be linked with librt and thread library.
+       * rt/aio_misc.c: Correct fundamental bugs.
+       * rt/aio_suspend.c: Correct bug in test for available request.
+       Initialize conditional variable.
+       * rt/lio_listio.c: Initialize conditional variable.
+       * rt/lio_listio64.c: Likewise.
+       * rt/tst-aio.c: New file.
+
+       * sysdeps/libm-ieee754/s_signgam.c: Undo last change.
+       * sysdeps/libm-ieee754/w_gamma.c: Likewise.  Adopt for ISO C 9x.
+       * sysdeps/libm-ieee754/w_gammaf.c: Likewise.
+       * sysdeps/libm-ieee754/w_gammal.c: Likewise.
+       * sysdeps/libm-ieee754/w_lgamma.c: Likewise.
+       * sysdeps/libm-ieee754/w_lgammaf.c: Likewise.
+       * sysdeps/libm-ieee754/w_lgammal.c: Likewise.
+
+1998-04-11 14:49  Mark Kettenis  <kettenis@landau.phys.uva.nl>
+
+       * posix/regex.c [_LIBC] (__re_syntax_options): Initialize to 0.
+
 1998-04-10  Ulrich Drepper  <drepper@cygnus.com>
 
+       * elf/dl-load.c (open_path): Use correct name for test whether
+       directory in load path exists.
+
+       * sysdeps/libm-ieee754/s_expm1.c: Remove variable one.
+       * sysdeps/libm-ieee754/e_pow.c: Fix typo.
+       Patches by Tom Rini <trini@kernel.crashing.org>.
+
+       * wcsmbs/wcstof_l.c: Declare ____wcstoull_l_internal.
+       * wcsmbs/wcstod_l.c: Likewise.
+       * wcsmbs/wcstold_l.c: Likewise.
+
        * include/byteswap.h: New file.
 
        * malloc/mtrace.c (mtrace): Use smaller output buffer to reduce
index b5f5c03cf6eb9c9bb7f61bab9cb573445fe24395..39cb3cda0e098a993a386917401cce5d342b0274 100644 (file)
@@ -413,12 +413,13 @@ else
 default-rpath = $(libdir)
 endif
 # This is how to find at build-time things that will be installed there.
-rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir):$(nisobjdir):$(dbobjdir)
+rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir):$(nisobjdir):$(dbobjdir):$(rtobjdir)
 mathobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)math)
 elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
 nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
 nisobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nis)
 dbobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)db2)
+rtobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)rt)
 else
 link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a
 endif
@@ -750,6 +751,7 @@ ifneq (,$(findstring linuxthreads,$(add-ons)))
 shared-thread-library = $(common-objpfx)linuxthreads/libpthread.so
 static-thread-library = $(common-objpfx)linuxthreads/libpthread.a
 have-thread-library = yes
+rpath-link := $(rpath-link):$(common-objpfx)linuxthreads
 endif
 
 endif # Makeconfig not yet included
index c3337e43869f99617bf0db1e340289a32926920e..6433b32983e79490432fbfad4858a77c6ca06e68 100644 (file)
@@ -919,7 +919,8 @@ open_path (const char *name, size_t namelen, int preloaded,
                   test whether there is any directory at all.  */
                struct stat st;
 
-               buf[this_dir->dirnamelen + capstr[cnt].len] = '\0';
+               buf[this_dir->dirnamelen
+                   + MAX (capstr[cnt].len - 1, 0)] = '\0';
 
                if (__xstat (_STAT_VER, buf, &st) != 0
                    || ! S_ISDIR (st.st_mode))
index 0c8e411f638bd140c7ea9ff5fe7568ec28bf3783..a7f0a90d5fc2b05486608cede04a178134638976 100644 (file)
@@ -244,7 +244,7 @@ mtrace ()
       if (mallstream != NULL)
        {
          /* Be sure it doesn't malloc its buffer!  */
-         setvbuf (mallstream, malloc_trace_buffer, TRACE_BUFFER_SIZE);
+         setbuffer (mallstream, malloc_trace_buffer, TRACE_BUFFER_SIZE);
          fprintf (mallstream, "= Start\n");
          tr_old_free_hook = __free_hook;
          __free_hook = tr_freehook;
index 274647e70f8747f87bd8b407aa9aecf4cbf920da..fe7f46f84b82b986ea742f48f2bd5390faefc617 100644 (file)
@@ -200,8 +200,14 @@ enum
 
 #ifdef __USE_MISC
 /* Support for various different standard error handling behaviors.  */
-
-typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_ } _LIB_VERSION_TYPE;
+typedef enum
+{
+  _IEEE_ = -1, /* According to IEEE 754/IEEE 854.  */
+  _SVID_,      /* According to System V, release 4.  */
+  _XOPEN_,     /* Nowadays also Unix98.  */
+  _POSIX_,
+  _ISOC_       /* Actually this is ISO C 9X.  */
+} _LIB_VERSION_TYPE;
 
 /* This variable can be changed at run-time to any of the values above to
    affect floating point error handling behavior (it may also be necessary
index aeaf198a1573d406d26ce3b5f4a688a915bff5ba..d29a4bf61e449c6dacf8bed8707cc8b232bf7947 100644 (file)
@@ -966,13 +966,13 @@ printchar (c)
 /* Set by `re_set_syntax' to the current regexp syntax to recognize.  Can
    also be assigned to arbitrarily: each pattern buffer stores its own
    syntax, so it can be changed between regex compilations.  */
-/* This has no initializer because initialized variables in Emacs
-   become read-only after dumping.  */
 #ifdef _LIBC
-reg_syntax_t __re_syntax_options;
+reg_syntax_t __re_syntax_options = 0;
 weak_alias (__re_syntax_options, re_syntax_options)
 # define re_syntax_options __re_syntax_options
 #else
+/* This has no initializer because initialized variables in Emacs
+   become read-only after dumping.  */
 reg_syntax_t re_syntax_options;
 #endif
 
index ef6e930b83b800ec6ca1154a1158d2a63728dc74..748050a74dfb0ddfd831bc228ea3c9b8ae2612e5 100644 (file)
@@ -30,6 +30,8 @@ librt-routines := aio_cancel aio_error aio_fsync aio_misc aio_read    \
 
 librt-map := librt.map
 
+tests := tst-aio
+
 # Make sure that everything is distributed independent of configuration.
 distribute := aio_misc.h $(librt-routines:=.c) $(librt-map)
 
@@ -48,3 +50,5 @@ include ../Rules
 # This ensures they will load libc.so for needed symbols if loaded by
 # a statically-linked program that hasn't already loaded it.
 $(objpfx)librt.so: $(common-objpfx)libc.so $(shared-thread-library)
+
+$(objpfx)tst-aio: $(objpfx)librt.so $(shared-thread-library)
index 91c55442b4b319cb08d53bfe5d472a45eb857eb9..030bef9f76761e26961dccbd004e10f7f66c3a56 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle general operations.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,7 +27,6 @@
 
 #include "aio_misc.h"
 
-
 /* Pool of request list entries.  */
 static struct requestlist **pool;
 
@@ -273,7 +272,7 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
       /* The current file descriptor is worked on.  It makes no sense
         to start another thread since this new thread would fight
         with the running thread for the resources.  But we also cannot
-        say that the thread processing this desriptor shall imeediately
+        say that the thread processing this desriptor shall immediately
         after finishing the current job process this request if there
         are other threads in the running queue which have a higher
         priority.  */
@@ -392,14 +391,18 @@ handle_fildes_io (void *arg)
   pthread_t self = pthread_self ();
   struct sched_param param;
   struct requestlist *runp = (struct requestlist *) arg;
-  aiocb_union *aiocbp = runp->aiocbp;
+  aiocb_union *aiocbp;
   int policy;
-  int fildes = runp->aiocbp->aiocb.aio_fildes;
+  int fildes;
 
   pthread_getschedparam (self, &policy, &param);
 
   do
     {
+      /* Update our variables.  */
+      aiocbp = runp->aiocbp;
+      fildes = aiocbp->aiocb.aio_fildes;
+
       /* Change the priority to the requested value (if necessary).  */
       if (aiocbp->aiocb.__abs_prio != param.sched_priority
          || aiocbp->aiocb.__policy != policy)
@@ -467,8 +470,8 @@ handle_fildes_io (void *arg)
       /* Now dequeue the current request.  */
       if (runp->next_prio == NULL)
        {
-         /* No outstanding request for this descriptor.  Process the
-            runlist if necessary.  */
+         /* No outstanding request for this descriptor.  Remove this
+            descriptor from the list.  */
          if (runp->next_fd != NULL)
            runp->next_fd->last_fd = runp->last_fd;
          if (runp->last_fd != NULL)
@@ -488,15 +491,12 @@ handle_fildes_io (void *arg)
       /* Free the old element.  */
       __aio_free_request (runp);
 
-      runp = freelist;
+      runp = runlist;
       if (runp != NULL)
        {
          /* We must not run requests which are not marked `running'.  */
          if (runp->running == yes)
-           {
-             freelist = runp->next_run;
-             runp->running = allocated;
-           }
+           runlist = runp->next_run;
          else
            {
              struct requestlist *old;
@@ -516,6 +516,8 @@ handle_fildes_io (void *arg)
       /* If no request to work on we will stop the thread.  */
       if (runp == NULL)
        --nthreads;
+      else
+       runp->running = allocated;
 
       /* Release the mutex.  */
       pthread_mutex_unlock (&__aio_requests_mutex);
index 6123b7baa07ccdbfd46035dab06343869ae5b59c..ca16342a605b7ede93aa24c6a1a067c1e6610067 100644 (file)
@@ -1,5 +1,5 @@
 /* Suspend until termination of a requests.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -40,40 +40,42 @@ aio_suspend (list, nent, timeout)
      int nent;
      const struct timespec *timeout;
 {
-  pthread_cond_t cond;
   struct waitlist waitlist[nent];
   struct requestlist *requestlist[nent];
+  pthread_cond_t cond;
   int cnt;
   int result = 0;
+  int dummy;
+  int none = 1;
 
   /* Request the mutex.  */
   pthread_mutex_lock (&__aio_requests_mutex);
 
-  /* First look whether there is already a terminated request.  */
+  /* There is not yet a finished request.  Signal the request that
+     we are working for it.  */
   for (cnt = 0; cnt < nent; ++cnt)
-    if (list[cnt] != NULL && list[cnt]->__error_code != EINPROGRESS)
-      break;
+    if (list[cnt] != NULL && list[cnt]->__error_code == EINPROGRESS)
+      {
+       requestlist[cnt] = __aio_find_req ((aiocb_union *) list[cnt]);
+
+       if (requestlist[cnt] != NULL)
+         {
+           waitlist[cnt].cond = &cond;
+           waitlist[cnt].next = requestlist[cnt]->waiting;
+           waitlist[cnt].counterp = &dummy;
+           waitlist[cnt].sigevp = NULL;
+           requestlist[cnt]->waiting = &waitlist[cnt];
+           none = 0;
+         }
+      }
 
-  if (cnt == nent)
+  /* If there is a not finished request wait for it.  */
+  if (!none)
     {
       int oldstate;
 
-      /* There is not yet a finished request.  Signal the request that
-        we are working for it.  */
-      for (cnt = 0; cnt < nent; ++cnt)
-       if (list[cnt] != NULL && list[cnt]->__error_code == EINPROGRESS)
-         {
-           requestlist[cnt] = __aio_find_req ((aiocb_union *) list[cnt]);
-
-           if (requestlist[cnt] != NULL)
-             {
-               waitlist[cnt].cond = &cond;
-               waitlist[cnt].next = requestlist[cnt]->waiting;
-               waitlist[cnt].counterp = NULL;
-               waitlist[cnt].sigevp = NULL;
-               requestlist[cnt]->waiting = &waitlist[cnt];
-             }
-         }
+      /* Initialize the conditional variable.  */
+      pthread_cond_init (&cond, NULL);
 
       /* Since `pthread_cond_wait'/`pthread_cond_timedwait' are cancelation
         points we must be careful.  We added entries to the waiting lists
@@ -87,7 +89,7 @@ aio_suspend (list, nent, timeout)
                                         timeout);
 
       /* Now remove the entry in the waiting list for all requests
-        which didn't terminate  */
+        which didn't terminate.  */
       for (cnt = 0; cnt < nent; ++cnt)
        if (list[cnt] != NULL && list[cnt]->__error_code == EINPROGRESS
            && requestlist[cnt] != NULL)
@@ -107,6 +109,11 @@ aio_suspend (list, nent, timeout)
       /* Now it's time to restore the cancelation state.  */
       pthread_setcancelstate (oldstate, NULL);
 
+      /* Release the conditional variable.  */
+      if (pthread_cond_destroy (&cond) != 0)
+       /* This must never happen.  */
+       abort ();
+
       if (result != 0)
        {
          /* An error occurred.  Possibly it's EINTR.  We have to translate
index b389c6a5f6913cbf011e1edb9c6cbe0610e12044..07c8d3ea28542903fd1848199205a73516a4eefa 100644 (file)
@@ -1,5 +1,5 @@
 /* Enqueue and list of read or write requests.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -86,6 +86,9 @@ lio_listio (mode, list, nent, sig)
       struct waitlist waitlist[nent];
       int oldstate;
 
+      /* Initialize the conditional variable.  */
+      pthread_cond_init (&cond, NULL);
+
       total = 0;
       for (cnt = 0; cnt < nent; ++cnt)
        if (list[cnt] != NULL && list[cnt]->aio_lio_opcode != LIO_NOP
@@ -110,6 +113,11 @@ lio_listio (mode, list, nent, sig)
 
       /* Now it's time to restore the cancelation state.  */
       pthread_setcancelstate (oldstate, NULL);
+
+      /* Release the conditional variable.  */
+      if (pthread_cond_destroy (&cond) != 0)
+       /* This must never happen.  */
+       abort ();
     }
   else
     {
index 19f56adab1f1fec87754c05b139a6c81c36e4ad9..69b78b79fbdc4f1adc89e9f940ab4b749cc99a73 100644 (file)
@@ -1,5 +1,5 @@
 /* Enqueue and list of read or write requests, 64bit offset version.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -86,6 +86,9 @@ lio_listio64 (mode, list, nent, sig)
       struct waitlist waitlist[nent];
       int oldstate;
 
+      /* Initialize the conditional variable.  */
+      pthread_cond_init (&cond, NULL);
+
       total = 0;
       for (cnt = 0; cnt < nent; ++cnt)
        if (list[cnt] != NULL && list[cnt]->aio_lio_opcode != LIO_NOP
@@ -109,6 +112,11 @@ lio_listio64 (mode, list, nent, sig)
 
       /* Now it's time to restore the cancelation state.  */
       pthread_setcancelstate (oldstate, NULL);
+
+      /* Release the conditional variable.  */
+      if (pthread_cond_destroy (&cond) != 0)
+       /* This must never happen.  */
+       abort ();
     }
   else
     {
diff --git a/rt/tst-aio.c b/rt/tst-aio.c
new file mode 100644 (file)
index 0000000..e319dea
--- /dev/null
@@ -0,0 +1,142 @@
+/* Tests for AIO in librt.
+   Copyright (C) 1998 Free Software Foundation, Inc.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 <aio.h>
+#include <errno.h>
+#include <error.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+
+/* prototype for our test function.  */
+extern int do_test (int argc, char *argv[]);
+
+
+/* We might need a bit longer timeout.  */
+#define TIMEOUT 20 /* sec */
+
+/* This defines the `main' function and some more.  */
+#include <test-skeleton.c>
+
+
+int
+test_file (const void *buf, size_t size, int fd, const char *msg)
+{
+  struct stat st;
+  char tmp[size];
+
+  errno = 0;
+  if (fstat (fd, &st) < 0)
+    {
+      error (0, errno, "%s: failed stat", msg);
+      return 1;
+    }
+
+  if (st.st_size != size)
+    {
+      error (0, errno, "%s: wrong size: %lu, should be %lu",
+            msg, (unsigned long int) st.st_size, (unsigned long int) size);
+      return 1;
+    }
+
+  if (pread (fd, tmp, size, 0) != size)
+    {
+      error (0, errno, "%s: failed stat", msg);
+      return 1;
+    }
+
+  if (memcmp (buf, tmp, size) != 0)
+    {
+      error (0, errno, "%s: failed comparison", msg);
+      return 1;
+    }
+
+  if (ftruncate (fd, 0) < 0)
+    {
+      error (0, errno, "%s: failed truncate", msg);
+      return 1;
+    }
+
+  return 0;
+}
+
+
+int
+do_test (int argc, char *argv[])
+{
+  char *name;
+  char name_len;
+  struct aiocb cbs[10];
+  struct aiocb *cbp[10];
+  char buf[1000];
+  size_t cnt;
+  int fd;
+  int result = 0;
+  int go_on;
+
+  name_len = strlen (test_dir);
+  name = malloc (name_len + sizeof ("/aioXXXXXX"));
+  mempcpy (mempcpy (name, test_dir, name_len),
+          "/aioXXXXXX", sizeof ("/aioXXXXXX"));
+  add_temp_file (name);
+
+  /* Open our test file.   */
+  fd = mkstemp (name);
+  if (fd == -1)
+    error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
+
+  /* Preparation.  */
+  for (cnt = 0; cnt < 10; ++cnt)
+    {
+      cbs[cnt].aio_fildes = fd;
+      cbs[cnt].aio_reqprio = 0;
+      cbs[cnt].aio_buf = memset (&buf[cnt * 100], '0' + cnt, 100);
+      cbs[cnt].aio_nbytes = 100;
+      cbs[cnt].aio_offset = cnt * 100;
+      cbs[cnt].aio_sigevent.sigev_notify = SIGEV_NONE;
+
+      cbp[cnt] = &cbs[cnt];
+    }
+
+  /* First a simple test.  */
+  for (cnt = 10; cnt > 0; )
+    aio_write (cbp[--cnt]);
+  /* Wait 'til the results are there.  */
+  do
+    {
+      aio_suspend ((const struct aiocb *const *) cbp, 10, NULL);
+      go_on = 0;
+      for (cnt = 0; cnt < 10; ++cnt)
+       if (cbp[cnt] != NULL && aio_error (cbp[cnt]) == EINPROGRESS)
+         go_on = 1;
+       else
+         {
+           if (cbp[cnt] != NULL)
+             printf ("request %d finished\n", cnt);
+           cbp[cnt] = NULL;
+         }
+    }
+  while (go_on);
+  /* Test this.  */
+  result |= test_file (buf, sizeof (buf), fd, "aio_write");
+
+  return result;
+}
index 02b16c5171b1040c1e7264d9ce32e5ab481db8f5..1e1496f00d147b6f8ed8a98b047c1af21c633b93 100644 (file)
@@ -266,7 +266,7 @@ C[] = {
            r2 = C[8]+s2*C[9]; s24=s22*s22;
            r3 = C[6]+s2*C[7]; s26=s24*s22;
             r = r3*s22 + r2*s24 + r1*s26;
-#endfi
+#endif
            r += s_l*(s_h+s);
            s2  = s_h*s_h;
            t_h = 3.0+s2+r;
index ed1aba527be837d4ed7e65e9c86b3fc3e14e65d7..df6b1e4df03ce2944a9abcbd9d3f9bf91210a3b8 100644 (file)
@@ -120,7 +120,6 @@ static const double
 #else
 static double
 #endif
-one            = 1.0,
 huge           = 1.0e+300,
 tiny           = 1.0e-300,
 o_threshold    = 7.09782712893383973096e+02,/* 0x40862E42, 0xFEFA39EF */
index 2ab5924a2acfff110bcf197c821f1aeb49c696b0..021b0ffca17cfeff4df7f5ae05ed547616090c46 100644 (file)
@@ -1,4 +1,3 @@
 #include "math.h"
 #include "math_private.h"
-int __signgam = 0;
-weak_alias (__signgam, signgam)
+int signgam;
index 762950374437d2394d9149de3c95a51d060117a9..02a3d47669a5de987e37b49aaa3e30325d8deb57 100644 (file)
@@ -22,8 +22,6 @@ static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        double __gamma(double x)
 #else
@@ -34,7 +32,7 @@ extern int __signgam;
         double y;
 #ifndef _IEEE_LIBM
        if (_LIB_VERSION == _SVID_)
-         y = __ieee754_lgamma_r(x,&__signgam);
+         y = __ieee754_lgamma_r(x,&signgam);
        else
          {
 #endif
index fc28a975da3adbadacbd220dbd84cf175e3ff0db..7d78a529089f0f1ea258f3b5b4c25cab8cd5e772 100644 (file)
@@ -20,8 +20,6 @@ static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        float __gammaf(float x)
 #else
@@ -32,7 +30,7 @@ extern int __signgam;
         float y;
 #ifndef _IEEE_LIBM
        if (_LIB_VERSION == _SVID_)
-         y = __ieee754_lgammaf_r(x,&__signgam);
+         y = __ieee754_lgammaf_r(x,&signgam);
        else
          {
 #endif
index 88c681b40b70d7239b7f1fa0e53d80066f5709aa..1b4ae2cc7b810216857eb1c69498c7f363966d87 100644 (file)
@@ -25,8 +25,6 @@ static char rcsid[] = "$NetBSD: $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        long double __gammal(long double x)
 #else
@@ -37,7 +35,7 @@ extern int __signgam;
         long double y;
 #ifndef _IEEE_LIBM
        if (_LIB_VERSION == _SVID_)
-         y = __ieee754_lgammal_r(x,&__signgam);
+         y = __ieee754_lgammal_r(x,&signgam);
        else
          {
 #endif
index fbb933f9fc0995285a2ffb8a62dd82e43fc069af..bbb53f53e873aa9254ab488b4354b1d498e488ad 100644 (file)
@@ -23,8 +23,6 @@ static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        double __lgamma(double x)
 #else
@@ -33,10 +31,14 @@ extern int __signgam;
 #endif
 {
 #ifdef _IEEE_LIBM
-       return __ieee754_lgamma_r(x,&__signgam);
+       return __ieee754_lgamma_r(x,&signgam);
 #else
         double y;
-        y = __ieee754_lgamma_r(x,&__signgam);
+       int local_signgam;
+        y = __ieee754_lgamma_r(x,&local_signgam);
+       if (_LIB_VERSION != _ISOC_)
+         /* ISO C 9x does not define the global variable.  */
+         signgam = local_signgam;
         if(_LIB_VERSION == _IEEE_) return y;
         if(!__finite(y)&&__finite(x)) {
             if(__floor(x)==x&&x<=0.0)
index e05660284fc05cb6efa4edd0b73609eb2c02f921..369dee6749513477feb7887a924aa22781ec59fd 100644 (file)
@@ -20,8 +20,6 @@ static char rcsid[] = "$NetBSD: w_lgammaf.c,v 1.3 1995/05/10 20:49:30 jtc Exp $"
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        float __lgammaf(float x)
 #else
@@ -30,10 +28,14 @@ extern int __signgam;
 #endif
 {
 #ifdef _IEEE_LIBM
-       return __ieee754_lgammaf_r(x,&__signgam);
+       return __ieee754_lgammaf_r(x,&signgam);
 #else
         float y;
-        y = __ieee754_lgammaf_r(x,&__signgam);
+       int local_signgam;
+        y = __ieee754_lgammaf_r(x,&local_signgam);
+       if (_LIB_VERSION != _ISOC_)
+         /* ISO C 9x does not define the global variable.  */
+         signgam = local_signgam;
         if(_LIB_VERSION == _IEEE_) return y;
         if(!__finitef(y)&&__finitef(x)) {
             if(__floorf(x)==x&&x<=(float)0.0)
index aab8417e31f8985fc2ff9b31dce9be27db340797..9db2ce26931a7a1dfb11f255f4603597463f5d92 100644 (file)
@@ -27,8 +27,6 @@ static char rcsid[] = "$NetBSD: $";
 #include "math.h"
 #include "math_private.h"
 
-extern int __signgam;
-
 #ifdef __STDC__
        long double __lgammal(long double x)
 #else
@@ -37,10 +35,14 @@ extern int __signgam;
 #endif
 {
 #ifdef _IEEE_LIBM
-       return __ieee754_lgammal_r(x,&__signgam);
+       return __ieee754_lgammal_r(x,&signgam);
 #else
         long double y;
-        y = __ieee754_lgammal_r(x,&__signgam);
+       int local_signgam;
+        y = __ieee754_lgammal_r(x,&local_signgam);
+       if (_LIB_VERSION != _ISOC_)
+         /* ISO C 9x does not define the global variable.  */
+         signgam = local_signgam;
         if(_LIB_VERSION == _IEEE_) return y;
         if(!__finitel(y)&&__finitel(x)) {
             if(__floorl(x)==x&&x<=0.0)
index 5bb5c44c162e2c4f12d28609bd633493f8c35682..39c6073c73eff547b4ac415766b86fe4d71f5b89 100644 (file)
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <getopt.h>
+#include <search.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -52,6 +53,39 @@ static int pid;
 /* Directory to place temporary files in.  */
 static const char *test_dir;
 
+/* List of temporary files.  */
+struct name_list
+{
+  struct qelem q;
+  const char *name;
+} *name_list;
+
+/* Add temporary files in list.  */
+void
+add_temp_file (const char *name)
+{
+  struct name_list *newp = (struct name_list *) calloc (sizeof (*newp), 1);
+  if (newp != NULL)
+    {
+      newp->name = name;
+      if (name_list == NULL)
+       name_list = (struct name_list *) &newp->q;
+      else
+       insque (newp, name_list);
+    }
+}
+
+/* Delete all temporary files.  */
+void
+delete_temp_files (void)
+{
+  while (name_list != NULL)
+    {
+      remove (name_list->name);
+      name_list = (struct name_list *) name_list->q.q_forw;
+    }
+}
+
 /* Timeout handler.  We kill the child and exit with an error.  */
 void
 timeout_handler (int sig __attribute__ ((unused)))
@@ -114,11 +148,20 @@ main (int argc, char *argv[])
          exit (1);
        }
     }
+  else
+    {
+      test_dir = getenv ("TMPDIR");
+      if (test_dir == NULL || test_dir[0] == '\0')
+       test_dir = "/tmp";
+    }
 
   /* If we are not expected to fork run the function immediately.  */
   if (direct)
     return TEST_FUNCTION;
 
+  /* make sure temporary files are deleted.  */
+  atexit (delete_temp_files);
+
   /* Set up the test environment:
      - prevent core dumps
      - set up the timer
@@ -166,8 +209,12 @@ main (int argc, char *argv[])
 #endif
   if (WTERMSIG (status) != EXPECTED_SIGNAL)
     {
-      fprintf (stderr, "Incorrect signal from child: got `%s', need `%s'\n",
-              strsignal (WTERMSIG (status)), strsignal (EXPECTED_SIGNAL));
+      if (EXPECTED_SIGNAL != 0)
+       fprintf (stderr, "Incorrect signal from child: got `%s', need `%s'\n",
+                strsignal (WTERMSIG (status)), strsignal (EXPECTED_SIGNAL));
+      else
+       fprintf (stderr, "Incorrect signal from child: got `%s'\n",
+                strsignal (WTERMSIG (status)));
       exit (1);
     }
 
index 1cd5694b93583b407c157d728a8d22a3eac96592..84d2e99f1d6e5913ea04de60e15eabc1307689ee 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string representing a number to integer value, using given locale.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -26,5 +26,8 @@
 
 extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
                                     __locale_t);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+                                                      wchar_t **, int, int,
+                                                      __locale_t);
 
 #include <wcstod.c>
index 193fc86f4632c3c66960e4af360be98ae0243ea8..347f27f3bcb236dd33f286cd3e4daad54e1e4813 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string representing a number to integer value, using given locale.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -26,5 +26,8 @@
 
 extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
                                    __locale_t);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+                                                      wchar_t **, int, int,
+                                                      __locale_t);
 
 #include <wcstof.c>
index 596c7ce47163bb4275240372a6cd7f7f8742b9ce..f92ec78026d0f4047b6128ea3be758202f5c426d 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert string representing a number to integer value, using given locale.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -26,5 +26,8 @@
 
 extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,
                                           __locale_t);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+                                                      wchar_t **, int, int,
+                                                      __locale_t);
 
 #include <wcstold.c>