Hi,
I was wondering what makes a daemon goes to sleep?
In the sense of actual code...
For example, when running a daemon the output is usually
"example daemon 1736 (example) going to sleep"
Assuming this daemon is the type of program which listens
on a /dev device node for a special string and once it receives
it, it will run some tasks.
Example code:
Code:
main() {
...
char buff[128] = {0};
fd = open("/dev/example", O_RDONLY");
len = read(fd, buff, 128);
close(fd);
..
}
what is the meaning of the {0} in the buff deceleration?
ADDON:
actually, i've noticed there's no special sleeping function
in the code i was looking at and it's actually an lkm that
controls the userspace process.
thanks anyway