[PATCH libaio v3 0/9] Add time64 support

Guillem Jover <[email protected]> Wed, 17 Jun 2026 03:30:51 +0200
Newsgroups gmane.linux.kernel.aio.general
Message-ID <[email protected]>
From: Guillem Jover <[email protected]>

Hi!

In Debian, there was a decision to perform the time64 transition
for all 32-bit architectures using a fake SONAME bump (where the actual
SONAME does not get bumped but the packaging is changed as if it had,
with additional relationship constraints), except for i386.

As I'd rather not leave i386 behind, I implemented dual-ABI support for
the libraries I maintain there, including libaio, in a similar way as
what glibc or musl do. But because this was time sensitive and had not
been coordinated with upstream, I also did a real (local) SONAME bump to
avoid binary incompatibilities and stomping over the upstream SONAME, in
case this was rejected upstream, or modifications were requested or
similar (the SONAME in Debian is currently libaio.so.1t64, which I'd
like to revert once the API/ABI is settled upstream).

The other issue I faced was that the Linux was broken for the
io_pgetevents_time64() syscall on 64-bit kernels running 32-bit userland
(at least for x86, but I suspected this would affect all other 32-bit
ports with a 64-bit counterpart that can run 32-bit userland, which would
need the same treatment). I submitted that fix as:

 [PATCH linux v2] arch: Wire up io_pgetevents_time64 compat entry point on i386
 <https://marc.info/?l=linux-aio&m=171758020922908>

But this got eventually fixed using the more exhaustive change from
Linux commit d3882564a77c21eb746ba5364f3fa89b88de3d61
"syscalls: fix compat_sys_io_pgetevents_time64 usage", present since
Linux 6.10.

The libaio code also unconditionally exports the time64 API on all 32-bit
ports, even for new ones where by default their ABI is already time64,
because I don't know of a clean way to get that at build time, except
for tracking an explicit list, which seemed too cumbersome.

In any case, let me know what you think, and if all is good and you
agree with the API/ABI changes, then I'd proceed to revert the local
SONAME bump in Debian to restore the previous ABI, as that used to
cause some issues with binary-only projects such as Oracle and similar
(although I think they might have adapted by now (?)).

I can also provide this (or in addition) as a merge request on codeberg
if that is useful or preferred.

Thanks,
Guillem

Changes since v2 (https://marc.info/?l=linux-aio&m=171757788520926):
- Add missing entries for .gitignore files.
- Renamed new timespec local variables to either sts or kts.
- Dropped the patch disabling io_pgetevents_time64 as the compat code
  got fixed in Linux 6.10.
- Clarify patch descriptions, and fix typos.

Changes since v1 (https://marc.info/?l=linux-aio&m=171745321208314):
- Add gitignore update and sigset rename patches.
- Rebased against the version used in Debian.
- Several typo fixes, and wording improvements.
- Retested w/ and w/ the kernel fix on 64-bit kernel 32-bit userland,
  all seems good.

Guillem Jover (9):
  Update .gitignore for the harness artifacts
  Move semicolon to SYMVER and DEFSYMVER call sites
  Use new symver function attribute to support LTO builds
  Remove unused vsys_def.h
  Remove unused raw_syscall.c
  Wrap long declarations exceeding 80 columns
  Rename sigset struct from data to aio_sigset
  Add time64 syscall support
  Add time64 public functions on 32-bit architectures

 .gitignore                                    |  8 ++
 harness/Makefile                              |  2 +-
 src/Makefile                                  |  9 +-
 src/{io_getevents.c => aio_getevents.c}       | 25 ++++--
 src/aio_pgetevents.c                          | 84 +++++++++++++++++++
 src/aio_ring.h                                |  3 +-
 src/aio_time.h                                | 54 ++++++++++++
 src/compat-0_1.c                              | 29 ++++---
 src/io_cancel.c                               |  5 +-
 src/io_getevents.c                            | 25 ++++--
 src/{io_queue_run.c => io_getevents_time64.c} | 26 +++---
 src/io_pgetevents.c                           | 40 ++++-----
 ...{io_queue_run.c => io_pgetevents_time64.c} | 30 +++----
 src/io_queue_run.c                            |  5 +-
 src/io_queue_wait.c                           | 17 +++-
 src/io_submit.c                               |  3 +-
 src/libaio.h                                  | 53 +++++++++---
 src/libaio.map                                |  6 ++
 src/raw_syscall.c                             | 19 -----
 src/syscall.h                                 | 17 +++-
 src/vsys_def.h                                | 24 ------
 21 files changed, 334 insertions(+), 150 deletions(-)
 copy src/{io_getevents.c => aio_getevents.c} (60%)
 create mode 100644 src/aio_pgetevents.c
 create mode 100644 src/aio_time.h
 copy src/{io_queue_run.c => io_getevents_time64.c} (67%)
 copy src/{io_queue_run.c => io_pgetevents_time64.c} (64%)
 delete mode 100644 src/raw_syscall.c
 delete mode 100644 src/vsys_def.h

-- 
2.53.0


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to [email protected].  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"[email protected]">[email protected]</a>