pub fn sys_uname(&self, buf: UserOutPtr<u8>) -> SysResult {
        info!("uname: buf={:?}", buf);

        let release = alloc::string::String::from(concat!(env!("CARGO_PKG_VERSION"), "-zcore"));
        #[cfg(not(target_os = "none"))]
        let release = release + "-libos";

        let vdso_const = kernel_hal::vdso::vdso_constants();

        #[cfg(target_arch = "x86_64")]
        let arch = "x86_64";
        #[cfg(target_arch = "riscv64")]
        let arch = "riscv64";

        let strings = [
            "Linux",                            // sysname
            "zcore",                            // nodename
            release.as_str(),                   // release
            vdso_const.version_string.as_str(), // version
            arch,                               // machine
            "rcore-os",                         // domainname
        ];

        for (i, &s) in strings.iter().enumerate() {
            const OFFSET: usize = 65;
            buf.add(i * OFFSET).write_cstring(s)?;
        }
        Ok(0)
    }
/// get name and information about current kernel
get name and information about current kernel
get name and information about current kernel
pub fn sys_uname(&self, buf: UserOutPtr<u8>) -> SysResult {
        info!("uname: buf={:?}", buf);
        let release = alloc::string::String::from(concat!(env!("CARGO_PKG_VERSION"), "-zcore"));
        #[cfg(not(target_os = "none"))]
        let release = release + "-libos";
        let vdso_const = kernel_hal::vdso::vdso_constants();
        #[cfg(target_arch = "x86_64")]
        let arch = "x86_64";
        #[cfg(target_arch = "riscv64")]
        let arch = "riscv64";
        let strings = [
            "Linux",                            // sysname
            "zcore",                            // nodename
            release.as_str(),                   // release
            vdso_const.version_string.as_str(), // version
            arch,                               // machine
            "rcore-os",                         // domainname
        ];
        for (i, &s) in strings.iter().enumerate() {
            const OFFSET: usize = 65;
            buf.add(i * OFFSET).write_cstring(s)?;
        }
        Ok(0)
    }
pub fn sys_uname ( & self , buf : UserOutPtr < u8 > ) -> SysResult { info ! ( " " buf ) ; let release = alloc :: string :: String :: from ( concat ! ( env ( " " ) " " ) ) ; # [ cfg ( not ( target_os " " ) ) ] let release = release + " " ; let vdso_const = kernel_hal :: vdso :: vdso_constants ( ) ; # [ cfg ( target_arch " " ) ] let arch = " " ; # [ cfg ( target_arch " " ) ] let arch = " " ; let strings = [ " " , // sysname " " , // nodename release . as_str ( ) , // release vdso_const . version_string . as_str ( ) , // version arch , // machine " " , // domainname ] ; for ( i , & s ) in strings . iter ( ) . enumerate ( ) { const OFFSET : usize = 65 ; buf . add ( i * OFFSET ) . write_cstring ( s ) ? ; } Ok ( 0 ) }
get name and information about current kernel
get name and information about current kernel
&self
buf
UserOutPtr<u8>
&self
buf
UserOutPtr<u8>