From 1ffe9239bb63a13b21d810187a62531891e586c1 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 2 Nov 2021 23:56:45 +0000 Subject: [PATCH] Import libaio_0.3.112-12.debian.tar.xz [dgit import tarball libaio 0.3.112-12 libaio_0.3.112-12.debian.tar.xz] --- changelog | 513 +++++++++++ control | 54 ++ copyright | 25 + libaio-dev.install | 3 + libaio-dev.manpages | 13 + libaio1-udeb.install | 2 + libaio1.install | 2 + libaio1.symbols | 18 + ...s-syscall-wrapper-on-32-bit-userland.patch | 107 +++ ...n-to-SYMVER-and-DEFSYMVER-call-sites.patch | 66 ++ patches/0001-man-Fix-typos.patch | 35 + ...definitions-to-match-exactly-the-ker.patch | 34 + ...unction-attribute-to-support-LTO-bui.patch | 93 ++ ...-definitions-to-match-exactly-the-ke.patch | 32 + ...EL_RW_POINTER-for-various-32-bit-arc.patch | 35 + .../0004-Fix-and-improve-MIPS-support.patch | 137 +++ patches/0005-Add-PARISC-support.patch | 66 ++ patches/0006-Add-m68k-support.patch | 53 ++ patches/0007-Add-SH-support.patch | 76 ++ patches/0008-Add-x32-support.patch | 64 ++ patches/0009-build-Fix-DESTDIR-handling.patch | 72 ++ ...0-build-Do-not-use-Werror-by-default.patch | 25 + .../0011-build-Honour-user-build-flags.patch | 83 ++ patches/series | 48 ++ .../0001-Fix-test-issue-with-gcc-11.patch | 68 ++ ...t-libgcc-to-avoid-unresolved-symbols.patch | 54 ++ ...nning-tests-against-the-installed-li.patch | 37 + ...missing-space-in-man-page-references.patch | 468 ++++++++++ ...the-correct-troff-macro-for-comments.patch | 204 +++++ ...Refer-to-libaio.h-instead-of-libio.h.patch | 36 + ...0005-man-End-sentences-with-a-period.patch | 134 +++ patches/upstream/0006-man-Fix-casing.patch | 55 ++ .../0007-man-Fix-period-formatting.patch | 212 +++++ .../0008-man-Remove-spurious-spaces.patch | 55 ++ .../0009-man-Remove-spurious-text.patch | 55 ++ .../0010-man-Add-None-to-empty-sections.patch | 28 + patches/upstream/0011-man-Fix-typos.patch | 213 +++++ .../upstream/0012-man-Fix-title-header.patch | 180 ++++ patches/upstream/0013-man-Fix-markup.patch | 799 ++++++++++++++++++ .../upstream/0014-man-Fold-short-lines.patch | 55 ++ ...tim-n-in-order-to-make-it-through-ro.patch | 61 ++ ...ntly-for-io_context_t-instead-of-ctx.patch | 153 ++++ ...ination-strncpy-expression-for-sizeo.patch | 53 ++ ...time-_SC_PAGE_SIZE-instead-of-build-.patch | 116 +++ ...C-V-use-SYS_eventfd2-instead-of-unav.patch | 38 + ...-test-exit-with-a-code-matching-the-.patch | 28 + ...rness-add-support-for-skipping-tests.patch | 89 ++ ...back-code-for-filesystems-not-suppor.patch | 111 +++ ...NOTSUP-from-io_submit-with-RWF_NOWAI.patch | 45 + ...p-22.p-if-async_poll-isn-t-supported.patch | 52 ++ ...s-fix-read-into-PROT_WRITE-mmap-test.patch | 40 + ...26-harness-Fix-PROT_WRITE-mmap-check.patch | 46 + ...tter-error-messages-on-error-conditi.patch | 81 ++ ...-test-if-io_pgetevents-is-not-implem.patch | 47 ++ rules | 48 ++ source/format | 1 + tests/control | 7 + tests/test-unit | 14 + tests/test-unit-root | 14 + upstream/metadata | 2 + watch | 3 + 61 files changed, 5358 insertions(+) create mode 100644 changelog create mode 100644 control create mode 100644 copyright create mode 100644 libaio-dev.install create mode 100644 libaio-dev.manpages create mode 100644 libaio1-udeb.install create mode 100644 libaio1.install create mode 100644 libaio1.symbols create mode 100644 patches/0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch create mode 100644 patches/0001-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch create mode 100644 patches/0001-man-Fix-typos.patch create mode 100644 patches/0001-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch create mode 100644 patches/0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch create mode 100644 patches/0002-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch create mode 100644 patches/0003-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch create mode 100644 patches/0004-Fix-and-improve-MIPS-support.patch create mode 100644 patches/0005-Add-PARISC-support.patch create mode 100644 patches/0006-Add-m68k-support.patch create mode 100644 patches/0007-Add-SH-support.patch create mode 100644 patches/0008-Add-x32-support.patch create mode 100644 patches/0009-build-Fix-DESTDIR-handling.patch create mode 100644 patches/0010-build-Do-not-use-Werror-by-default.patch create mode 100644 patches/0011-build-Honour-user-build-flags.patch create mode 100644 patches/series create mode 100644 patches/upstream/0001-Fix-test-issue-with-gcc-11.patch create mode 100644 patches/upstream/0001-Link-against-libgcc-to-avoid-unresolved-symbols.patch create mode 100644 patches/upstream/0001-harness-allow-running-tests-against-the-installed-li.patch create mode 100644 patches/upstream/0002-man-Add-missing-space-in-man-page-references.patch create mode 100644 patches/upstream/0003-man-Use-the-correct-troff-macro-for-comments.patch create mode 100644 patches/upstream/0004-man-Refer-to-libaio.h-instead-of-libio.h.patch create mode 100644 patches/upstream/0005-man-End-sentences-with-a-period.patch create mode 100644 patches/upstream/0006-man-Fix-casing.patch create mode 100644 patches/upstream/0007-man-Fix-period-formatting.patch create mode 100644 patches/upstream/0008-man-Remove-spurious-spaces.patch create mode 100644 patches/upstream/0009-man-Remove-spurious-text.patch create mode 100644 patches/upstream/0010-man-Add-None-to-empty-sections.patch create mode 100644 patches/upstream/0011-man-Fix-typos.patch create mode 100644 patches/upstream/0012-man-Fix-title-header.patch create mode 100644 patches/upstream/0013-man-Fix-markup.patch create mode 100644 patches/upstream/0014-man-Fold-short-lines.patch create mode 100644 patches/upstream/0015-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch create mode 100644 patches/upstream/0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch create mode 100644 patches/upstream/0017-harness-Use-destination-strncpy-expression-for-sizeo.patch create mode 100644 patches/upstream/0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch create mode 100644 patches/upstream/0019-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-unav.patch create mode 100644 patches/upstream/0020-harness-Make-the-test-exit-with-a-code-matching-the-.patch create mode 100644 patches/upstream/0021-harness-add-support-for-skipping-tests.patch create mode 100644 patches/upstream/0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch create mode 100644 patches/upstream/0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch create mode 100644 patches/upstream/0024-harness-skip-22.p-if-async_poll-isn-t-supported.patch create mode 100644 patches/upstream/0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch create mode 100644 patches/upstream/0026-harness-Fix-PROT_WRITE-mmap-check.patch create mode 100644 patches/upstream/0027-harness-Print-better-error-messages-on-error-conditi.patch create mode 100644 patches/upstream/0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch create mode 100755 rules create mode 100644 source/format create mode 100644 tests/control create mode 100755 tests/test-unit create mode 100755 tests/test-unit-root create mode 100644 upstream/metadata create mode 100644 watch diff --git a/changelog b/changelog new file mode 100644 index 0000000..70a3e60 --- /dev/null +++ b/changelog @@ -0,0 +1,513 @@ +libaio (0.3.112-12) unstable; urgency=medium + + * Add patch from upstream to fix test suite warning with gcc-11. + * Fix LTO build by using symver function attribute instead of .symver + __asm__ statement. (Closes: #998309) + + -- Guillem Jover Wed, 03 Nov 2021 00:56:45 +0100 + +libaio (0.3.112-11) unstable; urgency=medium + + * Use CC as a shell variable instead of a make one in autopkgtests. + * Fix typos in io(3) man page. + + -- Guillem Jover Sun, 10 Oct 2021 06:34:12 +0200 + +libaio (0.3.112-10) unstable; urgency=medium + + * Add autopkgtests. + * Switch to Standards-Version 4.6.0 (no changes needed). + * Ship all man pages again, now that the redundant ones are no longer + present, and the ones that describe the interfaces in the library live + in section 3 which do not conflict with the ones in manpages-dev. + (Closes: #995110) + * Stop shipping upstream TODO file in libaio-dev. + * List pathnames explicitly in debhelper .install fragment files, instead + of using over matching globs. + + -- Guillem Jover Sat, 09 Oct 2021 17:31:09 +0200 + +libaio (0.3.112-9) unstable; urgency=medium + + * Remove Build-Depends on dpkg-dev, satisfied in stable. + * Switch to debhelper compatibility level 13. + * Do not pass ChangeLog to dh_installchangelogs, now handled by default. + * Switch to Standards-Version 4.5.1 (no changes needed). + * Switch to the dh sequencer. + * Add debian/upstream/metadata file. + + -- Guillem Jover Thu, 24 Dec 2020 15:41:17 +0100 + +libaio (0.3.112-8) unstable; urgency=medium + + * Add a comment with the reason for each architecture being in the flaky + test suite mode. + * Remove temporary forced flaky test suite run on architectures built under + an emulator, and move them to the permanent flaky list. + * Add x32 to the flaky test suite mode list, it's still failing on the build + daemons, even though it worked locally. + * Remove no longer needed TESTS_RUN logic, and inline the nocheck condition. + + -- Guillem Jover Mon, 13 Apr 2020 02:58:47 +0200 + +libaio (0.3.112-7) unstable; urgency=medium + + * Cleanup patches: + - Move upstream patches under debian/patches/upstream/. + - Fix syscall definitions for ARM and ia64 to match the kernel exactly. + Otherwise the preprocessor emits warnings about redefinitions. + - Split the architecture support patches into one per arch support. + - Fix syscall definitions for hppa to match the kernel exactly. + - Make __X32_SYSCALL_BIT an unsigned long constant to match the kernel. + - Fix x32 structures padding. + - Rework build system patches to ready them for upstream submission, + and drop libdevdir support which we do not use anymore. + * Fix logic inversion in test suite flaky handling. + * Remove trailing closing parenthesis from TESTS_RUN conditional. + * Print a message when we run the test suite in flaky mode. + * Remove armhf from the test suite flaky mode. + + -- Guillem Jover Sun, 12 Apr 2020 04:49:39 +0200 + +libaio (0.3.112-6) unstable; urgency=medium + + * Sync with upstream commits: + - Rebase against latest upstream git master. + - Skip the test if io_pgetevents() is not implemented. + * Switch to Standards-Version 4.5.0 (no changes needed). + * Do not pass --add-udeb to dh_makeshlibs anymore, it's autodetected since + debhelper 12.3, for which we add an explicit versioned Build-Depends. + * Use correct syscall numbers for x32 port. + * Make the testsuite fatal on architectures known to pass it, to avoid + future regressions. + * Temporarily force a flaky test suite run on architectures built under + and emulator, to get test results. + + -- Guillem Jover Sat, 11 Apr 2020 19:06:49 +0200 + +libaio (0.3.112-5) unstable; urgency=medium + + * Sync with upstream commits: + - Make test suite failures fatal, so we ignore errors for now, until it + passes at least in all release architectures. + - Add support for SKIPable tests. + - Allow running tests against the installed library, which will make + possible to add autopkgtests. + - Fix test case 5.t, by using a write() instead of a read() to force the + kernel to read from the unreadable buffer. + * Add a workaround to io_pgetevents() for 32-bit userland running on + 64-bit kernels to cope with the broken compat kernel syscall, which uses + a 64-bit pointer instead of a 32-bit one, and eats the sigset_t size + member which makes it then fail a consistency check and return -EINVAL. + This fixes test case 22.t. The kernel fix is being prepared as well. + * Add more detailed error messages to test case 22.t. + + -- Guillem Jover Fri, 16 Aug 2019 05:11:10 +0200 + +libaio (0.3.112-4) unstable; urgency=medium + + * Switch to Standards-Version 4.4.0 (no changes needed). + * Switch to debhelper compatibility level 12. + * Switch from debian/compat to debhelper-compat in Build-Depends. + * Test suite fixes: + - Fix the attempt_rw READ call to be arch-dependent instead of making + it the WRITE call. Thanks to Jeff Moyer . + + -- Guillem Jover Fri, 02 Aug 2019 05:33:44 +0200 + +libaio (0.3.112-3) unstable; urgency=medium + + * Test suite fixes: + - Fix logic inversion in EINVAL check. + - Revert making the test suite fatal on failures, as the Debian buildd + setup is peculiar enough to make at least two tests fail. This will + need further work. + + -- Guillem Jover Tue, 26 Feb 2019 05:26:21 +0100 + +libaio (0.3.112-2) unstable; urgency=medium + + * Test suite fixes: + - Make RISC-V use SYS_eventfd2 instead of unavailable SYS_eventfd. + - Add fallback code for filesystems not supporting O_DIRECT. + - Handle -ENOTSUP in addition to -EINVAL from io_submit() with RWF_NOWAIT. + - The WRITE call does not change across different arches anymore. + - Make the test exit with a code matching the pass/fail state. + This will turn test suite errors into fatal build problems. + + -- Guillem Jover Tue, 26 Feb 2019 03:14:38 +0100 + +libaio (0.3.112-1) unstable; urgency=medium + + * New upstream release. + - Refresh patches. + - Remove patches merged upstream. + - Add new patch to fix error due to -Werror=sizeof-pointer-memaccess. + - Split man page cleanup into logic changes, and further improve the + formatting, markup, typo fixes, etc. + * Use expanded symbol file instead of matching on symver. Even though + upstream manages versioned symbols correctly, being explicit makes it + safer against accidental changes. + * Add a Build-Depends-Package field to the symbols file. + * Only install upstream TODO into libaio-dev. + * Remove support for old debug symbol package migration. + * Add comment for dpkg-dev versioned Build-Depends. + * Perform a proper and correct /usr-merge transition by moving the package + contents from / to /usr. + * Now using Standards-Version 4.3.0 (no changes needed). + * Remove unused make variables from debian/rules. + + -- Guillem Jover Mon, 25 Feb 2019 02:56:55 +0100 + +libaio (0.3.111-1) unstable; urgency=medium + + * New upstream release. + - Refresh patches. + - Fix x32 support. (Closes: #883904) + - Add riscv64 support. (Closes: #893003) + * Fix cross-building by not invoking getconf for PAGESIZE, and instead + getting the value at run-time. + * Do not pass -fomit-frame-pointer as part of the required compiler flags. + * Remove now always unused lintian override, as upstream requires linking + against libc everywhere for its syscall(3) usage. + * Mark libaio-dev as Multi-Arch same. + * Now using Standards-Version 4.1.3 (no changes needed). + * Switch to debhelper compatibility level 11. + + -- Guillem Jover Sun, 18 Mar 2018 02:58:44 +0100 + +libaio (0.3.110-5) unstable; urgency=medium + + * Line-wrap and sort debian/control fields. + * Now using Standards-Version 4.1.1 (no changes needed). + * Use dpkg buildtools.mk fragment to set a correct CC. + * Set Rules-Requires-Root to no. + * Switch to debian/watch format version 4. + * Fix regex in debian/watch file to not include extension in the version. + + -- Guillem Jover Sun, 05 Nov 2017 16:26:47 +0100 + +libaio (0.3.110-4) unstable; urgency=medium + + * Update upstream URLs to point to pagure.io instead of obsolete + fedorahosted.org site. + * Switch to debhelper compatibility level 10. + * Now using Standards-Version 4.0.1 (no changes needed). + * Move location of LGPL in Debian systems into a Comment field in + debian/copyright. + * Use -a instead of deprecated -s in debhelper commands. + + -- Guillem Jover Tue, 08 Aug 2017 00:29:32 +0200 + +libaio (0.3.110-3) unstable; urgency=medium + + * Use https for hadrons.org and debian.org URLs. + * Switch debug package to a ddeb. + * Switch to the dpkg makefile fragments in debian/rules. + * Enable hardening bindnow feature. + * Update URL in debian/watch. + * Fix typos in man pages, reported by lintian. + * Now using Standards-Version 3.9.8 (no changes needed). + + -- Guillem Jover Tue, 31 May 2016 20:38:08 +0200 + +libaio (0.3.110-2) unstable; urgency=medium + + * Use https for the debian/copyright Format URL. + * Switch Vcs-Browser to a cgit URL. + * Update Homepage URL to new release site. + Prompted by Sedat Dilek . + * Use https in debian/watch URL. + * Add a small note on each long package description explaining what is + contained on each package. + * Document each patch. + + -- Guillem Jover Tue, 29 Sep 2015 16:48:30 +0200 + +libaio (0.3.110-1) unstable; urgency=low + + * New upstream release. + - Refresh patches. + * Link against -lc and -Wl,--as-needed so that we pull the required + fortified functions from the internal libc_nonshared.a, but do not link + against the shared library because we do not use any of its symbols. + (Closes: #764509) + * Switch debian/copyright to machine-readable format 1.0. + * Now using Standards-Version 3.9.6 (no changes needed). + * Switch to debhelper compatibility level 9. + * Fix mips/mipsel syscall wrappers to return correct error values. + Thanks to Jurica Stanojkovic . + * Add mips64 support. Reported by Jeremy Fitzhardinge . + + -- Guillem Jover Thu, 09 Oct 2014 05:44:48 +0200 + +libaio (0.3.109-4) unstable; urgency=low + + * Now using Standards-Version 3.9.4 (no changes needed). + * Remove package creation information from debian/copyright. + * Update upstream git URL in debian/copyright. + * Add support for x32 (from the Yocto project). (Closes: #702183) + Thanks to Daniel Schepler . + * Add support for arm64 (stolen from upstream). (Closes: #702409) + Thanks to Ian Campbell . + * Add cross-compilation support. + Based on a patch by Ian Campbell . + * Update debian/watch file to a working URL. + + -- Guillem Jover Mon, 06 May 2013 18:56:19 +0200 + +libaio (0.3.109-3) unstable; urgency=low + + * Escape backslash in man pages. (Closes: #651833) + Thanks to Stephan Springl . + * Do not install man pages now provided by manpages-dev. (Closes: #650108) + * Use dpkg-buildflags to set CPPFLAGS, CFLAGS and LDFLAGS. + * Now using Standards-Version 3.9.3 (no changes needed). + + -- Guillem Jover Thu, 21 Jun 2012 09:21:59 +0200 + +libaio (0.3.109-2) unstable; urgency=low + + * Add a symbols file for libaio1. + * Remove heading ‘./’ from lintian-override tag. + * Fix FTBFS with newer gcc 4.6: (Closes: #638848) + - Do not build the test-suite with -Werror. + - Use unused waitpid() return code variables to assert valid values. + * Make shared library packages multiarch: + - Build-Depend on debhelper 8.1.3. + - Add misc:Pre-Depends substvar to Pre-Depends field in libaio1. + - Add “Multi-Arch: same” field to libaio1 and libaio1-dbg. + - Change paths from lib/ to lib/* in install and lintian-override files. + - Define DEB_HOST_MULTIARCH and use it to set libdir and libdevdir. + * Install all libaio io*.3 man pages. (Closes: #418048) + * Do not install man pages for functions coming from libc, the aio* + and lio_listio* man pages are already shipped by manpages-dev. + * Merge adapted changes from Ubuntu. (Closes: #588112) + - Change Priority from extra to optional. + - Add support for sparc64 and hppa 64-bit architectures. + * Set libaio1-dbg Priority back to extra. + * Now using Standards-Version 3.9.2 (no changes needed). + + -- Guillem Jover Tue, 30 Aug 2011 16:54:22 +0200 + +libaio (0.3.109-1) unstable; urgency=low + + * New upstream release. + - Refresh patches. + * Switch to source format “3.0 (quilt)”: + - Remove quilt from Build-Depends. + - Remove quilt.make include from debian/rules. + - Remove patch and unpatch targets from debian/rules. + - Remove now unneeded debian/README.source. + * Update watch file to point to the new upstream URL at kernel.org. + * Now using Standards-Version 3.9.1 (no changes needed). + * Add missing ${misc:Depends} to eveyr package Depends fields. + * Switch Architecture field list to just linux-any, and although the + code will not automatically support new Linux architectures, as it + will miss the syscall-.h header support among others, it just + needs to be ported, and this way it's easier to spot. This implicitly + adds amrhf support. (Closes: #596996) + * Add a Homepage field. (Closes: #566338) + + -- Guillem Jover Sun, 27 Feb 2011 05:22:27 +0100 + +libaio (0.3.107-7) unstable; urgency=low + + * Add support for sh3 and sh4. (Closes: #535288) + Thanks to Nobuhiro Iwamatsu . + * Now using Standards-Version 3.8.3 (no changes needed). + + -- Guillem Jover Thu, 10 Sep 2009 13:02:34 +0200 + +libaio (0.3.107-6) unstable; urgency=low + + * Workaround debhelper compat v7 bug (#534565) in dh_install which makes + files end up under /debian/tmp/ in the binary package, by not passing + --sourcedir to dh_install. (Closes: #533359, #532644) + * Pass -s to arch dependent debhelper commands. + * Now using Standards-Version 3.8.2 (no changes needed). + + -- Guillem Jover Thu, 25 Jun 2009 14:11:25 +0200 + +libaio (0.3.107-5) unstable; urgency=low + + * Change libaio1-dbg section to debug. + * Fix build failure in test suite on non-i386 32 bit architectures. + * Fix man pages errors and warnings. + + -- Guillem Jover Wed, 10 Jun 2009 06:09:52 +0200 + +libaio (0.3.107-4) unstable; urgency=low + + * Switch to debhelper compatibility level 7. + * Use dh_prep instead of “dh_clean -k”. + * Remove libaio1.dirs, unneeded due to dh_lintian taking care of it. + * Run the test suite on all architectures and not only on i386. + * Now using Standards-Version 3.8.1 (no changes needed). + * Switch the upstream repository reference from CVS to git. + + -- Guillem Jover Mon, 08 Jun 2009 19:40:54 +0200 + +libaio (0.3.107-3) unstable; urgency=low + + * Fix the Vcs-Git URL. + * Remove XB- from the Package-Type field. + * Fix watch file URL. (Closes: #502884) + Thanks to Jiří Paleček . + + -- Guillem Jover Mon, 20 Oct 2008 20:36:43 +0300 + +libaio (0.3.107-2) unstable; urgency=low + + * Only run the test suite on i386 as it has not been ported for other + architectures. (Closes: #488812) + * Use $(filter ...) instead of $(findstring ...) to extract space separated + options from DEB_BUILD_OPTIONS in debian/rules. + * Do not check for the existence of the Makefile on clean, it's always + there. + * Switch to use dh_lintian instead of manually installing the overrides. + - Bump the versioned debhelper Build-Depends to 6.0.7. + + -- Guillem Jover Wed, 09 Jul 2008 05:32:30 +0300 + +libaio (0.3.107-1) unstable; urgency=low + + * New upstream release. + * Run the test suite on install, and support nocheck DEB_BUILD_OPTIONS + to disable it. + + -- Guillem Jover Tue, 24 Jun 2008 09:03:54 +0300 + +libaio (0.3.106-9) unstable; urgency=low + + * Fix misspelled words (linux -> Linux and aio -> AIO). + * Update packaging Vcs fields to the new URL. + * Improve debian/copyright: + - Change 'Copyright Holder' to 'Copyright Holders'. + - Use UTF-8 copyright sign. + - Update upstream download url. + - Refer to LGPL-2.1 from common-licenses instead of just LGPL. + * Add a debian/README.source file. + * Now using Standards-Version 3.8.0. + * Refresh patches with -pab. (Closes: #484962) + * Update watch file URL. (Closes: #450017) + + -- Guillem Jover Sun, 22 Jun 2008 07:42:52 +0300 + +libaio (0.3.106-8) unstable; urgency=low + + * Install shared library under /lib, needed by multipath binaries which + reside under /sbin. (Closes: #441244) + - debian/patches/02_libdevdir.patch: New file. + * Add a debugging symbols library package. + * Add Vcs-Browser and Vcs-Git fields. + + -- Guillem Jover Tue, 11 Sep 2007 04:29:22 +0300 + +libaio (0.3.106-7) unstable; urgency=low + + * Add a new library udeb needed for multipath support. (Closes: #440320) + + -- Guillem Jover Thu, 06 Sep 2007 03:11:08 +0300 + +libaio (0.3.106-6) unstable; urgency=low + + * Link against libgcc to avoid unresolved symbols on at least hppa. + - debian/01_link_libgcc.patch: New file. + Thanks to Steve Langasek for the analysis. + * Add shlibs:Depends substvar back into libaio1 Depends, since we link + against an external library now (although it might not be used on any + architecture). + + -- Guillem Jover Mon, 06 Aug 2007 04:50:18 +0300 + +libaio (0.3.106-5) unstable; urgency=low + + * Do not ignore 'make clean' errors on clean. + * Support build-arch and build-indep in debian/rules: + - Rename install to install-arch. + - Rename build to build-arch. + - Add an empty build target that depends on build-arch and build-indep. + * Switch directory variables to simply expanded ones in debian/rules. + * Use binary:Version instead of the deprecated Source-Version substvar. + * Remove Tag field as it does not seem to make much sense to include it + in the packages. + + -- Guillem Jover Tue, 17 Jul 2007 09:19:26 +0300 + +libaio (0.3.106-4) unstable; urgency=low + + * Add armeb and armel to the Architecture fields. + + -- Guillem Jover Fri, 19 Jan 2007 06:48:26 +0200 + +libaio (0.3.106-3) unstable; urgency=low + + * Fix a typo in the arm io_syscall5 macro, making the library end up + with unresolvable symbols. (Closes: #393156) + Thanks to Marcin Juszkiewicz . + + -- Guillem Jover Mon, 16 Oct 2006 10:44:02 +0300 + +libaio (0.3.106-2) unstable; urgency=low + + * Use quilt for patching: + - Add new debian/patches/series file. + - Add Build-Depends on 'quilt (>= 0.40)'. + - Include quilt.make from debian/rules. + * Add support for arm, hppa, m68k, mips, mipsel and sparc. Those have yet + to be tested with the harness test suite and pass it. + * Add a Tag: field to all binary packages. + + -- Guillem Jover Tue, 19 Sep 2006 00:48:10 +0300 + +libaio (0.3.106-1) unstable; urgency=low + + * New Upstream Release. (Closes: #384268) + - Fix .endp being outside of procedure on ia64 with new binutils. + (Closes: #385373) + + -- Guillem Jover Fri, 1 Sep 2006 05:51:36 +0300 + +libaio (0.3.104-2) unstable; urgency=low + + * New Maintainer. + * Provide a new binary package libaio-dev, with the static library + the .so symlink and the manpages. (Closes: #318795) + * Add debian/libaio-dev.install. + * Add debian/libaio-dev.manpages. + * Rename the binary package libaio to libaio1 to match the soname, no + transition package as no one depends on it. + * Rename debian/lintian.override to debian/libaio1.lintian. + * Remove shlib-missing-in-control-file lintian override as we provide + now the shlibs file. + * Only put "usr/share/lintian/override" in libaio1.dirs. + * Remove temporal debhelper leftover files: + - debian/libaio-0.3.104.postinst.debhelper + - debian/libaio-0.3.104.postrm.debhelper + * Add amd64 to the Architecture fields. (Closes: #335352) + * Switch to debhelper compat level 5. + * Now using Standards-Version 3.7.2. + * Change Priority from optional to extra. + * Specify in the package description that this library is for Linux. + * Remove unneeded debian/dirs file. + * Remove debian/debianize.patch, we actually want the .so symlink + and the .a library when doing "make install". + * Clean up debian/rules: + - Do not use stamp files. + - Remove unused comments. + - Remove unused configure target. + - Do not pass DESTDIR to make as it is not using it. + * Complete debian/copyright: + - Add copyright holder information. + - Add the LGPL license snippet. + - Specify a download url which actually works. + * Add a watch file. + + -- Guillem Jover Thu, 24 Aug 2006 05:45:36 +0300 + +libaio (0.3.104-1) unstable; urgency=low + + * Initial Release. + + -- William Lee Irwin III Fri, 22 Apr 2005 14:49:28 -0700 diff --git a/control b/control new file mode 100644 index 0000000..868be44 --- /dev/null +++ b/control @@ -0,0 +1,54 @@ +Source: libaio +Maintainer: Guillem Jover +Priority: optional +Section: libs +Vcs-Browser: https://git.hadrons.org/cgit/debian/pkgs/libaio.git +Vcs-Git: https://git.hadrons.org/git/debian/pkgs/libaio.git +Homepage: https://pagure.io/libaio +Standards-Version: 4.6.0 +Rules-Requires-Root: no +Build-Depends: + debhelper-compat (= 13), + +Package: libaio1 +Architecture: linux-any +Multi-Arch: same +Pre-Depends: + ${misc:Pre-Depends}, +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Description: Linux kernel AIO access library - shared library + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the shared library. + +Package: libaio1-udeb +Package-Type: udeb +Section: debian-installer +Architecture: linux-any +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Description: Linux kernel AIO access library - shared library + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the udeb shared library. + +Package: libaio-dev +Section: libdevel +Architecture: linux-any +Multi-Arch: same +Depends: + ${misc:Depends}, + libaio1 (= ${binary:Version}), +Description: Linux kernel AIO access library - development files + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the static library and the header files. diff --git a/copyright b/copyright new file mode 100644 index 0000000..3892c71 --- /dev/null +++ b/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libaio +Upstream-Contact: Jeff Moyer +Source: https://pagure.io/libaio.git + +Files: * +Copyright: + Copyright © 2002-2003 Benjamin LaHaise + Copyright © 2003-2006, 2008-2009, 2013, 2018 Jeff Moyer +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public License + along with this library. If not, see . +Comment: + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in '/usr/share/common-licenses/LGPL-2.1'. diff --git a/libaio-dev.install b/libaio-dev.install new file mode 100644 index 0000000..dd27ae3 --- /dev/null +++ b/libaio-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/libaio.so +usr/lib/*/libaio.a diff --git a/libaio-dev.manpages b/libaio-dev.manpages new file mode 100644 index 0000000..fecc25c --- /dev/null +++ b/libaio-dev.manpages @@ -0,0 +1,13 @@ +man/io.3 +man/io_cancel.3 +man/io_fsync.3 +man/io_getevents.3 +man/io_prep_fsync.3 +man/io_prep_pread.3 +man/io_prep_pwrite.3 +man/io_queue_init.3 +man/io_queue_release.3 +man/io_queue_run.3 +man/io_queue_wait.3 +man/io_set_callback.3 +man/io_submit.3 diff --git a/libaio1-udeb.install b/libaio1-udeb.install new file mode 100644 index 0000000..cb2dadb --- /dev/null +++ b/libaio1-udeb.install @@ -0,0 +1,2 @@ +usr/lib/*/libaio.so.1 +usr/lib/*/libaio.so.1.* diff --git a/libaio1.install b/libaio1.install new file mode 100644 index 0000000..cb2dadb --- /dev/null +++ b/libaio1.install @@ -0,0 +1,2 @@ +usr/lib/*/libaio.so.1 +usr/lib/*/libaio.so.1.* diff --git a/libaio1.symbols b/libaio1.symbols new file mode 100644 index 0000000..5e6747c --- /dev/null +++ b/libaio1.symbols @@ -0,0 +1,18 @@ +libaio.so.1 libaio1 #MINVER# +* Build-Depends-Package: libaio-dev + LIBAIO_0.1@LIBAIO_0.1 0.3.9 + LIBAIO_0.4@LIBAIO_0.4 0.3.93 + LIBAIO_0.5@LIBAIO_0.5 0.3.112 + io_cancel@LIBAIO_0.1 0.3.9 + io_cancel@LIBAIO_0.4 0.3.93 + io_destroy@LIBAIO_0.4 0.3.93 + io_getevents@LIBAIO_0.1 0.3.9 + io_getevents@LIBAIO_0.4 0.3.93 + io_pgetevents@LIBAIO_0.5 0.3.112 + io_queue_init@LIBAIO_0.1 0.3.9 + io_queue_release@LIBAIO_0.1 0.3.9 + io_queue_run@LIBAIO_0.1 0.3.9 + io_queue_wait@LIBAIO_0.1 0.3.9 + io_queue_wait@LIBAIO_0.4 0.3.93 + io_setup@LIBAIO_0.4 0.3.93 + io_submit@LIBAIO_0.1 0.3.9 diff --git a/patches/0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch b/patches/0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch new file mode 100644 index 0000000..de9d577 --- /dev/null +++ b/patches/0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch @@ -0,0 +1,107 @@ +From 70bed6aad97ad28d3bfc6dc8bf3c8f9aed77282b Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 16 Aug 2019 02:33:46 +0200 +Subject: [PATCH libaio] Fix io_pgetevents() syscall wrapper on 32-bit userland + on 64-bit kernels + +The kernel compat syscall in the kernel got introduced with a broken +layout, which requires a pointer to the actual sigset_t variable but +with the size of the running kernel, not the size of the compat code. + +This means that when the wrapper sends the expected compat (32-bit) +pointer, the kernel reads a 64-bit pointer, eating with it also the +sigset size member. And then proceeds to fail the comparison of the +sigset_t size and returns EINVAL. + +This really needs to be fixed in the kernel, as there's no apparent +user of the broken compat layout (from codesearch.debian.org, nor a +quick github.com search). But we have to workaround it in libaio so +that we can use kernels that have not yet been fixed. + +We do that, by trying the non-broken layout (that would be used with +a 32-bit userland on a 32-bit kernel), and if that fails with -EINVAL +we retry with a structure padded to what the kernel expects. + +Signed-off-by: Guillem Jover +--- + src/io_pgetevents.c | 38 +++++++++++++++++++++++++++++++------- + src/libaio.h | 10 ++++++++++ + 2 files changed, 41 insertions(+), 7 deletions(-) + +diff --git a/src/io_pgetevents.c b/src/io_pgetevents.c +index e6b0614..b2515f2 100644 +--- a/src/io_pgetevents.c ++++ b/src/io_pgetevents.c +@@ -33,17 +33,41 @@ int io_pgetevents(io_context_t ctx, long min_nr, long nr, + struct io_event *events, struct timespec *timeout, + sigset_t *sigmask) + { +- struct { +- unsigned long ss; +- unsigned long ss_len; +- } data; ++ struct io_sigset aio_sigset; ++#ifndef __LP64__ ++ struct io_sigset_compat aio_sigset_compat = { 0 }; ++#endif ++ int ret; + + if (aio_ring_is_empty(ctx, timeout)) + return 0; + +- data.ss = (unsigned long)sigmask; +- data.ss_len = _NSIG / 8; +- return __io_pgetevents(ctx, min_nr, nr, events, timeout, &data); ++ aio_sigset.ss = (unsigned long)sigmask; ++ aio_sigset.ss_len = _NSIG / 8; ++ ret = __io_pgetevents(ctx, min_nr, nr, events, timeout, &aio_sigset); ++ ++#ifndef __LP64__ ++ /* ++ * The compat kernel syscall got introduced with an broken layout for ++ * its sigset argument, expecting it to contain a pointer for the ++ * non-compat pointer size. ++ * ++ * To cope with this on unfixed kernels, in case we are built as a ++ * 32-bit library (which could run on a kernel with compat code) and ++ * when the syscall returns EINVAL due to the kernel not finding the ++ * sigset size member when unpacking the structure, we retry with ++ * the fixed up compat layout, which requires the padding to be ++ * zero-filled, otherwise the 64-bit pointer will contain garbage. ++ */ ++ if (ret != -EINVAL) ++ return ret; ++ ++ aio_sigset_compat.ss = (unsigned long)sigmask; ++ aio_sigset_compat.ss_len = _NSIG / 8; ++ ret = __io_pgetevents(ctx, min_nr, nr, events, timeout, &aio_sigset_compat); ++#endif ++ ++ return ret; + } + #else + int io_pgetevents(io_context_t ctx, long min_nr, long nr, +diff --git a/src/libaio.h b/src/libaio.h +index ce3aad1..36ab9bc 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -152,6 +152,16 @@ struct io_event { + PADDEDul(res2, __pad4); + }; + ++struct io_sigset { ++ unsigned long ss; ++ unsigned long ss_len; ++}; ++ ++struct io_sigset_compat { ++ PADDEDptr(unsigned long ss, __ss_pad); ++ unsigned long ss_len; ++}; ++ + #undef PADDED + #undef PADDEDptr + #undef PADDEDul +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0001-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch b/patches/0001-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch new file mode 100644 index 0000000..137bd97 --- /dev/null +++ b/patches/0001-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch @@ -0,0 +1,66 @@ +From d794e5b83056aaa7b96b20fa5f505b777f66f41f Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 3 Nov 2021 00:20:50 +0100 +Subject: [PATCH 1/2] Move semicolon to SYMVER and DEFSYMVER call sites + +These look like function macros, so let's unify their call sites to use +function syntax with a final semicolon. + +Signed-off-by: Guillem Jover +--- + src/io_cancel.c | 2 +- + src/io_getevents.c | 2 +- + src/io_queue_wait.c | 2 +- + src/syscall.h | 4 ++-- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/io_cancel.c b/src/io_cancel.c +index 2f0f5f4..441806d 100644 +--- a/src/io_cancel.c ++++ b/src/io_cancel.c +@@ -20,4 +20,4 @@ + #include "syscall.h" + + io_syscall3(int, io_cancel_0_4, io_cancel, io_context_t, ctx, struct iocb *, iocb, struct io_event *, event) +-DEFSYMVER(io_cancel_0_4, io_cancel, 0.4) ++DEFSYMVER(io_cancel_0_4, io_cancel, 0.4); +diff --git a/src/io_getevents.c b/src/io_getevents.c +index 90d6081..88d285a 100644 +--- a/src/io_getevents.c ++++ b/src/io_getevents.c +@@ -32,4 +32,4 @@ int io_getevents_0_4(io_context_t ctx, long min_nr, long nr, struct io_event * e + return __io_getevents_0_4(ctx, min_nr, nr, events, timeout); + } + +-DEFSYMVER(io_getevents_0_4, io_getevents, 0.4) ++DEFSYMVER(io_getevents_0_4, io_getevents, 0.4); +diff --git a/src/io_queue_wait.c b/src/io_queue_wait.c +index 538d2f3..6f69a51 100644 +--- a/src/io_queue_wait.c ++++ b/src/io_queue_wait.c +@@ -28,4 +28,4 @@ int io_queue_wait_0_4(io_context_t ctx, struct timespec *timeout) + { + return io_getevents(ctx, 0, 0, NULL, timeout); + } +-DEFSYMVER(io_queue_wait_0_4, io_queue_wait, 0.4) ++DEFSYMVER(io_queue_wait_0_4, io_queue_wait, 0.4); +diff --git a/src/syscall.h b/src/syscall.h +index d2a117b..f7ce979 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -6,10 +6,10 @@ + #define SYMSTR(str) _SYMSTR(str) + + #define SYMVER(compat_sym, orig_sym, ver_sym) \ +- __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)); ++ __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)) + + #define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ +- __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)); ++ __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)) + + #if defined(__i386__) + #include "syscall-i386.h" +-- +2.33.1 + diff --git a/patches/0001-man-Fix-typos.patch b/patches/0001-man-Fix-typos.patch new file mode 100644 index 0000000..48827f1 --- /dev/null +++ b/patches/0001-man-Fix-typos.patch @@ -0,0 +1,35 @@ +From d5be842f622eac15b72a5fea7724fe07ee27fc16 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 10 Oct 2021 06:14:51 +0200 +Subject: [PATCH libaio] man: Fix typos + +Warned-by: lintian +--- + man/io.3 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index bfa9836..c4554a5 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -147,7 +147,7 @@ This is experimental. + * 3. When write completes decrement counter and free resources + * + * +- * Usage: aiocp file(s) desination ++ * Usage: aiocp file(s) destination + */ + + #include +@@ -271,7 +271,7 @@ int main(int argc, char *const *argv) + + while (tocopy > 0) { + int i, rc; +- /* Submit as many reads as once as possible upto AIO_MAXIO */ ++ /* Submit as many reads as once as possible up to AIO_MAXIO */ + int n = MIN(MIN(AIO_MAXIO - busy, AIO_MAXIO / 2), + howmany(length - offset, AIO_BLKSIZE)); + if (n > 0) { +-- +2.33.0 + diff --git a/patches/0001-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch b/patches/0001-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch new file mode 100644 index 0000000..d814a75 --- /dev/null +++ b/patches/0001-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch @@ -0,0 +1,34 @@ +From cb1a595e89837b342a8cfd1ace73537c9563fedb Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:39:47 +0200 +Subject: [PATCH libaio 01/11] syscall: Fix ARM definitions to match exactly + the kernel + +Otherwise we get preprocessor warnings due to the redefinitions. + +Signed-off-by: Guillem Jover +--- + src/syscall-arm.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/syscall-arm.h b/src/syscall-arm.h +index 556852b..315a37b 100644 +--- a/src/syscall-arm.h ++++ b/src/syscall-arm.h +@@ -19,8 +19,8 @@ + #define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE + #endif + +-#define __NR_io_setup (__NR_SYSCALL_BASE+243) +-#define __NR_io_destroy (__NR_SYSCALL_BASE+244) +-#define __NR_io_getevents (__NR_SYSCALL_BASE+245) +-#define __NR_io_submit (__NR_SYSCALL_BASE+246) +-#define __NR_io_cancel (__NR_SYSCALL_BASE+247) ++#define __NR_io_setup (__NR_SYSCALL_BASE + 243) ++#define __NR_io_destroy (__NR_SYSCALL_BASE + 244) ++#define __NR_io_getevents (__NR_SYSCALL_BASE + 245) ++#define __NR_io_submit (__NR_SYSCALL_BASE + 246) ++#define __NR_io_cancel (__NR_SYSCALL_BASE + 247) +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch b/patches/0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch new file mode 100644 index 0000000..a752619 --- /dev/null +++ b/patches/0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch @@ -0,0 +1,93 @@ +From e06dceb47bf17894295a96032eb8a2ee53a5a615 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 2 Nov 2021 22:37:32 +0100 +Subject: [PATCH 2/2] Use new symver function attribute to support LTO builds + +The LTO support cannot work properly when there are versioned symbols +via asm statements, as those are not seen by the compiler. Use the new +function attributes if supported instead of the asm statements. + +We need to move the SYMVER calls after the function definitions +otherwise it will reference symbols not yet seen. + +Signed-off-by: Guillem Jover +--- + src/compat-0_1.c | 7 +++---- + src/syscall.h | 13 +++++++++++++ + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/src/compat-0_1.c b/src/compat-0_1.c +index 722e107..ac40fcc 100644 +--- a/src/compat-0_1.c ++++ b/src/compat-0_1.c +@@ -28,7 +28,6 @@ + + + /* ABI change. Provide partial compatibility on this one for now. */ +-SYMVER(compat0_1_io_cancel, io_cancel, 0.1); + int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) + { + struct io_event event; +@@ -36,8 +35,8 @@ int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) + /* FIXME: the old ABI would return the event on the completion queue */ + return io_cancel(ctx, iocb, &event); + } ++SYMVER(compat0_1_io_cancel, io_cancel, 0.1); + +-SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); + int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) + { + struct timespec timeout; +@@ -45,10 +44,10 @@ int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) + timeout = *when; + return io_getevents(ctx, 0, 0, NULL, when ? &timeout : NULL); + } ++SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); + + + /* ABI change. Provide backwards compatibility for this one. */ +-SYMVER(compat0_1_io_getevents, io_getevents, 0.1); + int compat0_1_io_getevents(io_context_t ctx, long nr, + struct io_event *events, + const struct timespec *const_timeout) +@@ -59,4 +58,4 @@ int compat0_1_io_getevents(io_context_t ctx, long nr, + return io_getevents(ctx, 1, nr, events, + const_timeout ? &timeout : NULL); + } +- ++SYMVER(compat0_1_io_getevents, io_getevents, 0.1); +diff --git a/src/syscall.h b/src/syscall.h +index f7ce979..59e0bb3 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -2,14 +2,27 @@ + #include + #include + ++#ifndef __has_attribute ++#define __has_attribute(x) 0 ++#endif ++ + #define _SYMSTR(str) #str + #define SYMSTR(str) _SYMSTR(str) + ++#if __has_attribute(__symver__) ++#define SYMVER(compat_sym, orig_sym, ver_sym) \ ++ extern __typeof(compat_sym) compat_sym \ ++ __attribute__((__symver__(SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)))) ++#define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ ++ extern __typeof(compat_sym) compat_sym \ ++ __attribute__((__symver__(SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)))) ++#else + #define SYMVER(compat_sym, orig_sym, ver_sym) \ + __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)) + + #define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ + __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)) ++#endif + + #if defined(__i386__) + #include "syscall-i386.h" +-- +2.33.1 + diff --git a/patches/0002-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch b/patches/0002-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch new file mode 100644 index 0000000..5ba6246 --- /dev/null +++ b/patches/0002-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch @@ -0,0 +1,32 @@ +From e458ea6bf9526543c206fa4142ed5ef1c77530a6 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:44:43 +0200 +Subject: [PATCH libaio 02/11] syscall: Fix ia64 definitions to match exactly + the kernel + +Otherwise we get preprocessor warnings due to the redefinitions. + +Signed-off-by: Guillem Jover +--- + src/syscall-ia64.h | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/syscall-ia64.h b/src/syscall-ia64.h +index a21e93b..765c423 100644 +--- a/src/syscall-ia64.h ++++ b/src/syscall-ia64.h +@@ -1,5 +1,6 @@ +-#define __NR_io_setup 1238 +-#define __NR_io_destroy 1239 +-#define __NR_io_getevents 1240 +-#define __NR_io_submit 1241 +-#define __NR_io_cancel 1242 ++#define __NR_Linux 1024 ++#define __NR_io_setup (__NR_Linux + 214) ++#define __NR_io_destroy (__NR_Linux + 215) ++#define __NR_io_getevents (__NR_Linux + 216) ++#define __NR_io_submit (__NR_Linux + 217) ++#define __NR_io_cancel (__NR_Linux + 218) +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0003-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch b/patches/0003-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch new file mode 100644 index 0000000..90b5879 --- /dev/null +++ b/patches/0003-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch @@ -0,0 +1,35 @@ +From 9e87b37ec648e69f641dd83c7909a337dbd15728 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:30:09 +0200 +Subject: [PATCH libaio 03/11] harness: Add KERNEL_RW_POINTER for various + 32-bit architectures + +Signed-off-by: Guillem Jover +--- + harness/main.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/harness/main.c b/harness/main.c +index 82e9c69..0eed7bd 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -12,7 +12,16 @@ + #include + + #if __LP64__ == 0 ++#if defined(__i386__) || defined(__powerpc__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) ++#elif defined(__arm__) || defined(__s390__) ++#define KERNEL_RW_POINTER ((void *)0x00010000) ++#elif defined(__sparc__) ++#define KERNEL_RW_POINTER ((void *)0xf0010000) ++#else ++#warning Not really sure where kernel memory is. Guessing. ++#define KERNEL_RW_POINTER ((void *)0xc0010000) ++#endif + #else + //#warning Not really sure where kernel memory is. Guessing. + #define KERNEL_RW_POINTER ((void *)0xffffffff81000000) +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0004-Fix-and-improve-MIPS-support.patch b/patches/0004-Fix-and-improve-MIPS-support.patch new file mode 100644 index 0000000..47b0bf5 --- /dev/null +++ b/patches/0004-Fix-and-improve-MIPS-support.patch @@ -0,0 +1,137 @@ +From f9c8695989fea731c93d99c684482df5744b385c Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:18:50 +0200 +Subject: [PATCH libaio 04/11] Fix and improve MIPS support + +Fix structure padding for MIPS 64, add syscall definitions, and the +kernel R/W pointer. + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 6 +++++- + src/syscall-mips.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++ + src/syscall.h | 2 ++ + 4 files changed, 62 insertions(+), 2 deletions(-) + create mode 100644 src/syscall-mips.h + +diff --git a/harness/main.c b/harness/main.c +index 0eed7bd..33d8e46 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -12,7 +12,7 @@ + #include + + #if __LP64__ == 0 +-#if defined(__i386__) || defined(__powerpc__) ++#if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) + #elif defined(__arm__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) +diff --git a/src/libaio.h b/src/libaio.h +index 8b33382..26b07f9 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,7 +52,9 @@ typedef enum io_iocb_cmd { + + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ +- defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \ ++ defined(__sh__) || \ ++ defined(__bfin__) || \ ++ (defined(__MIPSEL__) && !defined(__mips64)) || \ + defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ + __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4) +@@ -62,6 +64,7 @@ typedef enum io_iocb_cmd { + + /* little endian, 64 bits */ + #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \ ++ (defined(__mips64) && defined(__MIPSEL__)) || \ + (defined(__aarch64__) && defined(__AARCH64EL__)) || \ + (defined(__riscv) && __riscv_xlen == 64) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ +@@ -73,6 +76,7 @@ typedef enum io_iocb_cmd { + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ + (defined(__sparc__) && defined(__arch64__)) || \ ++ (defined(__mips64) && defined(__MIPSEB__)) || \ + (defined(__aarch64__) && defined(__AARCH64EB__)) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8) +diff --git a/src/syscall-mips.h b/src/syscall-mips.h +new file mode 100644 +index 0000000..2c4245e +--- /dev/null ++++ b/src/syscall-mips.h +@@ -0,0 +1,54 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle ++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. ++ */ ++ ++#ifndef _MIPS_SIM_ABI32 ++#define _MIPS_SIM_ABI32 1 ++#define _MIPS_SIM_NABI32 2 ++#define _MIPS_SIM_ABI64 3 ++#endif ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI32 ++ ++/* ++ * Linux o32 style syscalls are in the range from 4000 to 4999. ++ */ ++#define __NR_Linux 4000 ++#define __NR_io_setup (__NR_Linux + 241) ++#define __NR_io_destroy (__NR_Linux + 242) ++#define __NR_io_getevents (__NR_Linux + 243) ++#define __NR_io_submit (__NR_Linux + 244) ++#define __NR_io_cancel (__NR_Linux + 245) ++ ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI64 ++ ++/* ++ * Linux 64-bit syscalls are in the range from 5000 to 5999. ++ */ ++#define __NR_Linux 5000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_NABI32 ++ ++/* ++ * Linux N32 syscalls are in the range from 6000 to 6999. ++ */ ++#define __NR_Linux 6000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ +diff --git a/src/syscall.h b/src/syscall.h +index b53da4c..db78e28 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -27,6 +27,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__mips__) ++#include "syscall-mips.h" + #elif defined(__aarch64__) || defined(__riscv) + #include "syscall-generic.h" + #else +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0005-Add-PARISC-support.patch b/patches/0005-Add-PARISC-support.patch new file mode 100644 index 0000000..ebf827c --- /dev/null +++ b/patches/0005-Add-PARISC-support.patch @@ -0,0 +1,66 @@ +From 1f01c77ff58df16b75d666a4737d80a09ba61b92 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:22:10 +0200 +Subject: [PATCH libaio 05/11] Add PARISC support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 ++ + src/libaio.h | 1 + + src/syscall-parisc.h | 5 +++++ + src/syscall.h | 2 ++ + 4 files changed, 10 insertions(+) + create mode 100644 src/syscall-parisc.h + +diff --git a/harness/main.c b/harness/main.c +index 33d8e46..01c81aa 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -16,6 +16,8 @@ + #define KERNEL_RW_POINTER ((void *)0xc0010000) + #elif defined(__arm__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) ++#elif defined(__hppa__) ++#define KERNEL_RW_POINTER ((void *)0x10100000) + #elif defined(__sparc__) + #define KERNEL_RW_POINTER ((void *)0xf0010000) + #else +diff --git a/src/libaio.h b/src/libaio.h +index 26b07f9..29005d0 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -75,6 +75,7 @@ typedef enum io_iocb_cmd { + + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ ++ (defined(__hppa__) && defined(__arch64__)) || \ + (defined(__sparc__) && defined(__arch64__)) || \ + (defined(__mips64) && defined(__MIPSEB__)) || \ + (defined(__aarch64__) && defined(__AARCH64EB__)) || \ +diff --git a/src/syscall-parisc.h b/src/syscall-parisc.h +new file mode 100644 +index 0000000..1738075 +--- /dev/null ++++ b/src/syscall-parisc.h +@@ -0,0 +1,5 @@ ++#define __NR_io_setup 215 ++#define __NR_io_destroy 216 ++#define __NR_io_getevents 217 ++#define __NR_io_submit 218 ++#define __NR_io_cancel 219 +diff --git a/src/syscall.h b/src/syscall.h +index db78e28..61c18c6 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -27,6 +27,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__hppa__) ++#include "syscall-parisc.h" + #elif defined(__mips__) + #include "syscall-mips.h" + #elif defined(__aarch64__) || defined(__riscv) +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0006-Add-m68k-support.patch b/patches/0006-Add-m68k-support.patch new file mode 100644 index 0000000..0b3c7d1 --- /dev/null +++ b/patches/0006-Add-m68k-support.patch @@ -0,0 +1,53 @@ +From 7791885da4e72ecbd9dd5c27be53b876f3630e9a Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:25:22 +0200 +Subject: [PATCH libaio 06/11] Add m68k support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/syscall-m68k.h | 5 +++++ + src/syscall.h | 2 ++ + 3 files changed, 8 insertions(+), 1 deletion(-) + create mode 100644 src/syscall-m68k.h + +diff --git a/harness/main.c b/harness/main.c +index 01c81aa..99d393f 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__s390__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/syscall-m68k.h b/src/syscall-m68k.h +new file mode 100644 +index 0000000..2dd4a9b +--- /dev/null ++++ b/src/syscall-m68k.h +@@ -0,0 +1,5 @@ ++#define __NR_io_setup 241 ++#define __NR_io_destroy 242 ++#define __NR_io_getevents 243 ++#define __NR_io_submit 244 ++#define __NR_io_cancel 245 +diff --git a/src/syscall.h b/src/syscall.h +index 61c18c6..a88876f 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -27,6 +27,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__m68k__) ++#include "syscall-m68k.h" + #elif defined(__hppa__) + #include "syscall-parisc.h" + #elif defined(__mips__) +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0007-Add-SH-support.patch b/patches/0007-Add-SH-support.patch new file mode 100644 index 0000000..45a837d --- /dev/null +++ b/patches/0007-Add-SH-support.patch @@ -0,0 +1,76 @@ +From 29782e82f83ed000edecc56ac77285864ec2672b Mon Sep 17 00:00:00 2001 +From: Nobuhiro Iwamatsu +Date: Sun, 12 Apr 2020 03:30:41 +0200 +Subject: [PATCH libaio 07/11] Add SH support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 3 ++- + src/syscall-sh.h | 6 ++++++ + src/syscall.h | 2 ++ + 4 files changed, 11 insertions(+), 2 deletions(-) + create mode 100644 src/syscall-sh.h + +diff --git a/harness/main.c b/harness/main.c +index 99d393f..ac0fba2 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/libaio.h b/src/libaio.h +index 29005d0..c748454 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,7 +52,7 @@ typedef enum io_iocb_cmd { + + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ +- defined(__sh__) || \ ++ (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ + defined(__bfin__) || \ + (defined(__MIPSEL__) && !defined(__mips64)) || \ + defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \ +@@ -88,6 +88,7 @@ typedef enum io_iocb_cmd { + /* big endian, 32 bits */ + #elif defined(__PPC__) || defined(__s390__) || \ + (defined(__arm__) && defined(__ARMEB__)) || \ ++ (defined(__sh__) && defined (__BIG_ENDIAN__)) || \ + defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \ + defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ +diff --git a/src/syscall-sh.h b/src/syscall-sh.h +new file mode 100644 +index 0000000..6c00573 +--- /dev/null ++++ b/src/syscall-sh.h +@@ -0,0 +1,6 @@ ++/* Copy from ./arch/sh/include/asm/unistd_32.h */ ++#define __NR_io_setup 245 ++#define __NR_io_destroy 246 ++#define __NR_io_getevents 247 ++#define __NR_io_submit 248 ++#define __NR_io_cancel 249 +diff --git a/src/syscall.h b/src/syscall.h +index a88876f..b86d745 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -33,6 +33,8 @@ + #include "syscall-parisc.h" + #elif defined(__mips__) + #include "syscall-mips.h" ++#elif defined(__sh__) ++#include "syscall-sh.h" + #elif defined(__aarch64__) || defined(__riscv) + #include "syscall-generic.h" + #else +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0008-Add-x32-support.patch b/patches/0008-Add-x32-support.patch new file mode 100644 index 0000000..02723df --- /dev/null +++ b/patches/0008-Add-x32-support.patch @@ -0,0 +1,64 @@ +From 15e2be45860c5f7bac4beed0551ec8257e863d7e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:36:39 +0200 +Subject: [PATCH libaio 08/11] Add x32 support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 4 +++- + src/syscall-x86_64.h | 10 ++++++++++ + 3 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/harness/main.c b/harness/main.c +index ac0fba2..db42a18 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/libaio.h b/src/libaio.h +index c748454..9695a53 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -51,7 +51,9 @@ typedef enum io_iocb_cmd { + } io_iocb_cmd_t; + + /* little endian, 32 bits */ +-#if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ ++#if defined(__i386__) || \ ++ (defined(__x86_64__) && defined(__ILP32__)) || \ ++ (defined(__arm__) && !defined(__ARMEB__)) || \ + (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ + defined(__bfin__) || \ + (defined(__MIPSEL__) && !defined(__mips64)) || \ +diff --git a/src/syscall-x86_64.h b/src/syscall-x86_64.h +index 0eccef3..6a44d53 100644 +--- a/src/syscall-x86_64.h ++++ b/src/syscall-x86_64.h +@@ -1,6 +1,16 @@ ++#if __ILP32__ ++#define __X32_SYSCALL_BIT 0x40000000UL ++#define __NR_io_setup (__X32_SYSCALL_BIT + 543) ++#define __NR_io_destroy (__X32_SYSCALL_BIT + 207) ++#define __NR_io_submit (__X32_SYSCALL_BIT + 544) ++#define __NR_io_cancel (__X32_SYSCALL_BIT + 210) ++#define __NR_io_getevents (__X32_SYSCALL_BIT + 208) ++#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333) ++#else + #define __NR_io_setup 206 + #define __NR_io_destroy 207 + #define __NR_io_getevents 208 + #define __NR_io_submit 209 + #define __NR_io_cancel 210 + #define __NR_io_pgetevents 333 ++#endif +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0009-build-Fix-DESTDIR-handling.patch b/patches/0009-build-Fix-DESTDIR-handling.patch new file mode 100644 index 0000000..fed806c --- /dev/null +++ b/patches/0009-build-Fix-DESTDIR-handling.patch @@ -0,0 +1,72 @@ +From d4ec369c6457cca55db5297701ddd5d9d3ff5ae0 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:58:12 +0200 +Subject: [PATCH libaio 09/11] build: Fix DESTDIR handling + +The convention for DESTDIR is that it is only prefixed during the +install target. In this case we postpone that to the inner Makefile +so that it can be invoked directly while preserving the expected +semantics. + +Signed-off-by: Guillem Jover +--- + Makefile | 8 +++++++- + src/Makefile | 11 ++++++----- + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index c1fb831..e48b520 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,6 +4,7 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE)) + TAG = $(NAME)-$(VERSION) + RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") + ++DESTDIR= + prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib +@@ -14,7 +15,12 @@ all: + @$(MAKE) -C src + + install: +- @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir) ++ @$(MAKE) -C src install \ ++ DESTDIR=$(DESTDIR) \ ++ prefix=$(prefix) \ ++ includedir=$(includedir) \ ++ libdir=$(libdir) \ ++ $(nil) + + check: + @$(MAKE) -C harness check +diff --git a/src/Makefile b/src/Makefile +index 37ae219..a53c43c 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,3 +1,4 @@ ++DESTDIR= + prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib +@@ -58,12 +59,12 @@ $(libname): $(libaio_sobjs) libaio.map + $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) + + install: $(all_targets) +- install -D -m 644 libaio.h $(includedir)/libaio.h +- install -D -m 644 libaio.a $(libdir)/libaio.a ++ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h ++ install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a + ifeq ($(ENABLE_SHARED),1) +- install -D -m 755 $(libname) $(libdir)/$(libname) +- ln -sf $(libname) $(libdir)/$(soname) +- ln -sf $(libname) $(libdir)/libaio.so ++ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) ++ ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname) ++ ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so + endif + + $(libaio_objs): libaio.h +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/0010-build-Do-not-use-Werror-by-default.patch b/patches/0010-build-Do-not-use-Werror-by-default.patch new file mode 100644 index 0000000..69dfac6 --- /dev/null +++ b/patches/0010-build-Do-not-use-Werror-by-default.patch @@ -0,0 +1,25 @@ +From 4246fcf2c0c1c6518a5689c8a0ee2662f67c4030 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 04:00:03 +0200 +Subject: [PATCH libaio 10/11] build: Do not use -Werror by default + +Using -Werror on a released project is in general not a good idea, as +changes in the toolchain and environment can trigger unexpected build +failures. + +Signed-off-by: Guillem Jover +--- + harness/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,7 +6,7 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-CFLAGS+=-Wall -Werror -I../src -g -O2 ++CFLAGS+=-Wall -I../src -g -O2 + #-lpthread -lrt + + # gcc-11 does not like the test case in 3.t that diff --git a/patches/0011-build-Honour-user-build-flags.patch b/patches/0011-build-Honour-user-build-flags.patch new file mode 100644 index 0000000..74805dd --- /dev/null +++ b/patches/0011-build-Honour-user-build-flags.patch @@ -0,0 +1,83 @@ +From b8f802cee62430d4951990f578bcd27eba27476e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 04:01:27 +0200 +Subject: [PATCH libaio 11/11] build: Honour user build flags + +CPPFLAGS, CFLAGS and LDFLAGS are user flags, which we need to preserve. +Any required flag that the build system needs, has to be set in some +other flag so that the build will succeed even if the user flags are +passed. + +Signed-off-by: Guillem Jover +--- + harness/Makefile | 7 +++++-- + src/Makefile | 18 +++++++++--------- + 2 files changed, 14 insertions(+), 11 deletions(-) + +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,8 +6,11 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-CFLAGS+=-Wall -I../src -g -O2 ++MK_CPPFLAGS := -I../src $(CPPFLAGS) ++CFLAGS = -Wall -g -O2 + #-lpthread -lrt ++MK_CFLAGS = $(CFLAGS) ++MK_LDFLAGS = main.c $(LIBAIO) -lpthread $(LDFLAGS) + + # gcc-11 does not like the test case in 3.t that + # passes an invalid pointer (-1) to the kernel, so +@@ -21,7 +24,7 @@ LIBAIO?=../src/libaio.a + all: $(PROGS) + + $(PROGS): %.p: %.t $(HARNESS_SRCS) +- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) -lpthread ++ $(CC) $(MK_CPPFLAGS) $(MK_CFLAGS) -DTEST_NAME=\"$<\" -o $@ $(MK_LDFLAGS) + + clean: + rm -f $(PROGS) *.o runtests.out rofile wofile rwfile +--- a/src/Makefile ++++ b/src/Makefile +@@ -3,12 +3,12 @@ prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib + +-CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -Wall -I. -fPIC +-SO_CFLAGS=-shared $(CFLAGS) +-L_CFLAGS=$(CFLAGS) +-LINK_FLAGS= +-LINK_FLAGS+=$(LDFLAGS) ++MK_CPPFLAGS = -I. ++MK_CFLAGS = -fPIC $(CFLAGS) ++CFLAGS = -Wall -g -fomit-frame-pointer -O2 ++SO_CFLAGS = -shared $(MK_CFLAGS) ++L_CFLAGS = $(MK_CFLAGS) ++MK_LDFLAGS = $(LDFLAGS) + ENABLE_SHARED ?= 1 + + soname=libaio.so.1 +@@ -43,10 +43,10 @@ libaio_sobjs := $(patsubst %.c,%.os,$(li + $(libaio_objs) $(libaio_sobjs): libaio.h vsys_def.h + + %.os: %.c +- $(CC) $(SO_CFLAGS) -c -o $@ $< ++ $(CC) $(MK_CPPFLAGS) $(SO_CFLAGS) -c -o $@ $< + + %.ol: %.c +- $(CC) $(L_CFLAGS) -c -o $@ $< ++ $(CC) $(MK_CPPFLAGS) $(L_CFLAGS) -c -o $@ $< + + AR ?= ar + RANLIB ?= ranlib +@@ -56,7 +56,7 @@ libaio.a: $(libaio_objs) + $(RANLIB) libaio.a + + $(libname): $(libaio_sobjs) libaio.map +- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) ++ $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(MK_LDFLAGS) + + install: $(all_targets) + install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..dd0428b --- /dev/null +++ b/patches/series @@ -0,0 +1,48 @@ +# Upstream commits +upstream/0001-Link-against-libgcc-to-avoid-unresolved-symbols.patch +upstream/0001-harness-allow-running-tests-against-the-installed-li.patch +upstream/0002-man-Add-missing-space-in-man-page-references.patch +upstream/0003-man-Use-the-correct-troff-macro-for-comments.patch +upstream/0004-man-Refer-to-libaio.h-instead-of-libio.h.patch +upstream/0005-man-End-sentences-with-a-period.patch +upstream/0006-man-Fix-casing.patch +upstream/0007-man-Fix-period-formatting.patch +upstream/0008-man-Remove-spurious-spaces.patch +upstream/0009-man-Remove-spurious-text.patch +upstream/0010-man-Add-None-to-empty-sections.patch +upstream/0011-man-Fix-typos.patch +upstream/0012-man-Fix-title-header.patch +upstream/0013-man-Fix-markup.patch +upstream/0014-man-Fold-short-lines.patch +upstream/0015-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch +upstream/0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch +upstream/0017-harness-Use-destination-strncpy-expression-for-sizeo.patch +upstream/0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch +upstream/0019-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-unav.patch +upstream/0020-harness-Make-the-test-exit-with-a-code-matching-the-.patch +upstream/0021-harness-add-support-for-skipping-tests.patch +upstream/0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch +upstream/0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch +upstream/0024-harness-skip-22.p-if-async_poll-isn-t-supported.patch +upstream/0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch +upstream/0026-harness-Fix-PROT_WRITE-mmap-check.patch +upstream/0027-harness-Print-better-error-messages-on-error-conditi.patch +upstream/0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch +upstream/0001-Fix-test-issue-with-gcc-11.patch +# Local changes, pending submission +0001-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch +0002-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch +0003-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch +0004-Fix-and-improve-MIPS-support.patch +0005-Add-PARISC-support.patch +0006-Add-m68k-support.patch +0007-Add-SH-support.patch +0008-Add-x32-support.patch +0009-build-Fix-DESTDIR-handling.patch +0010-build-Do-not-use-Werror-by-default.patch +0011-build-Honour-user-build-flags.patch +0001-man-Fix-typos.patch +0001-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch +0002-Use-new-symver-function-attribute-to-support-LTO-bui.patch +# Local changes, not for upstream +0001-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch diff --git a/patches/upstream/0001-Fix-test-issue-with-gcc-11.patch b/patches/upstream/0001-Fix-test-issue-with-gcc-11.patch new file mode 100644 index 0000000..20b1345 --- /dev/null +++ b/patches/upstream/0001-Fix-test-issue-with-gcc-11.patch @@ -0,0 +1,68 @@ +From 696a5e6483baa3a9e4eb83e5db5838d571c90ec9 Mon Sep 17 00:00:00 2001 +From: Lee Duncan +Date: Sun, 14 Feb 2021 14:59:07 -0800 +Subject: [PATCH libaio] Fix test issue with gcc-11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Test 3.t exercises io_submit() with invalid addresses, +and one test attempted to pass in "-1" as an invalid +pointer. But gcc-11 realizes you cannot take an offset +from an invalid pointer, making it impossible to +compile or run this test: + +> sh# make CC=gcc-11 partcheck +> make[1]: Entering directory '/alt/public_software/libaio/src' +> make[1]: Nothing to be done for 'all'. +> make[1]: Leaving directory '/alt/public_software/libaio/src' +> make[1]: Entering directory '/alt/public_software/libaio/harness' +> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread +> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread +> In file included from main.c:24: +> cases/3.t: In function ‘test_main’: +> cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=] +> 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT); +> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +> cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’ +> In file included from cases/3.t:5, +> from main.c:24: +> cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’ +> 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect) +> | ^~~~~~~~~~~~~~~~~ +> cc1: all warnings being treated as errors +> make[1]: *** [Makefile:19: cases/3.p] Error 1 +> make[1]: Leaving directory '/alt/public_software/libaio/harness' +> make: *** [Makefile:23: partcheck] Error 2 + +The fix is to tell gcc to relax it's stringop overflow +testing for this one test. + +Changes since v1: +* First version just skipped the test in question + +Signed-off-by: Lee Duncan +Signed-off-by: Jeff Moyer +--- + harness/Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/harness/Makefile b/harness/Makefile +index 5cc2b25..4f225d3 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -9,6 +9,11 @@ HARNESS_SRCS:=main.c + CFLAGS+=-Wall -Werror -I../src -g -O2 + #-lpthread -lrt + ++# gcc-11 does not like the test case in 3.t that ++# passes an invalid pointer (-1) to the kernel, so ++# tell the compiler we do not need a warning here ++cases/3.p: override CFLAGS+=-Wno-stringop-overflow ++ + # Change this on the build line to run tests against the installed libraries: + # make LIBAIO=-laio partcheck + LIBAIO?=../src/libaio.a +-- +2.33.1 + diff --git a/patches/upstream/0001-Link-against-libgcc-to-avoid-unresolved-symbols.patch b/patches/upstream/0001-Link-against-libgcc-to-avoid-unresolved-symbols.patch new file mode 100644 index 0000000..7f151a1 --- /dev/null +++ b/patches/upstream/0001-Link-against-libgcc-to-avoid-unresolved-symbols.patch @@ -0,0 +1,54 @@ +From 672eaebd131c789a528e3a9cd089b4b69a82012b Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 28 Sep 2018 13:15:54 +0300 +Subject: [PATCH libaio] Link against libgcc to avoid unresolved symbols + +We need to link agaisnt -lgcc, on at least hppa, PPC and ARC. +That's because in some corner-cases like compilation with -Os +on ARC and PPC so-called millicode (basically function prologue and +epilogue) implemented in libgcc.a is used. So we end up with +GLOBAL UNDEFINED symbol in libaio.so and then on linkage of the final +applicaiton LD fails to proceed saying: +--------------------------->8---------------------- +hidden symbol '__ld_r13_to_r15_ret' in .../libgcc.a(_millicodethunk_ret.o) is referenced by DSO +--------------------------->8---------------------- + +Also it looks like in general it is not the best idea to use either +"-nostartfiles" or "-nostdlib" when linking shared libs because +default construtor/destructor functions won't be executed, see +"5.2. Library constructor and destructor functions" in [1] + +So let's stop passing "-nostdlib" and "-nostartfiles" and get required +stuff built-in libaio. + +Initial patch taken from Debian [2]. + +Fixes build failures in Buildroot like blktrace [3], lvm2 [4]. + +[1] http://tldp.org/HOWTO/Program-Library-HOWTO/miscellaneous.html +[2] https://sources.debian.org/patches/libaio/0.3.111-1/01_link_libs.patch/ +[3] http://autobuild.buildroot.net/results/17461209755038a30118d76acb4f43469a22a139/ +[4] http://autobuild.buildroot.net/results/a5dfc87f94b97135e5cc84f6a876114891ed9dd9/ + +Signed-off-by: Guillem Jover +Signed-off-by: Alexey Brodkin +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index eadb336..5911c81 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -3,7 +3,7 @@ includedir=$(prefix)/include + libdir=$(prefix)/lib + + CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC ++CFLAGS += -Wall -I. -fPIC + SO_CFLAGS=-shared $(CFLAGS) + L_CFLAGS=$(CFLAGS) + LINK_FLAGS= +-- +2.23.0.rc1.170.gbd704faa3e + diff --git a/patches/upstream/0001-harness-allow-running-tests-against-the-installed-li.patch b/patches/upstream/0001-harness-allow-running-tests-against-the-installed-li.patch new file mode 100644 index 0000000..8b2f18d --- /dev/null +++ b/patches/upstream/0001-harness-allow-running-tests-against-the-installed-li.patch @@ -0,0 +1,37 @@ +From 6507d3f7a2b1985a33d06f280b9388aa34054889 Mon Sep 17 00:00:00 2001 +From: Jeff Moyer +Date: Mon, 29 Jul 2019 10:07:23 -0400 +Subject: [PATCH libaio 01/28] harness: allow running tests against the + installed library + +A user can now specify "LIBAIO=/path/to/libaio.so" in order to run +the test harness against the installed library. + +Signed-off-by: Jeff Moyer +--- + harness/Makefile | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/harness/Makefile b/harness/Makefile +index f477737..87b33f6 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -9,10 +9,14 @@ HARNESS_SRCS:=main.c + CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE) + #-lpthread -lrt + ++# Change this on the build line to run tests against the installed libraries: ++# make LIBAIO=-laio partcheck ++LIBAIO?=../src/libaio.a ++ + all: $(PROGS) + + $(PROGS): %.p: %.t $(HARNESS_SRCS) +- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a -lpthread ++ $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) -lpthread + + clean: + rm -f $(PROGS) *.o runtests.out rofile wofile rwfile +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0002-man-Add-missing-space-in-man-page-references.patch b/patches/upstream/0002-man-Add-missing-space-in-man-page-references.patch new file mode 100644 index 0000000..ed2a3ad --- /dev/null +++ b/patches/upstream/0002-man-Add-missing-space-in-man-page-references.patch @@ -0,0 +1,468 @@ +From aef192335a7f16384c4b95a2cc2ce9c46fa72e02 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:00 +0200 +Subject: [PATCH libaio 02/28] man: Add missing space in man page references + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 26 +++++++++++++------------- + man/io_cancel.3 | 26 +++++++++++++------------- + man/io_fsync.3 | 24 ++++++++++++------------ + man/io_getevents.3 | 28 ++++++++++++++-------------- + man/io_prep_fsync.3 | 26 +++++++++++++------------- + man/io_prep_pread.3 | 26 +++++++++++++------------- + man/io_prep_pwrite.3 | 26 +++++++++++++------------- + man/io_queue_init.3 | 26 +++++++++++++------------- + man/io_queue_release.3 | 24 ++++++++++++------------ + man/io_queue_run.3 | 26 +++++++++++++------------- + man/io_queue_wait.3 | 26 +++++++++++++------------- + man/io_set_callback.3 | 26 +++++++++++++------------- + man/io_submit.3 | 26 +++++++++++++------------- + 13 files changed, 168 insertions(+), 168 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index d910a68..968b1f9 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -336,16 +336,16 @@ int main(int argc, char *const *argv) + */ + .fi + .SH "SEE ALSO" +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 9a16084..3cf1bc6 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -50,16 +50,16 @@ cancelled. + .B ENOSYS + if not implemented. + .SH "SEE ALSO" +-.BR io(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index 53eb63d..859de1b 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -68,15 +68,15 @@ The iocb contains a file descriptor that does not exist. + .B EINVAL + The file specified in the iocb does not support the given io operation. + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_getevents(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_getevents (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 5062daa..a4f8b57 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -118,17 +118,17 @@ if nr is out of range, if when is out of range. + .B EFAULT + if any of the memory specified to is invalid. + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3), +-.BR pselect(2) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3), ++.BR pselect (2). +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index 4cf935a..1173e2a 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -74,16 +74,16 @@ None + .SH ERRORS + None + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index 5938aec..2c3b314 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -64,16 +64,16 @@ None + .SH ERRORS + None + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index 68b3500..669b8c2 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -62,16 +62,16 @@ None + .SH ERRORS + None + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_queue_init.3 b/man/io_queue_init.3 +index 317f631..7531f51 100644 +--- a/man/io_queue_init.3 ++++ b/man/io_queue_init.3 +@@ -48,16 +48,16 @@ Not implemented + .IR "maxevents > max_aio_reqs" + where max_aio_reqs is a tunable value. + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index 06b9ec0..9df39a0 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -32,17 +32,17 @@ contains an improperly initialized iocb, + .B ENOSYS + Not implemented + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_run(3), ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_run (3), + .BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). + +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 57dd417..45762f5 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -35,16 +35,16 @@ contains an improperly initialized iocb, + .B ENOSYS + Not implemented + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index 2306663..2c7fc2c 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -41,16 +41,16 @@ contains an improperly initialized iocb, + .B ENOSYS + Not implemented + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_set_callback(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_set_callback (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index a8ca789..3c7e43f 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -29,16 +29,16 @@ io_getevents, only with the library helpers + .SH "RETURN VALUES" + .SH ERRORS + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_submit(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_submit (3), ++.BR errno (3). +diff --git a/man/io_submit.3 b/man/io_submit.3 +index b6966ef..7281147 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -120,16 +120,16 @@ The iocb contains a file descriptor that does not exist. + .B EINVAL + The file specified in the iocb does not support the given io operation. + .SH "SEE ALSO" +-.BR io(3), +-.BR io_cancel(3), +-.BR io_fsync(3), +-.BR io_getevents(3), +-.BR io_prep_fsync(3), +-.BR io_prep_pread(3), +-.BR io_prep_pwrite(3), +-.BR io_queue_init(3), +-.BR io_queue_release(3), +-.BR io_queue_run(3), +-.BR io_queue_wait(3), +-.BR io_set_callback(3), +-.BR errno(3) ++.BR io (3), ++.BR io_cancel (3), ++.BR io_fsync (3), ++.BR io_getevents (3), ++.BR io_prep_fsync (3), ++.BR io_prep_pread (3), ++.BR io_prep_pwrite (3), ++.BR io_queue_init (3), ++.BR io_queue_release (3), ++.BR io_queue_run (3), ++.BR io_queue_wait (3), ++.BR io_set_callback (3), ++.BR errno (3). +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0003-man-Use-the-correct-troff-macro-for-comments.patch b/patches/upstream/0003-man-Use-the-correct-troff-macro-for-comments.patch new file mode 100644 index 0000000..9199001 --- /dev/null +++ b/patches/upstream/0003-man-Use-the-correct-troff-macro-for-comments.patch @@ -0,0 +1,204 @@ +From 0cd5b9ea20e8bc315d43ba1e38ed113804e3c759 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:01 +0200 +Subject: [PATCH libaio 03/28] man: Use the correct troff macro for comments + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_fsync.3 | 12 ++++++------ + man/io_getevents.3 | 36 ++++++++++++++++++------------------ + man/io_prep_fsync.3 | 14 +++++++------- + man/io_prep_pread.3 | 20 ++++++++++---------- + man/io_prep_pwrite.3 | 20 ++++++++++---------- + man/io_set_callback.3 | 2 +- + man/io_submit.3 | 24 ++++++++++++------------ + 7 files changed, 64 insertions(+), 64 deletions(-) + +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index 859de1b..77a62ff 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -1,9 +1,9 @@ +-./" static inline int io_fsync(io_context_t ctx, struct iocb *iocb, io_callback_t cb, int fd) +-./" { +-./" io_prep_fsync(iocb, fd); +-./" io_set_callback(iocb, cb); +-./" return io_submit(ctx, 1, &iocb); +-./" } ++.\" static inline int io_fsync(io_context_t ctx, struct iocb *iocb, io_callback_t cb, int fd) ++.\" { ++.\" io_prep_fsync(iocb, fd); ++.\" io_set_callback(iocb, cb); ++.\" return io_submit(ctx, 1, &iocb); ++.\" } + .TH io_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_fsync \- Synchronize a file's complete in-core state with that on disk +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index a4f8b57..1e643ac 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -1,21 +1,21 @@ +-./"/* io_getevents: +-./" * Attempts to read at least min_nr events and up to nr events from +-./" * the completion queue for the aio_context specified by ctx_id. May +-./" * fail with -EINVAL if ctx_id is invalid, if min_nr is out of range, +-./" * if nr is out of range, if when is out of range. May fail with +-./" * -EFAULT if any of the memory specified to is invalid. May return +-./" * 0 or < min_nr if no events are available and the timeout specified +-./" * by when has elapsed, where when == NULL specifies an infinite +-./" * timeout. Note that the timeout pointed to by when is relative and +-./" * will be updated if not NULL and the operation blocks. Will fail +-./" * with -ENOSYS if not implemented. +-./" */ +-./"asmlinkage long sys_io_getevents(io_context_t ctx_id, +-./" long min_nr, +-./" long nr, +-./" struct io_event *events, +-./" struct timespec *timeout) +-./" ++.\"/* io_getevents: ++.\" * Attempts to read at least min_nr events and up to nr events from ++.\" * the completion queue for the aio_context specified by ctx_id. May ++.\" * fail with -EINVAL if ctx_id is invalid, if min_nr is out of range, ++.\" * if nr is out of range, if when is out of range. May fail with ++.\" * -EFAULT if any of the memory specified to is invalid. May return ++.\" * 0 or < min_nr if no events are available and the timeout specified ++.\" * by when has elapsed, where when == NULL specifies an infinite ++.\" * timeout. Note that the timeout pointed to by when is relative and ++.\" * will be updated if not NULL and the operation blocks. Will fail ++.\" * with -ENOSYS if not implemented. ++.\" */ ++.\"asmlinkage long sys_io_getevents(io_context_t ctx_id, ++.\" long min_nr, ++.\" long nr, ++.\" struct io_event *events, ++.\" struct timespec *timeout) ++.\" + .TH io_getevents 2 2002-09-03 "Linux 2.4" "Linux AIO" + .SH NAME + io_getevents, aio_pgetevents \- Read resulting events from io requests +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index 1173e2a..2daddee 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -1,10 +1,10 @@ +-./" static inline void io_prep_fsync(struct iocb *iocb, int fd) +-./" { +-./" memset(iocb, 0, sizeof(*iocb)); +-./" iocb->aio_fildes = fd; +-./" iocb->aio_lio_opcode = IO_CMD_FSYNC; +-./" iocb->aio_reqprio = 0; +-./" } ++.\" static inline void io_prep_fsync(struct iocb *iocb, int fd) ++.\" { ++.\" memset(iocb, 0, sizeof(*iocb)); ++.\" iocb->aio_fildes = fd; ++.\" iocb->aio_lio_opcode = IO_CMD_FSYNC; ++.\" iocb->aio_reqprio = 0; ++.\" } + .TH io_prep_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_fsync \- Synchronize a file's complete in-core state with that on disk +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index 2c3b314..1ab28f5 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -1,13 +1,13 @@ +-./" static inline void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) +-./" { +-./" memset(iocb, 0, sizeof(*iocb)); +-./" iocb->aio_fildes = fd; +-./" iocb->aio_lio_opcode = IO_CMD_PREAD; +-./" iocb->aio_reqprio = 0; +-./" iocb->u.c.buf = buf; +-./" iocb->u.c.nbytes = count; +-./" iocb->u.c.offset = offset; +-./" } ++.\" static inline void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) ++.\" { ++.\" memset(iocb, 0, sizeof(*iocb)); ++.\" iocb->aio_fildes = fd; ++.\" iocb->aio_lio_opcode = IO_CMD_PREAD; ++.\" iocb->aio_reqprio = 0; ++.\" iocb->u.c.buf = buf; ++.\" iocb->u.c.nbytes = count; ++.\" iocb->u.c.offset = offset; ++.\" } + .TH io_prep_pread 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_pread \- Set up asynchronous read +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index 669b8c2..f8d7fac 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -1,13 +1,13 @@ +-./" static inline void io_prep_pwrite(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) +-./" { +-./" memset(iocb, 0, sizeof(*iocb)); +-./" iocb->aio_fildes = fd; +-./" iocb->aio_lio_opcode = IO_CMD_PWRITE; +-./" iocb->aio_reqprio = 0; +-./" iocb->u.c.buf = buf; +-./" iocb->u.c.nbytes = count; +-./" iocb->u.c.offset = offset; +-./" } ++.\" static inline void io_prep_pwrite(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) ++.\" { ++.\" memset(iocb, 0, sizeof(*iocb)); ++.\" iocb->aio_fildes = fd; ++.\" iocb->aio_lio_opcode = IO_CMD_PWRITE; ++.\" iocb->aio_reqprio = 0; ++.\" iocb->u.c.buf = buf; ++.\" iocb->u.c.nbytes = count; ++.\" iocb->u.c.offset = offset; ++.\" } + .TH io_prep_pwrite 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_pwrite \- Set up iocb for asynchronous writes +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index 3c7e43f..cc842f7 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -1,4 +1,4 @@ +-./"static inline void io_set_callback(struct iocb *iocb, io_callback_t cb) ++.\"static inline void io_set_callback(struct iocb *iocb, io_callback_t cb) + .TH io_set_callback 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_set_callback \- Set up io completion callback function +diff --git a/man/io_submit.3 b/man/io_submit.3 +index 7281147..a810b3f 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -1,15 +1,15 @@ +-./"/* sys_io_submit: +-./" * Queue the nr iocbs pointed to by iocbpp for processing. Returns +-./" * the number of iocbs queued. May return -EINVAL if the aio_context +-./" * specified by ctx_id is invalid, if nr is < 0, if the iocb at +-./" * *iocbpp[0] is not properly initialized, if the operation specified +-./" * is invalid for the file descriptor in the iocb. May fail with +-./" * -EFAULT if any of the data structures point to invalid data. May +-./" * fail with -EBADF if the file descriptor specified in the first +-./" * iocb is invalid. May fail with -EAGAIN if insufficient resources +-./" * are available to queue any iocbs. Will return 0 if nr is 0. Will +-./" * fail with -ENOSYS if not implemented. +-./" */ ++.\"/* sys_io_submit: ++.\" * Queue the nr iocbs pointed to by iocbpp for processing. Returns ++.\" * the number of iocbs queued. May return -EINVAL if the aio_context ++.\" * specified by ctx_id is invalid, if nr is < 0, if the iocb at ++.\" * *iocbpp[0] is not properly initialized, if the operation specified ++.\" * is invalid for the file descriptor in the iocb. May fail with ++.\" * -EFAULT if any of the data structures point to invalid data. May ++.\" * fail with -EBADF if the file descriptor specified in the first ++.\" * iocb is invalid. May fail with -EAGAIN if insufficient resources ++.\" * are available to queue any iocbs. Will return 0 if nr is 0. Will ++.\" * fail with -ENOSYS if not implemented. ++.\" */ + .TH io_submit 2 2002-09-02 "Linux 2.4" "Linux AIO" + .SH NAME + io_submit \- Submit io requests +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0004-man-Refer-to-libaio.h-instead-of-libio.h.patch b/patches/upstream/0004-man-Refer-to-libaio.h-instead-of-libio.h.patch new file mode 100644 index 0000000..d8d691c --- /dev/null +++ b/patches/upstream/0004-man-Refer-to-libaio.h-instead-of-libio.h.patch @@ -0,0 +1,36 @@ +From e9dce27ad722dc2f17f913e56432107bc3c1229f Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:02 +0200 +Subject: [PATCH libaio 04/28] man: Refer to libaio.h instead of libio.h + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index 968b1f9..e4fe108 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -6,7 +6,7 @@ io \- Asynchronous IO + .B #include + .sp + .br +-.B #include ++.B #include + .sp + .fi + .SH DESCRIPTION +@@ -29,7 +29,7 @@ might be arbitrarily many operations running for one file. The + asynchronous I/O operations are controlled using a data structure named + .IR "struct iocb" + It is defined in +-.IR "libio.h" ++.IR "libaio.h" + as follows. + + .nf +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0005-man-End-sentences-with-a-period.patch b/patches/upstream/0005-man-End-sentences-with-a-period.patch new file mode 100644 index 0000000..6f9f777 --- /dev/null +++ b/patches/upstream/0005-man-End-sentences-with-a-period.patch @@ -0,0 +1,134 @@ +From d868db4f2c993ebb2895ca77c32b5a5d000355d7 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:03 +0200 +Subject: [PATCH libaio 05/28] man: End sentences with a period + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_prep_fsync.3 | 4 ++-- + man/io_prep_pread.3 | 4 ++-- + man/io_prep_pwrite.3 | 4 ++-- + man/io_queue_init.3 | 2 +- + man/io_queue_release.3 | 2 +- + man/io_queue_run.3 | 2 +- + man/io_queue_wait.3 | 2 +- + man/io_set_callback.3 | 2 +- + 8 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index 2daddee..3a5f952 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -70,9 +70,9 @@ must be called. + Simultaneous asynchronous operations using the same iocb produce + undefined results. + .SH "RETURN VALUES" +-None ++None. + .SH ERRORS +-None ++None. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index 1ab28f5..a4df182 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -60,9 +60,9 @@ must be called. + Simultaneous asynchronous operations using the same iocb produce + undefined results. + .SH "RETURN VALUES" +-None ++None. + .SH ERRORS +-None ++None. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index f8d7fac..73c62c7 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -58,9 +58,9 @@ must be called. + Simultaneous asynchronous operations using the same iocb produce + undefined results. + .SH "RETURN VALUES" +-None ++None. + .SH ERRORS +-None ++None. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_queue_init.3 b/man/io_queue_init.3 +index 7531f51..666dfae 100644 +--- a/man/io_queue_init.3 ++++ b/man/io_queue_init.3 +@@ -42,7 +42,7 @@ is <= 0 or + is an invalid memory locattion. + .TP + .B ENOSYS +-Not implemented ++Not implemented. + .TP + .B EAGAIN + .IR "maxevents > max_aio_reqs" +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index 9df39a0..f927562 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -30,7 +30,7 @@ refers to an unitialized aio context, the iocb pointed to by + contains an improperly initialized iocb, + .TP + .B ENOSYS +-Not implemented ++Not implemented. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 45762f5..35f385b 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -33,7 +33,7 @@ refers to an unitialized aio context, the iocb pointed to by + contains an improperly initialized iocb, + .TP + .B ENOSYS +-Not implemented ++Not implemented. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index 2c7fc2c..eb6db83 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -39,7 +39,7 @@ refers to an unitialized aio context, the iocb pointed to by + contains an improperly initialized iocb, + .TP + .B ENOSYS +-Not implemented ++Not implemented. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index cc842f7..71efd2f 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -25,7 +25,7 @@ typedef void (*io_callback_t)(io_context_t ctx, struct iocb *iocb, long res, lon + .fi + .SH DESCRIPTION + The callback is not done if the caller uses raw events from +-io_getevents, only with the library helpers ++io_getevents, only with the library helpers. + .SH "RETURN VALUES" + .SH ERRORS + .SH "SEE ALSO" +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0006-man-Fix-casing.patch b/patches/upstream/0006-man-Fix-casing.patch new file mode 100644 index 0000000..dfd9c05 --- /dev/null +++ b/patches/upstream/0006-man-Fix-casing.patch @@ -0,0 +1,55 @@ +From 19a7217fe0a4dafd5f171b99bc27b7d8a29df9a0 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:04 +0200 +Subject: [PATCH libaio 06/28] man: Fix casing + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_cancel.3 | 4 ++-- + man/io_getevents.3 | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 3cf1bc6..9ac1b40 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -33,7 +33,7 @@ have to be overwritten soon. As an example, assume an application, which + writes data in files in a situation where new incoming data would have + to be written in a file which will be updated by an enqueued request. + .SH "RETURN VALUES" +-0 is returned on success , otherwise returns Errno. ++0 is returned on success , otherwise returns errno. + .SH ERRORS + .TP + .B EFAULT +@@ -48,7 +48,7 @@ If the iocb specified was not + cancelled. + .TP + .B ENOSYS +-if not implemented. ++If not implemented. + .SH "SEE ALSO" + .BR io (3), + .BR io_fsync (3), +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 1e643ac..c8f2676 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -112,11 +112,11 @@ behaves the same as + .SH ERRORS + .TP + .B EINVAL +-if ctx_id is invalid, if min_nr is out of range, ++If ctx_id is invalid, if min_nr is out of range, + if nr is out of range, if when is out of range. + .TP + .B EFAULT +-if any of the memory specified to is invalid. ++If any of the memory specified to is invalid. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0007-man-Fix-period-formatting.patch b/patches/upstream/0007-man-Fix-period-formatting.patch new file mode 100644 index 0000000..ac3d4fb --- /dev/null +++ b/patches/upstream/0007-man-Fix-period-formatting.patch @@ -0,0 +1,212 @@ +From 0319efeeea3dbd4b53b81934b4f24bba96d77959 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:05 +0200 +Subject: [PATCH libaio 07/28] man: Fix period formatting + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 13 +++++-------- + man/io_fsync.3 | 2 +- + man/io_getevents.3 | 3 +-- + man/io_prep_fsync.3 | 2 +- + man/io_prep_pread.3 | 5 ++--- + man/io_prep_pwrite.3 | 5 ++--- + man/io_queue_release.3 | 2 +- + man/io_queue_run.3 | 2 +- + man/io_queue_wait.3 | 2 +- + man/io_submit.3 | 8 ++++---- + 10 files changed, 19 insertions(+), 25 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index e4fe108..7b8ab5e 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -17,8 +17,8 @@ then immediately resume normal work while the I/O operations are + executed in parallel. + + These functions are part of the library with realtime functions named +-.IR "libaio" +-. They are not actually part of the ++.IR libaio . ++They are not actually part of the + .IR "libc" + binary. + The implementation of these functions can be done using support in the +@@ -98,8 +98,7 @@ where the read data is stored. + .TP + .IR "long u.c.nbytes" + This element specifies the length of the buffer pointed to by +-.IR "io_buf" +-. ++.IR io_buf . + .TP + .IR "int aio_reqprio" + Is not currently used. +@@ -111,8 +110,7 @@ and store the next + .IR "u.c.nbytes" + bytes in the + buffer pointed to by +-.IR "buf" +-. ++.IR buf . + .TP + .B "IO_CMD_PWRITE" + Start a write operation. Write +@@ -120,8 +118,7 @@ Start a write operation. Write + bytes starting at + .IR "buf" + into the file starting at position +-.IR "u.c.offset" +-. ++.IR u.c.offset . + .TP + .B "IO_CMD_NOP" + Do nothing for this control block. This value is useful sometimes when +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index 77a62ff..03c81bc 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -39,7 +39,7 @@ resources (mainly computation time). + Calling this function forces all I/O operations operating queued at the + time of the function call operating on the file descriptor + .IR "iocb->io_fildes" +-into the synchronized I/O completion state . The ++into the synchronized I/O completion state. The + .IR "io_fsync" + function returns + immediately but the notification through the method described in +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index c8f2676..24c07c3 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -107,8 +107,7 @@ argument is specified as NULL, then no signal mask manipulation is + performed (and thus + .BR io_pgetevents () + behaves the same as +-.BR io_getevents() +-) . ++.BR io_getevents() ). + .SH ERRORS + .TP + .B EINVAL +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index 3a5f952..cf4ecff 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -62,7 +62,7 @@ forced to the relevant completion state. The completion of + subsequent I/O on the file descriptor is not guaranteed to be + completed in a synchronized fashion. + .PP +-This function returns immediately . To schedule the operation, the ++This function returns immediately. To schedule the operation, the + function + .IR io_submit + must be called. +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index a4df182..6d66c0f 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -44,15 +44,14 @@ bytes of the file for which + is a descriptor are written to the buffer + starting at + .TP +-.IR "iocb->u.c.buf = buf" +-. ++.IR "iocb->u.c.buf = buf" . + .br + Reading starts at the absolute position + .TP + .IR "ioc->u.c.offset = offset" + in the file. + .PP +-This function returns immediately . To schedule the operation, the ++This function returns immediately. To schedule the operation, the + function + .IR io_submit + must be called. +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index 73c62c7..98b3a65 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -42,15 +42,14 @@ bytes of the file for which + is a descriptor are written from the buffer + starting at + .TP +-.IR "iocb->u.c.buf = buf" +-. ++.IR "iocb->u.c.buf = buf" . + .br + Writing starts at the absolute position + .TP + .IR "ioc->u.c.offset = offset" + in the file. + .PP +-This function returns immediately . To schedule the operation, the ++This function returns immediately. To schedule the operation, the + function + .IR io_submit + must be called. +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index f927562..db91bad 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -12,7 +12,7 @@ io_queue_release \- Release the context associated with the userspace handle + .sp + .SH DESCRIPTION + .B io_queue_release +-destroys the context associated with the userspace handle. May cancel any outstanding ++destroys the context associated with the userspace handle. May cancel any outstanding + AIOs and block on completion. + + .B cts. +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 35f385b..018257f 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -30,7 +30,7 @@ referenced data outside of the program's accessible address space. + .I ctx + refers to an unitialized aio context, the iocb pointed to by + .I iocbs +-contains an improperly initialized iocb, ++contains an improperly initialized iocb. + .TP + .B ENOSYS + Not implemented. +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index eb6db83..e3598d9 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -36,7 +36,7 @@ referenced data outside of the program's accessible address space. + .I ctx + refers to an unitialized aio context, the iocb pointed to by + .I iocbs +-contains an improperly initialized iocb, ++contains an improperly initialized iocb. + .TP + .B ENOSYS + Not implemented. +diff --git a/man/io_submit.3 b/man/io_submit.3 +index a810b3f..76e68d1 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -49,12 +49,12 @@ gets the + .IR "nr" + requests from the array pointed to + by +-.IR "iocbs" +-. The operation to be performed is determined by the ++.IR "iocbs" . ++The operation to be performed is determined by the + .IR "aio_lio_opcode" + member in each element of +-.IR "iocbs" +-. If this ++.IR "iocbs" . ++If this + field is + .B "IO_CMD_PREAD" + a read operation is enqueued, similar to a call +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0008-man-Remove-spurious-spaces.patch b/patches/upstream/0008-man-Remove-spurious-spaces.patch new file mode 100644 index 0000000..809e7c7 --- /dev/null +++ b/patches/upstream/0008-man-Remove-spurious-spaces.patch @@ -0,0 +1,55 @@ +From 767c68f7ea77f46fe9a227c2dc64a48f8eaa06f5 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:06 +0200 +Subject: [PATCH libaio 08/28] man: Remove spurious spaces + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_cancel.3 | 2 +- + man/io_queue_run.3 | 2 +- + man/io_queue_wait.3 | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 9ac1b40..261a407 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -33,7 +33,7 @@ have to be overwritten soon. As an example, assume an application, which + writes data in files in a situation where new incoming data would have + to be written in a file which will be updated by an enqueued request. + .SH "RETURN VALUES" +-0 is returned on success , otherwise returns errno. ++0 is returned on success, otherwise returns errno. + .SH ERRORS + .TP + .B EFAULT +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 018257f..b05851c 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -14,7 +14,7 @@ io_queue_run \- Handle completed io requests + .fi + .SH DESCRIPTION + .B io_queue_run +-Attempts to read all the events events from ++Attempts to read all the events events from + the completion queue for the aio_context specified by ctx_id. + .SH "RETURN VALUES" + May return +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index e3598d9..fff8141 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -12,7 +12,7 @@ io_queue_wait \- Wait for io requests to complete + .BI "int io_queue_wait(io_context_t ctx, const struct timespec *timeout);" + .fi + .SH DESCRIPTION +-Attempts to read an event from ++Attempts to read an event from + the completion queue for the aio_context specified by ctx_id. + .SH "RETURN VALUES" + May return +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0009-man-Remove-spurious-text.patch b/patches/upstream/0009-man-Remove-spurious-text.patch new file mode 100644 index 0000000..2b01beb --- /dev/null +++ b/patches/upstream/0009-man-Remove-spurious-text.patch @@ -0,0 +1,55 @@ +From 5f0e08fda606b960eb1652f5e6743dc031e595f1 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:07 +0200 +Subject: [PATCH libaio 09/28] man: Remove spurious text + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_getevents.3 | 1 - + man/io_prep_pread.3 | 2 +- + man/io_queue_release.3 | 3 +-- + 3 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 24c07c3..37e9f7a 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -73,7 +73,6 @@ events happens or until a signal is caught. + The following + .BR io_pgetevents () + call: +-call: + .PP + .in +4n + .EX +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index 6d66c0f..b32fe4c 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -20,7 +20,7 @@ io_prep_pread \- Set up asynchronous read + .br + .sp + .BI "inline void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) +-" ++. + .sp + struct iocb { + void *data; +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index db91bad..6444aff 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -14,8 +14,7 @@ io_queue_release \- Release the context associated with the userspace handle + .B io_queue_release + destroys the context associated with the userspace handle. May cancel any outstanding + AIOs and block on completion. +- +-.B cts. ++. + .SH "RETURN VALUES" + On success, + .B io_queue_release +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0010-man-Add-None-to-empty-sections.patch b/patches/upstream/0010-man-Add-None-to-empty-sections.patch new file mode 100644 index 0000000..32330e8 --- /dev/null +++ b/patches/upstream/0010-man-Add-None-to-empty-sections.patch @@ -0,0 +1,28 @@ +From 69874fec6fef24564302b2efa9af53af07851058 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:08 +0200 +Subject: [PATCH libaio 10/28] man: Add "None" to empty sections + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_set_callback.3 | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index 71efd2f..4ee4b05 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -27,7 +27,9 @@ typedef void (*io_callback_t)(io_context_t ctx, struct iocb *iocb, long res, lon + The callback is not done if the caller uses raw events from + io_getevents, only with the library helpers. + .SH "RETURN VALUES" ++None. + .SH ERRORS ++None. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0011-man-Fix-typos.patch b/patches/upstream/0011-man-Fix-typos.patch new file mode 100644 index 0000000..512b51a --- /dev/null +++ b/patches/upstream/0011-man-Fix-typos.patch @@ -0,0 +1,213 @@ +From 716fe28caeefd07235413c309d316e9a92587e0c Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:09 +0200 +Subject: [PATCH libaio 11/28] man: Fix typos + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 2 +- + man/io_fsync.3 | 4 ++-- + man/io_getevents.3 | 4 ++-- + man/io_prep_fsync.3 | 2 +- + man/io_prep_pread.3 | 2 +- + man/io_prep_pwrite.3 | 4 ++-- + man/io_queue_init.3 | 2 +- + man/io_queue_release.3 | 2 +- + man/io_queue_run.3 | 4 ++-- + man/io_queue_wait.3 | 2 +- + man/io_set_callback.3 | 2 +- + man/io_submit.3 | 2 +- + 12 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index 7b8ab5e..bc529ea 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -1,7 +1,7 @@ + .TH io 3 2002-09-12 "Linux 2.4" Linux IO" + .SH NAME + io \- Asynchronous IO +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .sp +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index 03c81bc..5400d41 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -7,7 +7,7 @@ + .TH io_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_fsync \- Synchronize a file's complete in-core state with that on disk +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .sp +@@ -58,7 +58,7 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an unitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the iocb pointed to by + .I iocbs + contains an improperly initialized iocb, + .TP +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 37e9f7a..95fa86e 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -64,11 +64,11 @@ is analogous to the relationship between + .BR select (2) + and + .BR pselect (2): +-similar ++similar to + .BR pselect (2), + .BR pgetevents () + allows an application to safely wait until either an aio completion +-events happens or until a signal is caught. ++event happens or until a signal is caught. + .PP + The following + .BR io_pgetevents () +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index cf4ecff..0397172 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -8,7 +8,7 @@ + .TH io_prep_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_fsync \- Synchronize a file's complete in-core state with that on disk +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .br +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index b32fe4c..3c28f61 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -11,7 +11,7 @@ + .TH io_prep_pread 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_pread \- Set up asynchronous read +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .sp +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index 98b3a65..69479c2 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -11,7 +11,7 @@ + .TH io_prep_pwrite 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_prep_pwrite \- Set up iocb for asynchronous writes +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .br +@@ -31,7 +31,7 @@ struct iocb { + }; + .fi + .SH DESCRIPTION +-io_prep_write is a convenicence function for setting up parallel writes. ++io_prep_write is a convenience function for setting up parallel writes. + + The first + .TP +diff --git a/man/io_queue_init.3 b/man/io_queue_init.3 +index 666dfae..9c04b3f 100644 +--- a/man/io_queue_init.3 ++++ b/man/io_queue_init.3 +@@ -39,7 +39,7 @@ referenced data outside of the program's accessible address space. + .I maxevents + is <= 0 or + .IR ctx +-is an invalid memory locattion. ++is an invalid memory location. + .TP + .B ENOSYS + Not implemented. +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index 6444aff..5c9ded1 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -24,7 +24,7 @@ error is one of the Exxx values defined in the Errors section. + .TP + .B EINVAL + .I ctx +-refers to an unitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the iocb pointed to by + .I iocbs + contains an improperly initialized iocb, + .TP +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index b05851c..8e0691c 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -14,7 +14,7 @@ io_queue_run \- Handle completed io requests + .fi + .SH DESCRIPTION + .B io_queue_run +-Attempts to read all the events events from ++Attempts to read all the events from + the completion queue for the aio_context specified by ctx_id. + .SH "RETURN VALUES" + May return +@@ -28,7 +28,7 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an unitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the iocb pointed to by + .I iocbs + contains an improperly initialized iocb. + .TP +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index fff8141..0cf0497 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -34,7 +34,7 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an unitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the iocb pointed to by + .I iocbs + contains an improperly initialized iocb. + .TP +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index 4ee4b05..3599e8c 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -2,7 +2,7 @@ + .TH io_set_callback 3 2002-09-12 "Linux 2.4" Linux AIO" + .SH NAME + io_set_callback \- Set up io completion callback function +-.SH SYNOPSYS ++.SH SYNOPSIS + .nf + .B #include + .br +diff --git a/man/io_submit.3 b/man/io_submit.3 +index 76e68d1..3ae8721 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -110,7 +110,7 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an unitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the iocb pointed to by + .I iocbs + contains an improperly initialized iocb, + .TP +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0012-man-Fix-title-header.patch b/patches/upstream/0012-man-Fix-title-header.patch new file mode 100644 index 0000000..a37e6ab --- /dev/null +++ b/patches/upstream/0012-man-Fix-title-header.patch @@ -0,0 +1,180 @@ +From ed25b0e63b2bedecc9c181a620422627f27064ef Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 23 Jul 2019 01:28:10 +0200 +Subject: [PATCH libaio 12/28] man: Fix title header + +- Update year. +- Balance double quotes. +- Remove version from source argument as recommended in man-pages(7). +- Fix all sections numbers to 3. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 2 +- + man/io_cancel.3 | 2 +- + man/io_fsync.3 | 2 +- + man/io_getevents.3 | 2 +- + man/io_prep_fsync.3 | 2 +- + man/io_prep_pread.3 | 2 +- + man/io_prep_pwrite.3 | 2 +- + man/io_queue_init.3 | 2 +- + man/io_queue_release.3 | 2 +- + man/io_queue_run.3 | 2 +- + man/io_queue_wait.3 | 2 +- + man/io_set_callback.3 | 2 +- + man/io_submit.3 | 2 +- + 13 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index bc529ea..922fbca 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -1,4 +1,4 @@ +-.TH io 3 2002-09-12 "Linux 2.4" Linux IO" ++.TH io 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io \- Asynchronous IO + .SH SYNOPSIS +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 261a407..a4683be 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -1,4 +1,4 @@ +-.TH io_cancel 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_cancel 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_cancel \- Cancel io requests + .SH SYNOPSIS +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index 5400d41..bc6778a 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -4,7 +4,7 @@ + .\" io_set_callback(iocb, cb); + .\" return io_submit(ctx, 1, &iocb); + .\" } +-.TH io_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" ++.TH io_fsync 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_fsync \- Synchronize a file's complete in-core state with that on disk + .SH SYNOPSIS +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 95fa86e..05b2507 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -16,7 +16,7 @@ + .\" struct io_event *events, + .\" struct timespec *timeout) + .\" +-.TH io_getevents 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_getevents 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_getevents, aio_pgetevents \- Read resulting events from io requests + .SH SYNOPSIS +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index 0397172..bc0c43b 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -5,7 +5,7 @@ + .\" iocb->aio_lio_opcode = IO_CMD_FSYNC; + .\" iocb->aio_reqprio = 0; + .\" } +-.TH io_prep_fsync 3 2002-09-12 "Linux 2.4" Linux AIO" ++.TH io_prep_fsync 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_prep_fsync \- Synchronize a file's complete in-core state with that on disk + .SH SYNOPSIS +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index 3c28f61..e981e41 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -8,7 +8,7 @@ + .\" iocb->u.c.nbytes = count; + .\" iocb->u.c.offset = offset; + .\" } +-.TH io_prep_pread 3 2002-09-12 "Linux 2.4" Linux AIO" ++.TH io_prep_pread 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_prep_pread \- Set up asynchronous read + .SH SYNOPSIS +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index 69479c2..f2837b6 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -8,7 +8,7 @@ + .\" iocb->u.c.nbytes = count; + .\" iocb->u.c.offset = offset; + .\" } +-.TH io_prep_pwrite 3 2002-09-12 "Linux 2.4" Linux AIO" ++.TH io_prep_pwrite 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_prep_pwrite \- Set up iocb for asynchronous writes + .SH SYNOPSIS +diff --git a/man/io_queue_init.3 b/man/io_queue_init.3 +index 9c04b3f..d8753a7 100644 +--- a/man/io_queue_init.3 ++++ b/man/io_queue_init.3 +@@ -1,4 +1,4 @@ +-.TH io_queue_init 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_queue_init 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_queue_init \- Initialize asynchronous io state machine + +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index 5c9ded1..392a478 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -1,4 +1,4 @@ +-.TH io_queue_release 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_queue_release 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_queue_release \- Release the context associated with the userspace handle + .SH SYNOPSIS +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 8e0691c..dc54acd 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -1,4 +1,4 @@ +-.TH io_queue_run 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_queue_run 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_queue_run \- Handle completed io requests + .SH SYNOPSIS +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index 0cf0497..356c3b2 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -1,4 +1,4 @@ +-.TH io_queue_wait 2 2002-09-03 "Linux 2.4" "Linux AIO" ++.TH io_queue_wait 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_queue_wait \- Wait for io requests to complete + .SH SYNOPSIS +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index 3599e8c..25b9a7f 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -1,5 +1,5 @@ + .\"static inline void io_set_callback(struct iocb *iocb, io_callback_t cb) +-.TH io_set_callback 3 2002-09-12 "Linux 2.4" Linux AIO" ++.TH io_set_callback 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_set_callback \- Set up io completion callback function + .SH SYNOPSIS +diff --git a/man/io_submit.3 b/man/io_submit.3 +index 3ae8721..01c25cd 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -10,7 +10,7 @@ + .\" * are available to queue any iocbs. Will return 0 if nr is 0. Will + .\" * fail with -ENOSYS if not implemented. + .\" */ +-.TH io_submit 2 2002-09-02 "Linux 2.4" "Linux AIO" ++.TH io_submit 3 2019-07-23 "Linux" "Linux AIO" + .SH NAME + io_submit \- Submit io requests + .SH SYNOPSIS +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0013-man-Fix-markup.patch b/patches/upstream/0013-man-Fix-markup.patch new file mode 100644 index 0000000..4e8b853 --- /dev/null +++ b/patches/upstream/0013-man-Fix-markup.patch @@ -0,0 +1,799 @@ +From a311701ea7eebff003e88694a391d810485f36e0 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:11 +0200 +Subject: [PATCH libaio 13/28] man: Fix markup + +- Remove unnecessary macro argument quoting. +- Variables, pathnames in italics. +- Keywords in bold. +- Man page references in bold, followed by the man page number. +- Fix TP/TQ macro usage. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 38 ++++++++++++++------------- + man/io_cancel.3 | 23 ++++++++++------ + man/io_fsync.3 | 9 ++++--- + man/io_getevents.3 | 33 ++++++++++++++++------- + man/io_prep_fsync.3 | 59 ++++++++++++++++++++++++++++++------------ + man/io_prep_pread.3 | 19 +++++--------- + man/io_prep_pwrite.3 | 14 ++++------ + man/io_queue_init.3 | 34 +++++++++++++++--------- + man/io_queue_release.3 | 16 +++++++----- + man/io_queue_run.3 | 18 ++++++++----- + man/io_queue_wait.3 | 25 +++++++++++------- + man/io_set_callback.3 | 5 ++-- + man/io_submit.3 | 26 +++++++++++-------- + 13 files changed, 195 insertions(+), 124 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index 922fbca..f40da41 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -10,16 +10,18 @@ io \- Asynchronous IO + .sp + .fi + .SH DESCRIPTION +-The libaio library defines a new set of I/O operations which can ++The ++.B libaio ++library defines a new set of I/O operations which can + significantly reduce the time an application spends waiting at I/O. The + new functions allow a program to initiate one or more I/O operations and + then immediately resume normal work while the I/O operations are + executed in parallel. + + These functions are part of the library with realtime functions named +-.IR libaio . ++.BR libaio . + They are not actually part of the +-.IR "libc" ++.B libc + binary. + The implementation of these functions can be done using support in the + kernel. +@@ -27,9 +29,9 @@ kernel. + All IO operations operate on files which were opened previously. There + might be arbitrarily many operations running for one file. The + asynchronous I/O operations are controlled using a data structure named +-.IR "struct iocb" ++.B struct iocb + It is defined in +-.IR "libaio.h" ++.I libaio.h + as follows. + + .nf +@@ -74,7 +76,7 @@ struct iocb { + + .fi + .TP +-.IR "int aio_fildes" ++.BI int " aio_fildes" + This element specifies the file descriptor to be used for the + operation. It must be a legal descriptor, otherwise the operation will + fail. +@@ -82,55 +84,55 @@ fail. + The device on which the file is opened must allow the seek operation. + I.e., it is not possible to use any of the IO operations on devices + like terminals where an +-.IR "lseek" ++.BR lseek (2) + call would lead to an error. + .TP +-.IR "long u.c.offset" ++.BI long " u.c.offset" + This element specifies the offset in the file at which the operation (input + or output) is performed. Since the operations are carried out in arbitrary + order and more than one operation for one file descriptor can be + started, one cannot expect a current read/write position of the file + descriptor. + .TP +-.IR "void *buf" ++.BI "void *" buf + This is a pointer to the buffer with the data to be written or the place + where the read data is stored. + .TP +-.IR "long u.c.nbytes" ++.BI long " u.c.nbytes" + This element specifies the length of the buffer pointed to by + .IR io_buf . + .TP +-.IR "int aio_reqprio" ++.BI int " aio_reqprio" + Is not currently used. + .TP + .B "IO_CMD_PREAD" + Start a read operation. Read from the file at position +-.IR "u.c.offset" ++.I u.c.offset + and store the next +-.IR "u.c.nbytes" ++.I u.c.nbytes + bytes in the + buffer pointed to by + .IR buf . + .TP + .B "IO_CMD_PWRITE" + Start a write operation. Write +-.IR "u.c.nbytes" ++.I u.c.nbytes + bytes starting at +-.IR "buf" ++.I buf + into the file starting at position + .IR u.c.offset . + .TP + .B "IO_CMD_NOP" + Do nothing for this control block. This value is useful sometimes when + an array of +-.IR "struct iocb" ++.B struct iocb + values contains holes, i.e., some of the + values must not be handled although the whole array is presented to the +-.IR "io_submit" ++.BR io_submit (3) + function. + .TP + .B "IO_CMD_FSYNC" +-.TP ++.TQ + .B "IO_CMD_POLL" + This is experimental. + .SH EXAMPLE +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index a4683be..3ca629b 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -9,7 +9,7 @@ io_cancel \- Cancel io requests + .B #include + .sp + .br +-.BI "int io_cancel(io_context_t ctx, struct iocb *iocb)" ++.BI "int io_cancel(io_context_t " ctx ", struct iocb *" iocb ");" + .br + .sp + struct iocb { +@@ -21,8 +21,11 @@ struct iocb { + }; + .fi + .SH DESCRIPTION +-Attempts to cancel an iocb previously passed to io_submit. If +-the operation is successfully cancelled, the resulting event is ++Attempts to cancel an ++.I iocb ++previously passed to ++.BR io_submit (3). ++If the operation is successfully cancelled, the resulting event is + copied into the memory pointed to by result without being placed + into the completion queue. + .PP +@@ -33,19 +36,23 @@ have to be overwritten soon. As an example, assume an application, which + writes data in files in a situation where new incoming data would have + to be written in a file which will be updated by an enqueued request. + .SH "RETURN VALUES" +-0 is returned on success, otherwise returns errno. ++\fI0\fP is returned on success, otherwise returns \fIerrno\fP. + .SH ERRORS + .TP + .B EFAULT + If any of the data structures pointed to are invalid. + .TP + .B EINVAL +-If aio_context specified by ctx_id is +-invalid. ++If ++.I aio_context ++specified by ++.I ctx_id ++is invalid. + .TP + .B EAGAIN +-If the iocb specified was not +-cancelled. ++If the ++.I iocb ++specified was not cancelled. + .TP + .B ENOSYS + If not implemented. +diff --git a/man/io_fsync.3 b/man/io_fsync.3 +index bc6778a..06538c4 100644 +--- a/man/io_fsync.3 ++++ b/man/io_fsync.3 +@@ -15,7 +15,7 @@ io_fsync \- Synchronize a file's complete in-core state with that on disk + .B #include + .sp + .br +-.BI "int io_fsync(io_context_t ctx, struct iocb *iocb, io_callback_t cb, int fd)" ++.BI "int io_fsync(io_context_t " ctx ", struct iocb *" iocb ", io_callback_t " cb ", int " fd ");" + .sp + struct iocb { + void *data; +@@ -40,7 +40,7 @@ Calling this function forces all I/O operations operating queued at the + time of the function call operating on the file descriptor + .IR "iocb->io_fildes" + into the synchronized I/O completion state. The +-.IR "io_fsync" ++.BR io_fsync () + function returns + immediately but the notification through the method described in + .IR "io_callback" +@@ -49,7 +49,10 @@ file descriptor have terminated and the file is synchronized. This also + means that requests for this very same file descriptor which are queued + after the synchronization request are not affected. + .SH "RETURN VALUES" +-Returns 0, otherwise returns errno. ++Returns ++.BR 0 , ++otherwise returns ++.IR errno . + .SH ERRORS + .TP + .B EFAULT +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 05b2507..6fbcc24 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -42,19 +42,25 @@ struct io_event { + unsigned PADDED(res2, __pad4); + }; + .sp +-.BI "int io_getevents(io_context_t " ctx ", long " nr ", struct io_event *" events "[], struct timespec *" timeout ");" +-.BI "int io_pgetevents(io_context_t " ctx ", long " nr ", struct io_event *" events "[], struct timespec *" timeout ", sigset_t *" sigmask ");" ++.BI "int io_getevents(io_context_t " ctx ", long " nr ", struct io_event *" events "[], struct timespec *" timeout ");" ++.BI "int io_pgetevents(io_context_t " ctx ", long " nr ", struct io_event *" events "[], struct timespec *" timeout ", sigset_t *" sigmask ");" + .fi + .SH DESCRIPTION +-Attempts to read up to nr events from +-the completion queue for the aio_context specified by ctx. ++Attempts to read up to ++.I nr ++events from the completion queue for the aio_context specified by ++.IR ctx . + .SH "RETURN VALUES" + May return +-0 if no events are available and the timeout specified +-by when has elapsed, where when == NULL specifies an infinite ++.B 0 ++if no events are available and the timeout specified ++by when has elapsed, where ++.I when ++== NULL specifies an infinite + timeout. Note that the timeout pointed to by when is relative and +-will be updated if not NULL and the operation blocks. Will fail +-with ENOSYS if not implemented. ++will be updated if not NULL and the operation blocks. Will fail with ++.B ENOSYS ++if not implemented. + .SS io_pgetevents() + The relationship between + .BR io_getevents () +@@ -110,8 +116,15 @@ behaves the same as + .SH ERRORS + .TP + .B EINVAL +-If ctx_id is invalid, if min_nr is out of range, +-if nr is out of range, if when is out of range. ++If ++.I ctx_id ++is invalid, if ++.I min_nr ++is out of range, if ++.I nr ++is out of range, if ++.I when ++is out of range. + .TP + .B EFAULT + If any of the memory specified to is invalid. +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index bc0c43b..d332709 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -16,7 +16,7 @@ io_prep_fsync \- Synchronize a file's complete in-core state with that on disk + .B #include + .br + .sp +-.BI "static inline void io_prep_fsync(struct iocb *iocb, int fd)" ++.BI "static inline void io_prep_fsync(struct iocb *" iocb ", int " fd ");" + .sp + struct iocb { + void *data; +@@ -28,47 +28,72 @@ struct iocb { + .sp + .fi + .SH DESCRIPTION +-This is an inline convenience function for setting up an iocbv for a FSYNC request. +-.br ++This is an inline convenience function for setting up an ++.I iocbv ++for a ++.B FSYNC ++request. ++. ++.PP + The file for which +-.TP ++.nf + .IR "iocb->aio_fildes = fd" ++.fi + is a descriptor is set up with + the command +-.TP +-.IR "iocb->aio_lio_opcode = IO_CMD_FSYNC: ++.nf ++.IR "iocb->aio_lio_opcode = IO_CMD_FSYNC" ++.fi + . + .PP +-The io_prep_fsync() function shall set up an IO_CMD_FSYNC operation +-to asynchronously force all I/O ++The ++.BR io_prep_fsync () ++function shall set up an ++.B IO_CMD_FSYNC ++operation to asynchronously force all I/O + operations associated with the file indicated by the file +-descriptor aio_fildes member of the iocb structure referenced by ++descriptor ++.I aio_fildes ++member of the ++.I iocb ++structure referenced by + the iocb argument and queued at the time of the call to +-io_submit() to the synchronized I/O completion state. The function ++.BR io_submit () ++to the synchronized I/O completion state. The function + call shall return when the synchronization request has been + initiated or queued to the file or device (even when the data + cannot be synchronized immediately). + + All currently queued I/O operations shall be completed as if by a call +-to fsync(); that is, as defined for synchronized I/O file ++to ++.BR fsync (2); ++that is, as defined for synchronized I/O file + integrity completion. If the +-operation queued by io_prep_fsync() fails, then, as for fsync(), ++operation queued by ++.BR io_prep_fsync () ++fails, then, as for ++.BR fsync (2), + outstanding I/O operations are not guaranteed to have + been completed. + +-If io_prep_fsync() succeeds, then it is only the I/O that was queued +-at the time of the call to io_submit() that is guaranteed to be ++If ++.BR io_prep_fsync () ++succeeds, then it is only the I/O that was queued ++at the time of the call to ++.BR io_submit (3) ++that is guaranteed to be + forced to the relevant completion state. The completion of + subsequent I/O on the file descriptor is not guaranteed to be + completed in a synchronized fashion. + .PP + This function returns immediately. To schedule the operation, the + function +-.IR io_submit ++.BR io_submit (3) + must be called. + .PP +-Simultaneous asynchronous operations using the same iocb produce +-undefined results. ++Simultaneous asynchronous operations using the same ++.I iocb ++produce undefined results. + .SH "RETURN VALUES" + None. + .SH ERRORS +diff --git a/man/io_prep_pread.3 b/man/io_prep_pread.3 +index e981e41..e0756a7 100644 +--- a/man/io_prep_pread.3 ++++ b/man/io_prep_pread.3 +@@ -19,7 +19,7 @@ io_prep_pread \- Set up asynchronous read + .B #include + .br + .sp +-.BI "inline void io_prep_pread(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) ++.BI "inline void io_prep_pread(struct iocb *" iocb ", int " fd ", void *" buf ", size_t " count ", long long " offset ");" + . + .sp + struct iocb { +@@ -31,32 +31,27 @@ struct iocb { + }; + .fi + .SH DESCRIPTION +-.IR io_prep_pread ++.BR io_prep_pread () + is an inline convenience function designed to facilitate the initialization of + the iocb for an asynchronous read operation. + + The first +-.TP +-.IR "iocb->u.c.nbytes = count" ++.I iocb->u.c.nbytes = count + bytes of the file for which +-.TP +-.IR "iocb->aio_fildes = fd" ++.I iocb->aio_fildes = fd + is a descriptor are written to the buffer + starting at +-.TP + .IR "iocb->u.c.buf = buf" . +-.br + Reading starts at the absolute position +-.TP +-.IR "ioc->u.c.offset = offset" ++.I ioc->u.c.offset = offset + in the file. + .PP + This function returns immediately. To schedule the operation, the + function +-.IR io_submit ++.BR io_submit (3) + must be called. + .PP +-Simultaneous asynchronous operations using the same iocb produce ++Simultaneous asynchronous operations using the same \fIiocb\fP produce + undefined results. + .SH "RETURN VALUES" + None. +diff --git a/man/io_prep_pwrite.3 b/man/io_prep_pwrite.3 +index f2837b6..b3770b4 100644 +--- a/man/io_prep_pwrite.3 ++++ b/man/io_prep_pwrite.3 +@@ -19,8 +19,8 @@ io_prep_pwrite \- Set up iocb for asynchronous writes + .B #include + .br + .sp +-.BI "inline void io_prep_pwrite(struct iocb *iocb, int fd, void *buf, size_t count, long long offset) +-" ++.BI "inline void io_prep_pwrite(struct iocb *" iocb ", int " fd ", void *" buf ", size_t " count ", long long " offset ");" ++. + .sp + struct iocb { + void *data; +@@ -31,27 +31,23 @@ struct iocb { + }; + .fi + .SH DESCRIPTION +-io_prep_write is a convenience function for setting up parallel writes. ++.BR io_prep_write () ++is a convenience function for setting up parallel writes. + + The first +-.TP + .IR "iocb->u.c.nbytes = count" + bytes of the file for which +-.TP + .IR "iocb->aio_fildes = fd" + is a descriptor are written from the buffer + starting at +-.TP + .IR "iocb->u.c.buf = buf" . +-.br + Writing starts at the absolute position +-.TP + .IR "ioc->u.c.offset = offset" + in the file. + .PP + This function returns immediately. To schedule the operation, the + function +-.IR io_submit ++.BR io_submit (3) + must be called. + .PP + Simultaneous asynchronous operations using the same iocb produce +diff --git a/man/io_queue_init.3 b/man/io_queue_init.3 +index d8753a7..661f377 100644 +--- a/man/io_queue_init.3 ++++ b/man/io_queue_init.3 +@@ -10,25 +10,31 @@ io_queue_init \- Initialize asynchronous io state machine + .B #include + .br + .sp +-.BI "int io_queue_init(int maxevents, io_context_t *ctx );" ++.BI "int io_queue_init(int " maxevents ", io_context_t *" ctx ");" + .sp + .fi + .SH DESCRIPTION +-.B io_queue_init +-Attempts to create an aio context capable of receiving at least +-.IR maxevents ++.BR io_queue_init () ++attempts to create an aio context capable of receiving at least ++.I maxevents + events. +-.IR ctx ++.I ctx + must point to an aio context that already exists and must be initialized + to +-.IR 0 ++.B 0 + before the call. +-If the operation is successful, *cxtp is filled with the resulting handle. ++If the operation is successful, ++.I *cxtp ++is filled with the resulting handle. + .SH "RETURN VALUES" + On success, +-.B io_queue_init +-returns 0. Otherwise, -error is return, where +-error is one of the Exxx values defined in the Errors section. ++.BR io_queue_init () ++returns ++.BR 0 . ++Otherwise, -error is return, where ++error is one of the Exxx values defined in the ++.B ERRORS ++section. + .SH ERRORS + .TP + .B EFAULT +@@ -37,7 +43,9 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I maxevents +-is <= 0 or ++is <= ++.B 0 ++or + .IR ctx + is an invalid memory location. + .TP +@@ -46,7 +54,9 @@ Not implemented. + .TP + .B EAGAIN + .IR "maxevents > max_aio_reqs" +-where max_aio_reqs is a tunable value. ++where ++.I max_aio_reqs ++is a tunable value. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +diff --git a/man/io_queue_release.3 b/man/io_queue_release.3 +index 392a478..7a67141 100644 +--- a/man/io_queue_release.3 ++++ b/man/io_queue_release.3 +@@ -8,7 +8,7 @@ io_queue_release \- Release the context associated with the userspace handle + .B #include + .br + .sp +-.BI "int io_queue_release(io_context_t ctx)" ++.BI "int io_queue_release(io_context_t " ctx ");" + .sp + .SH DESCRIPTION + .B io_queue_release +@@ -17,16 +17,21 @@ AIOs and block on completion. + . + .SH "RETURN VALUES" + On success, +-.B io_queue_release +-returns 0. Otherwise, -error is return, where ++.BR io_queue_release () ++returns ++.BR 0 . ++Otherwise, -error is return, where + error is one of the Exxx values defined in the Errors section. + .SH ERRORS + .TP + .B EINVAL + .I ctx +-refers to an uninitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the ++.I iocb ++pointed to by + .I iocbs +-contains an improperly initialized iocb, ++contains an improperly initialized ++.IR iocb . + .TP + .B ENOSYS + Not implemented. +@@ -44,4 +49,3 @@ Not implemented. + .BR io_set_callback (3), + .BR io_submit (3), + .BR errno (3). +- +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index dc54acd..93e322b 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -9,17 +9,19 @@ io_queue_run \- Handle completed io requests + .B #include + .br + .sp +-.BI "int io_queue_run(io_context_t ctx );" ++.BI "int io_queue_run(io_context_t " ctx ");" + .sp + .fi + .SH DESCRIPTION +-.B io_queue_run +-Attempts to read all the events from +-the completion queue for the aio_context specified by ctx_id. ++.BR io_queue_run () ++attempts to read all the events from ++the completion queue for the aio_context specified by ++.IR ctx_id . + .SH "RETURN VALUES" + May return +-0 if no events are available. +-Will fail with -ENOSYS if not implemented. ++.B 0 ++if no events are available. ++Will fail with -\fBENOSYS\fP if not implemented. + .SH ERRORS + .TP + .B EFAULT +@@ -28,7 +30,9 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an uninitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the ++.I iocb ++pointed to by + .I iocbs + contains an improperly initialized iocb. + .TP +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index 356c3b2..ad5e7f4 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -9,22 +9,27 @@ io_queue_wait \- Wait for io requests to complete + .B #include + .br + .sp +-.BI "int io_queue_wait(io_context_t ctx, const struct timespec *timeout);" ++.BI "int io_queue_wait(io_context_t " ctx ", const struct timespec *" timeout ");" + .fi + .SH DESCRIPTION +-Attempts to read an event from +-the completion queue for the aio_context specified by ctx_id. ++.BR io_queue_wait () ++attempts to read an event from ++the completion queue for the aio_context specified by ++.IR ctx_id . + .SH "RETURN VALUES" + May return +-0 if no events are available and the timeout specified ++.B 0 ++if no events are available and the timeout specified + by when has elapsed, where when == NULL specifies an infinite +-timeout. Note that the timeout pointed to by when is relative and ++\fItimeout\fP. Note that the \fItimeout\fP pointed to by when is relative and + will be updated if not NULL and the operation blocks. Will fail +-with -ENOSYS if not implemented. ++with -\fBENOSYS\fP if not implemented. + .SH "RETURN VALUES" + On success, +-.B io_queue_wait +-returns 0. Otherwise, -error is return, where ++.BR io_queue_wait () ++returns ++.BR 0 . ++Otherwise, -error is return, where + error is one of the Exxx values defined in the Errors section. + .SH ERRORS + .TP +@@ -34,7 +39,9 @@ referenced data outside of the program's accessible address space. + .TP + .B EINVAL + .I ctx +-refers to an uninitialized aio context, the iocb pointed to by ++refers to an uninitialized aio context, the ++.I iocb ++pointed to by + .I iocbs + contains an improperly initialized iocb. + .TP +diff --git a/man/io_set_callback.3 b/man/io_set_callback.3 +index 25b9a7f..855f4b9 100644 +--- a/man/io_set_callback.3 ++++ b/man/io_set_callback.3 +@@ -10,7 +10,7 @@ io_set_callback \- Set up io completion callback function + .B #include + .br + .sp +-.BI "static inline void io_set_callback(struct iocb *iocb, io_callback_t cb)" ++.BI "static inline void io_set_callback(struct iocb *" iocb ", io_callback_t " cb ");" + .sp + struct iocb { + void *data; +@@ -25,7 +25,8 @@ typedef void (*io_callback_t)(io_context_t ctx, struct iocb *iocb, long res, lon + .fi + .SH DESCRIPTION + The callback is not done if the caller uses raw events from +-io_getevents, only with the library helpers. ++.BR io_getevents (3), ++only with the library helpers. + .SH "RETURN VALUES" + None. + .SH ERRORS +diff --git a/man/io_submit.3 b/man/io_submit.3 +index 01c25cd..a195653 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -32,21 +32,21 @@ struct iocb { + }; + .fi + .SH DESCRIPTION +-.B io_submit ++.BR io_submit () + submits + .I nr + iocbs for processing for a given io context ctx. + + The +-.IR "io_submit" ++.BR io_submit () + function can be used to enqueue an arbitrary + number of read and write requests at one time. The requests can all be + meant for the same file, all for different files or every solution in + between. + +-.IR "io_submit" ++.BR io_submit () + gets the +-.IR "nr" ++.I nr + requests from the array pointed to + by + .IR "iocbs" . +@@ -75,10 +75,10 @@ in which case this element of + .IR "iocbs" + is simply ignored. This + ``operation'' is useful in situations where one has a fixed array of +-.IR "struct iocb" ++.B struct iocb + elements from which only a few need to be handled at + a time. Another situation is where the +-.IR "io_submit" ++.BR io_submit (3) + call was + canceled before all requests are processed and the remaining requests have to be reissued. + +@@ -86,15 +86,15 @@ The other members of each element of the array pointed to by + .IR "iocbs" + must have values suitable for the operation as described in + the documentation for +-.IR "io_prep_pread" ++.BR io_prep_pread (3) + and +-.IR "io_prep_pwrite" ++.BR io_prep_pwrite (3) + above. + + The function returns immediately after + having enqueued all the requests. + On success, +-.B io_submit ++.BR io_submit () + returns the number of iocbs submitted successfully. Otherwise, -error is return, where + error is one of the Exxx values defined in the Errors section. + .PP +@@ -115,10 +115,14 @@ refers to an uninitialized aio context, the iocb pointed to by + contains an improperly initialized iocb, + .TP + .B EBADF +-The iocb contains a file descriptor that does not exist. ++The ++.I iocb ++contains a file descriptor that does not exist. + .TP + .B EINVAL +-The file specified in the iocb does not support the given io operation. ++The file specified in the ++.I iocb ++does not support the given io operation. + .SH "SEE ALSO" + .BR io (3), + .BR io_cancel (3), +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0014-man-Fold-short-lines.patch b/patches/upstream/0014-man-Fold-short-lines.patch new file mode 100644 index 0000000..602fe7d --- /dev/null +++ b/patches/upstream/0014-man-Fold-short-lines.patch @@ -0,0 +1,55 @@ +From 96fe0e8a3efb8bb058852a46c0273125dd54ba49 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:12 +0200 +Subject: [PATCH libaio 14/28] man: Fold short lines + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_prep_fsync.3 | 3 +-- + man/io_submit.3 | 9 +++------ + 2 files changed, 4 insertions(+), 8 deletions(-) + +diff --git a/man/io_prep_fsync.3 b/man/io_prep_fsync.3 +index d332709..419dfeb 100644 +--- a/man/io_prep_fsync.3 ++++ b/man/io_prep_fsync.3 +@@ -39,8 +39,7 @@ The file for which + .nf + .IR "iocb->aio_fildes = fd" + .fi +-is a descriptor is set up with +-the command ++is a descriptor is set up with the command + .nf + .IR "iocb->aio_lio_opcode = IO_CMD_FSYNC" + .fi +diff --git a/man/io_submit.3 b/man/io_submit.3 +index a195653..c0791ed 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -47,18 +47,15 @@ between. + .BR io_submit () + gets the + .I nr +-requests from the array pointed to +-by ++requests from the array pointed to by + .IR "iocbs" . + The operation to be performed is determined by the + .IR "aio_lio_opcode" + member in each element of + .IR "iocbs" . +-If this +-field is ++If this field is + .B "IO_CMD_PREAD" +-a read operation is enqueued, similar to a call +-of ++a read operation is enqueued, similar to a call of + .IR "io_prep_pread" + for this element of the array (except that the way + the termination is signalled is different, as we will see below). If +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0015-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch b/patches/upstream/0015-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch new file mode 100644 index 0000000..d7f5bb7 --- /dev/null +++ b/patches/upstream/0015-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch @@ -0,0 +1,61 @@ +From 6f0b6fb5bb3ac118cb56848e52d40ff7e1ece3d1 Mon Sep 17 00:00:00 2001 +From: Stephan Springl +Date: Sat, 20 Jul 2019 21:18:13 +0200 +Subject: [PATCH libaio 15/28] man: Escape verbatim \n in order to make it + through roff + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io.3 | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index f40da41..bfa9836 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -174,11 +174,11 @@ static const char *srcname = NULL; + static void io_error(const char *func, int rc) + { + if (rc == -ENOSYS) +- fprintf(stderr, "AIO not in this kernel\n"); ++ fprintf(stderr, "AIO not in this kernel\\n"); + else if (rc < 0 && -rc < sys_nerr) +- fprintf(stderr, "%s: %s\n", func, sys_errlist[-rc]); ++ fprintf(stderr, "%s: %s\\n", func, sys_errlist[-rc]); + else +- fprintf(stderr, "%s: error %d\n", func, rc); ++ fprintf(stderr, "%s: error %d\\n", func, rc); + + if (dstfd > 0) + close(dstfd); +@@ -197,7 +197,7 @@ static void wr_done(io_context_t ctx, struct iocb *iocb, long res, long res2) + io_error("aio write", res2); + } + if (res != iocb->u.c.nbytes) { +- fprintf(stderr, "write missed bytes expect %d got %d\n", iocb->u.c.nbytes, res2); ++ fprintf(stderr, "write missed bytes expect %d got %d\\n", iocb->u.c.nbytes, res2); + exit(1); + } + --tocopy; +@@ -223,7 +223,7 @@ static void rd_done(io_context_t ctx, struct iocb *iocb, long res, long res2) + if (res2 != 0) + io_error("aio read", res2); + if (res != iosize) { +- fprintf(stderr, "read missing bytes expect %d got %d\n", iocb->u.c.nbytes, res); ++ fprintf(stderr, "read missing bytes expect %d got %d\\n", iocb->u.c.nbytes, res); + exit(1); + } + +@@ -283,7 +283,7 @@ int main(int argc, char *const *argv) + char *buf = (char *) malloc(iosize); + + if (NULL == buf || NULL == io) { +- fprintf(stderr, "out of memory\n"); ++ fprintf(stderr, "out of memory\\n"); + exit(1); + } + +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch b/patches/upstream/0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch new file mode 100644 index 0000000..ece0f90 --- /dev/null +++ b/patches/upstream/0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch @@ -0,0 +1,153 @@ +From e2175569737a2905d3c7a6e6ff664f0febcf5a28 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:18:14 +0200 +Subject: [PATCH libaio 16/28] Use ctx consistently for io_context_t instead of + ctx_id + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + man/io_cancel.3 | 2 +- + man/io_getevents.3 | 8 ++++---- + man/io_queue_run.3 | 2 +- + man/io_queue_wait.3 | 2 +- + man/io_submit.3 | 2 +- + src/compat-0_1.c | 4 ++-- + src/libaio.h | 4 ++-- + src/vsys_def.h | 2 +- + 8 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 3ca629b..8c6910e 100644 +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -46,7 +46,7 @@ If any of the data structures pointed to are invalid. + If + .I aio_context + specified by +-.I ctx_id ++.I ctx + is invalid. + .TP + .B EAGAIN +diff --git a/man/io_getevents.3 b/man/io_getevents.3 +index 6fbcc24..6ff686d 100644 +--- a/man/io_getevents.3 ++++ b/man/io_getevents.3 +@@ -1,7 +1,7 @@ + .\"/* io_getevents: + .\" * Attempts to read at least min_nr events and up to nr events from +-.\" * the completion queue for the aio_context specified by ctx_id. May +-.\" * fail with -EINVAL if ctx_id is invalid, if min_nr is out of range, ++.\" * the completion queue for the aio_context specified by ctx. May ++.\" * fail with -EINVAL if ctx is invalid, if min_nr is out of range, + .\" * if nr is out of range, if when is out of range. May fail with + .\" * -EFAULT if any of the memory specified to is invalid. May return + .\" * 0 or < min_nr if no events are available and the timeout specified +@@ -10,7 +10,7 @@ + .\" * will be updated if not NULL and the operation blocks. Will fail + .\" * with -ENOSYS if not implemented. + .\" */ +-.\"asmlinkage long sys_io_getevents(io_context_t ctx_id, ++.\"asmlinkage long sys_io_getevents(io_context_t ctx, + .\" long min_nr, + .\" long nr, + .\" struct io_event *events, +@@ -117,7 +117,7 @@ behaves the same as + .TP + .B EINVAL + If +-.I ctx_id ++.I ctx + is invalid, if + .I min_nr + is out of range, if +diff --git a/man/io_queue_run.3 b/man/io_queue_run.3 +index 93e322b..2bb9701 100644 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -16,7 +16,7 @@ io_queue_run \- Handle completed io requests + .BR io_queue_run () + attempts to read all the events from + the completion queue for the aio_context specified by +-.IR ctx_id . ++.IR ctx . + .SH "RETURN VALUES" + May return + .B 0 +diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3 +index ad5e7f4..1cf4f0b 100644 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -15,7 +15,7 @@ io_queue_wait \- Wait for io requests to complete + .BR io_queue_wait () + attempts to read an event from + the completion queue for the aio_context specified by +-.IR ctx_id . ++.IR ctx . + .SH "RETURN VALUES" + May return + .B 0 +diff --git a/man/io_submit.3 b/man/io_submit.3 +index c0791ed..c15134f 100644 +--- a/man/io_submit.3 ++++ b/man/io_submit.3 +@@ -1,7 +1,7 @@ + .\"/* sys_io_submit: + .\" * Queue the nr iocbs pointed to by iocbpp for processing. Returns + .\" * the number of iocbs queued. May return -EINVAL if the aio_context +-.\" * specified by ctx_id is invalid, if nr is < 0, if the iocb at ++.\" * specified by ctx is invalid, if nr is < 0, if the iocb at + .\" * *iocbpp[0] is not properly initialized, if the operation specified + .\" * is invalid for the file descriptor in the iocb. May fail with + .\" * -EFAULT if any of the data structures point to invalid data. May +diff --git a/src/compat-0_1.c b/src/compat-0_1.c +index 136396f..722e107 100644 +--- a/src/compat-0_1.c ++++ b/src/compat-0_1.c +@@ -49,14 +49,14 @@ int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) + + /* ABI change. Provide backwards compatibility for this one. */ + SYMVER(compat0_1_io_getevents, io_getevents, 0.1); +-int compat0_1_io_getevents(io_context_t ctx_id, long nr, ++int compat0_1_io_getevents(io_context_t ctx, long nr, + struct io_event *events, + const struct timespec *const_timeout) + { + struct timespec timeout; + if (const_timeout) + timeout = *const_timeout; +- return io_getevents(ctx_id, 1, nr, events, ++ return io_getevents(ctx, 1, nr, events, + const_timeout ? &timeout : NULL); + } + +diff --git a/src/libaio.h b/src/libaio.h +index 2bc24e0..8b33382 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -162,8 +162,8 @@ extern int io_setup(int maxevents, io_context_t *ctxp); + extern int io_destroy(io_context_t ctx); + extern int io_submit(io_context_t ctx, long nr, struct iocb *ios[]); + extern int io_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt); +-extern int io_getevents(io_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout); +-extern int io_pgetevents(io_context_t ctx_id, long min_nr, long nr, ++extern int io_getevents(io_context_t ctx, long min_nr, long nr, struct io_event *events, struct timespec *timeout); ++extern int io_pgetevents(io_context_t ctx, long min_nr, long nr, + struct io_event *events, struct timespec *timeout, + sigset_t *sigmask); + +diff --git a/src/vsys_def.h b/src/vsys_def.h +index 13d032e..dd711dc 100644 +--- a/src/vsys_def.h ++++ b/src/vsys_def.h +@@ -20,5 +20,5 @@ extern int vsys_io_destroy(io_context_t ctx); + extern int vsys_io_submit(io_context_t ctx, long nr, struct iocb *iocbs[]); + extern int vsys_io_cancel(io_context_t ctx, struct iocb *iocb); + extern int vsys_io_wait(io_context_t ctx, struct iocb *iocb, const struct timespec *when); +-extern int vsys_io_getevents(io_context_t ctx_id, long nr, struct io_event *events, const struct timespec *timeout); ++extern int vsys_io_getevents(io_context_t ctx, long nr, struct io_event *events, const struct timespec *timeout); + +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0017-harness-Use-destination-strncpy-expression-for-sizeo.patch b/patches/upstream/0017-harness-Use-destination-strncpy-expression-for-sizeo.patch new file mode 100644 index 0000000..c5da201 --- /dev/null +++ b/patches/upstream/0017-harness-Use-destination-strncpy-expression-for-sizeo.patch @@ -0,0 +1,53 @@ +From b9e17f6afdc4d0e81b1598aecea7b80d0c54b13a Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:20:58 +0200 +Subject: [PATCH libaio 17/28] harness: Use destination strncpy() expression + for sizeof() argument +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Even though this is the same size, as the sizeof() is derived from the +source expression, recent gcc versions will emit a warning, which is +turned into an error by -Werror: + + error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression + as the source; did you mean to use the size of the destination? + [-Werror=sizeof-pointer-memaccess] + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/cases/19.t | 2 +- + harness/cases/21.t | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/harness/cases/19.t b/harness/cases/19.t +index 4989510..5c3e0d6 100644 +--- a/harness/cases/19.t ++++ b/harness/cases/19.t +@@ -41,7 +41,7 @@ open_temp_file(void) + int fd; + char template[sizeof(TEMPLATE)]; + +- strncpy(template, TEMPLATE, sizeof(TEMPLATE)); ++ strncpy(template, TEMPLATE, sizeof(template)); + fd = mkostemp(template, O_DIRECT); + if (fd < 0) { + perror("mkstemp"); +diff --git a/harness/cases/21.t b/harness/cases/21.t +index 441eaa8..fe33a9d 100644 +--- a/harness/cases/21.t ++++ b/harness/cases/21.t +@@ -43,7 +43,7 @@ open_temp_file() + int fd; + char temp_file[sizeof(TEMPLATE)]; + +- strncpy(temp_file, TEMPLATE, sizeof(TEMPLATE)); ++ strncpy(temp_file, TEMPLATE, sizeof(temp_file)); + fd = mkstemp(temp_file); + if (fd < 0) { + perror("mkstemp"); +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch b/patches/upstream/0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch new file mode 100644 index 0000000..9b86f2e --- /dev/null +++ b/patches/upstream/0018-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch @@ -0,0 +1,116 @@ +From fca5217d524635bed70532aa68baff065d22d790 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:20:59 +0200 +Subject: [PATCH libaio 18/28] harness: Use run-time _SC_PAGE_SIZE instead of + build-time PAGESIZE + +The getconf(1) command is inherently not cross-compilation friendly. +In addition PAGESIZE depends on the specific system, even within a +specific arch, so using a hard-coded value is never safe. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/Makefile | 2 +- + harness/cases/18.t | 34 ++++++++++++++++++++++++---------- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/harness/Makefile b/harness/Makefile +index 87b33f6..5cc2b25 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,7 +6,7 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE) ++CFLAGS+=-Wall -Werror -I../src -g -O2 + #-lpthread -lrt + + # Change this on the build line to run tests against the installed libraries: +diff --git a/harness/cases/18.t b/harness/cases/18.t +index 5587ceb..daa1d26 100644 +--- a/harness/cases/18.t ++++ b/harness/cases/18.t +@@ -40,11 +40,17 @@ + + #define THREADS_NUM 100 + ++static size_t page_size; ++ + void + aio_worker(void *ptr) + { +- int i, j, fd; +- char buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); ++ int i, j, fd, ret; ++ char *buffer = NULL; ++ ++ ret = posix_memalign((void **)&buffer, page_size, page_size); ++ assert(ret == 0); ++ assert(buffer != NULL); + + fd = open(FILENAME, O_DIRECT|O_RDONLY); + assert(fd >= 0); +@@ -55,19 +61,19 @@ aio_worker(void *ptr) + struct iocb *cbs[1]; + + assert(!io_queue_init(1, &ctx)); +- io_prep_pread(&cb, fd, buffer, PAGE_SIZE, 0); ++ io_prep_pread(&cb, fd, buffer, page_size, 0); + cbs[0] = &cb; + +- memset(buffer, '0', PAGE_SIZE); ++ memset(buffer, '0', page_size); + assert(io_submit(ctx, 1, &cbs[0]) == 1); + // wait random time (0-500ms) ? + + io_destroy(ctx); +- memset(buffer, DESTROY_PATTERN, PAGE_SIZE); ++ memset(buffer, DESTROY_PATTERN, page_size); + // wait random for (0-500ms) ? + + // check it is still DESTROY_PATTERN +- for (j = 0; j < PAGE_SIZE; j++) { ++ for (j = 0; j < page_size; j++) { + if (buffer[j] != DESTROY_PATTERN) { + fprintf(stderr, + "Buffer has unexpected character: %c\n", +@@ -77,6 +83,7 @@ aio_worker(void *ptr) + } + } + ++ free(buffer); + close(fd); + } + +@@ -84,15 +91,22 @@ int + test_main(void) + { + int i, fd, ret; +- char buffer[PAGE_SIZE]; ++ char *buffer = NULL; + pthread_t threads[THREADS_NUM]; + ++ page_size = sysconf(_SC_PAGESIZE); ++ assert(page_size >= 1); ++ ++ ret = posix_memalign((void **)&buffer, page_size, page_size); ++ assert(ret == 0); ++ assert(buffer != NULL); ++ + fd = open(FILENAME, O_CREAT|O_TRUNC|O_APPEND|O_RDWR, S_IRUSR|S_IWUSR); + assert(fd != -1); + +- memset(buffer, FILEPATTERN, PAGE_SIZE); +- ret = write(fd, buffer, PAGE_SIZE); +- assert(ret == PAGE_SIZE); ++ memset(buffer, FILEPATTERN, page_size); ++ ret = write(fd, buffer, page_size); ++ assert(ret == page_size); + close(fd); + + for (i = 0; i < THREADS_NUM; i++) { +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0019-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-unav.patch b/patches/upstream/0019-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-unav.patch new file mode 100644 index 0000000..e2e1660 --- /dev/null +++ b/patches/upstream/0019-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-unav.patch @@ -0,0 +1,38 @@ +From f322f467c3cd2ac4d8d08a19bd281eabb65433b1 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:21:00 +0200 +Subject: [PATCH libaio 19/28] harness: Make RISC-V use SYS_eventfd2 instead of + unavailable SYS_eventfd + +This is a recent architecture and as such does not provide legacy +support for SYS_eventfd. Declare that we need to use the new syscall. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/cases/16.t | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/harness/cases/16.t b/harness/cases/16.t +index 5a546ff..b36bbd2 100644 +--- a/harness/cases/16.t ++++ b/harness/cases/16.t +@@ -18,12 +18,12 @@ + #define SYS_eventfd 318 + #elif defined(__alpha__) + #define SYS_eventfd 478 +-#elif defined(__aarch64__) +-/* arm64 does not implement eventfd, only eventfd2 */ ++#elif defined(__aarch64__) || defined(__riscv) ++/* arm64 and riscv do not implement eventfd, only eventfd2 */ + #define USE_EVENTFD2 + #ifndef SYS_eventfd2 + #define SYS_eventfd2 19 +-#endif /* __aarch64__ */ ++#endif /* __aarch64__ || __riscv */ + #else + #error define SYS_eventfd for your arch! + #endif +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0020-harness-Make-the-test-exit-with-a-code-matching-the-.patch b/patches/upstream/0020-harness-Make-the-test-exit-with-a-code-matching-the-.patch new file mode 100644 index 0000000..e1873f7 --- /dev/null +++ b/patches/upstream/0020-harness-Make-the-test-exit-with-a-code-matching-the-.patch @@ -0,0 +1,28 @@ +From abcb9eeacc2f12c3d77b66c274ace9bffecf68e3 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 23 Jul 2019 02:48:43 +0200 +Subject: [PATCH libaio 20/28] harness: Make the test exit with a code matching + the pass/fail state + +This way we can use the exit code to check whether the tests passed or +failed, and fail the package build. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/runtests.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/harness/runtests.sh b/harness/runtests.sh +index 717c72a..ef269a7 100755 +--- a/harness/runtests.sh ++++ b/harness/runtests.sh +@@ -17,3 +17,5 @@ done + + echo "Pass: $passes Fail: $fails" + echo "Test run complete at" `date` ++ ++exit $fails +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0021-harness-add-support-for-skipping-tests.patch b/patches/upstream/0021-harness-add-support-for-skipping-tests.patch new file mode 100644 index 0000000..546bf65 --- /dev/null +++ b/patches/upstream/0021-harness-add-support-for-skipping-tests.patch @@ -0,0 +1,89 @@ +From 90ec55ab2675bc2b6b4d256f78a3db26adf75900 Mon Sep 17 00:00:00 2001 +From: Jeff Moyer +Date: Mon, 29 Jul 2019 13:16:18 -0400 +Subject: [PATCH libaio 21/28] harness: add support for skipping tests + +Skipped tests will not cause the test harness to return failure. An +exit status of "3" was chosen for skipped tests. This doesn't +conflict with any of the current tests. + +Signed-off-by: Jeff Moyer +--- + harness/main.c | 20 ++++++++++++++++---- + harness/runtests.sh | 14 ++++++++++++-- + 2 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/harness/main.c b/harness/main.c +index 9ecd5da..82e9c69 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -26,15 +26,27 @@ char test_name[] = TEST_NAME; + int main(void) + { + int res; ++ const char *test_result; + + #if defined(SETUP) + SETUP; + #endif + + res = test_main(); +- printf("test %s completed %s.\n", test_name, +- res ? "FAILED" : "PASSED" +- ); ++ switch(res) { ++ case 0: ++ test_result = "PASSED"; ++ break; ++ case 3: ++ test_result = "SKIPPED"; ++ break; ++ default: ++ test_result = "FAILED"; ++ res = 1; ++ break; ++ } ++ ++ printf("test %s completed %s.\n", test_name, test_result); + fflush(stdout); +- return res ? 1 : 0; ++ return res; + } +diff --git a/harness/runtests.sh b/harness/runtests.sh +index ef269a7..e9ceec8 100755 +--- a/harness/runtests.sh ++++ b/harness/runtests.sh +@@ -2,6 +2,7 @@ + + passes=0 + fails=0 ++skips=0 + + echo "Test run starting at" `date` + +@@ -11,11 +12,20 @@ while [ $# -ge 1 ] ; do + echo "Starting $this_test" + $this_test 2>&1 + res=$? +- if [ $res -eq 0 ] ; then str="" ; passes=$[passes + 1] ; else str=" -- FAILED" ; fails=$[fails + 1] ; fi ++ if [ $res -eq 0 ]; then ++ str=""; ++ passes=$((passes + 1)); ++ elif [ $res -eq 3 ]; then ++ str=" -- SKIPPED"; ++ skips=$((skips + 1)); ++ else ++ str=" -- FAILED" ++ fails=$((fails + 1)); ++ fi + echo "Completed $this_test with $res$str". + done + +-echo "Pass: $passes Fail: $fails" ++echo "Pass: $passes Fail: $fails Skip: $skips" + echo "Test run complete at" `date` + + exit $fails +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch b/patches/upstream/0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch new file mode 100644 index 0000000..6908eeb --- /dev/null +++ b/patches/upstream/0022-harness-Add-fallback-code-for-filesystems-not-suppor.patch @@ -0,0 +1,111 @@ +From ac60a850d5ce22ae21e3746f72a9ebb2623d17f8 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:21:01 +0200 +Subject: [PATCH libaio 22/28] harness: Add fallback code for filesystems not + supporting O_DIRECT + +When running the harness on a filesystem such as a tmpfs, which do not +support O_DIRECT, fallback to calls without the flag. + +Signed-off-by: Guillem Jover +[JEM: change from duplicating the open call to using F_SETFL] +[JEM: 18 and 21 require O_DIRECT-skip if not present] +Signed-off-by: Jeff Moyer +--- + harness/cases/17.t | 11 +++++++++-- + harness/cases/18.t | 2 ++ + harness/cases/19.t | 10 ++++++++-- + harness/cases/21.t | 5 ++++- + 4 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/harness/cases/17.t b/harness/cases/17.t +index 38ada4d..b4b6660 100644 +--- a/harness/cases/17.t ++++ b/harness/cases/17.t +@@ -119,7 +119,7 @@ void prune(io_context_t io_ctx, int max_ios, int getevents_type) + + void run_test(int max_ios, int getevents_type) + { +- int fd, ret; ++ int fd, ret, flags; + long i, to_submit; + struct iocb **iocb_sub; + io_context_t io_ctx; +@@ -137,9 +137,16 @@ void run_test(int max_ios, int getevents_type) + events = calloc(max_ios, sizeof(*events)); + + unlink(filename); +- fd = open(filename, O_CREAT | O_RDWR | O_DIRECT, 0644); ++ fd = open(filename, O_CREAT | O_RDWR, 0644); + assert(fd >= 0); + ++ /* ++ * Use O_DIRECT if it's available. If it's not, the test code ++ * will still operate correctly, just potentially slower. ++ */ ++ flags = fcntl(fd, F_GETFL, 0); ++ fcntl(fd, F_SETFL, flags | O_DIRECT); ++ + ret = ftruncate(fd, max_ios * io_size); + assert(!ret); + +diff --git a/harness/cases/18.t b/harness/cases/18.t +index daa1d26..e8dbcd1 100644 +--- a/harness/cases/18.t ++++ b/harness/cases/18.t +@@ -53,6 +53,8 @@ aio_worker(void *ptr) + assert(buffer != NULL); + + fd = open(FILENAME, O_DIRECT|O_RDONLY); ++ if (fd < 0 && errno == EINVAL) ++ exit(3); /* skip this test, O_DIRECT is unavailable */ + assert(fd >= 0); + + for (i = 0; i < 1000; i++) { +diff --git a/harness/cases/19.t b/harness/cases/19.t +index 5c3e0d6..ba1c620 100644 +--- a/harness/cases/19.t ++++ b/harness/cases/19.t +@@ -38,15 +38,21 @@ struct aio_ring { + int + open_temp_file(void) + { +- int fd; ++ int fd, flags; + char template[sizeof(TEMPLATE)]; + + strncpy(template, TEMPLATE, sizeof(template)); +- fd = mkostemp(template, O_DIRECT); ++ fd = mkstemp(template); + if (fd < 0) { + perror("mkstemp"); + exit(1); + } ++ /* ++ * O_DIRECT is desirable, but not required for this test. ++ */ ++ flags = fcntl(F_GETFL, 0); ++ fcntl(F_SETFL, flags | O_DIRECT); ++ + unlink(template); + return fd; + } +diff --git a/harness/cases/21.t b/harness/cases/21.t +index fe33a9d..ba988ed 100644 +--- a/harness/cases/21.t ++++ b/harness/cases/21.t +@@ -92,7 +92,10 @@ test_main() + */ + flags = fcntl(fd, F_GETFL); + ret = fcntl(fd, F_SETFL, flags | O_DIRECT); +- if (ret != 0) { ++ if (ret < 0) { ++ /* SKIP this test if O_DIRECT is not available on this fs */ ++ if (errno == EINVAL) ++ return 3; + perror("fcntl"); + return 1; + } +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch b/patches/upstream/0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch new file mode 100644 index 0000000..eac4ce7 --- /dev/null +++ b/patches/upstream/0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch @@ -0,0 +1,45 @@ +From b7e04d72bda89f22ce013030358e6743417f7fea Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 20 Jul 2019 21:21:02 +0200 +Subject: [PATCH libaio 23/28] harness: Handle -ENOTSUP from io_submit() with + RWF_NOWAIT + +On filesystems such as tmpfs the syscall might return -ENOTSUP instead +of EINVAL when it does not support the RWF_NOWAIT flag. + +Signed-off-by: Guillem Jover +[JEM: skip the test instead of returning success] +[JEM: make the error message differentiate between kernel and fs support] +Signed-off-by: Jeff Moyer +--- + harness/cases/21.t | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/harness/cases/21.t b/harness/cases/21.t +index ba988ed..4164c02 100644 +--- a/harness/cases/21.t ++++ b/harness/cases/21.t +@@ -108,13 +108,15 @@ test_main() + ret = io_submit(ctx, 1, &iocbp); + + /* +- * io_submit will return -EINVAL if RWF_NOWAIT is not supported. ++ * io_submit will return -EINVAL if RWF_NOWAIT is not supported by ++ * the kernel, and EOPNOTSUPP if it's not supported by the fs. + */ + if (ret != 1) { +- if (ret == -EINVAL) { +- fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n"); +- /* just return success */ +- return 0; ++ if (ret == -EINVAL || ret == -ENOTSUP) { ++ fprintf(stderr, "RWF_NOWAIT not supported by %s.\n", ++ ret == -EINVAL ? "kernel" : "file system"); ++ /* skip this test */ ++ return 3; + } + errno = -ret; + perror("io_submit"); +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0024-harness-skip-22.p-if-async_poll-isn-t-supported.patch b/patches/upstream/0024-harness-skip-22.p-if-async_poll-isn-t-supported.patch new file mode 100644 index 0000000..37bddfa --- /dev/null +++ b/patches/upstream/0024-harness-skip-22.p-if-async_poll-isn-t-supported.patch @@ -0,0 +1,52 @@ +From 79826d55b06a50ef1be2b723fe35a1e534cfbbaa Mon Sep 17 00:00:00 2001 +From: Jeff Moyer +Date: Mon, 29 Jul 2019 14:25:01 -0400 +Subject: [PATCH libaio 24/28] harness: skip 22.p if async_poll isn't supported + +Use the new skip error code instead of failing the test. Also +add in a Local variables: section for emacs. + +Signed-off-by: Jeff Moyer +--- + harness/cases/22.t | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/harness/cases/22.t b/harness/cases/22.t +index c7428a8..b13024e 100644 +--- a/harness/cases/22.t ++++ b/harness/cases/22.t +@@ -83,6 +83,9 @@ int test_main(void) + io_prep_poll(&iocb, pipe1[0], POLLIN); + ret = io_submit(ctx, 1, iocbs); + if (ret != 1) { ++ /* if poll isn't supported, skip the test */ ++ if (ret == -EINVAL) ++ return 3; + printf("child: io_submit failed\n"); + return 1; + } +@@ -120,7 +123,10 @@ int test_main(void) + + ret = io_submit(ctx, 1, iocbs); + if (ret != 1) { +- printf("parent: io_submit failed\n"); ++ /* if poll isn't supported, skip the test */ ++ if (ret == -EINVAL) ++ return 3; ++ printf("parent: io_submit failed with %d\n", ret); + return 1; + } + +@@ -147,3 +153,9 @@ int test_main(void) + return 0; + } + } ++/* ++ * Local variables: ++ * mode: c ++ * c-basic-offset: 8 ++ * End: ++ */ +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch b/patches/upstream/0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch new file mode 100644 index 0000000..c35dfc7 --- /dev/null +++ b/patches/upstream/0025-harness-fix-read-into-PROT_WRITE-mmap-test.patch @@ -0,0 +1,40 @@ +From d7f5065448efb49b2a26e728ff735e12ea05b62e Mon Sep 17 00:00:00 2001 +From: Jeff Moyer +Date: Tue, 13 Aug 2019 15:30:05 -0400 +Subject: [PATCH libaio 25/28] harness: fix read into PROT_WRITE mmap test + +This test has been broken forever. Fix it up to perform an +aio_read using the result of a regular read as the expected +return code. + +Reported-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/cases/5.t | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/harness/cases/5.t b/harness/cases/5.t +index 2b4b4bb..7d67562 100644 +--- a/harness/cases/5.t ++++ b/harness/cases/5.t +@@ -40,14 +40,14 @@ int test_main(void) + buf = mmap(0, page_size, PROT_WRITE, MAP_SHARED, rwfd, 0); + assert(buf != (char *)-1); + +- status |= attempt_rw(rwfd, buf, SIZE, 0, READ, SIZE); +- + /* Whether PROT_WRITE is readable is arch-dependent. So compare + * against read result. */ + res = read(rwfd, buf, SIZE); + if (res < 0) + res = -errno; +- status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, res); ++ status |= attempt_rw(rwfd, buf, SIZE, 0, READ, res); ++ ++ status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, SIZE); + + return status; + } +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0026-harness-Fix-PROT_WRITE-mmap-check.patch b/patches/upstream/0026-harness-Fix-PROT_WRITE-mmap-check.patch new file mode 100644 index 0000000..9f9c43c --- /dev/null +++ b/patches/upstream/0026-harness-Fix-PROT_WRITE-mmap-check.patch @@ -0,0 +1,46 @@ +From 711c0381798c85f3e25ea0ab503b24857850a762 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 04:42:42 +0200 +Subject: [PATCH libaio 26/28] harness: Fix PROT_WRITE mmap check + +This partially reverts commit d7f5065448efb49b2a26e728ff735e12ea05b62e. + +The actual problem in the original code was that read() was being used +to assert whether the buffer was readable, but the kernel was instead +reading from the file descriptor and then writing into the buffer, so +no EFAULT was being generated (on architectures that do so). + +We needed to use a write() so that the kernel would read from the +buffer. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/cases/5.t | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/harness/cases/5.t b/harness/cases/5.t +index 7d67562..b0a7c56 100644 +--- a/harness/cases/5.t ++++ b/harness/cases/5.t +@@ -41,13 +41,12 @@ int test_main(void) + assert(buf != (char *)-1); + + /* Whether PROT_WRITE is readable is arch-dependent. So compare +- * against read result. */ +- res = read(rwfd, buf, SIZE); ++ * against write() result (to make the kernel read from buf). */ ++ res = write(rwfd, buf, SIZE); + if (res < 0) + res = -errno; +- status |= attempt_rw(rwfd, buf, SIZE, 0, READ, res); +- +- status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, SIZE); ++ status |= attempt_rw(rwfd, buf, SIZE, 0, READ, SIZE); ++ status |= attempt_rw(rwfd, buf, SIZE, 0, WRITE, res); + + return status; + } +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0027-harness-Print-better-error-messages-on-error-conditi.patch b/patches/upstream/0027-harness-Print-better-error-messages-on-error-conditi.patch new file mode 100644 index 0000000..8fbe333 --- /dev/null +++ b/patches/upstream/0027-harness-Print-better-error-messages-on-error-conditi.patch @@ -0,0 +1,81 @@ +From 6cd92a8216afcd1d3f6ff90cc150ba150800b11d Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 21 Aug 2019 05:29:50 +0200 +Subject: [PATCH libaio 27/28] harness: Print better error messages on error + conditions in 22.t + +These should help diagnose problems when dealing with error failures. +In particular this helped distinguish the problem with io_pgetevents() +not being implemented and it failing due to the sigset_t layout bug. + +Signed-off-by: Guillem Jover +[JEM: fix up 80 columns violations] +Signed-off-by: Jeff Moyer +--- + harness/cases/22.t | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/harness/cases/22.t b/harness/cases/22.t +index b13024e..c47140d 100644 +--- a/harness/cases/22.t ++++ b/harness/cases/22.t +@@ -76,7 +76,7 @@ int test_main(void) + + ret = io_setup(1, &ctx); + if (ret) { +- printf("child: io_setup failed\n"); ++ printf("child: io_setup failed: %s\n", strerror(-ret)); + return 1; + } + +@@ -86,7 +86,7 @@ int test_main(void) + /* if poll isn't supported, skip the test */ + if (ret == -EINVAL) + return 3; +- printf("child: io_submit failed\n"); ++ printf("child: io_submit failed: %s\n", strerror(-ret)); + return 1; + } + +@@ -99,7 +99,8 @@ int test_main(void) + } while (ret == 0); + + if (ret != -EINTR) { +- printf("child: io_pgetevents did not set errno to EINTR\n"); ++ printf("child: io_pgetevents did not set errno to " ++ "EINTR: %s\n", strerror(-ret)); + return 1; + } + +@@ -117,7 +118,7 @@ int test_main(void) + + ret = io_setup(1, &ctx); + if (ret) { +- printf("parent: io_setup failed\n"); ++ printf("parent: io_setup failed: %s\n", strerror(-ret)); + return 1; + } + +@@ -126,7 +127,8 @@ int test_main(void) + /* if poll isn't supported, skip the test */ + if (ret == -EINVAL) + return 3; +- printf("parent: io_submit failed with %d\n", ret); ++ printf("parent: io_submit failed with %d: %s\n", ++ ret, strerror(-ret)); + return 1; + } + +@@ -134,7 +136,8 @@ int test_main(void) + + ret = io_pgetevents(ctx, 1, 1, &ev, NULL, &sigmask); + if (ret < 0) { +- printf("parent: io_pgetevents failed\n"); ++ printf("parent: io_pgetevents failed: %s\n", ++ strerror(-ret)); + return 1; + } + if (ret != 1) { +-- +2.26.0.292.g33ef6b2f38 + diff --git a/patches/upstream/0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch b/patches/upstream/0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch new file mode 100644 index 0000000..e6f1044 --- /dev/null +++ b/patches/upstream/0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch @@ -0,0 +1,47 @@ +From d2029c6693561b555723b228c9172fd2dc02646e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 21 Aug 2019 05:29:52 +0200 +Subject: [PATCH libaio 28/28] harness: Skip the test if io_pgetevents() is not + implemented + +Either the kernel or the syscall wrapper will return -ENOSYS when this +syscall is not implemented. So we should cope with this in the test +suite and SKIP the test case. + +This is currently the case for alpha and ia64, even though they have +already been wired up very recently in the kernel mainline. + +Signed-off-by: Guillem Jover +Signed-off-by: Jeff Moyer +--- + harness/cases/22.t | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/harness/cases/22.t b/harness/cases/22.t +index c47140d..d6a8986 100644 +--- a/harness/cases/22.t ++++ b/harness/cases/22.t +@@ -98,6 +98,10 @@ int test_main(void) + ret = io_pgetevents(ctx, 1, 1, &ev, &to, &sigmask); + } while (ret == 0); + ++ /* SKIP if the syscall has not been implemented. */ ++ if (ret == -ENOSYS) ++ return 3; ++ + if (ret != -EINTR) { + printf("child: io_pgetevents did not set errno to " + "EINTR: %s\n", strerror(-ret)); +@@ -135,6 +139,9 @@ int test_main(void) + kill(p, SIGUSR1); + + ret = io_pgetevents(ctx, 1, 1, &ev, NULL, &sigmask); ++ /* SKIP if the syscall has not been implemented. */ ++ if (ret == -ENOSYS) ++ return 3; + if (ret < 0) { + printf("parent: io_pgetevents failed: %s\n", + strerror(-ret)); +-- +2.26.0.292.g33ef6b2f38 + diff --git a/rules b/rules new file mode 100755 index 0000000..9010218 --- /dev/null +++ b/rules @@ -0,0 +1,48 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow +DEB_CFLAGS_MAINT_PREPEND = -Wall + +include /usr/share/dpkg/default.mk +include /usr/share/dpkg/buildtools.mk + +# The following architectures still fail the test suite: +# m68k +# (emulated, no proper test results) +# sh4 +# (emulated, no proper test results) +# x32 +# (20: io_setup failed) +# riscv64 +# (5: 512 instead of EFAULT on write) +# sparc64 +# (5: 512 instead of EFAULT on write) +# (19: mremap EINVAL) +# hppa +# (5: 512 instead of EFAULT on write) +# (19: mremap EINVAL) +# (17: looping, timeout?) +ifneq (,$(filter $(DEB_HOST_ARCH),m68k sh4 x32 riscv64 sparc64 hppa)) + TESTS_FLAKY = yes +endif + +export CC + +%: + dh $@ + +override_dh_auto_test: +ifeq ($(TESTS_FLAKY),yes) + @echo "Notice: Running tests in flaky mode, errors will be ignored." +endif + $(if $(TESTS_FLAKY),-)$(MAKE) partcheck \ + CPPFLAGS="$(CPPFLAGS)" \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" + +override_dh_auto_install: + dh_auto_install -- \ + libdir=/usr/lib/$(DEB_HOST_MULTIARCH) diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/tests/control b/tests/control new file mode 100644 index 0000000..a44d003 --- /dev/null +++ b/tests/control @@ -0,0 +1,7 @@ +Tests: test-unit +Restrictions: flaky rw-build-tree +Depends: build-essential, libaio-dev + +Tests: test-unit-root +Restrictions: flaky rw-build-tree needs-root +Depends: build-essential, libaio-dev diff --git a/tests/test-unit b/tests/test-unit new file mode 100755 index 0000000..dec4a6d --- /dev/null +++ b/tests/test-unit @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +exec 2>&1 +set -u +set -x + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CC="$DEB_HOST_GNU_TYPE-gcc" +else + CC=gcc +fi + +make partcheck CC="$CC" LIBAIO=-laio diff --git a/tests/test-unit-root b/tests/test-unit-root new file mode 100755 index 0000000..ba1fc9d --- /dev/null +++ b/tests/test-unit-root @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +exec 2>&1 +set -u +set -x + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CC="$DEB_HOST_GNU_TYPE-gcc" +else + CC=gcc +fi + +make check CC="$CC" LIBAIO=-laio diff --git a/upstream/metadata b/upstream/metadata new file mode 100644 index 0000000..1974a17 --- /dev/null +++ b/upstream/metadata @@ -0,0 +1,2 @@ +Repository: https://pagure.io/libaio.git +Repository-Browse: https://pagure.io/libaio diff --git a/watch b/watch new file mode 100644 index 0000000..3984695 --- /dev/null +++ b/watch @@ -0,0 +1,3 @@ +# Site Directory Pattern Version Script +version=4 +https://releases.pagure.org/libaio/libaio-([\d\.]+)\.tar\.(?:gz|xz) debian uupdate -- 2.30.2