|
From: Russell S. <se...@cs...> - 2008-01-03 22:53:28
Attachments:
valgrind-sync_file_range.patch
|
I've attached a patch that adds support for Linux's sync_file_range. I tested it under x86_64, and added an entry for x86 since I happened to find the syscall number in my /usr/include directory. Presumably, it's supported on other architectures too... The manpage lists "off64_t" as the type for some of the parameters, but there is no vki_off64_t type, so I used vki_off_t. Should I use vki_loff_t instead? Thanks, Rusty |
|
From: Nicholas N. <nj...@cs...> - 2008-01-03 23:04:24
|
On Thu, 3 Jan 2008, Russell Sears wrote: > I've attached a patch that adds support for Linux's sync_file_range. I > tested it under x86_64, and added an entry for x86 since I happened to find > the syscall number in my /usr/include directory. Presumably, it's supported > on other architectures too... > > The manpage lists "off64_t" as the type for some of the parameters, but there > is no vki_off64_t type, so I used vki_off_t. Should I use vki_loff_t > instead? If a kernel type isn't present, a vki_* version should be added. See the comment at the top of include/vki/vki-linux.h. But don't trust the man pages, they mostly describe glibc's wrappers for the syscalls. These mostly are the same as the kernel syscalls, but not always. Only trust the kernel code. Unfortunately, I can't remember where in the kernel code the syscall prototypes are defined. Nick |
|
From: Tom H. <to...@co...> - 2008-01-04 00:19:21
|
On 03/01/2008, Nicholas Nethercote <nj...@cs...> wrote: > If a kernel type isn't present, a vki_* version should be added. > See the comment at the top of include/vki/vki-linux.h. > > But don't trust the man pages, they mostly describe glibc's wrappers for the > syscalls. These mostly are the same as the kernel syscalls, but not always. > Only trust the kernel code. Unfortunately, I can't remember where in the > kernel code the syscall prototypes are defined. There isn't one place - each call will be in a place appropriate to the systems it works on. In this case fs/sync.c is the file, and the prototype is: asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, unsigned int flags) So vki_loff_t is the thing to use. The wrapper should probably also validate the file descriptor like other wrappers which have file descriptor arguments do. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Russell S. <se...@cs...> - 2008-01-07 19:19:18
Attachments:
valgrind-sync_file_range-2.patch
|
Tom Hughes wrote: > On 03/01/2008, Nicholas Nethercote <nj...@cs...> wrote: > >> If a kernel type isn't present, a vki_* version should be added. >> See the comment at the top of include/vki/vki-linux.h. >> >> But don't trust the man pages, they mostly describe glibc's wrappers for the >> syscalls. These mostly are the same as the kernel syscalls, but not always. >> Only trust the kernel code. Unfortunately, I can't remember where in the >> kernel code the syscall prototypes are defined. > > There isn't one place - each call will be in a place appropriate to > the systems it works on. In this case fs/sync.c is the file, and the > prototype is: > > asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t > nbytes, unsigned int flags) > > So vki_loff_t is the thing to use. Fixed. Thanks! > > The wrapper should probably also validate the file descriptor like > other wrappers which have file descriptor arguments do. I couldn't find any wrappers that do anything special with their file descriptor arguments. (Look at sys_llseek in syswrap-linux.c, for example...) I've attached an updated patch. -Rusty > > Tom > |
|
From: Tom H. <to...@co...> - 2008-01-08 16:32:10
|
In message <478...@cs...>
Russell Sears <se...@cs...> wrote:
>> The wrapper should probably also validate the file descriptor like
>> other wrappers which have file descriptor arguments do.
>
> I couldn't find any wrappers that do anything special with their file
> descriptor arguments. (Look at sys_llseek in syswrap-linux.c, for
> example...)
The llseek wrapper was broken ;-) Now fixed...
> I've attached an updated patch.
Committed.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|