Re: RFC: Using openat()
"Dr. Werner Fink" <[email protected]> Mon, 23 Jan 2023 17:02:22 +0100
| Newsgroups | gmane.linux.procps.devel |
|---|---|
| Message-ID | <[email protected]> |
--ZRrcYNjZJhBkrRya
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On 2023/01/20 22:01:07 +1100, Craig Small wrote:
> Hi All,
> I have a proposed patch where the library uses openat() for all open
> files below
> /proc/<PID>. I think this is a reasonable idea as it means if a PID is
> reused you're not using half the old process and half the new process
> information.
>=20
> It's all internal so invisible to the calling programs, so its not an API
> change but it is a reasonably large patch. The work is largely based upon
> https://gitlab.com/procps-ng/procps/-/merge_requests/120
>=20
> Let me know what you think.
Could be that libc already does this
strace -e open,openat ps | & grep -v openat
PID TTY TIME CMD
2564 pts/0 00:00:00 strace
2565 pts/0 00:00:00 grep
2568 pts/0 00:00:00 ps
30701 pts/0 00:00:00 tcsh
+++ exited with 0 +++
Werner
--=20
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
--ZRrcYNjZJhBkrRya
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQJgBAABCABKFiEEGwa/WjgpkPvLonW+UOkNVR3Bay4FAmPOr4ksFIAAAAAAFQAO
cGthLWFkZHJlc3NAZ251cGcub3Jnd2VybmVyQHN1c2UuZGUACgkQUOkNVR3Bay7j
oRAAxd/WRNj6lpeVTYsRgUhGAAqdtVQFFuKqxZ+Z5HKrqQg4Ual3qEySlfdnZi4X
NKmq2dLhQ3G4gif8L+tRj8NlAeCDMVxmxhfgRfBZ8B7DaudlZAXYmE+3O6/hpGeB
A1rwlfuVn6fnRw1Vj7XlDPEcNuD94e+edH+F8l+un8IlrG4A28L81GSLX+4dRq/h
33Mm2TG5QOi1XCDFl6kRaNSVHArhnpOulDUwEkUUqg1xlyZD3uXNQc4fb+I/iET7
uLiLpNyZ//++pvXfUOUpjmZnJE/yv2TpPXQ+m+7utJbSZSxQCkq42aTEB67Kj92d
/iMWD+JAFzGX2NBH+tvU1zJM56hkoeKXhmeLhCg0/26llyC3ObZfZ1vLalUqYsSf
C8dJQw5ny9hbJcpd7MVa5CXGK8epO55ayv81s2MM6yqIpe37LL/St4oLBPdxKbnN
C23LkMprORwdvVcIFYU0IcXWshMqSFm5jsYdfktgCn5FyrG57iKkBiBRpMd9U4Lo
Cg212+kqOpMb27trDZXbrbs1K+Qn6+njw0XeUrDdLG4hp0A5QKIOYZGVgP+nNcXO
X/6XRda87mDVYXZHbFPCEWGeWPxmDmGNi4qfyuFOHBNKxTldcUQzxxbQam7bdw1h
lkDW9WD8jJnCOYTKBWEDfzeaNzQWXPBcl/Wn7fbqCJ2raqE=
=I5yt
-----END PGP SIGNATURE-----
--ZRrcYNjZJhBkrRya--