Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp
Path: utzoo!linus!decvax!decwrl!sun!gnu
From: gnu@sun.uucp (John Gilmore)
Newsgroups: net.news.b
Subject: Re: sigtrap & setuid problems
Message-ID: <1749@sun.uucp>
Date: Tue, 16-Oct-84 02:14:38 EDT
Article-I.D.: sun.1749
Posted: Tue Oct 16 02:14:38 1984
Date-Received: Wed, 17-Oct-84 09:04:47 EDT
References: <165@scorplx.UUCP> <193@scorplx.UUCP>
Organization: Sun Microsystems, Inc.
Lines: 32

> Any suggestions on what to do about this?  Maybe instead of #ifdef USG,
> someone should consider #ifdef SYS3, #ifdef SYSV (or something similiar).
> Comments?
How about "SYS3" and "SYS5" or "SYSIII" and "SYSV" but please don't mix
Roman and Arabic numbers...  Do the USG cpp's specify what version of
Unix they are?  What names do they use?

> > 2)	the name 'sigtrap' (an integer used globally in a few files)
> > 	is also the name of a function in /lib/libc.a .

Unfortunately various systems define _sigtrap, including early (and
late?) Unisoft systems and Fortunes.  For all I know it was in the
original MIT libraries from Nu Unix.  When I brought up netnews on a
friend's Fortune, it seems like the name was used as the springboard
routine for signals -- the kernel would jump you to _sigtrap which
would jump to the right signal handler.  Being an int variable
defined by netnews (which prevented the "real" _sigtrap from being
loaded from libc.a), jumping to it didn't work very well.

The fix as far as a portable netnews is concerned is:  don't use that
name.  Rename the variable "sigkludge" or something.  We mortals can do
it with #define but the master source should be fixed to use a totally
new name.

The fix as far as a Unix manufacturer is concerned is:  Don't put "_"
on library routines that should be invisible to the user.  This makes
them invisible to C programs anyway.

This is another aspect of the generic namespace problem; pre-set
#define's have been talked about but until now nobody has mentioned new
routines in libc as a problem.