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

TEEOS: Fix octal notation for O_* constants #3840

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

nathaniel-bennett
Copy link
Contributor

Resolves #3532

@rustbot
Copy link
Collaborator

rustbot commented Aug 16, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35
Copy link
Contributor

Thanks, this looks fine to me but do you have a link to the teeos headers to check against?

@tgross35 tgross35 enabled auto-merge August 16, 2024 19:06
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 16, 2024
@tgross35 tgross35 added this pull request to the merge queue Aug 16, 2024
@nathaniel-bennett
Copy link
Contributor Author

teeos directly pulls in musl libc headers as its source of constants, based on what the platform support page says (https://doc.rust-lang.org/nightly/rustc/platform-support/aarch64-unknown-teeos.html) and what its builld script does (https://gitee.com/openharmony-sig/tee_tee_os_kernel/blob/master/build/build_tee.sh#L60). It uses the O_* constants from musl on the kernel side of things (https://gitee.com/openharmony-sig/tee_tee_os_kernel/blob/master/user/system-services/system-servers/fs_base/fs_wrapper_ops.c#L151). Based on the musl implementation, these indeed use the C octal variant of constant values:

/~https://github.com/bminor/musl/blob/dd1e63c3638d5f9afb857fccf6ce1415ca5f1b8b/arch/arm/bits/fcntl.h

#define O_CREAT        0100
#define O_EXCL         0200
#define O_NOCTTY       0400
#define O_TRUNC       01000
#define O_APPEND      02000
#define O_NONBLOCK    04000
#define O_DSYNC      010000
#define O_SYNC     04010000
#define O_RSYNC    04010000
#define O_DIRECTORY  040000
#define O_NOFOLLOW  0100000
#define O_CLOEXEC  02000000

Merged via the queue into rust-lang:main with commit 6eddffb Aug 16, 2024
39 checks passed
@tgross35
Copy link
Contributor

Thanks! Just trying to get the sources linked in all the PRs since tracing some of these APIs back can be painful.

@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
3 participants