Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586601

Re: [PATCH] uapi: fix linux/sysctl.h userspace compilation errors

From ebiederm@xmission.com (Eric W. Biederman)
Newsgroups linux.kernel
Subject Re: [PATCH] uapi: fix linux/sysctl.h userspace compilation errors
Date 2017-02-23 02:50 +0100
Message-ID <tdQHD-2lQ-1@gated-at.bofh.it> (permalink)
References <tdOmt-HE-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


"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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] uapi: fix linux/sysctl.h userspace compilation errors "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-23 00:20 +0100
  Re: [PATCH] uapi: fix linux/sysctl.h userspace compilation errors ebiederm@xmission.com (Eric W. Biederman) - 2017-02-23 02:50 +0100
    [PATCH] uapi: stop including linux/sysctl.h in uapi/linux/netfilter.h "Dmitry V. Levin" <ldv@altlinux.org> - 2017-02-23 03:50 +0100
      Re: [PATCH] uapi: stop including linux/sysctl.h in  uapi/linux/netfilter.h Pablo Neira Ayuso <pablo@netfilter.org> - 2017-02-23 22:00 +0100

csiph-web