4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
25 * Copyright (c) 2013 by Delphix. All rights reserved.
26 * Copyright (c) 2015, Joyent, Inc. All rights reserved.
29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
32 #ifndef _SYS_SYSCALL_H
33 #define _SYS_SYSCALL_H
41 * syscall(SYS_xxxx, ...)
44 /* syscall enumeration MUST begin with 1 */
47 * SunOS/SPARC uses 0 for the indirect system call SYS_syscall
48 * but this doesn't count because it is just another way
49 * to specify the real system call number.
54 #define SYS_psecflags 2
62 #define SYS_symlinkat 11
73 #define SYS_readlinkat 22
77 #define SYS_pcsample 26
88 #define SYS_fstatfs 38
89 #define SYS_pgrpsys 39
92 * getpgrp() :: syscall(39,0)
93 * setpgrp() :: syscall(39,1)
94 * getsid(pid) :: syscall(39,2,pid)
95 * setsid() :: syscall(39,3)
96 * getpgid(pid) :: syscall(39,4,pid)
97 * setpgid(pid,pgid) :: syscall(39,5,pid,pgid)
99 #define SYS_uucopystr 40
102 #define SYS_profil 44
103 #define SYS_faccessat 45
104 #define SYS_setgid 46
105 #define SYS_getgid 47
106 #define SYS_mknodat 48
107 #define SYS_msgsys 49
110 * msgget(...) :: msgsys(0, ...)
111 * msgctl(...) :: msgsys(1, ...)
112 * msgrcv(...) :: msgsys(2, ...)
113 * msgsnd(...) :: msgsys(3, ...)
114 * msgids(...) :: msgsys(4, ...)
115 * msgsnap(...) :: msgsys(5, ...)
118 #define SYS_sysi86 50
124 #define SYS_shmsys 52
127 * shmat (...) :: shmsys(0, ...)
128 * shmctl(...) :: shmsys(1, ...)
129 * shmdt (...) :: shmsys(2, ...)
130 * shmget(...) :: shmsys(3, ...)
131 * shmids(...) :: shmsys(4, ...)
134 #define SYS_semsys 53
137 * semctl(...) :: semsys(0, ...)
138 * semget(...) :: semsys(1, ...)
139 * semop (...) :: semsys(2, ...)
140 * semids(...) :: semsys(3, ...)
141 * semtimedop(...) :: semsys(4, ...)
145 #define SYS_uadmin 55
146 #define SYS_fchownat 56
147 #define SYS_utssys 57
149 * subcodes (third argument):
150 * uname(obuf) (obsolete) :: syscall(57, obuf, ign, 0)
152 * ustat(dev, obuf) :: syscall(57, obuf, dev, 2)
153 * fusers(path, flags, obuf) :: syscall(57, path, flags, 3, obuf)
156 #define SYS_fdsync 58
157 #define SYS_execve 59
159 #define SYS_chroot 61
161 #define SYS_ulimit 63
162 #define SYS_renameat 64
163 #define SYS_unlinkat 65
164 #define SYS_fstatat 66
165 #define SYS_fstatat64 67
166 #define SYS_openat 68
167 #define SYS_openat64 69
168 #define SYS_tasksys 70
171 * settaskid(...) :: tasksys(0, ...)
172 * gettaskid(...) :: tasksys(1, ...)
173 * getprojid(...) :: tasksys(2, ...)
175 #define SYS_acctctl 71
176 #define SYS_exacctsys 72
179 * getacct(...) :: exacct(0, ...)
180 * putacct(...) :: exacct(1, ...)
181 * wracct(...) :: exacct(2, ...)
183 #define SYS_getpagesizes 73
186 * getpagesizes2(...) :: getpagesizes(0, ...)
187 * getpagesizes(...) :: getpagesizes(1, ...) legacy
189 #define SYS_rctlsys 74
192 * getrctl(...) :: rctlsys(0, ...)
193 * setrctl(...) :: rctlsys(1, ...)
194 * rctllist(...) :: rctlsys(2, ...)
195 * rctlctl(...) :: rctlsys(3, ...)
197 #define SYS_sidsys 75
200 * allocids(...) :: sidsys(0, ...)
201 * idmap_reg(...) :: sidsys(1, ...)
202 * idmap_unreg(...) :: sidsys(2, ...)
204 #define SYS_lwp_park 77
207 * _lwp_park(timespec_t *, lwpid_t) :: syslwp_park(0, ...)
208 * _lwp_unpark(lwpid_t, int) :: syslwp_park(1, ...)
209 * _lwp_unpark_all(lwpid_t *, int) :: syslwp_park(2, ...)
210 * _lwp_unpark_cancel(lwpid_t *, int) :: syslwp_park(3, ...)
211 * _lwp_set_park(lwpid_t *, int) :: syslwp_park(4, ...)
213 #define SYS_sendfilev 78
216 * sendfilev() :: sendfilev(0, ...)
217 * sendfilev64() :: sendfilev(1, ...)
221 #define SYS_getdents 81
222 #define SYS_privsys 82
225 * setppriv(...) :: privsys(0, ...)
226 * getppriv(...) :: privsys(1, ...)
227 * getimplinfo(...) :: privsys(2, ...)
228 * setpflags(...) :: privsys(3, ...)
229 * getpflags(...) :: privsys(4, ...)
230 * issetugid(); :: privsys(5)
232 #define SYS_ucredsys 83
235 * ucred_get(...) :: ucredsys(0, ...)
236 * getpeerucred(...) :: ucredsys(1, ...)
244 #define SYS_getmsg 85
245 #define SYS_putmsg 86
247 #define SYS_symlink 89
248 #define SYS_readlink 90
249 #define SYS_setgroups 91
250 #define SYS_getgroups 92
251 #define SYS_fchmod 93
252 #define SYS_fchown 94
253 #define SYS_sigprocmask 95
254 #define SYS_sigsuspend 96
255 #define SYS_sigaltstack 97
256 #define SYS_sigaction 98
257 #define SYS_sigpending 99
261 * sigpending(...) :: syscall(99, 1, ...)
262 * sigfillset(...) :: syscall(99, 2, ...)
264 #define SYS_context 100
267 * getcontext(...) :: syscall(100, 0, ...)
268 * setcontext(...) :: syscall(100, 1, ...)
270 #define SYS_fchmodat 101
271 #define SYS_mkdirat 102
272 #define SYS_statvfs 103
273 #define SYS_fstatvfs 104
274 #define SYS_getloadavg 105
275 #define SYS_nfssys 106
276 #define SYS_waitid 107
277 #define SYS_waitsys SYS_waitid /* historical */
278 #define SYS_sigsendsys 108
279 #define SYS_hrtsys 109
280 #define SYS_utimesys 110
283 * futimens(...) :: syscall(110, 0, ...)
284 * utimensat(...) :: syscall(110, 1, ...)
286 #define SYS_sigresend 111
287 #define SYS_priocntlsys 112
288 #define SYS_pathconf 113
289 #define SYS_mincore 114
291 #define SYS_mprotect 116
292 #define SYS_munmap 117
293 #define SYS_fpathconf 118
294 #define SYS_vfork 119
295 #define SYS_fchdir 120
296 #define SYS_readv 121
297 #define SYS_writev 122
298 #define SYS_preadv 123
299 #define SYS_pwritev 124
300 #define SYS_getrandom 126
301 #define SYS_mmapobj 127
302 #define SYS_setrlimit 128
303 #define SYS_getrlimit 129
304 #define SYS_lchown 130
305 #define SYS_memcntl 131
306 #define SYS_getpmsg 132
307 #define SYS_putpmsg 133
308 #define SYS_rename 134
309 #define SYS_uname 135
310 #define SYS_setegid 136
311 #define SYS_sysconfig 137
312 #define SYS_adjtime 138
313 #define SYS_systeminfo 139
314 #define SYS_sharefs 140
315 #define SYS_seteuid 141
316 #define SYS_forksys 142
319 * forkx(flags) :: forksys(0, flags)
320 * forkallx(flags) :: forksys(1, flags)
321 * vforkx(flags) :: forksys(2, flags)
323 #define SYS_sigtimedwait 144
324 #define SYS_lwp_info 145
325 #define SYS_yield 146
326 #define SYS_lwp_sema_post 148
327 #define SYS_lwp_sema_trywait 149
328 #define SYS_lwp_detach 150
329 #define SYS_corectl 151
330 #define SYS_modctl 152
331 #define SYS_fchroot 153
332 #define SYS_vhangup 155
333 #define SYS_gettimeofday 156
334 #define SYS_getitimer 157
335 #define SYS_setitimer 158
336 #define SYS_lwp_create 159
337 #define SYS_lwp_exit 160
338 #define SYS_lwp_suspend 161
339 #define SYS_lwp_continue 162
340 #define SYS_lwp_kill 163
341 #define SYS_lwp_self 164
342 #define SYS_lwp_sigmask 165
343 #define SYS_lwp_private 166
344 #define SYS_lwp_wait 167
345 #define SYS_lwp_mutex_wakeup 168
346 #define SYS_lwp_cond_wait 170
347 #define SYS_lwp_cond_signal 171
348 #define SYS_lwp_cond_broadcast 172
349 #define SYS_pread 173
350 #define SYS_pwrite 174
351 #define SYS_llseek 175
352 #define SYS_inst_sync 176
353 #define SYS_brand 177
357 * aioread(...) :: kaio(AIOREAD, ...)
358 * aiowrite(...) :: kaio(AIOWRITE, ...)
359 * aiowait(...) :: kaio(AIOWAIT, ...)
360 * aiocancel(...) :: kaio(AIOCANCEL, ...)
361 * aionotify() :: kaio(AIONOTIFY)
362 * aioinit() :: kaio(AIOINIT)
363 * aiostart() :: kaio(AIOSTART)
367 #define SYS_lgrpsys 180
368 #define SYS_meminfosys SYS_lgrpsys
371 * meminfo(...) :: meminfosys(MISYS_MEMINFO, ...)
373 #define SYS_rusagesys 181
376 * getrusage(...) :: rusagesys(RUSAGESYS_GETRUSAGE, ...)
377 * getvmusage(...) :: rusagesys(RUSAGESYS_GETVMUSAGE, ...)
382 * port_create(...) :: portfs(PORT_CREATE, ...)
383 * port_associate(...) :: portfs(PORT_ASSOCIATE, ...)
384 * port_dissociate(...) :: portfs(PORT_DISSOCIATE, ...)
385 * port_send(...) :: portfs(PORT_SEND, ...)
386 * port_sendn(...) :: portfs(PORT_SENDN, ...)
387 * port_get(...) :: portfs(PORT_GET, ...)
388 * port_getn(...) :: portfs(PORT_GETN, ...)
389 * port_alert(...) :: portfs(PORT_ALERT, ...)
390 * port_dispatch(...) :: portfs(PORT_DISPATCH, ...)
392 #define SYS_pollsys 183
394 #define SYS_auditsys 186
395 #define SYS_processor_bind 187
396 #define SYS_processor_info 188
397 #define SYS_p_online 189
398 #define SYS_sigqueue 190
399 #define SYS_clock_gettime 191
400 #define SYS_clock_settime 192
401 #define SYS_clock_getres 193
402 #define SYS_timer_create 194
403 #define SYS_timer_delete 195
404 #define SYS_timer_settime 196
405 #define SYS_timer_gettime 197
406 #define SYS_timer_getoverrun 198
407 #define SYS_nanosleep 199
418 #define SYS_setreuid 202
419 #define SYS_setregid 203
420 #define SYS_install_utrap 204
421 #define SYS_signotify 205
422 #define SYS_schedctl 206
424 #define SYS_sparc_utrap_install 208
425 #define SYS_resolvepath 209
426 #define SYS_lwp_mutex_timedlock 210
427 #define SYS_lwp_sema_timedwait 211
428 #define SYS_lwp_rwlock_sys 212
431 * lwp_rwlock_rdlock(...) :: syscall(212, 0, ...)
432 * lwp_rwlock_wrlock(...) :: syscall(212, 1, ...)
433 * lwp_rwlock_tryrdlock(...) :: syscall(212, 2, ...)
434 * lwp_rwlock_trywrlock(...) :: syscall(212, 3, ...)
435 * lwp_rwlock_unlock(...) :: syscall(212, 4, ...)
437 /* system calls for large file ( > 2 gigabyte) support */
438 #define SYS_getdents64 213
439 #define SYS_mmap64 214
440 #define SYS_stat64 215
441 #define SYS_lstat64 216
442 #define SYS_fstat64 217
443 #define SYS_statvfs64 218
444 #define SYS_fstatvfs64 219
445 #define SYS_setrlimit64 220
446 #define SYS_getrlimit64 221
447 #define SYS_pread64 222
448 #define SYS_pwrite64 223
449 #define SYS_open64 225
450 #define SYS_rpcsys 226
454 * zone_create(...) :: zone(ZONE_CREATE, ...)
455 * zone_destroy(...) :: zone(ZONE_DESTROY, ...)
456 * zone_getattr(...) :: zone(ZONE_GETATTR, ...)
457 * zone_enter(...) :: zone(ZONE_ENTER, ...)
458 * zone_list(...) :: zone(ZONE_LIST, ...)
459 * zone_shutdown(...) :: zone(ZONE_SHUTDOWN, ...)
460 * zone_lookup(...) :: zone(ZONE_LOOKUP, ...)
461 * zone_boot(...) :: zone(ZONE_BOOT, ...)
462 * zone_version(...) :: zone(ZONE_VERSION, ...)
463 * zone_setattr(...) :: zone(ZONE_SETATTR, ...)
464 * zone_add_datalink(...) :: zone(ZONE_ADD_DATALINK, ...)
465 * zone_remove_datalink(...) :: zone(ZONE_DEL_DATALINK, ...)
466 * zone_check_datalink(...) :: zone(ZONE_CHECK_DATALINK, ...)
467 * zone_list_datalink(...) :: zone(ZONE_LIST_DATALINK, ...)
469 #define SYS_autofssys 228
470 #define SYS_getcwd 229
471 #define SYS_so_socket 230
472 #define SYS_so_socketpair 231
474 #define SYS_listen 233
475 #define SYS_accept 234
476 #define SYS_connect 235
477 #define SYS_shutdown 236
479 #define SYS_recvfrom 238
480 #define SYS_recvmsg 239
482 #define SYS_sendmsg 241
483 #define SYS_sendto 242
484 #define SYS_getpeername 243
485 #define SYS_getsockname 244
486 #define SYS_getsockopt 245
487 #define SYS_setsockopt 246
488 #define SYS_sockconfig 247
492 #define SYS_ntp_gettime 248
493 #define SYS_ntp_adjtime 249
494 #define SYS_lwp_mutex_unlock 250
495 #define SYS_lwp_mutex_trylock 251
496 #define SYS_lwp_mutex_register 252
497 #define SYS_cladm 253
498 #define SYS_uucopy 254
499 #define SYS_umount2 255
503 typedef struct { /* syscall set type */
504 unsigned int word
[16];
507 typedef struct { /* return values from system call */
508 long sys_rval1
; /* primary return value from system call */
509 long sys_rval2
; /* second return value from system call */
512 #if !defined(_KERNEL)
514 extern long syscall(int, ...);
515 extern long __systemcall(sysret_t
*, int, ...);
516 extern int __set_errno(int);
526 #endif /* _SYS_SYSCALL_H */