SYSTEM

Section: C Library Functions (3)
Index Return to Main Contents

BSD mandoc
 

NAME

system - pass a command to the shell  

SYNOPSIS

Fd #include <stdlib.h> Ft int Fn system const char *string  

DESCRIPTION

The Fn system function hands the argument Fa string to the command interpreter sh(1). The calling process waits for the shell to finish executing the command, ignoring SIGINT and SIGQUIT and blocking SIGCHLD

If Fa string is a NULL pointer, Fn system will return non-zero if the command interpreter sh(1) is available, and zero if it is not.

The Fn system function returns the exit status of the shell, or -1 if the wait(3) for the shell failed. A return value of 127 means the execution of the shell failed.  

SEE ALSO

sh(1), execve(2), wait(2), popen(3)  

STANDARDS

The Fn system function conforms to St -ansiC .


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
STANDARDS

This document was created by man2html, using the manual pages.
Time: 06:43:25 GMT, May 19, 2025