Hi Poul-Henning,

I've been having trouble with ps(1) printing invalid controlling
terminal names for processes connected to psuedo-terminals.

This only seems to be a problem for DEVFS-enabled systems.

The output that makes it look like things are broken is this:

$ ps -t p7
  PID  TT  STAT      TIME COMMAND
80571 #C5  Ss     0:00.10 bash

It seems to be breakage in devname(3):

$ gdb /usr/obj/usr/src/bin/ps/ps
GNU gdb 4.18
[...]
(gdb) break print.c:311
Breakpoint 1 at 0x8048cb6: file /usr/src/bin/ps/print.c, line 311.
(gdb) run
Starting program: /usr/obj/usr/src/bin/ps/ps 
  PID  TT  STAT      TIME COMMAND

Breakpoint 1, tname (k=0x8090690, ve=0x8086040) at /usr/src/bin/ps/print.c:311
311             if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL)
(gdb) n
314                     if (strncmp(ttname, "tty", 3) == 0 ||
(gdb) print ttname
$2 = 0x807afe8 "#C5:1"

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to