Move more daemon_start code into Rust

This commit is contained in:
topjohnwu
2025-04-28 16:03:14 -07:00
committed by John Wu
parent 73840f8721
commit d1829308e9
7 changed files with 97 additions and 77 deletions

View File

@@ -16,7 +16,7 @@ impl Utf8CStr {
}
}
pub fn remount_with_flags(&self, flags: c_ulong) -> OsResult<()> {
pub fn remount_mount_point_flags(&self, flags: c_ulong) -> OsResult<()> {
unsafe {
libc::mount(
ptr::null(),
@@ -29,6 +29,19 @@ impl Utf8CStr {
}
}
pub fn remount_mount_flags(&self, flags: c_ulong) -> OsResult<()> {
unsafe {
libc::mount(
ptr::null(),
self.as_ptr(),
ptr::null(),
libc::MS_REMOUNT | flags,
ptr::null(),
)
.check_os_err("remount", Some(self), None)
}
}
pub fn remount_with_data(&self, data: &Utf8CStr) -> OsResult<()> {
unsafe {
libc::mount(