mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-05 22:21:31 +00:00
add support for mkdir and rm and code cleanup
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
/// Handwritten protocol definitions for XenStore.
|
||||
/// Used xen/include/public/io/xs_wire.h as a reference.
|
||||
use libc;
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
|
||||
#[derive(Copy, Clone, Pod, Zeroable, Debug)]
|
||||
#[repr(C)]
|
||||
@ -9,7 +9,7 @@ pub struct XsdMessageHeader {
|
||||
pub typ: u32,
|
||||
pub req: u32,
|
||||
pub tx: u32,
|
||||
pub len: u32
|
||||
pub len: u32,
|
||||
}
|
||||
|
||||
pub const XSD_CONTROL: u32 = 0;
|
||||
@ -44,25 +44,73 @@ pub const XSD_WRITE_CREATE_EXCL: &str = "CREATE|EXCL";
|
||||
#[repr(C)]
|
||||
pub struct XsError<'a> {
|
||||
num: i32,
|
||||
error: &'a str
|
||||
error: &'a str,
|
||||
}
|
||||
|
||||
pub const XSD_ERROR_EINVAL: XsError = XsError { num: libc::EINVAL, error: "EINVAL" };
|
||||
pub const XSD_ERROR_EACCES: XsError = XsError { num: libc::EACCES, error: "EACCES" };
|
||||
pub const XSD_ERROR_EEXIST: XsError = XsError { num: libc::EEXIST, error: "EEXIST" };
|
||||
pub const XSD_ERROR_EISDIR: XsError = XsError { num: libc::EISDIR, error: "EISDIR" };
|
||||
pub const XSD_ERROR_ENOENT: XsError = XsError { num: libc::ENOENT, error: "ENOENT" };
|
||||
pub const XSD_ERROR_ENOMEM: XsError = XsError { num: libc::ENOMEM, error: "ENOMEM" };
|
||||
pub const XSD_ERROR_ENOSPC: XsError = XsError { num: libc::ENOSPC, error: "ENOSPC" };
|
||||
pub const XSD_ERROR_EIO: XsError = XsError { num: libc::EIO, error: "EIO" };
|
||||
pub const XSD_ERROR_ENOTEMPTY: XsError = XsError { num: libc::ENOTEMPTY, error: "ENOTEMPTY" };
|
||||
pub const XSD_ERROR_ENOSYS: XsError = XsError { num: libc::ENOSYS, error: "ENOSYS" };
|
||||
pub const XSD_ERROR_EROFS: XsError = XsError { num: libc::EROFS, error: "EROFS" };
|
||||
pub const XSD_ERROR_EBUSY: XsError = XsError { num: libc::EBUSY, error: "EBUSY" };
|
||||
pub const XSD_ERROR_EAGAIN: XsError = XsError { num: libc::EAGAIN, error: "EAGAIN" };
|
||||
pub const XSD_ERROR_EISCONN: XsError = XsError { num: libc::EISCONN, error: "EISCONN" };
|
||||
pub const XSD_ERROR_E2BIG: XsError = XsError { num: libc::E2BIG, error: "E2BIG" };
|
||||
pub const XSD_ERROR_EPERM: XsError = XsError { num: libc::EPERM, error: "EPERM" };
|
||||
pub const XSD_ERROR_EINVAL: XsError = XsError {
|
||||
num: libc::EINVAL,
|
||||
error: "EINVAL",
|
||||
};
|
||||
pub const XSD_ERROR_EACCES: XsError = XsError {
|
||||
num: libc::EACCES,
|
||||
error: "EACCES",
|
||||
};
|
||||
pub const XSD_ERROR_EEXIST: XsError = XsError {
|
||||
num: libc::EEXIST,
|
||||
error: "EEXIST",
|
||||
};
|
||||
pub const XSD_ERROR_EISDIR: XsError = XsError {
|
||||
num: libc::EISDIR,
|
||||
error: "EISDIR",
|
||||
};
|
||||
pub const XSD_ERROR_ENOENT: XsError = XsError {
|
||||
num: libc::ENOENT,
|
||||
error: "ENOENT",
|
||||
};
|
||||
pub const XSD_ERROR_ENOMEM: XsError = XsError {
|
||||
num: libc::ENOMEM,
|
||||
error: "ENOMEM",
|
||||
};
|
||||
pub const XSD_ERROR_ENOSPC: XsError = XsError {
|
||||
num: libc::ENOSPC,
|
||||
error: "ENOSPC",
|
||||
};
|
||||
pub const XSD_ERROR_EIO: XsError = XsError {
|
||||
num: libc::EIO,
|
||||
error: "EIO",
|
||||
};
|
||||
pub const XSD_ERROR_ENOTEMPTY: XsError = XsError {
|
||||
num: libc::ENOTEMPTY,
|
||||
error: "ENOTEMPTY",
|
||||
};
|
||||
pub const XSD_ERROR_ENOSYS: XsError = XsError {
|
||||
num: libc::ENOSYS,
|
||||
error: "ENOSYS",
|
||||
};
|
||||
pub const XSD_ERROR_EROFS: XsError = XsError {
|
||||
num: libc::EROFS,
|
||||
error: "EROFS",
|
||||
};
|
||||
pub const XSD_ERROR_EBUSY: XsError = XsError {
|
||||
num: libc::EBUSY,
|
||||
error: "EBUSY",
|
||||
};
|
||||
pub const XSD_ERROR_EAGAIN: XsError = XsError {
|
||||
num: libc::EAGAIN,
|
||||
error: "EAGAIN",
|
||||
};
|
||||
pub const XSD_ERROR_EISCONN: XsError = XsError {
|
||||
num: libc::EISCONN,
|
||||
error: "EISCONN",
|
||||
};
|
||||
pub const XSD_ERROR_E2BIG: XsError = XsError {
|
||||
num: libc::E2BIG,
|
||||
error: "E2BIG",
|
||||
};
|
||||
pub const XSD_ERROR_EPERM: XsError = XsError {
|
||||
num: libc::EPERM,
|
||||
error: "EPERM",
|
||||
};
|
||||
|
||||
pub const XSD_WATCH_PATH: u32 = 0;
|
||||
pub const XSD_WATCH_TOKEN: u32 = 1;
|
||||
@ -77,7 +125,7 @@ pub struct XenDomainInterface {
|
||||
rsp_prod: u32,
|
||||
server_features: u32,
|
||||
connection: u32,
|
||||
error: u32
|
||||
error: u32,
|
||||
}
|
||||
|
||||
pub const XS_PAYLOAD_MAX: u32 = 4096;
|
||||
|
Reference in New Issue
Block a user