[GRASS5] grass5 on darwin - problem w/init

Glynn Clements glynn.clements at virgin.net
Tue Sep 10 11:13:14 EDT 2002


Crudeli wrote:

> If you are using OSX 10.2 (Jaguar), you might be interested in the 
> following corrections to your autoconf file:
> 
> good luck,
> 
> RafDouglas CTC
> ____________________________
> From:
> 
> http://www.osxgnu.org/#jagbugs
> 
> In the file /usr/share/autoconf/autoconf.m4f line 7294 should read:
> 
> exit (setpgrp (0,0) == -1);])],
> 
> 	not
> 
> exit (setpgrp (1,1) == -1);])],

1. Can you provide any background information for this issue? I don't
generally do things without knowing *why* I'm doing them.

2. I'm not so sure that this change is correct. AFAICT, the idea is
that the call is meant to fail (return -1) if the function accepts any
arguments. However, setpgrp(0,0) will normally succeed.

3. I don't think that it's reasonable to expect developers to hack
their autoconf installation. If this is necessary, I would rather just
add a local definition to GRASS' aclocal.m4, and use that.

4. AC_FUNC_SETPGRP throws an error if cross-compiling, as it needs to
actually *run* the test program.

Unfortunately, simply compiling it isn't sufficient; passing the wrong
number of parameters might only generate a warning. However, gcc will
generate an error if a conflicting prototype is in scope; this might
be good enough for the cross-compiling case.

Alternatively, we might be able to just replace setpgrp() with
setpgid(), which is more standardised, and doesn't require any messy
configure checks.

Note: setpgrp() is only used in two places:

1. src/display/devices/lib/main.c, in main()
2. src/libes/gis/fork.c, in G_fork().

In both cases, the purpose is to move the child process into a new
process group, so that it isn't part of the terminal's foreground
process group.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list