summaryrefslogtreecommitdiff
path: root/klibc/include
diff options
context:
space:
mode:
Diffstat (limited to 'klibc/include')
-rw-r--r--klibc/include/arch/x86_64/klibc/archsignal.h6
-rw-r--r--klibc/include/bits32/bitsize.h3
-rw-r--r--klibc/include/bits64/bitsize.h3
-rw-r--r--klibc/include/signal.h11
-rw-r--r--klibc/include/sys/select.h1
-rw-r--r--klibc/include/sys/vfs.h7
6 files changed, 27 insertions, 4 deletions
diff --git a/klibc/include/arch/x86_64/klibc/archsignal.h b/klibc/include/arch/x86_64/klibc/archsignal.h
index 74e82e1dd0..527241454e 100644
--- a/klibc/include/arch/x86_64/klibc/archsignal.h
+++ b/klibc/include/arch/x86_64/klibc/archsignal.h
@@ -8,6 +8,10 @@
#ifndef _KLIBC_ARCHSIGNAL_H
#define _KLIBC_ARCHSIGNAL_H
-/* No special stuff for this architecture */
+/* The x86-64 headers defines NSIG 32, but it's actually 64 */
+#undef _NSIG
+#undef NSIG
+#define _NSIG 64
+#define NSIG _NSIG
#endif
diff --git a/klibc/include/bits32/bitsize.h b/klibc/include/bits32/bitsize.h
new file mode 100644
index 0000000000..06cc885983
--- /dev/null
+++ b/klibc/include/bits32/bitsize.h
@@ -0,0 +1,3 @@
+#ifndef _BITSIZE
+#define _BITSIZE 32
+#endif
diff --git a/klibc/include/bits64/bitsize.h b/klibc/include/bits64/bitsize.h
new file mode 100644
index 0000000000..54696fd70e
--- /dev/null
+++ b/klibc/include/bits64/bitsize.h
@@ -0,0 +1,3 @@
+#ifndef _BITSIZE
+#define _BITSIZE 64
+#endif
diff --git a/klibc/include/signal.h b/klibc/include/signal.h
index 1b439077f2..e78318f5f7 100644
--- a/klibc/include/signal.h
+++ b/klibc/include/signal.h
@@ -27,9 +27,20 @@ typedef int sig_atomic_t;
#ifndef SA_NODEFER
# define SA_NODEFER SA_NOMASK
#endif
+/* Some architectures define NSIG and not _NSIG or vice versa */
#ifndef NSIG
# define NSIG _NSIG
#endif
+#ifndef _NSIG
+# define _NSIG NSIG
+#endif
+
+/* If we don't have any real-time signals available to userspace,
+ hide them all */
+#if SIGRTMAX <= SIGRTMIN
+# undef SIGRTMIN
+# undef SIGRTMAX
+#endif
__extern const char * const sys_siglist[];
diff --git a/klibc/include/sys/select.h b/klibc/include/sys/select.h
index 7caf8c931b..361a1a53b0 100644
--- a/klibc/include/sys/select.h
+++ b/klibc/include/sys/select.h
@@ -5,6 +5,7 @@
#ifndef _SYS_SELECT_H
#define _SYS_SELECT_H
+#include <klibc/extern.h>
#include <sys/time.h>
#include <sys/types.h>
diff --git a/klibc/include/sys/vfs.h b/klibc/include/sys/vfs.h
index b60d1a572f..cf5aaf9107 100644
--- a/klibc/include/sys/vfs.h
+++ b/klibc/include/sys/vfs.h
@@ -8,11 +8,12 @@
#include <stdint.h>
#include <klibc/extern.h>
#include <sys/types.h>
+#include <bitsize.h>
/* struct statfs64 -- there seems to be two standards -
one for 32 and one for 64 bits, and they're incompatible... */
-#if BITSIZE == 32 || defined(__s390__)
+#if _BITSIZE == 32 || defined(__s390__)
struct statfs {
uint32_t f_type;
@@ -28,7 +29,7 @@ struct statfs {
uint32_t f_spare[5];
};
-#else /* BITSIZE == 64 */
+#else /* _BITSIZE == 64 */
struct statfs {
uint64_t f_type;
@@ -44,7 +45,7 @@ struct statfs {
uint64_t f_spare[5];
};
-#endif /* BITSIZE */
+#endif /* _BITSIZE */
__extern int statfs(const char *, struct statfs *);
__extern int fstatfs(int, struct statfs *);