You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
349 B

#include <stdlib.h>
#include <unistd.h>
int main() {
write(1, "Appel à la commande 'ps -f' via system :\n", 42);
system("ps -f");
write(1, "\nRecouvrement par la même commande 'ps -f' via execlp :\n", 57);
execlp("ps", "ps", "-f", (char *)NULL);
// Cette partie ne sera atteinte qu'en cas d'erreur dans execlp
return 0;
}