From a60b7cefc14da58204fada12769f60cd10d26c04 Mon Sep 17 00:00:00 2001 From: Connor-GH Date: Sun, 15 Mar 2026 15:49:10 -0500 Subject: [PATCH] uname: update to reflect version info given from scheme We recently updated the kernel to give the "version" info in the uname scheme. Now, we also put this info in the `utsname` struct for the `uname` function. --- src/platform/redox/mod.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/platform/redox/mod.rs b/src/platform/redox/mod.rs index 3c0d90ac03..86b1ac3d2b 100644 --- a/src/platform/redox/mod.rs +++ b/src/platform/redox/mod.rs @@ -1463,15 +1463,24 @@ impl Pal for Sys { Ok(()) }; + // The file format is currently as follows: + // \n e.g. "Redox" + // \n e.g. "0.9.0" + // \n e.g. "x86_64" + // \n e.g. "yyyy-mm-ddThh:mm:ssZ" + + // A future file format might add the domainname. + + // nodename is handled above with /etc/hostname, and the domainname is + // currently zeroed out. + read_line(sysname.as_slice_mut().cast_slice_to::())?; read_line(release.as_slice_mut().cast_slice_to::())?; read_line(machine.as_slice_mut().cast_slice_to::())?; + read_line(version.as_slice_mut().cast_slice_to::())?; - // Version is not provided - version.as_slice_mut().zero(); - - // Redox doesn't provide domainname in sys:uname - //read_line(domainname.as_slice_mut())?; + // Redox doesn't provide domainname in uname scheme + //read_line(domainname.as_slice_mut().cast_slice_to::())?; domainname.as_slice_mut().zero(); Ok(())