diff --git a/lib/libc/gen/tcgetpgrp.3 b/lib/libc/gen/tcgetpgrp.3 --- a/lib/libc/gen/tcgetpgrp.3 +++ b/lib/libc/gen/tcgetpgrp.3 @@ -62,9 +62,27 @@ .Fa fd is not the controlling terminal. .El +.Sh NOTES +If +.Fn tcgetpgrp +is called from a background process and the terminal supports job control, +a +.Dv SIGTTIN +signal will be generated unless it is blocked or ignored. +If the signal is defaulted, the calling process will be stopped. +If the signal is caught and a handler is installed, the system call will fail +with +.Er EINTR . +To avoid this, applications should block or ignore +.Dv SIGTTIN +when invoking +.Fn tcgetpgrp +from a background process. .Sh SEE ALSO .Xr setpgid 2 , .Xr setsid 2 , +.Xr sigaction 2 , +.Xr signal 3 , .Xr tcsetpgrp 3 .Sh STANDARDS The diff --git a/lib/libc/gen/tcsetpgrp.3 b/lib/libc/gen/tcsetpgrp.3 --- a/lib/libc/gen/tcsetpgrp.3 +++ b/lib/libc/gen/tcsetpgrp.3 @@ -79,9 +79,28 @@ argument does not match the process group ID of a process in the same session as the calling process. .El +.Sh NOTES +If +.Fn tcsetpgrp +is called from a background process and the terminal supports +job control, a +.Dv SIGTTOU +signal will be generated unless it is blocked or ignored. +If the signal is defaulted, the calling process will be stopped. +If the signal is caught and a handler is installed, +the system call will fail +with +.Er EINTR . +To avoid this, applications should block or ignore +.Dv SIGTTOU +when invoking +.Fn tcsetpgrp +from a background process. .Sh SEE ALSO .Xr setpgid 2 , .Xr setsid 2 , +.Xr sigaction 2 , +.Xr signal 3 , .Xr tcgetpgrp 3 .Sh STANDARDS The