summaryrefslogtreecommitdiff
path: root/posix/sys
diff options
context:
space:
mode:
Diffstat (limited to 'posix/sys')
-rw-r--r--posix/sys/types.h35
-rw-r--r--posix/sys/utsname.h12
-rw-r--r--posix/sys/wait.h60
3 files changed, 67 insertions, 40 deletions
diff --git a/posix/sys/types.h b/posix/sys/types.h
index 675e2522fa..ab28d39aaf 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -40,11 +40,19 @@ typedef __fsid_t fsid_t;
#endif
typedef __dev_t dev_t;
-typedef __ino_t ino_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __loff_t loff_t;
+#ifndef __USE_FILE_OFFSET64
+typedef __ino_t ino_t;
+#else
+typedef __ino64_t ino_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __ino64_t ino64_t;
+#endif
+
#ifndef gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
@@ -56,9 +64,17 @@ typedef __uid_t uid_t;
#endif
#ifndef off_t
+# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
+# else
+typedef __off64_t off_t;
+# endif
# define off_t off_t
#endif
+#if defined __USE_LARGEFILE64 && !defined off64_t
+typedef __off64_t off64_t;
+# define off64_t off64_t
+#endif
#ifndef pid_t
typedef __pid_t pid_t;
@@ -156,6 +172,23 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
#endif /* Use BSD. */
+/* Types from the Large File Support interface. */
+#ifndef __USE_FILE_OFFSET64
+typedef __blkcnt_t blkcnt_t; /* Type to count number of disk blocks. */
+typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks. */
+typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes. */
+#else
+typedef __blkcnt64_t blkcnt_t; /* Type to count number of disk blocks. */
+typedef __fsblkcnt64_t fsblkcnt_t; /* Type to count file system blocks. */
+typedef __fsfilcnt64_t fsfilcnt_t; /* Type to count file system inodes. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+typedef __blkcnt64_t blkcnt64_t; /* Type to count number of disk blocks. */
+typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks. */
+typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes. */
+#endif
+
__END_DECLS
#endif /* sys/types.h */
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
index bebef5d456..629dd5902a 100644
--- a/posix/sys/utsname.h
+++ b/posix/sys/utsname.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,7 @@ __BEGIN_DECLS
#include <bits/utsname.h>
#ifndef _UTSNAME_NODENAME_LENGTH
-#define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
+# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
#endif
/* Structure describing the system and machine. */
@@ -52,16 +52,16 @@ struct utsname
#if _UTSNAME_DOMAIN_LENGTH - 0
/* Name of the domain of this node on the network. */
-#ifdef __USE_GNU
+# ifdef __USE_GNU
char domainname[_UTSNAME_DOMAIN_LENGTH];
-#else
+# else
char __domainname[_UTSNAME_DOMAIN_LENGTH];
-#endif
+# endif
#endif
};
#ifdef __USE_SVID
-#define SYS_NMLN _UTSNAME_LENGTH
+# define SYS_NMLN _UTSNAME_LENGTH
#endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index f573d778f7..9b5025ab83 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 96, 97 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,43 +38,37 @@ __BEGIN_DECLS
/* Lots of hair to allow traditional BSD use of `union wait'
as well as POSIX.1 use of `int' for the status word. */
-#ifdef __GNUC__
-#define __WAIT_INT(status) \
+# ifdef __GNUC__
+# define __WAIT_INT(status) \
(__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
__u.__in = (status); __u.__i; }))
-#else
-#define __WAIT_INT(status) (*(int *) &(status))
-#endif
-
-/* This is the type of the argument to `wait'.
-
- NOTE: Since this functionality is volatile, I'm disabling the use of it for
- now.
-
-With GCC 2.6.1 and later, the funky union causes redeclarations with either
- `int *' or `union wait *' to be allowed without complaint.
- __WAIT_STATUS_DEFN is the type used in the actual function
- definitions. */
-
-#if (!defined (__GNUC__) || __GNUC__ < 2 || \
- /*(__GNUC__ == 2 && __GNUC_MINOR__ < 6)*/ 1)
-#define __WAIT_STATUS __ptr_t
-#define __WAIT_STATUS_DEFN __ptr_t
-#else
+# else
+# define __WAIT_INT(status) (*(int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2
+# define __WAIT_STATUS __ptr_t
+# define __WAIT_STATUS_DEFN __ptr_t
+# else
/* This works in GCC 2.6.1 and later. */
typedef union
{
union wait *__uptr;
int *__iptr;
} __WAIT_STATUS __attribute__ ((transparent_union));
-#define __WAIT_STATUS_DEFN int *
+# define __WAIT_STATUS_DEFN int *
#endif
#else /* Don't use BSD. */
-#define __WAIT_INT(status) (status)
-#define __WAIT_STATUS int *
-#define __WAIT_STATUS_DEFN int *
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
#endif /* Use BSD. */
@@ -89,10 +83,10 @@ typedef union
#define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
#ifdef __USE_BSD
-#define WCOREFLAG __WCOREFLAG
-#define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
-#define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
-#define W_STOPCODE(sig) __W_STOPCODE(sig)
+# define WCOREFLAG __WCOREFLAG
+# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE(sig)
#endif
@@ -103,8 +97,8 @@ extern __pid_t wait __P ((__WAIT_STATUS __stat_loc));
#ifdef __USE_BSD
/* Special values for the PID argument to `waitpid' and `wait4'. */
-#define WAIT_ANY (-1) /* Any process. */
-#define WAIT_MYPGRP 0 /* Any process in my process group. */
+# define WAIT_ANY (-1) /* Any process. */
+# define WAIT_MYPGRP 0 /* Any process in my process group. */
#endif
/* Wait for a child matching PID to die.
@@ -124,7 +118,7 @@ extern __pid_t __waitpid __P ((__pid_t __pid, int *__stat_loc,
extern __pid_t waitpid __P ((__pid_t __pid, int *__stat_loc,
int __options));
-#if defined(__USE_BSD) || defined(__USE_XOPEN_EXTENDED)
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* This being here makes the prototypes valid whether or not
we have already included <sys/resource.h> to define `struct rusage'. */
struct rusage;