Skip to content

Commit

Permalink
afalg: Use eventfd2 syscall instead of eventfd
Browse files Browse the repository at this point in the history
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: 7f458a4 ("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 #4618)
  • Loading branch information
Baptiste Jonglez authored and levitte committed Oct 31, 2017
1 parent 605fa68 commit a0c2626
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/afalg/e_afalg.c
Expand Up @@ -107,7 +107,7 @@ static ossl_inline int io_setup(unsigned n, aio_context_t *ctx)

static ossl_inline int eventfd(int n)
{
return syscall(__NR_eventfd, n);
return syscall(__NR_eventfd2, n, 0);
}

static ossl_inline int io_destroy(aio_context_t ctx)
Expand Down

0 comments on commit a0c2626

Please sign in to comment.