Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsapi: adds Oflag to decouple from syscall package #1586

Merged
merged 1 commit into from
Jul 19, 2023
Merged

Conversation

codefromthecrypt
Copy link
Contributor

This adds fsapi.Oflag which includes oflag values needed to support fsapi.FS. Notably, this covers more area than Go does. Go defines portable abstractions for most open flags, but not all. Flags like O_DIRECTORY are needed by wasip1 and not defined in Go as os.O_DIRECTORY. Also, some operating systems don't define these either. Instead we have a new fsapi.Oflag type which includes all flags needed, even if notably in windows behavior is emulated.

}

type readFS struct {
fs fsapi.FS
fsapi.FS
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed like this to stop tedious forward-wrapping

This adds `fsapi.Oflag` which includes oflag values needed to support
`fsapi.FS`. Notably, this covers more area than Go does. Go defines
portable abstractions for most open flags, but not all. Flags like
`O_DIRECTORY` are needed by wasip1 and not defined in Go as
`os.O_DIRECTORY`. Also, some operating systems don't define these
either. Instead we have a new `fsapi.Oflag` type which includes all
flags needed, even if notably in windows behavior is emulated.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
// flags can coexist bitwise.
// - This is like `flag` in os.OpenFile and `oflag` in POSIX. See
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
type Oflag uint32
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the new type

@codefromthecrypt codefromthecrypt merged commit b842d6c into main Jul 19, 2023
@codefromthecrypt codefromthecrypt deleted the oflag branch July 19, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants