If tcsetpgrp() is called by a background process and there is a SIGTTOU handler installed without SA_RESTART set, tcsetpgrp() will return -1 and set errno to EINTR.
Index: lib/libc/termios/tcsetpgrp.3 =================================================================== RCS file: /cvs/src/lib/libc/termios/tcsetpgrp.3,v retrieving revision 1.13 diff -u -p -u -r1.13 tcsetpgrp.3 --- lib/libc/termios/tcsetpgrp.3 10 Jul 2016 00:48:21 -0000 1.13 +++ lib/libc/termios/tcsetpgrp.3 7 Mar 2017 18:47:51 -0000 @@ -77,6 +77,10 @@ is set to indicate the error, as follows The .Fa fd argument is not a valid file descriptor. +.It Bq Er EINTR +The +.Fn tcsetpgrp +function was interrupted by a signal. .It Bq Er EINVAL An invalid value of .Fa pgrp_id