Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for io_pgetevents_time64 syscall #9819

Closed
wants to merge 1 commit into from

Conversation

@alistair23
Copy link
Contributor

alistair23 commented Sep 9, 2019

32-bit architectures that are y2038 safe don't include syscalls that use
32-bit time_t. Instead these architectures have suffixed syscalls that
always use a 64-bit time_t. In the case of the io_getevents syscall the
syscall has been replaced with the io_pgetevents_time64 syscall instead.

This patch changes the io_getevents() function to use the correct
syscall based on the avaliable syscalls and the time_t size. We will
only use the new 64-bit time_t syscall if the architecture is using a
64-bit time_t. This is to avoid having to deal with 32/64-bit
conversions. In the future if a 32-bit time_t architecture wants to use
the 64-bit syscalls we can handle the conversion.

This fixes build failures on 32-bit RISC-V.

Signed-off-by: Alistair Francis alistair.francis@wdc.com

engines/e_afalg.c Outdated Show resolved Hide resolved
engines/e_afalg.c Outdated Show resolved Hide resolved
engines/e_afalg.c Show resolved Hide resolved
@alistair23

This comment has been minimized.

Copy link
Contributor Author

alistair23 commented Sep 10, 2019

I have updated the commit, to address some of your concerns. I haven't addressed the 32-bit time_t yet. Let me know what you would like me to do.

engines/e_afalg.c Outdated Show resolved Hide resolved
32-bit architectures that are y2038 safe don't include syscalls that use
32-bit time_t. Instead these architectures have suffixed syscalls that
always use a 64-bit time_t. In the case of the io_getevents syscall the
syscall has been replaced with the io_pgetevents_time64 syscall instead.

This patch changes the io_getevents() function to use the correct
syscall based on the avaliable syscalls and the time_t size. We will
only use the new 64-bit time_t syscall if the architecture is using a
64-bit time_t. This is to avoid having to deal with 32/64-bit
conversions and relying on a 64-bit timespec struct on 32-bit time_t
platforms. As of Linux 5.3 there are no 32-bit time_t architectures
without __NR_io_getevents. In the future if a 32-bit time_t architecture
wants to use the 64-bit syscalls we can handle the conversion.

This fixes build failures on 32-bit RISC-V.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@alistair23

This comment has been minimized.

Copy link
Contributor Author

alistair23 commented Sep 11, 2019

Just pushed a v3 with better error handling

@paulidale

This comment has been minimized.

Copy link
Contributor

paulidale commented Sep 18, 2019

Ping?

@paulidale

This comment has been minimized.

Copy link
Contributor

paulidale commented Sep 18, 2019

Merged to master.
Thanks for the fix.

@paulidale paulidale closed this Sep 18, 2019
levitte pushed a commit that referenced this pull request Sep 18, 2019
32-bit architectures that are y2038 safe don't include syscalls that use
32-bit time_t. Instead these architectures have suffixed syscalls that
always use a 64-bit time_t. In the case of the io_getevents syscall the
syscall has been replaced with the io_pgetevents_time64 syscall instead.

This patch changes the io_getevents() function to use the correct
syscall based on the avaliable syscalls and the time_t size. We will
only use the new 64-bit time_t syscall if the architecture is using a
64-bit time_t. This is to avoid having to deal with 32/64-bit
conversions and relying on a 64-bit timespec struct on 32-bit time_t
platforms. As of Linux 5.3 there are no 32-bit time_t architectures
without __NR_io_getevents. In the future if a 32-bit time_t architecture
wants to use the 64-bit syscalls we can handle the conversion.

This fixes build failures on 32-bit RISC-V.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from #9819)
@alistair23 alistair23 deleted the alistair23:alistair/rv32-fix branch Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.