Ex2 and 3
Ex2 and 3
Exp.no: 2
Date:
Aim:
Study :
UNIX commands are a set of basic instructions that can be executed in a terminal window
to perform various tasks in a UNIX-based operating system, such as Linux and macOS.
Here are some common UNIX commands:
Exp.no: 3
Date:
Aim:
To Process Management using System Calls : Fork, Exec, Getpid, Exit, Wait, Close.
Algorithm:
Step 3: If fork() returns a negative value, print an error message and exit with an error code
Step 5.2: Call wait() to wait for the child process to complete
Step 5.3: Print a message to the console indicating that the child process has completed
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int main() {
pid_t pid;
Result :