about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/bits')
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/fcntl.h94
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h51
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/statfs.h40
3 files changed, 146 insertions, 39 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
index 2586140fdc..09d6fb6d4c 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/mips/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
 
 #include <sys/types.h>
@@ -26,8 +26,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_NDELAY	O_NONBLOCK
 
-#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		14
-#define F_SETLK		6
-#define F_SETLKW	7
-
-#define F_SETOWN	24	/*  for sockets. */
-#define F_GETOWN	23	/*  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		14	/* 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	14	/* 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	5	/* Get owner of socket (receiver of SIGIO).  */
+# define F_GETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
+#endif
 
 /* 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 */
@@ -78,23 +89,42 @@
 				   blocking */
 #define LOCK_UN		8	/* remove lock */
 
-typedef struct flock {
-	short l_type;
-	short l_whence;
-	__off_t l_start;
-	__off_t l_len;
-	long  l_sysid;			/* XXX */
-	__pid_t l_pid;
-	long  pad[4];			/* XXX */
-} flock_t;
+typedef struct flock
+  {
+    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
+    long int l_sysid;	/* XXX */
+    __pid_t l_pid;	/* Process holding the lock.  */
+    long int pad[4];	/* XXX */
+  } flock_t;
+
+#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.  */
+    long int l_sysid;	/* XXX */
+    __pid_t l_pid;	/* Process holding the lock.  */
+    long int pad[4];	/* XXX */
+  };
+#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/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
index a797b34c38..f27a75eb9a 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -39,14 +39,22 @@ struct stat
   {
     unsigned long int st_dev;
     long int st_pad1[3];
+#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.*/
     unsigned long int st_rdev;	/* Device number, if device.  */
     long int st_pad2[2];
+#ifndef __USE_FILE_OFFSET64
     __off_t st_size;		/* Size of file, in bytes.  */
+#else
+    __off64_t st_size;		/* Size of file, in bytes.  */
+#endif
     /* SVR4 added this extra long to allow for expansion of off_t.  */
     long int st_pad3;
     /*
@@ -60,8 +68,11 @@ struct stat
     __time_t st_ctime;		/* Time of last status change.  */
     long int __reserved2;
     long int st_blksize;	/* Optimal block size for I/O.  */
-#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
-    long int st_blocks;		/* Number of 512-byte blocks allocated.  */
+#ifndef __USE_FILE_OFFSET64
+    __blkcnt_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+#else
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+#endif
     char st_fstype[16];		/* Filesystem type name */
     long int st_pad4[8];
     /* Linux specific fields */
@@ -69,6 +80,42 @@ struct stat
     unsigned int st_gen;
   };
 
+#ifdef __USE_LARGEFILE64
+struct stat64
+  {
+    unsigned long int st_dev;
+    long int st_pad1[3];
+    __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.*/
+    unsigned long int st_rdev;	/* Device number, if device.  */
+    long int st_pad2[2];
+    __off64_t st_size;		/* Size of file, in bytes.  */
+    /* SVR4 added this extra long to allow for expansion of off_t.  */
+    long int st_pad3;
+    /*
+     * Actually this should be timestruc_t st_atime, st_mtime and
+     * st_ctime but we don't have it under Linux.
+     */
+    __time_t st_atime;		/* Time of last access.  */
+    long int __reserved0;
+    __time_t st_mtime;		/* Time of last modification.  */
+    long int __reserved1;
+    __time_t st_ctime;		/* Time of last status change.  */
+    long int __reserved2;
+    long int st_blksize;	/* Optimal block size for I/O.  */
+    __blkcnt64_t st_blocks;	/* Number of 512-byte blocks allocated.  */
+    char st_fstype[16];		/* Filesystem type name */
+    long int st_pad4[8];
+    /* Linux specific fields */
+    unsigned int st_flags;
+    unsigned int st_gen;
+  };
+#endif
+
+#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
 
 /* Encoding of the file mode.  */
 
diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
index 3b2306147c..2727b27257 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
@@ -23,22 +23,52 @@
 #ifndef _BITS_STATFS_H
 #define _BITS_STATFS_H
 
+#include <bits/types.h>  /* for __fsid_t and __fsblkcnt_t*/
+
 struct statfs
   {
     long int f_type;
 #define f_fstyp f_type
     long int f_bsize;
     long int f_frsize;	/* Fragment size - unsupported */
-    long int f_blocks;
-    long int f_bfree;
-    long int f_files;
-    long int f_ffree;
+#ifndef __USE_FILE_OFFSET64
+    __fsblkcnt_t f_blocks;
+    __fsblkcnt_t f_bfree;
+    __fsblkcnt_t f_files;
+    __fsblkcnt_t f_ffree;
+    __fsblkcnt_t f_bavail;
+#else
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_files;
+    __fsblkcnt64_t f_ffree;
+    __fsblkcnt64_t f_bavail;
+#endif
+
+	/* Linux specials */
+    __fsid_t f_fsid;
+    long int f_namelen;
+    long int f_spare[6];
+  };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+  {
+    long int f_type;
+#define f_fstyp f_type
+    long int f_bsize;
+    long int f_frsize;	/* Fragment size - unsupported */
+    __fsblkcnt64_t f_blocks;
+    __fsblkcnt64_t f_bfree;
+    __fsblkcnt64_t f_files;
+    __fsblkcnt64_t f_ffree;
+    __fsblkcnt64_t f_bavail;
 
 	/* Linux specials */
-    long int f_bavail;
     __fsid_t f_fsid;
     long int f_namelen;
     long int f_spare[6];
   };
+#endif
 
 #endif	/* bits/statfs.h */