[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:39 UTC 2007


http://www.rtems.org/bugzilla/show_bug.cgi?id=1215

           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_INLINE long
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 ();
#else
  // 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 are the assignee for the bug, or are watching the assignee.



More information about the bugs mailing list