Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ system(3S) — DG/UX 5.4R2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

waitpid(2)

sh(1)



system(3S)                   DG/UX 5.4 Rel. 2.01                  system(3S)


NAME
       system - issue a shell command

SYNOPSIS
       #include <stdlib.h>

       int system (const char *string);

DESCRIPTION
       system causes the string to be given to the shell [see sh(1)] as
       input, as if the string had been typed as a command at a terminal.
       The current process waits until the shell has completed, then returns
       the exit status of the shell in the format specified by waitpid.

       If string is a NULL pointer, system checks if /sbin/sh exists and is
       executable.  If /sbin/sh is available, system returns non-zero;
       otherwise it returns zero.

       system fails if one or more of the following are true:

       EAGAIN      The system-imposed limit on the total number of processes
                   under execution by a single user would be exceeded.

       EINTR       system was interupted by a signal.

       ENOMEM      The new process requires more memory than is allowed by
                   the system-imposed maximum MAXMEM.

DIAGNOSTICS
       system forks to create a child process that in turn calls exec to
       execute /sbin/sh.  This shell then executes string.  If the fork or
       exec fails, system returns a value of -1 and sets errno.

SEE ALSO
       exec(2), waitpid(2).
       sh(1).





















Licensed material--property of copyright holder(s)                         1


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