From: ebiederm@xmission.com (Eric W. Biederman)
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] uapi: fix linux/sysctl.h userspace compilation errors
Date: Thu, 23 Feb 2017 14:34:58 +1300 [thread overview]
Message-ID: <87poi93d19.fsf@xmission.com> (raw)
In-Reply-To: <20170222230652.GA14373@altlinux.org> (Dmitry V. Levin's message of "Thu, 23 Feb 2017 02:06:52 +0300")
"Dmitry V. Levin" <ldv@altlinux.org> writes:
> Include <stddef.h> (guarded by #ifndef __KERNEL__) to fix the following
> linux/sysctl.h userspace compilation errors:
>
> /usr/include/linux/sysctl.h:38:2: error: unknown type name 'size_t'
> size_t *oldlenp;
> /usr/include/linux/sysctl.h:40:2: error: unknown type name 'size_t'
> size_t newlen;
>
> This also fixes userspace compilation of uapi headers that include
> linux/sysctl.h, e.g. linux/netfilter.h.
Are these compilation errors new?
Perhaps we should just refactor linux/netfilter.h not to depend on
linux/sysctl.h. The definitions in linux/sysctl.h are essentially dead
at this point and I would not expect any new, are really not any old
programs to depend on linux/sysctl.h. As I don't expect new users of
linux/sysctl.h I don't see how changing anything in the header is
meaningful.
Either the old users work or the old users are broken.
Eric
> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> ---
> include/uapi/linux/sysctl.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
> index d2b1215..c6d18aa 100644
> --- a/include/uapi/linux/sysctl.h
> +++ b/include/uapi/linux/sysctl.h
> @@ -26,6 +26,10 @@
> #include <linux/types.h>
> #include <linux/compiler.h>
>
> +#ifndef __KERNEL__
> +#include <stddef.h> /* For size_t. */
> +#endif
> +
> #define CTL_MAXNAME 10 /* how many path components do we allow in a
> call to sysctl? In other words, what is
> the largest acceptable value for the nlen
next prev parent reply other threads:[~2017-02-23 1:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 23:06 [PATCH] uapi: fix linux/sysctl.h userspace compilation errors Dmitry V. Levin
2017-02-23 1:34 ` Eric W. Biederman [this message]
2017-02-23 2:49 ` [PATCH] uapi: stop including linux/sysctl.h in uapi/linux/netfilter.h Dmitry V. Levin
2017-02-23 20:51 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87poi93d19.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ldv@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox