GRASS on Linux

Michael Shapiro shapiro at zorro.cecer.army.mil
Wed Jul 22 17:28:00 EDT 1992


|
|
|/grass/src/display/devices/XDRIVER/XDRIVER/ would not compile properly
|unless I commented out a line in SWITCHER.c. The d.mon command seems to work
|fine, but I'd rather know what the problem is with SWITCHER.c. The line I
|comment out is #139: setpgrp(0, getpid()). If I leave it in I get the
|following error:
|
|	SWITCHER.c: In function 'main'
|	SWITCHER.c:139: too many arguments to function setpgrp
|

setpgrp() is used to change the process group to be distinct from the
process group of the keyboard. This prevents keyboard interrupts from
unintentionally killing the monitor (ie if you comment this line out,
run and interrupt any program, the monitor will also die).

The problem is that some version of Unix have only one argument to setpgrp()
and other have two. It is a hack, but the two argument call works even
when only one is expected. However, your compiler notices and won't compile.
Replace this call with setpgrp(0) and see (1) if it compiles and (2) if
it protected from interrupts.




More information about the grass-user mailing list