[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-diffutils] bug#33965: handling of closed file descriptors
From: |
Bruno Haible |
Subject: |
[bug-diffutils] bug#33965: handling of closed file descriptors |
Date: |
Thu, 03 Jan 2019 21:02:16 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) |
I wrote:
> the result of fcntl
> can apparently be used to distinguish the substitute file descriptor
> stuffed in by exec() from a regular open("/dev/null",O_RDONLY).
Note that the code works for STDIN_FILENO, where fcntl(...) is 5 in one case
and 0 in the other case, and we use FD_CLOEXEC = 1 to distinguish the two.
For STDOUT_FILENO, fcntl(...) would be 5 in one case and 1 in the other case,
and the flag which allows to distinguish the two cases (4) is not listed in
<sys/fcntl.h>, therefore likely is a kernel-private flag.
Bruno
- [bug-diffutils] bug#33965: handling of closed file descriptors, Bruno Haible, 2019/01/03
- [bug-diffutils] bug#33965: handling of closed file descriptors,
Bruno Haible <=
- [bug-diffutils] bug#33965: bug#33965: handling of closed file descriptors, Jim Meyering, 2019/01/04
- [bug-diffutils] bug#33965: bug#33965: bug#33965: handling of closed file descriptors, Paul Eggert, 2019/01/04
- [bug-diffutils] bug#33965: bug#33965: handling of closed file descriptors, Bruno Haible, 2019/01/04
- [bug-diffutils] bug#33965: bug#33965: handling of closed file descriptors, Paul Eggert, 2019/01/04
- [bug-diffutils] bug#33965: bug#33965: handling of closed file descriptors, Bruno Haible, 2019/01/05
- [bug-diffutils] bug#33965: handling of closed file descriptors, Bruno Haible, 2019/01/05
- [bug-diffutils] bug#33965: handling of closed file descriptors, Paul Eggert, 2019/01/05
- Message not available
- [bug-diffutils] bug#33965: handling of closed file descriptors, Paul Eggert, 2019/01/06