[Bug 1215] New: _SC_PAGESIZE is defined but sysconf returns -1

rtems-bugs at rtems.org rtems-bugs at rtems.org
Tue Jan 30 10:08:38 UTC 2007


           Summary: _SC_PAGESIZE is defined but sysconf returns -1
           Product: RTEMS
           Version: 4.6
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: major
          Priority: P2
         Component: misc
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: jwillemsen at remedy.nl

With the port of ACE/TAO/CIAO we found a problem with _SC_PAGESIZE. The memory
pools in ACE use the pagesize as allocation granularity. When _SC_PAGESIZE is
defined we use sysconf to retrieve the actual pagesize. We now found that
calling ::sysconf (_SC_PAGESIZE) returns -1 instead of a valid pagesize, the
oroginal ACE code is below. I do see two solutions, implement _SC_PAGESIZE to
return a correct value or remove the _SC_PAGESIZE define

ACE_OS::getpagesize (void)
  ACE_OS_TRACE ("ACE_OS::getpagesize");
#if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP)
  SYSTEM_INFO sys_info;
  ::GetSystemInfo (&sys_info);
  return (long) sys_info.dwPageSize;
#elif defined (_SC_PAGESIZE)
  return ::sysconf (_SC_PAGESIZE);
#elif defined (ACE_HAS_GETPAGESIZE)
  return ::getpagesize ();
  // Use the default set in config.h
  return ACE_PAGE_SIZE;
#endif /* ACE_WIN32 */

Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.

More information about the bugs mailing list