Module Name:    src
Committed By:   dholland
Date:           Thu Jun 30 15:29:20 UTC 2016

Modified Files:
        src/include: unistd.h
        src/lib/libc/sys: fdiscard.2 posix_fallocate.c
        src/sys/sys: fcntl.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/include/unistd.h
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/sys/fdiscard.2
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/sys/posix_fallocate.c
cvs rdiff -u -r1.46 -r1.47 src/sys/sys/fcntl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/unistd.h
diff -u src/include/unistd.h:1.146 src/include/unistd.h:1.147
--- src/include/unistd.h:1.146	Sat Jun 18 14:39:15 2016
+++ src/include/unistd.h	Thu Jun 30 15:29:20 2016
@@ -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 @@ ssize_t	 readlink(const char * __restric
  */
 #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

Index: src/lib/libc/sys/fdiscard.2
diff -u src/lib/libc/sys/fdiscard.2:1.3 src/lib/libc/sys/fdiscard.2:1.4
--- src/lib/libc/sys/fdiscard.2:1.3	Sun Feb  1 15:24:15 2015
+++ src/lib/libc/sys/fdiscard.2	Thu Jun 30 15:29:20 2016
@@ -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

Index: src/lib/libc/sys/posix_fallocate.c
diff -u src/lib/libc/sys/posix_fallocate.c:1.1 src/lib/libc/sys/posix_fallocate.c:1.2
--- src/lib/libc/sys/posix_fallocate.c:1.1	Thu Sep 25 15:08:29 2014
+++ src/lib/libc/sys/posix_fallocate.c	Thu Jun 30 15:29:20 2016
@@ -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);
 

Index: src/sys/sys/fcntl.h
diff -u src/sys/sys/fcntl.h:1.46 src/sys/sys/fcntl.h:1.47
--- src/sys/sys/fcntl.h:1.46	Sun Sep 15 10:41:20 2013
+++ src/sys/sys/fcntl.h	Thu Jun 30 15:29:20 2016
@@ -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	flock(int, int);
 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 */
 

Reply via email to