Revert r288628 and instead fix a discrepancy between the posix_fadvise(2)

man page and POSIX: posix_fadvise(2) returns an error number on failure.

Reported by:	jilles
MFC after:	1 week
This commit is contained in:
Mark Johnston 2015-10-03 22:27:14 +00:00
parent f4ac78a284
commit 403ec61cbb
2 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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);
}