#1215 closed defect (fixed)

_SC_PAGESIZE is defined but sysconf returns -1

Reported by: Johnny Willemsen Owned by: Joel Sherrill
Priority: high Milestone: 4.7
Component: unspecified Version: 4.7
Severity: major Keywords:
Cc: Blocked By:
Blocking:

Description

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 */

Change History (2)

comment:1 Changed on Feb 6, 2007 at 2:07:05 PM by Ralf Corsepius

Resolution: fixed
Status: newclosed
Version: 4.64.7

Should be fixed by now in rtems-4-7-branch and cvs-HEAD.

I changed the code to let sysconf(_SC_PAGESIZE) return PAGE_SIZE.

WONTFIX for rtems-4.6

comment:2 Changed on Oct 10, 2017 at 6:35:44 AM by Sebastian Huber

Component: miscunspecified
Note: See TracTickets for help on using tickets.