C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
WNOHANG Posted by Donotalo on 29 Oct 2006 at 1:02 AM
i've seen the following in a program:
while(waitpid(-1, NULL, WNOHANG) > 0);

my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?


~Donotalo()
Report
Re: WNOHANG Posted by hdayvary on 29 Oct 2006 at 2:17 AM
: i've seen the following in a program:
: while(waitpid(-1, NULL, WNOHANG) > 0);

: my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
:

:
~Donotalo()
:
Hi
because it's a defined number or a const variable, so you must define or declared it before using it.
Report
Re: WNOHANG Posted by gautam on 29 Oct 2006 at 4:04 AM
This message was edited by gautam at 2006-10-29 4:10:12

This message was edited by gautam at 2006-10-29 4:6:30

: : i've seen the following in a program:
: : while(waitpid(-1, NULL, WNOHANG) > 0);

: : my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
: :

: :
~Donotalo()
: :
: Hi
: because it's a defined number or a const variable, so you must define or declared it before using it.
:
Hi,

Try sys/wait.h and on solaris I see sys/wait.h included in stdlib.h as well.

Just to let you know that line of code is quite normal in a program which creates many child processes to take care of zombie processes.


Report
Re: WNOHANG Posted by Donotalo on 29 Oct 2006 at 5:36 AM
: This message was edited by gautam at 2006-10-29 4:10:12

: This message was edited by gautam at 2006-10-29 4:6:30

: : : i've seen the following in a program:
: : : while(waitpid(-1, NULL, WNOHANG) > 0);

: : : my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
: : :

: : :
~Donotalo()
: : :
: : Hi
: : because it's a defined number or a const variable, so you must define or declared it before using it.
: :
: Hi,
:
: Try sys/wait.h and on solaris I see sys/wait.h included in stdlib.h as well.
:
: Just to let you know that line of code is quite normal in a program which creates many child processes to take care of zombie processes.
:
:
:
i'm programming in windows. i tried including stdlib.h but it doesnt help. further suggestion?



~Donotalo()

Report
Re: WNOHANG Posted by IDK on 29 Oct 2006 at 3:37 PM
: : : : i've seen the following in a program:
: : : : while(waitpid(-1, NULL, WNOHANG) > 0);

: : Hi,
: :
: : Try sys/wait.h and on solaris I see sys/wait.h included in stdlib.h as well.
: :
: : Just to let you know that line of code is quite normal in a program which creates many child processes to take care of zombie processes.
: :
: :
: :
: i'm programming in windows. i tried including stdlib.h but it doesnt help. further suggestion?
:


Does pids even exist in windows?
Ofcourse they do...

Try searching all header files for WNOHANG.
Report
Re: WNOHANG Posted by Donotalo on 30 Oct 2006 at 1:11 AM
: : i'm programming in windows. i tried including stdlib.h but it doesnt help. further suggestion?
: : [/purple]
:
: Does pids even exist in windows?
: Ofcourse they do...
:
: Try searching all header files for WNOHANG.
:

searching done. but there is no WNOHANG defined anywhere! my compiler is dev c++. is there any alternative?


~Donotalo()

Report
Re: WNOHANG Posted by IDK on 30 Oct 2006 at 2:55 AM
: : : i'm programming in windows. i tried including stdlib.h but it doesnt help. further suggestion?
: : : [/purple]
: :
: : Does pids even exist in windows?
: : Ofcourse they do...
: :
: : Try searching all header files for WNOHANG.
: :
:
: searching done. but there is no WNOHANG defined anywhere! my compiler is dev c++. is there any alternative?
:

:
~Donotalo()
:
:

Does it compile? Did you write the code yourself? (I suspects the answear to be no on both questions, but better to be sure)

DJGPP, and MinGW seems to be gcc implementations on windows, so it they could maybe help...
Report
Re: WNOHANG Posted by sushant_pate on 30 Oct 2006 at 2:58 AM
hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
Report
Re: WNOHANG Posted by Donotalo on 30 Oct 2006 at 5:04 AM
: hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
:
oh i'm too dumb. u r right. i shud have check about waitpid.


~Donotalo()

Report
Re: WNOHANG Posted by gautam on 30 Oct 2006 at 7:01 PM
: : hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
: :
: oh i'm too dumb. u r right. i shud have check about waitpid.
:

:
~Donotalo()
:
:
Try WaitForSingleObject on windows.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.