On Wed, 23 Oct 2002, Jim Magee wrote:
> On Wednesday, October 23, 2002, at 01:40 AM, Paul J. Lucas wrote:
> > Is madvise(2) broken under OS X ?
>
> Can you provide a code snippet that causes this error? It should work.
It's something like this:
struct stat stat_buf;
int fd_;
void *addr_;
if ( ::stat( "/tmp/foo", &stat_buf ) == -1 ) {
// ...
}
if ( ( fd_ = ::open( path, O_RDONLY ) ) == -1 ) {
// ...
}
addr_ = mmap( 0, stat_buf.st_size, PROT_READ, MAP_SHARED, fd_, 0 );
if ( addr_ == MAP_FAILED ) {
// ...
}
if ( madvise( addr_, size_, MADV_SEQUENTIAL ) == -1 ) {
// ...
}
- Paul
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.