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

Switch to libc wrapper instead of raw syscall for gettid() and execveat() #2156

Open
SteveLauC opened this issue Oct 5, 2023 · 3 comments
Open

Comments

@SteveLauC
Copy link
Member

gettid() was initially added in #293, at that time, we didn't have a libc wrapper so we had to involve the syscall() directly. The wrapper in glibc was added in 2.30, and the libc crate has exposed this interface since this PR, so we probably should switch to the libc wrapper and get rid of the raw syscall.

My concern, on Linux/glibc, it is available since 2.30, but the current supported glibc version is 2.17, so I am afraid we will have conpatibility issue just like this one #2146

@SteveLauC
Copy link
Member Author

SteveLauC commented Oct 5, 2023

execveat() was added in #800, still no libc wrapper at that time, but for now, from its man page, glibc seems to have a wrapper for it since 2.34, the libc crate has not exposed it yet

Update: musl, uClibc and bionic(Android) don't have a wrapper for execveat(), I will add a binding for glibc to the libc crate

@SteveLauC SteveLauC changed the title Switch to libc wrapper instead of raw syscall for gettid() Switch to libc wrapper instead of raw syscall for gettid() and execveat() Oct 5, 2023
@SteveLauC
Copy link
Member Author

I will add a binding for glibc to the libc crate

PR filed

@asomers
Copy link
Member

asomers commented Oct 5, 2023

Nice research.

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

No branches or pull requests

2 participants