base: revert oneshot_async service types, fix local fork deps, migrate remote to RedBear-OS
- Revert initfs/rootfs service types from oneshot_async to blocking Scheme/Notify/Oneshot to fix init ordering races. - Add /scheme/pci retry loop in pcid-spawner. - Bump redox_event to 0.4.8; use local paths for redox-ioctl and redox-rt. - Regenerate Cargo.lock / bootstrap/Cargo.lock with only local forks. - Update submodule origin from redbear-os-base.git to RedBear-OS.git branch submodule/base per single-repo policy.
This commit is contained in:
@@ -446,6 +446,22 @@ pub unsafe extern "C" fn redox_write_v1(fd: usize, ptr: *const u8, len: usize) -
|
||||
})) as isize
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_openat_v1(
|
||||
fd: usize,
|
||||
buf: *const u8,
|
||||
path_len: usize,
|
||||
flags: u32,
|
||||
fcntl_flags: u32,
|
||||
) -> isize {
|
||||
let path = unsafe { core::slice::from_raw_parts(buf, path_len) };
|
||||
let path_str = match core::str::from_utf8(path) {
|
||||
Ok(s) => s,
|
||||
Err(_) => return -(syscall::EINVAL as isize),
|
||||
};
|
||||
Error::mux(syscall::openat(fd, path_str, flags as usize, fcntl_flags as usize)) as isize
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe fn redox_dup_v1(fd: usize, buf: *const u8, len: usize) -> isize {
|
||||
Error::mux(syscall::dup(fd, unsafe {
|
||||
@@ -458,6 +474,46 @@ pub extern "C" fn redox_close_v1(fd: usize) -> isize {
|
||||
Error::mux(syscall::close(fd)) as isize
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn redox_fcntl_v0(fd: usize, cmd: usize, arg: usize) -> isize {
|
||||
Error::mux(syscall::fcntl(fd, cmd, arg)) as isize
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_strerror_v1(
|
||||
dst: *mut u8,
|
||||
dst_len: *mut usize,
|
||||
error: u32,
|
||||
) -> isize {
|
||||
let msg = match error {
|
||||
x if x == syscall::EPERM as u32 => "Operation not permitted",
|
||||
x if x == syscall::ENOENT as u32 => "No such file or directory",
|
||||
x if x == syscall::EINTR as u32 => "Interrupted system call",
|
||||
x if x == syscall::EIO as u32 => "I/O error",
|
||||
x if x == syscall::EBADF as u32 => "Bad file descriptor",
|
||||
x if x == syscall::EAGAIN as u32 => "Resource temporarily unavailable",
|
||||
x if x == syscall::ENOMEM as u32 => "Cannot allocate memory",
|
||||
x if x == syscall::EACCES as u32 => "Permission denied",
|
||||
x if x == syscall::EFAULT as u32 => "Bad address",
|
||||
x if x == syscall::EBUSY as u32 => "Device or resource busy",
|
||||
x if x == syscall::EEXIST as u32 => "File exists",
|
||||
x if x == syscall::ENOTDIR as u32 => "Not a directory",
|
||||
x if x == syscall::EISDIR as u32 => "Is a directory",
|
||||
x if x == syscall::EINVAL as u32 => "Invalid argument",
|
||||
x if x == syscall::ENOSYS as u32 => "Function not implemented",
|
||||
x if x == syscall::ENOTEMPTY as u32 => "Directory not empty",
|
||||
_ => "Unknown error",
|
||||
};
|
||||
let msg_bytes = msg.as_bytes();
|
||||
unsafe {
|
||||
let avail = *dst_len;
|
||||
let copy_len = avail.min(msg_bytes.len());
|
||||
core::ptr::copy_nonoverlapping(msg_bytes.as_ptr(), dst, copy_len);
|
||||
*dst_len = copy_len;
|
||||
copy_len as isize
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_sys_call_v0(
|
||||
fd: usize,
|
||||
|
||||
Reference in New Issue
Block a user