On Wed, Sep 17, 2014 at 01:12, Matti Karnaattu wrote:
> Hi,
> 
> 
> I found that OpenBSD setpgrp is not POSIX compliant, so I write test and
> make diff to fix issue.

Very nice.

> 
> 
> http://pubs.opengroup.org/onlinepubs/009695399/functions/setpgrp.html
> 
> 
> This change removes obsolete setpgrp, and fix /usr/src where it is used.

This can be done in two parts. I definitely agree with the second
half. We should use setpgid in src. Then setpgrp can be fixed when
convenient.

> 2. grep -R /usr/src/setpgrp shows that old way is used a few times but
> skipped by preprocessor directives. can someone advice me with source
> tree and practices? As some of the code is imported from elsewhere and
> cleaning those are probably not good idea if we are not forking here.

A list of locations and why setpgrp isn't used would be helpful. Right
now, everybody has to run that grep and look at the results themselves.


> #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE >= 420 || __BSD_VISIBLE
> Index: lib/libc/compat-43/setpgrp.c
> ===================================================================
> RCS file: /OpenBSD/src/lib/libc/compat-43/setpgrp.c,v
> retrieving revision 1.6
> diff -u -p -u -p -r1.6 setpgrp.c
> --- lib/libc/compat-43/setpgrp.c        8 Aug 2005 08:05:33 -0000       1.6
> +++ lib/libc/compat-43/setpgrp.c        16 Sep 2014 21:27:32 -0000
> @@ -32,7 +32,7 @@
> #include <unistd.h>
> 
> int
> -setpgrp(pid_t pid, pid_t pgid)
> +setpgrp(void)
> {
> -       return(setpgid(pid, pgid));
> +       return(setpgid(0, 0));
> }

Should probably move this file into a different directory at this
point, since it's no longer 4.3 compat.

Reply via email to