xref: /onnv-gate/usr/src/uts/common/os/sysent.c (revision 12789:82cffaae72d5)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
51676Sjpk  * Common Development and Distribution License (the "License").
61676Sjpk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
212248Sraf 
220Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
23*12789SRoger.Faulkner@Oracle.COM 
240Sstevel@tonic-gate /*
2512643SAnders.Persson@Sun.COM  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
260Sstevel@tonic-gate  */
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
290Sstevel@tonic-gate /*	  All Rights Reserved  	*/
300Sstevel@tonic-gate 
310Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/param.h>
340Sstevel@tonic-gate #include <sys/types.h>
350Sstevel@tonic-gate #include <sys/systm.h>
360Sstevel@tonic-gate #include <sys/systrace.h>
370Sstevel@tonic-gate #include <sys/procfs.h>
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
400Sstevel@tonic-gate /*
410Sstevel@tonic-gate  * This table is the switch used to transfer to the appropriate
420Sstevel@tonic-gate  * routine for processing a system call.  Each row contains the
430Sstevel@tonic-gate  * number of arguments expected, a switch that tells systrap()
440Sstevel@tonic-gate  * in trap.c whether a setjmp() is not necessary, and a pointer
450Sstevel@tonic-gate  * to the routine.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate int	access();
500Sstevel@tonic-gate int	alarm();
510Sstevel@tonic-gate int	auditsys();
522712Snn35248 int64_t	brandsys();
530Sstevel@tonic-gate int	brk();
540Sstevel@tonic-gate int	chdir();
550Sstevel@tonic-gate int	chmod();
560Sstevel@tonic-gate int	chown();
570Sstevel@tonic-gate int	chroot();
580Sstevel@tonic-gate int	cladm();
590Sstevel@tonic-gate int	close();
600Sstevel@tonic-gate int	exece();
6111798SRoger.Faulkner@Sun.COM int	faccessat();
62*12789SRoger.Faulkner@Oracle.COM int	fchmodat();
6311798SRoger.Faulkner@Sun.COM int	fchownat();
640Sstevel@tonic-gate int	fcntl();
653235Sraf int64_t	vfork();
663235Sraf int64_t	forksys();
670Sstevel@tonic-gate int	fstat();
680Sstevel@tonic-gate int	fdsync();
690Sstevel@tonic-gate int64_t	getgid();
700Sstevel@tonic-gate int	ucredsys();
710Sstevel@tonic-gate int64_t	getpid();
720Sstevel@tonic-gate int64_t	getuid();
730Sstevel@tonic-gate time_t	gtime();
740Sstevel@tonic-gate int	getloadavg();
750Sstevel@tonic-gate int	rusagesys();
760Sstevel@tonic-gate int	getpagesizes();
770Sstevel@tonic-gate int	gtty();
780Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
790Sstevel@tonic-gate int	hrtsys();
800Sstevel@tonic-gate #endif /* __i386 || __amd64 */
810Sstevel@tonic-gate int	ioctl();
820Sstevel@tonic-gate int	kill();
831676Sjpk int	labelsys();
840Sstevel@tonic-gate int	link();
85*12789SRoger.Faulkner@Oracle.COM int	linkat();
860Sstevel@tonic-gate off32_t	lseek32();
870Sstevel@tonic-gate off_t	lseek64();
880Sstevel@tonic-gate int	lgrpsys();
898212SMichael.Corcoran@Sun.COM int	mmapobjsys();
900Sstevel@tonic-gate int	mknod();
91*12789SRoger.Faulkner@Oracle.COM int	mknodat();
920Sstevel@tonic-gate int	mount();
930Sstevel@tonic-gate int	nice();
940Sstevel@tonic-gate int	nullsys();
950Sstevel@tonic-gate int	open();
9611798SRoger.Faulkner@Sun.COM int	openat();
970Sstevel@tonic-gate int	pause();
980Sstevel@tonic-gate long	pcsample();
990Sstevel@tonic-gate int	privsys();
1000Sstevel@tonic-gate int	profil();
1010Sstevel@tonic-gate ssize_t	pread();
1020Sstevel@tonic-gate ssize_t	pwrite();
1030Sstevel@tonic-gate ssize_t	read();
1040Sstevel@tonic-gate int	rename();
10511798SRoger.Faulkner@Sun.COM int	renameat();
1060Sstevel@tonic-gate void	rexit();
1070Sstevel@tonic-gate int	semsys();
1080Sstevel@tonic-gate int	setgid();
1090Sstevel@tonic-gate int	setpgrp();
1100Sstevel@tonic-gate int	setuid();
1110Sstevel@tonic-gate uintptr_t	shmsys();
1124321Scasper uint64_t	sidsys();
1130Sstevel@tonic-gate int	sigprocmask();
1140Sstevel@tonic-gate int	sigsuspend();
1150Sstevel@tonic-gate int	sigaltstack();
1160Sstevel@tonic-gate int	sigaction();
1170Sstevel@tonic-gate int	sigpending();
1184806Sraf int	sigresend();
1190Sstevel@tonic-gate int	sigtimedwait();
1200Sstevel@tonic-gate int	getsetcontext();
1210Sstevel@tonic-gate int	stat();
12211798SRoger.Faulkner@Sun.COM int	fstatat();
1230Sstevel@tonic-gate int	stime();
1240Sstevel@tonic-gate int	stty();
1250Sstevel@tonic-gate int	syssync();
1260Sstevel@tonic-gate int	sysacct();
1270Sstevel@tonic-gate clock_t	times();
1280Sstevel@tonic-gate long	ulimit();
1290Sstevel@tonic-gate int	getrlimit32();
1300Sstevel@tonic-gate int	setrlimit32();
1310Sstevel@tonic-gate int	umask();
1320Sstevel@tonic-gate int	umount2();
1330Sstevel@tonic-gate int	unlink();
13411798SRoger.Faulkner@Sun.COM int	unlinkat();
13510440SRoger.Faulkner@Sun.COM int	utimesys();
1360Sstevel@tonic-gate int64_t	utssys32();
1370Sstevel@tonic-gate int64_t	utssys64();
1382712Snn35248 int	uucopy();
1392712Snn35248 ssize_t	uucopystr();
1400Sstevel@tonic-gate ssize_t	write();
1410Sstevel@tonic-gate ssize_t	readv();
1420Sstevel@tonic-gate ssize_t	writev();
1430Sstevel@tonic-gate int	syslwp_park();
1440Sstevel@tonic-gate int	rmdir();
1450Sstevel@tonic-gate int	mkdir();
146*12789SRoger.Faulkner@Oracle.COM int	mkdirat();
1470Sstevel@tonic-gate int	getdents32();
1480Sstevel@tonic-gate int	statfs32();
1490Sstevel@tonic-gate int	fstatfs32();
1500Sstevel@tonic-gate int	sysfs();
1510Sstevel@tonic-gate int	getmsg();
1520Sstevel@tonic-gate int	pollsys();
1530Sstevel@tonic-gate int	putmsg();
1540Sstevel@tonic-gate int	uadmin();
1550Sstevel@tonic-gate int	lstat();
1560Sstevel@tonic-gate int	symlink();
157*12789SRoger.Faulkner@Oracle.COM int	symlinkat();
1580Sstevel@tonic-gate ssize_t	readlink();
159*12789SRoger.Faulkner@Oracle.COM ssize_t	readlinkat();
1600Sstevel@tonic-gate int	resolvepath();
1610Sstevel@tonic-gate int	setgroups();
1620Sstevel@tonic-gate int	getgroups();
1630Sstevel@tonic-gate int	fchdir();
1640Sstevel@tonic-gate int	fchown();
1650Sstevel@tonic-gate int	fchmod();
1660Sstevel@tonic-gate int	getcwd();
1670Sstevel@tonic-gate int	statvfs();
1680Sstevel@tonic-gate int	fstatvfs();
1690Sstevel@tonic-gate offset_t llseek32();
1700Sstevel@tonic-gate 
1710Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
1720Sstevel@tonic-gate int	sysi86();
1730Sstevel@tonic-gate #endif
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate int	acl();
1760Sstevel@tonic-gate int	facl();
1770Sstevel@tonic-gate long	priocntlsys();
1780Sstevel@tonic-gate int	waitsys();
1790Sstevel@tonic-gate int	sigsendsys();
1800Sstevel@tonic-gate int	mincore();
1810Sstevel@tonic-gate caddr_t	smmap64();
1820Sstevel@tonic-gate caddr_t smmap32();
1830Sstevel@tonic-gate int	smmaplf32();
1840Sstevel@tonic-gate int	mprotect();
1850Sstevel@tonic-gate int	munmap();
1860Sstevel@tonic-gate int	uname();
1870Sstevel@tonic-gate int	lchown();
1880Sstevel@tonic-gate int	getpmsg();
1890Sstevel@tonic-gate int	putpmsg();
1900Sstevel@tonic-gate int	memcntl();
1910Sstevel@tonic-gate long	sysconfig();
1920Sstevel@tonic-gate int	adjtime();
1930Sstevel@tonic-gate long	systeminfo();
1940Sstevel@tonic-gate int	setegid();
1950Sstevel@tonic-gate int	seteuid();
1960Sstevel@tonic-gate 
1970Sstevel@tonic-gate int	setreuid();
1980Sstevel@tonic-gate int	setregid();
1990Sstevel@tonic-gate int	install_utrap();
2000Sstevel@tonic-gate #ifdef __sparc
2010Sstevel@tonic-gate int	sparc_utrap_install();
2020Sstevel@tonic-gate #endif
2030Sstevel@tonic-gate 
2040Sstevel@tonic-gate int	syslwp_create();
2050Sstevel@tonic-gate void	syslwp_exit();
2060Sstevel@tonic-gate int	syslwp_suspend();
2070Sstevel@tonic-gate int	syslwp_continue();
2080Sstevel@tonic-gate int	syslwp_private();
2090Sstevel@tonic-gate int	lwp_detach();
2100Sstevel@tonic-gate int	lwp_info();
2110Sstevel@tonic-gate int	lwp_kill();
2120Sstevel@tonic-gate int	lwp_self();
2130Sstevel@tonic-gate int64_t	lwp_sigmask();
2140Sstevel@tonic-gate int	yield();
2150Sstevel@tonic-gate int	lwp_wait();
2160Sstevel@tonic-gate int	lwp_mutex_timedlock();
2170Sstevel@tonic-gate int	lwp_mutex_wakeup();
2180Sstevel@tonic-gate int	lwp_mutex_unlock();
2190Sstevel@tonic-gate int	lwp_mutex_trylock();
2204574Sraf int	lwp_mutex_register();
2210Sstevel@tonic-gate int	lwp_rwlock_sys();
2220Sstevel@tonic-gate int	lwp_sema_post();
2230Sstevel@tonic-gate int	lwp_sema_timedwait();
2240Sstevel@tonic-gate int	lwp_sema_trywait();
2250Sstevel@tonic-gate int	lwp_cond_wait();
2260Sstevel@tonic-gate int	lwp_cond_signal();
2270Sstevel@tonic-gate int	lwp_cond_broadcast();
2280Sstevel@tonic-gate caddr_t	schedctl();
2290Sstevel@tonic-gate 
2300Sstevel@tonic-gate long	pathconf();
2310Sstevel@tonic-gate long	fpathconf();
2320Sstevel@tonic-gate int	processor_bind();
2330Sstevel@tonic-gate int	processor_info();
2340Sstevel@tonic-gate int	p_online();
2350Sstevel@tonic-gate 
2360Sstevel@tonic-gate /*
2370Sstevel@tonic-gate  *	POSIX .4 system calls *
2380Sstevel@tonic-gate  */
2390Sstevel@tonic-gate int	clock_gettime();
2400Sstevel@tonic-gate int	clock_settime();
2410Sstevel@tonic-gate int	clock_getres();
2420Sstevel@tonic-gate int	timer_create();
2430Sstevel@tonic-gate int	timer_delete();
2440Sstevel@tonic-gate int	timer_settime();
2450Sstevel@tonic-gate int	timer_gettime();
2460Sstevel@tonic-gate int	timer_getoverrun();
2470Sstevel@tonic-gate int	nanosleep();
2480Sstevel@tonic-gate int	sigqueue();
2490Sstevel@tonic-gate int	signotify();
2500Sstevel@tonic-gate 
2510Sstevel@tonic-gate int	getdents64();
2520Sstevel@tonic-gate int	stat64();
2530Sstevel@tonic-gate int	lstat64();
2540Sstevel@tonic-gate int	fstatat64();
2550Sstevel@tonic-gate int	fstat64();
2560Sstevel@tonic-gate int	statvfs64();
2570Sstevel@tonic-gate int	fstatvfs64();
2580Sstevel@tonic-gate int	setrlimit64();
2590Sstevel@tonic-gate int	getrlimit64();
2600Sstevel@tonic-gate int	pread64();
2610Sstevel@tonic-gate int	pwrite64();
2620Sstevel@tonic-gate int	open64();
26311798SRoger.Faulkner@Sun.COM int	openat64();
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate /*
2660Sstevel@tonic-gate  * NTP syscalls
2670Sstevel@tonic-gate  */
2680Sstevel@tonic-gate 
2690Sstevel@tonic-gate int ntp_gettime();
2700Sstevel@tonic-gate int ntp_adjtime();
2710Sstevel@tonic-gate 
2720Sstevel@tonic-gate /*
2730Sstevel@tonic-gate  *	++++++++++++++++++++++++
2740Sstevel@tonic-gate  *	++  SunOS4.1 Buyback  ++
2750Sstevel@tonic-gate  *	++++++++++++++++++++++++
2760Sstevel@tonic-gate  *
27711798SRoger.Faulkner@Sun.COM  *	fchroot, vhangup, gettimeofday
2780Sstevel@tonic-gate  */
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate int	fchroot();
2810Sstevel@tonic-gate int	vhangup();
2820Sstevel@tonic-gate int	gettimeofday();
2830Sstevel@tonic-gate int	getitimer();
2840Sstevel@tonic-gate int	setitimer();
2850Sstevel@tonic-gate 
2860Sstevel@tonic-gate int	corectl();
2870Sstevel@tonic-gate int	modctl();
2880Sstevel@tonic-gate int64_t loadable_syscall();
2890Sstevel@tonic-gate int64_t indir();
2900Sstevel@tonic-gate 
2910Sstevel@tonic-gate long	tasksys();
2920Sstevel@tonic-gate long	rctlsys();
2930Sstevel@tonic-gate 
2940Sstevel@tonic-gate long	zone();
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate int	so_socket();
2970Sstevel@tonic-gate int	so_socketpair();
2980Sstevel@tonic-gate int	bind();
2990Sstevel@tonic-gate int	listen();
3000Sstevel@tonic-gate int	accept();
3010Sstevel@tonic-gate int	connect();
3020Sstevel@tonic-gate int	shutdown();
3030Sstevel@tonic-gate ssize_t	recv();
3040Sstevel@tonic-gate ssize_t	recvfrom();
3050Sstevel@tonic-gate ssize_t	recvmsg();
3060Sstevel@tonic-gate ssize_t	send();
3070Sstevel@tonic-gate ssize_t	sendmsg();
3080Sstevel@tonic-gate ssize_t	sendto();
3090Sstevel@tonic-gate int	getpeername();
3100Sstevel@tonic-gate int	getsockname();
3110Sstevel@tonic-gate int	getsockopt();
3120Sstevel@tonic-gate int	setsockopt();
3130Sstevel@tonic-gate int	sockconfig();
3140Sstevel@tonic-gate ssize_t	sendfilev();
3150Sstevel@tonic-gate 
3160Sstevel@tonic-gate typedef int64_t	(*llfcn_t)();	/* for casting one-word returns */
3170Sstevel@tonic-gate 
3180Sstevel@tonic-gate /*
3190Sstevel@tonic-gate  * Sysent initialization macros.
3200Sstevel@tonic-gate  * 	These take the name string of the system call even though that isn't
3210Sstevel@tonic-gate  *	currently used in the sysent entry.  This might be useful someday.
3220Sstevel@tonic-gate  *
3230Sstevel@tonic-gate  * Initialization macro for system calls which take their args in the C style.
3240Sstevel@tonic-gate  * These system calls return the longlong_t return value and must call
3250Sstevel@tonic-gate  * set_errno() to return an error.  For SPARC, narg must be at most six.
3260Sstevel@tonic-gate  * For more args, use the SYSENT_AP() routine.
3270Sstevel@tonic-gate  *
3280Sstevel@tonic-gate  * We are able to return two distinct values to userland via the rval_t.
3290Sstevel@tonic-gate  * At this time, that corresponds to one 64-bit quantity, or two 32-bit
3300Sstevel@tonic-gate  * quantities.  The kernel does not currently need to return two 64-bit
3310Sstevel@tonic-gate  * values, or one 128 bit value(!), but we may do one day, so the calling
3320Sstevel@tonic-gate  * sequence between userland and the kernel should permit it.
3330Sstevel@tonic-gate  *
3340Sstevel@tonic-gate  * The interpretation of rval_t is provided by the sy_flags field
3350Sstevel@tonic-gate  * which is used to determine how to arrange the results in registers
3360Sstevel@tonic-gate  * (or on the stack) for return userland.
3370Sstevel@tonic-gate  */
3380Sstevel@tonic-gate 	/* returns a 64-bit quantity for both ABIs */
3390Sstevel@tonic-gate #define	SYSENT_C(name, call, narg)	\
3400Sstevel@tonic-gate 	{ (narg), SE_64RVAL, NULL, NULL, (llfcn_t)(call) }
3410Sstevel@tonic-gate 
3420Sstevel@tonic-gate 	/* returns one 32-bit value for both ABIs: r_val1 */
3430Sstevel@tonic-gate #define	SYSENT_CI(name, call, narg)	\
3440Sstevel@tonic-gate 	{ (narg), SE_32RVAL1, NULL, NULL, (llfcn_t)(call) }
3450Sstevel@tonic-gate 
3460Sstevel@tonic-gate 	/* returns 2 32-bit values: r_val1 & r_val2 */
3470Sstevel@tonic-gate #define	SYSENT_2CI(name, call, narg)	\
3480Sstevel@tonic-gate 	{ (narg), SE_32RVAL1|SE_32RVAL2, NULL, NULL, (llfcn_t)(call) }
3490Sstevel@tonic-gate 
3500Sstevel@tonic-gate /*
3510Sstevel@tonic-gate  * Initialization macro for system calls which take their args in the standard
3520Sstevel@tonic-gate  * Unix style of a pointer to the arg structure and a pointer to the rval_t.
3530Sstevel@tonic-gate  *
3540Sstevel@tonic-gate  * Deprecated wherever possible (slower on some architectures, and trickier
3550Sstevel@tonic-gate  * to maintain two flavours).
3560Sstevel@tonic-gate  */
3570Sstevel@tonic-gate #define	SYSENT_AP(name, call, narg)	\
3580Sstevel@tonic-gate 	{ (narg), SE_64RVAL, (call), NULL, syscall_ap }
3590Sstevel@tonic-gate 
3600Sstevel@tonic-gate /*
3610Sstevel@tonic-gate  * Conditional constructors to build the tables without #ifdef clutter
3620Sstevel@tonic-gate  */
3630Sstevel@tonic-gate #if defined(_LP64)
3640Sstevel@tonic-gate #define	IF_LP64(true, false)	true
3650Sstevel@tonic-gate #else
3660Sstevel@tonic-gate #define	IF_LP64(true, false)	false
3670Sstevel@tonic-gate #endif
3680Sstevel@tonic-gate 
3690Sstevel@tonic-gate #if defined(__sparc)
3700Sstevel@tonic-gate #define	IF_sparc(true, false)	true
3710Sstevel@tonic-gate #else
3720Sstevel@tonic-gate #define	IF_sparc(true, false)	false
3730Sstevel@tonic-gate #endif
3740Sstevel@tonic-gate 
3750Sstevel@tonic-gate #if defined(__i386) && !defined(__amd64)
3760Sstevel@tonic-gate #define	IF_i386(true, false)	true
3770Sstevel@tonic-gate #else
3780Sstevel@tonic-gate #define	IF_i386(true, false)	false
3790Sstevel@tonic-gate #endif
3800Sstevel@tonic-gate 
381641Skalai #if defined(__i386) || defined(__amd64)
3820Sstevel@tonic-gate #define	IF_x86(true, false)	true
3830Sstevel@tonic-gate #else
3840Sstevel@tonic-gate #define	IF_x86(true, false)	false
3850Sstevel@tonic-gate #endif
3860Sstevel@tonic-gate 
3870Sstevel@tonic-gate #if (defined(__i386) && !defined(__amd64)) || defined(__i386_COMPAT)
3880Sstevel@tonic-gate #define	IF_386_ABI(true, false)	true
3890Sstevel@tonic-gate #else
3900Sstevel@tonic-gate #define	IF_386_ABI(true, false)	false
3910Sstevel@tonic-gate #endif
3920Sstevel@tonic-gate 
3930Sstevel@tonic-gate /*
3940Sstevel@tonic-gate  * Define system calls that return a native 'long' quantity i.e. a 32-bit
3950Sstevel@tonic-gate  * or 64-bit integer - depending on how the kernel is itself compiled
3960Sstevel@tonic-gate  * e.g. read(2) returns 'ssize_t' in the kernel and in userland.
3970Sstevel@tonic-gate  */
3980Sstevel@tonic-gate #define	SYSENT_CL(name, call, narg)	\
3990Sstevel@tonic-gate 	IF_LP64(SYSENT_C(name, call, narg), SYSENT_CI(name, call, narg))
4000Sstevel@tonic-gate 
4010Sstevel@tonic-gate /*
4020Sstevel@tonic-gate  * Initialization macro for loadable native system calls.
4030Sstevel@tonic-gate  */
4040Sstevel@tonic-gate #define	SYSENT_LOADABLE()	\
4050Sstevel@tonic-gate 	{ 0, SE_LOADABLE, (int (*)())nosys, NULL, loadable_syscall }
4060Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
4070Sstevel@tonic-gate 
4080Sstevel@tonic-gate /*
4090Sstevel@tonic-gate  * Initialization macro for loadable 32-bit compatibility system calls.
4100Sstevel@tonic-gate  */
4110Sstevel@tonic-gate #define	SYSENT_LOADABLE32()	SYSENT_LOADABLE()
4120Sstevel@tonic-gate 
4130Sstevel@tonic-gate #define	SYSENT_NOSYS()		SYSENT_C("nosys", nosys, 0)
4140Sstevel@tonic-gate 
4150Sstevel@tonic-gate struct sysent nosys_ent = SYSENT_NOSYS();
4160Sstevel@tonic-gate 
4170Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
4180Sstevel@tonic-gate /*
4190Sstevel@tonic-gate  * Native sysent table.
4200Sstevel@tonic-gate  */
4210Sstevel@tonic-gate struct sysent sysent[NSYSCALL] =
4220Sstevel@tonic-gate {
4230Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
4240Sstevel@tonic-gate 	/*  0 */ IF_LP64(
4250Sstevel@tonic-gate 			SYSENT_NOSYS(),
4260Sstevel@tonic-gate 			SYSENT_C("indir",	indir,		1)),
4270Sstevel@tonic-gate 	/*  1 */ SYSENT_CI("exit",		rexit,		1),
42811798SRoger.Faulkner@Sun.COM 	/*  2 */ SYSENT_LOADABLE(),			/* (was forkall) */
4290Sstevel@tonic-gate 	/*  3 */ SYSENT_CL("read",		read,		3),
4300Sstevel@tonic-gate 	/*  4 */ SYSENT_CL("write",		write,		3),
4310Sstevel@tonic-gate 	/*  5 */ SYSENT_CI("open",		open,		3),
4320Sstevel@tonic-gate 	/*  6 */ SYSENT_CI("close",		close,		1),
433*12789SRoger.Faulkner@Oracle.COM 	/*  7 */ SYSENT_CI("linkat",		linkat,		5),
43411798SRoger.Faulkner@Sun.COM 	/*  8 */ SYSENT_LOADABLE(),			/* (was creat) */
4350Sstevel@tonic-gate 	/*  9 */ SYSENT_CI("link",		link,		2),
4360Sstevel@tonic-gate 	/* 10 */ SYSENT_CI("unlink",		unlink,		1),
437*12789SRoger.Faulkner@Oracle.COM 	/* 11 */ SYSENT_CI("symlinkat",		symlinkat,	3),
4380Sstevel@tonic-gate 	/* 12 */ SYSENT_CI("chdir",		chdir,		1),
4390Sstevel@tonic-gate 	/* 13 */ SYSENT_CL("time",		gtime,		0),
4400Sstevel@tonic-gate 	/* 14 */ SYSENT_CI("mknod",		mknod,		3),
4410Sstevel@tonic-gate 	/* 15 */ SYSENT_CI("chmod",		chmod,		2),
4420Sstevel@tonic-gate 	/* 16 */ SYSENT_CI("chown",		chown,		3),
4430Sstevel@tonic-gate 	/* 17 */ SYSENT_CI("brk",		brk,		1),
4440Sstevel@tonic-gate 	/* 18 */ SYSENT_CI("stat",		stat,		2),
4450Sstevel@tonic-gate 	/* 19 */ IF_LP64(
4460Sstevel@tonic-gate 			SYSENT_CL("lseek",	lseek64,	3),
4470Sstevel@tonic-gate 			SYSENT_CL("lseek",	lseek32,	3)),
4480Sstevel@tonic-gate 	/* 20 */ SYSENT_2CI("getpid",		getpid,		0),
4490Sstevel@tonic-gate 	/* 21 */ SYSENT_AP("mount",		mount,		8),
450*12789SRoger.Faulkner@Oracle.COM 	/* 22 */ SYSENT_CL("readlinkat",	readlinkat,	4),
4510Sstevel@tonic-gate 	/* 23 */ SYSENT_CI("setuid",		setuid,		1),
4520Sstevel@tonic-gate 	/* 24 */ SYSENT_2CI("getuid",		getuid,		0),
4530Sstevel@tonic-gate 	/* 25 */ SYSENT_CI("stime",		stime,		1),
4540Sstevel@tonic-gate 	/* 26 */ SYSENT_CL("pcsample",		pcsample,	2),
4550Sstevel@tonic-gate 	/* 27 */ SYSENT_CI("alarm",		alarm,		1),
4560Sstevel@tonic-gate 	/* 28 */ SYSENT_CI("fstat",		fstat,		2),
4570Sstevel@tonic-gate 	/* 29 */ SYSENT_CI("pause",		pause,		0),
45811798SRoger.Faulkner@Sun.COM 	/* 30 */ SYSENT_LOADABLE(),			/* (was utime) */
4590Sstevel@tonic-gate 	/* 31 */ SYSENT_CI("stty",		stty,		2),
4600Sstevel@tonic-gate 	/* 32 */ SYSENT_CI("gtty",		gtty,		2),
4610Sstevel@tonic-gate 	/* 33 */ SYSENT_CI("access",		access,		2),
4620Sstevel@tonic-gate 	/* 34 */ SYSENT_CI("nice",		nice,		1),
4630Sstevel@tonic-gate 	/* 35 */ IF_LP64(
4640Sstevel@tonic-gate 			SYSENT_NOSYS(),
4650Sstevel@tonic-gate 			SYSENT_CI("statfs",	statfs32,	4)),
4660Sstevel@tonic-gate 	/* 36 */ SYSENT_CI("sync",		syssync,	0),
4670Sstevel@tonic-gate 	/* 37 */ SYSENT_CI("kill",		kill,		2),
4680Sstevel@tonic-gate 	/* 38 */ IF_LP64(
4690Sstevel@tonic-gate 			SYSENT_NOSYS(),
4700Sstevel@tonic-gate 			SYSENT_CI("fstatfs",	fstatfs32,	4)),
4710Sstevel@tonic-gate 	/* 39 */ SYSENT_CI("setpgrp",		setpgrp,	3),
4722712Snn35248 	/* 40 */ SYSENT_CI("uucopystr",		uucopystr,	3),
47311798SRoger.Faulkner@Sun.COM 	/* 41 */ SYSENT_LOADABLE(),			/* (was dup) */
4743235Sraf 	/* 42 */ SYSENT_LOADABLE(),			/* pipe */
4750Sstevel@tonic-gate 	/* 43 */ SYSENT_CL("times",		times,		1),
4760Sstevel@tonic-gate 	/* 44 */ SYSENT_CI("prof",		profil,		4),
47711798SRoger.Faulkner@Sun.COM 	/* 45 */ SYSENT_CI("faccessat",		faccessat,	4),
4780Sstevel@tonic-gate 	/* 46 */ SYSENT_CI("setgid",		setgid,		1),
4790Sstevel@tonic-gate 	/* 47 */ SYSENT_2CI("getgid",		getgid,		0),
480*12789SRoger.Faulkner@Oracle.COM 	/* 48 */ SYSENT_CI("mknodat",		mknodat,	4),
4813235Sraf 	/* 49 */ SYSENT_LOADABLE(),			/* msgsys */
4820Sstevel@tonic-gate 	/* 50 */ IF_x86(
4830Sstevel@tonic-gate 			SYSENT_CI("sysi86",	sysi86,		4),
4840Sstevel@tonic-gate 			SYSENT_LOADABLE()),		/* (was sys3b) */
4850Sstevel@tonic-gate 	/* 51 */ SYSENT_LOADABLE(),			/* sysacct */
4860Sstevel@tonic-gate 	/* 52 */ SYSENT_LOADABLE(),			/* shmsys */
4870Sstevel@tonic-gate 	/* 53 */ SYSENT_LOADABLE(),			/* semsys */
4880Sstevel@tonic-gate 	/* 54 */ SYSENT_CI("ioctl",		ioctl,		3),
4890Sstevel@tonic-gate 	/* 55 */ SYSENT_CI("uadmin",		uadmin,		3),
49011798SRoger.Faulkner@Sun.COM 	/* 56 */ SYSENT_CI("fchownat",		fchownat,	5),
4910Sstevel@tonic-gate 	/* 57 */ IF_LP64(
4920Sstevel@tonic-gate 			SYSENT_2CI("utssys",	utssys64,	4),
4930Sstevel@tonic-gate 			SYSENT_2CI("utssys",	utssys32,	4)),
4940Sstevel@tonic-gate 	/* 58 */ SYSENT_CI("fdsync",		fdsync,		2),
4950Sstevel@tonic-gate 	/* 59 */ SYSENT_CI("exece",		exece,		3),
4960Sstevel@tonic-gate 	/* 60 */ SYSENT_CI("umask",		umask,		1),
4970Sstevel@tonic-gate 	/* 61 */ SYSENT_CI("chroot",		chroot,		1),
4980Sstevel@tonic-gate 	/* 62 */ SYSENT_CI("fcntl",		fcntl,		3),
4990Sstevel@tonic-gate 	/* 63 */ SYSENT_CI("ulimit",		ulimit,		2),
50011798SRoger.Faulkner@Sun.COM 	/* 64 */ SYSENT_CI("renameat",		renameat,	4),
50111798SRoger.Faulkner@Sun.COM 	/* 65 */ SYSENT_CI("unlinkat",		unlinkat,	3),
50211798SRoger.Faulkner@Sun.COM 	/* 66 */ SYSENT_CI("fstatat",		fstatat,	4),
50311798SRoger.Faulkner@Sun.COM 	/* 67 */ IF_LP64(
50411798SRoger.Faulkner@Sun.COM 			SYSENT_NOSYS(),
50511798SRoger.Faulkner@Sun.COM 			SYSENT_CI("fstatat64",	fstatat64, 	4)),
50611798SRoger.Faulkner@Sun.COM 	/* 68 */ SYSENT_CI("openat",		openat,		4),
50711798SRoger.Faulkner@Sun.COM 	/* 69 */ IF_LP64(
50811798SRoger.Faulkner@Sun.COM 			SYSENT_NOSYS(),
50911798SRoger.Faulkner@Sun.COM 			SYSENT_CI("openat64",	openat64,	4)),
5100Sstevel@tonic-gate 	/* 70 */ SYSENT_CI("tasksys",		tasksys,	5),
5110Sstevel@tonic-gate 	/* 71 */ SYSENT_LOADABLE(),		/* acctctl */
5120Sstevel@tonic-gate 	/* 72 */ SYSENT_LOADABLE(),		/* exacct */
5135349Skchow 	/* 73 */ SYSENT_CI("getpagesizes",	getpagesizes,	3),
5140Sstevel@tonic-gate 	/* 74 */ SYSENT_CI("rctlsys",		rctlsys,	6),
5154321Scasper 	/* 75 */ SYSENT_2CI("sidsys",		sidsys,		4),
51611798SRoger.Faulkner@Sun.COM 	/* 76 */ SYSENT_LOADABLE(),			/* (was fsat) */
5170Sstevel@tonic-gate 	/* 77 */ SYSENT_CI("lwp_park",		syslwp_park,	3),
5180Sstevel@tonic-gate 	/* 78 */ SYSENT_CL("sendfilev",		sendfilev,	5),
5190Sstevel@tonic-gate 	/* 79 */ SYSENT_CI("rmdir",		rmdir,		1),
5200Sstevel@tonic-gate 	/* 80 */ SYSENT_CI("mkdir",		mkdir,		2),
5210Sstevel@tonic-gate 	/* 81 */ IF_LP64(
5220Sstevel@tonic-gate 			SYSENT_CI("getdents",	getdents64,	3),
5230Sstevel@tonic-gate 			SYSENT_CI("getdents",	getdents32,	3)),
5246134Scasper 	/* 82 */ SYSENT_CI("privsys",		privsys,	6),
5250Sstevel@tonic-gate 	/* 83 */ SYSENT_CI("ucredsys",		ucredsys,	3),
5260Sstevel@tonic-gate 	/* 84 */ SYSENT_CI("sysfs",		sysfs,		3),
5270Sstevel@tonic-gate 	/* 85 */ SYSENT_CI("getmsg",		getmsg,		4),
5280Sstevel@tonic-gate 	/* 86 */ SYSENT_CI("putmsg",		putmsg,		4),
52911798SRoger.Faulkner@Sun.COM 	/* 87 */ SYSENT_LOADABLE(),			/* (was poll) */
5300Sstevel@tonic-gate 	/* 88 */ SYSENT_CI("lstat",		lstat,		2),
5310Sstevel@tonic-gate 	/* 89 */ SYSENT_CI("symlink",		symlink,	2),
5320Sstevel@tonic-gate 	/* 90 */ SYSENT_CL("readlink",		readlink,	3),
5330Sstevel@tonic-gate 	/* 91 */ SYSENT_CI("setgroups",		setgroups,	2),
5340Sstevel@tonic-gate 	/* 92 */ SYSENT_CI("getgroups",		getgroups,	2),
5350Sstevel@tonic-gate 	/* 93 */ SYSENT_CI("fchmod",		fchmod,		2),
5360Sstevel@tonic-gate 	/* 94 */ SYSENT_CI("fchown",		fchown,		3),
5370Sstevel@tonic-gate 	/* 95 */ SYSENT_CI("sigprocmask",	sigprocmask,	3),
5380Sstevel@tonic-gate 	/* 96 */ SYSENT_CI("sigsuspend",	sigsuspend,	1),
5390Sstevel@tonic-gate 	/* 97 */ SYSENT_CI("sigaltstack",	sigaltstack,	2),
5400Sstevel@tonic-gate 	/* 98 */ SYSENT_CI("sigaction",		sigaction,	3),
5410Sstevel@tonic-gate 	/* 99 */ SYSENT_CI("sigpending",	sigpending,	2),
5420Sstevel@tonic-gate 	/* 100 */ SYSENT_CI("getsetcontext",	getsetcontext,	2),
543*12789SRoger.Faulkner@Oracle.COM 	/* 101 */ SYSENT_CI("fchmodat",		fchmodat,	4),
544*12789SRoger.Faulkner@Oracle.COM 	/* 102 */ SYSENT_CI("mkdirat",		mkdirat,	3),
5450Sstevel@tonic-gate 	/* 103 */ SYSENT_CI("statvfs",		statvfs,	2),
5460Sstevel@tonic-gate 	/* 104 */ SYSENT_CI("fstatvfs",		fstatvfs,	2),
5470Sstevel@tonic-gate 	/* 105 */ SYSENT_CI("getloadavg",	getloadavg,	2),
5480Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
5490Sstevel@tonic-gate 	/* 106 */ SYSENT_LOADABLE(),		/* nfssys */
5500Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
5510Sstevel@tonic-gate 	/* 107 */ SYSENT_CI("waitsys",		waitsys,	4),
5520Sstevel@tonic-gate 	/* 108 */ SYSENT_CI("sigsendset",	sigsendsys,	2),
5530Sstevel@tonic-gate 	/* 109 */ IF_x86(
5540Sstevel@tonic-gate 			SYSENT_AP("hrtsys",	hrtsys,		5),
5550Sstevel@tonic-gate 			SYSENT_LOADABLE()),
55610440SRoger.Faulkner@Sun.COM 	/* 110 */ SYSENT_CI("utimesys",		utimesys,	5),
5574806Sraf 	/* 111 */ SYSENT_CI("sigresend",	sigresend,	3),
5580Sstevel@tonic-gate 	/* 112 */ SYSENT_CL("priocntlsys",	priocntlsys,	5),
5590Sstevel@tonic-gate 	/* 113 */ SYSENT_CL("pathconf",		pathconf,	2),
5600Sstevel@tonic-gate 	/* 114 */ SYSENT_CI("mincore",		mincore,	3),
5610Sstevel@tonic-gate 	/* 115 */ IF_LP64(
5620Sstevel@tonic-gate 			SYSENT_CL("mmap",	smmap64,	6),
5630Sstevel@tonic-gate 			SYSENT_CL("mmap",	smmap32,	6)),
5640Sstevel@tonic-gate 	/* 116 */ SYSENT_CI("mprotect",		mprotect,	3),
5650Sstevel@tonic-gate 	/* 117 */ SYSENT_CI("munmap",		munmap,		2),
5660Sstevel@tonic-gate 	/* 118 */ SYSENT_CL("fpathconf",	fpathconf,	2),
5670Sstevel@tonic-gate 	/* 119 */ SYSENT_2CI("vfork",		vfork,		0),
5680Sstevel@tonic-gate 	/* 120 */ SYSENT_CI("fchdir",		fchdir,		1),
5690Sstevel@tonic-gate 	/* 121 */ SYSENT_CL("readv",		readv,		3),
5700Sstevel@tonic-gate 	/* 122 */ SYSENT_CL("writev",		writev,		3),
57111798SRoger.Faulkner@Sun.COM 	/* 123 */ SYSENT_LOADABLE(),			/* (was xstat) */
57211798SRoger.Faulkner@Sun.COM 	/* 124 */ SYSENT_LOADABLE(),			/* (was lxstat) */
57311798SRoger.Faulkner@Sun.COM 	/* 125 */ SYSENT_LOADABLE(),			/* (was fxstat) */
57411798SRoger.Faulkner@Sun.COM 	/* 126 */ SYSENT_LOADABLE(),			/* (was xmknod) */
5758212SMichael.Corcoran@Sun.COM 	/* 127 */ SYSENT_CI("mmapobj",		mmapobjsys,	5),
5760Sstevel@tonic-gate 	/* 128 */ IF_LP64(
5770Sstevel@tonic-gate 			SYSENT_CI("setrlimit",	setrlimit64,	2),
5780Sstevel@tonic-gate 			SYSENT_CI("setrlimit",	setrlimit32,	2)),
5790Sstevel@tonic-gate 	/* 129 */ IF_LP64(
5800Sstevel@tonic-gate 			SYSENT_CI("getrlimit",	getrlimit64,	2),
5810Sstevel@tonic-gate 			SYSENT_CI("getrlimit",	getrlimit32,	2)),
5820Sstevel@tonic-gate 	/* 130 */ SYSENT_CI("lchown",		lchown,		3),
5830Sstevel@tonic-gate 	/* 131 */ SYSENT_CI("memcntl",		memcntl,	6),
5840Sstevel@tonic-gate 	/* 132 */ SYSENT_CI("getpmsg",		getpmsg,	5),
5850Sstevel@tonic-gate 	/* 133 */ SYSENT_CI("putpmsg",		putpmsg,	5),
5860Sstevel@tonic-gate 	/* 134 */ SYSENT_CI("rename",		rename,		2),
5870Sstevel@tonic-gate 	/* 135 */ SYSENT_CI("uname",		uname,		1),
5880Sstevel@tonic-gate 	/* 136 */ SYSENT_CI("setegid",		setegid,	1),
5890Sstevel@tonic-gate 	/* 137 */ SYSENT_CL("sysconfig",	sysconfig,	1),
5900Sstevel@tonic-gate 	/* 138 */ SYSENT_CI("adjtime",		adjtime,	2),
5910Sstevel@tonic-gate 	/* 139 */ SYSENT_CL("systeminfo",	systeminfo,	3),
5923957Sth199096 	/* 140 */ SYSENT_LOADABLE(),		/* sharefs */
5930Sstevel@tonic-gate 	/* 141 */ SYSENT_CI("seteuid",		seteuid,	1),
5943235Sraf 	/* 142 */ SYSENT_2CI("forksys",		forksys,	2),
59511798SRoger.Faulkner@Sun.COM 	/* 143 */ SYSENT_LOADABLE(),			/* (was fork1) */
5960Sstevel@tonic-gate 	/* 144 */ SYSENT_CI("sigtimedwait",	sigtimedwait,	3),
5970Sstevel@tonic-gate 	/* 145 */ SYSENT_CI("lwp_info",		lwp_info,	1),
5980Sstevel@tonic-gate 	/* 146 */ SYSENT_CI("yield",		yield,		0),
59911913SRoger.Faulkner@Sun.COM 	/* 147 */ SYSENT_LOADABLE(),		    /* (was lwp_sema_wait) */
6000Sstevel@tonic-gate 	/* 148 */ SYSENT_CI("lwp_sema_post",	lwp_sema_post,	1),
6010Sstevel@tonic-gate 	/* 149 */ SYSENT_CI("lwp_sema_trywait",	lwp_sema_trywait, 1),
6020Sstevel@tonic-gate 	/* 150 */ SYSENT_CI("lwp_detach",	lwp_detach,	1),
6030Sstevel@tonic-gate 	/* 151 */ SYSENT_CI("corectl",		corectl,	4),
6040Sstevel@tonic-gate 	/* 152 */ SYSENT_CI("modctl",		modctl,		6),
6050Sstevel@tonic-gate 	/* 153 */ SYSENT_CI("fchroot",		fchroot,	1),
60611798SRoger.Faulkner@Sun.COM 	/* 154 */ SYSENT_LOADABLE(),			/* (was utimes) */
6070Sstevel@tonic-gate 	/* 155 */ SYSENT_CI("vhangup",		vhangup,	0),
6080Sstevel@tonic-gate 	/* 156 */ SYSENT_CI("gettimeofday",	gettimeofday,	1),
6090Sstevel@tonic-gate 	/* 157 */ SYSENT_CI("getitimer",	getitimer,	2),
6100Sstevel@tonic-gate 	/* 158 */ SYSENT_CI("setitimer",	setitimer,	3),
6110Sstevel@tonic-gate 	/* 159 */ SYSENT_CI("lwp_create",	syslwp_create,	3),
6120Sstevel@tonic-gate 	/* 160 */ SYSENT_CI("lwp_exit",	(int (*)())syslwp_exit,	0),
6130Sstevel@tonic-gate 	/* 161 */ SYSENT_CI("lwp_suspend",	syslwp_suspend,	1),
6140Sstevel@tonic-gate 	/* 162 */ SYSENT_CI("lwp_continue",	syslwp_continue, 1),
6150Sstevel@tonic-gate 	/* 163 */ SYSENT_CI("lwp_kill",		lwp_kill,	2),
6160Sstevel@tonic-gate 	/* 164 */ SYSENT_CI("lwp_self",		lwp_self,	0),
61711913SRoger.Faulkner@Sun.COM 	/* 165 */ SYSENT_2CI("lwp_sigmask",	lwp_sigmask,	5),
6180Sstevel@tonic-gate 	/* 166 */ IF_x86(
6190Sstevel@tonic-gate 			SYSENT_CI("lwp_private", syslwp_private, 3),
6200Sstevel@tonic-gate 			SYSENT_NOSYS()),
6210Sstevel@tonic-gate 	/* 167 */ SYSENT_CI("lwp_wait",		lwp_wait,	2),
6224574Sraf 	/* 168 */ SYSENT_CI("lwp_mutex_wakeup",	lwp_mutex_wakeup,	2),
62311798SRoger.Faulkner@Sun.COM 	/* 169 */ SYSENT_LOADABLE(),		    /* (was lwp_mutex_lock) */
6240Sstevel@tonic-gate 	/* 170 */ SYSENT_CI("lwp_cond_wait",	lwp_cond_wait,		4),
6250Sstevel@tonic-gate 	/* 171 */ SYSENT_CI("lwp_cond_signal",	lwp_cond_signal,	1),
6260Sstevel@tonic-gate 	/* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast,	1),
6270Sstevel@tonic-gate 	/* 173 */ SYSENT_CL("pread",		pread,		4),
6280Sstevel@tonic-gate 	/* 174 */ SYSENT_CL("pwrite ",		pwrite,		4),
6290Sstevel@tonic-gate 	/*
6300Sstevel@tonic-gate 	 * The 64-bit C library maps llseek() to lseek(), so this
6310Sstevel@tonic-gate 	 * is needed as a native syscall only on the 32-bit kernel.
6320Sstevel@tonic-gate 	 */
6330Sstevel@tonic-gate 	/* 175 */ IF_LP64(
6340Sstevel@tonic-gate 			SYSENT_NOSYS(),
6350Sstevel@tonic-gate 			SYSENT_C("llseek",	llseek32,	4)),
6360Sstevel@tonic-gate 	/* 176 */ SYSENT_LOADABLE(),		/* inst_sync */
6372712Snn35248 	/* 177 */ SYSENT_CI("brandsys",		brandsys,	6),
6380Sstevel@tonic-gate 	/* 178 */ SYSENT_LOADABLE(),		/* kaio */
6390Sstevel@tonic-gate 	/* 179 */ SYSENT_LOADABLE(),		/* cpc */
6400Sstevel@tonic-gate 	/* 180 */ SYSENT_CI("lgrpsys",		lgrpsys,	3),
6413247Sgjelinek 	/* 181 */ SYSENT_CI("rusagesys",	rusagesys, 	5),
6420Sstevel@tonic-gate 	/* 182 */ SYSENT_LOADABLE(),		/* portfs */
6430Sstevel@tonic-gate 	/* 183 */ SYSENT_CI("pollsys",		pollsys,	4),
6441676Sjpk 	/* 184 */ SYSENT_CI("labelsys",		labelsys,	5),
6450Sstevel@tonic-gate 	/* 185 */ SYSENT_CI("acl",		acl,		4),
64611861SMarek.Pospisil@Sun.COM 	/* 186 */ SYSENT_AP("auditsys",		auditsys,	6),
6470Sstevel@tonic-gate 	/* 187 */ SYSENT_CI("processor_bind",	processor_bind,	4),
6480Sstevel@tonic-gate 	/* 188 */ SYSENT_CI("processor_info",	processor_info,	2),
6490Sstevel@tonic-gate 	/* 189 */ SYSENT_CI("p_online",		p_online,	2),
6502248Sraf 	/* 190 */ SYSENT_CI("sigqueue",		sigqueue,	5),
6510Sstevel@tonic-gate 	/* 191 */ SYSENT_CI("clock_gettime",	clock_gettime,	2),
6520Sstevel@tonic-gate 	/* 192 */ SYSENT_CI("clock_settime",	clock_settime,	2),
6530Sstevel@tonic-gate 	/* 193 */ SYSENT_CI("clock_getres",	clock_getres,	2),
6540Sstevel@tonic-gate 	/* 194 */ SYSENT_CI("timer_create",	timer_create,	3),
6550Sstevel@tonic-gate 	/* 195 */ SYSENT_CI("timer_delete",	timer_delete,	1),
6560Sstevel@tonic-gate 	/* 196 */ SYSENT_CI("timer_settime",	timer_settime,	4),
6570Sstevel@tonic-gate 	/* 197 */ SYSENT_CI("timer_gettime",	timer_gettime,	2),
6580Sstevel@tonic-gate 	/* 198 */ SYSENT_CI("timer_getoverrun",	timer_getoverrun, 1),
6590Sstevel@tonic-gate 	/* 199 */ SYSENT_CI("nanosleep",	nanosleep,	2),
6600Sstevel@tonic-gate 	/* 200 */ SYSENT_CI("facl",		facl,		4),
6610Sstevel@tonic-gate 	/* 201 */ SYSENT_LOADABLE(),		/* door */
6620Sstevel@tonic-gate 	/* 202 */ SYSENT_CI("setreuid",		setreuid,	2),
6630Sstevel@tonic-gate 	/* 203 */ SYSENT_CI("setregid",		setregid,	2),
6640Sstevel@tonic-gate 	/* 204 */ SYSENT_CI("install_utrap",	install_utrap,	3),
6650Sstevel@tonic-gate 	/* 205 */ SYSENT_CI("signotify",	signotify,	3),
6660Sstevel@tonic-gate 	/* 206 */ SYSENT_CL("schedctl",		schedctl,	0),
6670Sstevel@tonic-gate 	/* 207 */ SYSENT_LOADABLE(),		/* pset */
6680Sstevel@tonic-gate 	/* 208 */ IF_sparc(
6690Sstevel@tonic-gate 		SYSENT_CI("sparc_utrap_install", sparc_utrap_install, 5),
6700Sstevel@tonic-gate 		SYSENT_NOSYS()),
6710Sstevel@tonic-gate 	/* 209 */ SYSENT_CI("resolvepath",	resolvepath,	3),
67210887SRoger.Faulkner@Sun.COM 	/* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock,	3),
6730Sstevel@tonic-gate 	/* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait,	3),
6740Sstevel@tonic-gate 	/* 212 */ SYSENT_CI("lwp_rwlock_sys",	lwp_rwlock_sys,	3),
6750Sstevel@tonic-gate 	/*
6760Sstevel@tonic-gate 	 * Syscalls 213-225: 32-bit system call support for large files.
6770Sstevel@tonic-gate 	 *
6780Sstevel@tonic-gate 	 * (The 64-bit C library transparently maps these system calls
6790Sstevel@tonic-gate 	 * back to their native versions, so almost all of them are only
6800Sstevel@tonic-gate 	 * needed as native syscalls on the 32-bit kernel).
6810Sstevel@tonic-gate 	 */
6820Sstevel@tonic-gate 	/* 213 */ IF_LP64(
6830Sstevel@tonic-gate 			SYSENT_NOSYS(),
6840Sstevel@tonic-gate 			SYSENT_CI("getdents64",	getdents64,	3)),
6850Sstevel@tonic-gate 	/* 214 */ IF_LP64(
6860Sstevel@tonic-gate 			SYSENT_NOSYS(),
6870Sstevel@tonic-gate 			SYSENT_AP("smmaplf32",	smmaplf32,	7)),
6880Sstevel@tonic-gate 	/* 215 */ IF_LP64(
6890Sstevel@tonic-gate 			SYSENT_NOSYS(),
6900Sstevel@tonic-gate 			SYSENT_CI("stat64",	stat64, 	2)),
6910Sstevel@tonic-gate 	/* 216 */ IF_LP64(
6920Sstevel@tonic-gate 			SYSENT_NOSYS(),
6930Sstevel@tonic-gate 			SYSENT_CI("lstat64",	lstat64,	2)),
6940Sstevel@tonic-gate 	/* 217 */ IF_LP64(
6950Sstevel@tonic-gate 			SYSENT_NOSYS(),
6960Sstevel@tonic-gate 			SYSENT_CI("fstat64", 	fstat64, 	2)),
6970Sstevel@tonic-gate 	/* 218 */ IF_LP64(
6980Sstevel@tonic-gate 			SYSENT_NOSYS(),
6990Sstevel@tonic-gate 			SYSENT_CI("statvfs64", 	statvfs64, 	2)),
7000Sstevel@tonic-gate 	/* 219 */ IF_LP64(
7010Sstevel@tonic-gate 			SYSENT_NOSYS(),
7020Sstevel@tonic-gate 			SYSENT_CI("fstatvfs64",	fstatvfs64, 	2)),
7030Sstevel@tonic-gate 	/* 220 */ IF_LP64(
7040Sstevel@tonic-gate 			SYSENT_NOSYS(),
7050Sstevel@tonic-gate 			SYSENT_CI("setrlimit64", setrlimit64, 	2)),
7060Sstevel@tonic-gate 	/* 221 */ IF_LP64(
7070Sstevel@tonic-gate 			SYSENT_NOSYS(),
7080Sstevel@tonic-gate 			SYSENT_CI("getrlimit64", getrlimit64, 	2)),
7090Sstevel@tonic-gate 	/* 222 */ IF_LP64(
7100Sstevel@tonic-gate 			SYSENT_NOSYS(),
7110Sstevel@tonic-gate 			SYSENT_CI("pread64",	pread64, 	5)),
7120Sstevel@tonic-gate 	/* 223 */ IF_LP64(
7130Sstevel@tonic-gate 			SYSENT_NOSYS(),
7140Sstevel@tonic-gate 			SYSENT_CI("pwrite64", 	pwrite64, 	5)),
71511798SRoger.Faulkner@Sun.COM 	/* 224 */ SYSENT_LOADABLE(),			/* (was creat64) */
7160Sstevel@tonic-gate 	/* 225 */ IF_LP64(
7170Sstevel@tonic-gate 			SYSENT_NOSYS(),
7180Sstevel@tonic-gate 			SYSENT_CI("open64",	open64,		3)),
7190Sstevel@tonic-gate 	/* 226 */ SYSENT_LOADABLE(),		/* rpcsys */
7201676Sjpk 	/* 227 */ SYSENT_CL("zone",		zone,		5),
7210Sstevel@tonic-gate 	/* 228 */ SYSENT_LOADABLE(),		/* autofssys */
7220Sstevel@tonic-gate 	/* 229 */ SYSENT_CI("getcwd",		getcwd,		2),
7230Sstevel@tonic-gate 	/* 230 */ SYSENT_CI("so_socket",	so_socket,	5),
7240Sstevel@tonic-gate 	/* 231 */ SYSENT_CI("so_socketpair",	so_socketpair,	1),
7250Sstevel@tonic-gate 	/* 232 */ SYSENT_CI("bind",		bind,		4),
7260Sstevel@tonic-gate 	/* 233 */ SYSENT_CI("listen",		listen,		3),
7270Sstevel@tonic-gate 	/* 234 */ SYSENT_CI("accept",		accept,		4),
7280Sstevel@tonic-gate 	/* 235 */ SYSENT_CI("connect",		connect,	4),
7290Sstevel@tonic-gate 	/* 236 */ SYSENT_CI("shutdown",		shutdown,	3),
7300Sstevel@tonic-gate 	/* 237 */ SYSENT_CL("recv",		recv,		4),
7310Sstevel@tonic-gate 	/* 238 */ SYSENT_CL("recvfrom",		recvfrom,	6),
7320Sstevel@tonic-gate 	/* 239 */ SYSENT_CL("recvmsg",		recvmsg,	3),
7330Sstevel@tonic-gate 	/* 240 */ SYSENT_CL("send",		send,		4),
7340Sstevel@tonic-gate 	/* 241 */ SYSENT_CL("sendmsg",		sendmsg,	3),
7350Sstevel@tonic-gate 	/* 242 */ SYSENT_CL("sendto",		sendto,		6),
7360Sstevel@tonic-gate 	/* 243 */ SYSENT_CI("getpeername",	getpeername,	4),
7370Sstevel@tonic-gate 	/* 244 */ SYSENT_CI("getsockname",	getsockname,	4),
7380Sstevel@tonic-gate 	/* 245 */ SYSENT_CI("getsockopt",	getsockopt,	6),
7390Sstevel@tonic-gate 	/* 246 */ SYSENT_CI("setsockopt",	setsockopt,	6),
74012643SAnders.Persson@Sun.COM 	/* 247 */ SYSENT_CI("sockconfig",	sockconfig,	5),
7410Sstevel@tonic-gate 	/* 248 */ SYSENT_CI("ntp_gettime",	ntp_gettime,	1),
7420Sstevel@tonic-gate 	/* 249 */ SYSENT_CI("ntp_adjtime",	ntp_adjtime,	1),
7430Sstevel@tonic-gate 	/* 250 */ SYSENT_CI("lwp_mutex_unlock",	lwp_mutex_unlock,	1),
74410887SRoger.Faulkner@Sun.COM 	/* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock,	2),
7459264SRoger.Faulkner@Sun.COM 	/* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register,	2),
7460Sstevel@tonic-gate 	/* 253 */ SYSENT_CI("cladm",		cladm,		3),
7472712Snn35248 	/* 254 */ SYSENT_CI("uucopy",		uucopy,		3),
7480Sstevel@tonic-gate 	/* 255 */ SYSENT_CI("umount2",		umount2,	2)
7490Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
7500Sstevel@tonic-gate };
7510Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
7520Sstevel@tonic-gate 
7530Sstevel@tonic-gate 
7540Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
7550Sstevel@tonic-gate 
7560Sstevel@tonic-gate extern int ulimit32();
7570Sstevel@tonic-gate extern ssize_t read32();
7580Sstevel@tonic-gate extern ssize_t write32();
7590Sstevel@tonic-gate extern ssize_t pread32();
7600Sstevel@tonic-gate extern ssize_t pwrite32();
7610Sstevel@tonic-gate extern ssize_t readv32();
7620Sstevel@tonic-gate extern ssize_t writev32();
7630Sstevel@tonic-gate extern ssize_t readlink32();
764*12789SRoger.Faulkner@Oracle.COM extern ssize_t readlinkat32();
7650Sstevel@tonic-gate extern int open32();
76611798SRoger.Faulkner@Sun.COM extern int openat32();
7670Sstevel@tonic-gate extern int stat32();
7680Sstevel@tonic-gate extern int fstatat32();
7690Sstevel@tonic-gate extern int lstat32();
7700Sstevel@tonic-gate extern int fstat32();
7710Sstevel@tonic-gate extern int fstatat64_32();
7720Sstevel@tonic-gate extern int stat64_32();
7730Sstevel@tonic-gate extern int lstat64_32();
7740Sstevel@tonic-gate extern int fstat64_32();
7750Sstevel@tonic-gate extern int getmsg32();
7760Sstevel@tonic-gate extern int putmsg32();
7770Sstevel@tonic-gate extern int getpmsg32();
7780Sstevel@tonic-gate extern int putpmsg32();
7790Sstevel@tonic-gate extern int getsetcontext32();
7800Sstevel@tonic-gate extern int statvfs32();
7810Sstevel@tonic-gate extern int fstatvfs32();
7820Sstevel@tonic-gate extern int statvfs64_32();
7830Sstevel@tonic-gate extern int fstatvfs64_32();
7840Sstevel@tonic-gate extern int sigaction32();
7850Sstevel@tonic-gate extern clock32_t times32();
7860Sstevel@tonic-gate extern int stime32();
7870Sstevel@tonic-gate extern int getpagesizes32();
7880Sstevel@tonic-gate extern int sigaltstack32();
7890Sstevel@tonic-gate extern int sigqueue32();
7900Sstevel@tonic-gate extern offset_t	llseek32();
7910Sstevel@tonic-gate extern int waitsys32();
7920Sstevel@tonic-gate 
7930Sstevel@tonic-gate extern ssize_t recv32();
7940Sstevel@tonic-gate extern ssize_t recvfrom32();
7950Sstevel@tonic-gate extern ssize_t send32();
7960Sstevel@tonic-gate extern ssize_t sendto32();
7970Sstevel@tonic-gate 
7980Sstevel@tonic-gate extern int privsys32();
7990Sstevel@tonic-gate extern int ucredsys32();
8000Sstevel@tonic-gate 
8010Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
8020Sstevel@tonic-gate /*
8030Sstevel@tonic-gate  * sysent table for ILP32 processes running on
8040Sstevel@tonic-gate  * a LP64 kernel.
8050Sstevel@tonic-gate  */
8060Sstevel@tonic-gate struct sysent sysent32[NSYSCALL] =
8070Sstevel@tonic-gate {
8080Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
8090Sstevel@tonic-gate 	/*  0 */ SYSENT_C("indir",		indir,		1),
8100Sstevel@tonic-gate 	/*  1 */ SYSENT_CI("exit",	(int (*)())rexit,	1),
81111798SRoger.Faulkner@Sun.COM 	/*  2 */ SYSENT_LOADABLE32(),			/* (was forkall) */
8120Sstevel@tonic-gate 	/*  3 */ SYSENT_CI("read",		read32,		3),
8130Sstevel@tonic-gate 	/*  4 */ SYSENT_CI("write",		write32,	3),
8140Sstevel@tonic-gate 	/*  5 */ SYSENT_CI("open",		open32,		3),
8150Sstevel@tonic-gate 	/*  6 */ SYSENT_CI("close",		close,		1),
816*12789SRoger.Faulkner@Oracle.COM 	/*  7 */ SYSENT_CI("linkat",		linkat,		5),
81711798SRoger.Faulkner@Sun.COM 	/*  8 */ SYSENT_LOADABLE32(),			/* (was creat32) */
8180Sstevel@tonic-gate 	/*  9 */ SYSENT_CI("link",		link,		2),
8190Sstevel@tonic-gate 	/* 10 */ SYSENT_CI("unlink",		unlink,		1),
820*12789SRoger.Faulkner@Oracle.COM 	/* 11 */ SYSENT_CI("symlinkat",		symlinkat,	3),
8210Sstevel@tonic-gate 	/* 12 */ SYSENT_CI("chdir",		chdir,		1),
8220Sstevel@tonic-gate 	/* 13 */ SYSENT_CI("time",		gtime,		0),
8230Sstevel@tonic-gate 	/* 14 */ SYSENT_CI("mknod",		mknod,		3),
8240Sstevel@tonic-gate 	/* 15 */ SYSENT_CI("chmod",		chmod,		2),
8250Sstevel@tonic-gate 	/* 16 */ SYSENT_CI("chown",		chown,		3),
8260Sstevel@tonic-gate 	/* 17 */ SYSENT_CI("brk",		brk,		1),
8270Sstevel@tonic-gate 	/* 18 */ SYSENT_CI("stat",		stat32,		2),
8280Sstevel@tonic-gate 	/* 19 */ SYSENT_CI("lseek",		lseek32,	3),
8290Sstevel@tonic-gate 	/* 20 */ SYSENT_2CI("getpid",		getpid,		0),
8300Sstevel@tonic-gate 	/* 21 */ SYSENT_AP("mount",		mount,		8),
831*12789SRoger.Faulkner@Oracle.COM 	/* 22 */ SYSENT_CI("readlinkat",	readlinkat32,	4),
8320Sstevel@tonic-gate 	/* 23 */ SYSENT_CI("setuid",		setuid,		1),
8330Sstevel@tonic-gate 	/* 24 */ SYSENT_2CI("getuid",		getuid,		0),
8340Sstevel@tonic-gate 	/* 25 */ SYSENT_CI("stime",		stime32,	1),
8350Sstevel@tonic-gate 	/* 26 */ SYSENT_CI("pcsample",		pcsample,	2),
8360Sstevel@tonic-gate 	/* 27 */ SYSENT_CI("alarm",		alarm,		1),
8370Sstevel@tonic-gate 	/* 28 */ SYSENT_CI("fstat",		fstat32,	2),
8380Sstevel@tonic-gate 	/* 29 */ SYSENT_CI("pause",		pause,		0),
83911798SRoger.Faulkner@Sun.COM 	/* 30 */ SYSENT_LOADABLE32(),			/* (was utime) */
8400Sstevel@tonic-gate 	/* 31 */ SYSENT_CI("stty",		stty,		2),
8410Sstevel@tonic-gate 	/* 32 */ SYSENT_CI("gtty",		gtty,		2),
8420Sstevel@tonic-gate 	/* 33 */ SYSENT_CI("access",		access,		2),
8430Sstevel@tonic-gate 	/* 34 */ SYSENT_CI("nice",		nice,		1),
8440Sstevel@tonic-gate 	/* 35 */ SYSENT_CI("statfs",		statfs32,	4),
8450Sstevel@tonic-gate 	/* 36 */ SYSENT_CI("sync",		syssync,	0),
8460Sstevel@tonic-gate 	/* 37 */ SYSENT_CI("kill",		kill,		2),
8470Sstevel@tonic-gate 	/* 38 */ SYSENT_CI("fstatfs",		fstatfs32,	4),
8480Sstevel@tonic-gate 	/* 39 */ SYSENT_CI("setpgrp",		setpgrp,	3),
8492712Snn35248 	/* 40 */ SYSENT_CI("uucopystr",		uucopystr,	3),
85011798SRoger.Faulkner@Sun.COM 	/* 41 */ SYSENT_LOADABLE32(),			/* (was dup) */
8513235Sraf 	/* 42 */ SYSENT_LOADABLE32(),			/* pipe */
8520Sstevel@tonic-gate 	/* 43 */ SYSENT_CI("times",		times32,	1),
8530Sstevel@tonic-gate 	/* 44 */ SYSENT_CI("prof",		profil,		4),
85411798SRoger.Faulkner@Sun.COM 	/* 45 */ SYSENT_CI("faccessat",		faccessat,	4),
8550Sstevel@tonic-gate 	/* 46 */ SYSENT_CI("setgid",		setgid,		1),
8560Sstevel@tonic-gate 	/* 47 */ SYSENT_2CI("getgid",		getgid,		0),
857*12789SRoger.Faulkner@Oracle.COM 	/* 48 */ SYSENT_CI("mknodat",		mknodat,	4),
8583235Sraf 	/* 49 */ SYSENT_LOADABLE32(),			/* msgsys */
8590Sstevel@tonic-gate 	/* 50 */ IF_386_ABI(
8600Sstevel@tonic-gate 			SYSENT_CI("sysi86",	sysi86,		4),
86111798SRoger.Faulkner@Sun.COM 			SYSENT_LOADABLE32()),		/* (was sys3b) */
8620Sstevel@tonic-gate 	/* 51 */ SYSENT_LOADABLE32(),			/* sysacct */
8630Sstevel@tonic-gate 	/* 52 */ SYSENT_LOADABLE32(),			/* shmsys */
8640Sstevel@tonic-gate 	/* 53 */ SYSENT_LOADABLE32(),			/* semsys */
8650Sstevel@tonic-gate 	/* 54 */ SYSENT_CI("ioctl",		ioctl,		3),
8660Sstevel@tonic-gate 	/* 55 */ SYSENT_CI("uadmin",		uadmin,		3),
86711798SRoger.Faulkner@Sun.COM 	/* 56 */ SYSENT_CI("fchownat",		fchownat,	5),
8680Sstevel@tonic-gate 	/* 57 */ SYSENT_2CI("utssys",		utssys32,	4),
8690Sstevel@tonic-gate 	/* 58 */ SYSENT_CI("fdsync",		fdsync,		2),
8700Sstevel@tonic-gate 	/* 59 */ SYSENT_CI("exece",		exece,		3),
8710Sstevel@tonic-gate 	/* 60 */ SYSENT_CI("umask",		umask,		1),
8720Sstevel@tonic-gate 	/* 61 */ SYSENT_CI("chroot",		chroot,		1),
8730Sstevel@tonic-gate 	/* 62 */ SYSENT_CI("fcntl",		fcntl,		3),
8740Sstevel@tonic-gate 	/* 63 */ SYSENT_CI("ulimit",		ulimit32,	2),
87511798SRoger.Faulkner@Sun.COM 	/* 64 */ SYSENT_CI("renameat",		renameat,	4),
87611798SRoger.Faulkner@Sun.COM 	/* 65 */ SYSENT_CI("unlinkat",		unlinkat,	3),
87711798SRoger.Faulkner@Sun.COM 	/* 66 */ SYSENT_CI("fstatat",		fstatat32,	4),
87811798SRoger.Faulkner@Sun.COM 	/* 67 */ SYSENT_CI("fstatat64", 	fstatat64_32, 	4),
87911798SRoger.Faulkner@Sun.COM 	/* 68 */ SYSENT_CI("openat",		openat32,	4),
88011798SRoger.Faulkner@Sun.COM 	/* 69 */ SYSENT_CI("openat64",		openat64,	4),
8810Sstevel@tonic-gate 	/* 70 */ SYSENT_CI("tasksys",		tasksys,	5),
8820Sstevel@tonic-gate 	/* 71 */ SYSENT_LOADABLE32(),		/* acctctl */
8830Sstevel@tonic-gate 	/* 72 */ SYSENT_LOADABLE32(),		/* exacct */
8845349Skchow 	/* 73 */ SYSENT_CI("getpagesizes",	getpagesizes32,	3),
8850Sstevel@tonic-gate 	/* 74 */ SYSENT_CI("rctlsys",		rctlsys,	6),
8864321Scasper 	/* 75 */ SYSENT_2CI("sidsys",		sidsys,		4),
88711798SRoger.Faulkner@Sun.COM 	/* 76 */ SYSENT_LOADABLE32(),			/* (was fsat) */
8880Sstevel@tonic-gate 	/* 77 */ SYSENT_CI("lwp_park",		syslwp_park,	3),
8890Sstevel@tonic-gate 	/* 78 */ SYSENT_CI("sendfilev",		sendfilev,	5),
8900Sstevel@tonic-gate 	/* 79 */ SYSENT_CI("rmdir",		rmdir,		1),
8910Sstevel@tonic-gate 	/* 80 */ SYSENT_CI("mkdir",		mkdir,		2),
8920Sstevel@tonic-gate 	/* 81 */ SYSENT_CI("getdents",		getdents32,	3),
8936134Scasper 	/* 82 */ SYSENT_CI("privsys",		privsys32,	6),
8940Sstevel@tonic-gate 	/* 83 */ SYSENT_CI("ucredsys",		ucredsys32,	3),
8950Sstevel@tonic-gate 	/* 84 */ SYSENT_CI("sysfs",		sysfs,		3),
8960Sstevel@tonic-gate 	/* 85 */ SYSENT_CI("getmsg",		getmsg32,	4),
8970Sstevel@tonic-gate 	/* 86 */ SYSENT_CI("putmsg",		putmsg32,	4),
89811798SRoger.Faulkner@Sun.COM 	/* 87 */ SYSENT_LOADABLE32(),			/* (was poll) */
8990Sstevel@tonic-gate 	/* 88 */ SYSENT_CI("lstat",		lstat32,	2),
9000Sstevel@tonic-gate 	/* 89 */ SYSENT_CI("symlink",		symlink,	2),
9010Sstevel@tonic-gate 	/* 90 */ SYSENT_CI("readlink",		readlink32,	3),
9020Sstevel@tonic-gate 	/* 91 */ SYSENT_CI("setgroups",		setgroups,	2),
9030Sstevel@tonic-gate 	/* 92 */ SYSENT_CI("getgroups",		getgroups,	2),
9040Sstevel@tonic-gate 	/* 93 */ SYSENT_CI("fchmod",		fchmod,		2),
9050Sstevel@tonic-gate 	/* 94 */ SYSENT_CI("fchown",		fchown,		3),
9060Sstevel@tonic-gate 	/* 95 */ SYSENT_CI("sigprocmask",	sigprocmask,	3),
9070Sstevel@tonic-gate 	/* 96 */ SYSENT_CI("sigsuspend",	sigsuspend,	1),
9080Sstevel@tonic-gate 	/* 97 */ SYSENT_CI("sigaltstack",	sigaltstack32,	2),
9090Sstevel@tonic-gate 	/* 98 */ SYSENT_CI("sigaction",		sigaction32,	3),
9100Sstevel@tonic-gate 	/* 99 */ SYSENT_CI("sigpending",	sigpending,	2),
9110Sstevel@tonic-gate 	/* 100 */ SYSENT_CI("getsetcontext",	getsetcontext32, 2),
912*12789SRoger.Faulkner@Oracle.COM 	/* 101 */ SYSENT_CI("fchmodat",		fchmodat,	4),
913*12789SRoger.Faulkner@Oracle.COM 	/* 102 */ SYSENT_CI("mkdirat",		mkdirat,	3),
9140Sstevel@tonic-gate 	/* 103 */ SYSENT_CI("statvfs",		statvfs32,	2),
9150Sstevel@tonic-gate 	/* 104 */ SYSENT_CI("fstatvfs",		fstatvfs32,	2),
9160Sstevel@tonic-gate 	/* 105 */ SYSENT_CI("getloadavg",	getloadavg,	2),
9170Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
9180Sstevel@tonic-gate 	/* 106 */ SYSENT_LOADABLE32(),		/* nfssys */
9190Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
9200Sstevel@tonic-gate 	/* 107 */ SYSENT_CI("waitsys",		waitsys32,	4),
9210Sstevel@tonic-gate 	/* 108 */ SYSENT_CI("sigsendset",	sigsendsys,	2),
9220Sstevel@tonic-gate 	/* 109 */ IF_x86(
9230Sstevel@tonic-gate 			SYSENT_AP("hrtsys",	hrtsys,		5),
9240Sstevel@tonic-gate 			SYSENT_LOADABLE32()),
92510440SRoger.Faulkner@Sun.COM 	/* 110 */ SYSENT_CI("utimesys",		utimesys,	5),
9264806Sraf 	/* 111 */ SYSENT_CI("sigresend",	sigresend,	3),
9270Sstevel@tonic-gate 	/* 112 */ SYSENT_CI("priocntlsys",	priocntlsys,	5),
9280Sstevel@tonic-gate 	/* 113 */ SYSENT_CI("pathconf",		pathconf,	2),
9290Sstevel@tonic-gate 	/* 114 */ SYSENT_CI("mincore",		mincore,	3),
9300Sstevel@tonic-gate 	/* 115 */ SYSENT_CI("mmap",		smmap32,	6),
9310Sstevel@tonic-gate 	/* 116 */ SYSENT_CI("mprotect",		mprotect,	3),
9320Sstevel@tonic-gate 	/* 117 */ SYSENT_CI("munmap",		munmap,		2),
9330Sstevel@tonic-gate 	/* 118 */ SYSENT_CI("fpathconf",	fpathconf,	2),
9340Sstevel@tonic-gate 	/* 119 */ SYSENT_2CI("vfork",		vfork,		0),
9350Sstevel@tonic-gate 	/* 120 */ SYSENT_CI("fchdir",		fchdir,		1),
9360Sstevel@tonic-gate 	/* 121 */ SYSENT_CI("readv",		readv32,	3),
9370Sstevel@tonic-gate 	/* 122 */ SYSENT_CI("writev",		writev32,	3),
93811798SRoger.Faulkner@Sun.COM 	/* 123 */ SYSENT_LOADABLE32(),		/*	was xstat32	*/
93911798SRoger.Faulkner@Sun.COM 	/* 124 */ SYSENT_LOADABLE32(),		/*	was lxstat32	*/
94011798SRoger.Faulkner@Sun.COM 	/* 125 */ SYSENT_LOADABLE32(),		/*	was fxstat32	*/
94111798SRoger.Faulkner@Sun.COM 	/* 126 */ SYSENT_LOADABLE32(),		/*	was xmknod	*/
9428212SMichael.Corcoran@Sun.COM 	/* 127 */ SYSENT_CI("mmapobj",		mmapobjsys,	5),
9430Sstevel@tonic-gate 	/* 128 */ SYSENT_CI("setrlimit",	setrlimit32,	2),
9440Sstevel@tonic-gate 	/* 129 */ SYSENT_CI("getrlimit",	getrlimit32,	2),
9450Sstevel@tonic-gate 	/* 130 */ SYSENT_CI("lchown",		lchown,		3),
9460Sstevel@tonic-gate 	/* 131 */ SYSENT_CI("memcntl",		memcntl,	6),
9470Sstevel@tonic-gate 	/* 132 */ SYSENT_CI("getpmsg",		getpmsg32,	5),
9480Sstevel@tonic-gate 	/* 133 */ SYSENT_CI("putpmsg",		putpmsg32,	5),
9490Sstevel@tonic-gate 	/* 134 */ SYSENT_CI("rename",		rename,		2),
9500Sstevel@tonic-gate 	/* 135 */ SYSENT_CI("uname",		uname,		1),
9510Sstevel@tonic-gate 	/* 136 */ SYSENT_CI("setegid",		setegid,	1),
9520Sstevel@tonic-gate 	/* 137 */ SYSENT_CI("sysconfig",	sysconfig,	1),
9530Sstevel@tonic-gate 	/* 138 */ SYSENT_CI("adjtime",		adjtime,	2),
9540Sstevel@tonic-gate 	/* 139 */ SYSENT_CI("systeminfo",	systeminfo,	3),
9553957Sth199096 	/* 140 */ SYSENT_LOADABLE32(),		/* sharefs */
9560Sstevel@tonic-gate 	/* 141 */ SYSENT_CI("seteuid",		seteuid,	1),
9573235Sraf 	/* 142 */ SYSENT_2CI("forksys",		forksys,	2),
95811798SRoger.Faulkner@Sun.COM 	/* 143 */ SYSENT_LOADABLE32(),			/* (was fork1) */
9590Sstevel@tonic-gate 	/* 144 */ SYSENT_CI("sigtimedwait",	sigtimedwait,	3),
9600Sstevel@tonic-gate 	/* 145 */ SYSENT_CI("lwp_info",		lwp_info,	1),
9610Sstevel@tonic-gate 	/* 146 */ SYSENT_CI("yield",		yield,		0),
96211913SRoger.Faulkner@Sun.COM 	/* 147 */ SYSENT_LOADABLE32(),		    /* (was lwp_sema_wait) */
9630Sstevel@tonic-gate 	/* 148 */ SYSENT_CI("lwp_sema_post",	lwp_sema_post,	1),
9640Sstevel@tonic-gate 	/* 149 */ SYSENT_CI("lwp_sema_trywait",	lwp_sema_trywait, 1),
9650Sstevel@tonic-gate 	/* 150 */ SYSENT_CI("lwp_detach",	lwp_detach,	1),
9660Sstevel@tonic-gate 	/* 151 */ SYSENT_CI("corectl",		corectl,	4),
9670Sstevel@tonic-gate 	/* 152 */ SYSENT_CI("modctl",		modctl,		6),
9680Sstevel@tonic-gate 	/* 153 */ SYSENT_CI("fchroot",		fchroot,	1),
96911798SRoger.Faulkner@Sun.COM 	/* 154 */ SYSENT_LOADABLE32(),			/* (was utimes) */
9700Sstevel@tonic-gate 	/* 155 */ SYSENT_CI("vhangup",		vhangup,	0),
9710Sstevel@tonic-gate 	/* 156 */ SYSENT_CI("gettimeofday",	gettimeofday,	1),
9720Sstevel@tonic-gate 	/* 157 */ SYSENT_CI("getitimer",	getitimer,	2),
9730Sstevel@tonic-gate 	/* 158 */ SYSENT_CI("setitimer",	setitimer,	3),
9740Sstevel@tonic-gate 	/* 159 */ SYSENT_CI("lwp_create",	syslwp_create,	3),
9750Sstevel@tonic-gate 	/* 160 */ SYSENT_CI("lwp_exit",	(int (*)())syslwp_exit,	0),
9760Sstevel@tonic-gate 	/* 161 */ SYSENT_CI("lwp_suspend",	syslwp_suspend,	1),
9770Sstevel@tonic-gate 	/* 162 */ SYSENT_CI("lwp_continue",	syslwp_continue, 1),
9780Sstevel@tonic-gate 	/* 163 */ SYSENT_CI("lwp_kill",		lwp_kill,	2),
9790Sstevel@tonic-gate 	/* 164 */ SYSENT_CI("lwp_self",		lwp_self,	0),
98011913SRoger.Faulkner@Sun.COM 	/* 165 */ SYSENT_2CI("lwp_sigmask",	lwp_sigmask,	5),
9810Sstevel@tonic-gate 	/* 166 */ IF_x86(
9820Sstevel@tonic-gate 			SYSENT_CI("lwp_private", syslwp_private, 3),
9830Sstevel@tonic-gate 			SYSENT_NOSYS()),
9840Sstevel@tonic-gate 	/* 167 */ SYSENT_CI("lwp_wait",		lwp_wait,	2),
9854574Sraf 	/* 168 */ SYSENT_CI("lwp_mutex_wakeup",	lwp_mutex_wakeup,	2),
98611913SRoger.Faulkner@Sun.COM 	/* 169 */ SYSENT_LOADABLE32(),		    /* (was lwp_mutex_lock) */
9870Sstevel@tonic-gate 	/* 170 */ SYSENT_CI("lwp_cond_wait",	lwp_cond_wait,		4),
9880Sstevel@tonic-gate 	/* 171 */ SYSENT_CI("lwp_cond_signal",	lwp_cond_signal,	1),
9890Sstevel@tonic-gate 	/* 172 */ SYSENT_CI("lwp_cond_broadcast", lwp_cond_broadcast,	1),
9900Sstevel@tonic-gate 	/* 173 */ SYSENT_CI("pread",		pread32,		4),
9910Sstevel@tonic-gate 	/* 174 */ SYSENT_CI("pwrite",		pwrite32,		4),
9920Sstevel@tonic-gate 	/* 175 */ SYSENT_C("llseek",		llseek32,	4),
9930Sstevel@tonic-gate 	/* 176 */ SYSENT_LOADABLE32(),		/* inst_sync */
9942712Snn35248 	/* 177 */ SYSENT_CI("brandsys",		brandsys,	6),
9950Sstevel@tonic-gate 	/* 178 */ SYSENT_LOADABLE32(),		/* kaio */
9960Sstevel@tonic-gate 	/* 179 */ SYSENT_LOADABLE32(),		/* cpc */
9970Sstevel@tonic-gate 	/* 180 */ SYSENT_CI("lgrpsys",		lgrpsys,	3),
9983247Sgjelinek 	/* 181 */ SYSENT_CI("rusagesys",	rusagesys,	5),
9990Sstevel@tonic-gate 	/* 182 */ SYSENT_LOADABLE32(),		/* portfs */
10000Sstevel@tonic-gate 	/* 183 */ SYSENT_CI("pollsys",		pollsys,	4),
10011676Sjpk 	/* 184 */ SYSENT_CI("labelsys",		labelsys,	5),
10020Sstevel@tonic-gate 	/* 185 */ SYSENT_CI("acl",		acl,		4),
100311861SMarek.Pospisil@Sun.COM 	/* 186 */ SYSENT_AP("auditsys",		auditsys,	6),
10040Sstevel@tonic-gate 	/* 187 */ SYSENT_CI("processor_bind",	processor_bind,	4),
10050Sstevel@tonic-gate 	/* 188 */ SYSENT_CI("processor_info",	processor_info,	2),
10060Sstevel@tonic-gate 	/* 189 */ SYSENT_CI("p_online",		p_online,	2),
10072248Sraf 	/* 190 */ SYSENT_CI("sigqueue",		sigqueue32,	5),
10080Sstevel@tonic-gate 	/* 191 */ SYSENT_CI("clock_gettime",	clock_gettime,	2),
10090Sstevel@tonic-gate 	/* 192 */ SYSENT_CI("clock_settime",	clock_settime,	2),
10100Sstevel@tonic-gate 	/* 193 */ SYSENT_CI("clock_getres",	clock_getres,	2),
10110Sstevel@tonic-gate 	/* 194 */ SYSENT_CI("timer_create",	timer_create,	3),
10120Sstevel@tonic-gate 	/* 195 */ SYSENT_CI("timer_delete",	timer_delete,	1),
10130Sstevel@tonic-gate 	/* 196 */ SYSENT_CI("timer_settime",	timer_settime,	4),
10140Sstevel@tonic-gate 	/* 197 */ SYSENT_CI("timer_gettime",	timer_gettime,	2),
10150Sstevel@tonic-gate 	/* 198 */ SYSENT_CI("timer_getoverrun",	timer_getoverrun, 1),
10160Sstevel@tonic-gate 	/* 199 */ SYSENT_CI("nanosleep",	nanosleep,	2),
10170Sstevel@tonic-gate 	/* 200 */ SYSENT_CI("facl",		facl,		4),
10180Sstevel@tonic-gate 	/* 201 */ SYSENT_LOADABLE32(),		/* door */
10190Sstevel@tonic-gate 	/* 202 */ SYSENT_CI("setreuid",		setreuid,	2),
10200Sstevel@tonic-gate 	/* 203 */ SYSENT_CI("setregid",		setregid,	2),
10210Sstevel@tonic-gate 	/* 204 */ SYSENT_CI("install_utrap",	install_utrap,	3),
10220Sstevel@tonic-gate 	/* 205 */ SYSENT_CI("signotify",	signotify,	3),
10230Sstevel@tonic-gate 	/* 206 */ SYSENT_CI("schedctl",		schedctl,	0),
10240Sstevel@tonic-gate 	/* 207 */ SYSENT_LOADABLE32(),		/* pset */
10250Sstevel@tonic-gate 	/* 208 */ SYSENT_LOADABLE32(),
10260Sstevel@tonic-gate 	/* 209 */ SYSENT_CI("resolvepath",	resolvepath,	3),
102710887SRoger.Faulkner@Sun.COM 	/* 210 */ SYSENT_CI("lwp_mutex_timedlock", lwp_mutex_timedlock, 3),
10280Sstevel@tonic-gate 	/* 211 */ SYSENT_CI("lwp_sema_timedwait", lwp_sema_timedwait,	3),
10290Sstevel@tonic-gate 	/* 212 */ SYSENT_CI("lwp_rwlock_sys",	lwp_rwlock_sys,	3),
10300Sstevel@tonic-gate 	/*
10310Sstevel@tonic-gate 	 * Syscalls 213-225: 32-bit system call support for large files.
10320Sstevel@tonic-gate 	 */
10330Sstevel@tonic-gate 	/* 213 */ SYSENT_CI("getdents64",	getdents64,	3),
10340Sstevel@tonic-gate 	/* 214 */ SYSENT_AP("smmaplf32", 	smmaplf32, 	7),
10350Sstevel@tonic-gate 	/* 215 */ SYSENT_CI("stat64", 		stat64_32, 	2),
10360Sstevel@tonic-gate 	/* 216 */ SYSENT_CI("lstat64", 		lstat64_32,	2),
10370Sstevel@tonic-gate 	/* 217 */ SYSENT_CI("fstat64", 		fstat64_32, 	2),
10380Sstevel@tonic-gate 	/* 218 */ SYSENT_CI("statvfs64", 	statvfs64_32, 	2),
10390Sstevel@tonic-gate 	/* 219 */ SYSENT_CI("fstatvfs64", 	fstatvfs64_32, 	2),
10400Sstevel@tonic-gate 	/* 220 */ SYSENT_CI("setrlimit64", 	setrlimit64, 	2),
10410Sstevel@tonic-gate 	/* 221 */ SYSENT_CI("getrlimit64", 	getrlimit64, 	2),
10420Sstevel@tonic-gate 	/* 222 */ SYSENT_CI("pread64", 		pread64, 	5),
10430Sstevel@tonic-gate 	/* 223 */ SYSENT_CI("pwrite64", 	pwrite64, 	5),
104411798SRoger.Faulkner@Sun.COM 	/* 224 */ SYSENT_LOADABLE32(),			/* (was creat64) */
10450Sstevel@tonic-gate 	/* 225 */ SYSENT_CI("open64",		open64,		3),
10460Sstevel@tonic-gate 	/* 226 */ SYSENT_LOADABLE32(),		/* rpcsys */
10470Sstevel@tonic-gate 	/* 227 */ SYSENT_CI("zone",		zone,		6),
10480Sstevel@tonic-gate 	/* 228 */ SYSENT_LOADABLE32(),		/* autofssys */
10490Sstevel@tonic-gate 	/* 229 */ SYSENT_CI("getcwd",		getcwd,		2),
10500Sstevel@tonic-gate 	/* 230 */ SYSENT_CI("so_socket",	so_socket,	5),
10510Sstevel@tonic-gate 	/* 231 */ SYSENT_CI("so_socketpair",	so_socketpair,	1),
10520Sstevel@tonic-gate 	/* 232 */ SYSENT_CI("bind",		bind,		4),
10530Sstevel@tonic-gate 	/* 233 */ SYSENT_CI("listen",		listen,		3),
10540Sstevel@tonic-gate 	/* 234 */ SYSENT_CI("accept",		accept,		4),
10550Sstevel@tonic-gate 	/* 235 */ SYSENT_CI("connect",		connect,	4),
10560Sstevel@tonic-gate 	/* 236 */ SYSENT_CI("shutdown",		shutdown,	3),
10570Sstevel@tonic-gate 	/* 237 */ SYSENT_CI("recv",		recv32,		4),
10580Sstevel@tonic-gate 	/* 238 */ SYSENT_CI("recvfrom",		recvfrom32,	6),
10590Sstevel@tonic-gate 	/* 239 */ SYSENT_CI("recvmsg",		recvmsg,	3),
10600Sstevel@tonic-gate 	/* 240 */ SYSENT_CI("send",		send32,		4),
10610Sstevel@tonic-gate 	/* 241 */ SYSENT_CI("sendmsg",		sendmsg,	3),
10620Sstevel@tonic-gate 	/* 242 */ SYSENT_CI("sendto",		sendto32,	6),
10630Sstevel@tonic-gate 	/* 243 */ SYSENT_CI("getpeername",	getpeername,	4),
10640Sstevel@tonic-gate 	/* 244 */ SYSENT_CI("getsockname",	getsockname,	4),
10650Sstevel@tonic-gate 	/* 245 */ SYSENT_CI("getsockopt",	getsockopt,	6),
10660Sstevel@tonic-gate 	/* 246 */ SYSENT_CI("setsockopt",	setsockopt,	6),
106712643SAnders.Persson@Sun.COM 	/* 247 */ SYSENT_CI("sockconfig",	sockconfig,	5),
10680Sstevel@tonic-gate 	/* 248 */ SYSENT_CI("ntp_gettime",	ntp_gettime,	1),
10690Sstevel@tonic-gate 	/* 249 */ SYSENT_CI("ntp_adjtime",	ntp_adjtime,	1),
10700Sstevel@tonic-gate 	/* 250 */ SYSENT_CI("lwp_mutex_unlock",	lwp_mutex_unlock,	1),
107110887SRoger.Faulkner@Sun.COM 	/* 251 */ SYSENT_CI("lwp_mutex_trylock", lwp_mutex_trylock,	2),
10729264SRoger.Faulkner@Sun.COM 	/* 252 */ SYSENT_CI("lwp_mutex_register", lwp_mutex_register,	2),
10730Sstevel@tonic-gate 	/* 253 */ SYSENT_CI("cladm",		cladm,		3),
10742712Snn35248 	/* 254 */ SYSENT_CI("uucopy",		uucopy,		3),
10750Sstevel@tonic-gate 	/* 255 */ SYSENT_CI("umount2",		umount2,	2)
10760Sstevel@tonic-gate /* ONC_PLUS EXTRACT START */
10770Sstevel@tonic-gate };
10780Sstevel@tonic-gate /* ONC_PLUS EXTRACT END */
10790Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */
10800Sstevel@tonic-gate 
10810Sstevel@tonic-gate /*
10820Sstevel@tonic-gate  * Space allocated and initialized in init_syscallnames().
10830Sstevel@tonic-gate  */
10840Sstevel@tonic-gate char **syscallnames;
10850Sstevel@tonic-gate 
10860Sstevel@tonic-gate systrace_sysent_t *systrace_sysent;
10870Sstevel@tonic-gate void (*systrace_probe)(dtrace_id_t, uintptr_t, uintptr_t,
10882769Sahl     uintptr_t, uintptr_t, uintptr_t, uintptr_t);
10890Sstevel@tonic-gate 
10900Sstevel@tonic-gate /*ARGSUSED*/
10910Sstevel@tonic-gate void
systrace_stub(dtrace_id_t id,uintptr_t arg0,uintptr_t arg1,uintptr_t arg2,uintptr_t arg3,uintptr_t arg4,uintptr_t arg5)10920Sstevel@tonic-gate systrace_stub(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1,
10932769Sahl     uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
10940Sstevel@tonic-gate {}
10950Sstevel@tonic-gate 
10960Sstevel@tonic-gate /*ARGSUSED*/
10970Sstevel@tonic-gate int64_t
dtrace_systrace_syscall(uintptr_t arg0,uintptr_t arg1,uintptr_t arg2,uintptr_t arg3,uintptr_t arg4,uintptr_t arg5)10980Sstevel@tonic-gate dtrace_systrace_syscall(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,
10990Sstevel@tonic-gate     uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
11000Sstevel@tonic-gate {
11010Sstevel@tonic-gate 	systrace_sysent_t *sy = &systrace_sysent[curthread->t_sysnum];
11020Sstevel@tonic-gate 	dtrace_id_t id;
11030Sstevel@tonic-gate 	int64_t rval;
11040Sstevel@tonic-gate 	proc_t *p;
11050Sstevel@tonic-gate 
11060Sstevel@tonic-gate 	if ((id = sy->stsy_entry) != DTRACE_IDNONE)
11072769Sahl 		(*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5);
11080Sstevel@tonic-gate 
11090Sstevel@tonic-gate 	/*
11100Sstevel@tonic-gate 	 * We want to explicitly allow DTrace consumers to stop a process
11110Sstevel@tonic-gate 	 * before it actually executes the meat of the syscall.
11120Sstevel@tonic-gate 	 */
11130Sstevel@tonic-gate 	p = ttoproc(curthread);
11140Sstevel@tonic-gate 	mutex_enter(&p->p_lock);
11150Sstevel@tonic-gate 	if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) {
11160Sstevel@tonic-gate 		curthread->t_dtrace_stop = 0;
11170Sstevel@tonic-gate 		stop(PR_REQUESTED, 0);
11180Sstevel@tonic-gate 	}
11190Sstevel@tonic-gate 	mutex_exit(&p->p_lock);
11200Sstevel@tonic-gate 
11210Sstevel@tonic-gate 	rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5);
11220Sstevel@tonic-gate 
11230Sstevel@tonic-gate 	if (ttolwp(curthread)->lwp_errno != 0)
11240Sstevel@tonic-gate 		rval = -1;
11250Sstevel@tonic-gate 
11260Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
11270Sstevel@tonic-gate 		(*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval,
11282769Sahl 		    (uintptr_t)((int64_t)rval >> 32), 0, 0, 0);
11290Sstevel@tonic-gate 
11300Sstevel@tonic-gate 	return (rval);
11310Sstevel@tonic-gate }
11320Sstevel@tonic-gate 
11330Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
11340Sstevel@tonic-gate 
11350Sstevel@tonic-gate systrace_sysent_t *systrace_sysent32;
11360Sstevel@tonic-gate 
11370Sstevel@tonic-gate /*ARGSUSED*/
11380Sstevel@tonic-gate int64_t
dtrace_systrace_syscall32(uintptr_t arg0,uintptr_t arg1,uintptr_t arg2,uintptr_t arg3,uintptr_t arg4,uintptr_t arg5)11390Sstevel@tonic-gate dtrace_systrace_syscall32(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,
11400Sstevel@tonic-gate     uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
11410Sstevel@tonic-gate {
11420Sstevel@tonic-gate 	systrace_sysent_t *sy = &systrace_sysent32[curthread->t_sysnum];
11430Sstevel@tonic-gate 	dtrace_id_t id;
11440Sstevel@tonic-gate 	int64_t rval;
11450Sstevel@tonic-gate 	proc_t *p;
11460Sstevel@tonic-gate 
11470Sstevel@tonic-gate 	if ((id = sy->stsy_entry) != DTRACE_IDNONE)
11482769Sahl 		(*systrace_probe)(id, arg0, arg1, arg2, arg3, arg4, arg5);
11490Sstevel@tonic-gate 
11500Sstevel@tonic-gate 	/*
11510Sstevel@tonic-gate 	 * We want to explicitly allow DTrace consumers to stop a process
11520Sstevel@tonic-gate 	 * before it actually executes the meat of the syscall.
11530Sstevel@tonic-gate 	 */
11540Sstevel@tonic-gate 	p = ttoproc(curthread);
11550Sstevel@tonic-gate 	mutex_enter(&p->p_lock);
11560Sstevel@tonic-gate 	if (curthread->t_dtrace_stop && !curthread->t_lwp->lwp_nostop) {
11570Sstevel@tonic-gate 		curthread->t_dtrace_stop = 0;
11580Sstevel@tonic-gate 		stop(PR_REQUESTED, 0);
11590Sstevel@tonic-gate 	}
11600Sstevel@tonic-gate 	mutex_exit(&p->p_lock);
11610Sstevel@tonic-gate 
11620Sstevel@tonic-gate 	rval = (*sy->stsy_underlying)(arg0, arg1, arg2, arg3, arg4, arg5);
11630Sstevel@tonic-gate 
11640Sstevel@tonic-gate 	if (ttolwp(curthread)->lwp_errno != 0)
11650Sstevel@tonic-gate 		rval = -1;
11660Sstevel@tonic-gate 
11670Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
11680Sstevel@tonic-gate 		(*systrace_probe)(id, (uintptr_t)rval, (uintptr_t)rval,
11692769Sahl 		    (uintptr_t)((uint64_t)rval >> 32), 0, 0, 0);
11700Sstevel@tonic-gate 
11710Sstevel@tonic-gate 	return (rval);
11720Sstevel@tonic-gate }
11730Sstevel@tonic-gate 
11740Sstevel@tonic-gate #endif
11750Sstevel@tonic-gate 
11760Sstevel@tonic-gate void
dtrace_systrace_rtt(void)11770Sstevel@tonic-gate dtrace_systrace_rtt(void)
11780Sstevel@tonic-gate {
11790Sstevel@tonic-gate 	systrace_sysent_t *sy;
11800Sstevel@tonic-gate 	dtrace_id_t id;
11810Sstevel@tonic-gate 
11820Sstevel@tonic-gate 	if (get_udatamodel() == DATAMODEL_NATIVE) {
11830Sstevel@tonic-gate 		if (systrace_sysent == NULL)
11840Sstevel@tonic-gate 			return;
11850Sstevel@tonic-gate 
11860Sstevel@tonic-gate 		sy = &systrace_sysent[curthread->t_sysnum];
11870Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
11880Sstevel@tonic-gate 	} else {
11890Sstevel@tonic-gate 		if (systrace_sysent32 == NULL)
11900Sstevel@tonic-gate 			return;
11910Sstevel@tonic-gate 
11920Sstevel@tonic-gate 		sy = &systrace_sysent32[curthread->t_sysnum];
11930Sstevel@tonic-gate #endif
11940Sstevel@tonic-gate 	}
11950Sstevel@tonic-gate 
11960Sstevel@tonic-gate 	if ((id = sy->stsy_return) != DTRACE_IDNONE)
11972769Sahl 		(*systrace_probe)(id, 0, 0, 0, 0, 0, 0);
11980Sstevel@tonic-gate }
1199