1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00
sortix--sortix/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

16 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;
}