WNOHANG

[purple]i've seen the following in a program:[code]
while(waitpid(-1, NULL, WNOHANG) > 0);[/code]
my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
[/purple]
[hr][purple]~Donotalo()[/purple]

Comments

  • : [purple]i've seen the following in a program:[code]
    : while(waitpid(-1, NULL, WNOHANG) > 0);[/code]
    : my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    Hi
    because it's a defined number or a const variable, so you must define or declared it before using it.
  • [b][red]This message was edited by gautam at 2006-10-29 4:10:12[/red][/b][hr]
    [b][red]This message was edited by gautam at 2006-10-29 4:6:30[/red][/b][hr]
    : : [purple]i've seen the following in a program:[code]
    : : while(waitpid(-1, NULL, WNOHANG) > 0);[/code]
    : : my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
    : : [/purple]
    : : [hr][purple]~Donotalo()[/purple]
    : :
    : 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.


  • : [b][red]This message was edited by gautam at 2006-10-29 4:10:12[/red][/b][hr]
    : [b][red]This message was edited by gautam at 2006-10-29 4:6:30[/red][/b][hr]
    : : : [purple]i've seen the following in a program:[code]
    : : : while(waitpid(-1, NULL, WNOHANG) > 0);[/code]
    : : : my compiler gives me error here, WNOHANG is undeclared. can anyone tell me in which header it is declared?
    : : : [/purple]
    : : : [hr][purple]~Donotalo()[/purple]
    : : :
    : : 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.
    :
    :
    : [purple]
    i'm programming in windows. i tried including stdlib.h but it doesnt help. further suggestion?
    [/purple]

    [hr][purple]~Donotalo()[/purple]

  • : : : : [purple]i've seen the following in a program:[code]
    : : : : while(waitpid(-1, NULL, WNOHANG) > 0);[/code]
    : : 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.
    : :
    : :
    : : [purple]
    : 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.
  • : : 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.
    :
    [purple]
    searching done. but there is no WNOHANG defined anywhere! my compiler is dev c++. is there any alternative?
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • : : : 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.
    : :
    : [purple]
    : searching done. but there is no WNOHANG defined anywhere! my compiler is dev c++. is there any alternative?
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    :

    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...
  • hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
  • : hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
    :
    [purple]oh i'm too dumb. u r right. i shud have check about waitpid.
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • : : hey , waitpid does not work on Windows platform, it does not support Linux/Unix type of processes.
    : :
    : [purple]oh i'm too dumb. u r right. i shud have check about waitpid.
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    :
    Try WaitForSingleObject on windows.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories