tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: procfs files vs symlink



On Wed, Jan 12, 2022 at 07:19:14PM +0700, Robert Elz wrote:
>     Date:        Tue, 11 Jan 2022 22:20:15 +0100
>     From:        Manuel Bouyer <bouyer%antioche.eu.org@localhost>
>     Message-ID:  <Yd30j9FPEMeBoV3W%antioche.eu.org@localhost>
> 
>   | > 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).
> 
> That should generate EBADF not EINVAL.  Attempting readlink()
> on something that is not a symlink, and various other possibilities
> like that would be more probable.  EINVAL isn't listed as a possible
> error return from [f]stat ... not that that guarantees that it cannot
> happen, particularly from within emulation code.

Acutally it's not fstat() but readlink(), as shown by ktrace.
To me it's not clear why readlink() fails on this file descriptor.
But it's not caused by my patch

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index