about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/bits')
-rw-r--r--sysdeps/mach/hurd/bits/fcntl.h76
-rw-r--r--sysdeps/mach/hurd/bits/stat.h64
2 files changed, 107 insertions, 33 deletions
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index c3d187ae0e..102c2a574f 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/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
 
 /* File access modes.  These are understood by io servers; they can be
@@ -29,10 +29,10 @@
 
 /* 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_EXEC		0x0004	/* Open for execution.  */
-#define O_NORW		0	/* Open without R/W access.  */
+# define O_READ		O_RDONLY /* Open for reading.  */
+# define O_WRITE	O_WRONLY /* Open for writing.  */
+# define O_EXEC		0x0004	/* Open for execution.  */
+# define O_NORW		0	/* Open without R/W access.  */
 #endif
 /* POSIX.1 standard names.  */
 #define	O_RDONLY	0x0001	/* Open read-only.  */
@@ -49,8 +49,8 @@
 #define	O_CREAT		0x0010	/* Create file if it doesn't exist.  */
 #define	O_EXCL		0x0020	/* Fail if file already exists.  */
 #ifdef __USE_GNU
-#define	O_NOLINK	0x0040	/* No name mappings on final component.  */
-#define	O_NOTRANS	0x0080	/* No translator on final component. */
+# define O_NOLINK	0x0040	/* No name mappings on final component.  */
+# define O_NOTRANS	0x0080	/* No translator on final component. */
 #endif
 
 
@@ -62,16 +62,16 @@
 
 #define	O_APPEND	0x0100	/* Writes always append to the file.  */
 #ifdef __USE_BSD
-#define	O_ASYNC		0x0200	/* Send SIGIO to owner when data is ready.  */
-#define	O_FSYNC		0x0400	/* Synchronous writes.  */
-#define	O_SYNC		O_FSYNC
+# define O_ASYNC	0x0200	/* Send SIGIO to owner when data is ready.  */
+# define O_FSYNC	0x0400	/* Synchronous writes.  */
+# define O_SYNC		O_FSYNC
 #endif
 #ifdef __USE_GNU
-#define	O_NOATIME	0x0800	/* Don't set access time on read (owner).  */
+# define O_NOATIME	0x0800	/* Don't set access time on read (owner).  */
 #endif
 #ifdef	__USE_MISC
-#define	O_SHLOCK	0x00020000 /* Open with shared file lock.  */
-#define	O_EXLOCK	0x00040000 /* Open with exclusive file lock.  */
+# define O_SHLOCK	0x00020000 /* Open with shared file lock.  */
+# define O_EXLOCK	0x00040000 /* Open with exclusive file lock.  */
 #endif
 
 
@@ -92,13 +92,13 @@
 
 #define	O_NONBLOCK	0x0008	/* Non-blocking open or non-blocking I/O.  */
 #ifdef __USE_BSD
-#define	O_NDELAY	O_NONBLOCK /* Deprecated.  */
+# define O_NDELAY	O_NONBLOCK /* Deprecated.  */
 #endif
 
 
 #ifdef __USE_GNU
 /* Mask of bits which are understood by io servers.  */
-#define O_HURD		(0xffff | O_EXLOCK | O_SHLOCK)
+# define O_HURD		(0xffff | O_EXLOCK | O_SHLOCK)
 #endif
 
 
@@ -113,7 +113,7 @@
    and are not preserved once the file has been opened.  */
 
 #ifdef __USE_GNU
-#define	O_IGNORE_CTTY	0x00080000 /* Don't do any ctty magic at all.  */
+# define O_IGNORE_CTTY	0x00080000 /* Don't do any ctty magic at all.  */
 #endif
 /* `open' never assigns a controlling terminal in GNU.  */
 #define	O_NOCTTY	0	/* Don't assign a controlling terminal.  */
@@ -121,20 +121,20 @@
 
 #ifdef __USE_BSD
 /* Bits in the file status flags returned by F_GETFL.  */
-#define FREAD		O_RDONLY
-#define	FWRITE		O_WRONLY
+# define FREAD		O_RDONLY
+# define FWRITE		O_WRONLY
 
 /* Traditional BSD names the O_* bits.  */
