No-std Linux direct syscall library
Pure Rust system call tracer with source-aware correlation for Rust binaries
Emulate Apache NuttX RTOS for Arm64 with Unicorn Emulator (Avaota-A1 SBC)
A crate to allow, deny, or trace Linux syscalls with an ergonomic, auto-generated enum customized for your system architecture.
A tool to search information of syscalls based on the API https://api.syscall.sh. You can search for a syscall number or name and filter for an architecture.
Traits and macros to help define a syscall interface for a kernel.
No-std Linux direct syscall library
Windows inline syscalls for Rust
A framework for building syscall interposers for user-space Linux applications
syscall-alt
Implementation of T3L2: Visualizing tangram 'OS' with batch processing system.
rCore Tutorial ch2 (batch / trap / syscall), fork suffix yks23 for crates.io.
An extension that lists the system's supported syscalls (e.g. SYS_open, SYS_write, etc.)
Parses /usr/include/asm/unistd_*.h at require-time and creates two hash-constants; Syscalls::BY_NAME, Syscalls::BY_NUMBER.
On platforms using glibc 1.25+ Process.pid always issue a syscall which is wasteful. pid_cache prevents that.
Provides syscalls to the monotonically increasing system clock
The splice family of Linux system calls can transfer data between file descriptors without the need to copy data into userspace. Instead of a userspace buffer, they rely on an ordinary Unix pipe as a kernel-level buffer. The `splice' and `tee' syscalls are also provided by the {sleepy_penguin}[https://yhbt.net/sleepy_penguin/] library. "io_splice" remains maintained for old applications or users experimenting with the vmsplice syscalls
= Cirron Cirron measures a piece of Ruby code and reports back several performance counters: CPU instruction count, branch misses, page faults and time spent measuring. It uses the Linux perf events interface or @ibireme's KPC demo[https://gist.github.com/ibireme/173517c208c7dc333ba962c1f0d67d12] on OSX. It can also trace syscalls using +strace+, Linux only! == Prerequisites - Linux with perf events support / Apple ARM OSX - C++ - Ruby 3.x == Usage === Performance Counters $ sudo irb irb(main):001> require 'cirron' => true irb(main):002* c = Cirron::collector do irb(main):003* puts "Hello" irb(main):004> end Hello => Counter(time_enabled_ns: 110260, instruction_count: 15406, branch_misses: 525, page_faults: 0) === Tracing Syscalls $ sudo irb irb> require 'cirron' => true irb> trace = Cirron::tracer do irb> # Your code here irb> puts "Hello" irb> end => [#<Syscall:0x00007c6c1a4b3608 @args="1, [{iov_base=\"Hello\", iov_len=5}, {iov_base=\"\\n\", iov_len=1}], 2", @duration="0.000201", @name="writev", @pid="2261962", @retval="6", @timestamp="1720285300.334976">] # Save the trace for ingesting to Perfetto irb> File.write("/tmp/trace", Cirron::to_tef(trace)) => 267 === Tampering with Syscalls Available tampering actions are: error: Inject a fault with the specified errno. retval: Inject a success with the specified return value. signal: Deliver the specified signal on syscall entry. delay_enter: Delay syscall entry by the specified time. delay_exit: Delay syscall exit by the specified time. poke_enter: Modify memory at argN on syscall entry. poke_exit: Modify memory at argN on syscall exit. syscall: Inject a different syscall instead. The when argument can be used to specify when to perform the tampering. See the Tampering section of the [strace manual page](https://man7.org/linux/man-pages/man1/strace.1.html) for more detailed explanaition of the arguments. ``` $ sudo irb irb> require 'cirron' irb> injector = Cirron.injector irb> injector.inject("openat", "error", "ENOSPC") irb> injector.inject("openat", "delay_enter", "1s", when_condition="2+2") irb> injector.run do irb> # Open now fails with "No space left on device" and every irb> # other call to `openat` will be delayed by 1s. irb> File.open("test.txt", "w") irb> end ``` == Additional Information For more detailed information, please visit the project's GitHub page: https://github.com/s7nfo/Cirron
Wraps the Linux TCP_USER_TIMEOUT (and optional SO_KEEPALIVE) socket options behind a fiber-safe block API. Sockets opened inside the block inherit a deadline the kernel itself enforces — Ruby threads parked in blocking syscalls that Thread#kill and Timeout.timeout cannot interrupt are released when the kernel drops the connection. No-op on macOS and other non-Linux platforms.