[PATCH] fadvise(2) system call

John Baldwin jhb at freebsd.org
Tue Nov 1 14:23:39 UTC 2011


On Tuesday, November 01, 2011 10:01:42 am John Baldwin wrote:
> On Monday, October 31, 2011 6:16:27 pm Ed Schouten wrote:
> > Hi John,
> > 
> > * John Baldwin <jhb at freebsd.org>, 20111031 22:17:
> > > I also really do think that posix_*() truly is far uglier to read.  In the 
> > > worst case, imagine something like this:
> > > 
> > > 	char *cp;
> > > 
> > > 	cp = posix_malloc(posix_strlen(some_string) + 1);
> > > 	posix_strcpy(cp, s);
> > > 	posix_printf("%s\n", cp);
> > > 
> > > *blech*
> > 
> > I do agree it's ugly, but at least it's standardized. The fact is that
> > it's easier to explain to someone "this code doesn't build on $NONBSD,
> > because $NONBSD lacks POSIX conformance" than saying "this code doesn't
> > build on $NONBSD because it uses BSD-specific crap". As I mentioned
> > previously, there is no fadvise() on Linux. There's no gain in
> > compatibility by implementing it -- it's just syntactic sugar.
> 
> Hmmm, there is an fadvise(2) manpage.  I had presumed from that it was
> a public interface.

A reworked patch is at www.freebsd.org/~jhb/patches/posix_fadvise.patch

A universe build is going.  I also noticed we currently use stubs for
the linux fadvise() system call.  Once this is in we should be able to
replace the stubs with calls to the new system call instead.

-- 
John Baldwin


More information about the freebsd-arch mailing list