Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  patch to add a wrapper around the syscall posix_fadvise

Guest
Posted: Sun Apr 25, 2010 8:20 pm Reply with quote
Guest
Hi,

The following patch adds a new function - file:advise/4
It's a wrapper around the POSIX syscall posix_fadvise, and does nothing
(always returns 'ok') on Windows.

This syscall allows one to declare the access pattern for a file's data.
Useful for many disk IO bound tasks, as it allows the underlying OS to adopt
a better caching strategy for the specified access pattern.

Man page: http://linux.die.net/man/2/posix_fadvise

I assigned the value 31 to the FILE_ADVISE constant because I assigned the
value 30 to a previously submitted patch (which adds a wrapper around the
syscall fdatasync).

Branch posix_fadvise in my github account:

git fetch git://github.com/fdmanana/otp.git posix_fadvise

Documentation and tests are included. Let me know if all is fine.

cheers

--
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."


Post received from mailinglist
Guest
Posted: Sun Apr 25, 2010 8:21 pm Reply with quote
Guest
Hi,

The following patch adds a new function - file:advise/4
It's a wrapper around the POSIX syscall posix_fadvise, and does nothing
(always returns 'ok') on Windows.

This syscall allows one to declare the access pattern for a file's data.
Useful for many disk IO bound tasks, as it allows the underlying OS to adopt
a better caching strategy for the specified access pattern.

Man page: http://linux.die.net/man/2/posix_fadvise

I assigned the value 31 to the FILE_ADVISE constant because I assigned the
value 30 to a previously submitted patch (which adds a wrapper around the
syscall fdatasync).

Branch posix_fadvise in my github account:

git fetch git://github.com/fdmanana/otp.git posix_fadvise

Documentation and tests are included. Let me know if all is fine.

cheers

--
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."


Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum