.\" Copyright (c) 2003 .\" Nicholas W. Hurley. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the Nicholas W. Hurley may not be used to endorse or .\" promote products derived from this software without specific .\" prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NICHOLAS W. HURLEY ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd 15 July 2003 .Dt SPORK 3 .Os .Sh NAME .Nm spork .Nd execute a file .Sh SYNOPSIS .In spork.h .Ft pid_t .Fn spork "int etype" "int num" "const char *fp" ... .Sh DESCRIPTION The .Nm spork function takes the place of both .Xr fork 2 and the .Nm exec family of functions (Using one of .Xr execl 3 , .Xr execlp 3 , .Xr execv 3 , or .Xr execvp 3 ) .Pp The initial argument for .Nm spork is which type of .Nm exec to use, one of .Nm S_EXECL , .Nm S_EXECLP , .Nm S_EXECV , or .Nm S_EXECVP \. .Pp In the case of .Nm S_EXECL and .Nm S_EXECLP , the second argument is the number of arguments after .Em fp in the call to .Nm spork \. .Pp The third argument is, in the case of .Nm S_EXECL and .Nm S_EXECV , the full path to the program to be run. In the case of .Nm S_EXECLP and .Nm S_EXECVP , the third argument can be either a full path or a standalone executable name. .Pp .Sh RETURN VALUES The return values for .Fn spork are the same as those for .Fn fork \. .Sh SEE ALSO .Xr fork 2 , .Xr exec 3 , .Xr execve 2