Skip to content

Use linux/* headers for linux and android #235

Closed
@kamalmarhubi

Description

@kamalmarhubi

This comes out of discussion on #233. Additions to Linux system APIs are included in headers like <linux/header.h> rather than <header.h>. We should use these headers for verification on Linux, in order to include constants that are not present in <header.h>.

@posborne provided some useful background:

Starting with kernel 3.7, there has been a push to separate the headers that are suitable for inclusion from userspace (or at least from libc) into the include/uapi and arch/$ARCH/include/uapi directories in the kernel. This is the case for the constants in this PR: http://lxr.free-electrons.com/source/include/uapi/linux/fcntl.h.

The idea has been around for awhile, but it recently got a bigger push.

As a specific example from #233:

$ printf '#define _GNU_SOURCE\n#include <fcntl.h>' | cpp -dM - | grep '#define F_
GET_SEAL'
$ printf '#define _GNU_SOURCE\n#include <linux/fcntl.h>' | cpp -dM - | grep '#def
ine F_GET_SEAL'
#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions