Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ system(3S) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

exec(2)

waitpid(2)

SYSTEM(3S)

NAME

system − issue a shell command

SYNOPSIS

#include <sys/wait.h>
#include <stdlib.h>

int system (string)
const char ∗string;

DESCRIPTION

System causes the string to be given to 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.

If the string is a null pointer, system returns 1.  Otherwise, system returns the termination status of sh(1) in the format specified by waitpid(2).

FILES

/bin/sh

SEE ALSO

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

DIAGNOSTICS

System forks to create a child process that in turn exec’s /bin/sh in order to execute string. If the fork fails, system returns -1 and sets errno. If the exec fails, system returns the status value returned by waitpid(2) for a process that terminates with a call of exit(127).

STANDARDS CONFORMANCE

system: SVID2, XPG2, XPG3, ANSI C

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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