summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/bits')
-rw-r--r--sysdeps/unix/sysv/linux/bits/dirent.h25
-rw-r--r--sysdeps/unix/sysv/linux/bits/fcntl.h84
-rw-r--r--sysdeps/unix/sysv/linux/bits/resource.h115
-rw-r--r--sysdeps/unix/sysv/linux/bits/stat.h45
-rw-r--r--sysdeps/unix/sysv/linux/bits/statfs.h36
-rw-r--r--sysdeps/unix/sysv/linux/bits/types.h23
6 files changed, 240 insertions, 88 deletions
diff --git a/sysdeps/unix/sysv/linux/bits/dirent.h b/sysdeps/unix/sysv/linux/bits/dirent.h
index ccf5080151..1f8ff1e3d0 100644
--- a/sysdeps/unix/sysv/linux/bits/dirent.h
+++ b/sysdeps/unix/sysv/linux/bits/dirent.h
@@ -16,17 +16,34 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _DIRENTRY_H
-#define _DIRENTRY_H 1
+#ifndef _BITS_DIRENT_H
+#define _BITS_DIRENT_H 1
struct dirent
{
- long int d_ino;
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino;
__off_t d_off;
+#else
+ __ino64_t d_ino;
+ __off64_t d_off;
+#endif
unsigned short int d_reclen;
unsigned char d_type;
char d_name[256]; /* We must not include limits.h! */
};
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+ {
+ __ino64_t d_ino;
+ __off64_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+#endif
+
#define d_fileno d_ino /* Backwards compatibility. */
#undef _DIRENT_HAVE_D_NAMLEN
@@ -34,4 +51,4 @@ struct dirent
#define _DIRENT_HAVE_D_OFF
#define _DIRENT_HAVE_D_TYPE
-#endif /* _DIRENTRY_H */
+#endif /* bits/dirent.h */
diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h
index 62c3052d8c..302fa00498 100644
--- a/sysdeps/unix/sysv/linux/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/bits/fcntl.h
@@ -18,7 +18,7 @@
Boston, MA 02111-1307, USA. */
#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
@@ -27,8 +27,8 @@
/* In GNU, read and write are bits (unlike BSD). */
#ifdef __USE_GNU
-#define O_READ O_RDONLY /* Open for reading. */
-#define O_WRITE O_WRONLY /* Open for writing. */
+# define O_READ O_RDONLY /* Open for reading. */
+# define O_WRITE O_WRONLY /* Open for writing. */
#endif
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
@@ -47,25 +47,36 @@
#define O_FSYNC O_SYNC
#define O_ASYNC 020000
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get f_flags */
-#define F_SETFD 2 /* set f_flags */
-#define F_GETFL 3 /* more flags (cloexec) */
-#define F_SETFL 4
-#define F_GETLK 5
-#define F_SETLK 6
-#define F_SETLKW 7
-
-#define F_SETOWN 8 /* for sockets. */
-#define F_GETOWN 9 /* for sockets. */
+/* XXX missing */
+#define O_LARGEFILE 0
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#define F_GETLK 5 /* Get record locking info. */
+#define F_SETLK 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW 7 /* Set record locking info (blocking). */
+
+/* XXX missing */
+#define F_GETLK64 5 /* Get record locking info. */
+#define F_SETLK64 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 7 /* Set record locking info (blocking). */
+
+#ifdef __USE_BSD
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
-/* for F_[GET|SET]FL */
+/* For F_[GET|SET]FL. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
@@ -80,20 +91,35 @@
struct flock
{
- short int l_type;
- short int l_whence;
- __off_t l_start;
- __off_t l_len;
- __pid_t l_pid;
+ 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'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
};
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ 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'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
-#define FAPPEND O_APPEND
-#define FFSYNC O_FSYNC
-#define FASYNC O_ASYNC
-#define FNONBLOCK O_NONBLOCK
-#define FNDELAY O_NDELAY
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
#endif /* Use BSD. */
diff --git a/sysdeps/unix/sysv/linux/bits/resource.h b/sysdeps/unix/sysv/linux/bits/resource.h
index 05cae83244..9ee6ea5b27 100644
--- a/sysdeps/unix/sysv/linux/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/bits/resource.h
@@ -1,5 +1,5 @@
/* Bit values & structures for resource limits. Linux version.
- Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */
#include <asm/resource.h>
+#include <bits/types.h>
/* Transmute defines to enumerations. The macro re-definitions are
necessary because some programs want to test for operating system
@@ -103,13 +104,33 @@ enum __rlimit_resource
#define RLIM_INFINITY RLIM_INFINITY
};
+/* Type for resource quantity measurement. */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
struct rlimit
-{
- /* The current (soft) limit. */
- long int rlim_cur;
- /* The hard limit. */
- long int rlim_max;
-};
+ {
+ /* The current (soft) limit. */
+ rlim_t rlim_cur;
+ /* The hard limit. */
+ rlim_t rlim_max;
+ };
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+ {
+ /* The current (soft) limit. */
+ rlim64_t rlim_cur;
+ /* The hard limit. */
+ rlim64_t rlim_max;
+ };
+#endif
/* Whose usage statistics do you want? */
enum __rusage_who
@@ -131,46 +152,46 @@ enum __rusage_who
/* Structure which says how much of each resource has been used. */
struct rusage
-{
- /* Total amount of user time used. */
- struct timeval ru_utime;
- /* Total amount of system time used. */
- struct timeval ru_stime;
- /* Maximum resident set size (in kilobytes). */
- long int ru_maxrss;
- /* Amount of sharing of text segment memory
- with other processes (kilobyte-seconds). */
- long int ru_ixrss;
- /* Amount of data segment memory used (kilobyte-seconds). */
- long int ru_idrss;
- /* Amount of stack memory used (kilobyte-seconds). */
- long int ru_isrss;
- /* Number of soft page faults (i.e. those serviced by reclaiming
- a page from the list of pages awaiting reallocation. */
- long int ru_minflt;
- /* Number of hard page faults (i.e. those that required I/O). */
- long int ru_majflt;
- /* Number of times a process was swapped out of physical memory. */
- long int ru_nswap;
- /* Number of input operations via the file system. Note: This
- and `ru_oublock' do not include operations with the cache. */
- long int ru_inblock;
- /* Number of output operations via the file system. */
- long int ru_oublock;
- /* Number of IPC messages sent. */
- long int ru_msgsnd;
- /* Number of IPC messages received. */
- long int ru_msgrcv;
- /* Number of signals delivered. */
- long int ru_nsignals;
- /* Number of voluntary context switches, i.e. because the process
- gave up the process before it had to (usually to wait for some
- resource to be available). */
- long int ru_nvcsw;
- /* Number of involuntary context switches, i.e. a higher priority process
- became runnable or the current process used up its time slice. */
- long int ru_nivcsw;
-};
+ {
+ /* Total amount of user time used. */
+ struct timeval ru_utime;
+ /* Total amount of system time used. */
+ struct timeval ru_stime;
+ /* Maximum resident set size (in kilobytes). */
+ long int ru_maxrss;
+ /* Amount of sharing of text segment memory
+ with other processes (kilobyte-seconds). */
+ long int ru_ixrss;
+ /* Amount of data segment memory used (kilobyte-seconds). */
+ long int ru_idrss;
+ /* Amount of stack memory used (kilobyte-seconds). */
+ long int ru_isrss;
+ /* Number of soft page faults (i.e. those serviced by reclaiming
+ a page from the list of pages awaiting reallocation. */
+ long int ru_minflt;
+ /* Number of hard page faults (i.e. those that required I/O). */
+ long int ru_majflt;
+ /* Number of times a process was swapped out of physical memory. */
+ long int ru_nswap;
+ /* Number of input operations via the file system. Note: This
+ and `ru_oublock' do not include operations with the cache. */
+ long int ru_inblock;
+ /* Number of output operations via the file system. */
+ long int ru_oublock;
+ /* Number of IPC messages sent. */
+ long int ru_msgsnd;
+ /* Number of IPC messages received. */
+ long int ru_msgrcv;
+ /* Number of signals delivered. */
+ long int ru_nsignals;
+ /* Number of voluntary context switches, i.e. because the process
+ gave up the process before it had to (usually to wait for some
+ resource to be available). */
+ long int ru_nvcsw;
+ /* Number of involuntary context switches, i.e. a higher priority process
+ became runnable or the current process used up its time slice. */
+ long int ru_nivcsw;
+ };
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index 1c6e5f84ca..aab025890c 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -39,18 +39,29 @@ struct stat
{
__dev_t st_dev; /* Device. */
unsigned short int __pad1;
+#ifndef __USE_FILE_OFFSET64
__ino_t st_ino; /* File serial number. */
+#else
+ __ino64_t st_ino; /* File serial number. */
+#endif
__mode_t st_mode; /* File mode. */
__nlink_t st_nlink; /* Link count. */
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group.*/
__dev_t st_rdev; /* Device number, if device. */
unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
+#else
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
unsigned long int st_blksize; /* Optimal block size for I/O. */
-#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
- unsigned long int st_blocks; /* Number of 512-byte blocks allocated. */
+#ifndef __USE_FILE_OFFSET64
+ __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
+#else
+ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+#endif
__time_t st_atime; /* Time of last access. */
unsigned long int __unused1;
__time_t st_mtime; /* Time of last modification. */
@@ -61,6 +72,36 @@ struct stat
unsigned long int __unused5;
};
+#ifdef __USE_LARGEFILE64
+struct stat64
+ {
+ __dev_t st_dev; /* Device. */
+ unsigned short int __pad1;
+
+ __ino64_t st_ino; /* File serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+ unsigned short int __pad2;
+ __off64_t st_size; /* Size of file, in bytes. */
+ unsigned long int st_blksize; /* Optimal block size for I/O. */
+
+ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int __unused1;
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int __unused2;
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+#endif
+
+#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
+
/* Encoding of the file mode. */
#define __S_IFMT 0170000 /* These bits determine file type. */
diff --git a/sysdeps/unix/sysv/linux/bits/statfs.h b/sysdeps/unix/sysv/linux/bits/statfs.h
index 8b9501423c..c79c80e84c 100644
--- a/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -23,20 +23,44 @@
#ifndef _BITS_STATFS_H
#define _BITS_STATFS_H
-#include <bits/types.h> /* for __fsid_t */
+#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/
struct statfs
{
int f_type;
int f_bsize;
- int f_blocks;
- int f_bfree;
- int f_bavail;
- int f_files;
- int f_ffree;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsblkcnt_t f_files;
+ __fsblkcnt_t f_ffree;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsblkcnt64_t f_files;
+ __fsblkcnt64_t f_ffree;
+#endif
__fsid_t f_fsid;
int f_namelen;
int f_spare[6];
};
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ int f_type;
+ int f_bsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsblkcnt64_t f_files;
+ __fsblkcnt64_t f_ffree;
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+#endif
+
#endif /* bits/statfs.h */
diff --git a/sysdeps/unix/sysv/linux/bits/types.h b/sysdeps/unix/sysv/linux/bits/types.h
index 34f4682b3c..daa94336de 100644
--- a/sysdeps/unix/sysv/linux/bits/types.h
+++ b/sysdeps/unix/sysv/linux/bits/types.h
@@ -65,6 +65,8 @@ typedef long int __off_t; /* Type of file sizes and offsets. */
typedef __quad_t __loff_t; /* Type of file sizes and offsets. */
typedef int __pid_t; /* Type of process identifications. */
typedef int __ssize_t; /* Type of a byte count, or error. */
+typedef long int __rlim_t; /* Type of resource counts. */
+typedef __quad_t __rlim64_t; /* Type of resource counts (LFS). */
typedef struct
{
@@ -100,4 +102,25 @@ typedef struct
typedef int __key_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number os disk blocks. */
+typedef __u_long __blkcnt_t;
+typedef __u_quad_t __blkcnt64_t;
+
+/* Type to count file system blocks. */
+typedef long int __fsblkcnt_t;
+typedef __quad_t __fsblkcnt64_t;
+
+/* Type to count file system inodes. */
+typedef __u_long __fsfilcnt_t;
+typedef __u_quad_t __fsfilcnt64_t;
+
+/* Type of file serial numbers. */
+typedef __u_long __ino64_t;
+
+/* Type of file sizes and offsets. */
+typedef __loff_t __off64_t;
+
#endif /* bits/types.h */