[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: esperar por fork()



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 19 November 2001 11:30, Swat wrote:
> Hola gente!!!
>
> Como puedo hacer para que un proceso padre espera a que hallan finalizado
> todos los hijos (fork() )... He estado probando con wait, wait4.. y no lo
> consigo... Alguna sugerencia, thx!
>
> Swat
A ver si te vale esto:

    switch(pid2=fork()){
    case -1:
	...
      break;
    case 0:  /* child */
	..
    default: 
      while (pid2 != wait(&status));
      
Best Regards,

Ramón Pons Vivanco
- -- 
Your own qualities will help prevent your advancement in the world.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjv5kgwACgkQZOQ0b7kuf9C9hQCfTwGuk0ueLOl9Y+9IcndOfDYC
NiYAn0SUSpjgdV9uW9NH05HK4GWvXM3d
=+ic6
-----END PGP SIGNATURE-----



Reply to: