From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,260d88b0692fc907 X-Google-Attributes: gid1164f8,public From: torvalds@linux.cs.Helsinki.FI (Linus Torvalds) Subject: Re: vfork on Dec Alpha buggy? Date: 1996/12/21 Message-ID: <59h345$9qh@linux.cs.Helsinki.FI>#1/1 X-Deja-AN: 205282405 references: <59b722$6k4@usenet.pa.dec.com> content-type: text/plain; charset=ISO-8859-1 organization: University of Helsinki mime-version: 1.0 newsgroups: comp.sys.dec In article <59b722$6k4@usenet.pa.dec.com>, Burkhard Neidecker-Lutz wrote: >In article chammer@hrz.uni-bielefeld.de (Carsten Hammer) writes: >> < program modifying a global variable under vfork in a child and hoping >> to see the change in the parent deleted> >>For Reference look at Richard W. Stevens 'Advanced Programming in the Unix >>Environment' > >You are relying on undefined (or rather, implementation defined) behaviour. >BSD derived systems (such as Ultrix and SUNOS 4.1.3) will yield 7 on >your program, while machines with proper copy-on-write semantics even on >vfork will yield 6 (such as Digital Unix and Linux). vfork() is an abomination, and should be shunned if possible. Burkhard is correct in that both Digital UNIX and Linux will just silently do a "fork()" regardless of what the user expected, in the hope that the user doesn't care and just wants to get some old program that used vfork() running. However, future versions of Linux probably _will_ support traditional vfork() behaviour, if only because it's pretty trivial to do with the new Linux kernel threads model. That doesn't mean that I'd encourage people to dust off their old programs, but if people really _want_ the functionality I could code it up (only for Linux, though, don't expect any OSF kernel patches from me ;) Anybody who really has a program that would benefit from a "real" vfork() on top of Linux is encoraged to contact me and tell me so, maybe I'll get it going sooner that way.. Linus