Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 May 2018 21:47:34 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r333192 - head/lib/libc/sys
Message-ID:  <CACNAnaFGWZV=DTEYpspYSEu2sqXcvez=encNRCT3R=r3hSGmiA@mail.gmail.com>
In-Reply-To: <201805030242.w432gDU1057032@repo.freebsd.org>
References:  <201805030242.w432gDU1057032@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 2, 2018 at 9:42 PM, Kyle Evans <kevans@freebsd.org> wrote:
> Author: kevans
> Date: Thu May  3 02:42:13 2018
> New Revision: 333192
> URL: https://svnweb.freebsd.org/changeset/base/333192
>
> Log:
>   fcntl(2): Vaguely document that ENOTTY is possible, with light examples
>
>   Reported by:  vs (2006, FreeBSD 6.1-BETA3)
>   Reported by:  me (2018, angry debugging session)

I guess I should be more specific here- this specific angry debugging
session was in net/freerdp's usage of devel/libepoll-shim. An
apparently common pattern is:

timer = timerfd_create(...);
...
fcntl(timer->fd, F_SETFL, O_NONBLOCK);

This fcntl(2) call will fail and result in an ENOTTY, because
libepoll-shim's implementation of timerfd_create is a wrapper around
kqueue and this isn't an OK thing to do. This was the inspiration of
one of the specifically mentioned examples.

epoll API provides a way to set NONBLOCK in the creation process, the
use of which in lieu of the timerfd_create ... fcntl pattern ended up
being the proper fix.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaFGWZV=DTEYpspYSEu2sqXcvez=encNRCT3R=r3hSGmiA>