RISC-V (64) Linux syscalls

Put the syscall number in register a7, the first argument in a0, second argument in a1 and so on. Look in the manual pages for the syscalls to see what the arguments are.

Example code

This code calls exit(0).

li a7, 93
li a0, 0
ecall

All syscalls with numbers

DecHexName
00io_setup
11io_destroy
22io_submit
33io_cancel
44io_getevents
55setxattr
66lsetxattr
77fsetxattr
88getxattr
99lgetxattr
10Afgetxattr
11Blistxattr
12Cllistxattr
13Dflistxattr
14Eremovexattr
15Flremovexattr
1610fremovexattr
1711getcwd
1812lookup_dcookie
1913eventfd2
2014epoll_create1
2115epoll_ctl
2216epoll_pwait
2317dup
2418dup3
2519fcntl
261Ainotify_init1
271Binotify_add_watch
281Cinotify_rm_watch
291Dioctl
301Eioprio_set
311Fioprio_get
3220flock
3321mknodat
3422mkdirat
3523unlinkat
3624symlinkat
3725linkat
3826renameat
3927umount2
4028mount
4129pivot_root
422Anfsservctl
432Bstatfs
442Cfstatfs
452Dtruncate
462Eftruncate
472Ffallocate
4830faccessat
4931chdir
5032fchdir
5133chroot
5234fchmod
5335fchmodat
5436fchownat
5537fchown
5638openat
5739close
583Avhangup
593Bpipe2
603Cquotactl
613Dgetdents64
623Elseek
633Fread
6440write
6541readv
6642writev
6743pread64
6844pwrite64
6945preadv
7046pwritev
7147sendfile
7248pselect6
7349ppoll
744Asignalfd4
754Bvmsplice
764Csplice
774Dtee
784Ereadlinkat
794Fnewfstatat
8050fstat
8151sync
8252fsync
8353fdatasync
8454sync_file_range
8555timerfd_create
8656timerfd_settime
8757timerfd_gettime
8858utimensat
8959acct
905Acapget
915Bcapset
925Cpersonality
935Dexit
945Eexit_group
955Fwaitid
9660set_tid_address
9761unshare
9862futex
9963set_robust_list
10064get_robust_list
10165nanosleep
10266getitimer
10367setitimer
10468kexec_load
10569init_module
1066Adelete_module
1076Btimer_create
1086Ctimer_gettime
1096Dtimer_getoverrun
1106Etimer_settime
1116Ftimer_delete
11270clock_settime
11371clock_gettime
11472clock_getres
11573clock_nanosleep
11674syslog
11775ptrace
11876sched_setparam
11977sched_setscheduler
12078sched_getscheduler
12179sched_getparam
1227Asched_setaffinity
1237Bsched_getaffinity
1247Csched_yield
1257Dsched_get_priority_max
1267Esched_get_priority_min
1277Fsched_rr_get_interval
12880restart_syscall
12981kill
13082tkill
13183tgkill
13284sigaltstack
13385rt_sigsuspend
13486rt_sigaction
13587rt_sigprocmask
13688rt_sigpending
13789rt_sigtimedwait
1388Art_sigqueueinfo
1398Brt_sigreturn
1408Csetpriority
1418Dgetpriority
1428Ereboot
1438Fsetregid
14490setgid
14591setreuid
14692setuid
14793setresuid
14894getresuid
14995setresgid
15096getresgid
15197setfsuid
15298setfsgid
15399times
1549Asetpgid
1559Bgetpgid
1569Cgetsid
1579Dsetsid
1589Egetgroups
1599Fsetgroups
160A0uname
161A1sethostname
162A2setdomainname
163A3getrlimit
164A4setrlimit
165A5getrusage
166A6umask
167A7prctl
168A8getcpu
169A9gettimeofday
170AAsettimeofday
171ABadjtimex
172ACgetpid
173ADgetppid
174AEgetuid
175AFgeteuid
176B0getgid
177B1getegid
178B2gettid
179B3sysinfo
180B4mq_open
181B5mq_unlink
182B6mq_timedsend
183B7mq_timedreceive
184B8mq_notify
185B9mq_getsetattr
186BAmsgget
187BBmsgctl
188BCmsgrcv
189BDmsgsnd
190BEsemget
191BFsemctl
192C0semtimedop
193C1semop
194C2shmget
195C3shmctl
196C4shmat
197C5shmdt
198C6socket
199C7socketpair
200C8bind
201C9listen
202CAaccept
203CBconnect
204CCgetsockname
205CDgetpeername
206CEsendto
207CFrecvfrom
208D0setsockopt
209D1getsockopt
210D2shutdown
211D3sendmsg
212D4recvmsg
213D5readahead
214D6brk
215D7munmap
216D8mremap
217D9add_key
218DArequest_key
219DBkeyctl
220DCclone
221DDexecve
222DEmmap
223DFfadvise64
224E0swapon
225E1swapoff
226E2mprotect
227E3msync
228E4mlock
229E5munlock
230E6mlockall
231E7munlockall
232E8mincore
233E9madvise
234EAremap_file_pages
235EBmbind
236ECget_mempolicy
237EDset_mempolicy
238EEmigrate_pages
239EFmove_pages
240F0rt_tgsigqueueinfo
241F1perf_event_open
242F2accept4
243F3recvmmsg
260104wait4
261105prlimit64
262106fanotify_init
263107fanotify_mark
264108name_to_handle_at
265109open_by_handle_at
26610Aclock_adjtime
26710Bsyncfs
26810Csetns
26910Dsendmmsg
27010Eprocess_vm_readv
27110Fprocess_vm_writev
272110kcmp
273111finit_module
274112sched_setattr
275113sched_getattr
276114renameat2
277115seccomp
278116getrandom
279117memfd_create
280118bpf
281119execveat
28211Auserfaultfd
28311Bmembarrier
28411Cmlock2
28511Dcopy_file_range
28611Epreadv2
28711Fpwritev2
288120pkey_mprotect
289121pkey_alloc
290122pkey_free
291123statx
292124io_pgetevents
293125rseq
294126kexec_file_load