]> granicus.if.org Git - zfs/commit
Fix header inclusions for standards conformance
authorRichard Yao <ryao@gentoo.org>
Sat, 8 Apr 2017 16:51:04 +0000 (12:51 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Apr 2017 15:58:09 +0000 (08:58 -0700)
commit120ff39a75ad52efc359308a5e128a58998dd2f3
tree1af0e21a6939a6e5d4d97ce0f342036b7072f854
parent281f1fa30ac3558d0e5e1573bdb9113291815bcd
Fix header inclusions for standards conformance

musl's sys/errno.h is literally:

/#warning redirecting incorrect #include <sys/errno.h> to <errno.h>
/#include <errno.h>

It does the same for sys/{poll,signal}.h. This is rather noisy when
building ZoL against musl. musl is also correct in pointing out that the
correct headers are outside of sys/ according to the single unix
specification:

http://pubs.opengroup.org/onlinepubs/7908799/xsh/errno.h.html
http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.h.html
http://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html

Lets implement our own sys/* versions of these headers to redirect to
the proper userland ones when building in userspace. That will silence
the warning.

There are also some instances where we include incorrectly from sys/ or
from outside of sys/ in userspace only code. In these instances, lets
just fix the includes directly.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Closes #5993
lib/libspl/include/sys/Makefile.am
lib/libspl/include/sys/errno.h [new file with mode: 0644]
lib/libspl/include/sys/poll.h [new file with mode: 0644]
lib/libspl/include/sys/signal.h [new file with mode: 0644]
lib/libzfs/libzfs_util.c
tests/zfs-tests/cmd/file_trunc/file_trunc.c
tests/zfs-tests/cmd/mktree/mktree.c