-#define FASYNC		O_ASYNC
-#define FCREAT		O_CREAT
-#define FEXCL		O_EXCL
-#define FTRUNC		O_TRUNC
-#define FNOCTTY		O_NOCTTY
-#define FFSYNC		O_FSYNC
-#define FSYNC		O_SYNC
-#define FAPPEND		O_APPEND
-#define FNONBLOCK	O_NONBLOCK
-#define FNDELAY		O_NDELAY
+# define FASYNC		O_ASYNC
+# define FCREAT		O_CREAT
+# define FEXCL		O_EXCL
+# define FTRUNC		O_TRUNC
+# define FNOCTTY	O_NOCTTY
+# define FFSYNC		O_FSYNC
+# define FSYNC		O_SYNC
+# define FAPPEND	O_APPEND
+# define FNONBLOCK	O_NONBLOCK
+# define FNDELAY	O_NDELAY
 #endif
 
 
@@ -145,8 +145,8 @@
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
 #ifdef __USE_BSD
-#define	F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
-#define	F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
+# 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 (non-blocking).  */
@@ -164,10 +164,26 @@ struct flock
   {
     int l_type;		/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
     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
+  {
+    int l_type;		/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    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
 
 /* Values for the `l_type' field of a `struct flock'.  */
 #define	F_RDLCK	1	/* Read lock.  */
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 2110a73aae..4679c589ee 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -39,7 +39,11 @@ struct stat
     __fsid_t st_fsid;		/* File system ID.  */
 #define	st_dev	st_fsid
 
+#ifndef __USE_FILE_OFFSET64
     __ino_t st_ino;		/* File number.  */
+#else
+    __ino64_t st_ino;		/* File number.  */
+#endif
     unsigned int st_gen;	/* To detect reuse of file numbers.  */
     __dev_t st_rdev;		/* Device if special file.  */
     __mode_t st_mode;		/* File mode.  */
@@ -48,7 +52,11 @@ struct stat
     __uid_t st_uid;		/* Owner.  */
     __gid_t st_gid;		/* Owning group.  */
 
+#ifndef __USE_FILE_OFFSET64
     __off_t st_size;		/* Size in bytes.  */
+#else
+    __off64_t st_size;		/* Size in bytes.  */
+#endif
 
     __time_t st_atime;		/* Access time, seconds */
     unsigned long int st_atime_usec; /* and microseconds.  */
@@ -59,9 +67,56 @@ struct stat
 
     unsigned int st_blksize;	/* Optimal size for I/O.  */
 
-#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.
+				   Not related to `st_blksize'.  */
+#else
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.
+				   Not related to `st_blksize'.  */
+#endif
+
+    __uid_t st_author;		/* File author.  */
+
+    unsigned int st_flags;	/* User-defined flags.
+				   High 16 bits can be set only by root.  */
 
-    unsigned int st_blocks;	/* Number of 512-byte blocks allocated.
+#ifndef __USE_FILE_OFFSET64
+# define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 12 : 11)
+#else
+# define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 9 : 8)
+#endif
+    int st_spare[_SPARE_SIZE];	/* Room for future expansion.  */
+#undef _SPARE_SIZE
+  };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    int st_fstype;		/* File system type.  */
+    __fsid_t st_fsid;		/* File system ID.  */
+# define st_dev	st_fsid
+
+    __ino64_t st_ino;		/* File number.  */
+    unsigned int st_gen;	/* To detect reuse of file numbers.  */
+    __dev_t st_rdev;		/* Device if special file.  */
+    __mode_t st_mode;		/* File mode.  */
+    __nlink_t st_nlink;		/* Number of links.  */
+
+    __uid_t st_uid;		/* Owner.  */
+    __gid_t st_gid;		/* Owning group.  */
+
+    __off64_t st_size;		/* Size in bytes.  */
+
+    __time_t st_atime;		/* Access time, seconds */
+    unsigned long int st_atime_usec; /* and microseconds.  */
+    __time_t st_mtime;		/* Modification time, seconds */
+    unsigned long int st_mtime_usec; /* and microseconds.  */
+    __time_t st_ctime;		/* Status change time, seconds */
+    unsigned long int st_ctime_usec; /* and microseconds.  */
+
+    unsigned int st_blksize;	/* Optimal size for I/O.  */
+
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.
 				   Not related to `st_blksize'.  */
 
     __uid_t st_author;		/* File author.  */
@@ -69,10 +124,13 @@ struct stat
     unsigned int st_flags;	/* User-defined flags.
 				   High 16 bits can be set only by root.  */
 
-#define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 12 : 11)
+#define _SPARE_SIZE	((sizeof (__fsid_t) == sizeof (int)) ? 9 : 8)
     int st_spare[_SPARE_SIZE];	/* Room for future expansion.  */
 #undef _SPARE_SIZE
   };
+#endif
+
+#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
 
 /* Encoding of the file mode.  */