Module Name:    src
Committed By:   manu
Date:           Thu Sep 25 15:08:29 UTC 2014

Modified Files:
        src/lib/libc/include: namespace.h
        src/lib/libc/sys: Makefile.inc
Added Files:
        src/lib/libc/sys: fdiscard.c posix_fallocate.c

Log Message:
Fix argument paddiing for posix_fallocate and fdiscard with gcc 1.x


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.224 -r1.225 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/fdiscard.c \
    src/lib/libc/sys/posix_fallocate.c

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

Modified files:

Index: src/lib/libc/include/namespace.h
diff -u src/lib/libc/include/namespace.h:1.174 src/lib/libc/include/namespace.h:1.175
--- src/lib/libc/include/namespace.h:1.174	Fri Jun 13 15:45:05 2014
+++ src/lib/libc/include/namespace.h	Thu Sep 25 15:08:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: namespace.h,v 1.174 2014/06/13 15:45:05 joerg Exp $	*/
+/*	$NetBSD: namespace.h,v 1.175 2014/09/25 15:08:29 manu Exp $	*/
 
 /*-
  * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -281,6 +281,7 @@
 #define execv			_execv
 #define execvp			_execvp
 #define explicit_memset		_explicit_memset
+#define fdiscard		_fdiscard
 #define fdopen			_fdopen
 #define fgetln			_fgetln
 #define fgetwln			_fgetwln
@@ -520,6 +521,7 @@
 #define pread			_pread
 #define printf_l		_printf_l
 #define pselect			_pselect
+#define posix_fallocate		_posix_fallocate
 #define psignal			_psignal
 #define pthread_atfork		_pthread_atfork
 #define ptree_init		ptree_init

Index: src/lib/libc/sys/Makefile.inc
diff -u src/lib/libc/sys/Makefile.inc:1.224 src/lib/libc/sys/Makefile.inc:1.225
--- src/lib/libc/sys/Makefile.inc:1.224	Fri Jul 25 08:30:47 2014
+++ src/lib/libc/sys/Makefile.inc	Thu Sep 25 15:08:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.224 2014/07/25 08:30:47 dholland Exp $
+#	$NetBSD: Makefile.inc,v 1.225 2014/09/25 15:08:29 manu Exp $
 #	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -30,8 +30,9 @@ SRCS+=	posix_fadvise.c posix_madvise.c s
 
 # glue to provide compatibility between GCC 1.X and 2.X and for compat
 # with old syscall interfaces.
-GLUE+= ftruncate.c lseek.c mmap.c pread.c preadv.c pwrite.c \
-	pwritev.c truncate.c ntp_adjtime.c mknodat.c
+GLUE+= fdiscard.c ftruncate.c lseek.c mmap.c posix_fallocate.c \
+	pread.c preadv.c pwrite.c pwritev.c truncate.c ntp_adjtime.c \
+	mknodat.c
 
 GLUE50+= adjtime.c clock_settime.c settimeofday.c
 
@@ -147,11 +148,11 @@ ASM_MD=	_lwp_getprivate.S mremap.S 
 .endfor
 
 WEAKASM= accept.S __aio_suspend50.S close.S connect.S execve.S \
-	fcntl.S fdatasync.S fdiscard.S fsync.S \
+	fcntl.S fdatasync.S fsync.S \
 	fsync_range.S __kevent50.S \
 	kill.S mq_receive.S mq_send.S __mq_timedreceive50.S __mq_timedsend50.S \
 	msgrcv.S msgsnd.S __msync13.S  __nanosleep50.S open.S poll.S \
-	__pollts50.S posix_fallocate.S __pselect50.S read.S readlink.S \
+	__pollts50.S __pselect50.S read.S readlink.S \
 	readv.S _sched_setparam.S _sched_getparam.S _sched_setaffinity.S \
 	_sched_getaffinity.S sched_yield.S \
 	__select50.S setcontext.S __sigprocmask14.S __sigsuspend14.S sysarch.S \

Added files:

Index: src/lib/libc/sys/fdiscard.c
diff -u /dev/null src/lib/libc/sys/fdiscard.c:1.1
--- /dev/null	Thu Sep 25 15:08:29 2014
+++ src/lib/libc/sys/fdiscard.c	Thu Sep 25 15:08:29 2014
@@ -0,0 +1,52 @@
+/*	$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $ */
+
+/*
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.      
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+int __fdiscard(int, int, off_t, off_t);
+
+/*
+ * 64-bit offset padding required for gcc 1.x
+ */
+int
+fdiscard(int fd, off_t off, off_t len)
+{
+	return __fdiscard(fd, 0, off, len);
+}
Index: src/lib/libc/sys/posix_fallocate.c
diff -u /dev/null src/lib/libc/sys/posix_fallocate.c:1.1
--- /dev/null	Thu Sep 25 15:08:29 2014
+++ src/lib/libc/sys/posix_fallocate.c	Thu Sep 25 15:08:29 2014
@@ -0,0 +1,52 @@
+/*	$NetBSD: posix_fallocate.c,v 1.1 2014/09/25 15:08:29 manu Exp $ */
+
+/*
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.      
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#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 $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+int __posix_fallocate(int, int, off_t, off_t);
+
+/*
+ * 64-bit offset padding required for gcc 1.x
+ */
+int
+posix_fallocate(int fd, off_t off, off_t len)
+{
+	return __posix_fallocate(fd, 0, off, len);
+}

Reply via email to