This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fcntl.h should provide mode_t, off_t and pid_t


Hello,

the Single Unix specification says that <fcntl.h> should provide
definitions for mode_t, off_t and pid_t.  The attached patched makes it
do so if not already.

Samuel

2008-07-13  Samuel Thibault  <samuel.thibault@ens-lyon.org>

	* io/fcntl.h: Define mode_t, off_t and pid_t if not already done.

Index: io/fcntl.h
===================================================================
RCS file: /cvs/glibc/libc/io/fcntl.h,v
retrieving revision 1.43
diff -u -p -r1.43 fcntl.h
--- io/fcntl.h	15 Sep 2007 22:34:56 -0000	1.43
+++ io/fcntl.h	13 Jul 2008 01:21:51 -0000
@@ -33,6 +33,29 @@ __BEGIN_DECLS
    numbers and flag bits for `open', `fcntl', et al.  */
 #include <bits/fcntl.h>
 
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+   available here.  */
+# ifndef __mode_t_defined
+typedef __mode_t mode_t;
+#  define __mode_t_defined
+# endif
+
+# ifndef __off_t_defined
+#  ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+#  else
+typedef __off64_t off_t;
+#  endif
+#  define __off_t_defined
+# endif
+
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+#  define __pid_t_defined
+# endif
+#endif	/* X/Open */
+
 /* For XPG all symbols from <sys/stat.h> should also be available.  */
 #ifdef __USE_XOPEN
 # include <sys/stat.h>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]