[comp.unix.questions] BSD job control

rac@sherpa.UUCP (Roger Cornelius) (09/01/90)

I'm attempting to port a program which uses BSD job control for use
with POSIX job control under system 5.  Can someone explain to me what
the BSD function sigsetmask() does.  I would also like to know what
the TIOCLGET and TIOCLSET ioctl() requests do.

Are BSD manuals available to non-BSD sites, and if so, from where?

Thanks.
-- 
Roger A. Cornelius          rac@sherpa.UUCP         uunet!sherpa!rac

gt0178a@prism.gatech.EDU (BURNS,JIM) (09/02/90)

in article <323@sherpa.UUCP>, rac@sherpa.UUCP (Roger Cornelius) says:
>                                         Can someone explain to me what
> the BSD function sigsetmask() does.

NAME
     sigsetmask - set current signal mask

SYNOPSIS
     sigsetmask(mask);
     int mask;

DESCRIPTION
     Sigsetmask sets the current signal mask (those signals which
     are blocked from delivery).  Signal i is blocked if the i-th
     bit in mask is a 1.

     The system quietly disallows SIGKILL, SIGSTOP, or SIGCONT to
     be blocked.

RETURN VALUE
     The previous set of masked signals is returned.

SEE ALSO
     kill(2), sigvec(2), sigblock(2), sigpause(2)

In other words, sigsetmask(2) allows you to disallow delivery of signals
in critical sections of code. Sigsetmask *sets* the signal mask. Similarly
sigblock(2) *adds* to the current signal mask. Signal 1 maps to bit 0
(right most) and signal 32 (if you go that high - see 'kill -l') maps to
bit 31 (left most). On systems w/16 bit ints, the parameter types would
probably be defined differently.
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

seindal@skinfaxe.diku.dk (Rene' Seindal) (09/03/90)

rac@sherpa.UUCP (Roger Cornelius) writes:

> Are BSD manuals available to non-BSD sites, and if so, from where?

USENIX and EUUG sells 4.3 manuals.

Rene' Seindal (seindal@diku.dk)

decot@hpisod2.HP.COM (Dave Decot) (09/07/90)

> I'm attempting to port a program which uses BSD job control for use
> with POSIX job control under system 5.  Can someone explain to me what
> the BSD function sigsetmask() does.  I would also like to know what
> the TIOCLGET and TIOCLSET ioctl() requests do.

sigprocmask() is the POSIX equivalent of BSD's sigsetmask(), although
the mask arguments must be constructed differently.

  TIOCLGET
       Get the process group control mode word and store it in
       the int referenced by arg.  This command is allowed
       from a background process; however, the information may
       be subsequently changed by a foreground process.

  TIOCLSET
       Set the process group control mode word to the value of
       the int referenced by arg.

  TIOCLBIS
       Use the int referenced by arg as a mask of bits to set
       in the process group control mode word.

  TIOCLBIC
       Use the int referenced by arg as a mask of bits to
       clear in the process group control mode word.

These are used to get, set, and clear flags such as TOSTOP
(which controls whether a background process group receives
a SIGTTOU signal when one of its process writes to its
controlling terminal).

Dave Decot
HP