**
** execve.c--Illustrate the usage of execve
**
*****************************************************************************/
#include
#include
#include
int main( void )
{
char* args[] = { "/bin/ls", NULL };
if ( -1 == (execve("/bin/ls", args, NULL)) )
{
perror( "execve" );
exit( EXIT_FAILURE);
}
puts( "shouldn't get here" );
exit( EXIT_SUCCESS );
}
[root@localhost src]# gcc execve.c
[root@localhost src]# ./a.out
a.out child_fork.c execve.c fork.c getpid.c