[−][src]Enum librs::linux::syscall::amd64::Syscall
Syscall numbers.
Variants
Read from a file descriptor and return number of bytes read:
read
(
FileDescriptor file,
Buffer buffer,
usize count,
)
-> usize;
Write to a file descriptor and return number of bytes written:
write
(
FileDescriptor file,
Buffer buffer,
usize count,
)
-> usize;
Implementations
impl Syscall
[src]
pub fn read<T>(file: RawFd, buffer: T, count: usize) -> Result<Success, Failure> where
T: Pointer,
[src]
T: Pointer,
Safeish wrapper for Read
.
Read from count
bytes from file descriptor file
into buffer
.
Errors
Fails if result is negativ.
Safety
Assuming this Syscall
exists on this machine,
is conforming to the standard and
the buffer
is large enough,
this wrapper is safe.
Examples
Read 16 bytes from Standard Input to buffer
:
let buffer = [u8;16]; let length = Syscall::read(fs::STDIN, &buffer, buffer.len());
pub fn write<T>(
file: RawFd,
buffer: T,
count: usize
) -> Result<Success, Failure> where
T: Pointer,
[src]
file: RawFd,
buffer: T,
count: usize
) -> Result<Success, Failure> where
T: Pointer,
Safeish wrapper for Write
.
Write count
bytes from buffer
to file descriptor file
.
Errors
Fails if result is negativ.
Safety
Assuming this Syscall
exists on this machine,
is conforming to the standard and
the buffer
is large enough,
this wrapper is safe.
Examples
Write »Hello World« to Standard Output:
let buffer = "HelloWorld\n"; let length = Syscall::write(fs::STDOUT, &buffer, buffer.len());
pub fn open(
pathName: &str,
flags: Flags,
mode: Mode
) -> Result<Success, Failure>
[src]
pathName: &str,
flags: Flags,
mode: Mode
) -> Result<Success, Failure>
Safeish wrapper for Open
.
Open and possibly create the file pathName
with given flags
.
Set permissions to mode
if creating the file.
Errors
Fails if result is negativ.
Safety
Assuming this Syscall
exists on this machine,
is conforming to the standard and
the pathName
is null-terminated,
this wrapper is safe.
Examples
Read 16 bytes from Standard Input to buffer
:
let buffer = [u8;16]; let length = Syscall::read(fs::STDIN, &buffer, buffer.len());
impl Syscall
[src]
pub unsafe fn call0(self) -> Result<Success, Failure>
[src]
pub unsafe fn call1(self, argument0: impl Argument) -> Result<Success, Failure>
[src]
pub unsafe fn call2(
self,
argument0: impl Argument,
argument1: impl Argument
) -> Result<Success, Failure>
[src]
self,
argument0: impl Argument,
argument1: impl Argument
) -> Result<Success, Failure>
pub unsafe fn call3(
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument
) -> Result<Success, Failure>
[src]
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument
) -> Result<Success, Failure>
pub unsafe fn call4(
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument
) -> Result<Success, Failure>
[src]
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument
) -> Result<Success, Failure>
pub unsafe fn call5(
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument,
argument4: impl Argument
) -> Result<Success, Failure>
[src]
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument,
argument4: impl Argument
) -> Result<Success, Failure>
pub unsafe fn call6(
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument,
argument4: impl Argument,
argument5: impl Argument
) -> Result<Success, Failure>
[src]
self,
argument0: impl Argument,
argument1: impl Argument,
argument2: impl Argument,
argument3: impl Argument,
argument4: impl Argument,
argument5: impl Argument
) -> Result<Success, Failure>
Auto Trait Implementations
impl RefUnwindSafe for Syscall
impl Send for Syscall
impl Sync for Syscall
impl Unpin for Syscall
impl UnwindSafe for Syscall
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,