From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11733 invoked by alias); 9 Dec 2005 11:48:14 -0000 Received: (qmail 11725 invoked by uid 22791); 9 Dec 2005 11:48:13 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Dec 2005 11:48:11 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HFF22357; Fri, 9 Dec 2005 13:47:51 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-84-228-245-91.inter.net.il [84.228.245.91]) by nitzan.inter.net.il (MOS 3.7.2-GA) with ESMTP id CEK96150 (AUTH halo1); Fri, 9 Dec 2005 13:47:49 +0200 (IST) Date: Fri, 09 Dec 2005 14:46:00 -0000 Message-Id: From: Eli Zaretskii To: Kevin Buettner , gdb-patches@sources.redhat.com In-reply-to: <20051208204301.GA29490@nevyn.them.org> (message from Daniel Jacobowitz on Thu, 8 Dec 2005 15:43:01 -0500) Subject: Re: [linux] Always ignore restart/cancellation signals Reply-to: Eli Zaretskii References: <20051208142420.GA21882@nevyn.them.org> <200512081950.jB8Jo9im029464@elgar.sibelius.xs4all.nl> <20051208133824.24b4c680@ironwood.lan> <20051208204301.GA29490@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00168.txt.bz2 > Date: Thu, 8 Dec 2005 15:43:01 -0500 > From: Daniel Jacobowitz > Cc: gdb-patches@sources.redhat.com > > On Thu, Dec 08, 2005 at 01:38:24PM -0700, Kevin Buettner wrote: > > > Hmm, I thought symbols starting with __ were "reserved by the > > > implemntation" and should not be used by user space programs. > > We're a program tightly tied to the implementation, and they're symbols > provided by the implementation. gdbserver already uses them; rda was > recently changed to use them; gdb/signals/signals.c already uses them. > > > > For the symbols in question, the header file, , says: > > > > /* These are the hard limits of the kernel. These values should not be > > used directly at user level. */ > > #define __SIGRTMIN 32 > > #define __SIGRTMAX (_NSIG - 1) > > > > So the comment supports your claim. > > > > The only alternative that I can think of is to hardcode the constant > > (32, in this case) into the GDB sources. Of these two approaches, I'd > > prefer to use __ symbol from the system headers. I do think that we > > ought to check for its existence first though. > > I'll do it if you like. There's no need to, IMHO. I think Jim was wrong: symbols starting with __ are indeed reserved for the implementation, but the meaning of that reservation is that user code should not _define_ such symbols, not that it must not use them. In effect, this rule sets up a namespace that the library implementation can use without risking that it steps on the feet of user code. But if we don't define any symbols that begin with __, we are safe accessing them, I think. I have no idea why the above comment from bits/signum.h was written. I think it is wrong and the glibc maintainers should be asked to either remove it or explain why they think these symbols should not be used at user level.