Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ucsd!rutgers!att!cbnews!lvc From: lvc@cbnews.ATT.COM (Lawrence V. Cipriani) Newsgroups: comp.lang.c Subject: Re: C optimizer Summary: so what Keywords: C pure function optimization Message-ID: <4359@cbnews.ATT.COM> Date: 26 Feb 89 15:14:05 GMT References: <515@larry.UUCP> <9648@smoke.BRL.MIL> <36034@bbn.COM> <9705@smoke.BRL.MIL> Organization: AT&T Network Systems Lines: 16 In article <9705@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: ! In article <4276@cbnews.ATT.COM> lvc@cbnews.ATT.COM (Lawrence V. Cipriani) writes: ! -How about if the left hand getpid() is called, and before the right hand ! -getpid() is called a signal comes in, causing a signal handler to be called, ! -then the signal handler does a fork. Then, the interrupt handler returns ! -and the right hand getpid() is called. Voila! ! ! Anyone who fork()s then returns inside a signal handler deserves to suffer. Yes, but so what. The question basically was "Is getpid() != getpid() ever true." It was not restricted to what was reasonable or common coding practice, or sanctioned by the pANS, or your personal preference, or anything else. It isn't necessary to say something is a bad idea when that wasn't asked, so I didn't. -- Larry Cipriani, att!cbnews!lvc or lvc@cbnews.att.com