Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include Implement sigemptyset() and sigfillset() not as macr...



details:   https://anonhg.NetBSD.org/src/rev/869bae960605
branches:  trunk
changeset: 566906:869bae960605
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun May 23 23:03:24 2004 +0000

description:
Implement sigemptyset() and sigfillset() not as macros but as inline
functions, just like the rest of the sigsetops.  From J.T.Conklin
in PR lib/25627; originally prompted to work around problems with
an application but also fixing one important bug: per POSIX, these
functions may be additionally implemented as macros, iff they evaluate
their macros only once.  This was not the case.

diffstat:

 include/signal.h |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r ec8fed0687f7 -r 869bae960605 include/signal.h
--- a/include/signal.h  Sun May 23 22:17:10 2004 +0000
+++ b/include/signal.h  Sun May 23 23:03:24 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signal.h,v 1.36 2003/09/12 20:27:50 christos Exp $     */
+/*     $NetBSD: signal.h,v 1.37 2004/05/23 23:03:24 kleink Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -134,11 +134,21 @@
        }
        return (__sigismember(set, signo));
 }
-#endif /* __GNUC__ && __STDC__ */
+
+extern __inline int
+sigemptyset(sigset_t *set)
+{
+       __sigemptyset(set);
+       return (0);
+}
 
-/* List definitions after function declarations, or Reiser cpp gets upset. */
-#define        sigemptyset(set)        (__sigemptyset(set), /*LINTED*/0)
-#define        sigfillset(set)         (__sigfillset(set), /*LINTED*/ 0)
+extern __inline int
+sigfillset(sigset_t *set)
+{
+       __sigfillset(set);
+       return (0);
+}
+#endif /* __GNUC__ && __STDC__ */
 #endif /* !__LIBC12_SOURCE__ */
 
 /*



Home | Main Index | Thread Index | Old Index