kubkon opened PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon requested sunfishcode for a review on PR #1561.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon updated PR #1561 from handle-rights
to master
:
This commit does a lot of reshuffling and even some more. It introduces
strongly-typed system primitives which are:OsFile
,OsDir
,Stdio
,
andOsOther
. Those primitives are separate structs now, each implementing
a subset ofHandle
methods, rather than all being an enumeration of some
supertype such asOsHandle
. To summarise the structs:
OsFile
represents a regular file, and implements fd-ops
ofHandle
trait
OsDir
represents a directory, and primarily implements path-ops, plus
readdir
and some common fd-ops such asfdstat
, etc.
Stdio
represents a stdio handle, and implements a subset of fd-ops
such asfdstat
_and_read_
andwrite_vectored
calls
OsOther
currently represents anything else and implements a set similar
to that implemented byStdio
This commit is effectively an experiment and an excercise into better
understanding what's going on for each OS resource/type under-the-hood.
It's meant to give us some intuition in order to move on with the idea
of having strongly-typed handles in WASI both in the syscall impl as well
as at the libc level.Some more minor changes include making
OsHandle
represent an OS-specific
wrapper for a raw OS handle (Unix fd or Windows handle). Also, sinceOsDir
is tricky across OSes, we also have a supertype ofOsHandle
called
OsDirHandle
which may store aDIR*
stream pointer (mainly BSD). Last but not
least, theFiletype
andRights
are now computed when the resource is created,
rather than every time we callHandle::get_file_type
andHandle::get_rights
.
Finally, in order to facilitate the latter, I've convertedEntryRights
into
HandleRights
and pushed them into eachHandle
implementor.
kubkon requested alexcrichton and sunfishcode for a review on PR #1561.
kubkon requested alexcrichton, pchickey, peterhuene and sunfishcode for a review on PR #1561.
kubkon requested alexcrichton, pchickey, peterhuene and sunfishcode for a review on PR #1561.
Last updated: Nov 22 2024 at 17:03 UTC