Commit Graph

21 Commits

Author SHA1 Message Date
alfred
fbf5f18034 When doing the initial open of the proc via procfs, complain if we are
unable to open the /proc/pid/mem file.  Otherwise doing a truss on
a nonexistant pid makes us return success even though no such process
exists.
2005-03-27 12:53:25 +00:00
alfred
187844b0ae I've been working on this somewhat so I'm moving the
parts I'm touching to be as style(9) compliant as I can.
2005-03-27 12:47:04 +00:00
dwmalone
d0190538be Move declarations of Procfd to a header file. 2004-01-07 14:29:45 +00:00
charnier
e6c3c12d23 Add FBSDID. Do not \n terminate warnx() argument. fprint() -> warnx(). 2003-09-07 15:50:43 +00:00
mdodd
c91f45bbc5 - Use time.h not sys/time.h.
- Fix printf format errors.

Submitted by:	 bde
2002-08-06 12:46:14 +00:00
bde
166c13c5dd Include <sys/time.h> for the declaration of struct timeval. Do not
depend on namespace pollution in <signal.h>.  (truss shouldn't be
using timevals anyway, since it was implemented long after timevals
were obsoleted by timespecs.)
2002-08-04 10:57:41 +00:00
mdodd
84294098fb Allow tracking fork()ed children.
PR:		 bin/25587 (in part)
MFC after:	3 weeks
2002-08-04 01:02:52 +00:00
mdodd
11473e5642 Parameterize globals.
PR:		bin/25587 (in part)
MFC after:	3 weeks
2002-08-04 00:46:48 +00:00
markm
d41e28d698 Partial WARNS=1 fizes with NO_WERROR set to prevent world breakage.
Use __FBSDID().
2001-12-11 23:34:02 +00:00
des
2d4ae62151 Back out part of previous commit: remove #include <sys/proc.h>. 2001-10-22 15:32:12 +00:00
des
9738c0ef71 #include <sys/proc.h> where needed (for the stop event definitions) and
reorder includes everywhere to conform to style(9).
2001-10-22 02:02:00 +00:00
sef
43c2df1ac6 Handle the case where we truss an SUGID program -- in particular, we need
to wake up any processes waiting via PIOCWAIT on process exit, and truss
needs to be more aware that a process may actually disappear while it's
waiting.

Reviewed by:	Paul Saab <ps@yahoo-inc.com>
2000-01-10 04:09:05 +00:00
peter
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
des
d55d163bcc Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
charnier
cd66b61113 Sort Xrefs. Use err(3). Remove uneeded #include.
Correct usage: one of {-p pid, command} is required.
Open output file when command line is fully analyzed: incorrect `truss -o f'
command does not create an empty file anymore.
1998-01-05 07:30:26 +00:00
sef
200a2249fa Add some copyright and license terms, at Jordan's request. Note that
syscall.h just refers to another file for the copyright notice.
1997-12-20 18:40:43 +00:00
sef
49436fdfd5 Change the ioctls for procfs around a bit; in particular, whever possible,
change from

	ioctl(fd, PIOC<foo>, &i);

to

	ioctl(fd, PIOC<foo>, i);

This is going from the _IOW to _IO ioctl macro.  The kernel, procctl, and
truss must be in synch for it all to work (not doing so will get errors about
inappropriate ioctl's, fortunately).  Hopefully I didn't forget anything :).
1997-12-13 03:13:49 +00:00
sef
3001e14a07 Use the new PF_LINGER flag -- when this is set in a process' proc structure,
said process will not have its event mask cleared (and be restarted) on
the last close of a procfs/mem file for that pid.  This reduces the chance
that a truss-monitored process will be left hanging with these bits set
and nobody looking for it.

This is the least-tested change of all of these, I'm afraid.
1997-12-07 04:08:48 +00:00
peter
de2f3e3f4b err(3) already includes strerror(errno) and a trailing \n 1997-12-06 14:42:58 +00:00
sef
26b4d5d167 Set the close-on-exec flag in the child; otherwise, it eats up a
file descriptor that it shouldn't.
1997-12-06 08:01:00 +00:00
sef
2d6f26ddab Truss program. Requires procfs. 1997-12-06 05:23:12 +00:00