Print this page
remove support for non-ANSI compilation


   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*      Copyright (c) 1988 AT&T     */
  23 /*        All Rights Reserved   */
  24 
  25 
  26 /*


  27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28  * Use is subject to license terms.
  29  */
  30 
  31 #ifndef _SIGNAL_H
  32 #define _SIGNAL_H
  33 
  34 #pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.5.3.4 */
  35 
  36 #include <sys/feature_tests.h>
  37 
  38 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  39         defined(__XOPEN_OR_POSIX)
  40 #include <sys/types.h>    /* need pid_t/uid_t/size_t/clock_t/caddr_t/pthread_t */
  41 #endif
  42 
  43 #include <iso/signal_iso.h>
  44 #include <sys/signal.h>
  45 
  46 /*
  47  * Allow global visibility for symbols defined in
  48  * C++ "std" namespace in <iso/signal_iso.h>.
  49  */
  50 #if __cplusplus >= 199711L
  51 using std::sig_atomic_t;
  52 using std::signal;
  53 using std::raise;
  54 #endif
  55 
  56 #ifdef  __cplusplus
  57 extern "C" {
  58 #endif
  59 
  60 
  61 #if defined(__STDC__)
  62 
  63 extern const char       **_sys_siglistp;        /* signal descriptions */
  64 extern const int        _sys_siglistn;          /* # of signal descriptions */
  65 
  66 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
  67 #define _sys_siglist    _sys_siglistp
  68 #define _sys_nsig       _sys_siglistn
  69 #endif
  70 
  71 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  72         defined(__XOPEN_OR_POSIX)
  73 extern int kill(pid_t, int);
  74 extern int sigaction(int, const struct sigaction *_RESTRICT_KYWD,
  75         struct sigaction *_RESTRICT_KYWD);
  76 #ifndef _KERNEL
  77 extern int sigaddset(sigset_t *, int);
  78 extern int sigdelset(sigset_t *, int);
  79 extern int sigemptyset(sigset_t *);
  80 extern int sigfillset(sigset_t *);
  81 extern int sigismember(const sigset_t *, int);
  82 #endif


 115 #if defined(__EXTENSIONS__) || \
 116         (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 117         (defined(_XPG4_2) && !defined(_XPG6))
 118 extern int sigstack(struct sigstack *, struct sigstack *);
 119 #endif
 120 
 121 #if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
 122         !defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE > 2)
 123 #include <sys/siginfo.h>
 124 #include <time.h>
 125 extern int pthread_kill(pthread_t, int);
 126 extern int pthread_sigmask(int, const sigset_t *_RESTRICT_KYWD,
 127         sigset_t *_RESTRICT_KYWD);
 128 extern int sigwaitinfo(const sigset_t *_RESTRICT_KYWD,
 129         siginfo_t *_RESTRICT_KYWD);
 130 extern int sigtimedwait(const sigset_t *_RESTRICT_KYWD,
 131         siginfo_t *_RESTRICT_KYWD, const struct timespec *_RESTRICT_KYWD);
 132 extern int sigqueue(pid_t, int, const union sigval);
 133 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && */
 134 
 135 #else   /* __STDC__ */
 136 
 137 extern char     **_sys_siglistp;        /* signal descriptions */
 138 extern int      _sys_siglistn;          /* # of signal descriptions */
 139 
 140 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
 141 #define _sys_siglist    _sys_siglistp
 142 #define _sys_nsig       _sys_siglistn
 143 #endif
 144 
 145 #if defined(__EXTENSIONS__) || defined(__XOPEN_OR_POSIX)
 146 extern int kill();
 147 extern int sigaction();
 148 #ifndef _KERNEL
 149 extern int sigaddset();
 150 extern int sigdelset();
 151 extern int sigemptyset();
 152 extern int sigfillset();
 153 extern int sigismember();
 154 #endif
 155 extern int sigpending();
 156 extern int sigprocmask();
 157 extern int sigsuspend();
 158 #endif /* defined(__EXTENSIONS__)... */
 159 
 160 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 161         defined(_XPG4_2)
 162 extern void (*bsd_signal())();
 163 extern int killpg();
 164 extern int siginterrupt();
 165 #endif /* defined(__EXTENSIONS__) ... */
 166 
 167 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 168         (defined(_XPG4_2) && !defined(_XPG6))
 169 extern int sigstack();
 170 #endif
 171 
 172 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
 173 extern int gsignal();
 174 extern int (*ssignal)();
 175 extern int sigsend();
 176 extern int sigsendset();
 177 extern int sig2str();
 178 extern int str2sig();
 179 #define SIG2STR_MAX     32
 180 #endif
 181 
 182 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 183         defined(_XPG4_2)
 184 extern int sigaltstack();
 185 extern int sighold();
 186 extern int sigignore();
 187 extern int sigpause();
 188 extern int sigrelse();
 189 extern void (*sigset())();
 190 #endif
 191 
 192 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 193         (_POSIX_C_SOURCE > 2)
 194 #include <sys/siginfo.h>
 195 #include <sys/time.h>
 196 extern int pthread_kill();
 197 extern int pthread_sigmask();
 198 extern int sigwaitinfo();
 199 extern int sigtimedwait();
 200 extern int sigqueue();
 201 #endif
 202 
 203 #endif  /* __STDC__ */
 204 
 205 /*
 206  * sigwait() prototype is defined here.
 207  */
 208 
 209 #if     defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
 210         !defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 211         defined(_POSIX_PTHREAD_SEMANTICS)
 212 
 213 #if     defined(__STDC__)
 214 
 215 #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 216 
 217 #ifdef __PRAGMA_REDEFINE_EXTNAME
 218 #pragma redefine_extname sigwait __posix_sigwait
 219 extern int sigwait(const sigset_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 220 #else  /* __PRAGMA_REDEFINE_EXTNAME */
 221 
 222 extern int __posix_sigwait(const sigset_t *_RESTRICT_KYWD,
 223     int *_RESTRICT_KYWD);
 224 
 225 #ifdef  __lint
 226 #define sigwait __posix_sigwait
 227 #else   /* !__lint */
 228 
 229 static int
 230 sigwait(const sigset_t *_RESTRICT_KYWD __setp, int *_RESTRICT_KYWD __signo)
 231 {
 232         return (__posix_sigwait(__setp, __signo));
 233 }
 234 
 235 #endif /* !__lint */
 236 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 237 
 238 #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 239 
 240 extern int sigwait(sigset_t *);
 241 
 242 #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 243 
 244 
 245 #else  /* __STDC__ */
 246 
 247 
 248 #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 249 
 250 #ifdef __PRAGMA_REDEFINE_EXTNAME
 251 #pragma redefine_extname sigwait __posix_sigwait
 252 extern int sigwait();
 253 #else  /* __PRAGMA_REDEFINE_EXTNAME */
 254 
 255 extern int __posix_sigwait();
 256 
 257 #ifdef  __lint
 258 #define sigwait __posix_sigwait
 259 #else   /* !__lint */
 260 
 261 static int
 262 sigwait(__setp, __signo)
 263         sigset_t *__setp;
 264         int *__signo;
 265 {
 266         return (__posix_sigwait(__setp, __signo));
 267 }
 268 
 269 #endif /* !__lint */
 270 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 271 
 272 #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 273 
 274 extern int sigwait();
 275 
 276 #endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 277 
 278 #endif /* __STDC__ */
 279 
 280 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
 281 
 282 #ifdef  __cplusplus
 283 }
 284 #endif
 285 
 286 #endif  /* _SIGNAL_H */


   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*      Copyright (c) 1988 AT&T     */
  23 /*        All Rights Reserved   */
  24 

  25 /*
  26  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  27  *
  28  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  29  * Use is subject to license terms.
  30  */
  31 
  32 #ifndef _SIGNAL_H
  33 #define _SIGNAL_H
  34 


  35 #include <sys/feature_tests.h>
  36 
  37 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  38         defined(__XOPEN_OR_POSIX)
  39 #include <sys/types.h>    /* need pid_t/uid_t/size_t/clock_t/caddr_t/pthread_t */
  40 #endif
  41 
  42 #include <iso/signal_iso.h>
  43 #include <sys/signal.h>
  44 
  45 /*
  46  * Allow global visibility for symbols defined in
  47  * C++ "std" namespace in <iso/signal_iso.h>.
  48  */
  49 #if __cplusplus >= 199711L
  50 using std::sig_atomic_t;
  51 using std::signal;
  52 using std::raise;
  53 #endif
  54 
  55 #ifdef  __cplusplus
  56 extern "C" {
  57 #endif
  58 
  59 


  60 extern const char       **_sys_siglistp;        /* signal descriptions */
  61 extern const int        _sys_siglistn;          /* # of signal descriptions */
  62 
  63 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
  64 #define _sys_siglist    _sys_siglistp
  65 #define _sys_nsig       _sys_siglistn
  66 #endif
  67 
  68 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
  69         defined(__XOPEN_OR_POSIX)
  70 extern int kill(pid_t, int);
  71 extern int sigaction(int, const struct sigaction *_RESTRICT_KYWD,
  72         struct sigaction *_RESTRICT_KYWD);
  73 #ifndef _KERNEL
  74 extern int sigaddset(sigset_t *, int);
  75 extern int sigdelset(sigset_t *, int);
  76 extern int sigemptyset(sigset_t *);
  77 extern int sigfillset(sigset_t *);
  78 extern int sigismember(const sigset_t *, int);
  79 #endif


 112 #if defined(__EXTENSIONS__) || \
 113         (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 114         (defined(_XPG4_2) && !defined(_XPG6))
 115 extern int sigstack(struct sigstack *, struct sigstack *);
 116 #endif
 117 
 118 #if defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
 119         !defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE > 2)
 120 #include <sys/siginfo.h>
 121 #include <time.h>
 122 extern int pthread_kill(pthread_t, int);
 123 extern int pthread_sigmask(int, const sigset_t *_RESTRICT_KYWD,
 124         sigset_t *_RESTRICT_KYWD);
 125 extern int sigwaitinfo(const sigset_t *_RESTRICT_KYWD,
 126         siginfo_t *_RESTRICT_KYWD);
 127 extern int sigtimedwait(const sigset_t *_RESTRICT_KYWD,
 128         siginfo_t *_RESTRICT_KYWD, const struct timespec *_RESTRICT_KYWD);
 129 extern int sigqueue(pid_t, int, const union sigval);
 130 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && */
 131 






































































 132 /*
 133  * sigwait() prototype is defined here.
 134  */
 135 
 136 #if     defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) && \
 137         !defined(__XOPEN_OR_POSIX)) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 138         defined(_POSIX_PTHREAD_SEMANTICS)
 139 


 140 #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 141 
 142 #ifdef __PRAGMA_REDEFINE_EXTNAME
 143 #pragma redefine_extname sigwait __posix_sigwait
 144 extern int sigwait(const sigset_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 145 #else  /* __PRAGMA_REDEFINE_EXTNAME */
 146 
 147 extern int __posix_sigwait(const sigset_t *_RESTRICT_KYWD,
 148     int *_RESTRICT_KYWD);
 149 
 150 #ifdef  __lint
 151 #define sigwait __posix_sigwait
 152 #else   /* !__lint */
 153 
 154 static int
 155 sigwait(const sigset_t *_RESTRICT_KYWD __setp, int *_RESTRICT_KYWD __signo)
 156 {
 157         return (__posix_sigwait(__setp, __signo));
 158 }
 159 
 160 #endif /* !__lint */
 161 #endif /* __PRAGMA_REDEFINE_EXTNAME */
 162 
 163 #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 164 
 165 extern int sigwait(sigset_t *);
 166 
 167 #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 168 




































 169 #endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
 170 
 171 #ifdef  __cplusplus
 172 }
 173 #endif
 174 
 175 #endif  /* _SIGNAL_H */