fork: add redox_fcntl_v0 + redox_rt::sys::fcntl for redox-scheme 0.11.2
Imported from upstream relibc master: redox_fcntl_v0 in src/platform/redox/libredox.rs and a thin redox_rt::sys::fcntl(fd, cmd, arg) wrapper around syscall::fcntl. redox-scheme 0.11.2 from crates.io references redox_fcntl_v0 directly (it is declared as an extern in libredox 0.1.18 and our local fork has it). Without this symbol, every user daemon that uses redox-scheme 0.11.2 fails to link with: undefined reference to redox_fcntl_v0. This is the kind of upstream-tracking gap that the AGENTS.md fork-sync policy exists to close. Upstream already had the function; we just had not replayed that part of upstream history into the fork yet. Bump the relibc fork forward in functional terms; no Cargo.toml version change (per AGENTS.md fork-sync policy, the upstream-tag part stays '0.2.5' and the rb-counter resets on a real upstream bump, not on function additions).
This commit is contained in:
@@ -561,3 +561,8 @@ pub fn std_fs_call_rw(fd: usize, payload: &mut [u8], metadata: &StdFsCallMeta) -
|
||||
pub fn fstat(fd: usize, stat: &mut syscall::Stat) -> Result<usize> {
|
||||
std_fs_call_ro(fd, stat, &StdFsCallMeta::new(StdFsCallKind::Fstat, 0, 0))
|
||||
}
|
||||
|
||||
pub fn fcntl(fd: usize, cmd: usize, arg: usize) -> Result<usize> {
|
||||
let _siglock = tmp_disable_signals();
|
||||
FdGuard::new(syscall::fcntl(fd, cmd, arg)).map(|g| g.as_raw_fd())
|
||||
}
|
||||
|
||||
@@ -378,6 +378,11 @@ pub unsafe extern "C" fn redox_close_v1(fd: usize) -> RawResult {
|
||||
Error::mux(syscall::close(fd))
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_fcntl_v0(fd: usize, cmd: usize, arg: usize) -> RawResult {
|
||||
Error::mux(redox_rt::sys::fcntl(fd, cmd, arg))
|
||||
}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub unsafe extern "C" fn redox_get_pid_v1() -> RawResult {
|
||||
redox_rt::sys::posix_getpid() as _
|
||||
|
||||
Reference in New Issue
Block a user