public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix signal.h
@ 2004-11-20 17:09 Jakub Jelinek
  2004-11-20 18:34 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2004-11-20 17:09 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

I believe the nonnull attributes for __sighandler_t arguments are wrong.
SIG_DFL (which is ((__sighandler_t) 0) == NULL) is a valid argument
for these functions.

2004-11-20  Jakub Jelinek  <jakub@redhat.com>

	* signal/signal.h (__sysv_signal, sysv_signal, signal, bsd_signal,
	ssignal): Remove __nonnull attribute.

--- libc/signal/signal.h.jj	2004-11-20 13:01:00.000000000 +0100
+++ libc/signal/signal.h	2004-11-20 18:02:54.613455520 +0100
@@ -78,10 +78,10 @@ typedef void (*__sighandler_t) (int);
    the additional function `sysv_signal' when X/Open compatibility is
    requested.  */
 extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
-     __THROW __nonnull ((2));
+     __THROW;
 #ifdef __USE_GNU
 extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler)
-     __THROW __nonnull ((2));
+     __THROW;
 #endif
 
 /* Set the handler for the signal SIG to HANDLER, returning the old
@@ -90,13 +90,13 @@ extern __sighandler_t sysv_signal (int _
 __BEGIN_NAMESPACE_STD
 #ifdef __USE_BSD
 extern __sighandler_t signal (int __sig, __sighandler_t __handler)
-     __THROW __nonnull ((2));
+     __THROW;
 #else
 /* Make sure the used `signal' implementation is the SVID version. */
 # ifdef __REDIRECT_NTH
 extern __sighandler_t __REDIRECT_NTH (signal,
 				      (int __sig, __sighandler_t __handler),
-				      __sysv_signal) __nonnull ((2));
+				      __sysv_signal);
 # else
 #  define signal __sysv_signal
 # endif
@@ -107,7 +107,7 @@ __END_NAMESPACE_STD
 /* The X/Open definition of `signal' conflicts with the BSD version.
    So they defined another function `bsd_signal'.  */
 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler)
-     __THROW __nonnull ((2));
+     __THROW;
 #endif
 
 /* Send signal SIG to process number PID.  If PID is zero,
@@ -132,7 +132,7 @@ __END_NAMESPACE_STD
 #ifdef __USE_SVID
 /* SVID names for the same things.  */
 extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
-     __THROW __nonnull ((2));
+     __THROW;
 extern int gsignal (int __sig) __THROW;
 #endif /* Use SVID.  */
 

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix signal.h
  2004-11-20 17:09 [PATCH] Fix signal.h Jakub Jelinek
@ 2004-11-20 18:34 ` Jakub Jelinek
  2004-11-20 18:43   ` Ulrich Drepper
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2004-11-20 18:34 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

On Sat, Nov 20, 2004 at 06:06:23PM +0100, Jakub Jelinek wrote:
> I believe the nonnull attributes for __sighandler_t arguments are wrong.
> SIG_DFL (which is ((__sighandler_t) 0) == NULL) is a valid argument
> for these functions.

BTW, is the nonnull attribute for first sigwait/sigwaitinfo/sigtimedwait
correct?  I think so from reading the standards, but in that case I wonder
why we test it, e.g.:
static int
do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
{
#ifdef SIGCANCEL
  sigset_t tmpset;
  if (set != NULL
...

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix signal.h
  2004-11-20 18:34 ` Jakub Jelinek
@ 2004-11-20 18:43   ` Ulrich Drepper
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 2004-11-20 18:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub Jelinek wrote:
> I think so from reading the standards, but in that case I wonder
> why we test it, e.g.:

Should be non-NULL.  I added the test in the userlevel code because I
wanted to provide the same error handling as if there would be no
userlevel part to the code.  I.e., the kernel will return EINVAL or
EFAULT (don't know which).

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBn5BH2ijCOnn/RHQRAr3mAJ4nEArXNsoyoG2SucCIEAD13Yy9HACgmhzq
FI4HSCSh3PkEEoHeRtRSgW8=
=ljnI
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-20 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-20 17:09 [PATCH] Fix signal.h Jakub Jelinek
2004-11-20 18:34 ` Jakub Jelinek
2004-11-20 18:43   ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).