shm_open() & mmap() vs. shmget() & shmat() - HP UX

This is a discussion on shm_open() & mmap() vs. shmget() & shmat() - HP UX ; > uname -smrsv HP-UX B.11.23 U ia64 There is a possibility to work with shared memory using shm_open() & mmap() too. Are there any differences in this case vs. usage of shmget() & shmat() ? What are Pros and Cons: ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: shm_open() & mmap() vs. shmget() & shmat()

  1. shm_open() & mmap() vs. shmget() & shmat()

    > uname -smrsv
    HP-UX B.11.23 U ia64

    There is a possibility to work with shared memory using shm_open() &
    mmap() too.

    Are there any differences in this case vs. usage of shmget() &
    shmat() ?

    What are Pros and Cons: shm_open() & mmap() vs. shmget() & shmat() ?

    Of course, the answer depends on our requirements, but perhaps there
    are common things to be remarked.


    Alex Vinokur
    email: alex DOT vinokur AT gmail DOT com
    http://mathforum.org/library/view/10978.html
    http://sourceforge.net/users/alexvn


  2. Re: shm_open() & mmap() vs. shmget() & shmat()

    Alex Vinokur wrote:
    > There is a possibility to work with shared memory using shm_open() &
    > mmap() too.


    Yes but you can use open(2) then mmap(2). I suppose using shm_open(2)
    tells the kernel you want to do mmap next.

    > Are there any differences in this case vs. usage of shmget() &
    > shmat()?


    With open/shm_open you have a file you can backup, that can persist over
    reboots. (You would still have to msync it.)

+ Reply to Thread