This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH glibc] Linux: Include <linux/sockios.h> in <bits/socket.h> under __USE_MISC
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: Arnd Bergmann <arnd at arndb dot de>, Florian Weimer <fweimer at redhat dot com>
- Cc: nd <nd at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>, "Sergei Trofimovich" <slyfox at gentoo dot org>, Networking <netdev at vger dot kernel dot org>, "Linux Kernel Mailing List" <linux-kernel at vger dot kernel dot org>, "David S. Miller" <davem at davemloft dot net>, Michael Kerrisk <mtk dot manpages at gmail dot com>, linux-man <linux-man at vger dot kernel dot org>
- Date: Mon, 22 Jul 2019 13:41:07 +0000
- Subject: Re: [PATCH glibc] Linux: Include <linux/sockios.h> in <bits/socket.h> under __USE_MISC
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=arm.com;dmarc=pass action=none header.from=arm.com;dkim=pass header.d=arm.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rVWA9d4zIZgRcYlt5Z36LN8lcV1HajImCd2PNiHUqxU=; b=f+VbtWnUSTMnChYiG0NUNzSBH5dHpfhcEczE+YAGVBcMor+cO634DDVISQ/LwRgrg8cWSG6Yd9mTZOGTSqW1ub9FCAa9QkeEqON/QG4epHbW7p7o5bVTgb5M2c70/jmJoAknrmOlEWtIOxLyWX7H7ZWCGOqYyTyVPTAzqMwuD91shJ52eBRw4zOi0GRGmU25wwfHRuCHlDHogymT34B+EhqFGQTGqSsVsLzkQurse1f5gQskIs/LxtJAZ2fTUC5OCbU0uQvhO+ha6RnAfN7Snk7k2knIbn6T+APcBJuX3AxPLPLJ7HCUBc9Z3qPw/lHgoyr/11da72g5wdCHdL6alQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cgxJJWZItZmU7uBg3/R0Aek6WZYAM3z591Qj0Cj4Wyq6u3qqal1avk53TlqHv8dZHnGflV+EzcG/M8nmNBcshKYxN82oaz1+T9v0c85+2+b8W4EX77PyuubgApKngVoC90Z5pUs97mtN0/uP/n2i4u643kjHvts19ko89pKb92dYOsPuqxd6wgVc6GT/BUvc6ZV+lRmCpNqCVGZgqSU4M1pPH84vPedpXxejNTIQQP2QE8FBEOm+nTtxUsv5hgkO8cyd4Elnnq7YPmc2O/wuXHfw29yLchC5M9DcLnIKTmn2R/9nE+QrrtkmvLX4MhZqUkC81cE79EMGciX0FFtzZg==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- References: <87ftmys3un.fsf@oldenburg2.str.redhat.com> <CAK8P3a0hC4wvjwCi4=DCET3C4qARMY6c58ffjwG3b1ZPM6kr-A@mail.gmail.com>
On 22/07/2019 12:34, Arnd Bergmann wrote:
> On Mon, Jul 22, 2019 at 1:31 PM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> Historically, <asm/socket.h> (which is included from <bits/socket.h>)
>> provided ioctl operations for sockets. User code accessed them
>> through <sys/socket.h>. The kernel UAPI headers have removed these
>> definitions in favor of <linux/sockios.h>. This commit makes them
>> available via <sys/socket.h> again.
>
> Looks good to me.
>
> I wonder if we should still do these two changes in the kernel:
>
> - include asm/socket.h from linux/socket.h for consistency
> - move the defines that got moved from asm/sockios.h to linux/sockios.h
> back to the previous location to help anyone who is user
> newer kernel headers with older glibc headers.
does user code actually expect these in sys/socket.h
or in asm/socket.h ?
man 7 socket
mentions SIOCGSTAMP but does not say the header.
man 2 ioctl_list
specifies include/asm-i386/socket.h as the location.
if user code tends to directly include asm/socket.h
then i think it's better to undo the kernel header
change than to put things in sys/socket.h.
(note: in musl these ioctl macros are in sys/ioctl.h
which is not a posix header so namespace rules are
less strict than for sys/socket.h and users tend to
include it for ioctl())