Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: language lawyering: ftello/fseek/pread edition



On Mon, Mar 23, 2015 at 10:05:22PM +0000, Christos Zoulas wrote:
> In article <20150323162935.GA20639%netbsd.org@localhost>,
> David Holland  <dholland-current%netbsd.org@localhost> wrote:
> >On Mon, Mar 23, 2015 at 04:55:52PM +0100, Thomas Klausner wrote:
> > > Thanks. So if it survives a build, can I commit the attached patch?
> >
> >I question the merits of _LARGEFILE_SOURCE (are we going to start
> >mucking with _FILE_OFFSET_BITS too?) but whatever.
> 
> There is no need for _LARGEFILE_SOURCE here, please remove it.

New version attached.
 Thomas
Index: stdio.h
===================================================================
RCS file: /cvsroot/src/include/stdio.h,v
retrieving revision 1.95
diff -u -r1.95 stdio.h
--- stdio.h	5 Mar 2015 03:29:02 -0000	1.95
+++ stdio.h	23 Mar 2015 22:18:10 -0000
@@ -370,7 +370,7 @@
 /*
  * X/Open CAE Specification Issue 5 Version 2
  */
-#if (_XOPEN_SOURCE - 0) >= 500 || defined(_LARGEFILE_SOURCE) || \
+#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
     defined(_NETBSD_SOURCE)
 #ifndef	off_t
 typedef	__off_t		off_t;
@@ -381,7 +381,7 @@
 int	 fseeko(FILE *, off_t, int);
 off_t	 ftello(FILE *);
 __END_DECLS
-#endif /* _XOPEN_SOURCE >= 500 || _LARGEFILE_SOURCE || _NETBSD_SOURCE */
+#endif /* (_POSIX_C_SOURCE - 0) >= 200112L || _XOPEN_SOURCE >= 500 || ... */
 
 /*
  * Functions defined in ISO C99.  Still put under _NETBSD_SOURCE due to
Index: unistd.h
===================================================================
RCS file: /cvsroot/src/include/unistd.h,v
retrieving revision 1.144
diff -u -r1.144 unistd.h
--- unistd.h	22 Feb 2015 00:54:46 -0000	1.144
+++ unistd.h	23 Mar 2015 22:18:10 -0000
@@ -294,10 +294,11 @@
 /*
  * X/Open CAE Specification Issue 5 Version 2
  */
-#if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
+#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 500 || \
+    defined(_NETBSD_SOURCE)
 ssize_t	 pread(int, void *, size_t, off_t);
 ssize_t	 pwrite(int, const void *, size_t, off_t);
-#endif
+#endif /* (_POSIX_C_SOURCE - 0) >= 200112L || ... */
 
 /*
  * X/Open Extended API set 2 (a.k.a. C063)


Home | Main Index | Thread Index | Old Index