From owner-svn-src-head@freebsd.org Thu May 3 02:47:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B6CCFBE6A7; Thu, 3 May 2018 02:47:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE79470948; Thu, 3 May 2018 02:47:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 64250FD12; Thu, 3 May 2018 02:47:56 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f52.google.com with SMTP id y14-v6so23373930lfy.12; Wed, 02 May 2018 19:47:56 -0700 (PDT) X-Gm-Message-State: ALQs6tCj/9bSprErwXq4JxvgkvqxmjkU2malB0Jyfwl9lwmQf5Xthzns Df96DqD+oBZYNqmqp8ffPiUT5DwFum3St9kLOXI= X-Google-Smtp-Source: AB8JxZoOhVQPwD0eapr4VHlnsf3q8UjZgNkLRkMpuCVIfrTiHzrbvfAKAKWnXyLMmevGb16weeCcN2bVidPpvnW7GR4= X-Received: by 2002:a19:95c2:: with SMTP id x185-v6mr12904937lfd.74.1525315674958; Wed, 02 May 2018 19:47:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.49.18 with HTTP; Wed, 2 May 2018 19:47:34 -0700 (PDT) In-Reply-To: <201805030242.w432gDU1057032@repo.freebsd.org> References: <201805030242.w432gDU1057032@repo.freebsd.org> From: Kyle Evans Date: Wed, 2 May 2018 21:47:34 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333192 - head/lib/libc/sys To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 02:47:57 -0000 On Wed, May 2, 2018 at 9:42 PM, Kyle Evans 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.