From owner-freebsd-standards@FreeBSD.ORG Fri Apr 23 01:23:44 2010 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F95B106566C for ; Fri, 23 Apr 2010 01:23:44 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 070D68FC12 for ; Fri, 23 Apr 2010 01:23:43 +0000 (UTC) Received: by qyk11 with SMTP id 11so10702692qyk.13 for ; Thu, 22 Apr 2010 18:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6XhEPonXN9BzbMEhc4jBFUNnap8dTIjPJ/oZQqO0bM0=; b=r01Zpubm37EHTqiOJMVbXaLQzZ616ynKlQ7uXM9GWwrDDzgr1XcO9qS40cIaOHPyMk +qkZd0lrj3Xo8Lzcavbnfp028ZsMEdSjd5RV1nJI0VxtQK6aI1anXZ/xJuFD7NXiM4Aw etfwSByZsqvCAmMVhElCMdhzFx43JGM5b3kMY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AEm7PV+qSs+YTyaKQN9eArImiY6LAm7Ven2SGBFXTwhSgDU02Z9aJ6Cm+cm6ezGeGu VaCEwIe5IG+hgwtt+fhL0ZRe2qOsegMLgo5lOEsb0j43gVwo7fvKopTooKg2NOVTCM3w pb/YEMFrZ9nvZrUBlay/f+WUiZtIkJSEEK+VI= MIME-Version: 1.0 Received: by 10.229.233.11 with HTTP; Thu, 22 Apr 2010 18:23:42 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Apr 2010 18:23:42 -0700 Received: by 10.229.218.147 with SMTP id hq19mr3988395qcb.34.1271985822758; Thu, 22 Apr 2010 18:23:42 -0700 (PDT) Message-ID: From: Garrett Cooper To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: standards@freebsd.org Subject: Re: Non-POSIX compliant portions of FreeBSD X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2010 01:23:44 -0000 On Sun, Apr 18, 2010 at 8:16 PM, Garrett Cooper wrote: > On Sun, Apr 18, 2010 at 5:48 AM, Eitan Adler w= rote: >>> =A0 =A0I'll keep on providing a full list of items where we aren't POSI= X >>> compliant, but it'd be interesting to get a response about whether or >>> not the items I submit are known or not, and whether or not they were >>> conscious design decisions and/or items which need to be fixed. >>> Thanks, >>> -Garrett >> >> Can you make this into a wiki page along with the comments you receive? > > =A0 =A0Sure. Here's the page for starters: > http://wiki.freebsd.org/FreeBSD_and_Standards Continuing on the fun... ioctl (by manpage alone) isn't even close to being POSIX standard. Here are the differences I spotted at least [in the ERRORS section]: FreeBSD: The ioctl() system call will fail if: [EBADF] The d argument is not a valid descriptor. [ENOTTY] The d argument is not associated with a character s= pe- cial device. [ENOTTY] The specified request does not apply to the kind of object that the descriptor d references. [EINVAL] The request or argp argument is not valid. [EFAULT] The argp argument points outside the process's allo= - cated address space. POSIX: [EBADF] The fildes argument is not a valid open file descriptor. [EINTR] A signal was caught during the ioctl() operation. [EINVAL] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer. If an underlying device driver detects an error, then ioctl() shall fail if= : [EINVAL] The request or arg argument is not valid for this device. [EIO] Some physical I/O error has occurred. [ENOTTY] The fildes argument is not associated with a STREAMS device that accepts control functions. [ENXIO] The request and arg arguments are valid for this device driver, but the service requested cannot be performed on this particular sub-device. [ENODEV] The fildes argument refers to a valid STREAMS device, but the corresponding device driver does not support the ioctl() function. If a STREAM is connected downstream from a multiplexer, any ioctl() command except I_UNLINK and I_PUNLINK shall set errno to [EINVAL]. 1. EINTR and EIO aren't implemented in FreeBSD. 2. The tort in EBADF for the POSIX definition suggests that the file descriptor state is important -- it looks like the wording is potentially a bit too well defined in the POSIX version as I could open a file descriptor, close it, then attempt to run an ioctl(2) on the device file descriptor, which should fail in the same way as the FreeBSD wording suggests. 3. It looks like ENODEV, ENOTTY, and ENXIO in the POSIX case are bundled together in some of the possible states for the ENOTTY error case on FreeBSD. At least it functions unlike the Linux copy in some cases though :]. Cheers, -Garrett