Module syscalls

Source

Re-exports§

pub use crate::error::SysError;

Modules§

traits

Structs§

SpawnArgs

Functions§

closeNeither native-simulator nor stub-syscalls
This syscall manually closes a file descriptor. After calling this, any attempt to read/write the file descriptor pointed to the other end would fail. Note: available after ckb 2nd hardfork.
current_cyclesNeither native-simulator nor stub-syscalls
Current Cycles returns current cycle consumption just before executing this syscall. This syscall consumes 500 cycles.
debugNeither native-simulator nor stub-syscalls
Output debug message
execNeither native-simulator nor stub-syscalls
Exec runs an executable file from specified cell data in the context of an already existing machine, replacing the previous executable. The used cycles does not change, but the code, registers and memory of the vm are replaced by those of the new program. It’s cycles consumption consists of two parts:
exitNeither native-simulator nor stub-syscalls
Exit, this script will be terminated after the exit syscall. exit code 0 represents verification is success, others represent error code.
inherited_fdsNeither native-simulator nor stub-syscalls
This syscall retrieves the file descriptors available to the current process, which are passed in from the parent process. These results are copied from the inherited_fds parameter of the Spawn syscall. Note: available after ckb 2nd hardfork.
load_block_extensionNeither native-simulator nor stub-syscalls
Load extension field associated either with an input cell, a dep cell, or a header dep based on source and index value.
load_cellNeither native-simulator nor stub-syscalls
Load cell
load_cell_by_fieldNeither native-simulator nor stub-syscalls
Load cell by field
load_cell_codeNeither native-simulator nor stub-syscalls
Load cell code, read cell data as executable code
load_cell_dataNeither native-simulator nor stub-syscalls
Load cell data, read cell data
load_cell_data_rawNeither native-simulator nor stub-syscalls
Load cell data, read cell data
load_headerNeither native-simulator nor stub-syscalls
Load header
load_header_by_fieldNeither native-simulator nor stub-syscalls
Load header by field
load_inputNeither native-simulator nor stub-syscalls
Load input
load_input_by_fieldNeither native-simulator nor stub-syscalls
Load input by field
load_scriptNeither native-simulator nor stub-syscalls
Load script
load_script_hashNeither native-simulator nor stub-syscalls
Load script hash
load_transactionNeither native-simulator nor stub-syscalls
Load transaction
load_tx_hashNeither native-simulator nor stub-syscalls
Load transaction hash
load_witnessNeither native-simulator nor stub-syscalls
Load witness
pipeNeither native-simulator nor stub-syscalls
This syscall create a pipe with read-write pair of file descriptions. The file descriptor with read permission is located at fds[0], and the corresponding file descriptor with write permission is located at fds[1]. Note: available after ckb 2nd hardfork.
process_idNeither native-simulator nor stub-syscalls
This syscall is used to get the current process id. Root process ID is 0. Note: available after ckb 2nd hardfork.
readNeither native-simulator nor stub-syscalls
This syscall reads data from a pipe via a file descriptor. The syscall Read attempts to read up to value pointed by length bytes from file descriptor fd into the buffer, and the actual length of data read is returned. Note: available after ckb 2nd hardfork.
spawnNeither native-simulator nor stub-syscalls
The parent process calls the Spawn system call, which creates a new process (a child process) that is an independent ckb-vm instance. It’s important to note that the parent process will not be blocked by the child process as a result of this syscall. Note: available after ckb 2nd hardfork.
vm_versionNeither native-simulator nor stub-syscalls
VM version syscall returns current running VM version, so far 2 values will be returned:
waitNeither native-simulator nor stub-syscalls
The syscall pauses until the execution of a process specified by pid has ended. Note: available after ckb 2nd hardfork.
writeNeither native-simulator nor stub-syscalls
This syscall writes data to a pipe via a file descriptor. The syscall Write writes up to value pointed by length bytes from the buffer, and the actual length of data written is returned.