Skip to content

(seq. #2454) support non bool values in setsockopt#2455

Open
zyuiop wants to merge 6 commits into
hermit-os:mainfrom
zyuiop:feat/systemcalls-setsockopt
Open

(seq. #2454) support non bool values in setsockopt#2455
zyuiop wants to merge 6 commits into
hermit-os:mainfrom
zyuiop:feat/systemcalls-setsockopt

Conversation

@zyuiop
Copy link
Copy Markdown
Contributor

@zyuiop zyuiop commented Jun 1, 2026

Add non boolean values in setsockopt.

Initially, I used a similar structure for getsockopt but I rebased on the latest PRs and removed that to rely on c_int only, hoping we don't implement string sockopt values anytime soon. However, I have for now kept this flexibility in setsockopt. We may want to rewrite that to use c_int instead, for consistency?

This PR has been split from #2454 but relies on its feature flag (not completely critical to be fair)

@zyuiop zyuiop force-pushed the feat/systemcalls-setsockopt branch from d5016b1 to dac9aec Compare June 1, 2026 18:38
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 555421a Previous: a025f19 Performance Ratio
startup_benchmark Build Time 112.42 s 116.82 s 0.96
startup_benchmark File Size 0.77 MB 0.77 MB 1.00
Startup Time - 1 core 1.00 s (±0.03 s) 1.00 s (±0.03 s) 1.00
Startup Time - 2 cores 0.98 s (±0.04 s) 1.04 s (±0.05 s) 0.95
Startup Time - 4 cores 0.99 s (±0.04 s) 1.02 s (±0.05 s) 0.97
multithreaded_benchmark Build Time 108.38 s 117.48 s 0.92
multithreaded_benchmark File Size 0.87 MB 0.84 MB 1.04
Multithreaded Pi Efficiency - 2 Threads 89.82 % (±15.72 %) 85.06 % (±19.28 %) 1.06
Multithreaded Pi Efficiency - 4 Threads 43.93 % (±7.87 %) 42.20 % (±9.32 %) 1.04
Multithreaded Pi Efficiency - 8 Threads 24.06 % (±3.67 %) 23.57 % (±5.00 %) 1.02
micro_benchmarks Build Time 94.30 s 92.09 s 1.02
micro_benchmarks File Size 0.88 MB 0.84 MB 1.04
Scheduling time - 1 thread 74.14 ticks (±3.87 ticks) 73.19 ticks (±3.39 ticks) 1.01
Scheduling time - 2 threads 42.82 ticks (±4.89 ticks) 44.10 ticks (±6.54 ticks) 0.97
Micro - Time for syscall (getpid) 3.15 ticks (±0.25 ticks) 3.09 ticks (±0.16 ticks) 1.02
Memcpy speed - (built_in) block size 4096 72858.42 MByte/s (±50495.37 MByte/s) 73877.55 MByte/s (±50900.64 MByte/s) 0.99
Memcpy speed - (built_in) block size 1048576 29312.30 MByte/s (±24119.93 MByte/s) 29621.41 MByte/s (±24412.82 MByte/s) 0.99
Memcpy speed - (built_in) block size 16777216 25958.09 MByte/s (±21340.57 MByte/s) 26615.80 MByte/s (±21973.01 MByte/s) 0.98
Memset speed - (built_in) block size 4096 73458.80 MByte/s (±50852.11 MByte/s) 74082.46 MByte/s (±51039.25 MByte/s) 0.99
Memset speed - (built_in) block size 1048576 30089.96 MByte/s (±24574.74 MByte/s) 30381.08 MByte/s (±24836.90 MByte/s) 0.99
Memset speed - (built_in) block size 16777216 26622.27 MByte/s (±21728.36 MByte/s) 27365.04 MByte/s (±22427.19 MByte/s) 0.97
Memcpy speed - (rust) block size 4096 65721.81 MByte/s (±46150.30 MByte/s) 67998.13 MByte/s (±47775.53 MByte/s) 0.97
Memcpy speed - (rust) block size 1048576 29327.49 MByte/s (±24153.61 MByte/s) 29415.03 MByte/s (±24216.28 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 26410.63 MByte/s (±21732.02 MByte/s) 26645.15 MByte/s (±21980.78 MByte/s) 0.99
Memset speed - (rust) block size 4096 66613.20 MByte/s (±46784.99 MByte/s) 68410.01 MByte/s (±48051.67 MByte/s) 0.97
Memset speed - (rust) block size 1048576 30099.22 MByte/s (±24596.29 MByte/s) 30182.39 MByte/s (±24662.20 MByte/s) 1.00
Memset speed - (rust) block size 16777216 27137.14 MByte/s (±22174.34 MByte/s) 27320.66 MByte/s (±22364.88 MByte/s) 0.99
alloc_benchmarks Build Time 89.91 s 91.56 s 0.98
alloc_benchmarks File Size 0.84 MB 0.85 MB 1.00
Allocations - Allocation success 100.00 % 100.00 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 100.00 % 100.00 % 1
Allocations - Average Allocation time 4062.33 Ticks (±66.12 Ticks) 4553.50 Ticks (±57.46 Ticks) 0.89
Allocations - Average Allocation time (no fail) 4062.33 Ticks (±66.12 Ticks) 4553.50 Ticks (±57.46 Ticks) 0.89
Allocations - Average Deallocation time 650.27 Ticks (±67.64 Ticks) 1035.15 Ticks (±129.57 Ticks) 0.63
mutex_benchmark Build Time 90.28 s 88.37 s 1.02
mutex_benchmark File Size 0.88 MB 0.84 MB 1.04
Mutex Stress Test Average Time per Iteration - 1 Threads 13.80 ns (±0.75 ns) 14.02 ns (±0.84 ns) 0.98
Mutex Stress Test Average Time per Iteration - 2 Threads 17.52 ns (±9.67 ns) 17.80 ns (±4.95 ns) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@mkroening mkroening self-requested a review June 1, 2026 19:28
@mkroening mkroening self-assigned this Jun 1, 2026
The goal is to permit non boolean options in the future, and also to add the keepalive option which is required by some other software
@zyuiop zyuiop force-pushed the feat/systemcalls-setsockopt branch from dac9aec to 555421a Compare June 1, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants