]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - sail/machdep.h
Don't cast the return value of calloc().
[bsdgames-darwin.git] / sail / machdep.h
index 223333d63c9de048ca1c060b2ccd5dce385ddcc7..63e64ff6927bbb11eb02a193282e303f9bb985b1 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: machdep.h,v 1.6 2008/01/28 01:58:01 dholland Exp $     */
+
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)machdep.h   5.5 (Berkeley) 6/1/90
+ *     @(#)machdep.h   8.1 (Berkeley) 5/31/93
  */
 
 #define TIMEOUT 300                            /* Sync() timeout in seconds */
 
-/* for 4.2bsd machines */
-#define blockalarm()   ((void) sigblock(1 << SIGALRM-1))
-#define unblockalarm() ((void) sigsetmask(sigblock(0) & ~(1 << SIGALRM-1)))
-
-/* for 2.9bsd machines (onyx)
-typedef int void;
-#define blockalarm()   ((void) sighold(SIGALRM))
-#define unblockalarm() ((void) sigrelse(SIGALRM))
-*/
+/* for POSIX systems */
+#define        blockalarm() \
+       do {                                                            \
+               sigset_t set;                                           \
+               sigemptyset(&set);                                      \
+               sigaddset(&set, SIGALRM);                               \
+               sigprocmask(SIG_BLOCK, &set, (sigset_t *)0);            \
+       } while (0)
+#define        unblockalarm() \
+       do {                                                            \
+               sigset_t set;                                           \
+               sigemptyset(&set);                                      \
+               sigaddset(&set, SIGALRM);                               \
+               sigprocmask(SIG_UNBLOCK, &set, (sigset_t *)0);          \
+       } while (0)