RFCS: Add backdoors for using FDs with HSL IO #177
fredemmott
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OS\FileDescriptor
->IO\Handle
If an
OS\FileDescriptor
is obtained/operated on via some unusual mechanism, there is currently no public way to convert it to anIO\Handle
.While we can't provide type safety - or even true runtime safety - as we're aiming for 100% completeness, we should provide a clearly-discouraged way to do this.
For example, perhaps a
File\ReadWriteHandle
could be created byFile\fdopen_read_write_UNSAFE($fd)
; we could similarly addUnix\fdopen_UNSAFE()
andTCP\fdopen_UNSAFE()
Accessing arbitrary file descriptors by number
This is currently intentionally disallowed due to:
For both of these:
It's also important to note that this isolation is really just making it harder, due to the presence of
/dev/fd
and/or/proc/self/fd
(depending on the platform). On the one hand, as we don't really have the isolation we want it doesn't hurt as much - but, on the other hand, we don't need to add it as the OS already provides a mechanismBeta Was this translation helpful? Give feedback.
All reactions