LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2007, 02:56 AM   #1
liri
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Rep: Reputation: 0
sleeping daemons


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

Last edited by liri; 10-03-2007 at 03:00 AM. Reason: resolution
 
Old 10-03-2007, 05:27 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Initialises all elements to value of zero.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ddclient sleeping zmdlan Linux - Networking 4 06-28-2006 11:54 AM
sleeping eth1 eth777 Linux - Networking 0 09-13-2005 12:17 PM
Sleeping Nukem Mandriva 6 01-07-2004 05:03 AM
Sleeping system wyvis Linux - General 4 01-17-2002 05:06 PM
Sleeping SAMBA CPUNeck Linux - Newbie 3 11-27-2001 12:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration