VMS Help  —  CRTL  shm_unlink
    Removes a shared memory object.

    This function is OpenVMS Alpha and Integrity servers only.

    Format

      #include  <sys/mman.h>

      int shm_unlink  (const char *name);

1  –  Argument

 name

    Pointer to a string naming the shared memory object to remove.

2  –  Description

    The shm_unlink function removes the name of the shared memory
    object named by the string pointed to by name.

    If one or more references to the shared memory object exist
    when the object is unlinked, the name is removed before shm_
    unlink returns, but the removal of the memory object contents is
    postponed until all open and map references to the shared memory
    object have been removed.

    Even if the object continues to exist after the last shm_unlink,
    reuse of the name subsequently causes shm_unlink to behave as
    if no shared memory object with this name exists (that is, shm_
    open will fail if O_CREAT is not set, or will create a new shared
    memory object if O_CREAT is set).

3  –  Return Values

    0                  Indicates success.
    -1                 Indicates failure, the named shared memory
                       object is not changed by the function call,
                       and errno is set to indicate the error:

                       o  EACCES - Permission is denied to unlink the
                          named shared memory object.

                       o  ENAMETOOLONG - The length of the name
                          argument exceeds PATH_MAX or a pathname
                          component is longer than NAME_MAX.

                       o  ENOENT - The named shared memory object
                          does not exist.
Close Help