Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sem_unlink(2) — DG/UX R4.11MU05

Media Vault

Software Library

Restoration Projects

Artifacts Sought



sem_unlink(2)                  DG/UX R4.11MU05                 sem_unlink(2)


NAME
       sem_unlink - remove a named semaphore

SYNOPSIS
       #include <semaphore.h>

       int semunlink (*name)
            const char     *name;

DESCRIPTION
       Use semunlink(2) to remove a named semaphore and its state
       information from the system:

        name   is the NULL-terminated string established with the
               semopen(2) call.

       If name does not begin with a slash, the associated pathname is
       located relative to the current working directory of the unlinking
       process.  The unlinking process must take care to have the name
       resolve to the desired filesystem location.

       If the semaphore indicated by name is still being referenced by a
       semaphore address obtained by semopen(2), its removal is postponed
       until all references to the semaphore are destroyed by calls to
       semclose(2), exit(2), or exec(2).  semunlink(2) does not block
       until all such references are destroyed, it returns immediately.

       Once semunlink(2) has been called successfully, calls to semopen(2)
       to re-connect or re-create to the semaphore refer to a new semaphore.

   Note
        * This routine is based on POSIX realtime extension document P1003.4
          draft 14. It is therefore subject to change.

        * Compilation of a source file using this routine requires that
          feature macro _POSIX4_DRAFT_SOURCE be defined.  This feature macro
          is not enabled by any other feature macro, nor does it enable any
          other feature macro.

        * The compiled routine must be linked to library librte.a.

RETURN VALUE
       If successful, semunlink returns 0. If unsuccessful, it returns -1
       and sets ERRNO to:

        EACCES Permission is denied to unlink the named semaphore.

        EFAULT Unable to access name.

        ENAMETOOLONG
               name contains more than NAME_MAX characters.

        ENOENT The named semaphore does not exist.

        ENOSPC Unable to allocate enough memory.

SEE ALSO
       semclose(2), semopen(2), semwait(2), semtrywait(2), sempost(2).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026