diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-04-15 19:17:18 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-04-17 14:08:12 +0200 |
commit | e55a55acb19400a26db4e7eec6d4649e364bc8d4 (patch) | |
tree | fca631642e03fac830b83537e672dd732303e051 /soft-fp/getf2.c | |
parent | 76d0f094dd177e303b36d7b77e21673f244a4b53 (diff) | |
download | glibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.tar glibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.tar.gz glibc-e55a55acb19400a26db4e7eec6d4649e364bc8d4.tar.bz2 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 'soft-fp/getf2.c')
0 files changed, 0 insertions, 0 deletions