Subject: killpg() gone?
To: Current NetBSD users <current-users@netbsd.org>
From: Gandhi woulda smacked you <greywolf@starwolf.com>
List: current-users
Date: 04/07/1999 13:38:47
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--1461840922-1680273712-923517527=:3194
Content-Type: TEXT/PLAIN; charset=US-ASCII

I looked under /usr/include/sys/syscall.h and killpg is nowhere
to be found, save a 4.3 compatibility reference.

I am running 1.3I (/sparc, if that matters!), and COMPAT_43 is enabled
(last time I disabled it the tty drivers stopped working).

# kill -1 -3003
-3003: No such process
# perl -e '$rv = kill(-1, 3003); print "$rv\n";'
0
#

So the shell can't kill process groups, and perl can't kill process
groups via perl::kill(), and I can't find the syscall number for
killpg() to have perl call it directly.

So, I can't kill process groups.

Why not?!?  I didn't think that the notion of process groups was THAT
far gone.

The reason I'm asking about all this is that I have a shell process
which forks a subshell in the background and exits.  This creates not
one, but TWO processes belonging to that shell.  The value of one is
received in $! of the parent, but then there's this second one, for
some reason.  It's almost as though the fork forks.  I'll include the
script.

This is, to my mind, broken on two fronts:

	- killpg is still registered as a system call in the man pages.

	- forked processes should not show up twice.


Here's the script (attached).  For the curious, it's supposed to
generate random signatures to a pipe.  But pine refuses to use a pipe as
a signature file, so I have the script redirect to a file every two
minutes if a -r [regular file] flag is supplied.  Yes, it's a hack, but
it works fine elsewhere.

				--*greywolf;
--
"We have discovered a bug in System V: the OS itself."

--1461840922-1680273712-923517527=:3194
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=sigd
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.02.9904071338470.3194@starwolf.starwolf.com>
Content-Description: 
Content-Disposition: attachment; filename=sigd

IyEgL2Jpbi9zaCAtDQojIHNpZ2QgLSBTaWduYXR1cmUgU2VydmVyIERhZW1v
bg0KIyBTaXRzIGFuZCBmZWVkcyBzaWduYXR1cmVzIHRvICRIT01FLy5zaWdu
YXR1cmUNCg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