Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 29 May 2000 01:00:03 +0000 (01:00 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 29 May 2000 01:00:03 +0000 (01:00 +0000)
2000-05-28  Ulrich Drepper  <drepper@redhat.com>

* sysdeps/arm/atomicity.h (compare_and_swap): Return result.

ChangeLog
posix/tst-fork.c
sysdeps/arm/atomicity.h

index 44b2dff..9a80bd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-05-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/arm/atomicity.h (compare_and_swap): Return result.
+
 2000-05-04  Andreas Jaeger  <aj@suse.de>
 
        * string/string.h: Remove __strdup prototype, it's not needed in
index 287fa5f..0bee14f 100644 (file)
@@ -38,6 +38,7 @@ main (void)
   char *name;
   int fd;
   pid_t pid;
+  pid_t ppid;
   off_t off;
   int status;
 
@@ -69,10 +70,24 @@ main (void)
   if (off == (off_t) -1 || off != strlen (testdata))
     error (EXIT_FAILURE, errno, "wrong file position");
 
+  /* Get the parent PID.  */
+  ppid = getpid ();
+
   /* Now fork of the process.  */
   pid = fork ();
   if (pid == 0)
     {
+      /* One little test first: the PID must have changed.  */
+      if (getpid () == ppid)
+       error (EXIT_FAILURE, 0, "child and parent have same PID");
+
+      /* Test the `getppid' function.  */
+      pid = getppid ();
+      if (pid == (pid_t) -1 ? errno != ENOSYS : pid != ppid)
+       error (EXIT_FAILURE, 0,
+              "getppid returned wrong PID (%ld, should be %ld)",
+              (long int) pid, (long int) ppid);
+
       /* This is the child.  First get the position of the descriptor.  */
       off = lseek (fd, 0, SEEK_CUR);
       if (off == (off_t) -1 || off != strlen (testdata))
index 01bd64e..c1f3b03 100644 (file)
@@ -81,6 +81,7 @@ compare_and_swap (volatile long int *p, long int oldval, long int newval)
           : "=&r" (result), "=&r" (tmp)
           : "r" (p), "r" (newval), "r" (oldval)
           : "cc", "memory");
+  return result;
 }
 
 #endif /* atomicity.h */