From: Guillem Jover Date: Tue, 26 Feb 2019 04:26:21 +0000 (+0000) Subject: Import libaio_0.3.112-3.debian.tar.xz X-Git-Tag: archive/raspbian/0.3.112-13+rpi1~1^2^2^2~30^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5a282bbdd52fc281abf8b03c25bc3c4b924b41c7;p=libaio.git Import libaio_0.3.112-3.debian.tar.xz [dgit import tarball libaio 0.3.112-3 libaio_0.3.112-3.debian.tar.xz] --- 5a282bbdd52fc281abf8b03c25bc3c4b924b41c7 diff --git a/changelog b/changelog new file mode 100644 index 0000000..57e2c41 --- /dev/null +++ b/changelog @@ -0,0 +1,396 @@ +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/compat b/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/compat @@ -0,0 +1 @@ +11 diff --git a/control b/control new file mode 100644 index 0000000..3254130 --- /dev/null +++ b/control @@ -0,0 +1,56 @@ +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.3.0 +Rules-Requires-Root: no +Build-Depends: +# Needed for buildtools.mk fragment. + dpkg-dev (>= 1.19.0), + debhelper (>= 11), + +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.docs b/libaio-dev.docs new file mode 100644 index 0000000..1333ed7 --- /dev/null +++ b/libaio-dev.docs @@ -0,0 +1 @@ +TODO diff --git a/libaio-dev.install b/libaio-dev.install new file mode 100644 index 0000000..49d3492 --- /dev/null +++ b/libaio-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/lib*.so +usr/lib/*/lib*.a diff --git a/libaio-dev.manpages b/libaio-dev.manpages new file mode 100644 index 0000000..6fcf105 --- /dev/null +++ b/libaio-dev.manpages @@ -0,0 +1,9 @@ +man/io_fsync.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 diff --git a/libaio1-udeb.install b/libaio1-udeb.install new file mode 100644 index 0000000..3ddde58 --- /dev/null +++ b/libaio1-udeb.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* diff --git a/libaio1.install b/libaio1.install new file mode 100644 index 0000000..3ddde58 --- /dev/null +++ b/libaio1.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* 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-harness-Use-destination-strncpy-expression-for-sizeo.patch b/patches/0001-harness-Use-destination-strncpy-expression-for-sizeo.patch new file mode 100644 index 0000000..fa3b59e --- /dev/null +++ b/patches/0001-harness-Use-destination-strncpy-expression-for-sizeo.patch @@ -0,0 +1,52 @@ +From ad2cdc64cd2953288f4cccadbf448e1bbf9ab338 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 9 Feb 2019 00:25:38 +0100 +Subject: [PATCH 1/7] 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 +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0001-man-Add-missing-space-in-man-page-references.patch b/patches/0001-man-Add-missing-space-in-man-page-references.patch new file mode 100644 index 0000000..765e504 --- /dev/null +++ b/patches/0001-man-Add-missing-space-in-man-page-references.patch @@ -0,0 +1,467 @@ +From 82725960523a81055cb2f21967c9976362663278 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:40:01 +0200 +Subject: [PATCH 01/15] man: Add missing space in man page references + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0002-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch b/patches/0002-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch new file mode 100644 index 0000000..cf0b0bb --- /dev/null +++ b/patches/0002-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch @@ -0,0 +1,115 @@ +From ce13c8eb716beec3b6a83285a6295212cbf3ce80 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sat, 9 Feb 2019 00:28:53 +0100 +Subject: [PATCH 2/7] 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 +--- + harness/Makefile | 2 +- + harness/cases/18.t | 34 ++++++++++++++++++++++++---------- + 2 files changed, 25 insertions(+), 11 deletions(-) + +diff --git a/harness/Makefile b/harness/Makefile +index f477737..a3c3b46 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,7 +6,7 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-MK_CPPFLAGS := -I../src -DPAGE_SIZE=$(shell getconf PAGESIZE) $(CPPFLAGS) ++MK_CPPFLAGS := -I../src $(CPPFLAGS) + CFLAGS = -Wall -g -O2 + #-lpthread -lrt + MK_CFLAGS = $(CFLAGS) +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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0002-man-Use-the-correct-troff-macro-for-comments.patch b/patches/0002-man-Use-the-correct-troff-macro-for-comments.patch new file mode 100644 index 0000000..f7f0c66 --- /dev/null +++ b/patches/0002-man-Use-the-correct-troff-macro-for-comments.patch @@ -0,0 +1,203 @@ +From eb2b0e1a49cf2c3b606b7467899812ebd622abed Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:46:13 +0200 +Subject: [PATCH 02/15] man: Use the correct troff macro for comments + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0003-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-SYS_.patch b/patches/0003-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-SYS_.patch new file mode 100644 index 0000000..fa2078d --- /dev/null +++ b/patches/0003-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-SYS_.patch @@ -0,0 +1,37 @@ +From 42e252f5fd42f147559452a781b5bb851ff0f40a Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 26 Feb 2019 01:45:15 +0100 +Subject: [PATCH 3/7] harness: Make RISC-V use SYS_eventfd2 instead of + 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 +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0003-man-Refer-to-libaio.h-instead-of-libio.h.patch b/patches/0003-man-Refer-to-libaio.h-instead-of-libio.h.patch new file mode 100644 index 0000000..04433e8 --- /dev/null +++ b/patches/0003-man-Refer-to-libaio.h-instead-of-libio.h.patch @@ -0,0 +1,35 @@ +From 183d0f60be9e0bfcb987b03818868351364cd54d Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:47:46 +0200 +Subject: [PATCH 03/15] man: Refer to libaio.h instead of libio.h + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0004-harness-Add-fallback-code-for-filesystems-not-suppor.patch b/patches/0004-harness-Add-fallback-code-for-filesystems-not-suppor.patch new file mode 100644 index 0000000..9b9b55b --- /dev/null +++ b/patches/0004-harness-Add-fallback-code-for-filesystems-not-suppor.patch @@ -0,0 +1,74 @@ +From 67bec1779c8232f37f68b4ad17865427003b3f35 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 26 Feb 2019 02:55:40 +0100 +Subject: [PATCH 4/7] 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 +--- + harness/cases/17.t | 2 ++ + harness/cases/18.t | 2 ++ + harness/cases/19.t | 4 ++++ + harness/cases/21.t | 2 +- + 4 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/harness/cases/17.t b/harness/cases/17.t +index 38ada4d..10c6b9c 100644 +--- a/harness/cases/17.t ++++ b/harness/cases/17.t +@@ -138,6 +138,8 @@ void run_test(int max_ios, int getevents_type) + + unlink(filename); + fd = open(filename, O_CREAT | O_RDWR | O_DIRECT, 0644); ++ if (fd < 0 && errno == EINVAL) ++ fd = open(filename, O_CREAT | O_RDWR, 0644); + assert(fd >= 0); + + ret = ftruncate(fd, max_ios * io_size); +diff --git a/harness/cases/18.t b/harness/cases/18.t +index daa1d26..d58f99b 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) ++ fd = open(FILENAME, O_RDONLY); + assert(fd >= 0); + + for (i = 0; i < 1000; i++) { +diff --git a/harness/cases/19.t b/harness/cases/19.t +index 5c3e0d6..aad9bdb 100644 +--- a/harness/cases/19.t ++++ b/harness/cases/19.t +@@ -43,6 +43,10 @@ open_temp_file(void) + + strncpy(template, TEMPLATE, sizeof(template)); + fd = mkostemp(template, O_DIRECT); ++ if (fd < 0 && errno == EINVAL) { ++ strncpy(template, TEMPLATE, sizeof(template)); ++ fd = mkstemp(template); ++ } + if (fd < 0) { + perror("mkstemp"); + exit(1); +diff --git a/harness/cases/21.t b/harness/cases/21.t +index fe33a9d..c1370fd 100644 +--- a/harness/cases/21.t ++++ b/harness/cases/21.t +@@ -92,7 +92,7 @@ test_main() + */ + flags = fcntl(fd, F_GETFL); + ret = fcntl(fd, F_SETFL, flags | O_DIRECT); +- if (ret != 0) { ++ if (ret != 0 && errno != EINVAL) { + perror("fcntl"); + return 1; + } +-- +2.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0004-man-End-sentences-with-a-period.patch b/patches/0004-man-End-sentences-with-a-period.patch new file mode 100644 index 0000000..441bd3b --- /dev/null +++ b/patches/0004-man-End-sentences-with-a-period.patch @@ -0,0 +1,133 @@ +From 0abb26053c5d814510e97e08ced56742f0044eeb Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 04/15] man: End sentences with a period + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch b/patches/0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch new file mode 100644 index 0000000..931a360 --- /dev/null +++ b/patches/0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch @@ -0,0 +1,34 @@ +From 649fc347f191bc228fe3509b2a2d0651f09ebf2f Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 26 Feb 2019 02:57:05 +0100 +Subject: [PATCH 5/7] 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 +--- + harness/cases/21.t | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/harness/cases/21.t b/harness/cases/21.t +index c1370fd..2b39eff 100644 +--- a/harness/cases/21.t ++++ b/harness/cases/21.t +@@ -105,10 +105,11 @@ test_main() + ret = io_submit(ctx, 1, &iocbp); + + /* +- * io_submit will return -EINVAL if RWF_NOWAIT is not supported. ++ * io_submit will return -EINVAL or -ENOTSUP if RWF_NOWAIT is not ++ * supported. + */ + if (ret != 1) { +- if (ret == -EINVAL) { ++ if (ret == -EINVAL || ret == -ENOTSUP) { + fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n"); + /* just return success */ + return 0; +-- +2.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0005-man-Fix-casing.patch b/patches/0005-man-Fix-casing.patch new file mode 100644 index 0000000..1e2a45e --- /dev/null +++ b/patches/0005-man-Fix-casing.patch @@ -0,0 +1,54 @@ +From bb54864ec53ee1f2c1f2533b8988ee69ffcd6f90 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 05/15] man: Fix casing + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0006-harness-The-WRITE-call-does-not-change-across-differ.patch b/patches/0006-harness-The-WRITE-call-does-not-change-across-differ.patch new file mode 100644 index 0000000..65a7a19 --- /dev/null +++ b/patches/0006-harness-The-WRITE-call-does-not-change-across-differ.patch @@ -0,0 +1,33 @@ +From 6f7f780b5a9ae3ce80de3caa5fc7d8a53c40661e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 26 Feb 2019 02:09:22 +0100 +Subject: [PATCH 6/7] harness: The WRITE call does not change across different + arches anymore + +Signed-off-by: Guillem Jover +--- + harness/cases/5.t | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/harness/cases/5.t b/harness/cases/5.t +index 2b4b4bb..322564a 100644 +--- a/harness/cases/5.t ++++ b/harness/cases/5.t +@@ -41,13 +41,7 @@ int test_main(void) + 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, WRITE, SIZE); + + return status; + } +-- +2.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0006-man-Fix-period-formatting.patch b/patches/0006-man-Fix-period-formatting.patch new file mode 100644 index 0000000..f2596c8 --- /dev/null +++ b/patches/0006-man-Fix-period-formatting.patch @@ -0,0 +1,211 @@ +From 9e6d0631a0a1094bc4082550664490230f0257e0 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 06/15] man: Fix period formatting + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0007-harness-Make-the-test-exit-with-a-code-matching-the-.patch b/patches/0007-harness-Make-the-test-exit-with-a-code-matching-the-.patch new file mode 100644 index 0000000..0453e4c --- /dev/null +++ b/patches/0007-harness-Make-the-test-exit-with-a-code-matching-the-.patch @@ -0,0 +1,36 @@ +From 6649e73243e8167821d6aefd5f83343b85c2980b Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 26 Feb 2019 03:07:28 +0100 +Subject: [PATCH 7/7] 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. +--- + harness/runtests.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/harness/runtests.sh b/harness/runtests.sh +index 717c72a..d7fd247 100755 +--- a/harness/runtests.sh ++++ b/harness/runtests.sh +@@ -3,7 +3,7 @@ + passes=0 + fails=0 + +-echo "Test run starting at" `date` ++echo "Test run starting at $(date)" + + while [ $# -ge 1 ] ; do + this_test=$1 +@@ -16,4 +16,6 @@ while [ $# -ge 1 ] ; do + done + + echo "Pass: $passes Fail: $fails" +-echo "Test run complete at" `date` ++echo "Test run complete at $(date)" ++ ++exit $fails +-- +2.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0007-man-Remove-spurious-spaces.patch b/patches/0007-man-Remove-spurious-spaces.patch new file mode 100644 index 0000000..8d02955 --- /dev/null +++ b/patches/0007-man-Remove-spurious-spaces.patch @@ -0,0 +1,54 @@ +From f8d3e59b6ff6a26f36efa611d956bcc2e03c7ee7 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 07/15] man: Remove spurious spaces + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0008-man-Remove-spurious-text.patch b/patches/0008-man-Remove-spurious-text.patch new file mode 100644 index 0000000..a11148b --- /dev/null +++ b/patches/0008-man-Remove-spurious-text.patch @@ -0,0 +1,54 @@ +From a1b19f2b9806c1585bab7ecc7ffb3df477498dce Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 8 Feb 2019 22:31:15 +0100 +Subject: [PATCH 08/15] man: Remove spurious text + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0009-man-Add-None-to-empty-sections.patch b/patches/0009-man-Add-None-to-empty-sections.patch new file mode 100644 index 0000000..4f0c1e5 --- /dev/null +++ b/patches/0009-man-Add-None-to-empty-sections.patch @@ -0,0 +1,27 @@ +From 6d39d8f03e277b459d05b8d22f0baf0d496037f2 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 09/15] man: Add "None" to empty sections + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0010-man-Fix-typos.patch b/patches/0010-man-Fix-typos.patch new file mode 100644 index 0000000..bfb6f1a --- /dev/null +++ b/patches/0010-man-Fix-typos.patch @@ -0,0 +1,212 @@ +From d91ef01a7ab8c00b9a068e14669dc19c4f2539ec Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 13 Aug 2017 20:36:23 +0200 +Subject: [PATCH 10/15] man: Fix typos + +Signed-off-by: Guillem Jover +--- + 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0011-man-Fix-title-header.patch b/patches/0011-man-Fix-title-header.patch new file mode 100644 index 0000000..70522cf --- /dev/null +++ b/patches/0011-man-Fix-title-header.patch @@ -0,0 +1,179 @@ +From cdc581ebea3a745ca7c43130a1c0ec5366fa2b19 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 10 Dec 2017 20:20:04 +0100 +Subject: [PATCH 11/15] 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 +--- + 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..52f0ab3 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 2017-12-10 "Linux" "Linux AIO" + .SH NAME + io \- Asynchronous IO + .SH SYNOPSIS +diff --git a/man/io_cancel.3 b/man/io_cancel.3 +index 261a407..62272c7 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 2017-12-10 "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..6938f6b 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 2017-12-10 "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..fd67929 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 2017-12-10 "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..7b6dd4b 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 2017-12-10 "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..a0508d7 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 2017-12-10 "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..8ce96ce 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 2017-12-10 "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..b09da50 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 2017-12-10 "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..d6d5def 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 2017-12-10 "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..ff6eb78 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 2017-12-10 "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..dedfcdd 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 2017-12-10 "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..e8d8e60 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 2017-12-10 "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..953246c 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 2017-12-10 "Linux" "Linux AIO" + .SH NAME + io_submit \- Submit io requests + .SH SYNOPSIS +-- +2.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0012-man-Fix-markup.patch b/patches/0012-man-Fix-markup.patch new file mode 100644 index 0000000..ee5e3bb --- /dev/null +++ b/patches/0012-man-Fix-markup.patch @@ -0,0 +1,798 @@ +From 469e352950fd873e028f7611aa4bea7ea2ca7521 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 10 Dec 2017 20:22:11 +0100 +Subject: [PATCH 12/15] 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 +--- + 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 52f0ab3..bbb0a2d 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 62272c7..25dfec4 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 6938f6b..ec3ab0a 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 fd67929..623752c 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 7b6dd4b..61e8850 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 a0508d7..72463f7 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 8ce96ce..f41d4f5 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 b09da50..33c907f 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 d6d5def..879d894 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 ff6eb78..05e188a 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 dedfcdd..96b61f7 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 e8d8e60..26a0cd0 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 953246c..587045b 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0013-man-Fold-short-lines.patch b/patches/0013-man-Fold-short-lines.patch new file mode 100644 index 0000000..c8f47b3 --- /dev/null +++ b/patches/0013-man-Fold-short-lines.patch @@ -0,0 +1,54 @@ +From 312d88fe494adc12737a6019d917be9fba757b8e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 8 Feb 2019 22:45:18 +0100 +Subject: [PATCH 13/15] man: Fold short lines + +Signed-off-by: Guillem Jover +--- + 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 61e8850..31cc9c5 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 587045b..7f4e27a 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0014-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch b/patches/0014-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch new file mode 100644 index 0000000..dbd5c8a --- /dev/null +++ b/patches/0014-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch @@ -0,0 +1,60 @@ +From 91cfb8e29f999a5eb72f256cf9649d1c71ccabe7 Mon Sep 17 00:00:00 2001 +From: Stephan Springl +Date: Sat, 9 Feb 2019 00:03:54 +0100 +Subject: [PATCH 14/15] man: Escape verbatim \n in order to make it through + roff + +Signed-off-by: Guillem Jover +--- + man/io.3 | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index bbb0a2d..2840bc7 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.21.0.rc2.261.ga7da99ff1b + diff --git a/patches/0015-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch b/patches/0015-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch new file mode 100644 index 0000000..45c5eb6 --- /dev/null +++ b/patches/0015-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch @@ -0,0 +1,132 @@ +From 6eb4eab6a70b5ee0f549b9f0086a76becbe3d4ec Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 8 Feb 2019 23:37:58 +0100 +Subject: [PATCH 15/15] Use ctx consistently for io_context_t instead of ctx_id + +Signed-off-by: Guillem Jover +--- + 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(-) + +--- a/man/io_cancel.3 ++++ b/man/io_cancel.3 +@@ -46,7 +46,7 @@ If any of the data structures pointed to + If + .I aio_context + specified by +-.I ctx_id ++.I ctx + is invalid. + .TP + .B EAGAIN +--- 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 +--- a/man/io_queue_run.3 ++++ b/man/io_queue_run.3 +@@ -16,7 +16,7 @@ io_queue_run \- Handle completed io requ + .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 +--- a/man/io_queue_wait.3 ++++ b/man/io_queue_wait.3 +@@ -15,7 +15,7 @@ io_queue_wait \- Wait for io requests to + .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 +--- 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 +--- 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 + + /* 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); + } + +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -168,8 +168,8 @@ extern int io_setup(int maxevents, io_co + 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); + +--- a/src/vsys_def.h ++++ b/src/vsys_def.h +@@ -20,5 +20,5 @@ extern int vsys_io_destroy(io_context_t + 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); + diff --git a/patches/00_arches.patch b/patches/00_arches.patch new file mode 100644 index 0000000..a0b801c --- /dev/null +++ b/patches/00_arches.patch @@ -0,0 +1,135 @@ +Description: Add/fix support for m68k, mips, paris, sparc +Author: Guillem Jover +Origin: vendor +Forwarded: no +Last-Update: 2014-10-09 + + +--- + harness/main.c | 10 +++++++++ + src/libaio.h | 1 + src/syscall-m68k.h | 5 ++++ + src/syscall-mips.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/syscall-parisc.h | 6 +++++ + src/syscall.h | 6 +++++ + 6 files changed, 82 insertions(+) + +--- /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 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -27,6 +27,12 @@ + #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__) ++#include "syscall-mips.h" + #elif defined(__aarch64__) || defined(__riscv) + #include "syscall-generic.h" + #else +--- /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 */ +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -72,6 +72,7 @@ typedef enum io_iocb_cmd { + + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ ++ (defined(__hppa__) && defined(__arch64__)) || \ + (defined(__sparc__) && defined(__arch64__)) || \ + (defined(__aarch64__) && defined(__AARCH64EB__)) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ +--- /dev/null ++++ b/src/syscall-parisc.h +@@ -0,0 +1,6 @@ ++#define __NR_Linux 0 ++#define __NR_io_setup (__NR_Linux + 215) ++#define __NR_io_destroy (__NR_Linux + 216) ++#define __NR_io_getevents (__NR_Linux + 217) ++#define __NR_io_submit (__NR_Linux + 218) ++#define __NR_io_cancel (__NR_Linux + 219) +--- a/harness/main.c ++++ b/harness/main.c +@@ -12,7 +12,17 @@ + #include + + #if __LP64__ == 0 ++#if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) ++#elif defined(__arm__) || defined(__m68k__) || 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 ++#error Unknown kernel memory address. ++#endif + #else + //#warning Not really sure where kernel memory is. Guessing. + #define KERNEL_RW_POINTER ((void *)0xffffffff81000000) diff --git a/patches/00_arches_mips_fix_padding.patch b/patches/00_arches_mips_fix_padding.patch new file mode 100644 index 0000000..4e0a118 --- /dev/null +++ b/patches/00_arches_mips_fix_padding.patch @@ -0,0 +1,38 @@ +Description: Fix structure padding for mips64 +Author: Guillem Jover +Forwarded: no +Last-Update: 2014-07-23 + + +--- + src/libaio.h | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -53,7 +53,8 @@ typedef enum io_iocb_cmd { + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ + (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ +- defined(__bfin__) || defined(__MIPSEL__) || \ ++ 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) +@@ -63,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__) && \ +@@ -75,6 +77,7 @@ typedef enum io_iocb_cmd { + #elif defined(__powerpc64__) || defined(__s390x__) || \ + (defined(__hppa__) && defined(__arch64__)) || \ + (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/patches/00_arches_sh.patch b/patches/00_arches_sh.patch new file mode 100644 index 0000000..b888636 --- /dev/null +++ b/patches/00_arches_sh.patch @@ -0,0 +1,66 @@ +Author: Nobuhiro Iwamatsu +Description: Add SH supprt + The test-suite logs can be found at: + . + + + +--- + harness/main.c | 2 +- + src/libaio.h | 4 +++- + src/syscall-sh.h | 6 ++++++ + src/syscall.h | 2 ++ + 4 files changed, 12 insertions(+), 2 deletions(-) + + +--- 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) +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,7 +52,8 @@ 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(__LITTLE_ENDIAN__)) || \ ++ defined(__bfin__) || defined(__MIPSEL__) || \ + defined(__cris__) || (defined(__riscv) && __riscv_xlen == 32) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ + __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4) +@@ -84,6 +85,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__) && \ +--- /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 +--- 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 diff --git a/patches/00_arches_x32.patch b/patches/00_arches_x32.patch new file mode 100644 index 0000000..75d3566 --- /dev/null +++ b/patches/00_arches_x32.patch @@ -0,0 +1,42 @@ +Description: Add support for x32 (from the Yocto project) +Author: Daniel Schepler +Origin: vendor +Forwarded: no +Bug-Debian: 702183 +Last-Update: 2013-05-06 + + +--- + harness/main.c | 2 +- + src/syscall-x86_64.h | 10 ++++++++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +--- a/src/syscall-x86_64.h ++++ b/src/syscall-x86_64.h +@@ -1,5 +1,15 @@ ++#ifndef __NR_io_setup + #define __NR_io_setup 206 ++#endif ++#ifndef __NR_io_destroy + #define __NR_io_destroy 207 ++#endif ++#ifndef __NR_io_getevents + #define __NR_io_getevents 208 ++#endif ++#ifndef __NR_io_submit + #define __NR_io_submit 209 ++#endif ++#ifndef __NR_io_cancel + #define __NR_io_cancel 210 ++#endif +--- 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/patches/01_link_libs.patch b/patches/01_link_libs.patch new file mode 100644 index 0000000..86e9cb3 --- /dev/null +++ b/patches/01_link_libs.patch @@ -0,0 +1,31 @@ +Description: Link against libgcc and libc to avoid unresolved symbols + We need to link agaisnt -lgcc, on at least hppa. We also need to link + against -lc, because we are now always using the syscall() libc function. + So let's stop passing -nostdlib and -nostartfiles. + . + Note: we used to use -Wl,--as-needed, this way we made sure we pulled the + required fortified functions from the internal libc_nonshared.a, but did + not link against the shared library because we did not use any of its + symbols. +Author: Guillem Jover +Origin: vendor +Bug-Debian: 764509 +Forwarded: no +Last-Update: 2014-10-09 + + +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- 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= diff --git a/patches/02_libdevdir.patch b/patches/02_libdevdir.patch new file mode 100644 index 0000000..cc364ae --- /dev/null +++ b/patches/02_libdevdir.patch @@ -0,0 +1,70 @@ +Description: Fix installation of shared vs static libraries +Author: Guillem Jover +Origin: vendor +Forwarded: no +Last-Update: 2007-09-11 + + +--- + Makefile | 10 +++++++++- + src/Makefile | 12 +++++++----- + 2 files changed, 16 insertions(+), 6 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -4,9 +4,11 @@ VERSION=$(shell awk '/Version:/ { print + TAG = $(NAME)-$(VERSION) + RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") + ++DESTDIR= + prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib ++libdevdir=$(libdir) + + default: all + +@@ -14,7 +16,13 @@ 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) \ ++ libdevdir=$(libdevdir) \ ++ $(nil) + + check: + @$(MAKE) -C harness check +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,6 +1,8 @@ ++DESTDIR= + prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib ++libdevdir=$(libdir) + + CFLAGS ?= -g -fomit-frame-pointer -O2 + CFLAGS += -Wall -I. -fPIC +@@ -58,12 +60,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)$(libdevdir)/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)$(libdevdir)/libaio.so + endif + + $(libaio_objs): libaio.h diff --git a/patches/04_no_Werror.patch b/patches/04_no_Werror.patch new file mode 100644 index 0000000..cf755df --- /dev/null +++ b/patches/04_no_Werror.patch @@ -0,0 +1,24 @@ +Description: Fix FTBFS with newer gcc 4.6 + 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. +Author: Guillem Jover +Origin: vendor +Forwarded: no +Last-Update: 2014-10-09 + + +--- + 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 -DPAGE_SIZE=$(shell getconf PAGESIZE) ++CFLAGS+=-Wall -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE) + #-lpthread -lrt + + all: $(PROGS) diff --git a/patches/05_build-flags.patch b/patches/05_build-flags.patch new file mode 100644 index 0000000..4f8c6b7 --- /dev/null +++ b/patches/05_build-flags.patch @@ -0,0 +1,79 @@ +Description: 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 of the user flags are passed. +Author: Guillem Jover +Origin: vendor +Forwarded: no +Last-Update: 2014-10-09 + + +--- + harness/Makefile | 7 +++++-- + src/Makefile | 18 +++++++++--------- + 2 files changed, 14 insertions(+), 11 deletions(-) + +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,13 +6,16 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-CFLAGS+=-Wall -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE) ++MK_CPPFLAGS := -I../src -DPAGE_SIZE=$(shell getconf PAGESIZE) $(CPPFLAGS) ++CFLAGS = -Wall -g -O2 + #-lpthread -lrt ++MK_CFLAGS = $(CFLAGS) ++MK_LDFLAGS = main.c ../src/libaio.a -lpthread $(LDFLAGS) + + all: $(PROGS) + + $(PROGS): %.p: %.t $(HARNESS_SRCS) +- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a -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 +@@ -4,12 +4,12 @@ includedir=$(prefix)/include + libdir=$(prefix)/lib + libdevdir=$(libdir) + +-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 +@@ -44,10 +44,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 +@@ -57,7 +57,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..ebb2554 --- /dev/null +++ b/patches/series @@ -0,0 +1,34 @@ +00_arches.patch +00_arches_sh.patch +00_arches_x32.patch +00_arches_mips_fix_padding.patch +# Build system +01_link_libs.patch +02_libdevdir.patch +04_no_Werror.patch +05_build-flags.patch +# Harness fixes +0001-harness-Use-destination-strncpy-expression-for-sizeo.patch +0002-harness-Use-run-time-_SC_PAGE_SIZE-instead-of-build-.patch +0003-harness-Make-RISC-V-use-SYS_eventfd2-instead-of-SYS_.patch +0004-harness-Add-fallback-code-for-filesystems-not-suppor.patch +0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch +0006-harness-The-WRITE-call-does-not-change-across-differ.patch +# XXX: The test suite is not ready to pass on Debian's peculiar buildd setup. +#0007-harness-Make-the-test-exit-with-a-code-matching-the-.patch +# Man pages fixes +0001-man-Add-missing-space-in-man-page-references.patch +0002-man-Use-the-correct-troff-macro-for-comments.patch +0003-man-Refer-to-libaio.h-instead-of-libio.h.patch +0004-man-End-sentences-with-a-period.patch +0005-man-Fix-casing.patch +0006-man-Fix-period-formatting.patch +0007-man-Remove-spurious-spaces.patch +0008-man-Remove-spurious-text.patch +0009-man-Add-None-to-empty-sections.patch +0010-man-Fix-typos.patch +0011-man-Fix-title-header.patch +0012-man-Fix-markup.patch +0013-man-Fold-short-lines.patch +0014-man-Escape-verbatim-n-in-order-to-make-it-through-ro.patch +0015-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch diff --git a/rules b/rules new file mode 100755 index 0000000..466a065 --- /dev/null +++ b/rules @@ -0,0 +1,78 @@ +#!/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 + +export CC + +lib := libaio1 +libudeb := $(lib)-udeb + +build-indep: + +build-arch: + dh_testdir + + $(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" + +build: build-indep build-arch + +clean: + dh_testdir + dh_testroot + + $(MAKE) clean + + dh_clean + +check-arch: build-arch + dh_testdir + +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + $(MAKE) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + partcheck +endif + +install-arch: check-arch + dh_testdir + dh_testroot + dh_clean + dh_installdirs + + $(MAKE) install \ + DESTDIR=$(CURDIR)/debian/tmp \ + libdir=/usr/lib/$(DEB_HOST_MULTIARCH) + +binary: binary-indep binary-arch + +binary-indep: + # Nothing to do. + +binary-arch: install-arch + dh_testdir + dh_testroot + dh_install -a + dh_installchangelogs -a ChangeLog + dh_installdocs -a + dh_installexamples -a + dh_installman -a + dh_lintian -a + dh_link -a + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs -a --add-udeb '$(libudeb)' + dh_shlibdeps -a + dh_installdeb -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +.PHONY: clean build-indep build-arch build +.PHONY: install-arch binary-indep binary-arch binary 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/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