This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug in procps-ng


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:

https://gitlab.com/procps-ng/procps/blob/master/proc/devname.c#L303

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.


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

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]