_SC_PAGESIZE or _SC_PAGE_SIZE - VxWorks

This is a discussion on _SC_PAGESIZE or _SC_PAGE_SIZE - VxWorks ; Dear all, I'm trying to port NTP to vxworks, but in the source code of NTP, there's _SC_PAGESIZE. I'm assuming it's a constant in other OS but not VxWorks. Can Anyone tell me what's the value for _SC_PAGESIZE in VxWorks? ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: _SC_PAGESIZE or _SC_PAGE_SIZE

  1. _SC_PAGESIZE or _SC_PAGE_SIZE

    Dear all,
    I'm trying to port NTP to vxworks, but in the source code of NTP,
    there's _SC_PAGESIZE. I'm assuming it's a constant in other OS but not
    VxWorks. Can Anyone tell me what's the value for _SC_PAGESIZE in
    VxWorks? Thanks a lot.


  2. Re: _SC_PAGESIZE or _SC_PAGE_SIZE

    Hello Aggie,

    What version of VxWorks are you using? In the Realtime Process (RTP)
    environment VxWorks does support _SC_PAGESIZE and _SC_PAGE_SIZE for a
    while (since VxWorks 6.3 I believe). In the kernel environment VxWorks
    does not support _SC_PAGESIZE since this constant is meant to be used
    with the sysconf() API. This routine is not provided in VxWorks'
    kernel environment but exists in the RTP environment.

    This said, on VxWorks the size of a memory page depends on the
    processor architecture. So the minimum value required by the POSIX
    standard is therefore meaningless in a VxWorks system. What you could
    do though is define _SC_PAGESIZE as vmPageSizeGet().

    Hope this helps,

    --
    PAD



  3. Re: _SC_PAGESIZE or _SC_PAGE_SIZE

    Hello PAD,
    Thank you for helping me a couple times already. I'm using VxWorks
    6.4.

    > What you could do though is define _SC_PAGESIZE as vmPageSizeGet().

    Hm... I think I already did that. I went to Kernel Configuration-
    >hardware->memory->MMU->MMU global map->VM page size. The value for VM

    page size is 4096. So I went to the source code of NTP and set
    _SC_PAGESIZE to be 4096. Is that what you are suggesting?? Thank you
    very much.


    On Aug 21, 10:13 am, PAD wrote:
    > Hello Aggie,
    >
    > What version of VxWorks are you using? In the Realtime Process (RTP)
    > environment VxWorks does support _SC_PAGESIZE and _SC_PAGE_SIZE for a
    > while (since VxWorks 6.3 I believe). In the kernel environment VxWorks
    > does not support _SC_PAGESIZE since this constant is meant to be used
    > with the sysconf() API. This routine is not provided in VxWorks'
    > kernel environment but exists in the RTP environment.
    >
    > This said, on VxWorks the size of a memory page depends on the
    > processor architecture. So the minimum value required by the POSIX
    > standard is therefore meaningless in a VxWorks system. What you could
    > do though is define _SC_PAGESIZE as vmPageSizeGet().
    >
    > Hope this helps,
    >
    > --
    > PAD




  4. Re: _SC_PAGESIZE or _SC_PAGE_SIZE

    On Aug 21, 10:21 am, Aggie wrote:
    [...]
    > page size is 4096. So I went to the source code of NTP and set
    > _SC_PAGESIZE to be 4096. Is that what you are suggesting?? Thank you

    [...]

    Yes, that'll work but would be ok only on those architectures for
    which a memory page is 4096 bytes long.

    What I was suggesting is that you define _SC_PAGESIZE in one of your
    header files as follows:

    #define _SC_PAGESIZE vmPageSizeGet()

    You might have to also add the inclusion of vmLib.h so that
    vmPageSizeGet() does not come up as an undeclared routine.

    Cheers,

    --
    PAD


+ Reply to Thread