bug in procps-ng

Achim Gratz Stromeko@nexgo.de
Wed Mar 13 18:14:00 GMT 2019

Corinna Vinschen writes:
>> [...]
>> Cygwin /proc/PID/stat[$7] appears to have major in upper half, minor in lower
>> half e.g. 8912896 -> 00880000 -> 136,0; 196608 -> 00030000 -> 3,0.
>> Linux man 5 proc defines:
>> (7) tty_nr  %d
>> 	The controlling terminal of the process. (The minor device number is
>> 	contained in the combination of bits 31 to 20 and 7 to 0; the major
>> 	device number is in bits 15 to 8.)
> Thanks.  I changed the output of /proc/<PID>/stat accordingly, but
> now `procps' always shows a question mark rather than a pty number,
> so that's not the problem:
> https://paste.fedoraproject.org/paste/BqENX~bhFzNkYQpa-lwWMw/raw

That was an exercise in futility.  Procps uses system macros to
dissemble the major/minor devices, so of course it's doing the right
thing on Cygwin while using Cygwin macros (I think these are actually
inline functions now).  But your assertion that it should use stat for
finding the tty is probably wrong, there's Cygwin specific code that
looks at /dev/ctty:


That's used in addition to code that would correctly determine the
devices fromt the stat info, so at the moment I have no idea where the
wheels fall off that wagon.

+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:

More information about the Cygwin-apps mailing list