This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 04/10] Convert signal.h from __need macros to bits/types/ headers.


On 05/17/2017 01:40 PM, Joseph Myers wrote:
> On Tue, 9 May 2017, Zack Weinberg wrote:
> 
>> Internal code that wants to manipulate signal masks must now include
>> <bits/sigsetops.h> (which is not installed) and should be aware that
> 
> As noted, should be renamed to something not in the bits/ namespace for 
> installed headers.  (signal/sigsetops.h already exists, so that shouldn't 
> be the name.)

It turns out that nothing in signal/sigsetops.h is used by anything
anymore, so I have removed it and recycled the name.

>> +/* These macros needn't check for a bogus signal number;
>> +   checking is done in the non-__ versions.  */
>> +# define __sigismember(set, sig)		\
>> +  (__extension__ ({				\
>> +    __sigset_t __mask = __sigmask (sig);	\
>> +    (set) & mask ? 1 : 0;			\
> 
> You're referencing plain "mask" here, when the local variable is __mask.

Good catch, thanks.  This is a problem with generic code that's not used
on any testable platform.

> Indentation messed up here (was using tabs, changed to spaces).  Likewise 
> elsewhere in this patch).

Fixed.

> Include 2017 in copyright dates.

Fixed.

> Should be GLIBC_2_26, as the version where these were obsoleted.  (As 
> there weren't any new ports in 2.25, having the wrong version here doesn't 
> actually break any ABIs.)

Fixed.  This patch has been kicking around my local git repo for quite a
while - it would have been correct when I wrote it.

>> diff --git a/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h b/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h
> 
>> +	/* SIGSYS.  */
>> +	struct
>> +	  {
>> +	    void *_call_addr;	/* Calling user insn.  */
>> +	    int _syscall;	/* Triggering system call number.  */
>> +	    unsigned int _arch; /* AUDIT_ARCH_* of syscall.  */
>> +	  } _sigsys;
> 
> This (and the macros using it) needs to be conditional.  ia64 (only) lacks 
> this part of siginfo_t.

How inconvenient.  Fixed.

>> +/* Additional fields for _sifields._sigfault.  */
>> +#define __SI_SIGFAULT_ADDL_2			\
>> +  struct					\
>> +     {						\
>> +       void *_lower;				\
>> +       void *_upper;				\
>> +     } si_addr_bnd;
> 
> Remark (not needing fixing for the patch to go in, though if fixed there 
> would be no need for __SI_SIGFAULT_ADDL_2): this is in fact part of 
> siginfo_t in the Linux kernel for all architectures rather than just 
> x86-specific (as is the more recent _pkey there), so logically should 
> probably be so in glibc as well, though I don't know if it's *used* by the 
> kernel on any other architectures or if it's entirely MPX-specific.

I went ahead and added this for all architectures (and _pkey as well).

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]