Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dg_attach_to_shds(2) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open(2)



dg_attach_to_shds(2)              SDK R4.11             dg_attach_to_shds(2)


NAME
       dgattachtoshareddescriptors - attach another process's shared
       descriptor array

SYNOPSIS
       #include <sys/types.h>

       int  dgattachtoshareddescriptors (pidt pid)

   where:
       pid       The process identifier of the process whose shared
                 descriptor array is to be attached.

DESCRIPTION
       File descriptors fall into two classes based on their process access
       and permanence semantics.  The first class of file descriptor is a
       per-process file descriptor.  A per-process descriptor is accessible
       only from the current process.  A per-process descriptor is closed
       only as a by-product of some action taken by the current process.
       This class of file descriptor is never shared by other processes.

       The second class of file descriptor is a shared descriptor.  Shared
       descriptors are collected into a shared descriptor array, which is
       the granularity upon which any process sharing of descriptors is
       done.  The shared descriptor array and all shared descriptors in that
       array persist only as long as the shared descriptor array is attached
       to at least one process.  If a shared descriptor array is no longer
       referenced by any process then it will be destroyed and all remaining
       descriptors in the array will be closed.  References to the shared
       descriptor array are lost either when a process exits or when it
       attaches to another shared descriptor array.

       A shared descriptor is accessible from all processes that have
       attached to the same descriptor array.  A shared descriptor may be
       closed by any process to which it is attached.
       Dgattachtoshareddescriptors(2) attaches the shared process array
       of process pid to the calling process.  The attach operation will
       fail if the attach would cause the per-process soft limit on the
       maximum number of descriptors to be exceeded.  When the attach is
       completed, the shared descriptor array (if any) previously attached
       to the calling process is no longer attached (the individual
       descriptors may or may not be closed) and the shared descriptor array
       of pid is now attached to the calling process.

       Shared descriptors should be used only by processes that are prepared
       to cooperate in their use.  Since shared descriptors may be closed by
       any process that have access to it, process must be prepared to lose
       access to a descriptor because of the action of another process.

ACCESS CONTROL
       The process identified by pid must have previously issued a
       successful dgallowshareddescriptorattach(2) on the pid of the
       calling process for this call to be successful.

RETURN VALUE
       0      All descriptors in the shared descriptor array of process pid
              may now be accessed by the calling process.

       -1     An error occurred.  errno is set to indicate the error.

DIAGNOSTICS
       Errno may be set to one of the following error codes:

       ESRCH          The shared descriptor array for pid has not been
                      exported to the process that requests the attach.

       EMFILE         The attach operation would exceed the soft limit on
                      the number of descriptors per process.

SEE ALSO
       open(2), dgallowshareddescriptorattach(2).


Licensed material--property of copyright holder(s)

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