On Nov 9 21:36, Andy Koppe wrote: > Hi, > > I had noticed that selecting or excluding processes without a > controlling terminal doesn't work in procps on Cygwin. > > For example, the mintty process shouldn't appear in the following, as > the 'f' (for forest) argument triggers procps's "BSD personality", > where processes without a controlling terminal are supposed to be > excluded by default: > > $ procps f > PID TTY STAT STIME COMMAND > 1809 ? Ss 19:49 /usr/bin/mintty - > 1810 pty0 Ss 19:49 \_ -zsh > 2075 pty0 R 21:14 \_ procps f > > Similarly, this should list the processes without a terminal, but > comes up empty: > > $ procps -t - > > I tracked this down to a difference in the tty field of /proc/*/stat > (which is the 7th field). On Linux, processes without a terminal have > value 0 there, and that's what procps expects. > > Cygwin 3.3 has -1 instead, whereas on master the bits of the tty field > were rearranged in commit 437d0a8f88, which turns the -1 into > 268435455 (i.e. 0xFFFFFFF). Either way, procps treats such processes > as having terminals. (The ? in the TTY column output is generated by a > different code path in procps that uses /proc/*/ctty on Cygwin.) > > Patches for the 3.3 branch and master attached.
Pushed in master. We won't do another 3.3, so I skipped it. Thanks, Corinna