Skip to content

flags: switch OpenFlags to u64#381

Merged
cyphar merged 3 commits into
mainfrom
flags-u64
Jun 1, 2026
Merged

flags: switch OpenFlags to u64#381
cyphar merged 3 commits into
mainfrom
flags-u64

Conversation

@cyphar
Copy link
Copy Markdown
Owner

@cyphar cyphar commented May 29, 2026

Recently it seems that OPENAT2_* flags will start taking up bits of the
higher 32-bits available with openat2(2) and so we will need to be able
to represent them.

Signed-off-by: Aleksa Sarai aleksa@amutable.com

@cyphar cyphar added api/cffi Related to the C-FFI API. api/procfs Related to the procfs API. api/root Related to the Root API. api/handle Related to the handle API. impact/breaking A change that will break our APIs in a backwards-incompatible way. labels May 29, 2026
@cyphar cyphar added this to the 0.2.5 milestone May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 97.29730% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/flags.rs 92.30% 1 Missing ⚠️
src/syscalls.rs 95.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

CString::into_raw will leak memory, we should use CStr::as_ptr but bind
to a local variable. This is "only" test code but it would be nice to
avoid leaking memory like this.

Fixes: cfb756c ("capi: change *link arguments to match syscall API")
Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
cyphar added 2 commits June 1, 2026 14:44
Recently it seems that OPENAT2_* flags will start taking up bits of the
higher 32-bits available with openat2(2) and so we will need to be able
to represent them.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
Now that OpenFlags is a u64 we can directly embed it into OpenHow and
remove all of the "as u64" casts we had for this case.

Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
@cyphar cyphar merged commit 0541ca7 into main Jun 1, 2026
119 checks passed
@cyphar cyphar deleted the flags-u64 branch June 1, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api/cffi Related to the C-FFI API. api/handle Related to the handle API. api/procfs Related to the procfs API. api/root Related to the Root API. impact/breaking A change that will break our APIs in a backwards-incompatible way.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant