about summary refs log tree commit diff
path: root/debug
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-04-15 19:17:18 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-04-17 14:08:12 +0200
commite55a55acb19400a26db4e7eec6d4649e364bc8d4 (patch)
treefca631642e03fac830b83537e672dd732303e051 /debug
parent76d0f094dd177e303b36d7b77e21673f244a4b53 (diff)
downloadglibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.tar.gz
glibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.tar.xz
glibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.zip
hurd: Avoid extra ctty RPCs in init_dtable ()
It is common to have (some of) stdin, stdout and stderr point to the
very same port. We were making the ctty RPCs that _hurd_port2fd () does
for each one of them separately:

1. term_getctty ()
2. mach_port_deallocate ()
3. term_open_ctty ()

Instead, let's detect this case and duplicate the ctty port we already
have. This means we do 1 RPC instead of 3 (and create a single protid
on the server side) if the file is our ctty, and no RPCs instead of 1
if it's not. A clear win!

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Diffstat (limited to 'debug')
0 files changed, 0 insertions, 0 deletions