C program to show how to use exit system call. The function exit() is used to exit from a process (or to terminate a process). This works both in Linux or UNIX and Windows operating systems.
#include<stdio.h>
main()
{
int pid;
pid=fork();
printf("%d\n",pid);
if(pid<0)
{
perror("Child can't be executed\n");
exit(-1);
}
else
{
printf("Child created\n");
exit(0);
}
}
Information about resetting and configuring Mobile phones (Java, Android, Symbian etc), educational articles especially for programming in C, C++ and Java and more about Computers and operating systems
How to use exit() System call
Labels:
$ccpp
,
c program
,
code
,
compiled
,
exit
,
lab
,
Linux
,
operating Systems
,
OS
,
programming
,
source code
,
system call
,
UNIX
,
Windows
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment