home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / linux / 25750 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.5 KB  |  44 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!concert!gatech!swrinde!zaphod.mps.ohio-state.edu!howland.reston.ans.net!usc!news.service.uci.edu!ucivax!ucla-cs!twinsun!eggert
  3. From: eggert@twinsun.com (Paul Eggert)
  4. Subject: Linux sigismember bug
  5. Message-ID: <bkOFi=w0@twinsun.com>
  6. Sender: usenet@twinsun.com
  7. Nntp-Posting-Host: farside
  8. Organization: Twin Sun Inc, El Segundo, CA, USA
  9. X-Newsreader: NN version 6.4.19
  10. Date: Wed, 27 Jan 1993 03:56:28 GMT
  11. Lines: 31
  12.  
  13. I'm not a Linux user, just an RCS maintainer.  But iwj@cam-orl.co.uk
  14. (Ian Jackson) tells me that Linux has a bug that causes CVS's
  15. configuration package to go into a loop.  Here's an example of the
  16. problem.  Linux has only 32 signals, numbered 1 through 32.  The
  17. program enclosed below invokes sigismember(&s,33).  Since 33 is not a
  18. valid signal, Posix 1003.1-1990 sections 3.3.3.3 and 3.3.3.4 say that
  19. sigismember(&s,33) must yield either -1 (setting errno to EINVAL), or
  20. 0.  Unfortunately, under Linux, sigismember(&s,33) yields 1, causing
  21. the program to print `33 is a defined signal'.  That's incorrect, since
  22. 33 is not a member of any signal set.
  23.  
  24.  
  25. #include <signal.h>
  26. #include <stdio.h>
  27.  
  28. int
  29. main()
  30. {
  31.     sigset_t s;
  32.     if (sigfillset(&s) != 0) {
  33.         perror("sigfillset");
  34.         return 1;
  35.     }
  36.     switch (sigismember(&s, 33)) {
  37.         case -1: perror("sigismember"); break;
  38.         case 0: printf("33 is not a defined signal\n"); break;
  39.         case 1: printf("33 is a defined signal\n"); break;
  40.         default: printf("sigismember yields bad value\n"); return 1;
  41.     }
  42.     return 0;
  43. }
  44.