diff --git a/lib/libc/sys/posix_fadvise.2 b/lib/libc/sys/posix_fadvise.2 index 8691f6b2b756..641bc9bff5ef 100644 --- a/lib/libc/sys/posix_fadvise.2 +++ b/lib/libc/sys/posix_fadvise.2 @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd January 30, 2014 +.Dd October 3, 2015 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -89,11 +89,13 @@ read or written. Future access to this data may require a read operation. .El .Sh RETURN VALUES -.Rv -std posix_fadvise -.Sh ERRORS -The +If successful, .Fn posix_fadvise -system call returns zero on success, and an error on failure: +returns zero. +It returns an error on failure, without setting +.Va errno . +.Sh ERRORS +Possible failure conditions: .Bl -tag -width Er .It Bq Er EBADF The diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 725a7fd6cced..ce4436ad731c 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4663,6 +4663,7 @@ int sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) { - return (kern_posix_fadvise(td, uap->fd, uap->offset, uap->len, - uap->advice)); + td->td_retval[0] = kern_posix_fadvise(td, uap->fd, uap->offset, + uap->len, uap->advice); + return (0); }