-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add mount2 syscall #1024
Add mount2 syscall #1024
Conversation
To fix the pub fn option_into_with_c_str<T, F, A: Arg>(a: Option<A>, f: F) -> io::Result<T>
where
A: Sized,
F: FnOnce(Option<&CStr>) -> io::Result<T>,
{
if let Some(a) = a {
a.into_with_c_str(|p| f(Some(p)))
} else {
f(None)
}
} |
It should work I believe. I was thinking of something similar but I wanted to wait for other opinions first |
While testing I realized that that data should not be an |
Sorry for resurrecting an old PR, but I don't think this is correct. When are these parameters null during a mount? @morr0ne I think you misunderstood the API. If you want |
It has been quite a while since I opened this pr so I do not properly remember what my needs were. I believe this is what I needed this for: https://github.com/morr0ne/woven/blob/48e5e68c736fb7578c58fb847cb4e00dd73aba2e/system/src/raminit.rs#L86 |
Wouldn't the empty string work? |
It might. I followed examples of how c programs used the api and the manual pages. Both pointed to using null and it does work |
Alrighty, I've submitted #1112 to deprecate that API while also allow passing in null for options. |
Adds a mount2 syscall.
This is actually the same as the current mount syscall. The main difference being the function parameters which are arguably wrong in the original implementation since it did not account for certain values being null.
This pr is incomplete since the parameters have been changed from
Arg
to&CStr
. This is not inline with other apis and should be fixed but I could not figure out how to convert the types properly. I temporarily used a different type because I needed to use the function. Help fixing the parameters would be appreciated.