added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / all-unix / exec / disable.c
blobe973652009b3c0f2d73a9425dfac164cb0f6fcb9
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: i386unix version of Disable()
6 Lang: english
7 */
9 #include <exec/tasks.h>
10 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <aros/atomic.h>
13 #include <proto/exec.h>
15 #include <stdlib.h>
16 #include <signal.h>
18 extern sigset_t sig_int_mask; /* Mask of sig_t that are ints, not traps */
19 #undef Exec
20 #ifdef UseExecstubs
21 # define Exec _Exec
22 #endif
24 AROS_LH0(void, Disable,
25 struct ExecBase *, SysBase, 20, Exec)
27 #undef Exec
28 AROS_LIBFUNC_INIT
30 sigprocmask(SIG_BLOCK, &sig_int_mask, NULL);
32 AROS_ATOMIC_INC(SysBase->IDNestCnt);
34 if (SysBase->IDNestCnt < 0)
36 /* If we get here we have big trouble. Someone called
37 1x Disable() and 2x Enable(). IDNestCnt < 0 would
38 mean enable interrupts, but the caller of Disable
39 relies on the function to disable them, so we don´t
40 do anything here (or maybe a deadend alert?) */
43 AROS_LIBFUNC_EXIT