main.cpp created
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -86,3 +86,6 @@ dkms.conf
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
settings.json
|
||||||
|
watch.c
|
||||||
|
ncwatchfile
|
||||||
25
main.cpp
Normal file
25
main.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
pid_t parent = getpid();
|
||||||
|
pid_t child = fork();
|
||||||
|
|
||||||
|
if (child > 0) // parent
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else // child
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user