Source-Changes-HG archive

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

[src/trunk]: src PR 51287 Ralf Nolden: posix_fallocate belongs in <fcntl.h>



details:   https://anonhg.NetBSD.org/src/rev/e7840e824471
branches:  trunk
changeset: 346187:e7840e824471
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Jun 30 15:29:20 2016 +0000

description:
PR 51287 Ralf Nolden: posix_fallocate belongs in <fcntl.h>

diffstat:

 include/unistd.h               |   3 +--
 lib/libc/sys/fdiscard.2        |   5 +++--
 lib/libc/sys/posix_fallocate.c |   6 +++---
 sys/sys/fcntl.h                |  11 ++++++++++-
 4 files changed, 17 insertions(+), 8 deletions(-)

diffs (93 lines):

diff -r a458a8a89d6e -r e7840e824471 include/unistd.h
--- a/include/unistd.h  Thu Jun 30 13:17:48 2016 +0000
+++ b/include/unistd.h  Thu Jun 30 15:29:20 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unistd.h,v 1.146 2016/06/18 14:39:15 kamil Exp $       */
+/*     $NetBSD: unistd.h,v 1.147 2016/06/30 15:29:20 dholland Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -173,7 +173,6 @@
  */
 #if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
     defined(_NETBSD_SOURCE)
-int     posix_fallocate(int, off_t, off_t);
 int     setegid(gid_t);
 int     seteuid(uid_t);
 #endif
diff -r a458a8a89d6e -r e7840e824471 lib/libc/sys/fdiscard.2
--- a/lib/libc/sys/fdiscard.2   Thu Jun 30 13:17:48 2016 +0000
+++ b/lib/libc/sys/fdiscard.2   Thu Jun 30 15:29:20 2016 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: fdiscard.2,v 1.3 2015/02/01 15:24:15 christos Exp $
+.\"    $NetBSD: fdiscard.2,v 1.4 2016/06/30 15:29:20 dholland Exp $
 .\"
 .\" Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -37,9 +37,10 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In unistd.h
+.In fcntl.h
 .Ft int
 .Fn posix_fallocate "int fd" "off_t pos" "off_t length"
+.In unistd.h
 .Ft int
 .Fn fdiscard "int fd" "off_t pos" "off_t length"
 .Sh DESCRIPTION
diff -r a458a8a89d6e -r e7840e824471 lib/libc/sys/posix_fallocate.c
--- a/lib/libc/sys/posix_fallocate.c    Thu Jun 30 13:17:48 2016 +0000
+++ b/lib/libc/sys/posix_fallocate.c    Thu Jun 30 15:29:20 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: posix_fallocate.c,v 1.1 2014/09/25 15:08:29 manu Exp $ */
+/*     $NetBSD: posix_fallocate.c,v 1.2 2016/06/30 15:29:20 dholland Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.      
@@ -33,12 +33,12 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: posix_fallocate.c,v 1.1 2014/09/25 15:08:29 manu Exp $");
+__RCSID("$NetBSD: posix_fallocate.c,v 1.2 2016/06/30 15:29:20 dholland Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #include <sys/syscall.h>
-#include <unistd.h>
+#include <fcntl.h>
 
 int __posix_fallocate(int, int, off_t, off_t);
 
diff -r a458a8a89d6e -r e7840e824471 sys/sys/fcntl.h
--- a/sys/sys/fcntl.h   Thu Jun 30 13:17:48 2016 +0000
+++ b/sys/sys/fcntl.h   Thu Jun 30 15:29:20 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fcntl.h,v 1.46 2013/09/15 10:41:20 njoly Exp $ */
+/*     $NetBSD: fcntl.h,v 1.47 2016/06/30 15:29:20 dholland Exp $      */
 
 /*-
  * Copyright (c) 1983, 1990, 1993
@@ -313,12 +313,21 @@
 int    posix_fadvise(int, off_t, off_t, int);
 
 /*
+ * The Open Group Base Specifications, Issue 6; IEEE Std 1003.1-2001 (POSIX)
+ */
+#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
+    defined(_NETBSD_SOURCE)
+int     posix_fallocate(int, off_t, off_t);
+#endif
+
+/*
  * X/Open Extended API set 2 (a.k.a. C063)
  */
 #if (_POSIX_C_SOURCE - 0) >= 200809L || (_XOPEN_SOURCE - 0 >= 700) || \
     defined(_INCOMPLETE_XOPEN_C063) || defined(_NETBSD_SOURCE)
 int    openat(int, const char *, int, ...);
 #endif
+
 __END_DECLS
 #endif /* !_KERNEL */
 



Home | Main Index | Thread Index | Old Index