Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!src.honeywell.com!msi.umn.edu!cs.umn.edu!ux.acs!eric From: eric@ux.acs.umn.edu (Merlinus Ambrosius) Newsgroups: comp.lang.c Subject: fork() is returning > 0 ??? Message-ID: <2691@ux.acs.umn.edu> Date: 9 Nov 90 21:48:50 GMT Reply-To: eric@ux.acs.umn.edu (Merlinus Ambrosius) Organization: Weylani-Yutano Corporation Lines: 31 Can you explain why in this piece of code, fork() is returning a value other than -1 or 0? When it works fine in other situations in the same program? I tried changing switch (fork ()) { to switch (fix = fork ()) { where fix is declared as an int, no difference (as expected), fix does get the pid of the child. switch (fork ()) { case -1: Msg (errno, "fork"); /*NOTREACHED*/ case 0: break; default: Attacher (); /*NOTREACHED*/ } It always ends up in the default case, which shouldn't be happening. For now, I'm just going to stick a break in the default before it calls Attacher(), but any ideas on what could be going on here would be wonderful. Thanks, Eric -- /----------"Oh carrots are divine, you get a dozen for dime, its maaaagic."-- |Eric (the "Mentat-Philosopher") Hendrickson University of Minnesota |eric@ux.acs.umn.edu ehend@hp370b.cfsmo.honeywell.com The game is afoot! \---"What does 'masochist' and 'amnesia' mean? Beats me, I don't know."----