vki-scnums-solaris.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /*--------------------------------------------------------------------*/
  2. /*--- System call numbers for Solaris. vki-scnums-solaris.h ---*/
  3. /*--------------------------------------------------------------------*/
  4. /*
  5. This file is part of Valgrind, a dynamic binary instrumentation
  6. framework.
  7. Copyright (C) 2011-2017 Petr Pavlu
  8. setup@dagobah.cz
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License as
  11. published by the Free Software Foundation; either version 2 of the
  12. License, or (at your option) any later version.
  13. This program is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  20. 02111-1307, USA.
  21. The GNU General Public License is contained in the file COPYING.
  22. */
  23. /* Copyright 2013-2017, Ivo Raisr <ivosh@ivosh.net>. */
  24. /* Copyright 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
  25. #ifndef __VKI_SCNUMS_SOLARIS_H
  26. #define __VKI_SCNUMS_SOLARIS_H
  27. /* Note: Basic information about Solaris syscalls can be found in the kernel
  28. source file uts/common/os/sysent.c.
  29. */
  30. /* Include sys/syscall.h to get SYS_* constants (and sys/trap.h to get T_*) to
  31. avoid any copyright issues connected with their potential copying out of
  32. the header file.
  33. */
  34. #include <sys/syscall.h>
  35. #include <sys/trap.h>
  36. /* normal syscall (int $0x91) */
  37. #define VG_SOLARIS_SYSCALL_CLASS_CLASSIC 0
  38. /* fasttrap syscall (int $0xD2) */
  39. #define VG_SOLARIS_SYSCALL_CLASS_FASTTRAP 1
  40. #define VG_SOLARIS_SYSCALL_CLASS_SHIFT 24
  41. #define VG_SOLARIS_SYSCALL_NUMBER_MASK 0x00FFFFFF
  42. #define VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(sysno) \
  43. ((VG_SOLARIS_SYSCALL_CLASS_FASTTRAP << VG_SOLARIS_SYSCALL_CLASS_SHIFT) \
  44. | (sysno))
  45. #define VG_SOLARIS_SYSNO_CLASS(sysno) \
  46. ((sysno) >> VG_SOLARIS_SYSCALL_CLASS_SHIFT)
  47. #define VG_SOLARIS_SYSNO_INDEX(sysno) \
  48. ((sysno) & VG_SOLARIS_SYSCALL_NUMBER_MASK)
  49. #define __NR_exit SYS_exit
  50. #if defined(SOLARIS_SPAWN_SYSCALL)
  51. #define __NR_spawn SYS_spawn
  52. #endif /* SOLARIS_SPAWN_SYSCALL */
  53. #define __NR_read SYS_read
  54. #define __NR_write SYS_write
  55. #define __NR_close SYS_close
  56. #define __NR_linkat SYS_linkat
  57. #define __NR_symlinkat SYS_symlinkat
  58. #define __NR_chdir SYS_chdir
  59. #define __NR_time SYS_time
  60. #define __NR_brk SYS_brk
  61. #define __NR_lseek SYS_lseek
  62. #define __NR_getpid SYS_getpid
  63. #define __NR_mount SYS_mount
  64. #define __NR_readlinkat SYS_readlinkat
  65. #define __NR_setuid SYS_setuid
  66. #define __NR_getuid SYS_getuid
  67. #define __NR_stime SYS_stime
  68. //#define __NR_pcsample SYS_pcsample
  69. #define __NR_alarm SYS_alarm
  70. #define __NR_pause SYS_pause
  71. #if defined(SOLARIS_FREALPATHAT_SYSCALL)
  72. #define __NR_frealpathat SYS_frealpathat
  73. #endif /* SOLARIS_FREALPATHAT_SYSCALL */
  74. #define __NR_stty SYS_stty
  75. #define __NR_gtty SYS_gtty
  76. //#define __NR_nice SYS_nice
  77. //#define __NR_statfs SYS_statfs
  78. //#define __NR_sync SYS_sync
  79. #define __NR_kill SYS_kill
  80. //#define __NR_fstatfs SYS_fstatfs
  81. #define __NR_pgrpsys SYS_pgrpsys
  82. //#define __NR_uucopystr SYS_uucopystr
  83. #define __NR_pipe SYS_pipe
  84. #define __NR_times SYS_times
  85. //#define __NR_profil SYS_profil
  86. #define __NR_faccessat SYS_faccessat
  87. #define __NR_setgid SYS_setgid
  88. #define __NR_getgid SYS_getgid
  89. #define __NR_mknodat SYS_mknodat
  90. //#define __NR_msgsys SYS_msgsys
  91. #define __NR_sysi86 SYS_sysi86
  92. //#define __NR_acct SYS_acct
  93. #define __NR_shmsys SYS_shmsys
  94. #define __NR_semsys SYS_semsys
  95. #define __NR_ioctl SYS_ioctl
  96. //#define __NR_uadmin SYS_uadmin
  97. #define __NR_fchownat SYS_fchownat
  98. //#define __NR_utssys SYS_utssys
  99. #define __NR_fdsync SYS_fdsync
  100. #define __NR_execve SYS_execve
  101. #define __NR_umask SYS_umask
  102. #define __NR_chroot SYS_chroot
  103. #define __NR_fcntl SYS_fcntl
  104. //#define __NR_ulimit SYS_ulimit
  105. #define __NR_renameat SYS_renameat
  106. #define __NR_unlinkat SYS_unlinkat
  107. #define __NR_fstatat SYS_fstatat
  108. #define __NR_fstatat64 SYS_fstatat64
  109. #define __NR_openat SYS_openat
  110. #define __NR_openat64 SYS_openat64
  111. #define __NR_tasksys SYS_tasksys
  112. //#define __NR_acctctl SYS_acctctl
  113. //#define __NR_exacctsys SYS_exacctsys
  114. #define __NR_getpagesizes SYS_getpagesizes
  115. //#define __NR_rctlsys SYS_rctlsys
  116. //#define __NR_sidsys SYS_sidsys
  117. #define __NR_lwp_park SYS_lwp_park
  118. #define __NR_sendfilev SYS_sendfilev
  119. #if defined(SOLARIS_LWP_NAME_SYSCALL)
  120. #define __NR_lwp_name SYS_lwp_name
  121. #endif /* SOLARIS_LWP_NAME_SYSCALL */
  122. #define __NR_getdents SYS_getdents
  123. #define __NR_privsys SYS_privsys
  124. #define __NR_ucredsys SYS_ucredsys
  125. #define __NR_sysfs SYS_sysfs
  126. #define __NR_getmsg SYS_getmsg
  127. #define __NR_putmsg SYS_putmsg
  128. #define __NR_setgroups SYS_setgroups
  129. #define __NR_getgroups SYS_getgroups
  130. #define __NR_sigprocmask SYS_sigprocmask
  131. #define __NR_sigsuspend SYS_sigsuspend
  132. #define __NR_sigaltstack SYS_sigaltstack
  133. #define __NR_sigaction SYS_sigaction
  134. #define __NR_sigpending SYS_sigpending
  135. #define __NR_context SYS_context
  136. #define __NR_fchmodat SYS_fchmodat
  137. #define __NR_mkdirat SYS_mkdirat
  138. #define __NR_statvfs SYS_statvfs
  139. #define __NR_fstatvfs SYS_fstatvfs
  140. //#define __NR_getloadavg SYS_getloadavg
  141. #define __NR_nfssys SYS_nfssys
  142. #define __NR_waitid SYS_waitid
  143. #define __NR_waitsys SYS_waitsys /* = SYS_waitid (historical) */
  144. #define __NR_sigsendsys SYS_sigsendsys
  145. //#define __NR_hrtsys SYS_hrtsys
  146. #if defined(SOLARIS_UTIMESYS_SYSCALL)
  147. #define __NR_utimesys SYS_utimesys
  148. #endif /* SOLARIS_UTIMESYS_SYSCALL */
  149. #if defined(SOLARIS_UTIMENSAT_SYSCALL)
  150. #define __NR_utimensat SYS_utimensat
  151. #endif /* SOLARIS_UTIMENSAT_SYSCALL */
  152. #define __NR_sigresend SYS_sigresend
  153. #define __NR_priocntlsys SYS_priocntlsys
  154. #define __NR_pathconf SYS_pathconf
  155. //#define __NR_mincore SYS_mincore
  156. #define __NR_mmap SYS_mmap
  157. #define __NR_mprotect SYS_mprotect
  158. #define __NR_munmap SYS_munmap
  159. //#define __NR_fpathconf SYS_fpathconf
  160. //#define __NR_vfork SYS_vfork
  161. #define __NR_fchdir SYS_fchdir
  162. #define __NR_readv SYS_readv
  163. #define __NR_writev SYS_writev
  164. #if defined(SOLARIS_UUIDSYS_SYSCALL)
  165. #define __NR_uuidsys SYS_uuidsys
  166. #endif /* SOLARIS_UUIDSYS_SYSCALL */
  167. #define __NR_mmapobj SYS_mmapobj
  168. #define __NR_setrlimit SYS_setrlimit
  169. #define __NR_getrlimit SYS_getrlimit
  170. #define __NR_memcntl SYS_memcntl
  171. #define __NR_getpmsg SYS_getpmsg
  172. #define __NR_putpmsg SYS_putpmsg
  173. #define __NR_uname SYS_uname
  174. #define __NR_setegid SYS_setegid
  175. #define __NR_sysconfig SYS_sysconfig
  176. //#define __NR_adjtime SYS_adjtime
  177. #define __NR_systeminfo SYS_systeminfo
  178. //#define __NR_sharefs SYS_sharefs
  179. #define __NR_seteuid SYS_seteuid
  180. #define __NR_forksys SYS_forksys
  181. #if defined(SOLARIS_GETRANDOM_SYSCALL)
  182. #define __NR_getrandom SYS_getrandom
  183. #endif /* SOLARIS_GETRANDOM_SYSCALL */
  184. #define __NR_sigtimedwait SYS_sigtimedwait
  185. //#define __NR_lwp_info SYS_lwp_info
  186. #define __NR_yield SYS_yield
  187. #define __NR_lwp_sema_post SYS_lwp_sema_post
  188. #define __NR_lwp_sema_trywait SYS_lwp_sema_trywait
  189. #define __NR_lwp_detach SYS_lwp_detach
  190. //#define __NR_corectl SYS_corectl
  191. #define __NR_modctl SYS_modctl
  192. #define __NR_fchroot SYS_fchroot
  193. #if defined(SOLARIS_SYSTEM_STATS_SYSCALL)
  194. #define __NR_system_stats SYS_system_stats
  195. #endif /* SOLARIS_SYSTEM_STATS_SYSCALL */
  196. //#define __NR_vhangup SYS_vhangup
  197. #define __NR_gettimeofday SYS_gettimeofday
  198. #define __NR_getitimer SYS_getitimer
  199. #define __NR_setitimer SYS_setitimer
  200. #define __NR_lwp_create SYS_lwp_create
  201. #define __NR_lwp_exit SYS_lwp_exit
  202. #define __NR_lwp_suspend SYS_lwp_suspend
  203. #define __NR_lwp_continue SYS_lwp_continue
  204. #if defined(SOLARIS_LWP_SIGQUEUE_SYSCALL)
  205. #define __NR_lwp_sigqueue SYS_lwp_sigqueue
  206. #else
  207. #define __NR_lwp_kill SYS_lwp_kill
  208. #endif /* SOLARIS_LWP_SIGQUEUE_SYSCALL */
  209. #define __NR_lwp_self SYS_lwp_self
  210. #define __NR_lwp_sigmask SYS_lwp_sigmask
  211. #define __NR_lwp_private SYS_lwp_private
  212. #define __NR_lwp_wait SYS_lwp_wait
  213. #define __NR_lwp_mutex_wakeup SYS_lwp_mutex_wakeup
  214. #define __NR_lwp_cond_wait SYS_lwp_cond_wait
  215. #define __NR_lwp_cond_signal SYS_lwp_cond_signal
  216. #define __NR_lwp_cond_broadcast SYS_lwp_cond_broadcast
  217. #define __NR_pread SYS_pread
  218. #define __NR_pwrite SYS_pwrite
  219. #define __NR_llseek SYS_llseek
  220. //#define __NR_inst_sync SYS_inst_sync
  221. //#define __NR_brand SYS_brand
  222. //#define __NR_kaio SYS_kaio
  223. //#define __NR_cpc SYS_cpc
  224. #define __NR_lgrpsys SYS_lgrpsys
  225. #define __NR_rusagesys SYS_rusagesys
  226. #define __NR_port SYS_port
  227. #define __NR_pollsys SYS_pollsys
  228. #define __NR_labelsys SYS_labelsys
  229. #define __NR_acl SYS_acl
  230. #define __NR_auditsys SYS_auditsys
  231. //#define __NR_processor_bind SYS_processor_bind
  232. //#define __NR_processor_info SYS_processor_info
  233. #define __NR_p_online SYS_p_online
  234. #define __NR_sigqueue SYS_sigqueue
  235. #define __NR_clock_gettime SYS_clock_gettime
  236. #define __NR_clock_settime SYS_clock_settime
  237. #define __NR_clock_getres SYS_clock_getres
  238. #define __NR_timer_create SYS_timer_create
  239. #define __NR_timer_delete SYS_timer_delete
  240. #define __NR_timer_settime SYS_timer_settime
  241. #define __NR_timer_gettime SYS_timer_gettime
  242. #define __NR_timer_getoverrun SYS_timer_getoverrun
  243. #define __NR_nanosleep SYS_nanosleep
  244. #define __NR_facl SYS_facl
  245. #define __NR_door SYS_door
  246. #define __NR_setreuid SYS_setreuid
  247. #define __NR_setregid SYS_setregid
  248. //#define __NR_install_utrap SYS_install_utrap
  249. //#define __NR_signotify SYS_signotify
  250. #define __NR_schedctl SYS_schedctl
  251. #define __NR_pset SYS_pset
  252. //#define SYS_sparc_utrap_install
  253. #define __NR_resolvepath SYS_resolvepath
  254. #define __NR_lwp_mutex_timedlock SYS_lwp_mutex_timedlock
  255. #define __NR_lwp_sema_timedwait SYS_lwp_sema_timedwait
  256. #define __NR_lwp_rwlock_sys SYS_lwp_rwlock_sys
  257. #define __NR_getdents64 SYS_getdents64
  258. #define __NR_mmap64 SYS_mmap64
  259. #define __NR_statvfs64 SYS_statvfs64
  260. #define __NR_fstatvfs64 SYS_fstatvfs64
  261. #define __NR_setrlimit64 SYS_setrlimit64
  262. #define __NR_getrlimit64 SYS_getrlimit64
  263. #define __NR_pread64 SYS_pread64
  264. #define __NR_pwrite64 SYS_pwrite64
  265. //#define __NR_rpcsys SYS_rpcsys
  266. #define __NR_zone SYS_zone
  267. //#define __NR_autofssys SYS_autofssys
  268. #define __NR_getcwd SYS_getcwd
  269. #define __NR_so_socket SYS_so_socket
  270. #define __NR_so_socketpair SYS_so_socketpair
  271. #define __NR_bind SYS_bind
  272. #define __NR_listen SYS_listen
  273. #define __NR_accept SYS_accept
  274. #define __NR_connect SYS_connect
  275. #define __NR_shutdown SYS_shutdown
  276. #define __NR_recv SYS_recv
  277. #define __NR_recvfrom SYS_recvfrom
  278. #define __NR_recvmsg SYS_recvmsg
  279. #define __NR_send SYS_send
  280. #define __NR_sendmsg SYS_sendmsg
  281. #define __NR_sendto SYS_sendto
  282. #define __NR_getpeername SYS_getpeername
  283. #define __NR_getsockname SYS_getsockname
  284. #define __NR_getsockopt SYS_getsockopt
  285. #define __NR_setsockopt SYS_setsockopt
  286. //#define __NR_sockconfig SYS_sockconfig
  287. //#define __NR_ntp_gettime SYS_ntp_gettime
  288. //#define __NR_ntp_adjtime SYS_ntp_adjtime
  289. //#define __NR_lwp_mutex_unlock SYS_lwp_mutex_unlock
  290. //#define __NR_lwp_mutex_trylock SYS_lwp_mutex_trylock
  291. #define __NR_lwp_mutex_register SYS_lwp_mutex_register
  292. //#define __NR_cladm SYS_cladm
  293. #define __NR_uucopy SYS_uucopy
  294. #define __NR_umount2 SYS_umount2
  295. /* The following syscalls were removed in Solaris 11 (see
  296. https://wikis.oracle.com/display/DTrace/syscall+Provider). Valgrind's core
  297. cannot use these syscalls but wrappers have to be provided for them because
  298. they are still in use on illumos.
  299. */
  300. #if defined(SOLARIS_OLD_SYSCALLS)
  301. #define __NR_open SYS_open
  302. #define __NR_link SYS_link
  303. #define __NR_unlink SYS_unlink
  304. #define __NR_mknod SYS_mknod
  305. #define __NR_chmod SYS_chmod
  306. #define __NR_chown SYS_chown
  307. #define __NR_stat SYS_stat
  308. #define __NR_fstat SYS_fstat
  309. #define __NR_access SYS_access
  310. #define __NR_rmdir SYS_rmdir
  311. #define __NR_mkdir SYS_mkdir
  312. #define __NR_lstat SYS_lstat
  313. #define __NR_symlink SYS_symlink
  314. #define __NR_readlink SYS_readlink
  315. #define __NR_fchmod SYS_fchmod
  316. #define __NR_fchown SYS_fchown
  317. #define __NR_lchown SYS_lchown
  318. #define __NR_rename SYS_rename
  319. #define __NR_stat64 SYS_stat64
  320. #define __NR_lstat64 SYS_lstat64
  321. #define __NR_fstat64 SYS_fstat64
  322. #define __NR_open64 SYS_open64
  323. #endif /* SOLARIS_OLD_SYSCALLS */
  324. /*
  325. #define __NR_null \
  326. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FNULL)
  327. #define __NR_fgetfp \
  328. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FGETFP)
  329. #define __NR_fsetfp \
  330. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_FSETFP)
  331. */
  332. #define __NR_gethrtime \
  333. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRTIME)
  334. #define __NR_gethrvtime \
  335. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRVTIME)
  336. #define __NR_gethrestime \
  337. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRESTIME)
  338. #define __NR_getlgrp \
  339. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETLGRP)
  340. #if defined(SOLARIS_GETHRT_FASTTRAP)
  341. #define __NR_gethrt \
  342. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETHRT)
  343. #endif /* SOLARIS_GETHRT_FASTTRAP */
  344. #if defined(SOLARIS_GETZONEOFFSET_FASTTRAP)
  345. #define __NR_getzoneoffset \
  346. VG_SOLARIS_SYSCALL_CONSTRUCT_FASTTRAP(T_GETZONEOFFSET)
  347. #endif /* SOLARIS_GETZONEOFFSET_FASTTRAP */
  348. #endif /* __VKI_SCNUMS_SOLARIS_H */
  349. /*--------------------------------------------------------------------*/
  350. /*--- end ---*/
  351. /*--------------------------------------------------------------------*/