LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-29-2004, 09:06 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
what exactly is "block" mean


I have encountered many "block"s while reading the linux programming book. what does it exactly mean?
for example, i am reading upon how to use waitpid(pid_t, int *, int)
the 3rd int which is a flag could contain WHOHANG, and WUNTRACED
the book says "WHOHANG return immediately if no child has exited - do not block if the status cannot be obtained; return a value of 0, not the PID.
WUNTRACED return immediately if child is blocked"

can anyone explain to me what those "blocked" means here? thanks
 
Old 09-29-2004, 09:16 PM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
"block" means it freezes the process. Like, if you did "getchar();" it would block the process until the user hit ENTER. So when you call waitpid(), it will block the process until the child exits -- it waits for the child. If the child has already exited by the time you call waitpid() then waitpid() will not block -- it will return right away. Does that make sense?
 
Old 09-29-2004, 09:38 PM   #3
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
yes it does, thanks for all of your help man
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
VFS: Cannot open root device "cobd1" or unknown-block(117,1) lorenzobalan Linux - General 4 12-12-2007 06:19 PM
New kernel - VFS: Cannot open root device "301" or unknown block(3,1) j0y Debian 2 04-30-2005 09:14 PM
VFS: Cannot open root device "1601" or unknown-block(22,1) takehora Slackware 3 06-11-2004 08:34 PM
"/dev/cdrom is not a valid block device" error kungfuhokie Fedora 4 06-11-2004 06:55 AM
Kernel 2.6.1 /dev/cdrom "not a valid block device" jwjensen Linux - General 8 01-27-2004 12:50 PM

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

All times are GMT -5. The time now is 02:36 PM.

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