venerdì 29 gennaio 2010

i capofamiglia exec

#include<stdio.h>
#include<stdio.h>
#include<sys/signal.h>
#include<unistd.h>


main()
{
int i, status, pid;

pid=fork();
if(pid==0){
printf("child\n");
execl("/bin/ls","ls",".", "-l", 0);

}
else{
printf("parent\n");
wait(&status);
}
}


/*______________________________________________________________________________*/


#include<stdio.h>
#include<stdio.h>
#include<sys/signal.h>
#include<unistd.h>

main()
{
int i, status, pid;
char *myargs[]={"ls","-l","/",NULL};
pid=fork();
if(pid==0){
printf("child\n");
execv("/bin/ls",myargs);

}
else
printf("parent\n");
wait(&status);
}

Nessun commento:

How to deploy Podman images to OpenShift Container Platform (CRC on localhost)

I have a microservice on localhost and I want to deploy its Podman image on OCP, which I am running using CRC on localhost.       1. Get the...