Module solana_rbpf::syscalls [−][src]
This module implements some built-in syscalls that can be called from within an eBPF program.
These syscalls may originate from several places:
- Some of them mimic the syscalls available in the Linux kernel.
- Some of them were proposed as example syscalls in uBPF and they were adapted here.
- Other syscalls may be specific to rbpf.
The prototype for syscalls is always the same: five u64 as arguments, and a u64 as a return
value. Hence some syscalls have unused arguments, or return a 0 value in all cases, in order to
respect this convention.
Structs
| BpfGatherBytes | The idea is to assemble five bytes into a single |
| BpfMemFrob | Same as |
| BpfRand | Returns a random u64 value comprised between |
| BpfSqrtI | Compute and return the square root of argument 1, cast as a float. Arguments 2 to 5 are unused. |
| BpfStrCmp | C-like |
| BpfTimeGetNs | Get monotonic time (since boot time) in nanoseconds. All arguments are unused. |
| BpfTracePrintf | Prints its last three arguments to standard output. The first two arguments are unused. Returns the number of bytes written. |
Constants
| BPF_KTIME_GETNS_IDX | Index of syscall |
| BPF_TRACE_PRINTK_IDX | Index of syscall |
Type Definitions
| Result | Return type of syscalls |