summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile11
-rw-r--r--posix/bits/posix1_lim.h (renamed from posix/posix1_lim.h)11
-rw-r--r--posix/bits/posix2_lim.h (renamed from posix/posix2_lim.h)9
-rw-r--r--posix/fnmatch.h1
-rw-r--r--posix/getopt.h2
-rw-r--r--posix/glob.h1
-rw-r--r--posix/regex.h6
-rw-r--r--posix/sched.h4
-rw-r--r--posix/sys/times.h2
-rw-r--r--posix/sys/types.h29
-rw-r--r--posix/sys/utsname.h5
-rw-r--r--posix/sys/wait.h8
-rw-r--r--posix/tar.h1
-rw-r--r--posix/unistd.h8
-rw-r--r--posix/wordexp.h2
15 files changed, 58 insertions, 42 deletions
diff --git a/posix/Makefile b/posix/Makefile
index 53061c0828..0209274fff 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -22,10 +22,11 @@
subdir := posix
headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \
- glob.h regex.h wordexp.h fnmatch.h gnu/types.h getopt.h \
- posix1_lim.h posix2_lim.h posix_opt.h local_lim.h tar.h \
- utsnamelen.h confname.h waitflags.h waitstatus.h sys/unistd.h \
- sched.h schedbits.h re_comp.h wait.h
+ glob.h regex.h wordexp.h fnmatch.h bits/types.h getopt.h \
+ bits/posix1_lim.h bits/posix2_lim.h bits/posix_opt.h \
+ bits/local_lim.h tar.h bits/utsname.h bits/confname.h \
+ bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \
+ bits/sched.h re_comp.h wait.h
distribute := confstr.h TESTS TESTS2C.sed testcases.h
@@ -59,7 +60,7 @@ before-compile := testcases.h
include ../Rules
-CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes
+CFLAGS-regex.c = -Wno-unused -Wno-strict-prototypes -DDEBUG
CFLAGS-getaddrinfo.c = -DRESOLVER
$(objpfx)libposix.a: $(dep-dummy-lib); $(make-dummy-lib)
diff --git a/posix/posix1_lim.h b/posix/bits/posix1_lim.h
index a23d224332..29d1acf947 100644
--- a/posix/posix1_lim.h
+++ b/posix/bits/posix1_lim.h
@@ -18,11 +18,12 @@
/*
* POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
+ *
+ * Never include this file directly; use <limits.h> instead.
*/
-#ifndef _POSIX1_LIMITS_H
-
-#define _POSIX1_LIMITS_H 1
+#ifndef _BITS_POSIX1_LIM_H
+#define _BITS_POSIX1_LIM_H 1
/* These are the standard-mandated minimum values. */
@@ -89,7 +90,7 @@
/* Get the implementation-specific values for the above. */
-#include <local_lim.h>
+#include <bits/local_lim.h>
#ifndef SSIZE_MAX
@@ -104,4 +105,4 @@
#define NGROUPS_MAX _POSIX_NGROUPS_MAX
#endif
-#endif /* posix1_limits.h */
+#endif /* bits/posix1_lim.h */
diff --git a/posix/posix2_lim.h b/posix/bits/posix2_lim.h
index 08b1e24b76..d2d89694ec 100644
--- a/posix/posix2_lim.h
+++ b/posix/bits/posix2_lim.h
@@ -16,9 +16,12 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _POSIX2_LIMITS_H
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
-#define _POSIX2_LIMITS_H 1
+#ifndef _BITS_POSIX2_LIM_H
+#define _BITS_POSIX2_LIM_H 1
/* The maximum `ibase' and `obase' values allowed by the `bc' utility. */
@@ -95,4 +98,4 @@
#endif
-#endif /* posix2_limits.h */
+#endif /* bits/posix2_lim.h */
diff --git a/posix/fnmatch.h b/posix/fnmatch.h
index e9a065a4c7..58880eceec 100644
--- a/posix/fnmatch.h
+++ b/posix/fnmatch.h
@@ -17,7 +17,6 @@
Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
-
#define _FNMATCH_H 1
#ifdef __cplusplus
diff --git a/posix/getopt.h b/posix/getopt.h
index d6ceb0eee1..68958c10bc 100644
--- a/posix/getopt.h
+++ b/posix/getopt.h
@@ -128,4 +128,4 @@ extern int _getopt_internal ();
}
#endif
-#endif /* _GETOPT_H */
+#endif /* getopt.h */
diff --git a/posix/glob.h b/posix/glob.h
index bfe1c9cd01..db44f7a69c 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -19,7 +19,6 @@
Boston, MA 02111-1307, USA. */
#ifndef _GLOB_H
-
#define _GLOB_H 1
#ifdef __cplusplus
diff --git a/posix/regex.h b/posix/regex.h
index 8e2bd8f394..e9a53d1a9c 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -20,8 +20,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef __REGEXP_LIBRARY_H__
-#define __REGEXP_LIBRARY_H__
+#ifndef _REGEX_H
+#define _REGEX_H 1
/* Allow the use in C++ code. */
#ifdef __cplusplus
@@ -524,7 +524,7 @@ extern void regfree _RE_ARGS ((regex_t *preg));
}
#endif /* C++ */
-#endif /* not __REGEXP_LIBRARY_H__ */
+#endif /* regex.h */
/*
Local variables:
diff --git a/posix/sched.h b/posix/sched.h
index 277f93eb52..ae0f634fa4 100644
--- a/posix/sched.h
+++ b/posix/sched.h
@@ -23,11 +23,11 @@
#include <features.h>
/* Get type definitions. */
-#include <gnu/types.h>
+#include <bits/types.h>
#include <sys/time.h> /* for struct timespec */
/* Get system specific constant and data structure definitions. */
-#include <schedbits.h>
+#include <bits/sched.h>
__BEGIN_DECLS
diff --git a/posix/sys/times.h b/posix/sys/times.h
index eea9e3502c..6f2838d6f1 100644
--- a/posix/sys/times.h
+++ b/posix/sys/times.h
@@ -21,8 +21,8 @@
*/
#ifndef _SYS_TIMES_H
-
#define _SYS_TIMES_H 1
+
#include <features.h>
#define __need_clock_t
diff --git a/posix/sys/types.h b/posix/sys/types.h
index ffeeee1ff0..f49c996a04 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -21,13 +21,13 @@
*/
#ifndef _SYS_TYPES_H
-
#define _SYS_TYPES_H 1
+
#include <features.h>
__BEGIN_DECLS
-#include <gnu/types.h>
+#include <bits/types.h>
#ifdef __USE_BSD
typedef __u_char u_char;
@@ -80,16 +80,25 @@ typedef unsigned int uint;
#if !defined (__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7
+/* These types are defined by the ISO C 9x header <inttypes.h>. */
+#ifndef __int8_t_defined
+#define __int8_t_defined
typedef char int8_t;
-typedef unsigned char u_int8_t;
typedef short int int16_t;
-typedef unsigned short int u_int16_t;
typedef int int32_t;
-typedef unsigned int u_int32_t;
#ifdef __GNUC__
typedef long long int int64_t;
+#endif
+#endif
+
+/* But these were defined by ISO C without the first `_'. */
+typedef unsigned char u_int8_t;
+typedef unsigned short int u_int16_t;
+typedef unsigned int u_int32_t;
+#ifdef __GNUC__
typedef unsigned long long int u_int64_t;
#endif
+
typedef int register_t;
#else
@@ -100,13 +109,17 @@ typedef int register_t;
#define __u_intN_t(N, MODE) \
typedef unsigned int u_int##N##_t __attribute__ ((__mode__ (MODE)))
+#ifndef __int8_t_defined
+#define __int8_t_defined
__intN_t (8, __QI__);
-__u_intN_t (8, __QI__);
__intN_t (16, __HI__);
-__u_intN_t (16, __HI__);
__intN_t (32, __SI__);
-__u_intN_t (32, __SI__);
__intN_t (64, __DI__);
+#endif
+
+__u_intN_t (8, __QI__);
+__u_intN_t (16, __HI__);
+__u_intN_t (32, __SI__);
__u_intN_t (64, __DI__);
typedef int register_t __attribute__ ((__mode__ (__word__)));
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
index e9891609bc..bebef5d456 100644
--- a/posix/sys/utsname.h
+++ b/posix/sys/utsname.h
@@ -21,13 +21,14 @@
*/
#ifndef _SYS_UTSNAME_H
-
#define _SYS_UTSNAME_H 1
+
#include <features.h>
__BEGIN_DECLS
-#include <utsnamelen.h>
+#include <bits/utsname.h>
+
#ifndef _UTSNAME_NODENAME_LENGTH
#define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
#endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index a13b825638..f573d778f7 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -21,17 +21,17 @@
*/
#ifndef _SYS_WAIT_H
-
#define _SYS_WAIT_H 1
+
#include <features.h>
__BEGIN_DECLS
-#include <gnu/types.h>
+#include <bits/types.h>
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
-#include <waitflags.h>
+#include <bits/waitflags.h>
#ifdef __USE_BSD
@@ -79,7 +79,7 @@ typedef union
#endif /* Use BSD. */
/* This will define all the `__W*' macros. */
-#include <waitstatus.h>
+#include <bits/waitstatus.h>
#define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
#define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
diff --git a/posix/tar.h b/posix/tar.h
index fef6413ceb..f8264a0f7f 100644
--- a/posix/tar.h
+++ b/posix/tar.h
@@ -19,7 +19,6 @@
Boston, MA 02111-1307, USA. */
#ifndef _TAR_H
-
#define _TAR_H 1
/* A tar archive consists of 512-byte blocks.
diff --git a/posix/unistd.h b/posix/unistd.h
index 8f1dd35ce1..8593b03349 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -21,8 +21,8 @@
*/
#ifndef _UNISTD_H
-
#define _UNISTD_H 1
+
#include <features.h>
__BEGIN_DECLS
@@ -135,7 +135,7 @@ __BEGIN_DECLS
_POSIX_PRIO_IO Prioritized Asynchronous I/O may be performed.
*/
-#include <posix_opt.h>
+#include <bits/posix_opt.h>
/* Standard file descriptors. */
@@ -146,7 +146,7 @@ __BEGIN_DECLS
/* All functions that are not declared anywhere else. */
-#include <gnu/types.h>
+#include <bits/types.h>
#ifndef ssize_t
typedef __ssize_t ssize_t;
@@ -392,7 +392,7 @@ extern void _exit __P ((int __status)) __attribute__ ((__noreturn__));
/* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
the `_SC_*' symbols for the NAME argument to `sysconf';
and the `_CS_*' symbols for the NAME argument to `confstr'. */
-#include <confname.h>
+#include <bits/confname.h>
/* Get file-specific configuration information about PATH. */
extern long int __pathconf __P ((__const char *__path, int __name));
diff --git a/posix/wordexp.h b/posix/wordexp.h
index a90f022c16..6fa02b78c4 100644
--- a/posix/wordexp.h
+++ b/posix/wordexp.h
@@ -17,8 +17,8 @@
Boston, MA 02111-1307, USA. */
#ifndef _WORDEXP_H
-
#define _WORDEXP_H 1
+
#include <features.h>
__BEGIN_DECLS