summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/auditrecord/audit_record_attr.txt87
-rw-r--r--usr/src/cmd/mdb/common/mdb/mdb_proc.c24
-rw-r--r--usr/src/cmd/sgs/include/conv.h2
-rw-r--r--usr/src/cmd/sgs/libconv/common/corenote.c206
-rw-r--r--usr/src/cmd/sgs/libconv/common/corenote.msg98
-rw-r--r--usr/src/cmd/sgs/librtld_db/rdb_demo/common/main.c9
-rw-r--r--usr/src/cmd/sgs/rtld.4.x/ld.sobin24576 -> 24576 bytes
-rw-r--r--usr/src/cmd/sgs/rtld.4.x/rtldlib.s32
-rw-r--r--usr/src/cmd/sgs/rtld/common/external.c6
-rw-r--r--usr/src/cmd/truss/Makefile.com6
-rw-r--r--usr/src/cmd/truss/actions.c64
-rw-r--r--usr/src/cmd/truss/codes.c28
-rw-r--r--usr/src/cmd/truss/expound.c127
-rw-r--r--usr/src/cmd/truss/ipc.c13
-rw-r--r--usr/src/cmd/truss/listopts.c110
-rw-r--r--usr/src/cmd/truss/main.c200
-rw-r--r--usr/src/cmd/truss/print.c25
-rw-r--r--usr/src/cmd/truss/print.h4
-rw-r--r--usr/src/cmd/truss/proto.h5
-rw-r--r--usr/src/cmd/truss/ramdata.h4
-rw-r--r--usr/src/cmd/truss/stat.c (renamed from usr/src/cmd/truss/xstat.c)117
-rw-r--r--usr/src/cmd/truss/systable.c343
22 files changed, 677 insertions, 833 deletions
diff --git a/usr/src/cmd/auditrecord/audit_record_attr.txt b/usr/src/cmd/auditrecord/audit_record_attr.txt
index f1e834ab12..53bf1ff177 100644
--- a/usr/src/cmd/auditrecord/audit_record_attr.txt
+++ b/usr/src/cmd/auditrecord/audit_record_attr.txt
@@ -2,7 +2,7 @@
# Two "#" are comments that are copied to audit_record_attr
# other comments are removed.
##
-## Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+## Copyright 2010 Sun Microsystems, Inc. All rights reserved.
## Use is subject to license terms.
##
## CDDL HEADER START
@@ -604,6 +604,7 @@ label=AUE_CORE
# see uts/common/c2/audit.c
label=AUE_CREAT
+# obsolete - see open(2)
format=path:[attr]
# does not match old BSM manual
# header,151,2,creat(2),,Mon May 15 09:21:59 2000, + 509998810 msec
@@ -681,6 +682,7 @@ label=AUE_ENTERPROM
# return,success,0
label=AUE_EXEC
+# obsolete - see execve(2)
format=path:[attr]1:[exec_args]2:[exec_env]3
comment=omitted on error:
comment=output if argv policy is set:
@@ -719,8 +721,9 @@ label=AUE_EXPORTFS
skip=Not used.
label=AUE_FACCESSAT
+# obsolete
see=access(2)
- format=path:[path_attr]:[attr]
+ format=path:[attr]
label=AUE_FACLSET
syscall=facl
@@ -796,9 +799,10 @@ label=AUE_FCHOWN
comment=1, file descriptor, "no path fd"
label=AUE_FCHOWNAT
+# obsolete
see=openat(2)
case=With a valid absolute/relative file path
- format=path:[path_attr]:[attr]
+ format=path:[attr]
case=With an file path eq. NULL and valid file descriptor
format=kernel
@@ -833,22 +837,15 @@ label=AUE_FORK1
# see audit.c
label=AUE_FSAT
+# obsolete
skip=Not used. (Placeholder for AUE_*AT records)
-#openat AUE_OPENAT_{W,RW,R} appended with CT as needed
-#openat64 AUE_OPENAT_{W,RW,R} appended with CT as needed
-#fstatat64 AUE_FSTATAT
-#fstat AUE_FSTATAT
-#chownat AUE_FCHOWNAT
-#unlinkat AUE_UNLINKAT
-#futimesat AUE_FUTIMESAT
-#renameat AUE_RENAMEAT
-#faccessat AUE_FACCESSAT
label=AUE_FSTAT
skip=Not used.
label=AUE_FSTATAT
- format=path:[path_attr]:[attr]
+# obsolete
+ format=path:[attr]
label=AUE_FSTATFS
case=With a valid file descriptor
@@ -864,10 +861,9 @@ label=AUE_FUSERS
syscall=utssys: UTS_FUSERS
format=path:attr
-
label=AUE_FUTIMESAT
- syscall=utimes(2)
- format=[path]:[path_attr]:[attr]
+# obsolete
+ format=[path]:[attr]
label=AUE_GETAUDIT
format=kernel
@@ -986,8 +982,8 @@ label=AUE_LSTAT
format=path:[attr]
label=AUE_LXSTAT
+# obsolete
skip=Not used.
-# AUE_LXSTAT now maps to AUE_LSTAT
label=AUE_MCTL
skip=Not used.
@@ -1188,78 +1184,80 @@ label=AUE_OPEN
skip=Not used. (placeholder for AUE_OPEN_*).
label=AUE_OPEN_R
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read
label=AUE_OPENAT_R
+# obsolete
format=path:[path_attr]:[attr]
see=openat(2)
label=AUE_OPEN_RC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,creat
label=AUE_OPENAT_RC
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_CREAT mangling
label=AUE_OPEN_RT
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,trunc
label=AUE_OPENAT_RT
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_TRUNC mangling
label=AUE_OPEN_RTC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,trunc,creat
label=AUE_OPENAT_RTC
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_TRUNC mangling, fm & O_CREAT mangling
label=AUE_OPEN_RW
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,write
label=AUE_OPENAT_RW
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
# aui_fsat(): fm & O_RDWR
label=AUE_OPEN_RWC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,write,creat
label=AUE_OPENAT_RWC
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_RDWR, fm & O_CREAT mangling
label=AUE_OPEN_RWT
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,write,trunc
label=AUE_OPENAT_RWT
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_RDWR, fm & O_TRUNC mangling
label=AUE_OPEN_RWTC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - read,write,trunc,creat
label=AUE_OPENAT_RWTC
+# obsolete
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_RDWR, fm & O_TRUNC mangling, fm & O_CREAT mangling
label=AUE_OPEN_W
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - write
label=AUE_OPENAT_W
@@ -1267,36 +1265,34 @@ label=AUE_OPENAT_W
format=path:[path_attr]:[attr]
label=AUE_OPEN_WC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - write,creat
label=AUE_OPENAT_WC
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_WRONLY, fm & O_CREAT mangling
label=AUE_OPEN_WT
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - write,trunc
label=AUE_OPENAT_WT
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_WRONLY, fm & O_TRUNC mangling
label=AUE_OPEN_WTC
- format=path:[attr]
+ format=path:[path_attr]:[attr]
see=open(2) - write,trunc,creat
label=AUE_OPENAT_WTC
see=openat(2)
format=path:[path_attr]:[attr]
-# aui_fsat(): fm & O_WRONLY, fm & O_TRUNC mangling, fm & O_CREAT mangling
label=AUE_OSETPGRP
skip=Not used.
label=AUE_OSTAT
+# obsolete
skip=Not used.
label=AUE_PATHCONF
@@ -1441,8 +1437,8 @@ label=AUE_RENAME
comment=to name
label=AUE_RENAMEAT
-# see openat(2)
- format=path1:[path_attr]:[attr]1:[path]2:[path_attr]
+# obsolete
+ format=path1:[attr]1:[path]2
comment=from name:
comment=to name
@@ -1982,16 +1978,19 @@ label=AUE_UNLINK
format=path:[attr]
label=AUE_UNLINKAT
+# obsolete
see=openat(2)
- format=path:[path_attr]:[attr]
+ format=path:[attr]
label=AUE_UNMOUNT
skip=Not used.
label=AUE_UTIME
+# obsolete
format=path:[attr]
label=AUE_UTIMES
+ see=futimens(2)
format=path:[attr]
label=AUE_VFORK
@@ -2015,10 +2014,12 @@ label=AUE_WRITEV
skip=Not used. (obsolete)
label=AUE_XMKNOD
- skip=Not used. xmknod() generates AUE_MKNOD
+# obsolete
+ skip=Not used.
label=AUE_XSTAT
- skip=Not Used. xstat() generates AUE_STAT.
+# obsolete
+ skip=Not Used.
label=AUE_PF_POLICY_ADDRULE
title=Add IPsec policy rule
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_proc.c b/usr/src/cmd/mdb/common/mdb/mdb_proc.c
index 0d39b131fb..7c419d8fcd 100644
--- a/usr/src/cmd/mdb/common/mdb/mdb_proc.c
+++ b/usr/src/cmd/mdb/common/mdb/mdb_proc.c
@@ -18,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -407,8 +408,7 @@ pt_post_attach(mdb_tgt_t *t)
* far the process has proceeded through linker initialization.
*/
if ((psp->pr_flags & PR_ISTOP) && psp->pr_why == PR_SYSEXIT &&
- psp->pr_errno == 0 && (psp->pr_what == SYS_exec ||
- psp->pr_what == SYS_execve)) {
+ psp->pr_errno == 0 && psp->pr_what == SYS_execve) {
if (mdb.m_target == NULL) {
warn("target performed exec of %s\n",
IOP_NAME(pt->p_fio));
@@ -443,11 +443,8 @@ pt_post_attach(mdb_tgt_t *t)
/*
* Install event specifiers to track fork and exec activities:
*/
- (void) mdb_tgt_add_sysexit(t, SYS_forkall, hflag, pt_fork, NULL);
- (void) mdb_tgt_add_sysexit(t, SYS_fork1, hflag, pt_fork, NULL);
(void) mdb_tgt_add_sysexit(t, SYS_vfork, hflag, pt_fork, NULL);
(void) mdb_tgt_add_sysexit(t, SYS_forksys, hflag, pt_fork, NULL);
- (void) mdb_tgt_add_sysexit(t, SYS_exec, hflag, pt_exec, NULL);
(void) mdb_tgt_add_sysexit(t, SYS_execve, hflag, pt_exec, NULL);
/*
@@ -667,10 +664,7 @@ pt_fork(mdb_tgt_t *t, int vid, void *private)
csp = &Pstatus(C)->pr_lwp;
if (csp->pr_why != PR_SYSEXIT ||
- (csp->pr_what != SYS_forkall &&
- csp->pr_what != SYS_fork1 &&
- csp->pr_what != SYS_vfork &&
- csp->pr_what != SYS_forksys)) {
+ (csp->pr_what != SYS_vfork && csp->pr_what != SYS_forksys)) {
warn("forked child process %ld did not stop on exit from "
"fork as expected\n", psp->pr_rval1);
}
@@ -720,7 +714,6 @@ pt_fork(mdb_tgt_t *t, int vid, void *private)
mdb_tgt_sespec_idle_all(t, EBUSY, FALSE);
t->t_pshandle = C;
- (void) Psysexit(C, SYS_exec, TRUE);
(void) Psysexit(C, SYS_execve, TRUE);
(void) Punsetflags(C, PR_FORK | PR_KLC);
@@ -733,8 +726,7 @@ pt_fork(mdb_tgt_t *t, int vid, void *private)
break; /* failure or process died */
} while (csp->pr_why != PR_SYSEXIT ||
- csp->pr_errno != 0 || (csp->pr_what != SYS_exec &&
- csp->pr_what != SYS_execve));
+ csp->pr_errno != 0 || csp->pr_what != SYS_execve);
} else
t->t_pshandle = C;
}
@@ -3588,7 +3580,7 @@ pt_setrun(mdb_tgt_t *t, mdb_tgt_status_t *tsp, int flags)
switch (Pstate(P)) {
case PS_STOP:
if (psp->pr_why == PR_SYSEXIT && psp->pr_errno == 0 &&
- (psp->pr_what == SYS_exec || psp->pr_what == SYS_execve))
+ psp->pr_what == SYS_execve)
pt_release_parents(t);
else
Pupdate_maps(P);
@@ -4027,8 +4019,8 @@ pt_brkpt_disarm(mdb_tgt_t *t, mdb_sespec_t *sep)
const lwpstatus_t *psp = &Pstatus(t->t_pshandle)->pr_lwp;
pt_brkpt_t *ptb = sep->se_data;
- if ((psp->pr_why == PR_SYSEXIT && psp->pr_errno == 0) &&
- (psp->pr_what == SYS_exec || psp->pr_what == SYS_execve))
+ if (psp->pr_why == PR_SYSEXIT && psp->pr_errno == 0 &&
+ psp->pr_what == SYS_execve)
return (0); /* do not restore saved instruction */
return (Pdelbkpt(t->t_pshandle, ptb->ptb_addr, ptb->ptb_instr));
diff --git a/usr/src/cmd/sgs/include/conv.h b/usr/src/cmd/sgs/include/conv.h
index e7fa3d36bc..f7bcf7fb79 100644
--- a/usr/src/cmd/sgs/include/conv.h
+++ b/usr/src/cmd/sgs/include/conv.h
@@ -313,7 +313,7 @@ typedef union {
} Conv_cnote_fltset_buf_t;
/* conv_cnote_sysset() */
-#define CONV_CNOTE_SYSSET_BUFSIZE 3222
+#define CONV_CNOTE_SYSSET_BUFSIZE 3195
typedef union {
Conv_inv_buf_t inv_buf;
char buf[CONV_CNOTE_SYSSET_BUFSIZE];
diff --git a/usr/src/cmd/sgs/libconv/common/corenote.c b/usr/src/cmd/sgs/libconv/common/corenote.c
index fe896e665b..f30809c9cc 100644
--- a/usr/src/cmd/sgs/libconv/common/corenote.c
+++ b/usr/src/cmd/sgs/libconv/common/corenote.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -183,70 +183,70 @@ conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
Conv_inv_buf_t *inv_buf)
{
static const Msg sysnumarr[] = {
- MSG_SYS_EXIT, MSG_SYS_FORKALL,
+ MSG_SYS_EXIT, MSG_SYS_2,
MSG_SYS_READ, MSG_SYS_WRITE,
MSG_SYS_OPEN, MSG_SYS_CLOSE,
- MSG_SYS_WAIT, MSG_SYS_CREAT,
+ MSG_SYS_7, MSG_SYS_8,
MSG_SYS_LINK, MSG_SYS_UNLINK,
- MSG_SYS_EXEC, MSG_SYS_CHDIR,
+ MSG_SYS_11, MSG_SYS_CHDIR,
MSG_SYS_TIME, MSG_SYS_MKNOD,
MSG_SYS_CHMOD, MSG_SYS_CHOWN,
MSG_SYS_BRK, MSG_SYS_STAT,
MSG_SYS_LSEEK, MSG_SYS_GETPID,
- MSG_SYS_MOUNT, MSG_SYS_UMOUNT,
+ MSG_SYS_MOUNT, MSG_SYS_22,
MSG_SYS_SETUID, MSG_SYS_GETUID,
MSG_SYS_STIME, MSG_SYS_PCSAMPLE,
MSG_SYS_ALARM, MSG_SYS_FSTAT,
- MSG_SYS_PAUSE, MSG_SYS_UTIME,
+ MSG_SYS_PAUSE, MSG_SYS_30,
MSG_SYS_STTY, MSG_SYS_GTTY,
MSG_SYS_ACCESS, MSG_SYS_NICE,
MSG_SYS_STATFS, MSG_SYS_SYNC,
MSG_SYS_KILL, MSG_SYS_FSTATFS,
MSG_SYS_PGRPSYS, MSG_SYS_UUCOPYSTR,
- MSG_SYS_DUP, MSG_SYS_PIPE,
+ MSG_SYS_41, MSG_SYS_PIPE,
MSG_SYS_TIMES, MSG_SYS_PROFIL,
- MSG_SYS_PLOCK, MSG_SYS_SETGID,
- MSG_SYS_GETGID, MSG_SYS_SIGNAL,
+ MSG_SYS_FACCESSAT, MSG_SYS_SETGID,
+ MSG_SYS_GETGID, MSG_SYS_48,
MSG_SYS_MSGSYS, MSG_SYS_SYSI86,
MSG_SYS_ACCT, MSG_SYS_SHMSYS,
MSG_SYS_SEMSYS, MSG_SYS_IOCTL,
- MSG_SYS_UADMIN, MSG_SYS_56,
+ MSG_SYS_UADMIN, MSG_SYS_FCHOWNAT,
MSG_SYS_UTSSYS, MSG_SYS_FDSYNC,
MSG_SYS_EXECVE, MSG_SYS_UMASK,
MSG_SYS_CHROOT, MSG_SYS_FCNTL,
- MSG_SYS_ULIMIT, MSG_SYS_64,
- MSG_SYS_65, MSG_SYS_66,
- MSG_SYS_67, MSG_SYS_68,
- MSG_SYS_69, MSG_SYS_TASKSYS,
+ MSG_SYS_ULIMIT, MSG_SYS_RENAMEAT,
+ MSG_SYS_UNLINKAT, MSG_SYS_FSTATAT,
+ MSG_SYS_FSTATAT64, MSG_SYS_OPENAT,
+ MSG_SYS_OPENAT64, MSG_SYS_TASKSYS,
MSG_SYS_ACCTCTL, MSG_SYS_EXACCTSYS,
MSG_SYS_GETPAGESIZES, MSG_SYS_RCTLSYS,
- MSG_SYS_SIDSYS, MSG_SYS_FSAT,
+ MSG_SYS_SIDSYS, MSG_SYS_76,
MSG_SYS_LWP_PARK, MSG_SYS_SENDFILEV,
MSG_SYS_RMDIR, MSG_SYS_MKDIR,
MSG_SYS_GETDENTS, MSG_SYS_PRIVSYS,
MSG_SYS_UCREDSYS, MSG_SYS_SYSFS,
MSG_SYS_GETMSG, MSG_SYS_PUTMSG,
- MSG_SYS_POLL, MSG_SYS_LSTAT,
+ MSG_SYS_87, MSG_SYS_LSTAT,
MSG_SYS_SYMLINK, MSG_SYS_READLINK,
MSG_SYS_SETGROUPS, MSG_SYS_GETGROUPS,
MSG_SYS_FCHMOD, MSG_SYS_FCHOWN,
MSG_SYS_SIGPROCMASK, MSG_SYS_SIGSUSPEND,
MSG_SYS_SIGALTSTACK, MSG_SYS_SIGACTION,
MSG_SYS_SIGPENDING, MSG_SYS_CONTEXT,
- MSG_SYS_EVSYS, MSG_SYS_EVTRAPRET,
+ MSG_SYS_101, MSG_SYS_102,
MSG_SYS_STATVFS, MSG_SYS_FSTATVFS,
MSG_SYS_GETLOADAVG, MSG_SYS_NFSSYS,
MSG_SYS_WAITID, MSG_SYS_SIGSENDSYS,
- MSG_SYS_HRTSYS, MSG_SYS_110,
+ MSG_SYS_HRTSYS, MSG_SYS_UTIMESYS,
MSG_SYS_SIGRESEND, MSG_SYS_PRIOCNTLSYS,
MSG_SYS_PATHCONF, MSG_SYS_MINCORE,
MSG_SYS_MMAP, MSG_SYS_MPROTECT,
MSG_SYS_MUNMAP, MSG_SYS_FPATHCONF,
MSG_SYS_VFORK, MSG_SYS_FCHDIR,
MSG_SYS_READV, MSG_SYS_WRITEV,
- MSG_SYS_XSTAT, MSG_SYS_LXSTAT,
- MSG_SYS_FXSTAT, MSG_SYS_XMKNOD,
- MSG_SYS_127, MSG_SYS_SETRLIMIT,
+ MSG_SYS_123, MSG_SYS_124,
+ MSG_SYS_125, MSG_SYS_126,
+ MSG_SYS_MMAPOBJ, MSG_SYS_SETRLIMIT,
MSG_SYS_GETRLIMIT, MSG_SYS_LCHOWN,
MSG_SYS_MEMCNTL, MSG_SYS_GETPMSG,
MSG_SYS_PUTPMSG, MSG_SYS_RENAME,
@@ -254,12 +254,12 @@ conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
MSG_SYS_SYSCONFIG, MSG_SYS_ADJTIME,
MSG_SYS_SYSTEMINFO, MSG_SYS_SHAREFS,
MSG_SYS_SETEUID, MSG_SYS_FORKSYS,
- MSG_SYS_FORK1, MSG_SYS_SIGTIMEDWAIT,
+ MSG_SYS_143, MSG_SYS_SIGTIMEDWAIT,
MSG_SYS_LWP_INFO, MSG_SYS_YIELD,
- MSG_SYS_LWP_SEMA_WAIT, MSG_SYS_LWP_SEMA_POST,
+ MSG_SYS_147, MSG_SYS_LWP_SEMA_POST,
MSG_SYS_LWP_SEMA_TRYWAIT, MSG_SYS_LWP_DETACH,
MSG_SYS_CORECTL, MSG_SYS_MODCTL,
- MSG_SYS_FCHROOT, MSG_SYS_UTIMES,
+ MSG_SYS_FCHROOT, MSG_SYS_154,
MSG_SYS_VHANGUP, MSG_SYS_GETTIMEOFDAY,
MSG_SYS_GETITIMER, MSG_SYS_SETITIMER,
MSG_SYS_LWP_CREATE, MSG_SYS_LWP_EXIT,
@@ -267,7 +267,7 @@ conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
MSG_SYS_LWP_KILL, MSG_SYS_LWP_SELF,
MSG_SYS_LWP_SIGMASK, MSG_SYS_LWP_PRIVATE,
MSG_SYS_LWP_WAIT, MSG_SYS_LWP_MUTEX_WAKEUP,
- MSG_SYS_LWP_MUTEX_LOCK, MSG_SYS_LWP_COND_WAIT,
+ MSG_SYS_169, MSG_SYS_LWP_COND_WAIT,
MSG_SYS_LWP_COND_SIGNAL, MSG_SYS_LWP_COND_BROADCAST,
MSG_SYS_PREAD, MSG_SYS_PWRITE,
MSG_SYS_LLSEEK, MSG_SYS_INST_SYNC,
@@ -294,7 +294,7 @@ conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
MSG_SYS_FSTAT64, MSG_SYS_STATVFS64,
MSG_SYS_FSTATVFS64, MSG_SYS_SETRLIMIT64,
MSG_SYS_GETRLIMIT64, MSG_SYS_PREAD64,
- MSG_SYS_PWRITE64, MSG_SYS_CREAT64,
+ MSG_SYS_PWRITE64, MSG_SYS_224,
MSG_SYS_OPEN64, MSG_SYS_RPCSYS,
MSG_SYS_ZONE, MSG_SYS_AUTOFSSYS,
MSG_SYS_GETCWD, MSG_SYS_SO_SOCKET,
@@ -328,15 +328,27 @@ conv_cnote_syscall(Word sysnum, Conv_fmt_flags_t fmt_flags,
*/
switch (sysnum) {
case 0:
- case 56:
- case SYS_reserved_64:
- case SYS_reserved_65:
- case SYS_reserved_66:
- case SYS_reserved_67:
- case SYS_reserved_68:
- case SYS_reserved_69:
- case 110:
- case 127:
+ case 2:
+ case 7:
+ case 8:
+ case 11:
+ case 22:
+ case 30:
+ case 41:
+ case 48:
+ case 76:
+ case 87:
+ case 101:
+ case 102:
+ case 123:
+ case 124:
+ case 125:
+ case 126:
+ case 143:
+ case 147:
+ case 154:
+ case 169:
+ case 224:
use_num = 1;
break;
default:
@@ -1806,16 +1818,16 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
\
/* sysset_t[0] - System Calls [1 - 32] */ \
MSG_SYS_EXIT_ALT_SIZE /* 1 */ + \
- MSG_SYS_FORKALL_ALT_SIZE /* 2 */ + \
+ MSG_SYS_2_SIZE /* 2 (unused) */ + \
MSG_SYS_READ_ALT_SIZE /* 3 */ + \
MSG_SYS_WRITE_ALT_SIZE /* 4 */ + \
MSG_SYS_OPEN_ALT_SIZE /* 5 */ + \
MSG_SYS_CLOSE_ALT_SIZE /* 6 */ + \
- MSG_SYS_WAIT_ALT_SIZE /* 7 */ + \
- MSG_SYS_CREAT_ALT_SIZE /* 8 */ + \
+ MSG_SYS_7_SIZE /* 7 (unused) */ + \
+ MSG_SYS_8_SIZE /* 8 (unused) */ + \
MSG_SYS_LINK_ALT_SIZE /* 9 */ + \
MSG_SYS_UNLINK_ALT_SIZE /* 10 */ + \
- MSG_SYS_EXEC_ALT_SIZE /* 11 */ + \
+ MSG_SYS_11_SIZE /* 11 (unused) */ + \
MSG_SYS_CHDIR_ALT_SIZE /* 12 */ + \
MSG_SYS_TIME_ALT_SIZE /* 13 */ + \
MSG_SYS_MKNOD_ALT_SIZE /* 14 */ + \
@@ -1826,7 +1838,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_LSEEK_ALT_SIZE /* 19 */ + \
MSG_SYS_GETPID_ALT_SIZE /* 20 */ + \
MSG_SYS_MOUNT_ALT_SIZE /* 21 */ + \
- MSG_SYS_UMOUNT_ALT_SIZE /* 22 */ + \
+ MSG_SYS_22_SIZE /* 22 (unused) */ + \
MSG_SYS_SETUID_ALT_SIZE /* 23 */ + \
MSG_SYS_GETUID_ALT_SIZE /* 24 */ + \
MSG_SYS_STIME_ALT_SIZE /* 25 */ + \
@@ -1834,7 +1846,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_ALARM_ALT_SIZE /* 27 */ + \
MSG_SYS_FSTAT_ALT_SIZE /* 28 */ + \
MSG_SYS_PAUSE_ALT_SIZE /* 29 */ + \
- MSG_SYS_UTIME_ALT_SIZE /* 30 */ + \
+ MSG_SYS_30_SIZE /* 30 (unused) */ + \
MSG_SYS_STTY_ALT_SIZE /* 31 */ + \
MSG_SYS_GTTY_ALT_SIZE /* 32 */ + \
\
@@ -1847,14 +1859,14 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_FSTATFS_ALT_SIZE /* 38 */ + \
MSG_SYS_PGRPSYS_ALT_SIZE /* 39 */ + \
MSG_SYS_UUCOPYSTR_ALT_SIZE /* 40 */ + \
- MSG_SYS_DUP_ALT_SIZE /* 41 */ + \
+ MSG_SYS_41_SIZE /* 41 (unused) */ + \
MSG_SYS_PIPE_ALT_SIZE /* 42 */ + \
MSG_SYS_TIMES_ALT_SIZE /* 43 */ + \
MSG_SYS_PROFIL_ALT_SIZE /* 44 */ + \
- MSG_SYS_PLOCK_ALT_SIZE /* 45 */ + \
+ MSG_SYS_FACCESSAT_ALT_SIZE /* 45 */ + \
MSG_SYS_SETGID_ALT_SIZE /* 46 */ + \
MSG_SYS_GETGID_ALT_SIZE /* 47 */ + \
- MSG_SYS_SIGNAL_ALT_SIZE /* 48 */ + \
+ MSG_SYS_48_SIZE /* 48 (unused) */ + \
MSG_SYS_MSGSYS_ALT_SIZE /* 49 */ + \
MSG_SYS_SYSI86_ALT_SIZE /* 50 */ + \
MSG_SYS_ACCT_ALT_SIZE /* 51 */ + \
@@ -1862,7 +1874,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_SEMSYS_ALT_SIZE /* 53 */ + \
MSG_SYS_IOCTL_ALT_SIZE /* 54 */ + \
MSG_SYS_UADMIN_ALT_SIZE /* 55 */ + \
- MSG_SYS_56_SIZE /* 56 (unused) */ + \
+ MSG_SYS_FCHOWNAT_ALT_SIZE /* 56 */ + \
MSG_SYS_UTSSYS_ALT_SIZE /* 57 */ + \
MSG_SYS_FDSYNC_ALT_SIZE /* 58 */ + \
MSG_SYS_EXECVE_ALT_SIZE /* 59 */ + \
@@ -1870,21 +1882,21 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_CHROOT_ALT_SIZE /* 61 */ + \
MSG_SYS_FCNTL_ALT_SIZE /* 62 */ + \
MSG_SYS_ULIMIT_ALT_SIZE /* 63 */ + \
- MSG_SYS_64_SIZE /* 64 (reserved) */ + \
+ MSG_SYS_RENAMEAT_ALT_SIZE /* 64 */ + \
\
/* sysset_t[2] - System Calls [65 - 96] */ \
- MSG_SYS_65_SIZE /* 65 (reserved) */ + \
- MSG_SYS_66_SIZE /* 66 (reserved) */ + \
- MSG_SYS_67_SIZE /* 67 (reserved) */ + \
- MSG_SYS_68_SIZE /* 68 (reserved) */ + \
- MSG_SYS_69_SIZE /* 69 (reserved) */ + \
+ MSG_SYS_UNLINKAT_ALT_SIZE /* 65 */ + \
+ MSG_SYS_FSTATAT_ALT_SIZE /* 66 */ + \
+ MSG_SYS_FSTATAT64_ALT_SIZE /* 67 */ + \
+ MSG_SYS_OPENAT_ALT_SIZE /* 68 */ + \
+ MSG_SYS_OPENAT64_ALT_SIZE /* 69 */ + \
MSG_SYS_TASKSYS_ALT_SIZE /* 70 */ + \
MSG_SYS_ACCTCTL_ALT_SIZE /* 71 */ + \
MSG_SYS_EXACCTSYS_ALT_SIZE /* 72 */ + \
MSG_SYS_GETPAGESIZES_ALT_SIZE /* 73 */ + \
MSG_SYS_RCTLSYS_ALT_SIZE /* 74 */ + \
MSG_SYS_SIDSYS_ALT_SIZE /* 75 */ + \
- MSG_SYS_FSAT_ALT_SIZE /* 76 */ + \
+ MSG_SYS_76_SIZE /* 76 (unused) */ + \
MSG_SYS_LWP_PARK_ALT_SIZE /* 77 */ + \
MSG_SYS_SENDFILEV_ALT_SIZE /* 78 */ + \
MSG_SYS_RMDIR_ALT_SIZE /* 79 */ + \
@@ -1895,7 +1907,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_SYSFS_ALT_SIZE /* 84 */ + \
MSG_SYS_GETMSG_ALT_SIZE /* 85 */ + \
MSG_SYS_PUTMSG_ALT_SIZE /* 86 */ + \
- MSG_SYS_POLL_ALT_SIZE /* 87 */ + \
+ MSG_SYS_87_SIZE /* 87 (unused) */ + \
MSG_SYS_LSTAT_ALT_SIZE /* 88 */ + \
MSG_SYS_SYMLINK_ALT_SIZE /* 89 */ + \
MSG_SYS_READLINK_ALT_SIZE /* 90 */ + \
@@ -1911,8 +1923,8 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_SIGACTION_ALT_SIZE /* 98 */ + \
MSG_SYS_SIGPENDING_ALT_SIZE /* 99 */ + \
MSG_SYS_CONTEXT_ALT_SIZE /* 100 */ + \
- MSG_SYS_EVSYS_ALT_SIZE /* 101 */ + \
- MSG_SYS_EVTRAPRET_ALT_SIZE /* 102 */ + \
+ MSG_SYS_101_SIZE /* 101 (unused) */ + \
+ MSG_SYS_102_SIZE /* 102 (unused) */ + \
MSG_SYS_STATVFS_ALT_SIZE /* 103 */ + \
MSG_SYS_FSTATVFS_ALT_SIZE /* 104 */ + \
MSG_SYS_GETLOADAVG_ALT_SIZE /* 105 */ + \
@@ -1920,7 +1932,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_WAITID_ALT_SIZE /* 107 */ + \
MSG_SYS_SIGSENDSYS_ALT_SIZE /* 108 */ + \
MSG_SYS_HRTSYS_ALT_SIZE /* 109 */ + \
- MSG_SYS_110_SIZE /* 110 (unused) */ + \
+ MSG_SYS_UTIMESYS_ALT_SIZE /* 110 */ + \
MSG_SYS_SIGRESEND_ALT_SIZE /* 111 */ + \
MSG_SYS_PRIOCNTLSYS_ALT_SIZE /* 112 */ + \
MSG_SYS_PATHCONF_ALT_SIZE /* 113 */ + \
@@ -1933,11 +1945,11 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_FCHDIR_ALT_SIZE /* 120 */ + \
MSG_SYS_READV_ALT_SIZE /* 121 */ + \
MSG_SYS_WRITEV_ALT_SIZE /* 122 */ + \
- MSG_SYS_XSTAT_ALT_SIZE /* 123 */ + \
- MSG_SYS_LXSTAT_ALT_SIZE /* 124 */ + \
- MSG_SYS_FXSTAT_ALT_SIZE /* 125 */ + \
- MSG_SYS_XMKNOD_ALT_SIZE /* 126 */ + \
- MSG_SYS_127_SIZE /* 127 (unused) */ + \
+ MSG_SYS_123_SIZE /* 123 (unused) */ + \
+ MSG_SYS_124_SIZE /* 124 (unused) */ + \
+ MSG_SYS_125_SIZE /* 125 (unused) */ + \
+ MSG_SYS_126_SIZE /* 126 (unused) */ + \
+ MSG_SYS_MMAPOBJ_ALT_SIZE /* 127 */ + \
MSG_SYS_SETRLIMIT_ALT_SIZE /* 128 */ + \
\
/* sysset_t[4] - System Calls [129 - 160] */ \
@@ -1955,18 +1967,18 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_SHAREFS_ALT_SIZE /* 140 */ + \
MSG_SYS_SETEUID_ALT_SIZE /* 141 */ + \
MSG_SYS_FORKSYS_ALT_SIZE /* 142 */ + \
- MSG_SYS_FORK1_ALT_SIZE /* 143 */ + \
+ MSG_SYS_143_SIZE /* 143 (unused) */ + \
MSG_SYS_SIGTIMEDWAIT_ALT_SIZE /* 144 */ + \
MSG_SYS_LWP_INFO_ALT_SIZE /* 145 */ + \
MSG_SYS_YIELD_ALT_SIZE /* 146 */ + \
- MSG_SYS_LWP_SEMA_WAIT_ALT_SIZE /* 147 */ + \
+ MSG_SYS_147_SIZE /* 147 (unused) */ + \
MSG_SYS_LWP_SEMA_POST_ALT_SIZE /* 148 */ + \
MSG_SYS_LWP_SEMA_TRYWAIT_ALT_SIZE /* 149 */ + \
MSG_SYS_LWP_DETACH_ALT_SIZE /* 150 */ + \
MSG_SYS_CORECTL_ALT_SIZE /* 151 */ + \
MSG_SYS_MODCTL_ALT_SIZE /* 152 */ + \
MSG_SYS_FCHROOT_ALT_SIZE /* 153 */ + \
- MSG_SYS_UTIMES_ALT_SIZE /* 154 */ + \
+ MSG_SYS_154_SIZE /* 154 (unused) */ + \
MSG_SYS_VHANGUP_ALT_SIZE /* 155 */ + \
MSG_SYS_GETTIMEOFDAY_ALT_SIZE /* 156 */ + \
MSG_SYS_GETITIMER_ALT_SIZE /* 157 */ + \
@@ -1983,7 +1995,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_LWP_PRIVATE_ALT_SIZE /* 166 */ + \
MSG_SYS_LWP_WAIT_ALT_SIZE /* 167 */ + \
MSG_SYS_LWP_MUTEX_WAKEUP_ALT_SIZE /* 168 */ + \
- MSG_SYS_LWP_MUTEX_LOCK_ALT_SIZE /* 169 */ + \
+ MSG_SYS_169_SIZE /* 169 (unused) */ + \
MSG_SYS_LWP_COND_WAIT_ALT_SIZE /* 170 */ + \
MSG_SYS_LWP_COND_SIGNAL_ALT_SIZE /* 171 */ + \
MSG_SYS_LWP_COND_BROADCAST_ALT_SIZE /* 172 */ + \
@@ -2040,7 +2052,7 @@ conv_cnote_fltset(uint32_t *maskarr, int n_mask,
MSG_SYS_GETRLIMIT64_ALT_SIZE /* 221 */ + \
MSG_SYS_PREAD64_ALT_SIZE /* 222 */ + \
MSG_SYS_PWRITE64_ALT_SIZE /* 223 */ + \
- MSG_SYS_CREAT64_ALT_SIZE /* 224 */ + \
+ MSG_SYS_224_SIZE /* 224 (unused) */ + \
\
/* sysset_t[7] - System Calls [225 - 256] */ \
MSG_SYS_OPEN64_ALT_SIZE /* 225 */ + \
@@ -2126,16 +2138,16 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
static const Val_desc vda0[] = { /* System Calls [1 - 32] */
{ 0x00000001, MSG_SYS_EXIT_ALT },
- { 0x00000002, MSG_SYS_FORKALL_ALT },
+ { 0x00000002, MSG_SYS_2 },
{ 0x00000004, MSG_SYS_READ_ALT },
{ 0x00000008, MSG_SYS_WRITE_ALT },
{ 0x00000010, MSG_SYS_OPEN_ALT },
{ 0x00000020, MSG_SYS_CLOSE_ALT },
- { 0x00000040, MSG_SYS_WAIT_ALT },
- { 0x00000080, MSG_SYS_CREAT_ALT },
+ { 0x00000040, MSG_SYS_7 },
+ { 0x00000080, MSG_SYS_8 },
{ 0x00000100, MSG_SYS_LINK_ALT },
{ 0x00000200, MSG_SYS_UNLINK_ALT },
- { 0x00000400, MSG_SYS_EXEC_ALT },
+ { 0x00000400, MSG_SYS_11 },
{ 0x00000800, MSG_SYS_CHDIR_ALT },
{ 0x00001000, MSG_SYS_TIME_ALT },
{ 0x00002000, MSG_SYS_MKNOD_ALT },
@@ -2146,7 +2158,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00040000, MSG_SYS_LSEEK_ALT },
{ 0x00080000, MSG_SYS_GETPID_ALT },
{ 0x00100000, MSG_SYS_MOUNT_ALT },
- { 0x00200000, MSG_SYS_UMOUNT_ALT },
+ { 0x00200000, MSG_SYS_22 },
{ 0x00400000, MSG_SYS_SETUID_ALT },
{ 0x00800000, MSG_SYS_GETUID_ALT },
{ 0x01000000, MSG_SYS_STIME_ALT },
@@ -2154,7 +2166,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x04000000, MSG_SYS_ALARM_ALT },
{ 0x08000000, MSG_SYS_FSTAT_ALT },
{ 0x10000000, MSG_SYS_PAUSE_ALT },
- { 0x20000000, MSG_SYS_UTIME_ALT },
+ { 0x20000000, MSG_SYS_30 },
{ 0x40000000, MSG_SYS_STTY_ALT },
{ 0x80000000, MSG_SYS_GTTY_ALT },
{ 0, 0 }
@@ -2168,14 +2180,14 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00000020, MSG_SYS_FSTATFS_ALT },
{ 0x00000040, MSG_SYS_PGRPSYS_ALT },
{ 0x00000080, MSG_SYS_UUCOPYSTR_ALT },
- { 0x00000100, MSG_SYS_DUP_ALT },
+ { 0x00000100, MSG_SYS_41 },
{ 0x00000200, MSG_SYS_PIPE_ALT },
{ 0x00000400, MSG_SYS_TIMES_ALT },
{ 0x00000800, MSG_SYS_PROFIL_ALT },
- { 0x00001000, MSG_SYS_PLOCK_ALT },
+ { 0x00001000, MSG_SYS_FACCESSAT_ALT },
{ 0x00002000, MSG_SYS_SETGID_ALT },
{ 0x00004000, MSG_SYS_GETGID_ALT },
- { 0x00008000, MSG_SYS_SIGNAL_ALT },
+ { 0x00008000, MSG_SYS_48 },
{ 0x00010000, MSG_SYS_MSGSYS_ALT },
{ 0x00020000, MSG_SYS_SYSI86_ALT },
{ 0x00040000, MSG_SYS_ACCT_ALT },
@@ -2183,7 +2195,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00100000, MSG_SYS_SEMSYS_ALT },
{ 0x00200000, MSG_SYS_IOCTL_ALT },
{ 0x00400000, MSG_SYS_UADMIN_ALT },
- { 0x00800000, MSG_SYS_56 },
+ { 0x00800000, MSG_SYS_FCHOWNAT_ALT },
{ 0x01000000, MSG_SYS_UTSSYS_ALT },
{ 0x0200000, MSG_SYS_FDSYNC_ALT },
{ 0x04000000, MSG_SYS_EXECVE_ALT },
@@ -2191,22 +2203,22 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x10000000, MSG_SYS_CHROOT_ALT },
{ 0x20000000, MSG_SYS_FCNTL_ALT },
{ 0x40000000, MSG_SYS_ULIMIT_ALT },
- { 0x80000000, MSG_SYS_64 },
+ { 0x80000000, MSG_SYS_RENAMEAT_ALT },
{ 0, 0 }
};
static const Val_desc vda2[] = { /* System Calls [65 - 96] */
- { 0x00000001, MSG_SYS_65 },
- { 0x00000002, MSG_SYS_66 },
- { 0x00000004, MSG_SYS_67 },
- { 0x00000008, MSG_SYS_68 },
- { 0x00000010, MSG_SYS_69 },
+ { 0x00000001, MSG_SYS_UNLINKAT_ALT },
+ { 0x00000002, MSG_SYS_FSTATAT_ALT },
+ { 0x00000004, MSG_SYS_FSTATAT64_ALT },
+ { 0x00000008, MSG_SYS_OPENAT_ALT },
+ { 0x00000010, MSG_SYS_OPENAT64_ALT },
{ 0x00000020, MSG_SYS_TASKSYS_ALT },
{ 0x00000040, MSG_SYS_ACCTCTL_ALT },
{ 0x00000080, MSG_SYS_EXACCTSYS_ALT },
{ 0x00000100, MSG_SYS_GETPAGESIZES_ALT },
{ 0x00000200, MSG_SYS_RCTLSYS_ALT },
{ 0x00000400, MSG_SYS_SIDSYS_ALT },
- { 0x00000800, MSG_SYS_FSAT_ALT },
+ { 0x00000800, MSG_SYS_76 },
{ 0x00001000, MSG_SYS_LWP_PARK_ALT },
{ 0x00002000, MSG_SYS_SENDFILEV_ALT },
{ 0x00004000, MSG_SYS_RMDIR_ALT },
@@ -2217,7 +2229,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00080000, MSG_SYS_SYSFS_ALT },
{ 0x00100000, MSG_SYS_GETMSG_ALT },
{ 0x00200000, MSG_SYS_PUTMSG_ALT },
- { 0x00400000, MSG_SYS_POLL_ALT },
+ { 0x00400000, MSG_SYS_87 },
{ 0x00800000, MSG_SYS_LSTAT_ALT },
{ 0x01000000, MSG_SYS_SYMLINK_ALT },
{ 0x02000000, MSG_SYS_READLINK_ALT },
@@ -2234,8 +2246,8 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00000002, MSG_SYS_SIGACTION_ALT },
{ 0x00000004, MSG_SYS_SIGPENDING_ALT },
{ 0x00000008, MSG_SYS_CONTEXT_ALT },
- { 0x00000010, MSG_SYS_EVSYS_ALT },
- { 0x00000020, MSG_SYS_EVTRAPRET_ALT },
+ { 0x00000010, MSG_SYS_101 },
+ { 0x00000020, MSG_SYS_102 },
{ 0x00000040, MSG_SYS_STATVFS_ALT },
{ 0x00000080, MSG_SYS_FSTATVFS_ALT },
{ 0x00000100, MSG_SYS_GETLOADAVG_ALT },
@@ -2243,7 +2255,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00000400, MSG_SYS_WAITID_ALT },
{ 0x00000800, MSG_SYS_SIGSENDSYS_ALT },
{ 0x00001000, MSG_SYS_HRTSYS_ALT },
- { 0x00002000, MSG_SYS_110 },
+ { 0x00002000, MSG_SYS_UTIMESYS_ALT },
{ 0x00004000, MSG_SYS_SIGRESEND_ALT },
{ 0x00008000, MSG_SYS_PRIOCNTLSYS_ALT },
{ 0x00010000, MSG_SYS_PATHCONF_ALT },
@@ -2256,11 +2268,11 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00800000, MSG_SYS_FCHDIR_ALT },
{ 0x01000000, MSG_SYS_READV_ALT },
{ 0x02000000, MSG_SYS_WRITEV_ALT },
- { 0x04000000, MSG_SYS_XSTAT_ALT },
- { 0x08000000, MSG_SYS_LXSTAT_ALT },
- { 0x10000000, MSG_SYS_FXSTAT_ALT },
- { 0x20000000, MSG_SYS_XMKNOD_ALT },
- { 0x40000000, MSG_SYS_127 },
+ { 0x04000000, MSG_SYS_123 },
+ { 0x08000000, MSG_SYS_124 },
+ { 0x10000000, MSG_SYS_125 },
+ { 0x20000000, MSG_SYS_126 },
+ { 0x40000000, MSG_SYS_MMAPOBJ_ALT },
{ 0x80000000, MSG_SYS_SETRLIMIT_ALT },
{ 0, 0 }
};
@@ -2279,18 +2291,18 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00000800, MSG_SYS_SHAREFS_ALT },
{ 0x00001000, MSG_SYS_SETEUID_ALT },
{ 0x00002000, MSG_SYS_FORKSYS_ALT },
- { 0x00004000, MSG_SYS_FORK1_ALT },
+ { 0x00004000, MSG_SYS_143 },
{ 0x00008000, MSG_SYS_SIGTIMEDWAIT_ALT },
{ 0x00010000, MSG_SYS_LWP_INFO_ALT },
{ 0x00020000, MSG_SYS_YIELD_ALT },
- { 0x00040000, MSG_SYS_LWP_SEMA_WAIT_ALT },
+ { 0x00040000, MSG_SYS_147 },
{ 0x00080000, MSG_SYS_LWP_SEMA_POST_ALT },
{ 0x00100000, MSG_SYS_LWP_SEMA_TRYWAIT_ALT },
{ 0x00200000, MSG_SYS_LWP_DETACH_ALT },
{ 0x00400000, MSG_SYS_CORECTL_ALT },
{ 0x00800000, MSG_SYS_MODCTL_ALT },
{ 0x01000000, MSG_SYS_FCHROOT_ALT },
- { 0x02000000, MSG_SYS_UTIMES_ALT },
+ { 0x02000000, MSG_SYS_154 },
{ 0x04000000, MSG_SYS_VHANGUP_ALT },
{ 0x08000000, MSG_SYS_GETTIMEOFDAY_ALT },
{ 0x10000000, MSG_SYS_GETITIMER_ALT },
@@ -2308,7 +2320,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x00000020, MSG_SYS_LWP_PRIVATE_ALT },
{ 0x00000040, MSG_SYS_LWP_WAIT_ALT },
{ 0x00000080, MSG_SYS_LWP_MUTEX_WAKEUP_ALT },
- { 0x00000100, MSG_SYS_LWP_MUTEX_LOCK_ALT },
+ { 0x00000100, MSG_SYS_169 },
{ 0x00000200, MSG_SYS_LWP_COND_WAIT_ALT },
{ 0x00000400, MSG_SYS_LWP_COND_SIGNAL_ALT },
{ 0x00000800, MSG_SYS_LWP_COND_BROADCAST_ALT },
@@ -2366,7 +2378,7 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
{ 0x10000000, MSG_SYS_GETRLIMIT64_ALT },
{ 0x20000000, MSG_SYS_PREAD64_ALT },
{ 0x40000000, MSG_SYS_PWRITE64_ALT },
- { 0x80000000, MSG_SYS_CREAT64_ALT },
+ { 0x80000000, MSG_SYS_224 },
{ 0, 0 }
};
static const Val_desc vda7[] = { /* System Calls [225 - 256] */
diff --git a/usr/src/cmd/sgs/libconv/common/corenote.msg b/usr/src/cmd/sgs/libconv/common/corenote.msg
index 9be9eca78c..3774d5119a 100644
--- a/usr/src/cmd/sgs/libconv/common/corenote.msg
+++ b/usr/src/cmd/sgs/libconv/common/corenote.msg
@@ -20,11 +20,9 @@
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
@ MSG_NT_PRSTATUS "[ NT_PRSTATUS ]"
@ MSG_NT_PRFPREG "[ NT_PRFPREG ]"
@@ -581,8 +579,7 @@
@ MSG_SYS_EXIT "[ exit ]" # 1
@ MSG_SYS_EXIT_ALT "exit"
-@ MSG_SYS_FORKALL "[ forkall ]" # 2
-@ MSG_SYS_FORKALL_ALT "forkall"
+@ MSG_SYS_2 "2" # 2 (u)
@ MSG_SYS_READ "[ read ]" # 3
@ MSG_SYS_READ_ALT "read"
@ MSG_SYS_WRITE "[ write ]" # 4
@@ -591,16 +588,13 @@
@ MSG_SYS_OPEN_ALT "open"
@ MSG_SYS_CLOSE "[ close ]" # 6
@ MSG_SYS_CLOSE_ALT "close"
-@ MSG_SYS_WAIT "[ wait ]" # 7
-@ MSG_SYS_WAIT_ALT "wait"
-@ MSG_SYS_CREAT "[ creat ]" # 8
-@ MSG_SYS_CREAT_ALT "creat"
+@ MSG_SYS_7 "7" # 7 (u)
+@ MSG_SYS_8 "8" # 8 (u)
@ MSG_SYS_LINK "[ link ]" # 9
@ MSG_SYS_LINK_ALT "link"
@ MSG_SYS_UNLINK "[ unlink ]" # 10
@ MSG_SYS_UNLINK_ALT "unlink"
-@ MSG_SYS_EXEC "[ exec ]" # 11
-@ MSG_SYS_EXEC_ALT "exec"
+@ MSG_SYS_11 "11" # 11 (u)
@ MSG_SYS_CHDIR "[ chdir ]" # 12
@ MSG_SYS_CHDIR_ALT "chdir"
@ MSG_SYS_TIME "[ time ]" # 13
@@ -621,8 +615,7 @@
@ MSG_SYS_GETPID_ALT "getpid"
@ MSG_SYS_MOUNT "[ mount ]" # 21
@ MSG_SYS_MOUNT_ALT "mount"
-@ MSG_SYS_UMOUNT "[ umount ]" # 22
-@ MSG_SYS_UMOUNT_ALT "umount"
+@ MSG_SYS_22 "22" # 22 (u)
@ MSG_SYS_SETUID "[ setuid ]" # 23
@ MSG_SYS_SETUID_ALT "setuid"
@ MSG_SYS_GETUID "[ getuid ]" # 24
@@ -637,8 +630,7 @@
@ MSG_SYS_FSTAT_ALT "fstat"
@ MSG_SYS_PAUSE "[ pause ]" # 29
@ MSG_SYS_PAUSE_ALT "pause"
-@ MSG_SYS_UTIME "[ utime ]" # 30
-@ MSG_SYS_UTIME_ALT "utime"
+@ MSG_SYS_30 "30" # 30 (u)
@ MSG_SYS_STTY "[ stty ]" # 31
@ MSG_SYS_STTY_ALT "stty"
@ MSG_SYS_GTTY "[ gtty ]" # 32
@@ -659,22 +651,20 @@
@ MSG_SYS_PGRPSYS_ALT "pgrpsys"
@ MSG_SYS_UUCOPYSTR "[ uucopystr ]" # 40
@ MSG_SYS_UUCOPYSTR_ALT "uucopystr"
-@ MSG_SYS_DUP "[ dup ]" # 41
-@ MSG_SYS_DUP_ALT "dup"
+@ MSG_SYS_41 "41" # 41 (u)
@ MSG_SYS_PIPE "[ pipe ]" # 42
@ MSG_SYS_PIPE_ALT "pipe"
@ MSG_SYS_TIMES "[ times ]" # 43
@ MSG_SYS_TIMES_ALT "times"
@ MSG_SYS_PROFIL "[ profil ]" # 44
@ MSG_SYS_PROFIL_ALT "profil"
-@ MSG_SYS_PLOCK "[ plock ]" # 45
-@ MSG_SYS_PLOCK_ALT "plock"
+@ MSG_SYS_FACCESSAT "[ faccessat ]" # 45
+@ MSG_SYS_FACCESSAT_ALT "faccessat"
@ MSG_SYS_SETGID "[ setgid ]" # 46
@ MSG_SYS_SETGID_ALT "setgid"
@ MSG_SYS_GETGID "[ getgid ]" # 47
@ MSG_SYS_GETGID_ALT "getgid"
-@ MSG_SYS_SIGNAL "[ signal ]" # 48
-@ MSG_SYS_SIGNAL_ALT "signal"
+@ MSG_SYS_48 "48" # 48 (u)
@ MSG_SYS_MSGSYS "[ msgsys ]" # 49
@ MSG_SYS_MSGSYS_ALT "msgsys"
@ MSG_SYS_SYSI86 "[ sysi86 ]" # 50
@@ -689,7 +679,8 @@
@ MSG_SYS_IOCTL_ALT "ioctl"
@ MSG_SYS_UADMIN "[ uadmin ]" # 55
@ MSG_SYS_UADMIN_ALT "uadmin"
-@ MSG_SYS_56 "56" # 56 (u)
+@ MSG_SYS_FCHOWNAT "[ fchownat ]" # 56
+@ MSG_SYS_FCHOWNAT_ALT "fchownat"
@ MSG_SYS_UTSSYS "[ utssys ]" # 57
@ MSG_SYS_UTSSYS_ALT "utssys"
@ MSG_SYS_FDSYNC "[ fdsync ]" # 58
@@ -704,12 +695,18 @@
@ MSG_SYS_FCNTL_ALT "fcntl"
@ MSG_SYS_ULIMIT "[ ulimit ]" # 63
@ MSG_SYS_ULIMIT_ALT "ulimit"
-@ MSG_SYS_64 "64" # 64 (r)
-@ MSG_SYS_65 "65" # 65 (r)
-@ MSG_SYS_66 "66" # 66 (r)
-@ MSG_SYS_67 "67" # 67 (r)
-@ MSG_SYS_68 "68" # 68 (r)
-@ MSG_SYS_69 "69" # 69 (r)
+@ MSG_SYS_RENAMEAT "[ renameat ]" # 64
+@ MSG_SYS_RENAMEAT_ALT "renameat"
+@ MSG_SYS_UNLINKAT "[ unlinkat ]" # 65
+@ MSG_SYS_UNLINKAT_ALT "unlinkat"
+@ MSG_SYS_FSTATAT "[ fstatat ]" # 66
+@ MSG_SYS_FSTATAT_ALT "fstatat"
+@ MSG_SYS_FSTATAT64 "[ fstatat64 ]" # 67
+@ MSG_SYS_FSTATAT64_ALT "fstatat64"
+@ MSG_SYS_OPENAT "[ openat ]" # 68
+@ MSG_SYS_OPENAT_ALT "openat"
+@ MSG_SYS_OPENAT64 "[ openat64 ]" # 69
+@ MSG_SYS_OPENAT64_ALT "openat64"
@ MSG_SYS_TASKSYS "[ tasksys ]" # 70
@ MSG_SYS_TASKSYS_ALT "tasksys "
@ MSG_SYS_ACCTCTL "[ acctctl ]" # 71
@@ -722,8 +719,7 @@
@ MSG_SYS_RCTLSYS_ALT "rctlsys "
@ MSG_SYS_SIDSYS "[ sidsys ]" # 75
@ MSG_SYS_SIDSYS_ALT "sidsys"
-@ MSG_SYS_FSAT "[ fsat ]" # 76
-@ MSG_SYS_FSAT_ALT "fsat"
+@ MSG_SYS_76 "76" # 76 (u)
@ MSG_SYS_LWP_PARK "[ lwp_park ]" # 77
@ MSG_SYS_LWP_PARK_ALT "lwp_park"
@ MSG_SYS_SENDFILEV "[ sendfilev ]" # 78
@@ -744,8 +740,7 @@
@ MSG_SYS_GETMSG_ALT "getmsg"
@ MSG_SYS_PUTMSG "[ putmsg ]" # 86
@ MSG_SYS_PUTMSG_ALT "putmsg"
-@ MSG_SYS_POLL "[ poll ]" # 87
-@ MSG_SYS_POLL_ALT "poll"
+@ MSG_SYS_87 "87" # 87 (u)
@ MSG_SYS_LSTAT "[ lstat ]" # 88
@ MSG_SYS_LSTAT_ALT "lstat"
@ MSG_SYS_SYMLINK "[ symlink ]" # 89
@@ -772,10 +767,8 @@
@ MSG_SYS_SIGPENDING_ALT "sigpending"
@ MSG_SYS_CONTEXT "[ context ]" # 100
@ MSG_SYS_CONTEXT_ALT "context"
-@ MSG_SYS_EVSYS "[ evsys ]" # 101
-@ MSG_SYS_EVSYS_ALT "evsys"
-@ MSG_SYS_EVTRAPRET "[ evtrapret ]" # 102
-@ MSG_SYS_EVTRAPRET_ALT "evtrapret"
+@ MSG_SYS_101 "101" # 101(u)
+@ MSG_SYS_102 "102" # 102(u)
@ MSG_SYS_STATVFS "[ statvfs ]" # 103
@ MSG_SYS_STATVFS_ALT "statvfs"
@ MSG_SYS_FSTATVFS "[ fstatvfs ]" # 104
@@ -790,7 +783,8 @@
@ MSG_SYS_SIGSENDSYS_ALT "sigsendsys"
@ MSG_SYS_HRTSYS "[ hrtsys ]" # 109
@ MSG_SYS_HRTSYS_ALT "hrtsys"
-@ MSG_SYS_110 "110" # 110(u)
+@ MSG_SYS_UTIMESYS "[ utimesys ]" # 110
+@ MSG_SYS_UTIMESYS_ALT "utimesys"
@ MSG_SYS_SIGRESEND "[ sigresend ]" # 111
@ MSG_SYS_SIGRESEND_ALT "sigresend"
@ MSG_SYS_PRIOCNTLSYS "[ priocntlsys ]" # 112
@@ -815,15 +809,12 @@
@ MSG_SYS_READV_ALT "readv"
@ MSG_SYS_WRITEV "[ writev ]" # 122
@ MSG_SYS_WRITEV_ALT "writev"
-@ MSG_SYS_XSTAT "[ xstat ]" # 123
-@ MSG_SYS_XSTAT_ALT "xstat"
-@ MSG_SYS_LXSTAT "[ lxstat ]" # 124
-@ MSG_SYS_LXSTAT_ALT "lxstat"
-@ MSG_SYS_FXSTAT "[ fxstat ]" # 125
-@ MSG_SYS_FXSTAT_ALT "fxstat"
-@ MSG_SYS_XMKNOD "[ xmknod ]" # 126
-@ MSG_SYS_XMKNOD_ALT "xmknod"
-@ MSG_SYS_127 "127" # 127(u)
+@ MSG_SYS_123 "123" # 123(u)
+@ MSG_SYS_124 "124" # 124(u)
+@ MSG_SYS_125 "125" # 125(u)
+@ MSG_SYS_126 "126" # 126(u)
+@ MSG_SYS_MMAPOBJ "[ mmapobj ]" # 127
+@ MSG_SYS_MMAPOBJ_ALT "mmapobj"
@ MSG_SYS_SETRLIMIT "[ setrlimit ]" # 128
@ MSG_SYS_SETRLIMIT_ALT "setrlimit"
@ MSG_SYS_GETRLIMIT "[ getrlimit ]" # 129
@@ -854,16 +845,14 @@
@ MSG_SYS_SETEUID_ALT "seteuid"
@ MSG_SYS_FORKSYS "[ forksys ]" # 142
@ MSG_SYS_FORKSYS_ALT "forksys"
-@ MSG_SYS_FORK1 "[ fork1 ]" # 143
-@ MSG_SYS_FORK1_ALT "fork1"
+@ MSG_SYS_143 "143" # 143(u)
@ MSG_SYS_SIGTIMEDWAIT "[ sigtimedwait ]" # 144
@ MSG_SYS_SIGTIMEDWAIT_ALT "sigtimedwait"
@ MSG_SYS_LWP_INFO "[ lwp_info ]" # 145
@ MSG_SYS_LWP_INFO_ALT "lwp_info"
@ MSG_SYS_YIELD "[ yield ]" # 146
@ MSG_SYS_YIELD_ALT "yield"
-@ MSG_SYS_LWP_SEMA_WAIT "[ lwp_sema_wait ]" # 147
-@ MSG_SYS_LWP_SEMA_WAIT_ALT "lwp_sema_wait"
+@ MSG_SYS_147 "147" # 147(u)
@ MSG_SYS_LWP_SEMA_POST "[ lwp_sema_post ]" # 148
@ MSG_SYS_LWP_SEMA_POST_ALT "lwp_sema_post"
@ MSG_SYS_LWP_SEMA_TRYWAIT "[ lwp_sema_trywait ]" # 149
@@ -876,8 +865,7 @@
@ MSG_SYS_MODCTL_ALT "modctl"
@ MSG_SYS_FCHROOT "[ fchroot ]" # 153
@ MSG_SYS_FCHROOT_ALT "fchroot"
-@ MSG_SYS_UTIMES "[ utimes ]" # 154
-@ MSG_SYS_UTIMES_ALT "utimes"
+@ MSG_SYS_154 "154" # 154(u)
@ MSG_SYS_VHANGUP "[ vhangup ]" # 155
@ MSG_SYS_VHANGUP_ALT "vhangup"
@ MSG_SYS_GETTIMEOFDAY "[ gettimeofday ]" # 156
@@ -906,8 +894,7 @@
@ MSG_SYS_LWP_WAIT_ALT "lwp_wait"
@ MSG_SYS_LWP_MUTEX_WAKEUP "[ lwp_mutex_wakeup ]" # 168
@ MSG_SYS_LWP_MUTEX_WAKEUP_ALT "lwp_mutex_wakeup"
-@ MSG_SYS_LWP_MUTEX_LOCK "[ lwp_mutex_lock ]" # 169
-@ MSG_SYS_LWP_MUTEX_LOCK_ALT "lwp_mutex_lock"
+@ MSG_SYS_169 "169" # 169(u)
@ MSG_SYS_LWP_COND_WAIT "[ lwp_cond_wait ]" # 170
@ MSG_SYS_LWP_COND_WAIT_ALT "lwp_cond_wait"
@ MSG_SYS_LWP_COND_SIGNAL "[ lwp_cond_signal ]" # 171
@@ -1016,8 +1003,7 @@
@ MSG_SYS_PREAD64_ALT "pread64"
@ MSG_SYS_PWRITE64 "[ pwrite64 ]" # 223
@ MSG_SYS_PWRITE64_ALT "pwrite64"
-@ MSG_SYS_CREAT64 "[ creat64 ]" # 224
-@ MSG_SYS_CREAT64_ALT "creat64"
+@ MSG_SYS_224 "224" # 224(u)
@ MSG_SYS_OPEN64 "[ open64 ]" # 225
@ MSG_SYS_OPEN64_ALT "open64"
@ MSG_SYS_RPCSYS "[ rpcsys ]" # 226
diff --git a/usr/src/cmd/sgs/librtld_db/rdb_demo/common/main.c b/usr/src/cmd/sgs/librtld_db/rdb_demo/common/main.c
index 6bd77b0434..b63ef6da0e 100644
--- a/usr/src/cmd/sgs/librtld_db/rdb_demo/common/main.c
+++ b/usr/src/cmd/sgs/librtld_db/rdb_demo/common/main.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -117,7 +117,6 @@ init_proc()
*/
oper = PCSEXIT;
premptyset(&sysset);
- praddset(&sysset, SYS_exec);
praddset(&sysset, SYS_execve);
if (writev(pfd, piov, 2) == -1)
perr("PCSEXIT");
@@ -233,8 +232,7 @@ main(int argc, char *argv[])
* Make sure that it stopped where we expected.
*/
while ((pstatus.pr_lwp.pr_why == PR_SYSEXIT) &&
- ((pstatus.pr_lwp.pr_what == SYS_exec) ||
- (pstatus.pr_lwp.pr_what == SYS_execve))) {
+ (pstatus.pr_lwp.pr_what == SYS_execve)) {
long pflags = 0;
if (!(pstatus.pr_lwp.pr_reg[R_PS] & ERRBIT)) {
/* successfull exec(2) */
@@ -266,8 +264,7 @@ main(int argc, char *argv[])
* Did we stop where we expected ?
*/
if ((pstatus.pr_lwp.pr_why != PR_SYSEXIT) ||
- ((pstatus.pr_lwp.pr_what != SYS_exec) &&
- (pstatus.pr_lwp.pr_what != SYS_execve))) {
+ (pstatus.pr_lwp.pr_what != SYS_execve)) {
long pflags = 0;
(void) fprintf(stderr, "Didn't catch the exec, why: %d "
diff --git a/usr/src/cmd/sgs/rtld.4.x/ld.so b/usr/src/cmd/sgs/rtld.4.x/ld.so
index 0b7c52675e..256acfb125 100644
--- a/usr/src/cmd/sgs/rtld.4.x/ld.so
+++ b/usr/src/cmd/sgs/rtld.4.x/ld.so
Binary files differ
diff --git a/usr/src/cmd/sgs/rtld.4.x/rtldlib.s b/usr/src/cmd/sgs/rtld.4.x/rtldlib.s
index 76b2ca1827..dcaf82ac45 100644
--- a/usr/src/cmd/sgs/rtld.4.x/rtldlib.s
+++ b/usr/src/cmd/sgs/rtld.4.x/rtldlib.s
@@ -1,14 +1,8 @@
-! #ident "%Z%%M% %I% %E% SMI"
-!
-! Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-! Use is subject to license terms.
-!
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
-! Common Development and Distribution License, Version 1.0 only
-! (the "License"). You may not use this file except in compliance
-! with the License.
+! Common Development and Distribution License (the "License").
+! You may not use this file except in compliance with the License.
!
! You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
! or http://www.opensolaris.org/os/licensing.
@@ -23,7 +17,9 @@
!
! CDDL HEADER END
!
-
+! Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+! Use is subject to license terms.
+!
! SPARC support routines for 4.x compatibility dynamic linker.
#include <sys/asm_linkage.h> ! N.B.: although this is the 4.x
@@ -31,6 +27,8 @@
! runs only on the SVR4 base, and
! is compiled in an SVR4 .h environment
+#define AT_FDCWD 0xffd19553
+
! ld.so bootstrap. Called from crt0 of a dynamically linked program with:
! %i0: version number (always 1)
! %i1: address of crt0 structure, which contains:
@@ -86,9 +84,14 @@ _aout_reloc_write:
.global _open, _mmap, _munmap, _read, _write, _lseek, _close
.global _fstat, _sysconfig, __exit
-_open:
+_open: ! open(path, oflags, mode) =>
+ mov %o2, %o3 ! openat(AT_FDCWD, path, oflag, mode)
+ mov %o1, %o2
+ mov %o0, %o1
+ sethi %hi(AT_FDCWD), %o0
+ or %o0, %lo(AT_FDCWD), %o0
ba __syscall
- mov SYS_open, %g1
+ mov SYS_openat, %g1
_mmap:
sethi %hi(0x80000000), %g1 ! MAP_NEW
@@ -116,9 +119,12 @@ _close:
ba __syscall
mov SYS_close, %g1
-_fstat:
+_fstat: ! fstat(fd, statb) =>
+ mov %g0, %o3 ! fstatat(fd, NULL, statb, 0)
+ mov %o1, %o2
+ mov %g0, %o1
ba __syscall
- mov SYS_fstat, %g1
+ mov SYS_fstatat, %g1
_sysconfig:
ba __syscall
diff --git a/usr/src/cmd/sgs/rtld/common/external.c b/usr/src/cmd/sgs/rtld/common/external.c
index 713a9d5be5..62c2fce8bd 100644
--- a/usr/src/cmd/sgs/rtld/common/external.c
+++ b/usr/src/cmd/sgs/rtld/common/external.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -617,7 +617,7 @@ fcntl(int fildes, int cmd, ...)
int
open(const char *path, int oflag, ...)
{
- extern int __open(const char *, int, ...);
+ extern int __open(const char *, int, mode_t);
mode_t mode;
va_list ap;
@@ -630,7 +630,7 @@ open(const char *path, int oflag, ...)
int
openat(int fd, const char *path, int oflag, ...)
{
- extern int __openat(int, const char *, int, ...);
+ extern int __openat(int, const char *, int, mode_t);
mode_t mode;
va_list ap;
diff --git a/usr/src/cmd/truss/Makefile.com b/usr/src/cmd/truss/Makefile.com
index 4e6ca276a7..8158f591ab 100644
--- a/usr/src/cmd/truss/Makefile.com
+++ b/usr/src/cmd/truss/Makefile.com
@@ -19,18 +19,16 @@
# CDDL HEADER END
#
#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# cmd/truss/Makefile.com
#
PROG= truss
OBJS= main.o listopts.o ipc.o actions.o expound.o codes.o print.o \
- ramdata.o systable.o procset.o xstat.o fcall.o htbl.o
+ ramdata.o systable.o procset.o stat.o fcall.o htbl.o
SRCS= $(OBJS:%.o=../%.c)
diff --git a/usr/src/cmd/truss/actions.c b/usr/src/cmd/truss/actions.c
index 13d443ca03..e04db7bdb5 100644
--- a/usr/src/cmd/truss/actions.c
+++ b/usr/src/cmd/truss/actions.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -388,9 +388,13 @@ sysentry(private_t *pri, int dotrace)
nargs = stp->nargs;
pri->sys_nargs = nargs;
- /* fetch and remember first argument if it's a string */
+ /*
+ * Fetch and remember first argument if it's a string,
+ * or second argument if SYS_openat or SYS_openat64.
+ */
pri->sys_valid = FALSE;
- if (nargs > 0 && stp->arg[0] == STG) {
+ if ((nargs > 0 && stp->arg[0] == STG) ||
+ (nargs > 1 && (what == SYS_openat || what == SYS_openat64))) {
long offset;
uint32_t offset32;
@@ -399,9 +403,7 @@ sysentry(private_t *pri, int dotrace)
* The address in pri->sys_args[0] refers to the old process
* image. We must fetch the string from the new image.
*/
- if (Lsp->pr_why == PR_SYSEXIT &&
- (Lsp->pr_what == SYS_execve ||
- Lsp->pr_what == SYS_exec)) {
+ if (Lsp->pr_why == PR_SYSEXIT && what == SYS_execve) {
psinfo_t psinfo;
long argv;
auxv_t auxv[32];
@@ -428,8 +430,10 @@ sysentry(private_t *pri, int dotrace)
offset = offset32;
}
}
- } else {
+ } else if (stp->arg[0] == STG) {
offset = pri->sys_args[0];
+ } else {
+ offset = pri->sys_args[1];
}
if ((s = fetchstring(pri, offset, PATH_MAX)) != NULL) {
pri->sys_valid = TRUE;
@@ -475,8 +479,10 @@ sysentry(private_t *pri, int dotrace)
arg = pri->sys_args[i];
x = stp->arg[i];
- if (x == STG && !raw &&
- i == 0 && pri->sys_valid) { /* already fetched */
+ if (!raw && pri->sys_valid &&
+ ((i == 0 && x == STG) ||
+ (i == 1 && (what == SYS_openat ||
+ what == SYS_openat64)))) { /* already fetched */
escape_string(pri, pri->sys_path);
argprinted = TRUE;
} else if (x != HID || raw) {
@@ -541,12 +547,10 @@ sysexit(private_t *pri, int dotrace)
switch (what) {
case SYS_exit: /* these are traced on entry */
case SYS_lwp_exit:
- case SYS_evtrapret:
case SYS_context:
istraced = dotrace && prismember(&trace, what);
break;
- case SYS_exec: /* these are normally traced on entry */
- case SYS_execve:
+ case SYS_execve: /* this is normally traced on entry */
istraced = dotrace && prismember(&trace, what);
if (pri->exec_string && *pri->exec_string) {
if (!cflag && istraced) { /* print exec() string now */
@@ -562,7 +566,8 @@ sysexit(private_t *pri, int dotrace)
/* FALLTHROUGH */
default:
/* we called sysentry() in main() for these */
- if (what == SYS_open || what == SYS_open64)
+ if (what == SYS_openat || what == SYS_openat64 ||
+ what == SYS_open || what == SYS_open64)
istraced = dotrace && prismember(&trace, what);
else
istraced = sysentry(pri, dotrace) && dotrace;
@@ -587,7 +592,8 @@ sysexit(private_t *pri, int dotrace)
if (what == SYS_forksys && subcode >= 3)
scp += subcode - 3;
else if (subcode != -1 &&
- (what != SYS_open && what != SYS_open64 &&
+ (what != SYS_openat && what != SYS_openat64 &&
+ what != SYS_open && what != SYS_open64 &&
what != SYS_lwp_create))
scp += subcode;
scp->count++;
@@ -601,10 +607,7 @@ sysexit(private_t *pri, int dotrace)
raw = prismember(&rawout, what);
if (!cflag && istraced) {
- if ((what == SYS_forkall ||
- what == SYS_vfork ||
- what == SYS_fork1 ||
- what == SYS_forksys) &&
+ if ((what == SYS_vfork || what == SYS_forksys) &&
pri->Errno == 0 && pri->Rval2 != 0) {
pri->length &= ~07;
if (strlen(sysname(pri, what, raw? -1 : subcode)) < 6) {
@@ -620,8 +623,7 @@ sysexit(private_t *pri, int dotrace)
pri->length +=
7 + printf("\t(returning as new lwp ...)");
}
- if (pri->Errno != 0 ||
- (what != SYS_exec && what != SYS_execve)) {
+ if (pri->Errno != 0 || what != SYS_execve) {
/* prepare to print the return code */
pri->length >>= 3;
if (pri->length >= 6)
@@ -670,7 +672,7 @@ sysexit(private_t *pri, int dotrace)
}
} else {
/* show arguments on successful exec */
- if (what == SYS_exec || what == SYS_execve) {
+ if (what == SYS_execve) {
if (!cflag && istraced)
showargs(pri, raw);
} else if (!cflag && istraced) {
@@ -818,10 +820,7 @@ sysexit(private_t *pri, int dotrace)
(void) fputc('\n', stdout);
}
- if (what == SYS_forkall ||
- what == SYS_vfork ||
- what == SYS_fork1 ||
- what == SYS_forksys) {
+ if (what == SYS_vfork || what == SYS_forksys) {
if (pri->Rval2 == 0) /* child was created */
pri->child = pri->Rval1;
else if (cflag && istraced) /* this is the child */
@@ -843,7 +842,7 @@ sysexit(private_t *pri, int dotrace)
int fdp1 = (int)pri->sys_args[0] + 1; /* filedescriptor + 1 */
if (raw) {
- if (what != SYS_exec && what != SYS_execve)
+ if (what != SYS_execve)
showpaths(pri, stp);
if (ISREAD(what) || ISWRITE(what)) {
if (pri->iob_buf[0] != '\0')
@@ -897,10 +896,14 @@ sysexit(private_t *pri, int dotrace)
void
showpaths(private_t *pri, const struct systable *stp)
{
+ int what = pri->lwpstat->pr_what;
int i;
for (i = 0; i < pri->sys_nargs; i++) {
- if ((stp->arg[i] == STG) ||
+ if (stp->arg[i] == ATC && (int)pri->sys_args[i] == AT_FDCWD) {
+ (void) printf("%s 0x%.8X: AT_FDCWD\n",
+ pri->pname, AT_FDCWD);
+ } else if ((stp->arg[i] == STG) ||
(stp->arg[i] == RST && !pri->Errno) ||
(stp->arg[i] == RLK && !pri->Errno && pri->Rval1 > 0)) {
long addr = pri->sys_args[i];
@@ -908,7 +911,10 @@ showpaths(private_t *pri, const struct systable *stp)
(stp->arg[i] == RLK)? (int)pri->Rval1 : PATH_MAX;
char *s;
- if (i == 0 && pri->sys_valid) /* already fetched */
+ if (pri->sys_valid &&
+ ((i == 0 && stp->arg[0] == STG) ||
+ (i == 1 && (what == SYS_openat ||
+ what == SYS_openat64)))) /* already fetched */
s = pri->sys_path;
else
s = fetchstring(pri, addr,
@@ -965,7 +971,7 @@ showargs(private_t *pri, int raw)
(void) printf(" argc = %d\n", nargs);
if (raw)
- showpaths(pri, &systable[SYS_exec]);
+ showpaths(pri, &systable[SYS_execve]);
show_cred(pri, FALSE);
diff --git a/usr/src/cmd/truss/codes.c b/usr/src/cmd/truss/codes.c
index 68d78f826e..09ea03b92f 100644
--- a/usr/src/cmd/truss/codes.c
+++ b/usr/src/cmd/truss/codes.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -59,7 +59,6 @@
#include <sys/termio.h>
#include <sys/stermio.h>
#include <sys/ttold.h>
-#include <sys/lock.h>
#include <sys/mount.h>
#include <sys/utssys.h>
#include <sys/sysconfig.h>
@@ -164,16 +163,6 @@ const char *const SYSFSname[] = {
"GETNFSTYP"
};
-#define PLOCKMIN UNLOCK
-#define PLOCKMAX DATLOCK
-const char *const PLOCKname[] = {
- "UNLOCK",
- "PROCLOCK",
- "TXTLOCK",
- NULL,
- "DATLOCK"
-};
-
#define SCONFMIN _CONFIG_NGROUPS
#define SCONFMAX _CONFIG_EPHID_MAX
const char *const SCONFname[] = {
@@ -1727,16 +1716,6 @@ sfsname(int code)
return (str);
}
-const char *
-plockname(int code)
-{
- const char *str = NULL;
-
- if (code >= PLOCKMIN && code <= PLOCKMAX)
- str = PLOCKname[code-PLOCKMIN];
- return (str);
-}
-
/* ARGSUSED */
const char *
si86name(int code)
@@ -1909,7 +1888,8 @@ pathconfname(int code)
#define ALL_O_FLAGS \
(O_NDELAY|O_APPEND|O_SYNC|O_DSYNC|O_NONBLOCK|O_CREAT|O_TRUNC\
- |O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS)
+ |O_EXCL|O_NOCTTY|O_LARGEFILE|O_RSYNC|O_XATTR|O_NOFOLLOW|O_NOLINKS\
+ |FXATTRDIROPEN)
const char *
openarg(private_t *pri, int arg)
@@ -1958,6 +1938,8 @@ openarg(private_t *pri, int arg)
(void) strlcat(str, "|O_NOFOLLOW", sizeof (pri->code_buf));
if (arg & O_NOLINKS)
(void) strlcat(str, "|O_NOLINKS", sizeof (pri->code_buf));
+ if (arg & FXATTRDIROPEN)
+ (void) strlcat(str, "|FXATTRDIROPEN", sizeof (pri->code_buf));
return ((const char *)str);
}
diff --git a/usr/src/cmd/truss/expound.c b/usr/src/cmd/truss/expound.c
index b0245d4458..d78cbecad5 100644
--- a/usr/src/cmd/truss/expound.c
+++ b/usr/src/cmd/truss/expound.c
@@ -52,7 +52,6 @@
#include <sys/shm.h>
#include <sys/shm_impl.h>
#include <sys/dirent.h>
-#include <sys/utime.h>
#include <ustat.h>
#include <fcntl.h>
#include <time.h>
@@ -148,69 +147,6 @@ prtimestruc(private_t *pri, const char *name, timestruc_t *value)
}
static void
-show_utime(private_t *pri)
-{
- long offset;
- struct utimbuf utimbuf;
-
- if (pri->sys_nargs < 2 || (offset = pri->sys_args[1]) == NULL)
- return;
-
- if (data_model == PR_MODEL_NATIVE) {
- if (Pread(Proc, &utimbuf, sizeof (utimbuf), offset)
- != sizeof (utimbuf))
- return;
- } else {
- struct utimbuf32 utimbuf32;
-
- if (Pread(Proc, &utimbuf32, sizeof (utimbuf32), offset)
- != sizeof (utimbuf32))
- return;
-
- utimbuf.actime = (time_t)utimbuf32.actime;
- utimbuf.modtime = (time_t)utimbuf32.modtime;
- }
-
- /* print access and modification times */
- prtime(pri, "at = ", utimbuf.actime);
- prtime(pri, "mt = ", utimbuf.modtime);
-}
-
-static void
-show_utimes(private_t *pri, long offset)
-{
- struct {
- struct timeval atime;
- struct timeval mtime;
- } utimbuf;
-
- if (offset == 0)
- return;
-
- if (data_model == PR_MODEL_NATIVE) {
- if (Pread(Proc, &utimbuf, sizeof (utimbuf), offset)
- != sizeof (utimbuf))
- return;
- } else {
- struct {
- struct timeval32 atime;
- struct timeval32 mtime;
- } utimbuf32;
-
- if (Pread(Proc, &utimbuf32, sizeof (utimbuf32), offset)
- != sizeof (utimbuf32))
- return;
-
- TIMEVAL32_TO_TIMEVAL(&utimbuf.atime, &utimbuf32.atime);
- TIMEVAL32_TO_TIMEVAL(&utimbuf.mtime, &utimbuf32.mtime);
- }
-
- /* print access and modification times */
- prtimeval(pri, "at = ", &utimbuf.atime);
- prtimeval(pri, "mt = ", &utimbuf.mtime);
-}
-
-static void
show_utimens(private_t *pri, long offset)
{
struct {
@@ -2143,30 +2079,6 @@ show_all_pollfds(private_t *pri, long offset, int nfds)
}
void
-show_poll(private_t *pri)
-{
- long offset;
- int nfds;
- int serial = 0;
-
- if (pri->sys_nargs < 2 || (offset = pri->sys_args[0]) == NULL ||
- (nfds = pri->sys_args[1]) <= 0)
- return;
-
- /* enter region of lengthy output */
- if (nfds > 32) {
- Eserialize();
- serial = 1;
- }
-
- show_all_pollfds(pri, offset, nfds);
-
- /* exit region of lengthy output */
- if (serial)
- Xserialize();
-}
-
-void
show_pollsys(private_t *pri)
{
long offset;
@@ -4829,12 +4741,6 @@ expound(private_t *pri, long r0, int raw)
what = Lsp->pr_syscall;
switch (what) {
- case SYS_utime:
- show_utime(pri);
- break;
- case SYS_utimes:
- show_utimes(pri, (long)pri->sys_args[1]);
- break;
case SYS_gettimeofday:
if (!err)
show_timeofday(pri);
@@ -4876,6 +4782,14 @@ expound(private_t *pri, long r0, int raw)
show_ioctl(pri, pri->sys_args[1],
(long)pri->sys_args[2]);
break;
+ case SYS_fstatat:
+ if (!err && pri->sys_nargs >= 3)
+ show_stat(pri, (long)pri->sys_args[2]);
+ break;
+ case SYS_fstatat64:
+ if (!err && pri->sys_nargs >= 3)
+ show_stat64_32(pri, (long)pri->sys_args[2]);
+ break;
case SYS_stat:
case SYS_fstat:
case SYS_lstat:
@@ -4888,26 +4802,6 @@ expound(private_t *pri, long r0, int raw)
if (!err && pri->sys_nargs >= 2)
show_stat64_32(pri, (long)pri->sys_args[1]);
break;
- case SYS_fsat:
- /*
- * subcodes for fstatat(), fstatat64(), futimesat().
- */
- if (!err && pri->sys_nargs >= 4) {
- if (pri->sys_args[0] == 3)
- show_statat(pri, (long)pri->sys_args[3]);
- else if (pri->sys_args[0] == 2)
- show_stat64_32(pri, (long)pri->sys_args[3]);
- else if (pri->sys_args[0] == 6)
- show_utimes(pri, (long)pri->sys_args[3]);
- }
- break;
- case SYS_xstat:
- case SYS_fxstat:
- case SYS_lxstat:
- if (!err && pri->sys_nargs >= 3)
- show_xstat(pri, (int)pri->sys_args[0],
- (long)pri->sys_args[2]);
- break;
case SYS_statvfs:
case SYS_fstatvfs:
if (err)
@@ -4985,9 +4879,6 @@ expound(private_t *pri, long r0, int raw)
case SYS_putpmsg:
show_gp_msg(pri, what);
break;
- case SYS_poll:
- show_poll(pri);
- break;
case SYS_pollsys:
show_pollsys(pri);
break;
@@ -5120,7 +5011,6 @@ expound(private_t *pri, long r0, int raw)
show_int(pri, (long)pri->sys_args[1], "lwpid");
break;
case SYS_lwp_mutex_wakeup:
- case SYS_lwp_mutex_lock:
case SYS_lwp_mutex_unlock:
case SYS_lwp_mutex_trylock:
case SYS_lwp_mutex_register:
@@ -5146,7 +5036,6 @@ expound(private_t *pri, long r0, int raw)
if (pri->sys_nargs > 0)
show_condvar(pri, (long)pri->sys_args[0]);
break;
- case SYS_lwp_sema_wait:
case SYS_lwp_sema_trywait:
case SYS_lwp_sema_post:
if (pri->sys_nargs > 0)
diff --git a/usr/src/cmd/truss/ipc.c b/usr/src/cmd/truss/ipc.c
index af3488d28e..2bb34656a7 100644
--- a/usr/src/cmd/truss/ipc.c
+++ b/usr/src/cmd/truss/ipc.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,17 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -259,7 +256,7 @@ checkproc(private_t *pri)
const pstatus_t *Psp = Pstatus(Proc);
struct ps_lwphandle *Lwp = pri->Lwp;
const lwpstatus_t *Lsp = pri->lwpstat;
- int what = Lsp->pr_what; /* SYS_open or SYS_open64 */
+ int what = Lsp->pr_what; /* one of the SYS_open* syscalls */
int err = Lsp->pr_errno;
int pid;
int i;
diff --git a/usr/src/cmd/truss/listopts.c b/usr/src/cmd/truss/listopts.c
index e7b0250a5e..0d32d15561 100644
--- a/usr/src/cmd/truss/listopts.c
+++ b/usr/src/cmd/truss/listopts.c
@@ -20,15 +20,13 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -118,28 +116,34 @@ syslist(char *str, /* string of syscall names */
}
if (sys > 0 && sys <= PRMAXSYS) {
switch (sys) {
- case SYS_xstat: /* set all if any */
- case SYS_stat:
+ case SYS_fstatat: /* set both if either */
+ case SYS_fstatat64:
+ sys = SYS_fstatat;
+ sys64 = SYS_fstatat64;
+ goto def;
+
+ case SYS_stat: /* set all if either */
case SYS_stat64:
sys = SYS_stat;
- sysx = SYS_xstat;
sys64 = SYS_stat64;
+ sysx = SYS_fstatat;
+ sysxx = SYS_fstatat64;
goto def;
- case SYS_lxstat: /* set all if any */
- case SYS_lstat:
+ case SYS_lstat: /* set all if either */
case SYS_lstat64:
sys = SYS_lstat;
- sysx = SYS_lxstat;
sys64 = SYS_lstat64;
+ sysx = SYS_fstatat;
+ sysxx = SYS_fstatat64;
goto def;
- case SYS_fxstat: /* set all if any */
- case SYS_fstat:
+ case SYS_fstat: /* set all if either */
case SYS_fstat64:
sys = SYS_fstat;
- sysx = SYS_fxstat;
sys64 = SYS_fstat64;
+ sysx = SYS_fstatat;
+ sysxx = SYS_fstatat64;
goto def;
case SYS_getdents: /* set both if either */
@@ -190,44 +194,20 @@ syslist(char *str, /* string of syscall names */
sys64 = SYS_pwrite64;
goto def;
- case SYS_creat: /* set both if either */
- case SYS_creat64:
- sys = SYS_creat;
- sys64 = SYS_creat64;
- goto def;
-
- case SYS_open: /* set both if either */
+ case SYS_openat: /* set all if any */
+ case SYS_openat64:
+ case SYS_open:
case SYS_open64:
- sys = SYS_open;
- sys64 = SYS_open64;
- goto def;
-
- case SYS_xmknod: /* set both if either */
- case SYS_mknod:
- sysx = SYS_xmknod;
- sys = SYS_mknod;
+ sys = SYS_openat;
+ sys64 = SYS_openat64;
+ sysx = SYS_open;
+ sysxx = SYS_open64;
goto def;
- case SYS_forkall: /* set all if any */
- case SYS_fork1:
+ case SYS_forksys: /* set both if either */
case SYS_vfork:
- case SYS_forksys:
- sys = SYS_forkall;
- sysx = SYS_fork1;
- sys64 = SYS_vfork;
- sysxx = SYS_forksys;
- goto def;
-
- case SYS_exec: /* set both if either */
- case SYS_execve:
- sysx = SYS_exec;
- sys = SYS_execve;
- goto def;
-
- case SYS_poll: /* set both if either */
- case SYS_pollsys:
- sysx = SYS_poll;
- sys = SYS_pollsys;
+ sysx = SYS_forksys;
+ sys = SYS_vfork;
goto def;
case SYS_sigprocmask: /* set both if either */
@@ -236,28 +216,38 @@ syslist(char *str, /* string of syscall names */
sys = SYS_lwp_sigmask;
goto def;
- case SYS_wait: /* set both if either */
- case SYS_waitid:
- sysx = SYS_wait;
- sys = SYS_waitid;
- goto def;
-
case SYS_lseek: /* set both if either */
case SYS_llseek:
sysx = SYS_lseek;
sys = SYS_llseek;
goto def;
- case SYS_lwp_mutex_lock: /* set both if either */
- case SYS_lwp_mutex_timedlock:
- sysx = SYS_lwp_mutex_lock;
- sys = SYS_lwp_mutex_timedlock;
+ case SYS_rename: /* set both */
+ sysx = SYS_renameat;
+ goto def;
+
+ case SYS_unlink: /* set both */
+ sysx = SYS_unlinkat;
+ goto def;
+
+ case SYS_rmdir: /* set both */
+ sysx = SYS_unlinkat;
+ goto def;
+
+ case SYS_chown: /* set both */
+ sysx = SYS_fchownat;
+ goto def;
+
+ case SYS_lchown: /* set both */
+ sysx = SYS_fchownat;
+ goto def;
+
+ case SYS_fchown: /* set both */
+ sysx = SYS_fchownat;
goto def;
- case SYS_lwp_sema_wait: /* set both if either */
- case SYS_lwp_sema_timedwait:
- sysx = SYS_lwp_sema_wait;
- sys = SYS_lwp_sema_timedwait;
+ case SYS_access: /* set both */
+ sysx = SYS_faccessat;
goto def;
default:
diff --git a/usr/src/cmd/truss/main.c b/usr/src/cmd/truss/main.c
index ef14a1fb49..736b8bc2ef 100644
--- a/usr/src/cmd/truss/main.c
+++ b/usr/src/cmd/truss/main.c
@@ -20,14 +20,12 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
@@ -160,9 +158,9 @@ insert_lwpid(lwpid_t lwpid)
if (i == truss_maxlwp) {
/* double the size of the array */
truss_lwpid = my_realloc(truss_lwpid,
- truss_maxlwp * 2 * sizeof (lwpid_t), NULL);
+ truss_maxlwp * 2 * sizeof (lwpid_t), NULL);
(void) memset(&truss_lwpid[truss_maxlwp], 0,
- truss_maxlwp * sizeof (lwpid_t));
+ truss_maxlwp * sizeof (lwpid_t));
truss_maxlwp *= 2;
}
truss_lwpid[i] = lwpid;
@@ -215,10 +213,10 @@ grab_lwp(lwpid_t who)
if ((Lwp = Lgrab(Proc, who, &gcode)) == NULL) {
if (gcode != G_NOPROC) {
(void) fprintf(stderr,
- "%s: cannot grab LWP %u in process %d,"
- " reason: %s\n",
- command, who, (int)Pstatus(Proc)->pr_pid,
- Lgrab_error(gcode));
+ "%s: cannot grab LWP %u in process %d,"
+ " reason: %s\n",
+ command, who, (int)Pstatus(Proc)->pr_pid,
+ Lgrab_error(gcode));
interrupt = SIGTERM; /* post an interrupt */
}
}
@@ -429,10 +427,8 @@ main(int argc, char *argv[])
exit(2);
/* if -a or -e was specified, force tracing of exec() */
- if (aflag || eflag) {
- praddset(&trace, SYS_exec);
+ if (aflag || eflag)
praddset(&trace, SYS_execve);
- }
/*
* Make sure that all system calls, signals, and machine faults
@@ -448,7 +444,7 @@ main(int argc, char *argv[])
/* collect the specified process ids */
if (pflag && argc > 0) {
grab = my_malloc(argc * sizeof (proc_set_t),
- "memory for process-ids");
+ "memory for process-ids");
while (argc-- > 0)
pids(*argv++, grab);
}
@@ -456,11 +452,11 @@ main(int argc, char *argv[])
if (errflg || (argc <= 0 && ngrab <= 0)) {
(void) fprintf(stderr,
"usage:\t%s [-fcaeildDEF] [-[tTvx] [!]syscalls] [-[sS] [!]signals]\\\n",
- command);
+ command);
(void) fprintf(stderr,
"\t[-[mM] [!]faults] [-[rw] [!]fds] [-[uU] [!]libs:[:][!]funcs]\\\n");
(void) fprintf(stderr,
- "\t[-o outfile] command | -p pid[/lwps] ...\n");
+ "\t[-o outfile] command | -p pid[/lwps] ...\n");
exit(2);
}
@@ -473,31 +469,31 @@ main(int argc, char *argv[])
switch (err) {
case C_PERM:
(void) fprintf(stderr,
- "%s: cannot trace set-id or "
- "unreadable object file: %s\n",
- command, path);
+ "%s: cannot trace set-id or "
+ "unreadable object file: %s\n",
+ command, path);
break;
case C_LP64:
(void) fprintf(stderr,
- "%s: cannot control _LP64 "
- "program: %s\n",
- command, path);
+ "%s: cannot control _LP64 "
+ "program: %s\n",
+ command, path);
break;
case C_NOEXEC:
(void) fprintf(stderr,
- "%s: cannot execute program: %s\n",
- command, argv[0]);
+ "%s: cannot execute program: %s\n",
+ command, argv[0]);
break;
case C_NOENT:
(void) fprintf(stderr,
- "%s: cannot find program: %s\n",
- command, argv[0]);
+ "%s: cannot find program: %s\n",
+ command, argv[0]);
break;
case C_STRANGE:
break;
default:
(void) fprintf(stderr, "%s: %s\n",
- command, Pcreate_error(err));
+ command, Pcreate_error(err));
break;
}
exit(2);
@@ -516,7 +512,7 @@ main(int argc, char *argv[])
pri->length = 0;
if (!cflag && prismember(&trace, SYS_execve)) {
pri->exec_string = my_realloc(pri->exec_string,
- strlen(pri->sys_string) + 1, NULL);
+ strlen(pri->sys_string) + 1, NULL);
(void) strcpy(pri->exec_pname, pri->pname);
(void) strcpy(pri->exec_string, pri->sys_string);
pri->length += strlen(pri->sys_string);
@@ -631,7 +627,7 @@ main(int argc, char *argv[])
case -1:
(void) fprintf(stderr,
"%s: cannot fork to control process, pid# %d\n",
- command, (int)set->pid);
+ command, (int)set->pid);
/* FALLTHROUGH */
default:
(void) mutex_unlock(&truss_lock);
@@ -680,13 +676,12 @@ main(int argc, char *argv[])
praddset(&traceeven, SYS_exit);
praddset(&traceeven, SYS_lwp_create);
praddset(&traceeven, SYS_lwp_exit);
- praddset(&traceeven, SYS_exec);
praddset(&traceeven, SYS_execve);
+ praddset(&traceeven, SYS_openat);
+ praddset(&traceeven, SYS_openat64);
praddset(&traceeven, SYS_open);
praddset(&traceeven, SYS_open64);
- praddset(&traceeven, SYS_forkall);
praddset(&traceeven, SYS_vfork);
- praddset(&traceeven, SYS_fork1);
praddset(&traceeven, SYS_forksys);
/* for I/O buffer dumps, force tracing of read()s and write()s */
@@ -721,15 +716,7 @@ main(int argc, char *argv[])
prdelset(&traceeven, SYS_context);
}
- /* special case -- sysexit not traced by OS */
- if (prismember(&trace, SYS_evtrapret)) {
- (void) Psysentry(Proc, SYS_evtrapret, TRUE);
- (void) Psysexit(Proc, SYS_evtrapret, FALSE);
- prdelset(&traceeven, SYS_evtrapret);
- }
-
/* special case -- trace exec() on entry to get the args */
- (void) Psysentry(Proc, SYS_exec, TRUE);
(void) Psysentry(Proc, SYS_execve, TRUE);
/* special case -- sysexit never reached */
@@ -756,8 +743,7 @@ main(int argc, char *argv[])
*/
if ((Lsp->pr_why != PR_SYSENTRY &&
Lsp->pr_why != PR_SYSEXIT) ||
- (Lsp->pr_what != SYS_exec &&
- Lsp->pr_what != SYS_execve)) {
+ Lsp->pr_what != SYS_execve) {
establish_breakpoints();
establish_stacks();
}
@@ -813,7 +799,7 @@ main_thread(int first)
* arrange not to leave it hung on the same system call.
*/
primary_lwp = (first && Pstate(Proc) == PS_STOP)?
- Pstatus(Proc)->pr_lwp.pr_lwpid : 0;
+ Pstatus(Proc)->pr_lwp.pr_lwpid : 0;
/*
* Create worker threads to match the lwps in the target process.
@@ -977,10 +963,10 @@ worker_thread(void *arg)
who = 1;
Lfree(Lwp);
pri->Lwp = Lwp =
- Lgrab(Proc, who, &gcode);
+ Lgrab(Proc, who, &gcode);
if (Lwp == NULL)
abend("Lgrab error: ",
- Lgrab_error(gcode));
+ Lgrab_error(gcode));
pri->lwpstat = Lsp = Lstatus(Lwp);
(void) mutex_unlock(&truss_lock);
continue;
@@ -999,11 +985,11 @@ worker_thread(void *arg)
if (pri->sys_valid)
(void) printf(
"%s\t*** cannot trace across exec() of %s ***\n",
- pri->pname, pri->sys_path);
+ pri->pname, pri->sys_path);
else
(void) printf(
"%s\t*** lost control of process ***\n",
- pri->pname);
+ pri->pname);
pri->length = 0;
Flush();
(void) mutex_unlock(&truss_lock);
@@ -1011,7 +997,7 @@ worker_thread(void *arg)
}
if (Lstate(Lwp) != PS_STOP) {
(void) fprintf(stderr,
- "%s: state = %d\n", command, Lstate(Lwp));
+ "%s: state = %d\n", command, Lstate(Lwp));
abend(pri->pname, "uncaught status of subject lwp");
}
@@ -1104,7 +1090,6 @@ worker_thread(void *arg)
case SYS_exit: /* exit() */
case SYS_lwp_exit: /* lwp_exit() */
case SYS_context: /* [get|set]context() */
- case SYS_evtrapret: /* evtrapret() */
if (dotrace && cflag &&
prismember(&trace, what)) {
ow_in_effect = 1;
@@ -1132,7 +1117,7 @@ worker_thread(void *arg)
putpname(pri);
timestamp(pri);
pri->length +=
- printf("%s\n", pri->sys_string);
+ printf("%s\n", pri->sys_string);
Flush();
}
pri->sys_leng = 0;
@@ -1141,19 +1126,18 @@ worker_thread(void *arg)
if (what == SYS_exit)
exit_called = TRUE;
break;
- case SYS_exec:
case SYS_execve:
(void) sysentry(pri, dotrace);
if (dotrace && !cflag &&
prismember(&trace, what)) {
pri->exec_string =
- my_realloc(pri->exec_string,
- strlen(pri->sys_string) + 1,
- NULL);
+ my_realloc(pri->exec_string,
+ strlen(pri->sys_string) + 1,
+ NULL);
(void) strcpy(pri->exec_pname,
- pri->pname);
+ pri->pname);
(void) strcpy(pri->exec_string,
- pri->sys_string);
+ pri->sys_string);
pri->length += strlen(pri->sys_string);
pri->exec_lwpid = Lsp->pr_lwpid;
}
@@ -1174,14 +1158,24 @@ worker_thread(void *arg)
break;
case PR_SYSEXIT:
/* check for write open of a /proc file */
- if ((what == SYS_open || what == SYS_open64)) {
+ if (what == SYS_openat || what == SYS_openat64 ||
+ what == SYS_open || what == SYS_open64) {
+ int readonly;
+
(void) sysentry(pri, dotrace);
pri->Errno = Lsp->pr_errno;
pri->ErrPriv = Lsp->pr_errpriv;
+ readonly =
+ ((what == SYS_openat ||
+ what == SYS_openat64) &&
+ pri->sys_nargs > 2 &&
+ (pri->sys_args[2]&0x3) == O_RDONLY) ||
+ ((what == SYS_open ||
+ what == SYS_open64) &&
+ pri->sys_nargs > 1 &&
+ (pri->sys_args[1]&0x3) == O_RDONLY);
if ((pri->Errno == 0 || pri->Errno == EBUSY) &&
- pri->sys_valid &&
- (pri->sys_nargs > 1 &&
- (pri->sys_args[1]&0x3) != O_RDONLY)) {
+ pri->sys_valid && !readonly) {
int rv = checkproc(pri);
if (rv == 1 && Fflag != PGRAB_FORCE) {
/*
@@ -1200,7 +1194,7 @@ worker_thread(void *arg)
}
sigusr1 = TRUE;
(void) mutex_unlock(
- &truss_lock);
+ &truss_lock);
goto out;
}
if (rv == 2) {
@@ -1216,8 +1210,7 @@ worker_thread(void *arg)
}
}
}
- if ((what == SYS_exec || what == SYS_execve) &&
- pri->Errno == 0) {
+ if (what == SYS_execve && pri->Errno == 0) {
/*
* Refresh the data model on exec() in case it
* is different from the parent. Lwait()
@@ -1252,8 +1245,7 @@ worker_thread(void *arg)
if (dotrace && Tflag && !first &&
prismember(&syshang, what))
leave_it_hung = TRUE;
- if ((what == SYS_exec || what == SYS_execve) &&
- pri->Errno == 0) {
+ if (what == SYS_execve && pri->Errno == 0) {
is_vfork_child = FALSE;
reset_breakpoints();
/*
@@ -1270,14 +1262,14 @@ worker_thread(void *arg)
*/
while (truss_nlwp > 1)
(void) cond_wait(&truss_cv,
- &truss_lock);
+ &truss_lock);
who = Lsp->pr_lwpid;
Lfree(Lwp);
pri->Lwp = Lwp =
- Lgrab(Proc, who, &gcode);
+ Lgrab(Proc, who, &gcode);
if (Lwp == NULL)
abend("Lgrab error: ",
- Lgrab_error(gcode));
+ Lgrab_error(gcode));
pri->lwpstat = Lsp = Lstatus(Lwp);
}
}
@@ -1285,8 +1277,8 @@ worker_thread(void *arg)
default:
req_flag = 0;
(void) fprintf(stderr,
- "unknown reason for stopping: %d/%d\n",
- Lsp->pr_why, what);
+ "unknown reason for stopping: %d/%d\n",
+ Lsp->pr_why, what);
abend(NULL, NULL);
}
@@ -1359,8 +1351,8 @@ worker_thread(void *arg)
(void) Lsetrun(Lwp, 0, PRCFAULT|PRSTOP);
} else {
(void) printf("%s\t*** Expected PR_FAULTED/"
- "FLTTRACE stop following vfork()\n",
- pri->pname);
+ "FLTTRACE stop following vfork()\n",
+ pri->pname);
}
}
@@ -1519,9 +1511,7 @@ out:
*/
(void) Pstop(Proc, MILLISEC);
clear_breakpoints();
- (void) Psysexit(Proc, SYS_forkall, FALSE);
(void) Psysexit(Proc, SYS_vfork, FALSE);
- (void) Psysexit(Proc, SYS_fork1, FALSE);
(void) Psysexit(Proc, SYS_forksys, FALSE);
(void) Punsetflags(Proc, PR_FORK);
Psync(Proc);
@@ -1555,8 +1545,8 @@ setup_basetime(hrtime_t basehrtime, struct timeval *basedate)
const char *ptime;
const char *pdst;
hrtime_t delta = basehrtime -
- ((hrtime_t)Cp->basetime.tv_sec * NANOSEC +
- Cp->basetime.tv_nsec);
+ ((hrtime_t)Cp->basetime.tv_sec * NANOSEC +
+ Cp->basetime.tv_nsec);
if (delta > 0) {
basedate->tv_sec -= (time_t)(delta / NANOSEC);
@@ -2109,12 +2099,12 @@ report(private_t *pri, time_t lapse) /* elapsed time, clock ticks */
(void) printf("faults -------------\n");
name = proc_fltname(i, pri->flt_name,
- sizeof (pri->flt_name));
+ sizeof (pri->flt_name));
(void) printf("%s%s\t%4ld\n", name,
- (((int)strlen(name) < 8)?
- (const char *)"\t" : (const char *)""),
- count);
+ (((int)strlen(name) < 8)?
+ (const char *)"\t" : (const char *)""),
+ count);
total += count;
}
}
@@ -2127,9 +2117,9 @@ report(private_t *pri, time_t lapse) /* elapsed time, clock ticks */
(void) printf("signals ------------\n");
name = signame(pri, i);
(void) printf("%s%s\t%4ld\n", name,
- (((int)strlen(name) < 8)?
- (const char *)"\t" : (const char *)""),
- count);
+ (((int)strlen(name) < 8)?
+ (const char *)"\t" : (const char *)""),
+ count);
total += count;
}
}
@@ -2154,7 +2144,7 @@ report(private_t *pri, time_t lapse) /* elapsed time, clock ticks */
qsort((void *)stbl, elem, sizeof (hentry_t),
lib_sort);
(void) printf(
- "\n%-20s %-40s %s\n", "Library:", "Function", "calls");
+ "\n%-20s %-40s %s\n", "Library:", "Function", "calls");
for (i = 0; i < elem; i++) {
(void) printf("%-20s %-40s %ld\n", stbl[i].lib,
stbl[i].key, stbl[i].count);
@@ -2179,7 +2169,7 @@ report(private_t *pri, time_t lapse) /* elapsed time, clock ticks */
for (subcode = 0; subcode < n; subcode++, scp++) {
if ((count = scp->count) != 0 || scp->error) {
(void) printf("%-19.19s ",
- sysname(pri, i, subcode));
+ sysname(pri, i, subcode));
ticks = scp->stime;
accumulate(&ticktot, &ticks, &tickzero);
@@ -2275,11 +2265,11 @@ psargs(private_t *pri)
if (proc_get_psinfo(pid, &psinfo) == 0)
(void) printf("%spsargs: %.64s\n",
- pri->pname, psinfo.pr_psargs);
+ pri->pname, psinfo.pr_psargs);
else {
perror("psargs()");
(void) printf("%s\t*** Cannot read psinfo file for pid %d\n",
- pri->pname, (int)pid);
+ pri->pname, (int)pid);
}
}
@@ -2293,7 +2283,7 @@ fetchstring(private_t *pri, long addr, int maxleng)
string[40] = '\0';
if (pri->str_bsize == 0) /* initial allocation of string buffer */
pri->str_buffer =
- my_malloc(pri->str_bsize = 16, "string buffer");
+ my_malloc(pri->str_bsize = 16, "string buffer");
*pri->str_buffer = '\0';
for (nbyte = 40; nbyte == 40 && leng < maxleng; addr += 40) {
@@ -2303,8 +2293,8 @@ fetchstring(private_t *pri, long addr, int maxleng)
(nbyte = strlen(string)) > 0) {
while (leng + nbyte >= pri->str_bsize)
pri->str_buffer =
- my_realloc(pri->str_buffer,
- pri->str_bsize *= 2, "string buffer");
+ my_realloc(pri->str_buffer,
+ pri->str_bsize *= 2, "string buffer");
(void) strcpy(pri->str_buffer+leng, string);
leng += nbyte;
}
@@ -2328,7 +2318,7 @@ show_cred(private_t *pri, int new)
return;
}
- if (!cflag && prismember(&trace, SYS_exec)) {
+ if (!cflag && prismember(&trace, SYS_execve)) {
if (new)
credentials = cred;
if ((new && cred.pr_ruid != cred.pr_suid) ||
@@ -2336,19 +2326,19 @@ show_cred(private_t *pri, int new)
cred.pr_suid != credentials.pr_suid)
(void) printf(
"%s *** SUID: ruid/euid/suid = %d / %d / %d ***\n",
- pri->pname,
- (int)cred.pr_ruid,
- (int)cred.pr_euid,
- (int)cred.pr_suid);
+ pri->pname,
+ (int)cred.pr_ruid,
+ (int)cred.pr_euid,
+ (int)cred.pr_suid);
if ((new && cred.pr_rgid != cred.pr_sgid) ||
cred.pr_rgid != credentials.pr_rgid ||
cred.pr_sgid != credentials.pr_sgid)
(void) printf(
"%s *** SGID: rgid/egid/sgid = %d / %d / %d ***\n",
- pri->pname,
- (int)cred.pr_rgid,
- (int)cred.pr_egid,
- (int)cred.pr_sgid);
+ pri->pname,
+ (int)cred.pr_rgid,
+ (int)cred.pr_egid,
+ (int)cred.pr_sgid);
}
credentials = cred;
@@ -2373,7 +2363,7 @@ control(private_t *pri, pid_t pid)
gps->fork_pid = getpid(); /* parent pid */
if ((childpid = fork()) == -1) {
(void) printf("%s\t*** Cannot fork() to control process #%d\n",
- pri->pname, (int)pid);
+ pri->pname, (int)pid);
Flush();
gps->fork_pid = 0;
(void) cond_broadcast(&gps->fork_cv);
@@ -2411,8 +2401,8 @@ control(private_t *pri, pid_t pid)
*/
if ((Proc = Pgrab(pid, PGRAB_RETAIN, &rc)) == NULL) {
(void) fprintf(stderr,
- "%s: cannot control child process, pid# %d: %s\n",
- command, (int)pid, Pgrab_error(rc));
+ "%s: cannot control child process, pid# %d: %s\n",
+ command, (int)pid, Pgrab_error(rc));
gps->fork_pid = childpid;
(void) cond_broadcast(&gps->fork_cv);
(void) mutex_unlock(&gps->fork_lock);
@@ -2470,7 +2460,7 @@ grabit(private_t *pri, proc_set_t *set)
*/
if ((Proc = Pgrab(set->pid, Fflag, &gcode)) == NULL) {
(void) fprintf(stderr, "%s: %s: %d\n",
- command, Pgrab_error(gcode), (int)set->pid);
+ command, Pgrab_error(gcode), (int)set->pid);
pri->lwpstat = NULL;
return (FALSE);
}
@@ -2516,8 +2506,8 @@ release(private_t *pri, pid_t pid)
write(fd, (char *)ctl, sizeof (ctl)) < 0) {
perror("release()");
(void) printf(
- "%s\t*** Cannot release child process, pid# %d\n",
- pri->pname, (int)pid);
+ "%s\t*** Cannot release child process, pid# %d\n",
+ pri->pname, (int)pid);
Flush();
}
if (fd >= 0) /* run-on-last-close sets the process running */
@@ -2658,7 +2648,7 @@ void
letgo(private_t *pri)
{
(void) printf("%s\t*** process otherwise traced, releasing ...\n",
- pri->pname);
+ pri->pname);
}
/*
diff --git a/usr/src/cmd/truss/print.c b/usr/src/cmd/truss/print.c
index 30dabbf934..2848fd1490 100644
--- a/usr/src/cmd/truss/print.c
+++ b/usr/src/cmd/truss/print.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -521,17 +521,6 @@ prt_smf(private_t *pri, int raw, long val) /* print streams message flags */
}
void
-prt_plk(private_t *pri, int raw, long val) /* print plock code */
-{
- const char *s = raw? NULL : plockname(val);
-
- if (s == NULL)
- prt_dec(pri, 0, val);
- else
- outstring(pri, s);
-}
-
-void
prt_mtf(private_t *pri, int raw, long val) /* print mount flags */
{
const char *s = raw? NULL : mountflags(pri, val);
@@ -2359,10 +2348,14 @@ prt_zga(private_t *pri, int raw, long val)
void
prt_atc(private_t *pri, int raw, long val)
{
- if (!raw && val == AT_FDCWD)
- outstring(pri, "AT_FDCWD");
- else
+ if ((int)val == AT_FDCWD) {
+ if (raw)
+ prt_hex(pri, 0, (uint_t)AT_FDCWD);
+ else
+ outstring(pri, "AT_FDCWD");
+ } else {
prt_dec(pri, 0, val);
+ }
}
/*
@@ -2633,7 +2626,7 @@ void (* const Print[])() = {
prt_sef, /* SEF -- print semsys flags */
prt_shc, /* SHC -- print shmsys command */
prt_shf, /* SHF -- print shmsys flags */
- prt_plk, /* PLK -- print plock code */
+ prt_nov, /* Was PLK, now available for reuse */
prt_sfs, /* SFS -- print sysfs code */
prt_rst, /* RST -- print string returned by syscall */
prt_smf, /* SMF -- print streams message flags */
diff --git a/usr/src/cmd/truss/print.h b/usr/src/cmd/truss/print.h
index 916ebc2505..159b2fbe58 100644
--- a/usr/src/cmd/truss/print.h
+++ b/usr/src/cmd/truss/print.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -56,7 +56,7 @@ extern "C" {
#define SEF 16 /* print semsys flags */
#define SHC 17 /* print shmsys command */
#define SHF 18 /* print shmsys flags */
-#define PLK 19 /* print plock code */
+/* Number 19 now available for reuse */
#define SFS 20 /* print sysfs code */
#define RST 21 /* print string returned by sys call */
#define SMF 22 /* print streams message flags */
diff --git a/usr/src/cmd/truss/proto.h b/usr/src/cmd/truss/proto.h
index 29c8632353..25f92cef67 100644
--- a/usr/src/cmd/truss/proto.h
+++ b/usr/src/cmd/truss/proto.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -66,7 +66,6 @@ extern const char *ioctlname(private_t *, uint_t);
extern const char *ioctldatastruct(uint_t);
extern const char *fcntlname(int);
extern const char *sfsname(int);
-extern const char *plockname(int);
extern const char *si86name(int);
extern const char *utscode(int);
extern const char *openarg(private_t *, int);
@@ -135,8 +134,6 @@ extern int maxsyscalls(void);
extern int nsubcodes(int);
extern void show_stat(private_t *, long);
-extern void show_statat(private_t *, long);
-extern void show_xstat(private_t *, int, long);
extern void show_stat64_32(private_t *, long);
extern void establish_breakpoints(void);
diff --git a/usr/src/cmd/truss/ramdata.h b/usr/src/cmd/truss/ramdata.h
index 24cea0dbd8..ea2bbdda46 100644
--- a/usr/src/cmd/truss/ramdata.h
+++ b/usr/src/cmd/truss/ramdata.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -106,7 +106,7 @@ typedef struct private {
char raw_sig_name[SIG2STR_MAX+4]; /* name of known signal */
char sig_name[12]; /* name of unknown signal */
char flt_name[12]; /* name of unknown fault */
- char *sys_path; /* first pathname given to syscall */
+ char *sys_path; /* pathname given to syscall */
size_t sys_psize; /* sizeof(*sys_path) */
int sys_valid; /* pathname was fetched and is valid */
char *sys_string; /* buffer for formatted syscall string */
diff --git a/usr/src/cmd/truss/xstat.c b/usr/src/cmd/truss/stat.c
index e82ce21af1..f5ecab0c62 100644
--- a/usr/src/cmd/truss/xstat.c
+++ b/usr/src/cmd/truss/stat.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,17 +18,15 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
-
#define _SYSCALL32
#include <stdio.h>
@@ -49,97 +46,6 @@ void show_stat32(private_t *, long);
void show_stat64(private_t *, long);
#endif
-#if defined(i386) && defined(_STAT_VER)
-
-/*
- * Old SVR3 stat structure.
- */
-struct o_stat {
- o_dev_t st_dev;
- o_ino_t st_ino;
- o_mode_t st_mode;
- o_nlink_t st_nlink;
- o_uid_t st_uid;
- o_gid_t st_gid;
- o_dev_t st_rdev;
- off32_t st_size;
- time_t st_atim;
- time_t st_mtim;
- time_t st_ctim;
-};
-
-void
-show_o_stat(private_t *pri, long offset)
-{
- struct o_stat statb;
- timestruc_t ts;
-
- if (offset != NULL &&
- Pread(Proc, &statb, sizeof (statb), offset) == sizeof (statb)) {
- (void) printf(
- "%s d=0x%.8X i=%-5u m=0%.6o l=%-2u u=%-5u g=%-5u",
- pri->pname,
- statb.st_dev & 0xffff,
- statb.st_ino,
- statb.st_mode,
- statb.st_nlink % 0xffff,
- statb.st_uid,
- statb.st_gid);
-
- switch (statb.st_mode & S_IFMT) {
- case S_IFCHR:
- case S_IFBLK:
- (void) printf(" rdev=0x%.4X\n", statb.st_rdev & 0xffff);
- break;
- default:
- (void) printf(" sz=%u\n", (uint32_t)statb.st_size);
- break;
- }
-
- ts.tv_nsec = 0;
- ts.tv_sec = statb.st_atim;
- prtimestruc(pri, "at = ", &ts);
- ts.tv_sec = statb.st_atim;
- prtimestruc(pri, "mt = ", &ts);
- ts.tv_sec = statb.st_atim;
- prtimestruc(pri, "ct = ", &ts);
- }
-}
-
-void
-show_stat(private_t *pri, long offset)
-{
- show_o_stat(pri, offset);
-}
-
-void
-show_xstat(private_t *pri, int version, long offset)
-{
- switch (version) {
- case _R3_STAT_VER:
- show_o_stat(pri, offset);
- break;
- case _STAT_VER:
- show_stat32(pri, offset);
- break;
- }
-}
-
-void
-show_statat(private_t *pri, long offset)
-{
-#ifdef _LP64
- if (data_model == PR_MODEL_LP64)
- show_stat64(pri, offset);
- else
- show_stat32(pri, offset);
-#else
- show_stat32(pri, offset);
-#endif
-}
-
-#else
-
void
show_stat(private_t *pri, long offset)
{
@@ -154,21 +60,6 @@ show_stat(private_t *pri, long offset)
}
void
-show_statat(private_t *pri, long offset)
-{
- show_stat(pri, offset);
-}
-
-/* ARGSUSED */
-void
-show_xstat(private_t *pri, int version, long offset)
-{
- show_stat(pri, offset);
-}
-
-#endif
-
-void
show_stat32(private_t *pri, long offset)
{
struct stat32 statb;
diff --git a/usr/src/cmd/truss/systable.c b/usr/src/cmd/truss/systable.c
index d63ccbabba..0046110e2b 100644
--- a/usr/src/cmd/truss/systable.c
+++ b/usr/src/cmd/truss/systable.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -219,16 +219,16 @@ errname(int err) /* return the error code name (NULL if none) */
const struct systable systable[] = {
{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"_exit", 1, DEC, NOV, DEC}, /* 1 */
-{"forkall", 0, DEC, NOV}, /* 2 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"read", 3, DEC, NOV, DEC, IOB, UNS}, /* 3 */
{"write", 3, DEC, NOV, DEC, IOB, UNS}, /* 4 */
{"open", 3, DEC, NOV, STG, OPN, OCT}, /* 5 */
{"close", 1, DEC, NOV, DEC}, /* 6 */
-{"wait", 0, DEC, HHX}, /* 7 */
-{"creat", 2, DEC, NOV, STG, OCT}, /* 8 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"link", 2, DEC, NOV, STG, STG}, /* 9 */
{"unlink", 1, DEC, NOV, STG}, /* 10 */
-{"exec", 2, DEC, NOV, STG, DEC}, /* 11 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"chdir", 1, DEC, NOV, STG}, /* 12 */
{"time", 0, DEC, NOV}, /* 13 */
{"mknod", 3, DEC, NOV, STG, OCT, HEX}, /* 14 */
@@ -238,8 +238,8 @@ const struct systable systable[] = {
{"stat", 2, DEC, NOV, STG, HEX}, /* 18 */
{"lseek", 3, DEC, NOV, DEC, DEX, WHN}, /* 19 */
{"getpid", 0, DEC, DEC}, /* 20 */
-{"mount", 8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
-{"umount", 1, DEC, NOV, STG}, /* 22 */
+{"mount", 8, DEC, NOV, STG, STG, MTF, MFT, HEX, DEC, HEX, DEC}, /* 21 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"setuid", 1, DEC, NOV, UNS}, /* 23 */
{"getuid", 0, UNS, UNS}, /* 24 */
{"stime", 1, DEC, NOV, DEC}, /* 25 */
@@ -247,7 +247,7 @@ const struct systable systable[] = {
{"alarm", 1, DEC, NOV, UNS}, /* 27 */
{"fstat", 2, DEC, NOV, DEC, HEX}, /* 28 */
{"pause", 0, DEC, NOV}, /* 29 */
-{"utime", 2, DEC, NOV, STG, HEX}, /* 30 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"stty", 2, DEC, NOV, DEC, DEC}, /* 31 */
{"gtty", 2, DEC, NOV, DEC, DEC}, /* 32 */
{"access", 2, DEC, NOV, STG, ACC}, /* 33 */
@@ -258,11 +258,11 @@ const struct systable systable[] = {
{"fstatfs", 4, DEC, NOV, DEC, HEX, DEC, DEC}, /* 38 */
{"pgrpsys", 3, DEC, NOV, DEC, DEC, DEC}, /* 39 */
{"uucopystr", 3, DEC, NOV, STG, RST, UNS}, /* 40 */
-{"dup", 1, DEC, NOV, DEC}, /* 41 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"pipe", 0, DEC, DEC}, /* 42 */
{"times", 1, DEC, NOV, HEX}, /* 43 */
{"profil", 4, DEC, NOV, HEX, UNS, HEX, OCT}, /* 44 */
-{"plock", 1, DEC, NOV, PLK}, /* 45 */
+{"faccessat", 4, DEC, NOV, ATC, STG, ACC, DEC}, /* 45 */
{"setgid", 1, DEC, NOV, UNS}, /* 46 */
{"getgid", 0, UNS, UNS}, /* 47 */
{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
@@ -273,7 +273,7 @@ const struct systable systable[] = {
{"semsys", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 53 */
{"ioctl", 3, DEC, NOV, DEC, IOC, IOA}, /* 54 */
{"uadmin", 3, DEC, NOV, DEC, DEC, DEC}, /* 55 */
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{"fchownat", 5, DEC, NOV, ATC, STG, DEC, DEC, UTF}, /* 56 */
{"utssys", 4, DEC, NOV, HEX, DEC, UTS, HEX}, /* 57 */
{"fdsync", 2, DEC, NOV, DEC, FFG}, /* 58 */
{"execve", 3, DEC, NOV, STG, HEX, HEX}, /* 59 */
@@ -281,22 +281,19 @@ const struct systable systable[] = {
{"chroot", 1, DEC, NOV, STG}, /* 61 */
{"fcntl", 3, DEC, NOV, DEC, FCN, HEX}, /* 62 */
{"ulimit", 2, DEX, NOV, ULM, DEC}, /* 63 */
-
-/* The following 6 entries were reserved for the UNIX PC */
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
-
+{"renameat", 4, DEC, NOV, ATC, STG, ATC, STG}, /* 64 */
+{"unlinkat", 3, DEC, NOV, ATC, STG, DEC}, /* 65 */
+{"fstatat", 4, DEC, NOV, ATC, STG, HEX, UTF}, /* 66 */
+{"fstatat64", 4, DEC, NOV, ATC, STG, HEX, UTF}, /* 67 */
+{"openat", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 68 */
+{"openat64", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 69 */
{"tasksys", 5, DEC, NOV, DEC, DEC, DEC, HEX, DEC}, /* 70 */
{"acctctl", 3, DEC, NOV, HEX, HEX, UNS}, /* 71 */
{"exacctsys", 6, DEC, NOV, DEC, IDT, DEC, HEX, DEC, HEX}, /* 72 */
{"getpagesizes", 2, DEC, NOV, HEX, DEC}, /* 73 */
{"rctlsys", 6, DEC, NOV, RSC, STG, HEX, HEX, DEC, DEC}, /* 74 */
{"sidsys", 4, UNS, UNS, DEC, DEC, DEC, DEC}, /* 75 */
-{"fsat", 6, DEC, NOV, HEX, HEX, HEX, HEX, HEX, HEX}, /* 76 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"lwp_park", 3, DEC, NOV, DEC, HEX, DEC}, /* 77 */
{"sendfilev", 5, DEC, NOV, DEC, DEC, HEX, DEC, HEX}, /* 78 */
{"rmdir", 1, DEC, NOV, STG}, /* 79 */
@@ -307,7 +304,7 @@ const struct systable systable[] = {
{"sysfs", 3, DEC, NOV, SFS, DEX, DEX}, /* 84 */
{"getmsg", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 85 */
{"putmsg", 4, DEC, NOV, DEC, HEX, HEX, SMF}, /* 86 */
-{"poll", 3, DEC, NOV, HEX, DEC, DEC}, /* 87 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"lstat", 2, DEC, NOV, STG, HEX}, /* 88 */
{"symlink", 2, DEC, NOV, STG, STG}, /* 89 */
{"readlink", 3, DEC, NOV, STG, RLK, UNS}, /* 90 */
@@ -321,8 +318,8 @@ const struct systable systable[] = {
{"sigaction", 3, DEC, NOV, SIG, HEX, HEX}, /* 98 */
{"sigpendsys", 2, DEC, NOV, DEC, HEX}, /* 99 */
{"context", 2, DEC, NOV, DEC, HEX}, /* 100 */
-{"evsys", 3, DEC, NOV, DEC, DEC, HEX}, /* 101 */
-{"evtrapret", 0, DEC, NOV}, /* 102 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"statvfs", 2, DEC, NOV, STG, HEX}, /* 103 */
{"fstatvfs", 2, DEC, NOV, DEC, HEX}, /* 104 */
{"getloadavg", 2, DEC, NOV, HEX, DEC}, /* 105 */
@@ -343,10 +340,10 @@ const struct systable systable[] = {
{"fchdir", 1, DEC, NOV, DEC}, /* 120 */
{"readv", 3, DEC, NOV, DEC, HEX, DEC}, /* 121 */
{"writev", 3, DEC, NOV, DEC, HEX, DEC}, /* 122 */
-{"xstat", 3, DEC, NOV, DEC, STG, HEX}, /* 123 */
-{"lxstat", 3, DEC, NOV, DEC, STG, HEX}, /* 124 */
-{"fxstat", 3, DEC, NOV, DEC, DEC, HEX}, /* 125 */
-{"xmknod", 4, DEC, NOV, DEC, STG, OCT, HEX}, /* 126 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"mmapobj", 5, DEC, NOV, DEC, MOB, HEX, HEX, HEX}, /* 127 */
{"setrlimit", 2, DEC, NOV, RLM, HEX}, /* 128 */
{"getrlimit", 2, DEC, NOV, RLM, HEX}, /* 129 */
@@ -363,18 +360,18 @@ const struct systable systable[] = {
{"sharefs", 3, DEC, NOV, DEC, HEX, DEC}, /* 140 */
{"seteuid", 1, DEC, NOV, UNS}, /* 141 */
{"forksys", 2, DEC, NOV, DEC, HHX}, /* 142 */
-{"fork1", 0, DEC, NOV}, /* 143 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"sigtimedwait", 3, DEC, NOV, HEX, HEX, HEX}, /* 144 */
{"lwp_info", 1, DEC, NOV, HEX}, /* 145 */
{"yield", 0, DEC, NOV}, /* 146 */
-{"lwp_sema_wait", 1, DEC, NOV, HEX}, /* 147 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"lwp_sema_post", 1, DEC, NOV, HEX}, /* 148 */
{"lwp_sema_trywait", 1, DEC, NOV, HEX}, /* 149 */
{"lwp_detach", 1, DEC, NOV, DEC}, /* 150 */
{"corectl", 4, DEC, NOV, DEC, HEX, HEX, HEX}, /* 151 */
{"modctl", 5, DEC, NOV, MOD, HEX, HEX, HEX, HEX}, /* 152 */
{"fchroot", 1, DEC, NOV, DEC}, /* 153 */
-{"utimes", 2, DEC, NOV, STG, HEX}, /* 154 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"vhangup", 0, DEC, NOV}, /* 155 */
{"gettimeofday", 1, DEC, NOV, HEX}, /* 156 */
{"getitimer", 2, DEC, NOV, ITM, HEX}, /* 157 */
@@ -389,7 +386,7 @@ const struct systable systable[] = {
{"lwp_private", 3, HEX, NOV, DEC, DEC, HEX}, /* 166 */
{"lwp_wait", 2, DEC, NOV, DEC, HEX}, /* 167 */
{"lwp_mutex_wakeup", 2, DEC, NOV, HEX, DEC}, /* 168 */
-{"lwp_mutex_lock", 1, DEC, NOV, HEX}, /* 169 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"lwp_cond_wait", 4, DEC, NOV, HEX, HEX, HEX, DEC}, /* 170 */
{"lwp_cond_signal", 1, DEC, NOV, HEX}, /* 171 */
{"lwp_cond_broadcast", 1, DEC, NOV, HEX}, /* 172 */
@@ -444,7 +441,7 @@ const struct systable systable[] = {
{"getrlimit64", 2, DEC, NOV, RLM, HEX}, /* 221 */
{"pread64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 222 */
{"pwrite64", 5, DEC, NOV, DEC, IOB, UNS, LLO, HID}, /* 223 */
-{"creat64", 2, DEC, NOV, STG, OCT}, /* 224 */
+{ NULL, 8, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX, HEX},
{"open64", 3, DEC, NOV, STG, OPN, OCT}, /* 225 */
{"rpcmod", 3, DEC, NOV, DEC, HEX}, /* 226 */
{"zone", 5, DEC, NOV, DEC, HEX, HEX, HEX, HEX}, /* 227 */
@@ -487,6 +484,65 @@ const struct systable systable[] = {
* The following are for interpreting syscalls with sub-codes.
*/
+const struct systable faccessattable[] = {
+{"faccessat", 4, DEC, NOV, ATC, STG, ACC, DEC}, /* 0 */
+{"access", 3, DEC, NOV, HID, STG, ACC}, /* 1 */
+};
+#define NACCESSCODE (sizeof (faccessattable) / sizeof (struct systable))
+
+const struct systable fchownattable[] = {
+{"fchownat", 5, DEC, NOV, ATC, STG, DEC, DEC, UTF}, /* 0 */
+{"chown", 4, DEC, NOV, HID, STG, DEC, DEC}, /* 1 */
+{"lchown", 4, DEC, NOV, HID, STG, DEC, DEC}, /* 2 */
+{"fchown", 4, DEC, NOV, DEC, HID, DEC, DEC}, /* 3 */
+};
+#define NCHOWNCODE (sizeof (fchownattable) / sizeof (struct systable))
+
+const struct systable renameattable[] = {
+{"renameat", 4, DEC, NOV, ATC, STG, ATC, STG}, /* 0 */
+{"rename", 4, DEC, NOV, HID, STG, HID, STG}, /* 1 */
+};
+#define NRENAMECODE (sizeof (renameattable) / sizeof (struct systable))
+
+const struct systable unlinkattable[] = {
+{"unlinkat", 3, DEC, NOV, ATC, STG, DEC}, /* 0 */
+{"unlink", 2, DEC, NOV, HID, STG}, /* 1 */
+{"rmdir", 2, DEC, NOV, HID, STG}, /* 2 */
+};
+#define NUNLINKCODE (sizeof (unlinkattable) / sizeof (struct systable))
+
+const struct systable fstatattable[] = {
+{"fstatat", 4, DEC, NOV, ATC, STG, HEX, UTF}, /* 0 */
+{"stat", 3, DEC, NOV, HID, STG, HEX}, /* 1 */
+{"lstat", 3, DEC, NOV, HID, STG, HEX}, /* 2 */
+{"fstat", 3, DEC, NOV, DEC, HID, HEX}, /* 3 */
+};
+#define NSTATCODE (sizeof (fstatattable) / sizeof (struct systable))
+
+const struct systable fstatat64table[] = {
+{"fstatat64", 4, DEC, NOV, ATC, STG, HEX, UTF}, /* 0 */
+{"stat64", 3, DEC, NOV, HID, STG, HEX}, /* 1 */
+{"lstat64", 3, DEC, NOV, HID, STG, HEX}, /* 2 */
+{"fstat64", 3, DEC, NOV, DEC, HID, HEX}, /* 3 */
+};
+#define NSTAT64CODE (sizeof (fstatat64table) / sizeof (struct systable))
+
+const struct systable openattable[] = {
+{"openat", 3, DEC, NOV, ATC, STG, OPN}, /* 0 */
+{"openat", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 1 */
+{"open", 3, DEC, NOV, HID, STG, OPN}, /* 2 */
+{"open", 4, DEC, NOV, HID, STG, OPN, OCT}, /* 3 */
+};
+#define NOPENATCODE (sizeof (openattable) / sizeof (struct systable))
+
+const struct systable openat64table[] = {
+{"openat64", 3, DEC, NOV, ATC, STG, OPN}, /* 0 */
+{"openat64", 4, DEC, NOV, ATC, STG, OPN, OCT}, /* 1 */
+{"open64", 3, DEC, NOV, HID, STG, OPN}, /* 2 */
+{"open64", 4, DEC, NOV, HID, STG, OPN, OCT}, /* 3 */
+};
+#define NOPENAT64CODE (sizeof (openat64table) / sizeof (struct systable))
+
const struct systable opentable[] = {
{"open", 2, DEC, NOV, STG, OPN}, /* 0 */
{"open", 3, DEC, NOV, STG, OPN, OCT}, /* 1 */
@@ -698,22 +754,6 @@ static const struct systable exacctsystable[] = {
};
#define NEXACCTSYSCODE (sizeof (exacctsystable) / sizeof (struct systable))
-static const struct systable fsatsystable[] = {
-{"openat", 5, DEC, NOV, HID, ATC, STG, OPN, OCT}, /* 0 */
-{"openat64", 5, DEC, NOV, HID, ATC, STG, OPN, OCT}, /* 1 */
-{"fstatat64", 5, DEC, NOV, HID, ATC, STG, HEX, HEX}, /* 2 */
-{"fstatat", 5, DEC, NOV, HID, ATC, STG, HEX, HEX}, /* 3 */
-{"fchownat", 6, DEC, NOV, HID, ATC, STG, HEX, HEX, HEX}, /* 4 */
-{"unlinkat", 4, DEC, NOV, HID, ATC, STG, HEX}, /* 5 */
-{"futimesat", 4, DEC, NOV, HID, ATC, STG, HEX}, /* 6 */
-{"renameat", 5, DEC, NOV, HID, ATC, STG, DEC, STG}, /* 7 */
-{"faccessat", 5, DEC, NOV, HID, ATC, STG, ACC, ACC}, /* 8 */
-{"__openattrdirat", 3, DEC, NOV, HID, ATC, STG}, /* 9 */
-{"openat", 4, DEC, NOV, HID, ATC, STG, OPN}, /* N - 2 */
-{"openat64", 4, DEC, NOV, HID, ATC, STG, OPN}, /* N - 1 */
-};
-#define NFSATSYSCODE (sizeof (fsatsystable) / sizeof (struct systable))
-
static const struct systable lwpparktable[] = {
{"lwp_park", 3, DEC, NOV, HID, HEX, DEC}, /* 0 */
{"lwp_unpark", 2, DEC, NOV, HID, DEC}, /* 1 */
@@ -836,6 +876,8 @@ const struct systable utimesystable[] = {
const struct sysalias sysalias[] = {
{ "exit", SYS_exit },
{ "fork", SYS_forksys },
+ { "fork1", SYS_forksys },
+ { "forkall", SYS_forksys },
{ "forkx", SYS_forksys },
{ "forkallx", SYS_forksys },
{ "vforkx", SYS_forksys },
@@ -927,6 +969,7 @@ const struct sysalias sysalias[] = {
{ "putacct", SYS_exacctsys },
{ "wracct", SYS_exacctsys },
{ "lwp_cond_timedwait", SYS_lwp_cond_wait },
+ { "lwp_sema_wait", SYS_lwp_sema_timedwait },
{ "lwp_park", SYS_lwp_park },
{ "lwp_unpark", SYS_lwp_park },
{ "lwp_unpark_all", SYS_lwp_park },
@@ -935,17 +978,11 @@ const struct sysalias sysalias[] = {
{ "lwp_rwlock_tryrdlock", SYS_lwp_rwlock_sys },
{ "lwp_rwlock_trywrlock", SYS_lwp_rwlock_sys },
{ "lwp_rwlock_unlock", SYS_lwp_rwlock_sys },
+ { "lwp_mutex_lock", SYS_lwp_mutex_timedlock },
{ "sendfilev64", SYS_sendfilev },
- { "openat", SYS_fsat },
- { "openat64", SYS_fsat },
- { "fstatat64", SYS_fsat },
- { "fstatat", SYS_fsat },
- { "fchownat", SYS_fsat },
- { "unlinkat", SYS_fsat },
- { "futimesat", SYS_fsat },
- { "renameat", SYS_fsat },
- { "faccessat", SYS_fsat },
- { "__openattrdirat", SYS_fsat },
+ { "creat", SYS_open },
+ { "creat64", SYS_open64 },
+ { "openattrdirat", SYS_openat },
{ "lgrpsys", SYS_lgrpsys },
{ "getrusage", SYS_rusagesys },
{ "getrusage_chld", SYS_rusagesys },
@@ -987,6 +1024,9 @@ const struct sysalias sysalias[] = {
{ "allocids", SYS_sidsys },
{ "futimens", SYS_utimesys },
{ "utimensat", SYS_utimesys },
+ { "poll", SYS_pollsys },
+ { "umount", SYS_umount2 },
+ { "wait", SYS_waitid },
{ NULL, 0 } /* end-of-list */
};
@@ -1000,6 +1040,38 @@ subsys(int syscall, int subcode)
if (subcode != -1) {
switch (syscall) {
+ case SYS_faccessat:
+ if ((unsigned)subcode < NACCESSCODE)
+ stp = &faccessattable[subcode];
+ break;
+ case SYS_fchownat:
+ if ((unsigned)subcode < NCHOWNCODE)
+ stp = &fchownattable[subcode];
+ break;
+ case SYS_renameat:
+ if ((unsigned)subcode < NRENAMECODE)
+ stp = &renameattable[subcode];
+ break;
+ case SYS_unlinkat:
+ if ((unsigned)subcode < NUNLINKCODE)
+ stp = &unlinkattable[subcode];
+ break;
+ case SYS_fstatat:
+ if ((unsigned)subcode < NSTATCODE)
+ stp = &fstatattable[subcode];
+ break;
+ case SYS_fstatat64:
+ if ((unsigned)subcode < NSTAT64CODE)
+ stp = &fstatat64table[subcode];
+ break;
+ case SYS_openat:
+ if ((unsigned)subcode < NOPENATCODE)
+ stp = &openattable[subcode];
+ break;
+ case SYS_openat64:
+ if ((unsigned)subcode < NOPENAT64CODE)
+ stp = &openat64table[subcode];
+ break;
case SYS_open:
if ((unsigned)subcode < NOPENCODE)
stp = &opentable[subcode];
@@ -1072,10 +1144,6 @@ subsys(int syscall, int subcode)
if ((unsigned)subcode < NEXACCTSYSCODE)
stp = &exacctsystable[subcode];
break;
- case SYS_fsat:
- if ((unsigned)subcode < NFSATSYSCODE)
- stp = &fsatsystable[subcode];
- break;
case SYS_privsys: /* privileges */
if ((unsigned)subcode < NPRIVSYSCODE)
stp = &privsystable[subcode];
@@ -1208,42 +1276,70 @@ getsubcode(private_t *pri)
int subcode = -1;
int arg0;
- if (syscall > 0 && nsysarg > 0) {
+ if (syscall > 0 && nsysarg > 0 && !prismember(&rawout, syscall)) {
arg0 = Lsp->pr_sysarg[0];
switch (syscall) {
case SYS_utssys: /* utssys() */
if (nsysarg > 2)
subcode = Lsp->pr_sysarg[2];
break;
- case SYS_open: /* open() w/ and w/o O_CREAT */
- case SYS_open64:
- if (nsysarg > 1)
- subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
+ case SYS_faccessat:
+ if (nsysarg > 3)
+ subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
+ Lsp->pr_sysarg[3] == 0)? 1 : 0;
break;
- case SYS_fsat:
- switch (arg0) {
- case 0: /* openat */
- if (nsysarg > 3)
- subcode =
- (Lsp->pr_sysarg[3] & O_CREAT) ?
- 0 : NFSATSYSCODE - 2;
+ case SYS_fchownat:
+ if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
+ subcode = 3;
break;
- case 1: /* openat64 */
- if (nsysarg > 3)
- subcode =
- (Lsp->pr_sysarg[3] & O_CREAT) ?
- 1 : NFSATSYSCODE - 1;
+ }
+ if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
+ subcode = 0;
+ break;
+ }
+ if (nsysarg > 4)
+ subcode = (Lsp->pr_sysarg[4] == 0)? 1 :
+ (Lsp->pr_sysarg[4] == AT_SYMLINK_NOFOLLOW)?
+ 2 : 0;
+ break;
+ case SYS_renameat:
+ if (nsysarg > 2)
+ subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD &&
+ (int)Lsp->pr_sysarg[2] == AT_FDCWD)? 1 : 0;
+ break;
+ case SYS_unlinkat:
+ if (nsysarg > 2)
+ subcode =
+ ((int)Lsp->pr_sysarg[0] != AT_FDCWD)? 0 :
+ (Lsp->pr_sysarg[2] == AT_REMOVEDIR)? 2 :
+ (Lsp->pr_sysarg[2] == 0)? 1 : 0;
+ break;
+ case SYS_fstatat:
+ case SYS_fstatat64:
+ if (nsysarg > 1 && Lsp->pr_sysarg[1] == NULL) {
+ subcode = 3;
break;
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- subcode = arg0;
}
+ if (nsysarg > 0 && (int)Lsp->pr_sysarg[0] != AT_FDCWD) {
+ subcode = 0;
+ break;
+ }
+ if (nsysarg > 3)
+ subcode = (Lsp->pr_sysarg[3] == 0)? 1 :
+ (Lsp->pr_sysarg[3] == AT_SYMLINK_NOFOLLOW)?
+ 2 : 0;
+ break;
+ case SYS_openat: /* openat() w/ and w/o AT_FDCWD */
+ case SYS_openat64: /* and with and w/o O_CREAT */
+ if (nsysarg > 2)
+ subcode = ((int)Lsp->pr_sysarg[0] == AT_FDCWD)?
+ ((Lsp->pr_sysarg[2] & O_CREAT)? 3 : 2) :
+ ((Lsp->pr_sysarg[2] & O_CREAT)? 1 : 0);
+ break;
+ case SYS_open: /* open() w/ and w/o O_CREAT */
+ case SYS_open64:
+ if (nsysarg > 1)
+ subcode = (Lsp->pr_sysarg[1] & O_CREAT)? 1 : 0;
break;
case SYS_kaio: /* kaio() */
subcode = arg0 & ~AIO_POLL_BIT;
@@ -1317,6 +1413,14 @@ int
maxsyscalls()
{
return (PRMAXSYS + 1
+ + NACCESSCODE - 1
+ + NCHOWNCODE - 1
+ + NRENAMECODE - 1
+ + NUNLINKCODE - 1
+ + NSTATCODE - 1
+ + NSTAT64CODE - 1
+ + NOPENATCODE - 1
+ + NOPENAT64CODE - 1
+ NOPENCODE - 1
+ NOPEN64CODE - 1
+ NMSGCODE - 1
@@ -1335,7 +1439,6 @@ maxsyscalls()
+ NLWPCREATECODE - 1
+ NTASKSYSCODE - 1
+ NEXACCTSYSCODE - 1
- + NFSATSYSCODE - 1
+ NLWPPARKCODE - 1
+ NLWPRWLOCKCODE - 1
+ NSENDFILESYSCODE - 1
@@ -1360,53 +1463,67 @@ int
nsubcodes(int syscall)
{
switch (syscall) {
+ case SYS_faccessat:
+ return (NACCESSCODE);
+ case SYS_fchownat:
+ return (NCHOWNCODE);
+ case SYS_renameat:
+ return (NRENAMECODE);
+ case SYS_unlinkat:
+ return (NUNLINKCODE);
+ case SYS_fstatat:
+ return (NSTATCODE);
+ case SYS_fstatat64:
+ return (NSTAT64CODE);
+ case SYS_openat:
+ return (NOPENATCODE);
+ case SYS_openat64:
+ return (NOPENAT64CODE);
case SYS_open:
return (NOPENCODE);
case SYS_open64:
return (NOPEN64CODE);
- case SYS_msgsys: /* msgsys() */
+ case SYS_msgsys:
return (NMSGCODE);
- case SYS_semsys: /* semsys() */
+ case SYS_semsys:
return (NSEMCODE);
- case SYS_shmsys: /* shmsys() */
+ case SYS_shmsys:
return (NSHMCODE);
- case SYS_pgrpsys: /* pgrpsys() */
+ case SYS_pgrpsys:
return (NPIDCODE);
- case SYS_utssys: /* utssys() */
+ case SYS_utssys:
return (NUTSCODE);
- case SYS_sysfs: /* sysfs() */
+ case SYS_sysfs:
return (NSFSCODE);
- case SYS_sigpending: /* sigpending()/sigfillset() */
+ case SYS_sigpending:
return (NSGPCODE);
- case SYS_context: /* [get|set]context() */
+ case SYS_context:
return (NCTXCODE);
- case SYS_hrtsys: /* hrtsys() */
+ case SYS_hrtsys:
return (NHRTCODE);
- case SYS_corectl: /* corectl() */
+ case SYS_corectl:
return (NCORCODE);
- case SYS_kaio: /* kaio() */
+ case SYS_kaio:
return (NAIOCODE);
- case SYS_door: /* doors */
+ case SYS_door:
return (NDOORCODE);
- case SYS_pset: /* pset() */
+ case SYS_pset:
return (NPSETCODE);
- case SYS_lwp_create: /* lwp_create() */
+ case SYS_lwp_create:
return (NLWPCREATECODE);
- case SYS_tasksys: /* tasks */
+ case SYS_tasksys:
return (NTASKSYSCODE);
- case SYS_exacctsys: /* exacct */
+ case SYS_exacctsys:
return (NEXACCTSYSCODE);
- case SYS_fsat:
- return (NFSATSYSCODE);
- case SYS_privsys: /* privileges */
+ case SYS_privsys:
return (NPRIVSYSCODE);
- case SYS_lwp_park: /* lwp_park */
+ case SYS_lwp_park:
return (NLWPPARKCODE);
case SYS_lwp_rwlock_sys:
return (NLWPRWLOCKCODE);
- case SYS_sendfilev: /* sendfilev */
+ case SYS_sendfilev:
return (NSENDFILESYSCODE);
- case SYS_lgrpsys: /* lgrpsys */
+ case SYS_lgrpsys:
return (NLGRPSYSCODE);
case SYS_rusagesys:
return (NRUSAGESYSCODE);
@@ -1416,7 +1533,7 @@ nsubcodes(int syscall)
return (NUCREDSYSCODE);
case SYS_port:
return (NPORTCODE);
- case SYS_zone: /* zone */
+ case SYS_zone:
return (NZONECODE);
case SYS_labelsys:
return (NLABELCODE);