diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2022-11-26 00:34:59 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-01-08 18:22:10 +0100 |
commit | aa48120a160b1eadf7d87e46385767cec5392c8f (patch) | |
tree | f45d82f44dba1506a3c3a36f2eb3c09fd09a1b56 /dragonflybsd | |
parent | f320171578ba37d085e5daabfea8b809c3c62633 (diff) |
Fix Linux Platform_getProcessLocks() for file-description locks
Instead of filtering the global /proc/locks by PID-that-locked
(which is different than the process that holds it for inherited
flock(2)s and always literal -1 for fcntl(F_OFD_SETLK)s),
just look at the locks on open files
For a process with:
$ head /proc/$$/fdinfo/{9,10,11}
==> /proc/797393/fdinfo/9 <==
pos: 0
flags: 0100000
mnt_id: 2775
lock: 1: FLOCK ADVISORY WRITE 818754 00:69:7 0 EOF
==> /proc/797393/fdinfo/10 <==
pos: 0
flags: 0100000
mnt_id: 127
lock: 1: FLOCK ADVISORY WRITE 828244 00:30:509028 0 EOF
lock: 2: OFDLCK ADVISORY READ -1 00:30:509028 0 199
==> /proc/797393/fdinfo/11 <==
pos: 0
flags: 0100000
mnt_id: 2775
lock: 1: FLOCK ADVISORY WRITE 935925 00:69:1187 0 EOF
Instead of:
No locks have been found for the selected process.
I now observe:
1 FLOCK ADVISORY WRITE 00:30:00000000000000509028 0 <END OF FILE> /home/nabijaczleweli/.feeds
1 FLOCK ADVISORY WRITE 00:69:00000000000000000007 0 <END OF FILE> /home/nabijaczleweli/uwu/mart.html
1 FLOCK ADVISORY WRITE 00:69:00000000000000001187 0 <END OF FILE> /home/nabijaczleweli/uwu/removedfile (deleted)
2 OFDLCK ADVISORY READ 00:30:00000000000000509028 0 199 /home/nabijaczleweli/.feeds
This also fixes an obvious issue where the filename for fd 0 would
never be resolved
Diffstat (limited to 'dragonflybsd')
0 files changed, 0 insertions, 0 deletions