Red Hat Bugzilla – Bug 169719
madvise returns EBADF for anonymous mappings
Last modified: 2007-11-30 17:11:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7
Description of problem:
The madvise system call is returning an EBADF error for anonymous
mappings. This is due to a recently introduced change to always
return EBADF if not associated with a file. This interpretation of
madvise may not be correct. Allowing madvise to operate on anonymous
mappings can be useful for improving performance on some applications.
Works on Solaris.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Compile and run the attached program.
Actual Results: The madvise system call returns an EBADF error.
Expected Results: The madvise system call should succeed.
Created attachment 119513 [details]
Example test code.
A kernel patch has been approved reverting the change in
behavior the system call. This patch should be picked up
in due course and will resolve this issue.
2.6.14-1.1637_FC4 has been released as an update for FC4.
Please retest with this update, as a large amount of code has been changed in
this release, which may have fixed your problem.
The issue is resolved by kernel-2.6.14-1.1637_FC4.