stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * CDDL HEADER START |
| 3 | * |
| 4 | * The contents of this file are subject to the terms of the |
jpk | 45916cd | 2006-03-24 12:29:20 -0800 | [diff] [blame] | 5 | * Common Development and Distribution License (the "License"). |
| 6 | * You may not use this file except in compliance with the License. |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 7 | * |
| 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. |
| 12 | * |
| 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] |
| 18 | * |
| 19 | * CDDL HEADER END |
| 20 | */ |
raf | f841f6a | 2006-06-20 19:21:46 -0700 | [diff] [blame] | 21 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 22 | /* |
Anders Persson | 3e95bd4 | 2010-06-17 17:22:09 -0700 | [diff] [blame] | 23 | * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 24 | * Copyright 2012 Milan Jurik. All rights reserved. |
Theo Schlossnagle | 5dbfd19 | 2013-04-11 04:50:36 +0000 | [diff] [blame] | 25 | * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 26 | * Copyright (c) 2018, Joyent, Inc. |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 27 | */ |
| 28 | |
| 29 | /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ |
| 30 | /* All Rights Reserved */ |
| 31 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 32 | #include <sys/param.h> |
| 33 | #include <sys/types.h> |
| 34 | #include <sys/systm.h> |
| 35 | #include <sys/systrace.h> |
| 36 | #include <sys/procfs.h> |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 37 | #include <sys/mman.h> |
| 38 | #include <sys/int_types.h> |
| 39 | #include <c2/audit.h> |
| 40 | #include <sys/stat.h> |
| 41 | #include <sys/times.h> |
| 42 | #include <sys/statfs.h> |
| 43 | #include <sys/stropts.h> |
| 44 | #include <sys/statvfs.h> |
| 45 | #include <sys/utsname.h> |
| 46 | #include <sys/timex.h> |
| 47 | #include <sys/socket.h> |
| 48 | #include <sys/sendfile.h> |
| 49 | |
| 50 | struct hrtsysa; |
| 51 | struct mmaplf32a; |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 52 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 53 | /* |
| 54 | * This table is the switch used to transfer to the appropriate |
| 55 | * routine for processing a system call. Each row contains the |
| 56 | * number of arguments expected, a switch that tells systrap() |
| 57 | * in trap.c whether a setjmp() is not necessary, and a pointer |
| 58 | * to the routine. |
| 59 | */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 60 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 61 | int access(char *, int); |
| 62 | int alarm(int); |
| 63 | int auditsys(struct auditcalls *, rval_t *); |
| 64 | int64_t brandsys(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, |
| 65 | uintptr_t); |
Richard Lowe | d2a7078 | 2014-04-16 02:39:14 +0100 | [diff] [blame] | 66 | intptr_t brk(caddr_t); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 67 | int chdir(char *); |
| 68 | int chmod(char *, int); |
| 69 | int chown(char *, uid_t, gid_t); |
| 70 | int chroot(char *); |
| 71 | int cladm(int, int, void *); |
| 72 | int close(int); |
| 73 | int exece(const char *, const char **, const char **); |
| 74 | int faccessat(int, char *, int, int); |
| 75 | int fchmodat(int, char *, int, int); |
| 76 | int fchownat(int, char *, uid_t, gid_t, int); |
| 77 | int fcntl(int, int, intptr_t); |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 78 | int64_t vfork(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 79 | int64_t forksys(int, int); |
| 80 | int fstat(int, struct stat *); |
| 81 | int fdsync(int, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 82 | int64_t getgid(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 83 | int ucredsys(int, int, void *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 84 | int64_t getpid(); |
| 85 | int64_t getuid(); |
| 86 | time_t gtime(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 87 | int getloadavg(int *, int); |
| 88 | int rusagesys(int, void *, void *, void *, void *); |
| 89 | int getpagesizes(int, size_t *, int); |
| 90 | int gtty(int, intptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 91 | #if defined(__i386) || defined(__amd64) |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 92 | int hrtsys(struct hrtsysa *, rval_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 93 | #endif /* __i386 || __amd64 */ |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 94 | int ioctl(int, int, intptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 95 | int kill(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 96 | int labelsys(int, void *, void *, void *, void *, void *); |
| 97 | int link(char *, char *); |
| 98 | int linkat(int, char *, int, char *, int); |
| 99 | off32_t lseek32(int32_t, off32_t, int32_t); |
| 100 | off_t lseek64(int, off_t, int); |
| 101 | int lgrpsys(int, long, void *); |
| 102 | int mmapobjsys(int, uint_t, mmapobj_result_t *, uint_t *, void *); |
| 103 | int mknod(char *, mode_t, dev_t); |
| 104 | int mknodat(int, char *, mode_t, dev_t); |
| 105 | int mount(long *, rval_t *); |
| 106 | int nice(int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 107 | int nullsys(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 108 | int open(char *, int, int); |
| 109 | int openat(int, char *, int, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 110 | int pause(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 111 | long pcsample(void *, long); |
| 112 | int privsys(int, priv_op_t, priv_ptype_t, void *, size_t, int); |
| 113 | int profil(unsigned short *, size_t, ulong_t, uint_t); |
| 114 | ssize_t pread(int, void *, size_t, off_t); |
Richard Lowe | d2a7078 | 2014-04-16 02:39:14 +0100 | [diff] [blame] | 115 | int psecflags(procset_t *, psecflagwhich_t, secflagdelta_t *); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 116 | ssize_t pwrite(int, void *, size_t, off_t); |
| 117 | ssize_t read(int, void *, size_t); |
| 118 | int rename(char *, char *); |
| 119 | int renameat(int, char *, int, char *); |
| 120 | void rexit(int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 121 | int semsys(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 122 | int setgid(gid_t); |
| 123 | int setpgrp(int, int, int); |
| 124 | int setuid(uid_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 125 | uintptr_t shmsys(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 126 | uint64_t sidsys(int, int, int, int); |
| 127 | int sigprocmask(int, sigset_t *, sigset_t *); |
| 128 | int sigsuspend(sigset_t); |
| 129 | int sigaltstack(struct sigaltstack *, struct sigaltstack *); |
| 130 | int sigaction(int, struct sigaction *, struct sigaction *); |
| 131 | int sigpending(int, sigset_t *); |
| 132 | int sigresend(int, siginfo_t *, sigset_t *); |
| 133 | int sigtimedwait(sigset_t *, siginfo_t *, timespec_t *); |
| 134 | int getsetcontext(int, void *); |
| 135 | int stat(char *, struct stat *); |
| 136 | int fstatat(int, char *, struct stat *, int); |
| 137 | int stime(time_t); |
| 138 | int stty(int, intptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 139 | int syssync(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 140 | int sysacct(char *); |
| 141 | clock_t times(struct tms *); |
| 142 | long ulimit(int, long); |
| 143 | int getrlimit32(int, struct rlimit32 *); |
| 144 | int setrlimit32(int, struct rlimit32 *); |
| 145 | int umask(int); |
| 146 | int umount2(char *, int); |
| 147 | int unlink(char *); |
| 148 | int unlinkat(int, char *, int); |
| 149 | int utimesys(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t); |
| 150 | int64_t utssys32(void *, int, int, void *); |
| 151 | int64_t utssys64(void *, long, int, void *); |
| 152 | int uucopy(const void *, void *, size_t); |
| 153 | ssize_t uucopystr(const char *, char *, size_t); |
| 154 | ssize_t write(int, void *, size_t); |
| 155 | ssize_t readv(int, struct iovec *, int); |
| 156 | ssize_t writev(int, struct iovec *, int); |
DJ Hoffman | fca543c | 2014-06-09 20:35:13 +0000 | [diff] [blame] | 157 | ssize_t preadv(int, struct iovec *, int, off_t, off_t); |
| 158 | ssize_t pwritev(int, struct iovec *, int, off_t, off_t); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 159 | int syslwp_park(int, uintptr_t, uintptr_t); |
| 160 | int rmdir(char *); |
| 161 | int mkdir(char *, int); |
| 162 | int mkdirat(int, char *, int); |
| 163 | int getdents32(int, void *, size_t); |
| 164 | int statfs32(char *, struct statfs32 *, int32_t, int32_t); |
| 165 | int fstatfs32(int32_t, struct statfs32 *, int32_t, int32_t); |
| 166 | int sysfs(int, long, long); |
| 167 | int getmsg(int, struct strbuf *, struct strbuf *, int *); |
| 168 | int pollsys(pollfd_t *, nfds_t, timespec_t *, sigset_t *); |
| 169 | int putmsg(int, struct strbuf *, struct strbuf *, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 170 | int uadmin(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 171 | int lstat(char *, struct stat *); |
| 172 | int symlink(char *, char *); |
| 173 | int symlinkat(char *, int, char *); |
| 174 | ssize_t readlink(char *, char *, size_t); |
| 175 | ssize_t readlinkat(int, char *, char *, size_t); |
| 176 | int resolvepath(char *, char *, size_t); |
| 177 | int setgroups(int, gid_t *); |
| 178 | int getgroups(int, gid_t *); |
| 179 | int fchdir(int); |
| 180 | int fchown(int, uid_t, uid_t); |
| 181 | int fchmod(int, int); |
| 182 | int getcwd(char *, size_t); |
| 183 | int statvfs(char *, struct statvfs *); |
| 184 | int fstatvfs(int, struct statvfs *); |
| 185 | offset_t llseek32(int32_t, uint32_t, uint32_t, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 186 | |
| 187 | #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT) |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 188 | int sysi86(short, uintptr_t, uintptr_t, uintptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 189 | #endif |
| 190 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 191 | int acl(const char *, int, int, void *); |
| 192 | int facl(int, int, int, void *); |
| 193 | long priocntlsys(int, procset_t *, int, caddr_t, caddr_t); |
| 194 | int waitsys(idtype_t, id_t, siginfo_t *, int); |
| 195 | int sigsendsys(procset_t *, int); |
| 196 | int mincore(caddr_t, size_t, char *); |
| 197 | caddr_t smmap64(caddr_t, size_t, int, int, int, off_t); |
| 198 | caddr_t smmap32(caddr32_t, size32_t, int, int, int, off32_t); |
| 199 | int smmaplf32(struct mmaplf32a *, rval_t *); |
| 200 | int mprotect(caddr_t, size_t, int); |
| 201 | int munmap(caddr_t, size_t); |
| 202 | int uname(struct utsname *); |
| 203 | int lchown(char *, uid_t, gid_t); |
| 204 | int getpmsg(int, struct strbuf *, struct strbuf *, int *, int *); |
| 205 | int putpmsg(int, struct strbuf *, struct strbuf *, int, int); |
| 206 | int memcntl(caddr_t, size_t, int, caddr_t, int, int); |
| 207 | long sysconfig(int); |
| 208 | int adjtime(struct timeval *, struct timeval *); |
| 209 | long systeminfo(int, char *, long); |
| 210 | int setegid(gid_t); |
| 211 | int seteuid(uid_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 212 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 213 | int setreuid(uid_t, uid_t); |
| 214 | int setregid(gid_t, gid_t); |
| 215 | int install_utrap(utrap_entry_t type, utrap_handler_t, utrap_handler_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 216 | #ifdef __sparc |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 217 | int sparc_utrap_install(utrap_entry_t type, utrap_handler_t, |
| 218 | utrap_handler_t, utrap_handler_t *, utrap_handler_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 219 | #endif |
| 220 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 221 | int syslwp_create(ucontext_t *, int, id_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 222 | void syslwp_exit(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 223 | int syslwp_suspend(id_t); |
| 224 | int syslwp_continue(id_t); |
| 225 | int syslwp_private(int, int, uintptr_t); |
| 226 | int lwp_detach(id_t); |
| 227 | int lwp_info(timestruc_t *); |
| 228 | int lwp_kill(id_t, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 229 | int lwp_self(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 230 | int64_t lwp_sigmask(int, uint_t, uint_t, uint_t, uint_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 231 | int yield(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 232 | int lwp_wait(id_t, id_t *); |
| 233 | int lwp_mutex_timedlock(lwp_mutex_t *, timespec_t *, uintptr_t); |
| 234 | int lwp_mutex_wakeup(lwp_mutex_t *, int); |
| 235 | int lwp_mutex_unlock(lwp_mutex_t *); |
| 236 | int lwp_mutex_trylock(lwp_mutex_t *, uintptr_t); |
| 237 | int lwp_mutex_register(lwp_mutex_t *, caddr_t); |
| 238 | int lwp_rwlock_sys(int, lwp_rwlock_t *, timespec_t *); |
| 239 | int lwp_sema_post(lwp_sema_t *); |
| 240 | int lwp_sema_timedwait(lwp_sema_t *, timespec_t *, int); |
| 241 | int lwp_sema_trywait(lwp_sema_t *); |
| 242 | int lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *, timespec_t *, int); |
| 243 | int lwp_cond_signal(lwp_cond_t *); |
| 244 | int lwp_cond_broadcast(lwp_cond_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 245 | caddr_t schedctl(); |
| 246 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 247 | long pathconf(char *, int); |
| 248 | long fpathconf(int, int); |
| 249 | int processor_bind(idtype_t, id_t, processorid_t, processorid_t *); |
| 250 | int processor_info(processorid_t, processor_info_t *); |
| 251 | int p_online(processorid_t, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 252 | |
| 253 | /* |
| 254 | * POSIX .4 system calls * |
| 255 | */ |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 256 | int clock_gettime(clockid_t, timespec_t *); |
| 257 | int clock_settime(clockid_t, timespec_t *); |
| 258 | int clock_getres(clockid_t, timespec_t *); |
| 259 | int timer_create(clockid_t, struct sigevent *, timer_t *); |
| 260 | int timer_delete(timer_t); |
| 261 | int timer_settime(timer_t, int, itimerspec_t *, itimerspec_t *); |
| 262 | int timer_gettime(timer_t, itimerspec_t *); |
| 263 | int timer_getoverrun(timer_t); |
| 264 | int nanosleep(timespec_t *, timespec_t *); |
| 265 | int sigqueue(pid_t, int, void *, int, int); |
| 266 | int signotify(int, siginfo_t *, signotify_id_t *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 267 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 268 | int getdents64(int, void *, size_t); |
| 269 | int stat64(char *, struct stat64 *); |
| 270 | int lstat64(char *, struct stat64 *); |
| 271 | int fstatat64(int, char *, struct stat64 *, int); |
| 272 | int fstat64(int, struct stat64 *); |
| 273 | int statvfs64(char *, struct statvfs64 *); |
| 274 | int fstatvfs64(int, struct statvfs64 *); |
| 275 | int setrlimit64(int, struct rlimit64 *); |
| 276 | int getrlimit64(int, struct rlimit64 *); |
| 277 | int pread64(int, void *, size32_t, uint32_t, uint32_t); |
| 278 | int pwrite64(int, void *, size32_t, uint32_t, uint32_t); |
| 279 | int open64(char *, int, int); |
| 280 | int openat64(int, char *, int, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 281 | |
| 282 | /* |
| 283 | * NTP syscalls |
| 284 | */ |
| 285 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 286 | int ntp_gettime(struct ntptimeval *); |
| 287 | int ntp_adjtime(struct timex *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 288 | |
| 289 | /* |
| 290 | * ++++++++++++++++++++++++ |
| 291 | * ++ SunOS4.1 Buyback ++ |
| 292 | * ++++++++++++++++++++++++ |
| 293 | * |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 294 | * fchroot, vhangup, gettimeofday |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 295 | */ |
| 296 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 297 | int fchroot(int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 298 | int vhangup(); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 299 | int gettimeofday(struct timeval *); |
| 300 | int getitimer(uint_t, struct itimerval *); |
| 301 | int setitimer(uint_t, struct itimerval *, struct itimerval *); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 302 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 303 | int corectl(int, uintptr_t, uintptr_t, uintptr_t); |
| 304 | int modctl(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 305 | int64_t loadable_syscall(); |
| 306 | int64_t indir(); |
| 307 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 308 | long tasksys(int, projid_t, uint_t, void *, size_t); |
| 309 | long rctlsys(int, char *, void *, void *, size_t, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 310 | |
| 311 | long zone(); |
| 312 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 313 | int so_socket(int, int, int, char *, int); |
| 314 | int so_socketpair(int[2]); |
| 315 | int bind(int, struct sockaddr *, socklen_t, int); |
| 316 | int listen(int, int, int); |
Theo Schlossnagle | 5eaceb4 | 2013-05-09 23:44:40 +0000 | [diff] [blame] | 317 | int accept(int, struct sockaddr *, socklen_t *, int, int); |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 318 | int connect(int, struct sockaddr *, socklen_t, int); |
| 319 | int shutdown(int, int, int); |
| 320 | ssize_t recv(int, void *, size_t, int); |
| 321 | ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); |
| 322 | ssize_t recvmsg(int, struct nmsghdr *, int); |
| 323 | ssize_t send(int, void *, size_t, int); |
| 324 | ssize_t sendmsg(int, struct nmsghdr *, int); |
| 325 | ssize_t sendto(int, void *, size_t, int, struct sockaddr *, socklen_t); |
| 326 | int getpeername(int, struct sockaddr *, socklen_t *, int); |
| 327 | int getsockname(int, struct sockaddr *, socklen_t *, int); |
| 328 | int getsockopt(int, int, int, void *, socklen_t *, int); |
| 329 | int setsockopt(int, int, int, void *, socklen_t *, int); |
| 330 | int sockconfig(int, void *, void *, void *, void *); |
| 331 | ssize_t sendfilev(int, int, const struct sendfilevec *, int, size_t *); |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 332 | ssize_t getrandom(void *, size_t, unsigned int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 333 | |
| 334 | typedef int64_t (*llfcn_t)(); /* for casting one-word returns */ |
| 335 | |
| 336 | /* |
| 337 | * Sysent initialization macros. |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 338 | * These take the name string of the system call even though that isn't |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 339 | * currently used in the sysent entry. This might be useful someday. |
| 340 | * |
| 341 | * Initialization macro for system calls which take their args in the C style. |
| 342 | * These system calls return the longlong_t return value and must call |
| 343 | * set_errno() to return an error. For SPARC, narg must be at most six. |
| 344 | * For more args, use the SYSENT_AP() routine. |
| 345 | * |
| 346 | * We are able to return two distinct values to userland via the rval_t. |
| 347 | * At this time, that corresponds to one 64-bit quantity, or two 32-bit |
| 348 | * quantities. The kernel does not currently need to return two 64-bit |
| 349 | * values, or one 128 bit value(!), but we may do one day, so the calling |
| 350 | * sequence between userland and the kernel should permit it. |
| 351 | * |
| 352 | * The interpretation of rval_t is provided by the sy_flags field |
| 353 | * which is used to determine how to arrange the results in registers |
| 354 | * (or on the stack) for return userland. |
| 355 | */ |
| 356 | /* returns a 64-bit quantity for both ABIs */ |
| 357 | #define SYSENT_C(name, call, narg) \ |
| 358 | { (narg), SE_64RVAL, NULL, NULL, (llfcn_t)(call) } |
| 359 | |
| 360 | /* returns one 32-bit value for both ABIs: r_val1 */ |
| 361 | #define SYSENT_CI(name, call, narg) \ |
| 362 | { (narg), SE_32RVAL1, NULL, NULL, (llfcn_t)(call) } |
| 363 | |
| 364 | /* returns 2 32-bit values: r_val1 & r_val2 */ |
| 365 | #define SYSENT_2CI(name, call, narg) \ |
| 366 | { (narg), SE_32RVAL1|SE_32RVAL2, NULL, NULL, (llfcn_t)(call) } |
| 367 | |
| 368 | /* |
| 369 | * Initialization macro for system calls which take their args in the standard |
| 370 | * Unix style of a pointer to the arg structure and a pointer to the rval_t. |
| 371 | * |
| 372 | * Deprecated wherever possible (slower on some architectures, and trickier |
| 373 | * to maintain two flavours). |
| 374 | */ |
| 375 | #define SYSENT_AP(name, call, narg) \ |
| 376 | { (narg), SE_64RVAL, (call), NULL, syscall_ap } |
| 377 | |
| 378 | /* |
| 379 | * Conditional constructors to build the tables without #ifdef clutter |
| 380 | */ |
| 381 | #if defined(_LP64) |
| 382 | #define IF_LP64(true, false) true |
| 383 | #else |
| 384 | #define IF_LP64(true, false) false |
| 385 | #endif |
| 386 | |
| 387 | #if defined(__sparc) |
| 388 | #define IF_sparc(true, false) true |
| 389 | #else |
| 390 | #define IF_sparc(true, false) false |
| 391 | #endif |
| 392 | |
| 393 | #if defined(__i386) && !defined(__amd64) |
| 394 | #define IF_i386(true, false) true |
| 395 | #else |
| 396 | #define IF_i386(true, false) false |
| 397 | #endif |
| 398 | |
kalai | c2e7b48 | 2005-10-04 10:09:58 -0700 | [diff] [blame] | 399 | #if defined(__i386) || defined(__amd64) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 400 | #define IF_x86(true, false) true |
| 401 | #else |
| 402 | #define IF_x86(true, false) false |
| 403 | #endif |
| 404 | |
| 405 | #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT) |
| 406 | #define IF_386_ABI(true, false) true |
| 407 | #else |
| 408 | #define IF_386_ABI(true, false) false |
| 409 | #endif |
| 410 | |
| 411 | /* |
| 412 | * Define system calls that return a native 'long' quantity i.e. a 32-bit |
| 413 | * or 64-bit integer - depending on how the kernel is itself compiled |
| 414 | * e.g. read(2) returns 'ssize_t' in the kernel and in userland. |
| 415 | */ |
| 416 | #define SYSENT_CL(name, call, narg) \ |
| 417 | IF_LP64(SYSENT_C(name, call, narg), SYSENT_CI(name, call, narg)) |
| 418 | |
| 419 | /* |
| 420 | * Initialization macro for loadable native system calls. |
| 421 | */ |
| 422 | #define SYSENT_LOADABLE() \ |
| 423 | { 0, SE_LOADABLE, (int (*)())nosys, NULL, loadable_syscall } |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 424 | |
| 425 | /* |
| 426 | * Initialization macro for loadable 32-bit compatibility system calls. |
| 427 | */ |
| 428 | #define SYSENT_LOADABLE32() SYSENT_LOADABLE() |
| 429 | |
| 430 | #define SYSENT_NOSYS() SYSENT_C("nosys", nosys, 0) |
| 431 | |
| 432 | struct sysent nosys_ent = SYSENT_NOSYS(); |
| 433 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 434 | /* |
| 435 | * Native sysent table. |
| 436 | */ |
| 437 | struct sysent sysent[NSYSCALL] = |
| 438 | { |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 439 | /* 0 */ IF_LP64( |
| 440 | SYSENT_NOSYS(), |
| 441 | SYSENT_C("indir", indir, 1)), |
| 442 | /* 1 */ SYSENT_CI("exit", rexit, 1), |
Richard Lowe | d2a7078 | 2014-04-16 02:39:14 +0100 | [diff] [blame] | 443 | /* 2 */ SYSENT_CI("psecflags", psecflags, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 444 | /* 3 */ SYSENT_CL("read", read, 3), |
| 445 | /* 4 */ SYSENT_CL("write", write, 3), |
| 446 | /* 5 */ SYSENT_CI("open", open, 3), |
| 447 | /* 6 */ SYSENT_CI("close", close, 1), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 448 | /* 7 */ SYSENT_CI("linkat", linkat, 5), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 449 | /* 8 */ SYSENT_LOADABLE(), /* (was creat) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 450 | /* 9 */ SYSENT_CI("link", link, 2), |
| 451 | /* 10 */ SYSENT_CI("unlink", unlink, 1), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 452 | /* 11 */ SYSENT_CI("symlinkat", symlinkat, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 453 | /* 12 */ SYSENT_CI("chdir", chdir, 1), |
| 454 | /* 13 */ SYSENT_CL("time", gtime, 0), |
| 455 | /* 14 */ SYSENT_CI("mknod", mknod, 3), |
| 456 | /* 15 */ SYSENT_CI("chmod", chmod, 2), |
| 457 | /* 16 */ SYSENT_CI("chown", chown, 3), |
| 458 | /* 17 */ SYSENT_CI("brk", brk, 1), |
| 459 | /* 18 */ SYSENT_CI("stat", stat, 2), |
| 460 | /* 19 */ IF_LP64( |
| 461 | SYSENT_CL("lseek", lseek64, 3), |
| 462 | SYSENT_CL("lseek", lseek32, 3)), |
| 463 | /* 20 */ SYSENT_2CI("getpid", getpid, 0), |
| 464 | /* 21 */ SYSENT_AP("mount", mount, 8), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 465 | /* 22 */ SYSENT_CL("readlinkat", readlinkat, 4), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 466 | /* 23 */ SYSENT_CI("setuid", setuid, 1), |
| 467 | /* 24 */ SYSENT_2CI("getuid", getuid, 0), |
| 468 | /* 25 */ SYSENT_CI("stime", stime, 1), |
| 469 | /* 26 */ SYSENT_CL("pcsample", pcsample, 2), |
| 470 | /* 27 */ SYSENT_CI("alarm", alarm, 1), |
| 471 | /* 28 */ SYSENT_CI("fstat", fstat, 2), |
| 472 | /* 29 */ SYSENT_CI("pause", pause, 0), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 473 | /* 30 */ SYSENT_LOADABLE(), /* (was utime) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 474 | /* 31 */ SYSENT_CI("stty", stty, 2), |
| 475 | /* 32 */ SYSENT_CI("gtty", gtty, 2), |
| 476 | /* 33 */ SYSENT_CI("access", access, 2), |
| 477 | /* 34 */ SYSENT_CI("nice", nice, 1), |
| 478 | /* 35 */ IF_LP64( |
| 479 | SYSENT_NOSYS(), |
| 480 | SYSENT_CI("statfs", statfs32, 4)), |
| 481 | /* 36 */ SYSENT_CI("sync", syssync, 0), |
| 482 | /* 37 */ SYSENT_CI("kill", kill, 2), |
| 483 | /* 38 */ IF_LP64( |
| 484 | SYSENT_NOSYS(), |
| 485 | SYSENT_CI("fstatfs", fstatfs32, 4)), |
| 486 | /* 39 */ SYSENT_CI("setpgrp", setpgrp, 3), |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 487 | /* 40 */ SYSENT_CI("uucopystr", uucopystr, 3), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 488 | /* 41 */ SYSENT_LOADABLE(), /* (was dup) */ |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 489 | /* 42 */ SYSENT_LOADABLE(), /* pipe */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 490 | /* 43 */ SYSENT_CL("times", times, 1), |
| 491 | /* 44 */ SYSENT_CI("prof", profil, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 492 | /* 45 */ SYSENT_CI("faccessat", faccessat, 4), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 493 | /* 46 */ SYSENT_CI("setgid", setgid, 1), |
| 494 | /* 47 */ SYSENT_2CI("getgid", getgid, 0), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 495 | /* 48 */ SYSENT_CI("mknodat", mknodat, 4), |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 496 | /* 49 */ SYSENT_LOADABLE(), /* msgsys */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 497 | /* 50 */ IF_x86( |
| 498 | SYSENT_CI("sysi86", sysi86, 4), |
| 499 | SYSENT_LOADABLE()), /* (was sys3b) */ |
| 500 | /* 51 */ SYSENT_LOADABLE(), /* sysacct */ |
| 501 | /* 52 */ SYSENT_LOADABLE(), /* shmsys */ |
| 502 | /* 53 */ SYSENT_LOADABLE(), /* semsys */ |
| 503 | /* 54 */ SYSENT_CI("ioctl", ioctl, 3), |
| 504 | /* 55 */ SYSENT_CI("uadmin", uadmin, 3), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 505 | /* 56 */ SYSENT_CI("fchownat", fchownat, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 506 | /* 57 */ IF_LP64( |
| 507 | SYSENT_2CI("utssys", utssys64, 4), |
| 508 | SYSENT_2CI("utssys", utssys32, 4)), |
| 509 | /* 58 */ SYSENT_CI("fdsync", fdsync, 2), |
| 510 | /* 59 */ SYSENT_CI("exece", exece, 3), |
| 511 | /* 60 */ SYSENT_CI("umask", umask, 1), |
| 512 | /* 61 */ SYSENT_CI("chroot", chroot, 1), |
| 513 | /* 62 */ SYSENT_CI("fcntl", fcntl, 3), |
| 514 | /* 63 */ SYSENT_CI("ulimit", ulimit, 2), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 515 | /* 64 */ SYSENT_CI("renameat", renameat, 4), |
| 516 | /* 65 */ SYSENT_CI("unlinkat", unlinkat, 3), |
| 517 | /* 66 */ SYSENT_CI("fstatat", fstatat, 4), |
| 518 | /* 67 */ IF_LP64( |
| 519 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 520 | SYSENT_CI("fstatat64", fstatat64, 4)), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 521 | /* 68 */ SYSENT_CI("openat", openat, 4), |
| 522 | /* 69 */ IF_LP64( |
| 523 | SYSENT_NOSYS(), |
| 524 | SYSENT_CI("openat64", openat64, 4)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 525 | /* 70 */ SYSENT_CI("tasksys", tasksys, 5), |
| 526 | /* 71 */ SYSENT_LOADABLE(), /* acctctl */ |
| 527 | /* 72 */ SYSENT_LOADABLE(), /* exacct */ |
kchow | 02bc52b | 2007-10-28 10:20:15 -0700 | [diff] [blame] | 528 | /* 73 */ SYSENT_CI("getpagesizes", getpagesizes, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 529 | /* 74 */ SYSENT_CI("rctlsys", rctlsys, 6), |
casper | f48205b | 2007-05-25 05:43:42 -0700 | [diff] [blame] | 530 | /* 75 */ SYSENT_2CI("sidsys", sidsys, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 531 | /* 76 */ SYSENT_LOADABLE(), /* (was fsat) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 532 | /* 77 */ SYSENT_CI("lwp_park", syslwp_park, 3), |
| 533 | /* 78 */ SYSENT_CL("sendfilev", sendfilev, 5), |
| 534 | /* 79 */ SYSENT_CI("rmdir", rmdir, 1), |
| 535 | /* 80 */ SYSENT_CI("mkdir", mkdir, 2), |
| 536 | /* 81 */ IF_LP64( |
| 537 | SYSENT_CI("getdents", getdents64, 3), |
| 538 | SYSENT_CI("getdents", getdents32, 3)), |
casper | ddf7fe9 | 2008-03-03 07:48:05 -0800 | [diff] [blame] | 539 | /* 82 */ SYSENT_CI("privsys", privsys, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 540 | /* 83 */ SYSENT_CI("ucredsys", ucredsys, 3), |
| 541 | /* 84 */ SYSENT_CI("sysfs", sysfs, 3), |
| 542 | /* 85 */ SYSENT_CI("getmsg", getmsg, 4), |
| 543 | /* 86 */ SYSENT_CI("putmsg", putmsg, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 544 | /* 87 */ SYSENT_LOADABLE(), /* (was poll) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 545 | /* 88 */ SYSENT_CI("lstat", lstat, 2), |
| 546 | /* 89 */ SYSENT_CI("symlink", symlink, 2), |
| 547 | /* 90 */ SYSENT_CL("readlink", readlink, 3), |
| 548 | /* 91 */ SYSENT_CI("setgroups", setgroups, 2), |
| 549 | /* 92 */ SYSENT_CI("getgroups", getgroups, 2), |
| 550 | /* 93 */ SYSENT_CI("fchmod", fchmod, 2), |
| 551 | /* 94 */ SYSENT_CI("fchown", fchown, 3), |
| 552 | /* 95 */ SYSENT_CI("sigprocmask", sigprocmask, 3), |
| 553 | /* 96 */ SYSENT_CI("sigsuspend", sigsuspend, 1), |
| 554 | /* 97 */ SYSENT_CI("sigaltstack", sigaltstack, 2), |
| 555 | /* 98 */ SYSENT_CI("sigaction", sigaction, 3), |
| 556 | /* 99 */ SYSENT_CI("sigpending", sigpending, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 557 | /* 100 */ SYSENT_CI("getsetcontext", getsetcontext, 2), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 558 | /* 101 */ SYSENT_CI("fchmodat", fchmodat, 4), |
| 559 | /* 102 */ SYSENT_CI("mkdirat", mkdirat, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 560 | /* 103 */ SYSENT_CI("statvfs", statvfs, 2), |
| 561 | /* 104 */ SYSENT_CI("fstatvfs", fstatvfs, 2), |
| 562 | /* 105 */ SYSENT_CI("getloadavg", getloadavg, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 563 | /* 106 */ SYSENT_LOADABLE(), /* nfssys */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 564 | /* 107 */ SYSENT_CI("waitsys", waitsys, 4), |
| 565 | /* 108 */ SYSENT_CI("sigsendset", sigsendsys, 2), |
| 566 | /* 109 */ IF_x86( |
| 567 | SYSENT_AP("hrtsys", hrtsys, 5), |
| 568 | SYSENT_LOADABLE()), |
Roger A. Faulkner | 3b862e9 | 2009-09-01 15:37:22 -0700 | [diff] [blame] | 569 | /* 110 */ SYSENT_CI("utimesys", utimesys, 5), |
raf | f48068a | 2007-08-06 13:50:45 -0700 | [diff] [blame] | 570 | /* 111 */ SYSENT_CI("sigresend", sigresend, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 571 | /* 112 */ SYSENT_CL("priocntlsys", priocntlsys, 5), |
| 572 | /* 113 */ SYSENT_CL("pathconf", pathconf, 2), |
| 573 | /* 114 */ SYSENT_CI("mincore", mincore, 3), |
| 574 | /* 115 */ IF_LP64( |
| 575 | SYSENT_CL("mmap", smmap64, 6), |
| 576 | SYSENT_CL("mmap", smmap32, 6)), |
| 577 | /* 116 */ SYSENT_CI("mprotect", mprotect, 3), |
| 578 | /* 117 */ SYSENT_CI("munmap", munmap, 2), |
| 579 | /* 118 */ SYSENT_CL("fpathconf", fpathconf, 2), |
| 580 | /* 119 */ SYSENT_2CI("vfork", vfork, 0), |
| 581 | /* 120 */ SYSENT_CI("fchdir", fchdir, 1), |
| 582 | /* 121 */ SYSENT_CL("readv", readv, 3), |
| 583 | /* 122 */ SYSENT_CL("writev", writev, 3), |
DJ Hoffman | fca543c | 2014-06-09 20:35:13 +0000 | [diff] [blame] | 584 | /* 123 */ SYSENT_CL("preadv", preadv, 5), |
| 585 | /* 124 */ SYSENT_CL("pwritev", pwritev, 5), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 586 | /* 125 */ SYSENT_LOADABLE(), /* (was fxstat) */ |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 587 | /* 126 */ SYSENT_CL("getrandom", getrandom, 3), |
Michael Corcoran | 0616c1c | 2008-11-24 17:12:06 -0800 | [diff] [blame] | 588 | /* 127 */ SYSENT_CI("mmapobj", mmapobjsys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 589 | /* 128 */ IF_LP64( |
| 590 | SYSENT_CI("setrlimit", setrlimit64, 2), |
| 591 | SYSENT_CI("setrlimit", setrlimit32, 2)), |
| 592 | /* 129 */ IF_LP64( |
| 593 | SYSENT_CI("getrlimit", getrlimit64, 2), |
| 594 | SYSENT_CI("getrlimit", getrlimit32, 2)), |
| 595 | /* 130 */ SYSENT_CI("lchown", lchown, 3), |
| 596 | /* 131 */ SYSENT_CI("memcntl", memcntl, 6), |
| 597 | /* 132 */ SYSENT_CI("getpmsg", getpmsg, 5), |
| 598 | /* 133 */ SYSENT_CI("putpmsg", putpmsg, 5), |
| 599 | /* 134 */ SYSENT_CI("rename", rename, 2), |
| 600 | /* 135 */ SYSENT_CI("uname", uname, 1), |
| 601 | /* 136 */ SYSENT_CI("setegid", setegid, 1), |
| 602 | /* 137 */ SYSENT_CL("sysconfig", sysconfig, 1), |
| 603 | /* 138 */ SYSENT_CI("adjtime", adjtime, 2), |
| 604 | /* 139 */ SYSENT_CL("systeminfo", systeminfo, 3), |
th199096 | a237e38 | 2007-04-02 21:38:04 -0700 | [diff] [blame] | 605 | /* 140 */ SYSENT_LOADABLE(), /* sharefs */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 606 | /* 141 */ SYSENT_CI("seteuid", seteuid, 1), |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 607 | /* 142 */ SYSENT_2CI("forksys", forksys, 2), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 608 | /* 143 */ SYSENT_LOADABLE(), /* (was fork1) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 609 | /* 144 */ SYSENT_CI("sigtimedwait", sigtimedwait, 3), |
| 610 | /* 145 */ SYSENT_CI("lwp_info", lwp_info, 1), |
| 611 | /* 146 */ SYSENT_CI("yield", yield, 0), |
Roger A. Faulkner | bdf0047 | 2010-03-12 12:19:46 -0800 | [diff] [blame] | 612 | /* 147 */ SYSENT_LOADABLE(), /* (was lwp_sema_wait) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 613 | /* 148 */ SYSENT_CI("lwp_sema_post", lwp_sema_post, 1), |
| 614 | /* 149 */ SYSENT_CI("lwp_sema_trywait", lwp_sema_trywait, 1), |
| 615 | /* 150 */ SYSENT_CI("lwp_detach", lwp_detach, 1), |
| 616 | /* 151 */ SYSENT_CI("corectl", corectl, 4), |
| 617 | /* 152 */ SYSENT_CI("modctl", modctl, 6), |
| 618 | /* 153 */ SYSENT_CI("fchroot", fchroot, 1), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 619 | /* 154 */ SYSENT_LOADABLE(), /* (was utimes) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 620 | /* 155 */ SYSENT_CI("vhangup", vhangup, 0), |
| 621 | /* 156 */ SYSENT_CI("gettimeofday", gettimeofday, 1), |
| 622 | /* 157 */ SYSENT_CI("getitimer", getitimer, 2), |
| 623 | /* 158 */ SYSENT_CI("setitimer", setitimer, 3), |
| 624 | /* 159 */ SYSENT_CI("lwp_create", syslwp_create, 3), |
| 625 | /* 160 */ SYSENT_CI("lwp_exit", (int (*)())syslwp_exit, 0), |
| 626 | /* 161 */ SYSENT_CI("lwp_suspend", syslwp_suspend, 1), |
| 627 | /* 162 */ SYSENT_CI("lwp_continue", syslwp_continue, 1), |
| 628 | /* 163 */ SYSENT_CI("lwp_kill", lwp_kill, 2), |
| 629 | /* 164 */ SYSENT_CI("lwp_self", lwp_self, 0), |
Roger A. Faulkner | bdf0047 | 2010-03-12 12:19:46 -0800 | [diff] [blame] | 630 | /* 165 */ SYSENT_2CI("lwp_sigmask", lwp_sigmask, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 631 | /* 166 */ IF_x86( |
| 632 | SYSENT_CI("lwp_private", syslwp_private, 3), |
| 633 | SYSENT_NOSYS()), |
| 634 | /* 167 */ SYSENT_CI("lwp_wait", lwp_wait, 2), |
raf | 883492d | 2007-06-29 13:31:58 -0700 | [diff] [blame] | 635 | /* 168 */ SYSENT_CI("lwp_mutex_wakeup", lwp_mutex_wakeup, 2), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 636 | /* 169 */ SYSENT_LOADABLE(), /* (was lwp_mutex_lock) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 637 | /* 170 */ SYSENT_CI("lwp_cond_wait", lwp_cond_wait, 4), |
| 638 | /* 171 */ SYSENT_CI("lwp_cond_signal", lwp_cond_signal, 1), |
| 639 | /* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast, 1), |
| 640 | /* 173 */ SYSENT_CL("pread", pread, 4), |
| 641 | /* 174 */ SYSENT_CL("pwrite ", pwrite, 4), |
| 642 | /* |
| 643 | * The 64-bit C library maps llseek() to lseek(), so this |
| 644 | * is needed as a native syscall only on the 32-bit kernel. |
| 645 | */ |
| 646 | /* 175 */ IF_LP64( |
| 647 | SYSENT_NOSYS(), |
| 648 | SYSENT_C("llseek", llseek32, 4)), |
| 649 | /* 176 */ SYSENT_LOADABLE(), /* inst_sync */ |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 650 | /* 177 */ SYSENT_CI("brandsys", brandsys, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 651 | /* 178 */ SYSENT_LOADABLE(), /* kaio */ |
| 652 | /* 179 */ SYSENT_LOADABLE(), /* cpc */ |
| 653 | /* 180 */ SYSENT_CI("lgrpsys", lgrpsys, 3), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 654 | /* 181 */ SYSENT_CI("rusagesys", rusagesys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 655 | /* 182 */ SYSENT_LOADABLE(), /* portfs */ |
| 656 | /* 183 */ SYSENT_CI("pollsys", pollsys, 4), |
jpk | 45916cd | 2006-03-24 12:29:20 -0800 | [diff] [blame] | 657 | /* 184 */ SYSENT_CI("labelsys", labelsys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 658 | /* 185 */ SYSENT_CI("acl", acl, 4), |
Marek Pospisil | 005d3fe | 2010-03-05 13:16:08 -0800 | [diff] [blame] | 659 | /* 186 */ SYSENT_AP("auditsys", auditsys, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 660 | /* 187 */ SYSENT_CI("processor_bind", processor_bind, 4), |
| 661 | /* 188 */ SYSENT_CI("processor_info", processor_info, 2), |
| 662 | /* 189 */ SYSENT_CI("p_online", p_online, 2), |
raf | f841f6a | 2006-06-20 19:21:46 -0700 | [diff] [blame] | 663 | /* 190 */ SYSENT_CI("sigqueue", sigqueue, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 664 | /* 191 */ SYSENT_CI("clock_gettime", clock_gettime, 2), |
| 665 | /* 192 */ SYSENT_CI("clock_settime", clock_settime, 2), |
| 666 | /* 193 */ SYSENT_CI("clock_getres", clock_getres, 2), |
| 667 | /* 194 */ SYSENT_CI("timer_create", timer_create, 3), |
| 668 | /* 195 */ SYSENT_CI("timer_delete", timer_delete, 1), |
| 669 | /* 196 */ SYSENT_CI("timer_settime", timer_settime, 4), |
| 670 | /* 197 */ SYSENT_CI("timer_gettime", timer_gettime, 2), |
| 671 | /* 198 */ SYSENT_CI("timer_getoverrun", timer_getoverrun, 1), |
| 672 | /* 199 */ SYSENT_CI("nanosleep", nanosleep, 2), |
| 673 | /* 200 */ SYSENT_CI("facl", facl, 4), |
| 674 | /* 201 */ SYSENT_LOADABLE(), /* door */ |
| 675 | /* 202 */ SYSENT_CI("setreuid", setreuid, 2), |
| 676 | /* 203 */ SYSENT_CI("setregid", setregid, 2), |
| 677 | /* 204 */ SYSENT_CI("install_utrap", install_utrap, 3), |
| 678 | /* 205 */ SYSENT_CI("signotify", signotify, 3), |
| 679 | /* 206 */ SYSENT_CL("schedctl", schedctl, 0), |
| 680 | /* 207 */ SYSENT_LOADABLE(), /* pset */ |
| 681 | /* 208 */ IF_sparc( |
| 682 | SYSENT_CI("sparc_utrap_install", sparc_utrap_install, 5), |
| 683 | SYSENT_NOSYS()), |
| 684 | /* 209 */ SYSENT_CI("resolvepath", resolvepath, 3), |
Roger A. Faulkner | db94676 | 2009-10-27 10:50:50 -0700 | [diff] [blame] | 685 | /* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 686 | /* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait, 3), |
| 687 | /* 212 */ SYSENT_CI("lwp_rwlock_sys", lwp_rwlock_sys, 3), |
| 688 | /* |
| 689 | * Syscalls 213-225: 32-bit system call support for large files. |
| 690 | * |
| 691 | * (The 64-bit C library transparently maps these system calls |
| 692 | * back to their native versions, so almost all of them are only |
| 693 | * needed as native syscalls on the 32-bit kernel). |
| 694 | */ |
| 695 | /* 213 */ IF_LP64( |
| 696 | SYSENT_NOSYS(), |
| 697 | SYSENT_CI("getdents64", getdents64, 3)), |
| 698 | /* 214 */ IF_LP64( |
| 699 | SYSENT_NOSYS(), |
| 700 | SYSENT_AP("smmaplf32", smmaplf32, 7)), |
| 701 | /* 215 */ IF_LP64( |
| 702 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 703 | SYSENT_CI("stat64", stat64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 704 | /* 216 */ IF_LP64( |
| 705 | SYSENT_NOSYS(), |
| 706 | SYSENT_CI("lstat64", lstat64, 2)), |
| 707 | /* 217 */ IF_LP64( |
| 708 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 709 | SYSENT_CI("fstat64", fstat64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 710 | /* 218 */ IF_LP64( |
| 711 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 712 | SYSENT_CI("statvfs64", statvfs64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 713 | /* 219 */ IF_LP64( |
| 714 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 715 | SYSENT_CI("fstatvfs64", fstatvfs64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 716 | /* 220 */ IF_LP64( |
| 717 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 718 | SYSENT_CI("setrlimit64", setrlimit64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 719 | /* 221 */ IF_LP64( |
| 720 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 721 | SYSENT_CI("getrlimit64", getrlimit64, 2)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 722 | /* 222 */ IF_LP64( |
| 723 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 724 | SYSENT_CI("pread64", pread64, 5)), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 725 | /* 223 */ IF_LP64( |
| 726 | SYSENT_NOSYS(), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 727 | SYSENT_CI("pwrite64", pwrite64, 5)), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 728 | /* 224 */ SYSENT_LOADABLE(), /* (was creat64) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 729 | /* 225 */ IF_LP64( |
| 730 | SYSENT_NOSYS(), |
| 731 | SYSENT_CI("open64", open64, 3)), |
| 732 | /* 226 */ SYSENT_LOADABLE(), /* rpcsys */ |
jpk | 45916cd | 2006-03-24 12:29:20 -0800 | [diff] [blame] | 733 | /* 227 */ SYSENT_CL("zone", zone, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 734 | /* 228 */ SYSENT_LOADABLE(), /* autofssys */ |
| 735 | /* 229 */ SYSENT_CI("getcwd", getcwd, 2), |
| 736 | /* 230 */ SYSENT_CI("so_socket", so_socket, 5), |
| 737 | /* 231 */ SYSENT_CI("so_socketpair", so_socketpair, 1), |
| 738 | /* 232 */ SYSENT_CI("bind", bind, 4), |
| 739 | /* 233 */ SYSENT_CI("listen", listen, 3), |
Theo Schlossnagle | 5dbfd19 | 2013-04-11 04:50:36 +0000 | [diff] [blame] | 740 | /* 234 */ SYSENT_CI("accept", accept, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 741 | /* 235 */ SYSENT_CI("connect", connect, 4), |
| 742 | /* 236 */ SYSENT_CI("shutdown", shutdown, 3), |
| 743 | /* 237 */ SYSENT_CL("recv", recv, 4), |
| 744 | /* 238 */ SYSENT_CL("recvfrom", recvfrom, 6), |
| 745 | /* 239 */ SYSENT_CL("recvmsg", recvmsg, 3), |
| 746 | /* 240 */ SYSENT_CL("send", send, 4), |
| 747 | /* 241 */ SYSENT_CL("sendmsg", sendmsg, 3), |
| 748 | /* 242 */ SYSENT_CL("sendto", sendto, 6), |
| 749 | /* 243 */ SYSENT_CI("getpeername", getpeername, 4), |
| 750 | /* 244 */ SYSENT_CI("getsockname", getsockname, 4), |
| 751 | /* 245 */ SYSENT_CI("getsockopt", getsockopt, 6), |
| 752 | /* 246 */ SYSENT_CI("setsockopt", setsockopt, 6), |
Anders Persson | 3e95bd4 | 2010-06-17 17:22:09 -0700 | [diff] [blame] | 753 | /* 247 */ SYSENT_CI("sockconfig", sockconfig, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 754 | /* 248 */ SYSENT_CI("ntp_gettime", ntp_gettime, 1), |
| 755 | /* 249 */ SYSENT_CI("ntp_adjtime", ntp_adjtime, 1), |
| 756 | /* 250 */ SYSENT_CI("lwp_mutex_unlock", lwp_mutex_unlock, 1), |
Roger A. Faulkner | db94676 | 2009-10-27 10:50:50 -0700 | [diff] [blame] | 757 | /* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock, 2), |
Roger A. Faulkner | c242ec1 | 2009-04-02 14:09:25 -0700 | [diff] [blame] | 758 | /* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 759 | /* 253 */ SYSENT_CI("cladm", cladm, 3), |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 760 | /* 254 */ SYSENT_CI("uucopy", uucopy, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 761 | /* 255 */ SYSENT_CI("umount2", umount2, 2) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 762 | }; |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 763 | |
| 764 | |
| 765 | #ifdef _SYSCALL32_IMPL |
| 766 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 767 | extern int ulimit32(int, int); |
| 768 | extern ssize_t read32(int32_t, caddr32_t, size32_t); |
| 769 | extern ssize_t write32(int32_t, caddr32_t, size32_t); |
| 770 | extern ssize_t pread32(int32_t, caddr32_t, size32_t, off32_t); |
| 771 | extern ssize_t pwrite32(int32_t, caddr32_t, size32_t, off32_t); |
| 772 | extern ssize_t readv32(int32_t, caddr32_t, int32_t); |
| 773 | extern ssize_t writev32(int32_t, caddr32_t, int32_t); |
| 774 | extern ssize_t readlink32(caddr32_t, caddr32_t, size32_t); |
| 775 | extern ssize_t readlinkat32(int, caddr32_t, caddr32_t, size32_t); |
| 776 | extern int open32(char *, int, int); |
| 777 | extern int openat32(int, char *, int, int); |
| 778 | extern int stat32(char *, struct stat32 *); |
| 779 | extern int fstatat32(int, char *, struct stat32 *, int); |
| 780 | extern int lstat32(char *, struct stat32 *); |
| 781 | extern int fstat32(int, struct stat32 *); |
| 782 | extern int fstatat64_32(int, char *, struct stat64_32 *, int); |
| 783 | extern int stat64_32(char *, struct stat64_32 *); |
| 784 | extern int lstat64_32(char *, struct stat64_32 *); |
| 785 | extern int fstat64_32(int, struct stat64_32 *); |
| 786 | extern int getmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *); |
| 787 | extern int putmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *); |
| 788 | extern int getpmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t *, |
| 789 | int32_t *); |
| 790 | extern int putpmsg32(int, struct strbuf32 *, struct strbuf32 *, int32_t, |
| 791 | int32_t); |
| 792 | extern int getsetcontext32(int, void *); |
| 793 | extern int statvfs32(char *, struct statvfs32 *); |
| 794 | extern int fstatvfs32(int, struct statvfs32 *); |
| 795 | extern int statvfs64_32(char *, struct statvfs64_32 *); |
| 796 | extern int fstatvfs64_32(int, struct statvfs64_32 *); |
| 797 | extern int sigaction32(int, struct sigaction32 *, struct sigaction32 *); |
| 798 | extern clock32_t times32(struct tms32 *); |
| 799 | extern int stime32(time32_t); |
| 800 | extern int getpagesizes32(int, size32_t *, int); |
| 801 | extern int sigaltstack32(struct sigaltstack32 *, struct sigaltstack32 *); |
| 802 | extern int sigqueue32(pid_t, int, caddr32_t, int, int); |
| 803 | extern offset_t llseek32(int32_t, uint32_t, uint32_t, int); |
| 804 | extern int waitsys32(idtype_t, id_t, siginfo_t *, int); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 805 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 806 | extern ssize_t recv32(int32_t, caddr32_t, size32_t, int32_t); |
| 807 | extern ssize_t recvfrom32(int32_t, caddr32_t, size32_t, int32_t, caddr32_t, |
| 808 | caddr32_t); |
| 809 | extern ssize_t send32(int32_t, caddr32_t, size32_t, int32_t); |
| 810 | extern ssize_t sendto32(int32_t, caddr32_t, size32_t, int32_t, caddr32_t, |
| 811 | socklen_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 812 | |
Milan Jurik | b97d6ca | 2012-02-03 20:27:13 +0100 | [diff] [blame] | 813 | extern int privsys32(int, priv_op_t, priv_ptype_t, caddr32_t, size32_t, int); |
| 814 | extern int ucredsys32(int, int, caddr32_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 815 | |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 816 | /* |
| 817 | * sysent table for ILP32 processes running on |
| 818 | * a LP64 kernel. |
| 819 | */ |
| 820 | struct sysent sysent32[NSYSCALL] = |
| 821 | { |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 822 | /* 0 */ SYSENT_C("indir", indir, 1), |
| 823 | /* 1 */ SYSENT_CI("exit", (int (*)())rexit, 1), |
Richard Lowe | d2a7078 | 2014-04-16 02:39:14 +0100 | [diff] [blame] | 824 | /* 2 */ SYSENT_CI("psecflags", psecflags, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 825 | /* 3 */ SYSENT_CI("read", read32, 3), |
| 826 | /* 4 */ SYSENT_CI("write", write32, 3), |
| 827 | /* 5 */ SYSENT_CI("open", open32, 3), |
| 828 | /* 6 */ SYSENT_CI("close", close, 1), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 829 | /* 7 */ SYSENT_CI("linkat", linkat, 5), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 830 | /* 8 */ SYSENT_LOADABLE32(), /* (was creat32) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 831 | /* 9 */ SYSENT_CI("link", link, 2), |
| 832 | /* 10 */ SYSENT_CI("unlink", unlink, 1), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 833 | /* 11 */ SYSENT_CI("symlinkat", symlinkat, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 834 | /* 12 */ SYSENT_CI("chdir", chdir, 1), |
| 835 | /* 13 */ SYSENT_CI("time", gtime, 0), |
| 836 | /* 14 */ SYSENT_CI("mknod", mknod, 3), |
| 837 | /* 15 */ SYSENT_CI("chmod", chmod, 2), |
| 838 | /* 16 */ SYSENT_CI("chown", chown, 3), |
| 839 | /* 17 */ SYSENT_CI("brk", brk, 1), |
| 840 | /* 18 */ SYSENT_CI("stat", stat32, 2), |
| 841 | /* 19 */ SYSENT_CI("lseek", lseek32, 3), |
| 842 | /* 20 */ SYSENT_2CI("getpid", getpid, 0), |
| 843 | /* 21 */ SYSENT_AP("mount", mount, 8), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 844 | /* 22 */ SYSENT_CI("readlinkat", readlinkat32, 4), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 845 | /* 23 */ SYSENT_CI("setuid", setuid, 1), |
| 846 | /* 24 */ SYSENT_2CI("getuid", getuid, 0), |
| 847 | /* 25 */ SYSENT_CI("stime", stime32, 1), |
| 848 | /* 26 */ SYSENT_CI("pcsample", pcsample, 2), |
| 849 | /* 27 */ SYSENT_CI("alarm", alarm, 1), |
| 850 | /* 28 */ SYSENT_CI("fstat", fstat32, 2), |
| 851 | /* 29 */ SYSENT_CI("pause", pause, 0), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 852 | /* 30 */ SYSENT_LOADABLE32(), /* (was utime) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 853 | /* 31 */ SYSENT_CI("stty", stty, 2), |
| 854 | /* 32 */ SYSENT_CI("gtty", gtty, 2), |
| 855 | /* 33 */ SYSENT_CI("access", access, 2), |
| 856 | /* 34 */ SYSENT_CI("nice", nice, 1), |
| 857 | /* 35 */ SYSENT_CI("statfs", statfs32, 4), |
| 858 | /* 36 */ SYSENT_CI("sync", syssync, 0), |
| 859 | /* 37 */ SYSENT_CI("kill", kill, 2), |
| 860 | /* 38 */ SYSENT_CI("fstatfs", fstatfs32, 4), |
| 861 | /* 39 */ SYSENT_CI("setpgrp", setpgrp, 3), |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 862 | /* 40 */ SYSENT_CI("uucopystr", uucopystr, 3), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 863 | /* 41 */ SYSENT_LOADABLE32(), /* (was dup) */ |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 864 | /* 42 */ SYSENT_LOADABLE32(), /* pipe */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 865 | /* 43 */ SYSENT_CI("times", times32, 1), |
| 866 | /* 44 */ SYSENT_CI("prof", profil, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 867 | /* 45 */ SYSENT_CI("faccessat", faccessat, 4), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 868 | /* 46 */ SYSENT_CI("setgid", setgid, 1), |
| 869 | /* 47 */ SYSENT_2CI("getgid", getgid, 0), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 870 | /* 48 */ SYSENT_CI("mknodat", mknodat, 4), |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 871 | /* 49 */ SYSENT_LOADABLE32(), /* msgsys */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 872 | /* 50 */ IF_386_ABI( |
| 873 | SYSENT_CI("sysi86", sysi86, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 874 | SYSENT_LOADABLE32()), /* (was sys3b) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 875 | /* 51 */ SYSENT_LOADABLE32(), /* sysacct */ |
| 876 | /* 52 */ SYSENT_LOADABLE32(), /* shmsys */ |
| 877 | /* 53 */ SYSENT_LOADABLE32(), /* semsys */ |
| 878 | /* 54 */ SYSENT_CI("ioctl", ioctl, 3), |
| 879 | /* 55 */ SYSENT_CI("uadmin", uadmin, 3), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 880 | /* 56 */ SYSENT_CI("fchownat", fchownat, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 881 | /* 57 */ SYSENT_2CI("utssys", utssys32, 4), |
| 882 | /* 58 */ SYSENT_CI("fdsync", fdsync, 2), |
| 883 | /* 59 */ SYSENT_CI("exece", exece, 3), |
| 884 | /* 60 */ SYSENT_CI("umask", umask, 1), |
| 885 | /* 61 */ SYSENT_CI("chroot", chroot, 1), |
| 886 | /* 62 */ SYSENT_CI("fcntl", fcntl, 3), |
| 887 | /* 63 */ SYSENT_CI("ulimit", ulimit32, 2), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 888 | /* 64 */ SYSENT_CI("renameat", renameat, 4), |
| 889 | /* 65 */ SYSENT_CI("unlinkat", unlinkat, 3), |
| 890 | /* 66 */ SYSENT_CI("fstatat", fstatat32, 4), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 891 | /* 67 */ SYSENT_CI("fstatat64", fstatat64_32, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 892 | /* 68 */ SYSENT_CI("openat", openat32, 4), |
| 893 | /* 69 */ SYSENT_CI("openat64", openat64, 4), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 894 | /* 70 */ SYSENT_CI("tasksys", tasksys, 5), |
| 895 | /* 71 */ SYSENT_LOADABLE32(), /* acctctl */ |
| 896 | /* 72 */ SYSENT_LOADABLE32(), /* exacct */ |
kchow | 02bc52b | 2007-10-28 10:20:15 -0700 | [diff] [blame] | 897 | /* 73 */ SYSENT_CI("getpagesizes", getpagesizes32, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 898 | /* 74 */ SYSENT_CI("rctlsys", rctlsys, 6), |
casper | f48205b | 2007-05-25 05:43:42 -0700 | [diff] [blame] | 899 | /* 75 */ SYSENT_2CI("sidsys", sidsys, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 900 | /* 76 */ SYSENT_LOADABLE32(), /* (was fsat) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 901 | /* 77 */ SYSENT_CI("lwp_park", syslwp_park, 3), |
| 902 | /* 78 */ SYSENT_CI("sendfilev", sendfilev, 5), |
| 903 | /* 79 */ SYSENT_CI("rmdir", rmdir, 1), |
| 904 | /* 80 */ SYSENT_CI("mkdir", mkdir, 2), |
| 905 | /* 81 */ SYSENT_CI("getdents", getdents32, 3), |
casper | ddf7fe9 | 2008-03-03 07:48:05 -0800 | [diff] [blame] | 906 | /* 82 */ SYSENT_CI("privsys", privsys32, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 907 | /* 83 */ SYSENT_CI("ucredsys", ucredsys32, 3), |
| 908 | /* 84 */ SYSENT_CI("sysfs", sysfs, 3), |
| 909 | /* 85 */ SYSENT_CI("getmsg", getmsg32, 4), |
| 910 | /* 86 */ SYSENT_CI("putmsg", putmsg32, 4), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 911 | /* 87 */ SYSENT_LOADABLE32(), /* (was poll) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 912 | /* 88 */ SYSENT_CI("lstat", lstat32, 2), |
| 913 | /* 89 */ SYSENT_CI("symlink", symlink, 2), |
| 914 | /* 90 */ SYSENT_CI("readlink", readlink32, 3), |
| 915 | /* 91 */ SYSENT_CI("setgroups", setgroups, 2), |
| 916 | /* 92 */ SYSENT_CI("getgroups", getgroups, 2), |
| 917 | /* 93 */ SYSENT_CI("fchmod", fchmod, 2), |
| 918 | /* 94 */ SYSENT_CI("fchown", fchown, 3), |
| 919 | /* 95 */ SYSENT_CI("sigprocmask", sigprocmask, 3), |
| 920 | /* 96 */ SYSENT_CI("sigsuspend", sigsuspend, 1), |
| 921 | /* 97 */ SYSENT_CI("sigaltstack", sigaltstack32, 2), |
| 922 | /* 98 */ SYSENT_CI("sigaction", sigaction32, 3), |
| 923 | /* 99 */ SYSENT_CI("sigpending", sigpending, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 924 | /* 100 */ SYSENT_CI("getsetcontext", getsetcontext32, 2), |
Roger A. Faulkner | 794f0ad | 2010-07-07 17:36:17 -0700 | [diff] [blame] | 925 | /* 101 */ SYSENT_CI("fchmodat", fchmodat, 4), |
| 926 | /* 102 */ SYSENT_CI("mkdirat", mkdirat, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 927 | /* 103 */ SYSENT_CI("statvfs", statvfs32, 2), |
| 928 | /* 104 */ SYSENT_CI("fstatvfs", fstatvfs32, 2), |
| 929 | /* 105 */ SYSENT_CI("getloadavg", getloadavg, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 930 | /* 106 */ SYSENT_LOADABLE32(), /* nfssys */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 931 | /* 107 */ SYSENT_CI("waitsys", waitsys32, 4), |
| 932 | /* 108 */ SYSENT_CI("sigsendset", sigsendsys, 2), |
| 933 | /* 109 */ IF_x86( |
| 934 | SYSENT_AP("hrtsys", hrtsys, 5), |
| 935 | SYSENT_LOADABLE32()), |
Roger A. Faulkner | 3b862e9 | 2009-09-01 15:37:22 -0700 | [diff] [blame] | 936 | /* 110 */ SYSENT_CI("utimesys", utimesys, 5), |
raf | f48068a | 2007-08-06 13:50:45 -0700 | [diff] [blame] | 937 | /* 111 */ SYSENT_CI("sigresend", sigresend, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 938 | /* 112 */ SYSENT_CI("priocntlsys", priocntlsys, 5), |
| 939 | /* 113 */ SYSENT_CI("pathconf", pathconf, 2), |
| 940 | /* 114 */ SYSENT_CI("mincore", mincore, 3), |
| 941 | /* 115 */ SYSENT_CI("mmap", smmap32, 6), |
| 942 | /* 116 */ SYSENT_CI("mprotect", mprotect, 3), |
| 943 | /* 117 */ SYSENT_CI("munmap", munmap, 2), |
| 944 | /* 118 */ SYSENT_CI("fpathconf", fpathconf, 2), |
| 945 | /* 119 */ SYSENT_2CI("vfork", vfork, 0), |
| 946 | /* 120 */ SYSENT_CI("fchdir", fchdir, 1), |
| 947 | /* 121 */ SYSENT_CI("readv", readv32, 3), |
| 948 | /* 122 */ SYSENT_CI("writev", writev32, 3), |
DJ Hoffman | fca543c | 2014-06-09 20:35:13 +0000 | [diff] [blame] | 949 | /* 123 */ SYSENT_CI("preadv", preadv, 5), |
| 950 | /* 124 */ SYSENT_CI("pwritev", pwritev, 5), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 951 | /* 125 */ SYSENT_LOADABLE32(), /* was fxstat32 */ |
Robert Mustacchi | 9d12795 | 2015-04-07 09:59:42 -0700 | [diff] [blame] | 952 | /* 126 */ SYSENT_CI("getrandom", getrandom, 3), |
Michael Corcoran | 0616c1c | 2008-11-24 17:12:06 -0800 | [diff] [blame] | 953 | /* 127 */ SYSENT_CI("mmapobj", mmapobjsys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 954 | /* 128 */ SYSENT_CI("setrlimit", setrlimit32, 2), |
| 955 | /* 129 */ SYSENT_CI("getrlimit", getrlimit32, 2), |
| 956 | /* 130 */ SYSENT_CI("lchown", lchown, 3), |
| 957 | /* 131 */ SYSENT_CI("memcntl", memcntl, 6), |
| 958 | /* 132 */ SYSENT_CI("getpmsg", getpmsg32, 5), |
| 959 | /* 133 */ SYSENT_CI("putpmsg", putpmsg32, 5), |
| 960 | /* 134 */ SYSENT_CI("rename", rename, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 961 | /* 135 */ SYSENT_CI("uname", uname, 1), |
| 962 | /* 136 */ SYSENT_CI("setegid", setegid, 1), |
| 963 | /* 137 */ SYSENT_CI("sysconfig", sysconfig, 1), |
| 964 | /* 138 */ SYSENT_CI("adjtime", adjtime, 2), |
| 965 | /* 139 */ SYSENT_CI("systeminfo", systeminfo, 3), |
th199096 | a237e38 | 2007-04-02 21:38:04 -0700 | [diff] [blame] | 966 | /* 140 */ SYSENT_LOADABLE32(), /* sharefs */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 967 | /* 141 */ SYSENT_CI("seteuid", seteuid, 1), |
raf | 657b1f3 | 2006-12-13 11:41:29 -0800 | [diff] [blame] | 968 | /* 142 */ SYSENT_2CI("forksys", forksys, 2), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 969 | /* 143 */ SYSENT_LOADABLE32(), /* (was fork1) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 970 | /* 144 */ SYSENT_CI("sigtimedwait", sigtimedwait, 3), |
| 971 | /* 145 */ SYSENT_CI("lwp_info", lwp_info, 1), |
| 972 | /* 146 */ SYSENT_CI("yield", yield, 0), |
Roger A. Faulkner | bdf0047 | 2010-03-12 12:19:46 -0800 | [diff] [blame] | 973 | /* 147 */ SYSENT_LOADABLE32(), /* (was lwp_sema_wait) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 974 | /* 148 */ SYSENT_CI("lwp_sema_post", lwp_sema_post, 1), |
| 975 | /* 149 */ SYSENT_CI("lwp_sema_trywait", lwp_sema_trywait, 1), |
| 976 | /* 150 */ SYSENT_CI("lwp_detach", lwp_detach, 1), |
| 977 | /* 151 */ SYSENT_CI("corectl", corectl, 4), |
| 978 | /* 152 */ SYSENT_CI("modctl", modctl, 6), |
| 979 | /* 153 */ SYSENT_CI("fchroot", fchroot, 1), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 980 | /* 154 */ SYSENT_LOADABLE32(), /* (was utimes) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 981 | /* 155 */ SYSENT_CI("vhangup", vhangup, 0), |
| 982 | /* 156 */ SYSENT_CI("gettimeofday", gettimeofday, 1), |
| 983 | /* 157 */ SYSENT_CI("getitimer", getitimer, 2), |
| 984 | /* 158 */ SYSENT_CI("setitimer", setitimer, 3), |
| 985 | /* 159 */ SYSENT_CI("lwp_create", syslwp_create, 3), |
| 986 | /* 160 */ SYSENT_CI("lwp_exit", (int (*)())syslwp_exit, 0), |
| 987 | /* 161 */ SYSENT_CI("lwp_suspend", syslwp_suspend, 1), |
| 988 | /* 162 */ SYSENT_CI("lwp_continue", syslwp_continue, 1), |
| 989 | /* 163 */ SYSENT_CI("lwp_kill", lwp_kill, 2), |
| 990 | /* 164 */ SYSENT_CI("lwp_self", lwp_self, 0), |
Roger A. Faulkner | bdf0047 | 2010-03-12 12:19:46 -0800 | [diff] [blame] | 991 | /* 165 */ SYSENT_2CI("lwp_sigmask", lwp_sigmask, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 992 | /* 166 */ IF_x86( |
| 993 | SYSENT_CI("lwp_private", syslwp_private, 3), |
| 994 | SYSENT_NOSYS()), |
| 995 | /* 167 */ SYSENT_CI("lwp_wait", lwp_wait, 2), |
raf | 883492d | 2007-06-29 13:31:58 -0700 | [diff] [blame] | 996 | /* 168 */ SYSENT_CI("lwp_mutex_wakeup", lwp_mutex_wakeup, 2), |
Roger A. Faulkner | bdf0047 | 2010-03-12 12:19:46 -0800 | [diff] [blame] | 997 | /* 169 */ SYSENT_LOADABLE32(), /* (was lwp_mutex_lock) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 998 | /* 170 */ SYSENT_CI("lwp_cond_wait", lwp_cond_wait, 4), |
| 999 | /* 171 */ SYSENT_CI("lwp_cond_signal", lwp_cond_signal, 1), |
| 1000 | /* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast, 1), |
| 1001 | /* 173 */ SYSENT_CI("pread", pread32, 4), |
| 1002 | /* 174 */ SYSENT_CI("pwrite", pwrite32, 4), |
| 1003 | /* 175 */ SYSENT_C("llseek", llseek32, 4), |
| 1004 | /* 176 */ SYSENT_LOADABLE32(), /* inst_sync */ |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 1005 | /* 177 */ SYSENT_CI("brandsys", brandsys, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1006 | /* 178 */ SYSENT_LOADABLE32(), /* kaio */ |
| 1007 | /* 179 */ SYSENT_LOADABLE32(), /* cpc */ |
| 1008 | /* 180 */ SYSENT_CI("lgrpsys", lgrpsys, 3), |
gjelinek | 0209230 | 2006-12-14 13:35:17 -0800 | [diff] [blame] | 1009 | /* 181 */ SYSENT_CI("rusagesys", rusagesys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1010 | /* 182 */ SYSENT_LOADABLE32(), /* portfs */ |
| 1011 | /* 183 */ SYSENT_CI("pollsys", pollsys, 4), |
jpk | 45916cd | 2006-03-24 12:29:20 -0800 | [diff] [blame] | 1012 | /* 184 */ SYSENT_CI("labelsys", labelsys, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1013 | /* 185 */ SYSENT_CI("acl", acl, 4), |
Marek Pospisil | 005d3fe | 2010-03-05 13:16:08 -0800 | [diff] [blame] | 1014 | /* 186 */ SYSENT_AP("auditsys", auditsys, 6), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1015 | /* 187 */ SYSENT_CI("processor_bind", processor_bind, 4), |
| 1016 | /* 188 */ SYSENT_CI("processor_info", processor_info, 2), |
| 1017 | /* 189 */ SYSENT_CI("p_online", p_online, 2), |
raf | f841f6a | 2006-06-20 19:21:46 -0700 | [diff] [blame] | 1018 | /* 190 */ SYSENT_CI("sigqueue", sigqueue32, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1019 | /* 191 */ SYSENT_CI("clock_gettime", clock_gettime, 2), |
| 1020 | /* 192 */ SYSENT_CI("clock_settime", clock_settime, 2), |
| 1021 | /* 193 */ SYSENT_CI("clock_getres", clock_getres, 2), |
| 1022 | /* 194 */ SYSENT_CI("timer_create", timer_create, 3), |
| 1023 | /* 195 */ SYSENT_CI("timer_delete", timer_delete, 1), |
| 1024 | /* 196 */ SYSENT_CI("timer_settime", timer_settime, 4), |
| 1025 | /* 197 */ SYSENT_CI("timer_gettime", timer_gettime, 2), |
| 1026 | /* 198 */ SYSENT_CI("timer_getoverrun", timer_getoverrun, 1), |
| 1027 | /* 199 */ SYSENT_CI("nanosleep", nanosleep, 2), |
| 1028 | /* 200 */ SYSENT_CI("facl", facl, 4), |
| 1029 | /* 201 */ SYSENT_LOADABLE32(), /* door */ |
| 1030 | /* 202 */ SYSENT_CI("setreuid", setreuid, 2), |
| 1031 | /* 203 */ SYSENT_CI("setregid", setregid, 2), |
| 1032 | /* 204 */ SYSENT_CI("install_utrap", install_utrap, 3), |
| 1033 | /* 205 */ SYSENT_CI("signotify", signotify, 3), |
| 1034 | /* 206 */ SYSENT_CI("schedctl", schedctl, 0), |
| 1035 | /* 207 */ SYSENT_LOADABLE32(), /* pset */ |
| 1036 | /* 208 */ SYSENT_LOADABLE32(), |
| 1037 | /* 209 */ SYSENT_CI("resolvepath", resolvepath, 3), |
Roger A. Faulkner | db94676 | 2009-10-27 10:50:50 -0700 | [diff] [blame] | 1038 | /* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1039 | /* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait, 3), |
| 1040 | /* 212 */ SYSENT_CI("lwp_rwlock_sys", lwp_rwlock_sys, 3), |
| 1041 | /* |
| 1042 | * Syscalls 213-225: 32-bit system call support for large files. |
| 1043 | */ |
| 1044 | /* 213 */ SYSENT_CI("getdents64", getdents64, 3), |
Jason King | de6af22 | 2018-12-13 10:43:17 -0800 | [diff] [blame^] | 1045 | /* 214 */ SYSENT_AP("smmaplf32", smmaplf32, 7), |
| 1046 | /* 215 */ SYSENT_CI("stat64", stat64_32, 2), |
| 1047 | /* 216 */ SYSENT_CI("lstat64", lstat64_32, 2), |
| 1048 | /* 217 */ SYSENT_CI("fstat64", fstat64_32, 2), |
| 1049 | /* 218 */ SYSENT_CI("statvfs64", statvfs64_32, 2), |
| 1050 | /* 219 */ SYSENT_CI("fstatvfs64", fstatvfs64_32, 2), |
| 1051 | /* 220 */ SYSENT_CI("setrlimit64", setrlimit64, 2), |
| 1052 | /* 221 */ SYSENT_CI("getrlimit64", getrlimit64, 2), |
| 1053 | /* 222 */ SYSENT_CI("pread64", pread64, 5), |
| 1054 | /* 223 */ SYSENT_CI("pwrite64", pwrite64, 5), |
Roger A. Faulkner | 8fd04b8 | 2010-02-28 18:42:20 -0800 | [diff] [blame] | 1055 | /* 224 */ SYSENT_LOADABLE32(), /* (was creat64) */ |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1056 | /* 225 */ SYSENT_CI("open64", open64, 3), |
| 1057 | /* 226 */ SYSENT_LOADABLE32(), /* rpcsys */ |
| 1058 | /* 227 */ SYSENT_CI("zone", zone, 6), |
| 1059 | /* 228 */ SYSENT_LOADABLE32(), /* autofssys */ |
| 1060 | /* 229 */ SYSENT_CI("getcwd", getcwd, 2), |
| 1061 | /* 230 */ SYSENT_CI("so_socket", so_socket, 5), |
| 1062 | /* 231 */ SYSENT_CI("so_socketpair", so_socketpair, 1), |
| 1063 | /* 232 */ SYSENT_CI("bind", bind, 4), |
| 1064 | /* 233 */ SYSENT_CI("listen", listen, 3), |
Theo Schlossnagle | 5dbfd19 | 2013-04-11 04:50:36 +0000 | [diff] [blame] | 1065 | /* 234 */ SYSENT_CI("accept", accept, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1066 | /* 235 */ SYSENT_CI("connect", connect, 4), |
| 1067 | /* 236 */ SYSENT_CI("shutdown", shutdown, 3), |
| 1068 | /* 237 */ SYSENT_CI("recv", recv32, 4), |
| 1069 | /* 238 */ SYSENT_CI("recvfrom", recvfrom32, 6), |
| 1070 | /* 239 */ SYSENT_CI("recvmsg", recvmsg, 3), |
| 1071 | /* 240 */ SYSENT_CI("send", send32, 4), |
| 1072 | /* 241 */ SYSENT_CI("sendmsg", sendmsg, 3), |
| 1073 | /* 242 */ SYSENT_CI("sendto", sendto32, 6), |
| 1074 | /* 243 */ SYSENT_CI("getpeername", getpeername, 4), |
| 1075 | /* 244 */ SYSENT_CI("getsockname", getsockname, 4), |
| 1076 | /* 245 */ SYSENT_CI("getsockopt", getsockopt, 6), |
| 1077 | /* 246 */ SYSENT_CI("setsockopt", setsockopt, 6), |
Anders Persson | 3e95bd4 | 2010-06-17 17:22:09 -0700 | [diff] [blame] | 1078 | /* 247 */ SYSENT_CI("sockconfig", sockconfig, 5), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1079 | /* 248 */ SYSENT_CI("ntp_gettime", ntp_gettime, 1), |
| 1080 | /* 249 */ SYSENT_CI("ntp_adjtime", ntp_adjtime, 1), |
| 1081 | /* 250 */ SYSENT_CI("lwp_mutex_unlock", lwp_mutex_unlock, 1), |
Roger A. Faulkner | db94676 | 2009-10-27 10:50:50 -0700 | [diff] [blame] | 1082 | /* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock, 2), |
Roger A. Faulkner | c242ec1 | 2009-04-02 14:09:25 -0700 | [diff] [blame] | 1083 | /* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register, 2), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1084 | /* 253 */ SYSENT_CI("cladm", cladm, 3), |
nn35248 | 9acbbea | 2006-09-11 22:51:59 -0700 | [diff] [blame] | 1085 | /* 254 */ SYSENT_CI("uucopy", uucopy, 3), |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1086 | /* 255 */ SYSENT_CI("umount2", umount2, 2) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1087 | }; |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1088 | #endif /* _SYSCALL32_IMPL */ |
| 1089 | |
| 1090 | /* |
| 1091 | * Space allocated and initialized in init_syscallnames(). |
| 1092 | */ |
| 1093 | char **syscallnames; |
| 1094 | |
| 1095 | systrace_sysent_t *systrace_sysent; |
| 1096 | void (*systrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1097 | uintptr_t, uintptr_t, uintptr_t, uintptr_t); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1098 | |
| 1099 | /*ARGSUSED*/ |
| 1100 | void |
| 1101 | systrace_stub(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1102 | uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5) |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1103 | {} |
| 1104 | |
| 1105 | /*ARGSUSED*/ |
| 1106 | int64_t |
| 1107 | dtrace_systrace_syscall(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2, |
| 1108 | uintptr_t arg3, uintptr_t arg4, uintptr_t arg5) |
| 1109 | { |
| 1110 | systrace_sysent_t *sy = &systrace_sysent[curthread->t_sysnum]; |
| 1111 | dtrace_id_t id; |
| 1112 | int64_t rval; |
| 1113 | proc_t *p; |
| 1114 | |
| 1115 | if ((id = sy->stsy_entry) != DTRACE_IDNONE) |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1116 | (*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1117 | |
| 1118 | /* |
| 1119 | * We want to explicitly allow DTrace consumers to stop a process |
| 1120 | * before it actually executes the meat of the syscall. |
| 1121 | */ |
| 1122 | p = ttoproc(curthread); |
| 1123 | mutex_enter(&p->p_lock); |
| 1124 | if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) { |
| 1125 | curthread->t_dtrace_stop = 0; |
| 1126 | stop(PR_REQUESTED, 0); |
| 1127 | } |
| 1128 | mutex_exit(&p->p_lock); |
| 1129 | |
| 1130 | rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5); |
| 1131 | |
| 1132 | if (ttolwp(curthread)->lwp_errno != 0) |
| 1133 | rval = -1; |
| 1134 | |
| 1135 | if ((id = sy->stsy_return) != DTRACE_IDNONE) |
| 1136 | (*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval, |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1137 | (uintptr_t)((int64_t)rval >> 32), 0, 0, 0); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1138 | |
| 1139 | return (rval); |
| 1140 | } |
| 1141 | |
| 1142 | #ifdef _SYSCALL32_IMPL |
| 1143 | |
| 1144 | systrace_sysent_t *systrace_sysent32; |
| 1145 | |
| 1146 | /*ARGSUSED*/ |
| 1147 | int64_t |
| 1148 | dtrace_systrace_syscall32(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2, |
| 1149 | uintptr_t arg3, uintptr_t arg4, uintptr_t arg5) |
| 1150 | { |
| 1151 | systrace_sysent_t *sy = &systrace_sysent32[curthread->t_sysnum]; |
| 1152 | dtrace_id_t id; |
| 1153 | int64_t rval; |
| 1154 | proc_t *p; |
| 1155 | |
| 1156 | if ((id = sy->stsy_entry) != DTRACE_IDNONE) |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1157 | (*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1158 | |
| 1159 | /* |
| 1160 | * We want to explicitly allow DTrace consumers to stop a process |
| 1161 | * before it actually executes the meat of the syscall. |
| 1162 | */ |
| 1163 | p = ttoproc(curthread); |
| 1164 | mutex_enter(&p->p_lock); |
| 1165 | if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) { |
| 1166 | curthread->t_dtrace_stop = 0; |
| 1167 | stop(PR_REQUESTED, 0); |
| 1168 | } |
| 1169 | mutex_exit(&p->p_lock); |
| 1170 | |
| 1171 | rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5); |
| 1172 | |
| 1173 | if (ttolwp(curthread)->lwp_errno != 0) |
| 1174 | rval = -1; |
| 1175 | |
| 1176 | if ((id = sy->stsy_return) != DTRACE_IDNONE) |
| 1177 | (*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval, |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1178 | (uintptr_t)((uint64_t)rval >> 32), 0, 0, 0); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1179 | |
| 1180 | return (rval); |
| 1181 | } |
| 1182 | |
| 1183 | #endif |
| 1184 | |
| 1185 | void |
| 1186 | dtrace_systrace_rtt(void) |
| 1187 | { |
| 1188 | systrace_sysent_t *sy; |
| 1189 | dtrace_id_t id; |
| 1190 | |
| 1191 | if (get_udatamodel() == DATAMODEL_NATIVE) { |
| 1192 | if (systrace_sysent == NULL) |
| 1193 | return; |
| 1194 | |
| 1195 | sy = &systrace_sysent[curthread->t_sysnum]; |
| 1196 | #ifdef _SYSCALL32_IMPL |
| 1197 | } else { |
| 1198 | if (systrace_sysent32 == NULL) |
| 1199 | return; |
| 1200 | |
| 1201 | sy = &systrace_sysent32[curthread->t_sysnum]; |
| 1202 | #endif |
| 1203 | } |
| 1204 | |
| 1205 | if ((id = sy->stsy_return) != DTRACE_IDNONE) |
ahl | 2b6e762 | 2006-09-19 16:29:20 -0700 | [diff] [blame] | 1206 | (*systrace_probe)(id, 0, 0, 0, 0, 0, 0); |
stevel@tonic-gate | 7c478bd | 2005-06-14 00:00:00 -0700 | [diff] [blame] | 1207 | } |