Xref: utzoo comp.arch:4479 comp.unix.wizards:8028 Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.arch,comp.unix.wizards Subject: Re: Universal OS (was Re: Survey of architectures) Message-ID: <50825@sun.uucp> Date: 26 Apr 88 00:26:46 GMT References: <2048@gumby.mips.COM> <10504@steinmetz.ge.com> <7657@ames.arpa> <1520@pt.cs.cmu.edu> Sender: news@sun.uucp Followup-To: comp.unix.wizards Lines: 32 > 3. OS - what is the interface to the signal handler under > SYS V and BSD! This particular point really continues a discussion started in comp.lang.c. The discussion was inspired by some misconceptions about UNIX signal handlers. Any rational version of UNIX will permit signal handlers to take a single argument that is the signal number. Any version that obliges signal handlers to be written to take more than one argument will cause *so* much already-written code to break that it can fairly well considered to be broken itself. Fortunately, 4BSD has, as far as I know, only been implemented only on systems where the extra "signal code" argument that it passes doesn't make a difference. As such, it is not (yet) broken in that sense. ANSI C specifies that signal handlers take one and only one argument. This also happens to break existing code; however, assuming that there are machines that cannot support "varargs" without "varargs" functions being explicitly declared as such, they had no choice. In other words, if you want to write portable code, write it so that signal handlers take one argument. This will work on any non-broken UNIX system. Thus, the issue of the interface to the signal handler is not an issue raised by multiple versions of UNIX. It *is* an issue if you have non-UNIX systems, but if you have to deal with non-UNIX systems, it's probably one of the least of the issues you will have to deal with. As for the relevance of this point to "most people" and "most users", the people mentioned in the original article: to borrow a phrase I have heard attributed to Frank Zappa, "most people" or "most users" wouldn't know a signal handler if it came up and bit them in the ass.