tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: procfs files vs symlink
On Tue, Jan 11, 2022 at 08:00:53PM +0000, David Holland wrote:
> On Tue, Jan 11, 2022 at 11:10:24AM +0100, Manuel Bouyer wrote:
> > The attached diff changes the procfs behavior to match the linux one, for
> > linux processes:
> > comore:/home/bouyer>ls -l /proc/self/fd/
> > total 1
> > crw--w---- 1 bouyer tty 5, 0 Jan 11 11:08 0
> > crw--w---- 1 bouyer tty 5, 0 Jan 11 11:08 1
> > crw--w---- 1 bouyer tty 5, 0 Jan 11 11:08 2
> > lr-xr-xr-x 1 bouyer staff 512 Jan 11 11:08 3 -> /home/bouyer
> >
> > ls: /proc/self/fd//4: Invalid argument
> > lr-xr-xr-x 1 bouyer staff 0 Jan 11 11:08 4
>
> What causes that EINVAL?
I'm not sure (somneone suggested that the file descriptor has been closed
when ls tries to fstat() it, but I can't confirm this). Anyway, it happens
also without my patch - see my mail on current-users about the linux binary
issue.
>
> also beware -- the linux world expects regular files to have canonical
> paths, and that's just not true elsewhere and can't really be papered
> over.
I didn't check all the cases, but it's enough to make my binaries run.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index