svn commit: r288955 - in user/ngie/more-tests2: lib/clang lib/libarchive lib/libarchive/test lib/libarchive/tests lib/libc++ lib/libprocstat lib/libutil release/doc/en_US.ISO8859-1/relnotes share/m...
Garrett Cooper
ngie at FreeBSD.org
Tue Oct 6 21:43:41 UTC 2015
Author: ngie
Date: Tue Oct 6 21:43:37 2015
New Revision: 288955
URL: https://svnweb.freebsd.org/changeset/base/288955
Log:
MFhead @ r288954
Added:
user/ngie/more-tests2/lib/libarchive/tests/
- copied from r288954, user/ngie/more-tests2/lib/libarchive/test/
Deleted:
user/ngie/more-tests2/lib/libarchive/test/
Modified:
user/ngie/more-tests2/lib/clang/clang.build.mk
user/ngie/more-tests2/lib/libarchive/Makefile
user/ngie/more-tests2/lib/libarchive/tests/Makefile
user/ngie/more-tests2/lib/libc++/Makefile
user/ngie/more-tests2/lib/libprocstat/libprocstat.c
user/ngie/more-tests2/lib/libutil/kinfo_getvmmap.c
user/ngie/more-tests2/release/doc/en_US.ISO8859-1/relnotes/article.xml
user/ngie/more-tests2/share/man/man5/core.5
user/ngie/more-tests2/sys/dev/drm2/i915/i915_drv.c
user/ngie/more-tests2/sys/kern/imgact_elf.c
user/ngie/more-tests2/sys/kern/kern_exec.c
user/ngie/more-tests2/sys/kern/kern_fork.c
user/ngie/more-tests2/sys/kern/kern_proc.c
user/ngie/more-tests2/sys/kern/subr_syscall.c
user/ngie/more-tests2/sys/sys/exec.h
user/ngie/more-tests2/sys/sys/proc.h
user/ngie/more-tests2/sys/sys/user.h
user/ngie/more-tests2/tests/sys/kern/Makefile
user/ngie/more-tests2/tests/sys/kern/ptrace_test.c
user/ngie/more-tests2/usr.bin/truss/syscalls.c
Directory Properties:
user/ngie/more-tests2/ (props changed)
user/ngie/more-tests2/lib/libutil/ (props changed)
user/ngie/more-tests2/share/ (props changed)
user/ngie/more-tests2/sys/ (props changed)
Modified: user/ngie/more-tests2/lib/clang/clang.build.mk
==============================================================================
--- user/ngie/more-tests2/lib/clang/clang.build.mk Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/clang/clang.build.mk Tue Oct 6 21:43:37 2015 (r288955)
@@ -247,9 +247,11 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/Static
-I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \
${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
-.for dep in ${TGHDRS:C/$/.inc.d/}
-. sinclude "${dep}"
-.endfor
+.if !make(depend)
+. for dep in ${TGHDRS:C/$/.inc.d/}
+. sinclude "${dep}"
+. endfor
+.endif
SRCS+= ${TGHDRS:C/$/.inc.h/}
DPSRCS+= ${TGHDRS:C/$/.inc.h/}
Modified: user/ngie/more-tests2/lib/libarchive/Makefile
==============================================================================
--- user/ngie/more-tests2/lib/libarchive/Makefile Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/libarchive/Makefile Tue Oct 6 21:43:37 2015 (r288955)
@@ -398,11 +398,8 @@ MLINKS+= archive_write_set_options.3 arc
MLINKS+= archive_write_set_options.3 archive_write_set_option.3
MLINKS+= libarchive.3 archive.3
-.PHONY: check test clean-test
-check test:
- cd ${.CURDIR}/test && make obj && make test
-
-clean-test:
- cd ${.CURDIR}/test && make clean
+.if ${MK_TESTS} != "no"
+#SUBDIR+= tests
+.endif
.include <bsd.lib.mk>
Modified: user/ngie/more-tests2/lib/libarchive/tests/Makefile
==============================================================================
--- user/ngie/more-tests2/lib/libarchive/test/Makefile Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/libarchive/tests/Makefile Tue Oct 6 21:43:37 2015 (r288955)
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBARCHIVEDIR= ${.CURDIR}/../../../contrib/libarchive
+LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
MAN=
Modified: user/ngie/more-tests2/lib/libc++/Makefile
==============================================================================
--- user/ngie/more-tests2/lib/libc++/Makefile Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/libc++/Makefile Tue Oct 6 21:43:37 2015 (r288955)
@@ -63,7 +63,6 @@ CXXFLAGS+= -std=c++11
.endif
LIBADD+= cxxrt
-LDFLAGS+= --verbose
INCSGROUPS= STD EXP EXT
STD_HEADERS= __bit_reference\
Modified: user/ngie/more-tests2/lib/libprocstat/libprocstat.c
==============================================================================
--- user/ngie/more-tests2/lib/libprocstat/libprocstat.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/libprocstat/libprocstat.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -1867,6 +1867,8 @@ kinfo_getvmmap_core(struct procstat_core
eb = buf + len;
while (bp < eb) {
kv = (struct kinfo_vmentry *)(uintptr_t)bp;
+ if (kv->kve_structsize == 0)
+ break;
bp += kv->kve_structsize;
cnt++;
}
@@ -1882,6 +1884,8 @@ kinfo_getvmmap_core(struct procstat_core
/* Pass 2: unpack */
while (bp < eb) {
kv = (struct kinfo_vmentry *)(uintptr_t)bp;
+ if (kv->kve_structsize == 0)
+ break;
/* Copy/expand into pre-zeroed buffer */
memcpy(kp, kv, kv->kve_structsize);
/* Advance to next packed record */
Modified: user/ngie/more-tests2/lib/libutil/kinfo_getvmmap.c
==============================================================================
--- user/ngie/more-tests2/lib/libutil/kinfo_getvmmap.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/lib/libutil/kinfo_getvmmap.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -44,6 +44,8 @@ kinfo_getvmmap(pid_t pid, int *cntp)
eb = buf + len;
while (bp < eb) {
kv = (struct kinfo_vmentry *)(uintptr_t)bp;
+ if (kv->kve_structsize == 0)
+ break;
bp += kv->kve_structsize;
cnt++;
}
@@ -59,6 +61,8 @@ kinfo_getvmmap(pid_t pid, int *cntp)
/* Pass 2: unpack */
while (bp < eb) {
kv = (struct kinfo_vmentry *)(uintptr_t)bp;
+ if (kv->kve_structsize == 0)
+ break;
/* Copy/expand into pre-zeroed buffer */
memcpy(kp, kv, kv->kve_structsize);
/* Advance to next packed record */
Modified: user/ngie/more-tests2/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- user/ngie/more-tests2/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Oct 6 21:43:37 2015 (r288955)
@@ -22,7 +22,7 @@
<pubdate>$FreeBSD$</pubdate>
- <!-- Last rev: 284814 -->
+ <!-- Last rev: 288943 -->
<copyright>
<year>2015</year>
@@ -457,26 +457,15 @@
<sect2 xml:id="userland-contrib">
<title>Contributed Software</title>
- <para revision="258884" contrib="sponsor"
- sponsor="&darpa_afrl;">&man.lldb.1; has been updated to
- upstream snapshot version r196259.</para>
-
<para revision="260445">&man.byacc.1; has been updated to
version 20140101.</para>
- <para revision="261283"><application>libc++</application> has
- been updated to version 3.4.</para>
-
<para revision="261320"><application>OpenSSH</application> has
been updated to 6.5p1.</para>
<para revision="261344"><application>mdocml</application> has
been updated to version 1.12.3.</para>
- <para revision="261991"><application>LLVM</application> and
- <application>Clang</application> have been updated to
- version 3.4.</para>
-
<para revision="275718">The <application>binutils</application>
suite of utilities has been updated to include upstream
patches that add new relocations for &arch.powerpc;
@@ -595,6 +584,10 @@
<para revision="288303">The &man.nc.1; utility has been updated
to the OpenBSD 5.8 version.</para>
+
+ <para revision="288943"><application>LLVM</application> and
+ <application>Clang</application> have been updated to
+ version 3.7.0.</para>
</sect2>
<sect2 xml:id="userland-installer">
Modified: user/ngie/more-tests2/share/man/man5/core.5
==============================================================================
--- user/ngie/more-tests2/share/man/man5/core.5 Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/share/man/man5/core.5 Tue Oct 6 21:43:37 2015 (r288955)
@@ -28,7 +28,7 @@
.\" @(#)core.5 8.3 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd September 2, 2015
+.Dd October 5, 2015
.Dt CORE 5
.Os
.Sh NAME
@@ -130,6 +130,19 @@ All file descriptor information can be p
This potentially wastes up to PATH_MAX bytes per open fd.
Packing is disabled with
.Dl sysctl kern.coredump_pack_fileinfo=0 .
+.Pp
+Similarly, corefiles are written with vmmap information as an ELF note, which
+contains file paths.
+By default, they are packed to only use as much space as
+needed.
+By the same mechanism as for the open files note, these paths can also
+change at any time and result in a truncated note.
+.Pp
+All vmmap information can be preserved by disabling packing.
+Like the file information, this potentially wastes up to PATH_MAX bytes per
+mapped object.
+Packing is disabled with
+.Dl sysctl kern.coredump_pack_vmmapinfo=0 .
.Sh EXAMPLES
In order to store all core images in per-user private areas under
.Pa /var/coredumps ,
Modified: user/ngie/more-tests2/sys/dev/drm2/i915/i915_drv.c
==============================================================================
--- user/ngie/more-tests2/sys/dev/drm2/i915/i915_drv.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/dev/drm2/i915/i915_drv.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -894,7 +894,6 @@ int intel_gpu_reset(struct drm_device *d
case 4:
ret = i965_do_reset(dev);
break;
- case 3:
case 2:
ret = i8xx_do_reset(dev);
break;
Modified: user/ngie/more-tests2/sys/kern/imgact_elf.c
==============================================================================
--- user/ngie/more-tests2/sys/kern/imgact_elf.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/kern/imgact_elf.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -1959,24 +1959,30 @@ note_procstat_vmmap(void *arg, struct sb
{
struct proc *p;
size_t size;
- int structsize;
+ int structsize, vmmap_flags;
+
+ if (coredump_pack_vmmapinfo)
+ vmmap_flags = KERN_VMMAP_PACK_KINFO;
+ else
+ vmmap_flags = 0;
p = (struct proc *)arg;
+ structsize = sizeof(struct kinfo_vmentry);
if (sb == NULL) {
size = 0;
sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN);
sbuf_set_drain(sb, sbuf_drain_count, &size);
sbuf_bcat(sb, &structsize, sizeof(structsize));
PROC_LOCK(p);
- kern_proc_vmmap_out(p, sb);
+ kern_proc_vmmap_out(p, sb, -1, vmmap_flags);
sbuf_finish(sb);
sbuf_delete(sb);
*sizep = size;
} else {
- structsize = sizeof(struct kinfo_vmentry);
sbuf_bcat(sb, &structsize, sizeof(structsize));
PROC_LOCK(p);
- kern_proc_vmmap_out(p, sb);
+ kern_proc_vmmap_out(p, sb, *sizep - sizeof(structsize),
+ vmmap_flags);
}
}
Modified: user/ngie/more-tests2/sys/kern/kern_exec.c
==============================================================================
--- user/ngie/more-tests2/sys/kern/kern_exec.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/kern/kern_exec.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -105,6 +105,11 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_pac
&coredump_pack_fileinfo, 0,
"Enable file path packing in 'procstat -f' coredump notes");
+int coredump_pack_vmmapinfo = 1;
+SYSCTL_INT(_kern, OID_AUTO, coredump_pack_vmmapinfo, CTLFLAG_RWTUN,
+ &coredump_pack_vmmapinfo, 0,
+ "Enable file path packing in 'procstat -v' coredump notes");
+
static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS);
static int sysctl_kern_usrstack(SYSCTL_HANDLER_ARGS);
static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS);
Modified: user/ngie/more-tests2/sys/kern/kern_fork.c
==============================================================================
--- user/ngie/more-tests2/sys/kern/kern_fork.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/kern/kern_fork.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/procdesc.h>
#include <sys/pioctl.h>
+#include <sys/ptrace.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
@@ -1031,8 +1032,8 @@ fork_return(struct thread *td, struct tr
{
struct proc *p, *dbg;
+ p = td->td_proc;
if (td->td_dbgflags & TDB_STOPATFORK) {
- p = td->td_proc;
sx_xlock(&proctree_lock);
PROC_LOCK(p);
if ((p->p_pptr->p_flag & (P_TRACED | P_FOLLOWFORK)) ==
@@ -1049,9 +1050,9 @@ fork_return(struct thread *td, struct tr
p->p_pid, p->p_oppid);
proc_reparent(p, dbg);
sx_xunlock(&proctree_lock);
- td->td_dbgflags |= TDB_CHILD;
+ td->td_dbgflags |= TDB_CHILD | TDB_SCX;
ptracestop(td, SIGSTOP);
- td->td_dbgflags &= ~TDB_CHILD;
+ td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX);
} else {
/*
* ... otherwise clear the request.
@@ -1061,6 +1062,18 @@ fork_return(struct thread *td, struct tr
cv_broadcast(&p->p_dbgwait);
}
PROC_UNLOCK(p);
+ } else if (p->p_flag & P_TRACED) {
+ /*
+ * This is the start of a new thread in a traced
+ * process. Report a system call exit event.
+ */
+ PROC_LOCK(p);
+ td->td_dbgflags |= TDB_SCX;
+ _STOPEVENT(p, S_SCX, td->td_dbg_sc_code);
+ if ((p->p_stops & S_PT_SCX) != 0)
+ ptracestop(td, SIGTRAP);
+ td->td_dbgflags &= ~TDB_SCX;
+ PROC_UNLOCK(p);
}
userret(td, frame);
Modified: user/ngie/more-tests2/sys/kern/kern_proc.c
==============================================================================
--- user/ngie/more-tests2/sys/kern/kern_proc.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/kern/kern_proc.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -2252,7 +2252,7 @@ next:;
* Must be called with the process locked and will return unlocked.
*/
int
-kern_proc_vmmap_out(struct proc *p, struct sbuf *sb)
+kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags)
{
vm_map_entry_t entry, tmp_entry;
struct vattr va;
@@ -2276,7 +2276,7 @@ kern_proc_vmmap_out(struct proc *p, stru
PRELE(p);
return (ESRCH);
}
- kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK);
+ kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK | M_ZERO);
error = 0;
map = &vm->vm_map;
@@ -2411,10 +2411,23 @@ kern_proc_vmmap_out(struct proc *p, stru
free(freepath, M_TEMP);
/* Pack record size down */
- kve->kve_structsize = offsetof(struct kinfo_vmentry, kve_path) +
- strlen(kve->kve_path) + 1;
+ if ((flags & KERN_VMMAP_PACK_KINFO) != 0)
+ kve->kve_structsize =
+ offsetof(struct kinfo_vmentry, kve_path) +
+ strlen(kve->kve_path) + 1;
+ else
+ kve->kve_structsize = sizeof(*kve);
kve->kve_structsize = roundup(kve->kve_structsize,
sizeof(uint64_t));
+
+ /* Halt filling and truncate rather than exceeding maxlen */
+ if (maxlen != -1 && maxlen < kve->kve_structsize) {
+ error = 0;
+ vm_map_lock_read(map);
+ break;
+ } else if (maxlen != -1)
+ maxlen -= kve->kve_structsize;
+
if (sbuf_bcat(sb, kve, kve->kve_structsize) != 0)
error = ENOMEM;
vm_map_lock_read(map);
@@ -2447,7 +2460,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
sbuf_delete(&sb);
return (error);
}
- error = kern_proc_vmmap_out(p, &sb);
+ error = kern_proc_vmmap_out(p, &sb, -1, KERN_VMMAP_PACK_KINFO);
error2 = sbuf_finish(&sb);
sbuf_delete(&sb);
return (error != 0 ? error : error2);
Modified: user/ngie/more-tests2/sys/kern/subr_syscall.c
==============================================================================
--- user/ngie/more-tests2/sys/kern/subr_syscall.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/kern/subr_syscall.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -83,11 +83,12 @@ syscallenter(struct thread *td, struct s
if (error == 0) {
STOPEVENT(p, S_SCE, sa->narg);
- if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) {
+ if (p->p_flag & P_TRACED) {
PROC_LOCK(p);
td->td_dbg_sc_code = sa->code;
td->td_dbg_sc_narg = sa->narg;
- ptracestop((td), SIGTRAP);
+ if (p->p_stops & S_PT_SCE)
+ ptracestop((td), SIGTRAP);
PROC_UNLOCK(p);
}
if (td->td_dbgflags & TDB_USERWR) {
Modified: user/ngie/more-tests2/sys/sys/exec.h
==============================================================================
--- user/ngie/more-tests2/sys/sys/exec.h Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/sys/exec.h Tue Oct 6 21:43:37 2015 (r288955)
@@ -84,6 +84,7 @@ int exec_register(const struct execsw *)
int exec_unregister(const struct execsw *);
extern int coredump_pack_fileinfo;
+extern int coredump_pack_vmmapinfo;
/*
* note: name##_mod cannot be const storage because the
Modified: user/ngie/more-tests2/sys/sys/proc.h
==============================================================================
--- user/ngie/more-tests2/sys/sys/proc.h Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/sys/proc.h Tue Oct 6 21:43:37 2015 (r288955)
@@ -235,8 +235,6 @@ struct thread {
int td_sqqueue; /* (t) Sleepqueue queue blocked on. */
void *td_wchan; /* (t) Sleep address. */
const char *td_wmesg; /* (t) Reason for sleep. */
- int td_lastcpu; /* (t) Last cpu we were on. */
- int td_oncpu; /* (t) Which cpu we are on. */
volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */
u_char td_tsqueue; /* (t) Turnstile queue blocked on. */
short td_locks; /* (k) Debug: count of non-spin locks */
@@ -283,8 +281,6 @@ struct thread {
int td_no_sleeping; /* (k) Sleeping disabled count. */
int td_dom_rr_idx; /* (k) RR Numa domain selection. */
void *td_su; /* (k) FFS SU private */
- u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */
- u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/
#define td_endzero td_sigmask
/* Copied during fork1() or create_thread(). */
@@ -296,6 +292,8 @@ struct thread {
u_char td_pri_class; /* (t) Scheduling class. */
u_char td_user_pri; /* (t) User pri from estcpu and nice. */
u_char td_base_user_pri; /* (t) Base user pri */
+ u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */
+ u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/
#define td_endcopy td_pcb
/*
@@ -335,6 +333,8 @@ struct thread {
struct vm_page **td_ma; /* (k) uio pages held */
int td_ma_cnt; /* (k) size of *td_ma */
void *td_emuldata; /* Emulator state data */
+ int td_lastcpu; /* (t) Last cpu we were on. */
+ int td_oncpu; /* (t) Which cpu we are on. */
};
struct mtx *thread_lock_block(struct thread *);
Modified: user/ngie/more-tests2/sys/sys/user.h
==============================================================================
--- user/ngie/more-tests2/sys/sys/user.h Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/sys/sys/user.h Tue Oct 6 21:43:37 2015 (r288955)
@@ -541,6 +541,9 @@ struct kinfo_sigtramp {
/* Flags for kern_proc_filedesc_out. */
#define KERN_FILEDESC_PACK_KINFO 0x00000001U
+
+/* Flags for kern_proc_vmmap_out. */
+#define KERN_VMMAP_PACK_KINFO 0x00000001U
struct sbuf;
/*
@@ -556,7 +559,8 @@ int kern_proc_filedesc_out(struct proc *
int flags);
int kern_proc_cwd_out(struct proc *p, struct sbuf *sb, ssize_t maxlen);
int kern_proc_out(struct proc *p, struct sbuf *sb, int flags);
-int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb);
+int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen,
+ int flags);
int vntype_to_kinfo(int vtype);
#endif /* !_KERNEL */
Modified: user/ngie/more-tests2/tests/sys/kern/Makefile
==============================================================================
--- user/ngie/more-tests2/tests/sys/kern/Makefile Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/tests/sys/kern/Makefile Tue Oct 6 21:43:37 2015 (r288955)
@@ -7,6 +7,7 @@ ATF_TESTS_C+= ptrace_test
ATF_TESTS_C+= unix_seqpacket_test
TEST_METADATA.unix_seqpacket_test+= timeout="15"
+LDADD.ptrace_test+= -lpthread
LDADD.unix_seqpacket_test+= -lpthread
WARNS?= 5
Modified: user/ngie/more-tests2/tests/sys/kern/ptrace_test.c
==============================================================================
--- user/ngie/more-tests2/tests/sys/kern/ptrace_test.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/tests/sys/kern/ptrace_test.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -29,10 +29,12 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ptrace.h>
+#include <sys/syscall.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <sys/wait.h>
#include <errno.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -409,12 +411,15 @@ ATF_TC_BODY(ptrace__parent_sees_exit_aft
* debugger is attached to it.
*/
static __dead2 void
-follow_fork_parent(void)
+follow_fork_parent(bool use_vfork)
{
pid_t fpid, wpid;
int status;
- CHILD_REQUIRE((fpid = fork()) != -1);
+ if (use_vfork)
+ CHILD_REQUIRE((fpid = vfork()) != -1);
+ else
+ CHILD_REQUIRE((fpid = fork()) != -1);
if (fpid == 0)
/* Child */
@@ -434,7 +439,7 @@ follow_fork_parent(void)
* child process.
*/
static pid_t
-handle_fork_events(pid_t parent)
+handle_fork_events(pid_t parent, struct ptrace_lwpinfo *ppl)
{
struct ptrace_lwpinfo pl;
bool fork_reported[2];
@@ -469,6 +474,8 @@ handle_fork_events(pid_t parent)
child = wpid;
else
ATF_REQUIRE(child == wpid);
+ if (ppl != NULL)
+ ppl[1] = pl;
fork_reported[1] = true;
} else {
ATF_REQUIRE(wpid == parent);
@@ -478,6 +485,8 @@ handle_fork_events(pid_t parent)
child = pl.pl_child_pid;
else
ATF_REQUIRE(child == pl.pl_child_pid);
+ if (ppl != NULL)
+ ppl[0] = pl;
fork_reported[0] = true;
}
}
@@ -499,7 +508,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_att
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -516,7 +525,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_att
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -555,7 +564,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_de
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -572,7 +581,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_de
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -606,7 +615,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_d
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
trace_me();
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -623,7 +632,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_d
/* Continue the child ignoring the SIGSTOP. */
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_DETACH, children[0], (caddr_t)1, 0) != -1);
@@ -688,7 +697,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_att
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -715,7 +724,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_att
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -756,7 +765,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_de
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -783,7 +792,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_de
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
@@ -819,7 +828,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_d
ATF_REQUIRE((fpid = fork()) != -1);
if (fpid == 0) {
attach_fork_parent(cpipe);
- follow_fork_parent();
+ follow_fork_parent(false);
}
/* Parent process. */
@@ -846,7 +855,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_d
/* Signal the fork parent to continue. */
close(cpipe[0]);
- children[1] = handle_fork_events(children[0]);
+ children[1] = handle_fork_events(children[0], NULL);
ATF_REQUIRE(children[1] > 0);
ATF_REQUIRE(ptrace(PT_DETACH, children[0], (caddr_t)1, 0) != -1);
@@ -952,6 +961,223 @@ ATF_TC_BODY(ptrace__getppid, tc)
ATF_REQUIRE(WEXITSTATUS(status) == 1);
}
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * child process created via fork() reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_fork);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_fork, tc)
+{
+ struct ptrace_lwpinfo pl[2];
+ pid_t children[2], fpid, wpid;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ trace_me();
+ follow_fork_parent(false);
+ }
+
+ /* Parent process. */
+ children[0] = fpid;
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(children[0], &status, 0);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1);
+
+ /* Continue the child ignoring the SIGSTOP. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+
+ /* Wait for both halves of the fork event to get reported. */
+ children[1] = handle_fork_events(children[0], pl);
+ ATF_REQUIRE(children[1] > 0);
+
+ ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl[0].pl_syscall_code == SYS_fork);
+ ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code);
+ ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg);
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1);
+
+ /*
+ * The child can't exit until the grandchild reports status, so the
+ * grandchild should report its exit first to the debugger.
+ */
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[1]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 2);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * child process created via vfork() reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_vfork);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_vfork, tc)
+{
+ struct ptrace_lwpinfo pl[2];
+ pid_t children[2], fpid, wpid;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ trace_me();
+ follow_fork_parent(true);
+ }
+
+ /* Parent process. */
+ children[0] = fpid;
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(children[0], &status, 0);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, children[0], NULL, 1) != -1);
+
+ /* Continue the child ignoring the SIGSTOP. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+
+ /* Wait for both halves of the fork event to get reported. */
+ children[1] = handle_fork_events(children[0], pl);
+ ATF_REQUIRE(children[1] > 0);
+
+ ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE((pl[1].pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl[0].pl_syscall_code == SYS_vfork);
+ ATF_REQUIRE(pl[0].pl_syscall_code == pl[1].pl_syscall_code);
+ ATF_REQUIRE(pl[0].pl_syscall_narg == pl[1].pl_syscall_narg);
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1);
+
+ /*
+ * The child can't exit until the grandchild reports status, so the
+ * grandchild should report its exit first to the debugger.
+ */
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[1]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 2);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == children[0]);
+ ATF_REQUIRE(WIFEXITED(status));
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
+static void *
+simple_thread(void *arg __unused)
+{
+
+ pthread_exit(NULL);
+}
+
+/*
+ * Verify that pl_syscall_code in struct ptrace_lwpinfo for a new
+ * thread reports the correct value.
+ */
+ATF_TC_WITHOUT_HEAD(ptrace__new_child_pl_syscall_code_thread);
+ATF_TC_BODY(ptrace__new_child_pl_syscall_code_thread, tc)
+{
+ struct ptrace_lwpinfo pl;
+ pid_t fpid, wpid;
+ lwpid_t main;
+ int status;
+
+ ATF_REQUIRE((fpid = fork()) != -1);
+ if (fpid == 0) {
+ pthread_t thread;
+
+ trace_me();
+
+ CHILD_REQUIRE(pthread_create(&thread, NULL, simple_thread,
+ NULL) == 0);
+ CHILD_REQUIRE(pthread_join(thread, NULL) == 0);
+ exit(1);
+ }
+
+ /* The first wait() should report the stop from SIGSTOP. */
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP);
+
+ ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl,
+ sizeof(pl)) != -1);
+ main = pl.pl_lwpid;
+
+ /*
+ * Continue the child ignoring the SIGSTOP and tracing all
+ * system call exits.
+ */
+ ATF_REQUIRE(ptrace(PT_TO_SCX, fpid, (caddr_t)1, 0) != -1);
+
+ /*
+ * Wait for the new thread to arrive. pthread_create() might
+ * invoke any number of system calls. For now we just wait
+ * for the new thread to arrive and make sure it reports a
+ * valid system call code. If ptrace grows thread event
+ * reporting then this test can be made more precise.
+ */
+ for (;;) {
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP);
+
+ ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl,
+ sizeof(pl)) != -1);
+ ATF_REQUIRE((pl.pl_flags & PL_FLAG_SCX) != 0);
+ ATF_REQUIRE(pl.pl_syscall_code != 0);
+ if (pl.pl_lwpid != main)
+ /* New thread seen. */
+ break;
+
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ }
+
+ /* Wait for the child to exit. */
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ for (;;) {
+ wpid = waitpid(fpid, &status, 0);
+ ATF_REQUIRE(wpid == fpid);
+ if (WIFEXITED(status))
+ break;
+
+ ATF_REQUIRE(WIFSTOPPED(status));
+ ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP);
+ ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0);
+ }
+
+ ATF_REQUIRE(WEXITSTATUS(status) == 1);
+
+ wpid = wait(&status);
+ ATF_REQUIRE(wpid == -1);
+ ATF_REQUIRE(errno == ECHILD);
+}
+
ATF_TP_ADD_TCS(tp)
{
@@ -968,6 +1194,9 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp,
ptrace__follow_fork_parent_detached_unrelated_debugger);
ATF_TP_ADD_TC(tp, ptrace__getppid);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_fork);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_vfork);
+ ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_thread);
return (atf_no_error());
}
Modified: user/ngie/more-tests2/usr.bin/truss/syscalls.c
==============================================================================
--- user/ngie/more-tests2/usr.bin/truss/syscalls.c Tue Oct 6 21:36:45 2015 (r288954)
+++ user/ngie/more-tests2/usr.bin/truss/syscalls.c Tue Oct 6 21:43:37 2015 (r288955)
@@ -90,191 +90,208 @@ __FBSDID("$FreeBSD$");
* This should probably be in its own file, sorted alphabetically.
*/
static struct syscall decoded_syscalls[] = {
- { .name = "fcntl", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } },
- { .name = "rfork", .ret_type = 1, .nargs = 1,
- .args = { { Rforkflags, 0 } } },
- { .name = "linux_readlink", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Name | OUT, 1 }, { Int, 2 } } },
- { .name = "linux_socketcall", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { LinuxSockArgs, 1 } } },
- { .name = "getpgid", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "getsid", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "readlink", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Readlinkres | OUT, 1 }, { Int, 2 } } },
- { .name = "readlinkat", .ret_type = 1, .nargs = 4,
- .args = { { Atfd, 0 }, { Name, 1 }, { Readlinkres | OUT, 2 },
+ /* Native ABI */
+ { .name = "__getcwd", .ret_type = 1, .nargs = 2,
+ .args = { { Name | OUT, 0 }, { Int, 1 } } },
+ { .name = "_umtx_op", .ret_type = 1, .nargs = 5,
+ .args = { { Ptr, 0 }, { Umtxop, 1 }, { LongHex, 2 }, { Ptr, 3 },
+ { Ptr, 4 } } },
+ { .name = "accept", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Sockaddr | OUT, 1 }, { Ptr | OUT, 2 } } },
+ { .name = "access", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
+ { .name = "bind", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } },
+ { .name = "bindat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
{ Int, 3 } } },
- { .name = "lseek", .ret_type = 2, .nargs = 3,
- .args = { { Int, 0 }, { QuadHex, 1 + QUAD_ALIGN },
- { Whence, 1 + QUAD_SLOTS + QUAD_ALIGN } } },
- { .name = "linux_lseek", .ret_type = 2, .nargs = 3,
- .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } },
- { .name = "mmap", .ret_type = 1, .nargs = 6,
- .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 },
- { Int, 4 }, { QuadHex, 5 + QUAD_ALIGN } } },
- { .name = "linux_mkdir", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Int, 1 } } },
- { .name = "mprotect", .ret_type = 1, .nargs = 3,
- .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } },
- { .name = "open", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { Open, 1 }, { Octal, 2 } } },
- { .name = "openat", .ret_type = 1, .nargs = 4,
- .args = { { Atfd, 0 }, { Name | IN, 1 }, { Open, 2 },
- { Octal, 3 } } },
- { .name = "mkdir", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Octal, 1 } } },
- { .name = "mkdirat", .ret_type = 1, .nargs = 3,
- .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
- { .name = "linux_open", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Hex, 1 }, { Octal, 2 } } },
- { .name = "close", .ret_type = 1, .nargs = 1,
- .args = { { Int, 0 } } },
- { .name = "link", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Name, 1 } } },
- { .name = "linkat", .ret_type = 1, .nargs = 5,
- .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 },
- { Atflags, 4 } } },
- { .name = "unlink", .ret_type = 1, .nargs = 1,
- .args = { { Name, 0 } } },
- { .name = "unlinkat", .ret_type = 1, .nargs = 3,
- .args = { { Atfd, 0 }, { Name, 1 }, { Atflags, 2 } } },
+ { .name = "break", .ret_type = 1, .nargs = 1,
+ .args = { { Ptr, 0 } } },
{ .name = "chdir", .ret_type = 1, .nargs = 1,
.args = { { Name, 0 } } },
- { .name = "chroot", .ret_type = 1, .nargs = 1,
- .args = { { Name, 0 } } },
- { .name = "mkfifo", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Octal, 1 } } },
- { .name = "mkfifoat", .ret_type = 1, .nargs = 3,
- .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 } } },
- { .name = "mknod", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Octal, 1 }, { Int, 2 } } },
- { .name = "mknodat", .ret_type = 1, .nargs = 4,
- .args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Int, 3 } } },
+ { .name = "chflags", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Hex, 1 } } },
{ .name = "chmod", .ret_type = 1, .nargs = 2,
.args = { { Name, 0 }, { Octal, 1 } } },
+ { .name = "chown", .ret_type = 1, .nargs = 3,
+ .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
+ { .name = "chroot", .ret_type = 1, .nargs = 1,
+ .args = { { Name, 0 } } },
+ { .name = "clock_gettime", .ret_type = 1, .nargs = 2,
+ .args = { { Int, 0 }, { Timespec | OUT, 1 } } },
+ { .name = "close", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
+ { .name = "connect", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Sockaddr | IN, 1 }, { Int, 2 } } },
+ { .name = "connectat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Int, 1 }, { Sockaddr | IN, 2 },
+ { Int, 3 } } },
+ { .name = "eaccess", .ret_type = 1, .nargs = 2,
+ .args = { { Name | IN, 0 }, { Accessmode, 1 } } },
+ { .name = "execve", .ret_type = 1, .nargs = 3,
+ .args = { { Name | IN, 0 }, { ExecArgs | IN, 1 },
+ { ExecEnv | IN, 2 } } },
+ { .name = "exit", .ret_type = 0, .nargs = 1,
+ .args = { { Hex, 0 } } },
+ { .name = "faccessat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Accessmode, 2 },
+ { Atflags, 3 } } },
{ .name = "fchmod", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { Octal, 1 } } },
- { .name = "lchmod", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Octal, 1 } } },
{ .name = "fchmodat", .ret_type = 1, .nargs = 4,
.args = { { Atfd, 0 }, { Name, 1 }, { Octal, 2 }, { Atflags, 3 } } },
- { .name = "chown", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
{ .name = "fchown", .ret_type = 1, .nargs = 3,
.args = { { Int, 0 }, { Int, 1 }, { Int, 2 } } },
- { .name = "lchown", .ret_type = 1, .nargs = 3,
- .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } },
{ .name = "fchownat", .ret_type = 1, .nargs = 5,
.args = { { Atfd, 0 }, { Name, 1 }, { Int, 2 }, { Int, 3 },
{ Atflags, 4 } } },
- { .name = "linux_stat64", .ret_type = 1, .nargs = 3,
- .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 } } },
- { .name = "mount", .ret_type = 1, .nargs = 4,
- .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } },
- { .name = "umount", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Int, 2 } } },
+ { .name = "fcntl", .ret_type = 1, .nargs = 3,
+ .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } },
{ .name = "fstat", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { Stat | OUT, 1 } } },
{ .name = "fstatat", .ret_type = 1, .nargs = 4,
.args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat | OUT, 2 },
{ Atflags, 3 } } },
- { .name = "stat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
- { .name = "statfs", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { StatFs | OUT, 1 } } },
{ .name = "fstatfs", .ret_type = 1, .nargs = 2,
.args = { { Int, 0 }, { StatFs | OUT, 1 } } },
- { .name = "lstat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } },
- { .name = "linux_newstat", .ret_type = 1, .nargs = 2,
- .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } },
- { .name = "linux_access", .ret_type = 1, .nargs = 2,
- .args = { { Name, 0 }, { Accessmode, 1 } } },
- { .name = "linux_newfstat", .ret_type = 1, .nargs = 2,
- .args = { { Int, 0 }, { Ptr | OUT, 1 } } },
- { .name = "write", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { BinString | IN, 1 }, { Int, 2 } } },
- { .name = "ioctl", .ret_type = 1, .nargs = 3,
- .args = { { Int, 0 }, { Ioctl, 1 }, { Hex, 2 } } },
- { .name = "break", .ret_type = 1, .nargs = 1,
- .args = { { Ptr, 0 } } },
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list