In article <[email protected]>,
Nicolas Joly  <[email protected]> wrote:
>-=-=-=-=-=-
>
>
>Hi,
>
>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
>of EOPNOTSUPP.
>
>Any specific reason for this one ?

Nope, please fix it.

christos

Reply via email to