Crate nc[][src]

Re-exports

pub use types::*;

Modules

Constants

Functions

Read/write system parameters.

Accept a connection on a socket.

Check user’s permission for a file.

Switch process accounting.

Add a key to the kernel’s key management facility.

Tune kernel clock. Returns clock state on success.

set an alarm clock for delivery of a signal.

Set architecture-specific thread state.

Bind a name to a socket.

Perform a command on an extended BPF map or program

Change data segment size.

Get capabilities of thread.

Set capabilities of thread.

Change working directory.

Change permissions of a file.

Change ownership of a file.

Change the root directory.

Tune kernel clock. Returns clock state on success.

Get resolution(precision) of the specific clock.

Get time of specific clock.

High resolution sleep with a specific clock.

Set time of specific clock.

Create a child process.

Close a file descriptor.

Initialize a connection on a socket.

Copy a range of data from one file to another.

Create a file. equals to call open() with flags O_CREAT|O_WRONLY|O_TRUNC.

Unlock a kernel module.

Create a copy of the file descriptor oldfd, using the lowest available file descriptor.

Create a copy of the file descriptor oldfd, using the speficified file descriptor newfd.

Save as dup2(), but can set the close-on-exec flag on newfd.

Open an epoll file descriptor.

Open an epoll file descriptor.

Control interface for an epoll file descriptor.

Deprecated.

Wait for an I/O event on an epoll file descriptor.

Wait for an I/O event on an epoll file descriptor.

Deperecated.

Create a file descriptor for event notification.

Create a file descriptor for event notification.

Execute a new program. TODO(Shaohua): type of argv and env will be changed. And return value might be changed too.

Execute a new program relative to a directory file descriptor. TODO(Shaohua): type of argv and env will be changed. And return value might be changed too.

Terminate current process.

Exit all threads in a process’s thread group.

Check user’s permission for a file.

Predeclare an access pattern for file data.

Manipulate file space.

Create and initialize fanotify group.

Add, remove, or modify an fanotify mark on a filesystem object

Change working directory.

Change permissions of a file.

Change permissions of a file.

Change ownership of a file.

Change ownership of a file.

manipulate file descriptor.

Flush all modified in-core data (exclude metadata) refered by fd to disk.

Get extended attribute value.

Load a kernel module.

List extended attribute names.

Apply or remove an advisory lock on an open file.

Create a child process.

Remove an extended attribute.

Set parameters and trigger actions on a context.

Set extended attribute value.

Create a kernel mount representation for a new, prepared superblock.

Open a filesystem by name so that it can be configured for mounting.

Pick a superblock into a context for reconfiguration.

Get file status about a file descriptor.

Get filesystem statistics.

Flush all modified in-core data refered by fd to disk.

Truncate an opened file to a specified length.

Fast user-space locking.

Change timestamp of a file relative to a directory file discriptor.

Retrieve exported kernel and module symbols. Deprecated.

Retrieve NUMA memory policy for a thread

Get list of robust futexes.

Get thread-local storage information.

Determine CPU and NUMA node on which the calling thread is running.

Get current working directory.

Get directory entries.

Get directory entries.

Get the effective group ID of the calling process.

Get the effective user ID of the calling process.

Get the real group ID of the calling process.

Get list of supplementary group Ids.

Get value of an interval timer.

Get name of connected peer socket.

Returns the PGID(process group ID) of the process specified by pid.

Get the process group ID of the calling process.

Get the process ID (PID) of the calling process.

Get the process ID of the parent of the calling process.

Get program scheduling priority.

Obtain a series of random bytes.

Get real, effect and saved group ID.

Get real, effect and saved user ID.

Get resource limit.

Get resource usage.

Get session Id.

Get current address to which the socket sockfd is bound.

Get options on sockets

Get the caller’s thread ID (TID).

Get time.

Get the real user ID of the calling process.

Get extended attribute value.

Load a kernel module.

Add a watch to an initialized inotify instance.

Initialize an inotify instance.

Initialize an inotify instance.

Remove an existing watch from an inotify instance.

Attempts to cancel an iocb previously passed to io_submit. Attempts to cancel an iocb previously passed to io_submit. If the operation is successfully cancelled, the resulting event is copied into the memory pointed to by result without being placed into the completion queue and 0 is returned. May fail with -EFAULT if any of the data structures pointed to are invalid. May fail with -EINVAL if aio_context specified by ctx_id is invalid. May fail with -EAGAIN if the iocb specified was not cancelled. Will fail with -ENOSYS if not implemented.

Destroy the aio_context specified. May cancel any outstanding AIOs and block on completion. Will fail with -ENOSYS if not implemented. May fail with -EINVAL if the context pointed to is invalid.

Attempts to read at least min_nr events and up to nr events from the completion queue for the aio_context specified by ctx_id. If it succeeds, the number of read events is returned. May fail with -EINVAL if ctx_id is invalid, if min_nr is out of range, if nr is out of range, if timeout is out of range. May fail with -EFAULT if any of the memory specified is invalid. May return 0 or < min_nr if the timeout specified by timeout has elapsed before sufficient events are available, where timeout == NULL specifies an infinite timeout. Note that the timeout pointed to by timeout is relative. Will fail with -ENOSYS if not implemented.

