]> thyrsus.com Git - semex.git/commitdiff
Cleanup for prototype world.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 24 Oct 1994 06:45:06 +0000 (06:45 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 24 Oct 1994 06:45:06 +0000 (06:45 +0000)
semex.c
semex.xml

diff --git a/semex.c b/semex.c
index dc7a6fe238583fef00ad241930362d22e7d668ef..144f2b85fa33f6de8f9ccbdc6989a57d8644a771 100644 (file)
--- a/semex.c
+++ b/semex.c
@@ -1,5 +1,5 @@
 /*
- * semex.c --- System V semaphore exerciser
+ * semex.c --- System V and Linux semaphore exerciser
  *
  * by Eric S. Raymond <esr@snark.thyrsus.com>
  */
@@ -15,7 +15,7 @@ extern char *strchr(), *strcat(), *ctime();
 extern unsigned sleep();
 
 /*
- * This will need to change if any future version changes the define values
+ * This will need to change if any future version changes the #define values
  * of any UNIX error types. The highest value currently recognized is
  * EIDRM; the code that uses it in errmsg() will issue a generic error type
  * for higher values.
@@ -238,37 +238,33 @@ char      *argv[];
            (void) sscanf(cmdline, "v %d %d\n", &semid, &semnum);
            if (tty)
                (void) printf("semctl(%d, %d, GETVAL) returns %d\n",
-                       semid, semnum, semctl(semid, semnum, GETVAL));
+                       semid, semnum, semctl(semid, semnum, GETVAL, NULL));
            break;
 
        case 'p':
            (void) sscanf(cmdline, "p %d %d\n", &semid, &semnum);
            if (tty)
                (void) printf("semctl(%d, %d, GETPID) returns %d\n",
-                       semid, semnum, semctl(semid, semnum, GETPID));
+                       semid, semnum, semctl(semid, semnum, GETPID, NULL));
            break;
 
        case 'n':
            (void) sscanf(cmdline, "n %d %d\n", &semid, &semnum);
            if (tty)
                (void) printf("semctl(%d, %d, GETNCNT) returns %d\n",
-                       semid, semnum, semctl(semid, semnum, GETNCNT));
+                       semid, semnum, semctl(semid, semnum, GETNCNT, NULL));
            break;
 
        case 'z':
            (void) sscanf(cmdline, "z %d %d\n", &semid, &semnum);
            if (tty)
                (void) printf("semctl(%d, %d, GETZCNT) returns %d\n",
-                       semid, semnum, semctl(semid, semnum, GETZCNT));
+                       semid, semnum, semctl(semid, semnum, GETZCNT, NULL));
            break;
 
        case 's':       /* set the value of a semaphore */
            {
-               union {
-                   int val;
-                   struct semid_ds *buf;
-                   unsigned short *array;
-               } semval;
+               union semun semval;
 
                semval.val = 0;
 
@@ -340,8 +336,7 @@ char        *argv[];
        case 'r':       /* delete an existing semaphore */
            (void) sscanf(cmdline, "r %d", &semid);
 
-           rv = semctl(semid, 0, IPC_RMID);
-
+           rv = semctl(semid, 0, IPC_RMID, NULL);
            if (tty)
            {
                (void) printf("semctl(%d, 0, IPC_RMID) ", semid);
index 5efec6e0154fcd501c8cd87211857a45fa293563..332801288e2d47d8c98fdc48153f046989c64fbe 100644 (file)
--- a/semex.xml
+++ b/semex.xml
@@ -140,7 +140,7 @@ but its lint library checks for the correct type, which is
  struct sembuf *
 
 as one can actually deduce from the description text for both entries.
-System V Release 3 and 4 seems to get this right.
+System V Release 3 and 4 and Linux all seem to get this right.
 .SH BUGS
 The 'p' and 'v' commands are not Dyskstra's P and V operations.
 .PP