Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ukill(PCI) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

uexec(PCI)

uwait(PCI)


 ukill(PCI)                     6 January 1993                     ukill(PCI)


 Name

    ukill - send a signal to a UNIX operating system process or group of pro-
    cesses

 Syntax


    #include <pcilib.h>


    #include <memmdl.h>


    #include <sys/types.h>


    #include <signal.h>

    int ukill( drvnum, pid, sig )
    int drvnum;
    pid_t pid;
    int sig;

    _________________________________________________________________________
       NOTE  Please check this carefully.
    _________________________________________________________________________


 Description

    ukill sends a signal to a process or a group of processes.  pid specifies
    the process or group of processes to which the signal is to be sent.
    drvnum is the drive number of the virtual drive connected to the host
    running the process to which the signal is to be sent.  (Drive A: = 1,
    drive B: = 2, and so forth.)  If drvnum is 0, the signal is sent on the
    host associated with the current drive.  The signal to be sent is speci-
    fied by sig and is either one from the list given in signal(S) or 0.  For
    compatibility with 4.1 BSD programs, sig may also be the negative of one
    of the listed signal numbers.  If sig is 0 (the null signal), error
    checking is performed but no signal is actually sent.  This can be used
    to check the validity of pid.

    The real or effective user ID of the sending DOS server process must
    match the real or effective user ID of the receiving process, unless the
    effective user ID of the DOS server process is super-user.

    Several processes, including those with process IDs of 0 and 1, are spe-
    cial system-created processes.  Of these, only process 1 (the initializa-
    tion process) may ever be signaled.

    If pid is greater than 0 and sig is greater than or equal to 0, sig will
    be sent to the process whose process ID is equal to pid.  pid may equal
    1, but may not be the process ID of any other system-created process.

    If pid is 0, the absolute value of sig will be sent to each process
    (excluding the system-created processes) whose process group ID is equal
    to the process group ID of the sender. The sender's process group ID may
    not be 0.

    If pid is -1 and the effective user ID of the sender is not super-user,
    the absolute value of sig will be sent to each process whose real user ID
    is equal to the effective user ID of the sender.

    If pid is -1 and the effective user ID of the sender is super-user, the
    absolute value of sig will be sent to all processes excluding the
    system-created processes.

    If pid is negative but not -1, the absolute value of sig will be sent to
    each process whose process group ID is equal to the absolute value of
    pid.  This is the standard UNIX System V method for sending signals to
    members of a specified process group.

    If pid is positive and sig is negative, the absolute value of sig will be
    sent to each process whose process group ID is equal to pid.  This is the
    standard 4.1 BSD method for sending signals to members of a specified
    process group.

    ukill fails and no signal is sent if one or more of the following are
    true:

    [EINVAL]  sig is not a valid signal number.

    [EINVAL]  pid is the ID of one of the system-created processes that can-
              not be signaled.

    [ESRCH]   No process can be found corresponding to that specified by pid.

    [ESRCH]   pid is 0 and the sender's process group ID is 0.

    [EPERM]   The user ID of the sending process is not super-user, and its
              real or effective user ID does not match the real or effective
              user ID of the receiving process.


 Return value

    On successful completion, a value of 0 returns.  If the call fails for
    any reason, a value of -1 returns, and errno is set to indicate the
    error.

 Example


               :
               :
       #define SIGTERM  15     /* See UNIX  signal(2) man page */

       int    driveNum;
       pid_t  pid;
       int    sig;
       int    retVal;
               :
               :
       /*
       ** Send Termination signal (SIGTERM),
       ** to a process with PID 7476 on virtual
       ** drive D: (4).
       */
       sig = SIGTERM;
       pid = 7476;
       driveNum = 4;

       if ( (retVal = ukill(driveNum, pid, sig)) == -1 )
               errorHandler();
       else

               :
               :


 See also

    uexec(PCI), uwait(PCI)


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