Article View: news.software.nntp
Article #34956Re: NNTP revision - it's about time?
From: Andrew Gierth
Date: Sat, 23 Jan 1999 00:00
Date: Sat, 23 Jan 1999 00:00
39 lines
2756 bytes
2756 bytes
>>>>> "Fluffy" == Fluffy <meowing@banet.net> writes:
>> You seem to be misunderstanding vfork(), which is bugger-all use for
>> the nnrpd-daemon situation (it's only ever useful if you're going to
>> immediately follow the fork with an exec() call, because it suspends
>> the parent process until either that happens or the child dies.)
Fluffy> This will confuse the heck out of linuxheads, where fork and
Fluffy> vfork are the same call and so work interchangeably (it's got
Fluffy> copy-on-write so it's cheap enough to do it that way).
On many other systems besides Linux vfork() is either synonymous with
fork() or absent. On others, such as SCO OpenSwerver, vfork() copies
the address space (copy-on-write) etc., but still suspends the parent
process until the child execs or dies.
The "true" vfork() is actually quite a rare and elusive beast. But you
should only write code that calls vfork() if you understand the
restrictions on what the child process can do with it.
The Single Unix specification, incidentally, defines vfork as follows:
DESCRIPTION
The vfork() function has the same effect as fork(), except that
the behaviour is undefined if the process created by vfork()
either modifies any data other than a variable of type pid_t used
to store the return value from vfork(), or returns from the
function in which vfork() was called, or calls any other function
before successfully calling _exit() or one of the exec family of
functions.
This, you can see, is quite restrictive on what programs can do
(portably) in the child branch of a vfork.
--
Andrew.
Technical Details
Message-ID:
<87emom94ux.fsf@erlenstar.demon.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<77nr30$15t$1@taliesin.netcom.net.uk> <77qfel$kb@meow.invalid> <782g8m$ardu$1@newssvr03-int.news.prodigy.com> <slrn7a9u1l.pgt.meowing@meowhost.meow.invalid> <78annp$8pac$1@newssvr03-int.news.prodigy.com> <87g1939f3h.fsf@erlenstar.demon.co.uk> <slrn7ai6ma.oi7.meowing@meowhost.meow.invalid>Show Full Headers
Complete Article Headers
Message-ID: <87emom94ux.fsf@erlenstar.demon.co.uk> Subject: Re: NNTP revision - it's about time? Date: Sat, 23 Jan 1999 00:00:00 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> References: <77nr30$15t$1@taliesin.netcom.net.uk> <77qfel$kb@meow.invalid> <782g8m$ardu$1@newssvr03-int.news.prodigy.com> <slrn7a9u1l.pgt.meowing@meowhost.meow.invalid> <78annp$8pac$1@newssvr03-int.news.prodigy.com> <87g1939f3h.fsf@erlenstar.demon.co.uk> <slrn7ai6ma.oi7.meowing@meowhost.meow.invalid> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 435840267 X-Mayan-Date: Long count = 12.19.5.15.17; tzolkin = 4 Caban; haab = 10 Muan X-Complaints-To: andrew@erlenstar.demon.co.uk Organization: disorganised X-Attribution: AG X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-P-Persistent-Headers: are a bad idea. Newsgroups: news.software.nntp X-Post-Filter: postfilter v0.01 alpha