lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/8] kbuild: prevent exported headers from including <stdlib.h>, <stdbool.h>
On Mon, Apr 4, 2022 at 9:41 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Mon, Apr 04, 2022 at 03:19:42PM +0900, Masahiro Yamada wrote:
> > If we can make kernel headers self-contained (that is, none of exported
> > kernel headers includes system headers), we will be able to add the
> > -nostdinc flag, but that is much far from where we stand now.
>
> What is still missing for that?

One case that I don't know how to solve is

include/uapi/sound/asound.h:typedef struct { unsigned char
pad[sizeof(time_t) - sizeof(int)]; } __time_pad;

Here we define a structure layout based on a libc-provided type. There are two
possible variants (32-bit and 64-bit time_t), and the kernel interface
can handle
both versions because they get different ioctl command numbers, but user space
must see the one that matches its normal time_t.

There are a couple of similar cases like this, but I think the other ones don't
need to define architecture specific padding like this.

Arnd

\
 
 \ /
  Last update: 2022-04-04 10:02    [W:1.288 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site