[Bug 2078] New: sys/features.h ill-defines _POSIX_MEMLOCK and _POSIX_MEMLOCK_RANGE

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Oct 9 00:29:00 UTC 2012


             Bug #: 2078
           Summary: sys/features.h ill-defines _POSIX_MEMLOCK and
    Classification: Unclassified
           Product: Tools
           Version: unspecified
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Newlib
        AssignedTo: ralf.corsepius at rtems.org
        ReportedBy: strauman at slac.stanford.edu

According to the linux manpage (I don't have access to a posix standard ATM):

      On  POSIX  systems  on  which  mlock()  and  munlock()  are  available,
       _POSIX_MEMLOCK_RANGE is defined in <unistd.h> and the number  of  bytes
       in  a page can be determined from the constant PAGESIZE (if defined) in
       <limits.h> or by calling sysconf(_SC_PAGESIZE).

       On POSIX systems on which mlockall() and  munlockall()  are  available,
       _POSIX_MEMLOCK  is  defined  in  <unistd.h>  to a value greater than 0.
       (See also sysconf(3).)

However, newlib's sys/feature.h defines

#ifdef __rtems__
#define _POSIX_MEMLOCK          1
#define _POSIX_MEMLOCK_RANGE        1

which is wrong since RTEMS does *not* implement mlock nor mlockall. BTW:
the definition of _POSIX_MEMORY_PROTECTION also seems fishy.

Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the bugs mailing list