Cygwin: pinfo: Align CTTY behavior to the statement of POSIX.
commit25c4ad6ea52fc5451193dc98fc5ab04b1f509302
authorTakashi Yano <takashi.yano@nifty.ne.jp>
Tue, 20 Dec 2022 11:26:36 +0000 (20 20:26 +0900)
committerTakashi Yano <takashi.yano@nifty.ne.jp>
Thu, 22 Dec 2022 11:57:17 +0000 (22 20:57 +0900)
tree16a0de464013fabf791737dbfc4ebd5abb7169cb
parent5841b2f6a4208682264d03e3edfa0a09881932a6
Cygwin: pinfo: Align CTTY behavior to the statement of POSIX.

POSIX states "A terminal may be the controlling terminal for at most
one session."
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html

However, in cygwin, multiple sessions could be associated with the
same TTY. This patch aligns CTTY behavior to the statement of POSIX.

Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
winsup/cygwin/fhandler/termios.cc
winsup/cygwin/mm/cygheap.cc
winsup/cygwin/pinfo.cc