Operating Systems Lab Manual / OS Exec families C Program

Program Name

Write a C Program for OS Exec families
Theory
Exec function family functions(execl, execlp, execle, execv and execvp) are used to execute a file.
The exec family of functions replaces the current running process with a new process.

int execl(const char *path, const char *arg, …, NULL);
int execlp(const char *file, const char *arg, …, NULL );
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);
int execle(const char *path, const char *arg, …, NULL, char * const envp[] );
int execve(const char *file, char *const argv[], char *const envp[]);
Program Code


Input:

Output:
Stat Demo
USER ID is 0
GROUP ID IS 0
no of links 0
Time of last file access Wed Mar  4 05:51:52 1970
Time of last file modification Sun Apr  7 02:36:01 1974
Time of last file status change Wed Nov  6 00:36:28 1935

Block size 134513381
no of blocks 5365748
File size -1077859208
Inode no:0Id of device containing a dir entry for this file is 0
Id of device for char special or blk special file is 134513552


Home     Back