summaryrefslogtreecommitdiff
path: root/bits
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-11-01 01:45:53 +0100
committerThomas Schwinge <thomas@codesourcery.com>2012-11-01 01:45:53 +0100
commitcefc074b32d1eed87b2b96c8943d7f1864a5bb15 (patch)
tree1f43da63f9bae90772538a6c5b051e34983a22e7 /bits
parent0ce6f3added7475bfd0f2f551c6c97baccde6da5 (diff)
parent343dc156c34702751b3cc63736caa0649c59421a (diff)
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'bits')
-rw-r--r--bits/dirent.h36
-rw-r--r--bits/fcntl.h77
-rw-r--r--bits/libc-lock.h8
-rw-r--r--bits/param.h33
-rw-r--r--bits/signum.h69
-rw-r--r--bits/stat.h9
-rw-r--r--bits/types.h1
-rw-r--r--bits/typesizes.h11
8 files changed, 191 insertions, 53 deletions
diff --git a/bits/dirent.h b/bits/dirent.h
index ac1928d3db..948510c068 100644
--- a/bits/dirent.h
+++ b/bits/dirent.h
@@ -1,5 +1,5 @@
-/* Directory entry structure `struct dirent'. Stub version.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Directory entry structure `struct dirent'. 4.4BSD/Generic version.
+ Copyright (C) 1996-2012 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
@@ -22,14 +22,38 @@
struct dirent
{
- char d_name[1]; /* Variable length. */
- int d_fileno;
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino; /* File serial number. */
+#else
+ __ino64_t d_ino;
+#endif
+ unsigned short int d_reclen; /* Length of the whole `struct dirent'. */
+ unsigned char d_type; /* File type, possibly unknown. */
+ unsigned char d_namlen; /* Length of the file name. */
+
+ /* Only this member is in the POSIX standard. */
+ char d_name[1]; /* File name (actually longer). */
};
#ifdef __USE_LARGEFILE64
struct dirent64
{
- char d_name[1]; /* Variable length. */
- int d_fileno;
+ __ino64_t d_ino;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ unsigned char d_namlen;
+
+ char d_name[1];
};
#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#define _DIRENT_HAVE_D_RECLEN 1
+#define _DIRENT_HAVE_D_NAMLEN 1
+#define _DIRENT_HAVE_D_TYPE 1
+
+#ifdef __INO_T_MATCHES_INO64_T
+/* Inform libc code that these two types are effectively identical. */
+# define _DIRENT_MATCHES_DIRENT64 1
+#endif
diff --git a/bits/fcntl.h b/bits/fcntl.h
index ba5de0071e..65b366ab7f 100644
--- a/bits/fcntl.h
+++ b/bits/fcntl.h
@@ -1,5 +1,5 @@
-/* O_*, F_*, FD_* bit values for stub configuration.
- Copyright (C) 1991, 1992, 1997, 2000, 2004 Free Software Foundation, Inc.
+/* O_*, F_*, FD_* bit values. 4.4BSD/Generic version.
+ Copyright (C) 1991-2012 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
@@ -16,10 +16,8 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* These values should be changed as appropriate for your system. */
-
#ifndef _FCNTL_H
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
@@ -33,7 +31,28 @@
#define O_CREAT 0x0200 /* Create file if it doesn't exist. */
#define O_EXCL 0x0800 /* Fail if file already exists. */
#define O_TRUNC 0x0400 /* Truncate file to zero length. */
-#define O_NOCTTY 0x0100 /* Don't assign a controlling terminal. */
+#define O_NOCTTY 0x8000 /* Don't assign a controlling terminal. */
+#define O_ASYNC 0x0040 /* Send SIGIO to owner when data is ready. */
+#define O_FSYNC 0x0080 /* Synchronous writes. */
+#define O_SYNC O_FSYNC
+#ifdef __USE_MISC
+#define O_SHLOCK 0x0010 /* Open with shared file lock. */
+#define O_EXLOCK 0x0020 /* Open with shared exclusive lock. */
+#endif
+#ifdef __USE_XOPEN2K8
+# define O_DIRECTORY 0x00200000 /* Must be a directory. */
+# define O_NOFOLLOW 0x00000100 /* Do not follow links. */
+# define O_CLOEXEC 0x00400000 /* Set close_on_exec. */
+#endif
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC 0x00010000 /* Synchronize data. */
+# define O_RSYNC 0x00020000 /* Synchronize read operations. */
+#endif
+
+/* All opens support large file sizes, so there is no flag bit for this. */
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0
+#endif
/* File status flags for `open' and `fcntl'. */
#define O_APPEND 0x0008 /* Writes append to the file. */
@@ -43,6 +62,22 @@
# define O_NDELAY O_NONBLOCK
#endif
+#ifdef __USE_BSD
+/* Bits in the file status flags returned by F_GETFL.
+ These are all the O_* flags, plus FREAD and FWRITE, which are
+ independent bits set by which of O_RDONLY, O_WRONLY, and O_RDWR, was
+ given to `open'. */
+# define FREAD 1
+# define FWRITE 2
+
+/* Traditional BSD names the O_* bits. */
+# define FASYNC O_ASYNC
+# define FFSYNC O_FSYNC
+# define FSYNC O_SYNC
+# define FAPPEND O_APPEND
+# define FNDELAY O_NDELAY
+#endif
+
/* Mask for file access modes. This is system-dependent in case
some system ever wants to define some other flavor of access. */
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
@@ -53,13 +88,21 @@
#define F_SETFD 2 /* Set file descriptor flags. */
#define F_GETFL 3 /* Get file status flags. */
#define F_SETFL 4 /* Set file status flags. */
-#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
-# define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
+#define F_GETOWN 5 /* Get owner (receiver of SIGIO). */
+#define F_SETOWN 6 /* Set owner (receiver of SIGIO). */
#endif
#define F_GETLK 7 /* Get record locking info. */
-#define F_SETLK 8 /* Set record locking info. */
-#define F_SETLKW 9 /* Set record locking info, wait. */
+#define F_SETLK 8 /* Set record locking info (non-blocking). */
+#define F_SETLKW 9 /* Set record locking info (blocking). */
+/* Not necessary, we always have 64-bit offsets. */
+#define F_GETLK64 F_GETLK /* Get record locking info. */
+#define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */
+#define F_SETLKW64 F_SETLKW/* Set record locking info (blocking). */
+#ifdef __USE_XOPEN2K8
+# define F_DUPFD_CLOEXEC 12 /* Duplicate file descriptor with
+ close-on-exit set. */
+#endif
/* File descriptor flags used with F_GETFD and F_SETFD. */
#define FD_CLOEXEC 1 /* Close on exec. */
@@ -71,12 +114,24 @@
argument to `fcntl' for the F_GETLK, F_SETLK, and F_SETLKW requests. */
struct flock
{
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ };
+
+#ifdef __USE_LARGEFILE64
+/* Note this matches struct flock exactly. */
+struct flock64
+ {
__off_t l_start; /* Offset where the lock begins. */
__off_t l_len; /* Size of the locked area; zero means until EOF. */
__pid_t l_pid; /* Process holding the lock. */
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
};
+#endif
/* Values for the `l_type' field of a `struct flock'. */
#define F_RDLCK 1 /* Read lock. */
diff --git a/bits/libc-lock.h b/bits/libc-lock.h
index d7c49e7bb5..d372722b95 100644
--- a/bits/libc-lock.h
+++ b/bits/libc-lock.h
@@ -44,11 +44,11 @@
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#define __libc_lock_init(NAME)
+#define __rtld_lock_initialize(NAME)
#define __libc_rwlock_init(NAME)
/* Same as last but this time we initialize a recursive mutex. */
#define __libc_lock_init_recursive(NAME)
-#define __rtld_lock_init_recursive(NAME)
/* Finalize the named lock variable, which must be locked. It cannot be
used again until __libc_lock_init is called again on it. This must be
@@ -129,12 +129,12 @@
typedef int __libc_key_t;
/* Create key for thread specific data. */
-#define __libc_key_create(KEY,DEST) -1
+#define __libc_key_create(KEY,DEST) ((void) (KEY), (void) (DEST), -1)
/* Set thread-specific data associated with KEY to VAL. */
-#define __libc_setspecific(KEY,VAL) ((void)0)
+#define __libc_setspecific(KEY,VAL) ((void) (KEY), (void) (VAL))
/* Get thread-specific data associated with KEY. */
-#define __libc_getspecific(KEY) 0
+#define __libc_getspecific(KEY) ((void) (KEY), (void *) 0)
#endif /* bits/libc-lock.h */
diff --git a/bits/param.h b/bits/param.h
new file mode 100644
index 0000000000..8a2bc71de6
--- /dev/null
+++ b/bits/param.h
@@ -0,0 +1,33 @@
+/* Old-style Unix parameters and limits. Stub version.
+ Copyright (C) 1995-2012 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_PARAM_H
+# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
+#endif
+
+/* This header is expected to define a few particular macros.
+
+ The traditional BSD macros that correspond directly to POSIX <limits.h>
+ macros don't need to be defined here if <bits/local_lim.h> defines the
+ POSIX limit macro, as the common <sys/param.h> code will define each
+ traditional name to its POSIX name if available.
+
+ This file should define at least:
+
+ EXEC_PAGESIZE
+*/
diff --git a/bits/signum.h b/bits/signum.h
index 48bb7b8050..0a0acb23af 100644
--- a/bits/signum.h
+++ b/bits/signum.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 1993, 1996, 1998 Free Software Foundation, Inc.
+/* Signal number constants. Generic version.
+ Copyright (C) 1991-2012 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
@@ -27,37 +28,49 @@
# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
#endif
-/* Signals in the 1-15 range are defined with their historical numbers.
- Signals in the 20-25 range are relatively new and have no ingrained
- numbers. */
+/* We define here all the signal names listed in POSIX (1003.1-2008).
+ Signals in the 1-15 range are defined with their historical numbers.
+ For other signals specified by POSIX, we use the BSD numbers. */
-/* ANSI signals. */
-#define SIGINT 2 /* Interactive attention signal. */
-#define SIGILL 4 /* Illegal instruction. */
-#define SIGABRT 6 /* Abnormal termination. */
-#define SIGFPE 8 /* Erroneous arithmetic operation. */
-#define SIGSEGV 11 /* Invalid access to storage. */
-#define SIGTERM 15 /* Termination request. */
+/* ISO C99 signals. */
+#define SIGINT 2 /* Interactive attention signal. */
+#define SIGILL 4 /* Illegal instruction. */
+#define SIGABRT 6 /* Abnormal termination. */
+#define SIGFPE 8 /* Erroneous arithmetic operation. */
+#define SIGSEGV 11 /* Invalid access to storage. */
+#define SIGTERM 15 /* Termination request. */
/* Historical signals specified by POSIX. */
-#define SIGHUP 1 /* Hangup. */
-#define SIGQUIT 3 /* Quit. */
-#define SIGKILL 9 /* Kill (cannot be blocked, caught, or ignored). */
-#define SIGPIPE 13 /* Broken pipe. */
-#define SIGALRM 14 /* Alarm clock. */
-
-/* New(er) POSIX signals. */
-#define SIGSTOP 20 /* Stop (cannot be blocked, caught, or ignored). */
-#define SIGCONT 21 /* Continue. */
-#define SIGTSTP 22 /* Keyboard stop. */
-#define SIGTTIN 23 /* Background read from control terminal. */
-#define SIGTTOU 24 /* Background write to control terminal. */
-#define SIGCHLD 25 /* Child terminated or stopped. */
-
-#define _NSIG 26
+#define SIGHUP 1 /* Hangup. */
+#define SIGQUIT 3 /* Quit. */
+#define SIGTRAP 5 /* Trace/breakpoint trap. */
+#define SIGKILL 9 /* Killed. */
+#define SIGBUS 10 /* Bus error. */
+#define SIGSYS 12 /* Bad system call. */
+#define SIGPIPE 13 /* Broken pipe. */
+#define SIGALRM 14 /* Alarm clock. */
+
+/* New(er) POSIX signals (1003.1-2008). */
+#define SIGURG 16 /* High bandwidth data is available at a socket. */
+#define SIGSTOP 17 /* Stopped (signal). */
+#define SIGTSTP 18 /* Stopped. */
+#define SIGCONT 19 /* Continued. */
+#define SIGCHLD 20 /* Child terminated or stopped. */
+#define SIGTTIN 21 /* Background read from control terminal. */
+#define SIGTTOU 22 /* Background write to control terminal. */
+#define SIGPOLL 23 /* Pollable event occurred (System V). */
+#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
+#define SIGXCPU 24 /* CPU time limit exceeded. */
+#define SIGXFSZ 25 /* File size limit exceeded. */
+#define SIGVTALRM 26 /* Virtual timer expired. */
+#define SIGPROF 27 /* Profiling timer expired. */
+#define SIGUSR1 30 /* User-defined signal 1. */
+#define SIGUSR2 31 /* User-defined signal 2. */
+
+#define _NSIG 32
/* Archaic names for compatibility. */
-#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP11 */
-#define SIGCLD SIGCHLD /* Old System V name */
+#define SIGIOT SIGABRT /* IOT instruction, abort() on a PDP11 */
+#define SIGCLD SIGCHLD /* Old System V name */
#endif /* <signal.h> included. */
diff --git a/bits/stat.h b/bits/stat.h
index 06b4816c81..b9495c52e2 100644
--- a/bits/stat.h
+++ b/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -15,10 +15,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* This structure needs to be defined in accordance with the
implementation of __stat, __fstat, and __lstat. */
@@ -96,3 +99,5 @@ struct stat64
__time_t st_ctime; /* Time of last status change. */
};
#endif
+
+#endif /* bits/stat.h */
diff --git a/bits/types.h b/bits/types.h
index 041ace6316..51ef89b7a4 100644
--- a/bits/types.h
+++ b/bits/types.h
@@ -150,7 +150,6 @@ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
-__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
/* Clock ID used in clock and timer functions. */
diff --git a/bits/typesizes.h b/bits/typesizes.h
index 3fd4a2e067..ac18c8199e 100644
--- a/bits/typesizes.h
+++ b/bits/typesizes.h
@@ -51,7 +51,6 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
-#define __SWBLK_T_TYPE __SLONGWORD_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
#define __TIMER_T_TYPE void *
@@ -61,6 +60,16 @@
#define __SYSCALL_SLONG_TYPE __SLONGWORD_TYPE
#define __SYSCALL_ULONG_TYPE __ULONGWORD_TYPE
+#ifdef __LP64__
+/* Tell the libc code that off_t and off64_t are actually the same type
+ for all ABI purposes, even if possibly expressed as different base types
+ for C type-checking purposes. */
+# define __OFF_T_MATCHES_OFF64_T 1
+
+/* Same for ino_t and ino64_t. */
+# define __INO_T_MATCHES_INO64_T 1
+#endif
+
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024