[lkml]   [2002]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: fadvise syscall?
At 14:31 17/03/02, Simon Richter wrote:
>On Sun, 17 Mar 2002, Anton Altaparmakov wrote:
> > All of what you are asking for exists in Windows and all the semantics are
> > implemented through a very powerful open(2) equivalent. I don't see why we
> > shouldn't do the same. It makes more sense to me than inventing yet another
> > system call...
>It is easier for application writers to code:
> (void)fadvise(fd, FADV_STREAMING);
>Than to have a forest of #ifdefs to determine which O_* flags are
>supported. After all, we still want our programs to run under Solaris. :-)

Ugh. Both of your suggestions look ugly. Using the O_* flags, you just need
to have a compatibility header file which contains:

# define O_SEQUENTIAL 0

Then in the code you just use O_SEQUENTIAL and if the system doesn't know
about it it is optimised away at compile time.

Note how nicely this fits in with autoconf/automake where the ./configure
script can test for O_SEQUENTIAL and if it is not there automatically
define it to 0. That then means your code is completely free from these
ugly #ifdefs.

Thanks for making your point as that is ANOTHER argument for using open(2)
instead of fadvise() [1]. (-;



[1] Yeah, I know, one could also define fadvise() to nothing in the compat
header file...

"I've not lost my mind. It's backed up on tape somewhere." - Unknown
Anton Altaparmakov <aia21 at> (replace at with @)
Linux NTFS Maintainer / WWW:
ICQ: 8561279 / WWW:

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:25    [W:0.173 / U:7.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site