Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux Fix fadvise64 syscalls to use 64bit offset ...
details: https://anonhg.NetBSD.org/src/rev/77471b06c940
branches: trunk
changeset: 329264:77471b06c940
user: njoly <njoly%NetBSD.org@localhost>
date: Sat May 17 09:23:51 2014 +0000
description:
Fix fadvise64 syscalls to use 64bit offset types.
diffstat:
sys/compat/linux/arch/alpha/syscalls.master | 6 +++---
sys/compat/linux/arch/amd64/syscalls.master | 6 +++---
sys/compat/linux/arch/arm/syscalls.master | 6 +++---
sys/compat/linux/arch/i386/syscalls.master | 10 +++++-----
sys/compat/linux/arch/m68k/syscalls.master | 10 +++++-----
sys/compat/linux/arch/mips/syscalls.master | 6 +++---
sys/compat/linux/arch/powerpc/syscalls.master | 10 +++++-----
sys/compat/linux/common/linux_fadvise64.c | 15 +++++----------
8 files changed, 32 insertions(+), 37 deletions(-)
diffs (211 lines):
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.86 2014/05/06 17:33:35 njoly Exp $
+ $NetBSD: syscalls.master,v 1.87 2014/05/17 09:23:51 njoly Exp $
;
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -657,8 +657,8 @@
410 UNIMPL remap_file_pages
411 STD { int|linux_sys||set_tid_address(int *tid); }
412 UNIMPL restart_syscall
-413 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+413 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
414 UNIMPL timer_create
415 UNIMPL timer_settime
416 UNIMPL timer_gettime
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/amd64/syscalls.master
--- a/sys/compat/linux/arch/amd64/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/amd64/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.48 2014/05/04 10:08:53 njoly Exp $
+ $NetBSD: syscalls.master,v 1.49 2014/05/17 09:23:51 njoly Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -421,8 +421,8 @@
218 STD { int|linux_sys||set_tid_address(int *tid); }
219 UNIMPL restart_syscall
220 UNIMPL semtimedop
-221 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+221 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
222 UNIMPL timer_create
223 UNIMPL timer_settime
224 UNIMPL timer_gettime
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/arm/syscalls.master
--- a/sys/compat/linux/arch/arm/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/arm/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.57 2014/05/06 17:33:35 njoly Exp $
+ $NetBSD: syscalls.master,v 1.58 2014/05/17 09:23:51 njoly Exp $
; Derived from sys/compat/linux/arch/*/syscalls.master
; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -451,8 +451,8 @@
size_t sz, struct linux_statfs64 *sp); }
268 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); }
269 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
-270 STD { int|linux_sys||fadvise64_64(int fd, \
- linux_off_t offset, linux_off_t len, int advice); }
+270 STD { int|linux_sys||fadvise64_64(int fd, off_t offset, \
+ off_t len, int advice); }
271 UNIMPL pciconfig_iobase
272 UNIMPL pciconfig_read
273 UNIMPL pciconfig_write
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/i386/syscalls.master
--- a/sys/compat/linux/arch/i386/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/i386/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.114 2014/05/04 10:08:53 njoly Exp $
+ $NetBSD: syscalls.master,v 1.115 2014/05/17 09:23:51 njoly Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -423,8 +423,8 @@
247 UNIMPL io_getevents
248 UNIMPL io_submit
249 UNIMPL io_cancel
-250 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+250 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
251 UNIMPL /* unused */
252 STD { int|linux_sys||exit_group(int error_code); }
253 UNIMPL lookup_dcookie
@@ -453,8 +453,8 @@
size_t sz, struct linux_statfs64 *sp); }
270 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); }
271 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
-272 STD { int|linux_sys||fadvise64_64(int fd, \
- linux_off_t offset, linux_off_t len, int advice); }
+272 STD { int|linux_sys||fadvise64_64(int fd, off_t offset, \
+ off_t len, int advice); }
273 UNIMPL vserver
274 UNIMPL mbind
275 UNIMPL get_mempolicy
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/m68k/syscalls.master
--- a/sys/compat/linux/arch/m68k/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/m68k/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.84 2014/05/06 17:33:35 njoly Exp $
+ $NetBSD: syscalls.master,v 1.85 2014/05/17 09:23:51 njoly Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -434,8 +434,8 @@
243 UNIMPL io_getevents
244 UNIMPL io_submit
245 UNIMPL io_cancel
-246 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+246 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
247 UNIMPL exit_group
248 UNIMPL lookup_dcookie
249 UNIMPL epoll_create
@@ -463,8 +463,8 @@
size_t sz, struct linux_statfs64 *sp); }
265 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); }
266 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); }
-267 STD { int|linux_sys||fadvise64_64(int fd, \
- linux_off_t offset, linux_off_t len, int advice); }
+267 STD { int|linux_sys||fadvise64_64(int fd, off_t offset, \
+ off_t len, int advice); }
268 UNIMPL mbind
269 UNIMPL get_mempolicy
270 UNIMPL set_mempolicy
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/mips/syscalls.master
--- a/sys/compat/linux/arch/mips/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/mips/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.52 2014/05/06 17:33:35 njoly Exp $
+ $NetBSD: syscalls.master,v 1.53 2014/05/17 09:23:51 njoly Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -432,8 +432,8 @@
251 UNIMPL remap_file_pages
252 STD { int|linux_sys||set_tid_address(int *tid); }
253 UNIMPL restart_syscall
-254 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+254 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
255 STD { int|linux_sys||statfs64(const char *path, \
size_t sz, struct linux_statfs64 *sp); }
256 STD { int|linux_sys||fstatfs64(int fd, \
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/arch/powerpc/syscalls.master
--- a/sys/compat/linux/arch/powerpc/syscalls.master Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/arch/powerpc/syscalls.master Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.61 2014/05/06 17:33:35 njoly Exp $
+ $NetBSD: syscalls.master,v 1.62 2014/05/17 09:23:51 njoly Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -420,8 +420,8 @@
230 UNIMPL io_submit
231 UNIMPL io_cancel
232 STD { int|linux_sys||set_tid_address(int *tid); }
-233 STD { int|linux_sys||fadvise64(int fd, \
- linux_off_t offset, size_t len, int advice); }
+233 STD { int|linux_sys||fadvise64(int fd, off_t offset, \
+ size_t len, int advice); }
234 STD { int|linux_sys||exit_group(int error_code); }
235 UNIMPL lookup_dcookie
236 UNIMPL epoll_create
@@ -449,8 +449,8 @@
size_t sz, struct linux_statfs64 *sp); }
253 STD { int|linux_sys||fstatfs64(int fd, \
size_t sz, struct linux_statfs64 *sp); }
-254 STD { int|linux_sys||fadvise64_64(int fd, \
- linux_off_t offset, linux_off_t len, int advice); }
+254 STD { int|linux_sys||fadvise64_64(int fd, off_t offset, \
+ off_t len, int advice); }
255 UNIMPL rtas
256 UNIMPL /* reserved for sys_debug_setcontext */
257 UNIMPL /* reserved for vserver */
diff -r b8b6140f2566 -r 77471b06c940 sys/compat/linux/common/linux_fadvise64.c
--- a/sys/compat/linux/common/linux_fadvise64.c Sat May 17 07:10:27 2014 +0000
+++ b/sys/compat/linux/common/linux_fadvise64.c Sat May 17 09:23:51 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fadvise64.c,v 1.1 2011/05/30 17:50:32 alnsn Exp $ */
+/* $NetBSD: linux_fadvise64.c,v 1.2 2014/05/17 09:23:51 njoly Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_fadvise64.c,v 1.1 2011/05/30 17:50:32 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fadvise64.c,v 1.2 2014/05/17 09:23:51 njoly Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -67,16 +67,11 @@
{
/* {
syscallarg(int) fd;
- syscallarg(linux_off_t) offset;
+ syscallarg(off_t) offset;
syscallarg(size_t) len;
syscallarg(int) advice;
} */
- size_t len = SCARG(uap, len);
-
- if (sizeof(len) == sizeof(linux_off_t) && len > SSIZE_MAX)
- return (EINVAL);
-
- return do_posix_fadvise(SCARG(uap, fd),
- SCARG(uap, offset), len, linux_to_bsd_posix_fadv(SCARG(uap, advice)));
+ return do_posix_fadvise(SCARG(uap, fd), SCARG(uap, offset),
+ SCARG(uap, len), linux_to_bsd_posix_fadv(SCARG(uap, advice)));
}
Home |
Main Index |
Thread Index |
Old Index