afalg: Use eventfd2 syscall instead of eventfd
authorBaptiste Jonglez <git@bitsofnetworks.org>
Mon, 30 Oct 2017 13:38:19 +0000 (14:38 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 31 Oct 2017 10:22:06 +0000 (11:22 +0100)
commita0c262644eab897b51faf1fa013008052c3754c2
tree0177a14f7823708eaab6b99d57da0576e8316d14
parent605fa68efaf2ebc891330ed1ae9e5053a2228c1e
afalg: Use eventfd2 syscall instead of eventfd

The eventfd syscall is deprecated and is not available on aarch64, causing
build to fail:

    engines/e_afalg.c: In function 'eventfd':
    engines/e_afalg.c:108:20: error: '__NR_eventfd' undeclared (first use in this function)
         return syscall(__NR_eventfd, n);
                        ^

Instead, switch to the newer eventfd2 syscall, which is supposed to be
supported by all architectures.

This kind of issues would be avoided by simply using the eventfd(2)
wrapper from the libc, but there must be subtle reasons not to...

Tested on a aarch64 system running OpenSUSE Leap 42.1 (gcc118 from
https://cfarm.tetaneutral.net/machines/list/ ) and also cross-compiling
for aarch64 with LEDE (kernel 4.9).

This properly fixes #1685.

CLA: trivial
Fixes: 7f458a48 ("ALG: Add AFALG engine")
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4618)
engines/afalg/e_afalg.c