Current-Users archive

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

Re: fstat(2) fails on AF_LINK socket descriptor

In article <>,
Nicolas Joly  <> wrote:
>I have some code that tries to detect file type given a descriptor by
>using fstat(2) ... and do some specific stuff accordingly, and
>specifically for socket descriptors.
>It mostly works, except for AF_LINK socket descriptor where fstat(2)
>fails with EOPNOTSUPP. Like with the attached sample code.
>Looking at the code in src/sys/net/link_proto.c confirms that
>behavior :
>static int
>link_stat(struct socket *so, struct stat *ub)
>        KASSERT(solocked(so));
>        return EOPNOTSUPP;
>But this is an exception as all other stat functions returns 0 instead
>Any specific reason for this one ?

Nope, please fix it.


Home | Main Index | Thread Index | Old Index