1*48349Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California. 242122Sbostic.\" All rights reserved. 320376Smckusick.\" 442122Sbostic.\" %sccs.include.redist.man% 542122Sbostic.\" 6*48349Scael.\" @(#)system.3 6.4 (Berkeley) 04/19/91 742122Sbostic.\" 8*48349Scael.Dd 9*48349Scael.Dt SYSTEM 3 10*48349Scael.Os 11*48349Scael.Sh NAME 12*48349Scael.Nm system 13*48349Scael.Nd pass a command to the shell 14*48349Scael.Sh SYNOPSIS 15*48349Scael.Fd #include <stdlib.h> 16*48349Scael.Ft int 17*48349Scael.Fn system "const char *string" 18*48349Scael.Sh DESCRIPTION 19*48349ScaelThe 20*48349Scael.Fn system 21*48349Scaelfunction 22*48349Scaelhands the argument 23*48349Scael.Fa string 2442122Sbosticto the command interpreter 25*48349Scael.Xr sh 1 . 26*48349ScaelThe calling process waits for the shell 27*48349Scaelto finish executing the command, 28*48349Scaelignoring 29*48349Scael.Dv SIGINT 30*48349Scaeland 31*48349Scael.Dv SIGQUIT , 32*48349Scaeland blocking 33*48349Scael.Dv SIGCHLD . 34*48349Scael.Pp 3542122SbosticIf 36*48349Scael.Fa string 37*48349Scaelis a 38*48349Scael.Dv NULL 39*48349Scaelpointer, 40*48349Scael.Fn system 4142122Sbosticwill return non-zero if the command interpreter 42*48349Scael.Xr sh 1 4342122Sbosticis available, and zero if it is not. 44*48349Scael.Pp 45*48349ScaelThe 46*48349Scael.Fn system 47*48349Scaelfunction 4842122Sbosticreturns the exit status of the shell, or \-1 if the 49*48349Scael.Xr wait 3 5042122Sbosticfor the shell failed. 51*48349ScaelA return value of 127 means the execution of the shell 5242122Sbosticfailed. 53*48349Scael.Sh SEE ALSO 54*48349Scael.Xr sh 1 , 55*48349Scael.Xr execve 2 , 56*48349Scael.Xr wait 2 , 57*48349Scael.Xr popen 3 58*48349Scael.Sh STANDARDS 59*48349ScaelThe 60*48349Scael.Fn system 61*48349Scaelfunction 62*48349Scaelconforms to 63*48349Scael.St -ansiC . 64