Subject: Re: removing duplicated code from compat version of sys_waitsys
To: None <>
From: David Laight <>
List: tech-kern
Date: 02/13/2003 19:06:07
Well, I received 1 comment, about the format of a comment and
the suggestion that there should be man 9 pages.

I presume that means no one is worried :-)

Shall I commit them before they get stale?


On Tue, Feb 04, 2003 at 04:03:06PM +0000, David Laight wrote:
> The code of sys_waitsys() is replicated in 5 different parts of the
> kernel source.  The routine in non-trivial and it is quite easy for
> the routines to get out of sync - as indeed they are at the moment.
> The change below splits syswait_sys() into 3, only the smaller
> part has to be replicated in the 'compat' routines.
> The 2 new routines are:
>     int find_stopped_child(struct proc *, pid_t, int, struct proc **);
> which searches for a child process in an appropriate state, and:
>     void proc_free(struct proc *);
> which frees all the data areas associated with a process after it is
> finished with.
> I'm fairly happy that the standard sys_waitsys() if fine, however
> I can't test the compat versions so it would be useful if someone
> would volunteer.  In particulat compat/irix only applies to sgimips,
> compat/netbsd32 and compat/svr4_32 to sparc64 and I don't have
> any binaries for compat/svr4.
> A job control shell probably tests the important paths - the most
> likely errors are (as always) inverted comparisons.
> Oh, christos thinks this is a good idea :-)
> These diffs make the changes look much worse than they actually are...

David Laight: