OXIESEC PANEL
- Current Dir:
/
/
opt
/
golang
/
1.22.0
/
src
/
syscall
Server IP: 191.96.63.230
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
asan.go
410 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asan0.go
342 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm9_unix2_amd64.s
1.19 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_aix_ppc64.s
540 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_darwin_amd64.s
2.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_darwin_arm64.s
2.83 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_freebsd_arm.s
2.96 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_freebsd_arm64.s
2.79 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_freebsd_riscv64.s
2.76 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_386.s
3.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_amd64.s
1.33 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_arm.s
1.77 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_arm64.s
916 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_loong64.s
947 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_mips64x.s
985 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_mipsx.s
1.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_ppc64x.s
913 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_riscv64.s
861 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_linux_s390x.s
2.15 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_netbsd_arm.s
2.85 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_netbsd_arm64.s
2.88 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_386.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_amd64.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_arm.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_arm64.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_mips64.s
2.85 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_ppc64.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_openbsd_riscv64.s
1.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_plan9_386.s
3.14 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_plan9_amd64.s
3.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_plan9_arm.s
3.25 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_solaris_amd64.s
1.8 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_unix_386.s
2.74 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
asm_unix_amd64.s
2.15 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
bpf_bsd.go
4.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
const_plan9.go
1.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
creds_test.go
3.37 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dir_plan9.go
5.62 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dirent.go
3.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dirent_test.go
3.43 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
dll_windows.go
7.63 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
endian_big.go
249 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
endian_little.go
309 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
env_unix.go
2.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
env_windows.go
1.96 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
errors_plan9.go
1.61 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_aix_test.go
823 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_bsd.go
7.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_freebsd.go
8.43 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_freebsd_test.go
2.41 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_libc.go
8.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_libc2.go
8.19 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_linux.go
22.81 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_linux_test.go
20.37 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_pdeathsig_test.go
4.49 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_plan9.go
13.25 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_solaris_test.go
815 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_unix.go
8.63 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_unix_test.go
8.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_windows.go
10.3 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
exec_windows_test.go
3.11 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_darwin_test.go
348 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_linux_test.go
296 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_rlimit_test.go
262 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_unix_test.go
391 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_wasip1_test.go
267 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
export_windows_test.go
500 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
flock_aix.go
564 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
flock_bsd.go
469 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
flock_linux.go
641 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
flock_linux_32bit.go
511 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
forkpipe.go
604 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
forkpipe2.go
2.6 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
fs_js.go
10.84 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
fs_wasip1.go
24.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
fs_wasip1_test.go
1.98 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
getdirentries_test.go
2.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📁
js
-
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
lsf_linux.go
2.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
mkall.sh
14.62 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mkasm.go
1.88 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
mkerrors.sh
10.71 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mkpost.go
2.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
mksyscall.pl
10.19 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksyscall_libc.pl
8.02 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksyscall_windows.go
1.99 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
mksysctl_openbsd.pl
5.04 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_dragonfly.pl
866 bytes
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_freebsd.pl
1.35 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_linux.pl
1.26 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_netbsd.pl
1.01 KB
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_openbsd.pl
872 bytes
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mksysnum_plan9.sh
459 bytes
02/02/2024 06:09:55 PM
rwxr-xr-x
📄
mmap_unix_test.go
500 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
msan.go
410 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
msan0.go
342 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
net.go
1.19 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
net_fake.go
883 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
net_js.go
1.38 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
net_wasip1.go
1.82 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
netlink_linux.go
4.77 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
os_wasip1.go
252 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
pwd_plan9.go
2.27 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
rlimit.go
1.59 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
rlimit_darwin.go
593 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
rlimit_stub.go
338 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
rlimit_test.go
953 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_bsd.go
9.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_darwin.go
2.01 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_dragonfly.go
2.61 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_freebsd.go
2.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_freebsd_32bit.go
1.14 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_freebsd_64bit.go
762 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_netbsd.go
1.43 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
route_openbsd.go
1.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
security_windows.go
10.01 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
setuidgid_32_linux.go
435 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
setuidgid_linux.go
421 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
sockcmsg_dragonfly.go
547 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
sockcmsg_linux.go
1.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sockcmsg_unix.go
2.51 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
sockcmsg_unix_other.go
1.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall.go
3.78 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_aix.go
17.9 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_aix_ppc64.go
405 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_bsd.go
13.63 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_bsd_test.go
1.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_darwin.go
10.74 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_darwin_amd64.go
1.91 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_darwin_arm64.go
1.82 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_dragonfly.go
8.55 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_dragonfly_amd64.go
1.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd.go
8.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_386.go
1.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_amd64.go
1.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_arm.go
1.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_arm64.go
1.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_riscv64.go
1.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_freebsd_test.go
424 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_illumos.go
613 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_js.go
6.71 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux.go
35.62 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_386.go
10.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_accept.go
961 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_accept4.go
592 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_amd64.go
4.78 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_arm.go
7.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_arm64.go
6.21 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_loong64.go
7.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_mips64x.go
5.98 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_mipsx.go
6.85 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_ppc64x.go
4.63 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_riscv64.go
5.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_s390x.go
7.9 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_linux_test.go
21.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_netbsd.go
7.78 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_netbsd_386.go
716 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_netbsd_amd64.go
709 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_netbsd_arm.go
716 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_netbsd_arm64.go
709 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd.go
6.97 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd1.go
534 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_386.go
715 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_amd64.go
701 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_arm.go
715 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_arm64.go
906 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_libc.go
3.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_mips64.go
970 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_ppc64.go
906 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_openbsd_riscv64.go
906 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_plan9.go
9.37 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_plan9_test.go
1.15 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_ptrace_test.go
768 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_solaris.go
15.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_solaris_amd64.go
487 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_solarisonly.go
304 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_test.go
1.44 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_unix.go
12.11 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_unix_test.go
9.43 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_wasip1.go
9.37 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_windows.go
52.6 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
syscall_windows_test.go
5.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tables_js.go
19.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
tables_wasip1.go
6.49 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
time_fake.go
677 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
time_nofake.go
351 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
timestruct.go
954 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_aix.go
3.35 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_darwin.go
5.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_dragonfly.go
5.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_freebsd.go
6.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_illumos_amd64.go
379 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_linux.go
10.9 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_netbsd.go
4.77 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_openbsd.go
5.04 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_solaris.go
4.88 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_windows.go
27.75 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_windows_386.go
477 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_windows_amd64.go
477 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_windows_arm.go
477 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
types_windows_arm64.go
477 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
wtf8_windows.go
2.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
wtf8_windows_test.go
4.31 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_aix_ppc64.go
47.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_darwin_amd64.go
55.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_darwin_arm64.go
55.79 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_dragonfly_amd64.go
59.62 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_freebsd_386.go
67.35 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_freebsd_amd64.go
67.4 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_freebsd_arm.go
67.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_freebsd_arm64.go
67.41 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_freebsd_riscv64.go
67.41 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_386.go
57.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_amd64.go
57.39 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_arm.go
57.88 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_arm64.go
68.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_loong64.go
82.47 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_mips.go
69.18 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_mips64.go
68.5 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_mips64le.go
68.5 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_mipsle.go
69.18 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_ppc64.go
70.89 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_ppc64le.go
71.84 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_riscv64.go
70.8 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_linux_s390x.go
73.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_netbsd_386.go
67.48 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_netbsd_amd64.go
67.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_netbsd_arm.go
66.49 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_netbsd_arm64.go
67.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_386.go
62.52 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_amd64.go
62.48 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_arm.go
62.47 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_arm64.go
66.36 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_mips64.go
66.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_ppc64.go
67.14 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_openbsd_riscv64.go
67.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_solaris_amd64.go
50.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zerrors_windows.go
9.97 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_aix_ppc64.go
41.4 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_darwin_amd64.go
51.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_darwin_amd64.s
8.7 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_darwin_arm64.go
51.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_darwin_arm64.s
8.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_dragonfly_amd64.go
31.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_freebsd_386.go
31.21 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_freebsd_amd64.go
31.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_freebsd_arm.go
31.23 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_freebsd_arm64.go
31.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_freebsd_riscv64.go
31.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_386.go
34.68 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_amd64.go
39.5 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_arm.go
38.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_arm64.go
37.81 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_loong64.go
37.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_mips.go
40.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_mips64.go
40.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_mips64le.go
40.35 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_mipsle.go
40.34 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_ppc64.go
40.98 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_ppc64le.go
40.99 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_riscv64.go
37.84 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_linux_s390x.go
35.3 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_netbsd_386.go
30.11 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_netbsd_amd64.go
29.97 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_netbsd_arm.go
30.12 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_netbsd_arm64.go
29.97 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_386.go
48.07 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_386.s
8.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_amd64.go
47.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_amd64.s
8.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_arm.go
48.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_arm.s
8.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_arm64.go
47.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_arm64.s
8.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_mips64.go
30.05 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_ppc64.go
47.92 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_ppc64.s
8.78 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_riscv64.go
47.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_openbsd_riscv64.s
8.09 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_plan9_386.go
6.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_plan9_amd64.go
6.18 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_plan9_arm.go
6.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_solaris_amd64.go
37.56 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsyscall_windows.go
56.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysctl_openbsd.go
11.39 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_darwin_amd64.go
14.55 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_darwin_arm64.go
14.39 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_dragonfly_amd64.go
22.94 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_freebsd_386.go
25.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_freebsd_amd64.go
25.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_freebsd_arm.go
25.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_freebsd_arm64.go
35.79 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_freebsd_riscv64.go
35.79 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_386.go
11.27 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_amd64.go
10.11 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_arm.go
11.55 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_arm64.go
8.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_loong64.go
10.28 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_mips.go
12.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_mips64.go
10.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_mips64le.go
10.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_mipsle.go
12.1 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_ppc64.go
11.47 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_ppc64le.go
11.49 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_riscv64.go
8.88 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_linux_s390x.go
10.64 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_netbsd_386.go
25.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_netbsd_amd64.go
25.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_netbsd_arm.go
25.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_netbsd_arm64.go
25.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_386.go
14.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_amd64.go
14.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_arm.go
14.46 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_arm64.go
14.72 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_mips64.go
14.93 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_ppc64.go
15.83 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_openbsd_riscv64.go
15.67 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_plan9.go
1.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
zsysnum_solaris_amd64.go
293 bytes
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_aix_ppc64.go
4.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_darwin_amd64.go
6.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_darwin_arm64.go
6.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_dragonfly_amd64.go
6.7 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_freebsd_386.go
8 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_freebsd_amd64.go
8.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_freebsd_arm.go
8.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_freebsd_arm64.go
8.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_freebsd_riscv64.go
8.03 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_386.go
11.58 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_amd64.go
11.95 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_arm.go
11.47 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_arm64.go
10.16 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_loong64.go
10.77 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_mips.go
9.96 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_mips64.go
10.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_mips64le.go
10.08 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_mipsle.go
9.96 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_ppc64.go
10.25 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_ppc64le.go
10.38 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_riscv64.go
10.23 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_linux_s390x.go
10.44 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_netbsd_386.go
5.99 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_netbsd_amd64.go
6.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_netbsd_arm.go
6.13 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_netbsd_arm64.go
6.17 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_386.go
6.73 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_amd64.go
6.89 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_arm.go
6.84 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_arm64.go
6.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_mips64.go
6.66 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_ppc64.go
6.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_openbsd_riscv64.go
6.69 KB
02/02/2024 06:09:55 PM
rw-r--r--
📄
ztypes_solaris_amd64.go
5.57 KB
02/02/2024 06:09:55 PM
rw-r--r--
Editing: fs_wasip1.go
Close
// Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build wasip1 package syscall import ( "runtime" "unsafe" ) func init() { // Try to set stdio to non-blocking mode before the os package // calls NewFile for each fd. NewFile queries the non-blocking flag // but doesn't change it, even if the runtime supports non-blocking // stdio. Since WebAssembly modules are single-threaded, blocking // system calls temporarily halt execution of the module. If the // runtime supports non-blocking stdio, the Go runtime is able to // use the WASI net poller to poll for read/write readiness and is // able to schedule goroutines while waiting. SetNonblock(0, true) SetNonblock(1, true) SetNonblock(2, true) } type uintptr32 = uint32 type size = uint32 type fdflags = uint32 type filesize = uint64 type filetype = uint8 type lookupflags = uint32 type oflags = uint32 type rights = uint64 type timestamp = uint64 type dircookie = uint64 type filedelta = int64 type fstflags = uint32 type iovec struct { buf uintptr32 bufLen size } const ( LOOKUP_SYMLINK_FOLLOW = 0x00000001 ) const ( OFLAG_CREATE = 0x0001 OFLAG_DIRECTORY = 0x0002 OFLAG_EXCL = 0x0004 OFLAG_TRUNC = 0x0008 ) const ( FDFLAG_APPEND = 0x0001 FDFLAG_DSYNC = 0x0002 FDFLAG_NONBLOCK = 0x0004 FDFLAG_RSYNC = 0x0008 FDFLAG_SYNC = 0x0010 ) const ( RIGHT_FD_DATASYNC = 1 << iota RIGHT_FD_READ RIGHT_FD_SEEK RIGHT_FDSTAT_SET_FLAGS RIGHT_FD_SYNC RIGHT_FD_TELL RIGHT_FD_WRITE RIGHT_FD_ADVISE RIGHT_FD_ALLOCATE RIGHT_PATH_CREATE_DIRECTORY RIGHT_PATH_CREATE_FILE RIGHT_PATH_LINK_SOURCE RIGHT_PATH_LINK_TARGET RIGHT_PATH_OPEN RIGHT_FD_READDIR RIGHT_PATH_READLINK RIGHT_PATH_RENAME_SOURCE RIGHT_PATH_RENAME_TARGET RIGHT_PATH_FILESTAT_GET RIGHT_PATH_FILESTAT_SET_SIZE RIGHT_PATH_FILESTAT_SET_TIMES RIGHT_FD_FILESTAT_GET RIGHT_FD_FILESTAT_SET_SIZE RIGHT_FD_FILESTAT_SET_TIMES RIGHT_PATH_SYMLINK RIGHT_PATH_REMOVE_DIRECTORY RIGHT_PATH_UNLINK_FILE RIGHT_POLL_FD_READWRITE RIGHT_SOCK_SHUTDOWN RIGHT_SOCK_ACCEPT ) const ( WHENCE_SET = 0 WHENCE_CUR = 1 WHENCE_END = 2 ) const ( FILESTAT_SET_ATIM = 0x0001 FILESTAT_SET_ATIM_NOW = 0x0002 FILESTAT_SET_MTIM = 0x0004 FILESTAT_SET_MTIM_NOW = 0x0008 ) const ( // Despite the rights being defined as a 64 bits integer in the spec, // wasmtime crashes the program if we set any of the upper 32 bits. fullRights = rights(^uint32(0)) readRights = rights(RIGHT_FD_READ | RIGHT_FD_READDIR) writeRights = rights(RIGHT_FD_DATASYNC | RIGHT_FD_WRITE | RIGHT_FD_ALLOCATE | RIGHT_PATH_FILESTAT_SET_SIZE) // Some runtimes have very strict expectations when it comes to which // rights can be enabled on files opened by path_open. The fileRights // constant is used as a mask to retain only bits for operations that // are supported on files. fileRights rights = RIGHT_FD_DATASYNC | RIGHT_FD_READ | RIGHT_FD_SEEK | RIGHT_FDSTAT_SET_FLAGS | RIGHT_FD_SYNC | RIGHT_FD_TELL | RIGHT_FD_WRITE | RIGHT_FD_ADVISE | RIGHT_FD_ALLOCATE | RIGHT_PATH_CREATE_DIRECTORY | RIGHT_PATH_CREATE_FILE | RIGHT_PATH_LINK_SOURCE | RIGHT_PATH_LINK_TARGET | RIGHT_PATH_OPEN | RIGHT_FD_READDIR | RIGHT_PATH_READLINK | RIGHT_PATH_RENAME_SOURCE | RIGHT_PATH_RENAME_TARGET | RIGHT_PATH_FILESTAT_GET | RIGHT_PATH_FILESTAT_SET_SIZE | RIGHT_PATH_FILESTAT_SET_TIMES | RIGHT_FD_FILESTAT_GET | RIGHT_FD_FILESTAT_SET_SIZE | RIGHT_FD_FILESTAT_SET_TIMES | RIGHT_PATH_SYMLINK | RIGHT_PATH_REMOVE_DIRECTORY | RIGHT_PATH_UNLINK_FILE | RIGHT_POLL_FD_READWRITE // Runtimes like wasmtime and wasmedge will refuse to open directories // if the rights requested by the application exceed the operations that // can be performed on a directory. dirRights rights = RIGHT_FD_SEEK | RIGHT_FDSTAT_SET_FLAGS | RIGHT_FD_SYNC | RIGHT_PATH_CREATE_DIRECTORY | RIGHT_PATH_CREATE_FILE | RIGHT_PATH_LINK_SOURCE | RIGHT_PATH_LINK_TARGET | RIGHT_PATH_OPEN | RIGHT_FD_READDIR | RIGHT_PATH_READLINK | RIGHT_PATH_RENAME_SOURCE | RIGHT_PATH_RENAME_TARGET | RIGHT_PATH_FILESTAT_GET | RIGHT_PATH_FILESTAT_SET_SIZE | RIGHT_PATH_FILESTAT_SET_TIMES | RIGHT_FD_FILESTAT_GET | RIGHT_FD_FILESTAT_SET_TIMES | RIGHT_PATH_SYMLINK | RIGHT_PATH_REMOVE_DIRECTORY | RIGHT_PATH_UNLINK_FILE ) // https://github.com/WebAssembly/WASI/blob/a2b96e81c0586125cc4dc79a5be0b78d9a059925/legacy/preview1/docs.md#-fd_closefd-fd---result-errno // //go:wasmimport wasi_snapshot_preview1 fd_close //go:noescape func fd_close(fd int32) Errno // https://github.com/WebAssembly/WASI/blob/a2b96e81c0586125cc4dc79a5be0b78d9a059925/legacy/preview1/docs.md#-fd_filestat_set_sizefd-fd-size-filesize---result-errno // //go:wasmimport wasi_snapshot_preview1 fd_filestat_set_size //go:noescape func fd_filestat_set_size(fd int32, set_size filesize) Errno // https://github.com/WebAssembly/WASI/blob/a2b96e81c0586125cc4dc79a5be0b78d9a059925/legacy/preview1/docs.md#-fd_preadfd-fd-iovs-iovec_array-offset-filesize---resultsize-errno // //go:wasmimport wasi_snapshot_preview1 fd_pread //go:noescape func fd_pread(fd int32, iovs unsafe.Pointer, iovsLen size, offset filesize, nread unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_pwrite //go:noescape func fd_pwrite(fd int32, iovs unsafe.Pointer, iovsLen size, offset filesize, nwritten unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_read //go:noescape func fd_read(fd int32, iovs unsafe.Pointer, iovsLen size, nread unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_readdir //go:noescape func fd_readdir(fd int32, buf unsafe.Pointer, bufLen size, cookie dircookie, nwritten unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_seek //go:noescape func fd_seek(fd int32, offset filedelta, whence uint32, newoffset unsafe.Pointer) Errno // https://github.com/WebAssembly/WASI/blob/a2b96e81c0586125cc4dc79a5be0b78d9a059925/legacy/preview1/docs.md#-fd_fdstat_set_rightsfd-fd-fs_rights_base-rights-fs_rights_inheriting-rights---result-errno // //go:wasmimport wasi_snapshot_preview1 fd_fdstat_set_rights //go:noescape func fd_fdstat_set_rights(fd int32, rightsBase rights, rightsInheriting rights) Errno //go:wasmimport wasi_snapshot_preview1 fd_filestat_get //go:noescape func fd_filestat_get(fd int32, buf unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_write //go:noescape func fd_write(fd int32, iovs unsafe.Pointer, iovsLen size, nwritten unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_sync //go:noescape func fd_sync(fd int32) Errno //go:wasmimport wasi_snapshot_preview1 path_create_directory //go:noescape func path_create_directory(fd int32, path unsafe.Pointer, pathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_filestat_get //go:noescape func path_filestat_get(fd int32, flags lookupflags, path unsafe.Pointer, pathLen size, buf unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 path_filestat_set_times //go:noescape func path_filestat_set_times(fd int32, flags lookupflags, path unsafe.Pointer, pathLen size, atim timestamp, mtim timestamp, fstflags fstflags) Errno //go:wasmimport wasi_snapshot_preview1 path_link //go:noescape func path_link(oldFd int32, oldFlags lookupflags, oldPath unsafe.Pointer, oldPathLen size, newFd int32, newPath unsafe.Pointer, newPathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_readlink //go:noescape func path_readlink(fd int32, path unsafe.Pointer, pathLen size, buf unsafe.Pointer, bufLen size, nwritten unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 path_remove_directory //go:noescape func path_remove_directory(fd int32, path unsafe.Pointer, pathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_rename //go:noescape func path_rename(oldFd int32, oldPath unsafe.Pointer, oldPathLen size, newFd int32, newPath unsafe.Pointer, newPathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_symlink //go:noescape func path_symlink(oldPath unsafe.Pointer, oldPathLen size, fd int32, newPath unsafe.Pointer, newPathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_unlink_file //go:noescape func path_unlink_file(fd int32, path unsafe.Pointer, pathLen size) Errno //go:wasmimport wasi_snapshot_preview1 path_open //go:noescape func path_open(rootFD int32, dirflags lookupflags, path unsafe.Pointer, pathLen size, oflags oflags, fsRightsBase rights, fsRightsInheriting rights, fsFlags fdflags, fd unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 random_get //go:noescape func random_get(buf unsafe.Pointer, bufLen size) Errno // https://github.com/WebAssembly/WASI/blob/a2b96e81c0586125cc4dc79a5be0b78d9a059925/legacy/preview1/docs.md#-fdstat-record // fdflags must be at offset 2, hence the uint16 type rather than the // fdflags (uint32) type. type fdstat struct { filetype filetype fdflags uint16 rightsBase rights rightsInheriting rights } //go:wasmimport wasi_snapshot_preview1 fd_fdstat_get //go:noescape func fd_fdstat_get(fd int32, buf unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_fdstat_set_flags //go:noescape func fd_fdstat_set_flags(fd int32, flags fdflags) Errno func fd_fdstat_get_flags(fd int) (uint32, error) { var stat fdstat errno := fd_fdstat_get(int32(fd), unsafe.Pointer(&stat)) return uint32(stat.fdflags), errnoErr(errno) } func fd_fdstat_get_type(fd int) (uint8, error) { var stat fdstat errno := fd_fdstat_get(int32(fd), unsafe.Pointer(&stat)) return stat.filetype, errnoErr(errno) } type preopentype = uint8 const ( preopentypeDir preopentype = iota ) type prestatDir struct { prNameLen size } type prestat struct { typ preopentype dir prestatDir } //go:wasmimport wasi_snapshot_preview1 fd_prestat_get //go:noescape func fd_prestat_get(fd int32, prestat unsafe.Pointer) Errno //go:wasmimport wasi_snapshot_preview1 fd_prestat_dir_name //go:noescape func fd_prestat_dir_name(fd int32, path unsafe.Pointer, pathLen size) Errno type opendir struct { fd int32 name string } // List of preopen directories that were exposed by the runtime. The first one // is assumed to the be root directory of the file system, and others are seen // as mount points at sub paths of the root. var preopens []opendir // Current working directory. We maintain this as a string and resolve paths in // the code because wasmtime does not allow relative path lookups outside of the // scope of a directory; a previous approach we tried consisted in maintaining // open a file descriptor to the current directory so we could perform relative // path lookups from that location, but it resulted in breaking path resolution // from the current directory to its parent. var cwd string func init() { dirNameBuf := make([]byte, 256) // We start looking for preopens at fd=3 because 0, 1, and 2 are reserved // for standard input and outputs. for preopenFd := int32(3); ; preopenFd++ { var prestat prestat errno := fd_prestat_get(preopenFd, unsafe.Pointer(&prestat)) if errno == EBADF { break } if errno == ENOTDIR || prestat.typ != preopentypeDir { continue } if errno != 0 { panic("fd_prestat: " + errno.Error()) } if int(prestat.dir.prNameLen) > len(dirNameBuf) { dirNameBuf = make([]byte, prestat.dir.prNameLen) } errno = fd_prestat_dir_name(preopenFd, unsafe.Pointer(&dirNameBuf[0]), prestat.dir.prNameLen) if errno != 0 { panic("fd_prestat_dir_name: " + errno.Error()) } preopens = append(preopens, opendir{ fd: preopenFd, name: string(dirNameBuf[:prestat.dir.prNameLen]), }) } if cwd, _ = Getenv("PWD"); cwd != "" { cwd = joinPath("/", cwd) } else if len(preopens) > 0 { cwd = preopens[0].name } } // Provided by package runtime. func now() (sec int64, nsec int32) //go:nosplit func appendCleanPath(buf []byte, path string, lookupParent bool) ([]byte, bool) { i := 0 for i < len(path) { for i < len(path) && path[i] == '/' { i++ } j := i for j < len(path) && path[j] != '/' { j++ } s := path[i:j] i = j switch s { case "": continue case ".": continue case "..": if !lookupParent { k := len(buf) for k > 0 && buf[k-1] != '/' { k-- } for k > 1 && buf[k-1] == '/' { k-- } buf = buf[:k] if k == 0 { lookupParent = true } else { s = "" continue } } default: lookupParent = false } if len(buf) > 0 && buf[len(buf)-1] != '/' { buf = append(buf, '/') } buf = append(buf, s...) } return buf, lookupParent } // joinPath concatenates dir and file paths, producing a cleaned path where // "." and ".." have been removed, unless dir is relative and the references // to parent directories in file represented a location relative to a parent // of dir. // // This function is used for path resolution of all wasi functions expecting // a path argument; the returned string is heap allocated, which we may want // to optimize in the future. Instead of returning a string, the function // could append the result to an output buffer that the functions in this // file can manage to have allocated on the stack (e.g. initializing to a // fixed capacity). Since it will significantly increase code complexity, // we prefer to optimize for readability and maintainability at this time. func joinPath(dir, file string) string { buf := make([]byte, 0, len(dir)+len(file)+1) if isAbs(dir) { buf = append(buf, '/') } buf, lookupParent := appendCleanPath(buf, dir, false) buf, _ = appendCleanPath(buf, file, lookupParent) // The appendCleanPath function cleans the path so it does not inject // references to the current directory. If both the dir and file args // were ".", this results in the output buffer being empty so we handle // this condition here. if len(buf) == 0 { buf = append(buf, '.') } // If the file ended with a '/' we make sure that the output also ends // with a '/'. This is needed to ensure that programs have a mechanism // to represent dereferencing symbolic links pointing to directories. if buf[len(buf)-1] != '/' && isDir(file) { buf = append(buf, '/') } return unsafe.String(&buf[0], len(buf)) } func isAbs(path string) bool { return hasPrefix(path, "/") } func isDir(path string) bool { return hasSuffix(path, "/") } func hasPrefix(s, p string) bool { return len(s) >= len(p) && s[:len(p)] == p } func hasSuffix(s, x string) bool { return len(s) >= len(x) && s[len(s)-len(x):] == x } // preparePath returns the preopen file descriptor of the directory to perform // path resolution from, along with the pair of pointer and length for the // relative expression of path from the directory. // // If the path argument is not absolute, it is first appended to the current // working directory before resolution. func preparePath(path string) (int32, unsafe.Pointer, size) { var dirFd = int32(-1) var dirName string dir := "/" if !isAbs(path) { dir = cwd } path = joinPath(dir, path) for _, p := range preopens { if len(p.name) > len(dirName) && hasPrefix(path, p.name) { dirFd, dirName = p.fd, p.name } } path = path[len(dirName):] for isAbs(path) { path = path[1:] } if len(path) == 0 { path = "." } return dirFd, stringPointer(path), size(len(path)) } func Open(path string, openmode int, perm uint32) (int, error) { if path == "" { return -1, EINVAL } dirFd, pathPtr, pathLen := preparePath(path) var oflags oflags if (openmode & O_CREATE) != 0 { oflags |= OFLAG_CREATE } if (openmode & O_TRUNC) != 0 { oflags |= OFLAG_TRUNC } if (openmode & O_EXCL) != 0 { oflags |= OFLAG_EXCL } var rights rights switch openmode & (O_RDONLY | O_WRONLY | O_RDWR) { case O_RDONLY: rights = fileRights & ^writeRights case O_WRONLY: rights = fileRights & ^readRights case O_RDWR: rights = fileRights } var fdflags fdflags if (openmode & O_APPEND) != 0 { fdflags |= FDFLAG_APPEND } if (openmode & O_SYNC) != 0 { fdflags |= FDFLAG_SYNC } var fd int32 errno := path_open( dirFd, LOOKUP_SYMLINK_FOLLOW, pathPtr, pathLen, oflags, rights, fileRights, fdflags, unsafe.Pointer(&fd), ) if errno == EISDIR && oflags == 0 && fdflags == 0 && ((rights & writeRights) == 0) { // wasmtime and wasmedge will error if attempting to open a directory // because we are asking for too many rights. However, we cannot // determine ahread of time if the path we are about to open is a // directory, so instead we fallback to a second call to path_open with // a more limited set of rights. // // This approach is subject to a race if the file system is modified // concurrently, so we also inject OFLAG_DIRECTORY to ensure that we do // not accidentally open a file which is not a directory. errno = path_open( dirFd, LOOKUP_SYMLINK_FOLLOW, pathPtr, pathLen, oflags|OFLAG_DIRECTORY, rights&dirRights, fileRights, fdflags, unsafe.Pointer(&fd), ) } return int(fd), errnoErr(errno) } func Close(fd int) error { errno := fd_close(int32(fd)) return errnoErr(errno) } func CloseOnExec(fd int) { // nothing to do - no exec } func Mkdir(path string, perm uint32) error { if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) errno := path_create_directory(dirFd, pathPtr, pathLen) return errnoErr(errno) } func ReadDir(fd int, buf []byte, cookie dircookie) (int, error) { var nwritten size errno := fd_readdir(int32(fd), unsafe.Pointer(&buf[0]), size(len(buf)), cookie, unsafe.Pointer(&nwritten)) return int(nwritten), errnoErr(errno) } type Stat_t struct { Dev uint64 Ino uint64 Filetype uint8 Nlink uint64 Size uint64 Atime uint64 Mtime uint64 Ctime uint64 Mode int // Uid and Gid are always zero on wasip1 platforms Uid uint32 Gid uint32 } func Stat(path string, st *Stat_t) error { if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) errno := path_filestat_get(dirFd, LOOKUP_SYMLINK_FOLLOW, pathPtr, pathLen, unsafe.Pointer(st)) setDefaultMode(st) return errnoErr(errno) } func Lstat(path string, st *Stat_t) error { if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) errno := path_filestat_get(dirFd, 0, pathPtr, pathLen, unsafe.Pointer(st)) setDefaultMode(st) return errnoErr(errno) } func Fstat(fd int, st *Stat_t) error { errno := fd_filestat_get(int32(fd), unsafe.Pointer(st)) setDefaultMode(st) return errnoErr(errno) } func setDefaultMode(st *Stat_t) { // WASI does not support unix-like permissions, but Go programs are likely // to expect the permission bits to not be zero so we set defaults to help // avoid breaking applications that are migrating to WASM. if st.Filetype == FILETYPE_DIRECTORY { st.Mode = 0700 } else { st.Mode = 0600 } } func Unlink(path string) error { if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) errno := path_unlink_file(dirFd, pathPtr, pathLen) return errnoErr(errno) } func Rmdir(path string) error { if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) errno := path_remove_directory(dirFd, pathPtr, pathLen) return errnoErr(errno) } func Chmod(path string, mode uint32) error { var stat Stat_t return Stat(path, &stat) } func Fchmod(fd int, mode uint32) error { var stat Stat_t return Fstat(fd, &stat) } func Chown(path string, uid, gid int) error { return ENOSYS } func Fchown(fd int, uid, gid int) error { return ENOSYS } func Lchown(path string, uid, gid int) error { return ENOSYS } func UtimesNano(path string, ts []Timespec) error { // UTIME_OMIT value must match internal/syscall/unix/at_wasip1.go const UTIME_OMIT = -0x2 if path == "" { return EINVAL } dirFd, pathPtr, pathLen := preparePath(path) atime := TimespecToNsec(ts[0]) mtime := TimespecToNsec(ts[1]) if ts[0].Nsec == UTIME_OMIT || ts[1].Nsec == UTIME_OMIT { var st Stat_t if err := Stat(path, &st); err != nil { return err } if ts[0].Nsec == UTIME_OMIT { atime = int64(st.Atime) } if ts[1].Nsec == UTIME_OMIT { mtime = int64(st.Mtime) } } errno := path_filestat_set_times( dirFd, LOOKUP_SYMLINK_FOLLOW, pathPtr, pathLen, timestamp(atime), timestamp(mtime), FILESTAT_SET_ATIM|FILESTAT_SET_MTIM, ) return errnoErr(errno) } func Rename(from, to string) error { if from == "" || to == "" { return EINVAL } oldDirFd, oldPathPtr, oldPathLen := preparePath(from) newDirFd, newPathPtr, newPathLen := preparePath(to) errno := path_rename( oldDirFd, oldPathPtr, oldPathLen, newDirFd, newPathPtr, newPathLen, ) return errnoErr(errno) } func Truncate(path string, length int64) error { if path == "" { return EINVAL } fd, err := Open(path, O_WRONLY, 0) if err != nil { return err } defer Close(fd) return Ftruncate(fd, length) } func Ftruncate(fd int, length int64) error { errno := fd_filestat_set_size(int32(fd), filesize(length)) return errnoErr(errno) } const ImplementsGetwd = true func Getwd() (string, error) { return cwd, nil } func Chdir(path string) error { if path == "" { return EINVAL } dir := "/" if !isAbs(path) { dir = cwd } path = joinPath(dir, path) var stat Stat_t dirFd, pathPtr, pathLen := preparePath(path) errno := path_filestat_get(dirFd, LOOKUP_SYMLINK_FOLLOW, pathPtr, pathLen, unsafe.Pointer(&stat)) if errno != 0 { return errnoErr(errno) } if stat.Filetype != FILETYPE_DIRECTORY { return ENOTDIR } cwd = path return nil } func Readlink(path string, buf []byte) (n int, err error) { if path == "" { return 0, EINVAL } if len(buf) == 0 { return 0, nil } dirFd, pathPtr, pathLen := preparePath(path) var nwritten size errno := path_readlink( dirFd, pathPtr, pathLen, unsafe.Pointer(&buf[0]), size(len(buf)), unsafe.Pointer(&nwritten), ) // For some reason wasmtime returns ERANGE when the output buffer is // shorter than the symbolic link value. os.Readlink expects a nil // error and uses the fact that n is greater or equal to the buffer // length to assume that it needs to try again with a larger size. // This condition is handled in os.Readlink. return int(nwritten), errnoErr(errno) } func Link(path, link string) error { if path == "" || link == "" { return EINVAL } oldDirFd, oldPathPtr, oldPathLen := preparePath(path) newDirFd, newPathPtr, newPathLen := preparePath(link) errno := path_link( oldDirFd, 0, oldPathPtr, oldPathLen, newDirFd, newPathPtr, newPathLen, ) return errnoErr(errno) } func Symlink(path, link string) error { if path == "" || link == "" { return EINVAL } dirFd, pathPtr, pathlen := preparePath(link) errno := path_symlink( stringPointer(path), size(len(path)), dirFd, pathPtr, pathlen, ) return errnoErr(errno) } func Fsync(fd int) error { errno := fd_sync(int32(fd)) return errnoErr(errno) } func bytesPointer(b []byte) unsafe.Pointer { return unsafe.Pointer(unsafe.SliceData(b)) } func stringPointer(s string) unsafe.Pointer { return unsafe.Pointer(unsafe.StringData(s)) } func makeIOVec(b []byte) unsafe.Pointer { return unsafe.Pointer(&iovec{ buf: uintptr32(uintptr(bytesPointer(b))), bufLen: size(len(b)), }) } func Read(fd int, b []byte) (int, error) { var nread size errno := fd_read(int32(fd), makeIOVec(b), 1, unsafe.Pointer(&nread)) runtime.KeepAlive(b) return int(nread), errnoErr(errno) } func Write(fd int, b []byte) (int, error) { var nwritten size errno := fd_write(int32(fd), makeIOVec(b), 1, unsafe.Pointer(&nwritten)) runtime.KeepAlive(b) return int(nwritten), errnoErr(errno) } func Pread(fd int, b []byte, offset int64) (int, error) { var nread size errno := fd_pread(int32(fd), makeIOVec(b), 1, filesize(offset), unsafe.Pointer(&nread)) runtime.KeepAlive(b) return int(nread), errnoErr(errno) } func Pwrite(fd int, b []byte, offset int64) (int, error) { var nwritten size errno := fd_pwrite(int32(fd), makeIOVec(b), 1, filesize(offset), unsafe.Pointer(&nwritten)) runtime.KeepAlive(b) return int(nwritten), errnoErr(errno) } func Seek(fd int, offset int64, whence int) (int64, error) { var newoffset filesize errno := fd_seek(int32(fd), filedelta(offset), uint32(whence), unsafe.Pointer(&newoffset)) return int64(newoffset), errnoErr(errno) } func Dup(fd int) (int, error) { return 0, ENOSYS } func Dup2(fd, newfd int) error { return ENOSYS } func Pipe(fd []int) error { return ENOSYS } func RandomGet(b []byte) error { errno := random_get(bytesPointer(b), size(len(b))) return errnoErr(errno) }