read asynchronous I/O events from the completion queue

Create an asynchronous I/O context. Create an aio_context capable of receiving at least nr_events. ctxp must not point to an aio_context that already exists, and must be initialized to 0 prior to the call. On successful creation of the aio_context, *ctxp is filled in with the resulting handle. May fail with -EINVAL if *ctxp is not initialized, if the specified nr_events exceeds internal limits. May fail with -EAGAIN if the specified nr_events exceeds the user’s limit of available events. May fail with -ENOMEM if insufficient kernel resources are available. May fail with -EFAULT if an invalid pointer is passed for ctxp. Will fail with -ENOSYS if not implemented.

Queue the nr iocbs pointed to by iocbpp for processing. Returns the number of iocbs queued. May return -EINVAL if the aio_context specified by ctx_id is invalid, if nr is < 0, if the iocb at *iocbpp[0] is not properly initialized, if the operation specified is invalid for the file descriptor in the iocb. May fail with -EFAULT if any of the data structures point to invalid data. May fail with -EBADF if the file descriptor specified in the first iocb is invalid. May fail with -EAGAIN if insufficient resources are available to queue any iocbs. Will return 0 if nr is 0. Will fail with -ENOSYS if not implemented.

Control device.

Set port input/output permissions.

Change I/O privilege level.

Get I/O scheduling class and priority

Set I/O scheduling class and priority

Compare two processes to determine if they share a kernel resource.

Load a new kernel for later execution.

Load a new kernel for later execution.

Manipulate the kernel’s key management facility.

Send signal to a process.

Change ownership of a file. Does not deference symbolic link.

Get extended attribute value.

Make a new name for a file.

Make a new name for a file.

Listen for connections on a socket.

List extended attribute names.

List extended attribute names.

Return a directory entry’s path.

Remove an extended attribute.

Reposition file offset.

Set extended attribute value.

Get file status about a file, without following symbolic.

Give advice about use of memory.

Set memory policy for a memory range.

sys_membarrier - issue memory barriers on a set of threads @cmd: Takes command values defined in enum membarrier_cmd. @flags: Currently needs to be 0. For future extensions.

Create an anonymous file.

Move all pages in a process to another set of nodes

mincore() returns the memory residency status of the pages in the current process’s address space specified by [addr, addr + len). The status is returned in a vector of bytes. The least significant bit of each byte is 1 if the referenced page is in memory, otherwise it is zero.

Create a directory.

Create a directory.

Create a special or ordinary file.

Create a special or ordinary file.

Lock memory.

Lock memory.

Lock memory.

Map files or devices into memory.

Mount filesystem.

Move a mount from one place to another. In combination with fsopen()/fsmount() this is used to install a new mount and in combination with open_tree(OPEN_TREE_CLONE [| AT_RECURSIVE]) it can be used to copy a mount subtree.

Move individual pages of a process to another node

Set protection on a region of memory.

Get/set message queue attributes

Register for notification when a message is available

Open a message queue.

Receive a message from a message queue

Send message to a message queue

Remove a message queue

Remap a virtual memory address

System V message control operations.

Get a System V message queue identifier.

Receive messages from a System V message queue.

Append the message to a System V message queue.

Synchronize a file with memory map.

Unlock memory.

Unlock memory.

Unmap files or devices from memory.

Obtain handle for a filename

High resolution sleep.

Get file status

Syscall interface to kernel nfs daemon. Deprecated.

Open and possibly create a file.

Obtain handle for an open file

Open and possibly create a file within a directory.

Pause the calling process to sleep until a signal is delivered.

Set up performance monitoring.

Set the process execution domain.

sys_pidfd_send_signal - Signal a process through a pidfd @pidfd: file descriptor of the process @sig: signal to send @info: signal info @flags: future flags

Create a pipe

Create a pipe.

Change the root filesystem.

Create a new protection key.

Free a protection key.

Set protection on a region of memory.

Wait for some event on file descriptors.

Wait for some event on a file descriptor.

Operations on a process.

Read from a file descriptor without changing file offset.

Read from a file descriptor without changing file offset.

Read from a file descriptor without changing file offset.

Get/set the resource limits of an arbitary process.

Transfer data between process address spaces

Transfer data between process address spaces

Sychronous I/O multiplexing. Most architectures can’t handle 7-argument syscalls. So we provide a 6-argument version where the sixth argument is a pointer to a structure which has a pointer to the sigset_t itself followed by a size_t containing the sigset size.

Process trace.

Write to a file descriptor without changing file offset.

Write to a file descriptor without changing file offset.

Write to a file descriptor without changing file offset.

Manipulate disk quotes.

Read from a file descriptor.

Initialize file head into page cache.

Read value of a symbolic link.

Read value of a symbolic link.

Read from a file descriptor into multiple buffers.

Reboot or enable/disable Ctrl-Alt-Del.

Receive a message from a socket.

Receives multile messages on a socket

Receive a msg from a socket.

Create a nonlinear file mapping. Deprecated.

Remove an extended attribute.

Change name or location of a file.

Change name or location of a file.

Change name or location of a file.

Request a key from kernel’s key management facility.

Restart a system call after interruption by a stop signal.

Delete a directory.

Setup restartable sequences for caller thread.

Examine and change a signal action.

Examine pending signals.

Change the list of currently blocked signals.

Queue a signal and data.

Return from signal handler and cleanup stack frame. Never returns.

Wait for a signal. Always returns Errno, normally EINTR.

Synchronously wait for queued signals.

Queue a signal and data.

Get static priority max value.

Get static priority min value.

Get a thread’s CPU affinity mask.

Get scheduling policy and attributes

Get scheduling paramters.

Get scheduling parameter.

Get the SCHED_RR interval for the named process.

Set a thread’s CPU affinity mask.

Set the RT priority of a thread.

Set scheduling paramters.

Set scheduling parameter.

Yield the processor.

Operate on Secure Computing state of the process.

Sychronous I/O multiplexing.

System V semaphore control operations

Get a System V semphore set identifier.

System V semphore operations.

System V semaphore operations

Transfer data between two file descriptors.

Send multiple messages on a socket

Send a message on a socket. Allow sending ancillary data.

Send a message on a socket.

Set default NUMA memory policy for a thread and its children

Set the robust-futex list head of a task.

Set thread-local storage information.

Set pointer to thread ID.

Set NIS domain name.

Set group identify used for filesystem checkes.

Set user identify used for filesystem checkes.

Set the group ID of the calling process to gid.

Set list of supplementary group Ids.

Set hostname

Set value of an interval timer.

Reassociate thread with a namespace.

Set the process group ID (PGID) of the process specified by pid to pgid.

Set program scheduling priority.

Set real and effective group IDs of the calling process.

Set real, effective and saved group Ids of the calling process.

Set real, effective and saved user Ids of the calling process.

Set real and effective user IDs of the calling process.

Set resource limit

Create a new session if the calling process is not a process group leader.

Set options on sockets.

Set system time and timezone.

Set the effective user ID of the calling process to uid.

Set extended attribute value.

Attach the System V shared memory segment.

System V shared memory control.

Detach the System V shared memory segment.

Allocates a System V shared memory segment.

Shutdown part of a full-duplex connection.

Get/set signal stack context.

Create a file descriptor to accept signals.

Create a file descriptor to accept signals.

Create an endpoint for communication.

Create a pair of connected socket.

Splice data to/from pipe.

Get file status about a file.

Get filesystem statistics.

Get file status about a file (extended).

Get errno description.

Stop swapping to file/device.

Start swapping to file/device.

Make a new name for a file.

Make a new name for a file.

Commit filesystem caches to disk.

Sync a file segment to disk

Commit filesystem cache related to fd to disk. let path = “/etc/passwd”; let ret = nc::open(path, nc::O_RDONLY, 0); assert!(ret.is_ok()); let fd = ret.unwrap(); let ret = nc::syncfs(fd); assert!(ret.is_ok()); assert!(nc::close(fd).is_ok());

Get filesystem type information.

Return system information.

Read and/or clear kernel message ring buffer; set console_loglevel

Duplicate pipe content.

Send a signal to a thread.

Get time in seconds.

Create a per-process timer

Delete a per-process timer

Get overrun count for a per-process timer

Fetch state of per-process timer

Arm/disarm state of per-process timer

Create a timer that notifies via a file descriptor.

Get current timer via a file descriptor.

Set current timer via a file descriptor.

Get process times.

Send a signal to a thread (obsolete).

Truncate a file to a specified length.

Set file mode creation mask.

Umount filesystem.

Get name and information about current kernel.

Delete a name and possibly the file it refers to.

Delete a name and possibly the file it refers to.

Disassociate parts of the process execution context

Load shared library.

Create a file descriptor to handle page faults in user space.

Get filesystem statistics

Change file last access and modification time.

Change time timestamps with nanosecond precision.

Change file last access and modification time. let path = “/tmp/nc-utimes”; let ret = nc::open(path, nc::O_WRONLY | nc::O_CREAT, 0o644); assert!(ret.is_ok()); let fd = ret.unwrap(); assert!(nc::close(fd).is_ok()); let times = [ nc::timespec_t { tv_sec: 100, tv_nsec: 0, }, nc::timespec_t { tv_sec: 10, tv_nsec: 0, }, ]; let ret = nc::utimens(path, &times); assert!(ret.is_ok()); assert!(nc::unlink(path).is_ok());

Create a child process and wait until it is terminated.

Virtually hang up the current terminal.

Splice user page into a pipe.

Wait for process to change state.

Wait for process to change state

Write to a file descriptor.

Write to a file descriptor from multiple buffers.

Type Definitions

Error No.