http://bugs.winehq.org/show_bug.cgi?id=28898
--- Comment #45 from Erich Hoover ehoover@mines.edu 2012-03-20 19:17:34 CDT --- (In reply to comment #44)
Nice pickup. However, I don't know if a patch that calls lsof (amongst other things) will be accepted by wine. I realise that during the first revisions it's easiest to just do that, however I think now that it's working someone will probably have to rewrite the patch to actually read /proc directly. In particular, I know that wine currently does not depend on "lsof" as I had to manually install it on my laptop to get D3 to work.
I'm meant to be at work in 10 minutes, so I'll keep digging later, but we do have the inode, so a simple check in /proc/<PID>/fd/ for a link to "socket:<INODE>" would give the corresponding PID (so we'd have to iterate over all possible PIDs, looking for a specific inode).
Yup, I know exactly how to do this - I just haven't taken the time since: 1) I already have four patches sitting on the queue. 2) I have two patches not on the queue that are ready for submission. 3) Alexandre is on vacation this week. 4) I am one of the organizers for a conference that is next week.
If someone else wants to do this then they are free to use my code as a starting point, otherwise I'll probably get to it late next week or early the week after next.