std/sys
This package may not be fully viewable as it is documented using juledoc
. Due to its low-level nature, it contains many specific definitions. For more detailed documentation, refer to the source code.
Index
fn GetLastErrno(): Errno
fn NewTimeval(sec: i64, usec: i64, mut &out: Timeval): bool
fn Seek(handle: int, offset: i64, origin: int): i64
unsafe fn Read(handle: int, mut buff: *unsafe, n: uint): int
fn Close(handle: int): int
unsafe fn Write(handle: int, buff: *unsafe, n: uint): int
fn Exit(code: int)
fn Htons(x: int): u16
fn Ntohs(x: int): u16
unsafe fn Select(nfds: int, mut read: *Fd, mut write: *Fd, mut err: *Fd, mut timeout: *Timeval): int
type Errno
type Timeval
type Sockaddr
type SockaddrIn
type SockaddrIn6
type Fd
GetLastErrno
fn GetLastErrno(): Errno
Returns number of last error.
NewTimeval
fn NewTimeval(sec: i64, usec: i64, mut &out: Timeval): bool
Creates new Timeval by sec and usec. Sets fields of the out. Reports whether sec and usec have valid range. If sec or usec have invalid range, out will not be mutated.
Seek
fn Seek(handle: int, offset: i64, origin: int): i64
Wrapper for C's lseek function.
Read
unsafe fn Read(handle: int, mut buff: *unsafe, n: uint): int
Wrapper for C's read function.
Close
fn Close(handle: int): int
Wrapper for C's close function.
Write
unsafe fn Write(handle: int, buff: *unsafe, n: uint): int
Wrapper for C's write function.
Exit
fn Exit(code: int)
Wrapper for C's exit.
Htons
fn Htons(x: int): u16
C's htons macro.
Ntohs
fn Ntohs(x: int): u16
C's ntohs macro.
Select
unsafe fn Select(nfds: int, mut read: *Fd, mut write: *Fd, mut err: *Fd, mut timeout: *Timeval): int
C's select function.
Errno
type Errno: int
Type of error numbers.
Timeval
type Timeval: cpp.timeval
C's timeval structure.
Sockaddr
type Sockaddr: cpp.sockaddr
C's sockaddr structure.
SockaddrIn
type SockaddrIn: cpp.sockaddr_in
C's sockaddr_in structure.
SockaddrIn6
type SockaddrIn6: cpp.sockaddr_in6
C's sockaddr_in6 structure.
Fd
type Fd: cpp.fd_set
C's fd_set structure.