Sujet : Re: Python (was Re: I did not inhale)
De : vallor (at) *nospam* cultnix.org (vallor)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 25. Aug 2024, 14:41:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vafcau$1st8a$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Pan/0.160 (Toresk; 7830f38; Linux-6.11.0-rc5)
On Sun, 25 Aug 2024 12:32:10 +0200, "Dmitry A. Kazakov"
<
mailbox@dmitry-kazakov.de> wrote in <
vaf179$1rnhl$1@dont-email.me>:
On 2024-08-25 09:50, Sebastian wrote:
In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
wrote:
Windows did many things wrong, but accessing file descriptors by
numbers is beyond even Windows. In Windows a file is an OS object. You
access it getting an opaque handle to. Note that a handle can be
marshaled from one process to another. Try that with process-local
numbers!
UNIX domain sockets support the passing of file descriptors between
processes.
File descriptor (a pointer to) is not file number.
You cannot pass number 1 simply because 1 is already in use.
On this Linux system, "man 7 unix", in the section
"SCM_RIGHTS", it explains how the passing mechanism
is handled. One paragraph reads:
Commonly, this operation is referred to as "passing a
file descriptor" to another process. However, more
accurately, what is being passed is a reference to an
open file description (see open(2)), and in the re‐
ceiving process it is likely that a different file de‐
scriptor number will be used. Semantically, this op‐
eration is equivalent to duplicating (dup(2)) a file
descriptor into the file descriptor table of another
process.
-- -v