sortix-mirror/utils/help.cpp
Jonas 'Sortie' Termansen 0ed0082070 Added execv(3) and execve(3).
Removed the older libmaxsi system call.
2012-03-02 15:00:11 +01:00

17 lines
369 B
C++

#include <stdio.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
printf("Please enter the name of one of the following programs:\n");
const char* programname = "ls";
const char* newargv[] = { programname, "/bin", NULL };
execv(programname, (char* const*) newargv);
error(1, errno, "%s", programname);
return 1;
}