home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- 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
- From: eggert@twinsun.com (Paul Eggert)
- Subject: Linux sigismember bug
- Message-ID: <bkOFi=w0@twinsun.com>
- Sender: usenet@twinsun.com
- Nntp-Posting-Host: farside
- Organization: Twin Sun Inc, El Segundo, CA, USA
- X-Newsreader: NN version 6.4.19
- Date: Wed, 27 Jan 1993 03:56:28 GMT
- Lines: 31
-
- I'm not a Linux user, just an RCS maintainer. But iwj@cam-orl.co.uk
- (Ian Jackson) tells me that Linux has a bug that causes CVS's
- configuration package to go into a loop. Here's an example of the
- problem. Linux has only 32 signals, numbered 1 through 32. The
- program enclosed below invokes sigismember(&s,33). Since 33 is not a
- valid signal, Posix 1003.1-1990 sections 3.3.3.3 and 3.3.3.4 say that
- sigismember(&s,33) must yield either -1 (setting errno to EINVAL), or
- 0. Unfortunately, under Linux, sigismember(&s,33) yields 1, causing
- the program to print `33 is a defined signal'. That's incorrect, since
- 33 is not a member of any signal set.
-
-
- #include <signal.h>
- #include <stdio.h>
-
- int
- main()
- {
- sigset_t s;
- if (sigfillset(&s) != 0) {
- perror("sigfillset");
- return 1;
- }
- switch (sigismember(&s, 33)) {
- case -1: perror("sigismember"); break;
- case 0: printf("33 is not a defined signal\n"); break;
- case 1: printf("33 is a defined signal\n"); break;
- default: printf("sigismember yields bad value\n"); return 1;
- }
- return 0;
- }
-