--- /dev/null
+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 <guillem@debian.org> 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 <sedat.dilek@gmail.com>.
+ * 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 <guillem@debian.org> 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 <Jurica.Stanojkovic@rt-rk.com>.
+ * Add mips64 support. Reported by Jeremy Fitzhardinge <jeremy@exablox.com>.
+
+ -- Guillem Jover <guillem@debian.org> 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 <dschepler@gmail.com>.
+ * Add support for arm64 (stolen from upstream). (Closes: #702409)
+ Thanks to Ian Campbell <ijc@hellion.org.uk>.
+ * Add cross-compilation support.
+ Based on a patch by Ian Campbell <ijc@hellion.org.uk>.
+ * Update debian/watch file to a working URL.
+
+ -- Guillem Jover <guillem@debian.org> 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 <springl-libaio@bfw-online.de>.
+ * 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 <guillem@debian.org> 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 <guillem@debian.org> 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-<arch>.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 <guillem@debian.org> 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 <iwamatsu@nigauri.org>.
+ * Now using Standards-Version 3.8.3 (no changes needed).
+
+ -- Guillem Jover <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <jpalecek@web.de>.
+
+ -- Guillem Jover <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <vorlon@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <debian-bugs@hrw.one.pl>.
+
+ -- Guillem Jover <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> 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 <guillem@debian.org> Thu, 24 Aug 2006 05:45:36 +0300
+
+libaio (0.3.104-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- William Lee Irwin III <wli@holomorphy.com> Fri, 22 Apr 2005 14:49:28 -0700
--- /dev/null
+Source: libaio
+Maintainer: Guillem Jover <guillem@debian.org>
+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://fedorahosted.org/releases/l/i/libaio/
+Build-Depends: debhelper (>= 9.20150811)
+Standards-Version: 3.9.8
+
+Package: libaio1
+Architecture: linux-any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc: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: ${shlibs:Depends}, ${misc: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
+Depends: libaio1 (= ${binary:Version}), ${misc:Depends}
+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.
--- /dev/null
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: libaio
+Upstream-Contact: Jeff Moyer <jmoyer@redhat.com>
+Source: https://git.fedorahosted.org/cgit/libaio.git
+
+Files: *
+Copyright:
+ Copyright © 2002-2003 Benjamin LaHaise <bcrl@redhat.com>
+ Copyright © 2003-2004 Jeff Moyer <jmoyer@redhat.com>
+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 <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License can be found in '/usr/share/common-licenses/LGPL-2.1'.
--- /dev/null
+usr/include
+usr/lib/*/lib*.so
+usr/lib/*/lib*.a
--- /dev/null
+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
--- /dev/null
+lib/*/lib*.so.*
--- /dev/null
+lib/*/lib*.so.*
--- /dev/null
+libaio1: shared-lib-without-dependency-information lib/*/libaio.so.1.0.1
--- /dev/null
+libaio.so.1 libaio1 #MINVER#
+ (symver)LIBAIO_0.1 0.3.9
+ (symver)LIBAIO_0.4 0.3.93
--- /dev/null
+Description: Add/fix support for m68k, mips, paris, sparc
+Author: Guillem Jover <guillem@debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-09
+
+
+---
+ harness/main.c | 10 ++
+ src/libaio.h | 1
+ src/syscall-m68k.h | 78 +++++++++++++++++
+ src/syscall-mips.h | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall-parisc.h | 146 +++++++++++++++++++++++++++++++++
+ src/syscall-sparc.h | 20 +++-
+ src/syscall.h | 6 +
+ 7 files changed, 479 insertions(+), 5 deletions(-)
+
+--- /dev/null
++++ b/src/syscall-m68k.h
+@@ -0,0 +1,78 @@
++#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
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a) ); \
++return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a,btype b) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a,btype b,ctype c) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname (atype a, btype b, ctype c, dtype d) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++register long __e __asm__ ("%d5") = (long)(e); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d), "d" (__e) \
++ ); \
++return (type) __res; \
++}
++
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -28,6 +28,12 @@
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+ #include "syscall-arm64.h"
++#elif defined(__m68k__)
++#include "syscall-m68k.h"
++#elif defined(__hppa__)
++#include "syscall-parisc.h"
++#elif defined(__mips__)
++#include "syscall-mips.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
+--- /dev/null
++++ b/src/syscall-mips.h
+@@ -0,0 +1,223 @@
++/*
++ * 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.
++ *
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
++ */
++
++#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 */
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %3\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a, btype b) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %4\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a, btype b, ctype c) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname(atype a, btype b, ctype c, dtype d) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
++
++/*
++ * Using those means your brain needs more than an oil change ;-)
++ */
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "lw\t$2, %6\n\t" \
++ "subu\t$29, 32\n\t" \
++ "sw\t$2, 16($29)\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ "addiu\t$29, 32\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
++ "m" ((unsigned long)e) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
++
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ register unsigned long __a4 asm("$8") = (unsigned long) e; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %6\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
++ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
++
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -66,6 +66,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__))
+ #define PADDED(x, y) unsigned y; x
+--- /dev/null
++++ b/src/syscall-parisc.h
+@@ -0,0 +1,146 @@
++/*
++ * Linux system call numbers.
++ *
++ * Cary Coutant says that we should just use another syscall gateway
++ * page to avoid clashing with the HPUX space, and I think he's right:
++ * it will would keep a branch out of our syscall entry path, at the
++ * very least. If we decide to change it later, we can ``just'' tweak
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
++ * 1024 or something. Oh, and recompile libc. =)
++ *
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
++ * from the kernel at startup, which seems a sane strategy.
++ */
++
++#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)
++
++#define SYS_ify(syscall_name) __NR_##syscall_name
++
++/* Assume all syscalls are done from PIC code just to be
++ * safe. The worst case scenario is that you lose a register
++ * and save/restore r19 across the syscall. */
++#define PIC
++
++/* Definition taken from glibc 2.3.3
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
++ */
++
++#ifdef PIC
++/* WARNING: CANNOT BE USED IN A NOP! */
++# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
++# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
++# define K_USING_GR4 "%r4",
++#else
++# define K_STW_ASM_PIC " \n"
++# define K_LDW_ASM_PIC " \n"
++# define K_USING_GR4
++#endif
++
++/* GCC has to be warned that a syscall may clobber all the ABI
++ registers listed as "caller-saves", see page 8, Table 2
++ in section 2.2.6 of the PA-RISC RUN-TIME architecture
++ document. However! r28 is the result and will conflict with
++ the clobber list so it is left out. Also the input arguments
++ registers r20 -> r26 will conflict with the list so they
++ are treated specially. Although r19 is clobbered by the syscall
++ we cannot say this because it would violate ABI, thus we say
++ r4 is clobbered and use that register to save/restore r19
++ across the syscall. */
++
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
++ "%r20", "%r29", "%r31"
++
++#undef K_INLINE_SYSCALL
++#define K_INLINE_SYSCALL(name, nr, args...) ({ \
++ long __sys_res; \
++ { \
++ register unsigned long __res __asm__("r28"); \
++ K_LOAD_ARGS_##nr(args) \
++ /* FIXME: HACK stw/ldw r19 around syscall */ \
++ __asm__ volatile( \
++ K_STW_ASM_PIC \
++ " ble 0x100(%%sr2, %%r0)\n" \
++ " ldi %1, %%r20\n" \
++ K_LDW_ASM_PIC \
++ : "=r" (__res) \
++ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
++ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
++ ); \
++ __sys_res = (long)__res; \
++ } \
++ __sys_res; \
++})
++
++#define K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_1(r26) \
++ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
++ K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_2(r26,r25) \
++ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
++ K_LOAD_ARGS_1(r26)
++#define K_LOAD_ARGS_3(r26,r25,r24) \
++ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
++ K_LOAD_ARGS_2(r26,r25)
++#define K_LOAD_ARGS_4(r26,r25,r24,r23) \
++ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
++ K_LOAD_ARGS_3(r26,r25,r24)
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \
++ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
++ K_LOAD_ARGS_4(r26,r25,r24,r23)
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
++ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
++ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
++
++/* Even with zero args we use r20 for the syscall number */
++#define K_ASM_ARGS_0
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
++
++/* The registers not listed as inputs but clobbered */
++#define K_CLOB_ARGS_6
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++ return K_INLINE_SYSCALL(sname, 1, arg1); \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1, type2 arg2) \
++{ \
++ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1, type2 arg2, type3 arg3) \
++{ \
++ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \
++}
++
+--- a/harness/main.c
++++ b/harness/main.c
+@@ -12,7 +12,17 @@
+ #include <libaio.h>
+
+ #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)
+--- a/src/syscall-sparc.h
++++ b/src/syscall-sparc.h
+@@ -20,7 +20,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+ : "=r" (__res), "=&r" (__o0) \
+ : "1" (__o0), "r" (__g1) \
+ : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++ return (type) __res; \
++return -1; \
+ }
+
+ #define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
+@@ -38,7 +40,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+ : "=r" (__res), "=&r" (__o0) \
+ : "1" (__o0), "r" (__o1), "r" (__g1) \
+ : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++ return (type) __res; \
++return -1; \
+ }
+
+ #define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
+@@ -57,7 +61,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+ : "=r" (__res), "=&r" (__o0) \
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \
+ : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++ return (type) __res; \
++return -1; \
+ }
+
+ #define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+@@ -77,7 +83,9 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+ : "=r" (__res), "=&r" (__o0) \
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \
+ : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++ return (type) __res; \
++return -1; \
+ }
+
+ #define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
+@@ -99,5 +107,7 @@ __asm__ __volatile__ ("t 0x10\n\t" \
+ : "=r" (__res), "=&r" (__o0) \
+ : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
+ : "cc"); \
+-return (type) __res; \
++if (__res < -255 || __res >= 0) \
++ return (type) __res; \
++return -1; \
+ }
--- /dev/null
+Description: Fix mips/mipsel syscall wrappers to return correct error values.
+Author: Jurica Stanojkovic <Jurica.Stanojkovic@rt-rk.com>
+Forwarded: no
+Last-Update: 2012-09-24
+
+
+diff -upNr a/src/syscall-mips.h b/src/syscall-mips.h
+--- a/src/syscall-mips.h 2012-09-13 11:46:35.652286733 +0200
++++ b/src/syscall-mips.h 2012-09-13 16:09:17.964407909 +0200
+@@ -76,7 +76,7 @@ type fname(atype a) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) 0 - __v0; \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
--- /dev/null
+Description: Fix structure padding for mips64
+Author: Guillem Jover <guillem@debian.org>
+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
+@@ -52,7 +52,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__)
+ #define PADDED(x, y) x; unsigned y
+ #define PADDEDptr(x, y) x; unsigned y
+@@ -60,6 +61,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__))
+ #define PADDED(x, y) x, y
+ #define PADDEDptr(x, y) x
+@@ -69,6 +71,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__))
+ #define PADDED(x, y) unsigned y; x
+ #define PADDEDptr(x,y) x
--- /dev/null
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Description: Add SH supprt
+ The test-suite logs can be found at:
+ .
+ <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535288>
+
+
+---
+ harness/main.c | 2 -
+ src/libaio.h | 4 ++
+ src/syscall-sh.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall.h | 2 +
+ 4 files changed, 84 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
+@@ -51,7 +51,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__)
+ #define PADDED(x, y) x; unsigned y
+ #define PADDEDptr(x, y) x; unsigned y
+@@ -76,6 +77,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__)
+ #define PADDED(x, y) unsigned y; x
+--- /dev/null
++++ b/src/syscall-sh.h
+@@ -0,0 +1,78 @@
++/* 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
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++__asm__ __volatile__ ("trapa #0x11" \
++ : "=z" (__sc0) \
++ : "0" (__sc0), "r" (__sc4) \
++ : "memory"); \
++ return (type) __sc0;\
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1,type2 arg2) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++ __asm__ __volatile__ ("trapa #0x12" \
++ : "=z" (__sc0) \
++ : "0" (__sc0), "r" (__sc4), "r" (__sc5) \
++ : "memory"); \
++ return (type) __sc0;\
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1,type2 arg2,type3 arg3) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++ __asm__ __volatile__ ("trapa #0x13" \
++ : "=z" (__sc0) \
++ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
++ : "memory"); \
++ return (type) __sc0;\
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++register long __sc0 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++register long __sc7 __asm__ ("r7") = (long) arg4; \
++__asm__ __volatile__ ("trapa #0x14" \
++ : "=z" (__sc0) \
++ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \
++ "r" (__sc7) \
++ : "memory" ); \
++ return (type) __sc0;\
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++register long __sc3 __asm__ ("r3") = __NR_##sname; \
++register long __sc4 __asm__ ("r4") = (long) arg1; \
++register long __sc5 __asm__ ("r5") = (long) arg2; \
++register long __sc6 __asm__ ("r6") = (long) arg3; \
++register long __sc7 __asm__ ("r7") = (long) arg4; \
++register long __sc0 __asm__ ("r0") = (long) arg5; \
++__asm__ __volatile__ ("trapa #0x15" \
++ : "=z" (__sc0) \
++ : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
++ "r" (__sc3) \
++ : "memory" ); \
++ return (type) __sc0;\
++}
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -34,6 +34,8 @@
+ #include "syscall-parisc.h"
+ #elif defined(__mips__)
+ #include "syscall-mips.h"
++#elif defined(__sh__)
++#include "syscall-sh.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
--- /dev/null
+Description: Add sparc64 support
+Author: David S. Miller <davem@davemloft.net>
+Forwarded: no
+Bug-Debian: 588112
+Last-Update: 2010-07-05
+
+
+---
+ src/syscall-sparc64.h | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/syscall.h | 2 +
+ 2 files changed, 100 insertions(+)
+
+--- a/src/syscall.h
++++ b/src/syscall.h
+@@ -24,6 +24,8 @@
+ #include "syscall-alpha.h"
+ #elif defined(__arm__)
+ #include "syscall-arm.h"
++#elif defined(__sparc__) && defined(__arch64__)
++#include "syscall-sparc64.h"
+ #elif defined(__sparc__)
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+--- /dev/null
++++ b/src/syscall-sparc64.h
+@@ -0,0 +1,98 @@
++#define __NR_io_setup 268
++#define __NR_io_destroy 269
++#define __NR_io_submit 270
++#define __NR_io_cancel 271
++#define __NR_io_getevents 272
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++ unsigned long __res; \
++ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
++ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++ __asm__ __volatile__("t 0x6d\n\t" \
++ "sub %%g0, %%o0, %0\n\t" \
++ "movcc %%xcc, %%o0, %0\n" \
++ "1:" \
++ : "=r" (__res), "=&r" (__o0) \
++ : "1" (__o0), "r" (__g1) \
++ : "cc"); \
++ return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1, type2 arg2) \
++{ \
++ unsigned long __res; \
++ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
++ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++ __asm__ __volatile__("t 0x6d\n\t" \
++ "sub %%g0, %%o0, %0\n\t" \
++ "movcc %%xcc, %%o0, %0\n" \
++ "1:" \
++ : "=r" (__res), "=&r" (__o0) \
++ : "1" (__o0), "r" (__o1), "r" (__g1) \
++ : "cc"); \
++ return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1, type2 arg2, type3 arg3) \
++{ \
++ unsigned long __res; \
++ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
++ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++ __asm__ __volatile__("t 0x6d\n\t" \
++ "sub %%g0, %%o0, %0\n\t" \
++ "movcc %%xcc, %%o0, %0\n" \
++ "1:" \
++ : "=r" (__res), "=&r" (__o0) \
++ : "1" (__o0), "r" (__o1), "r" (__o2), \
++ "r" (__g1) \
++ : "cc"); \
++ return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++ unsigned long __res; \
++ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
++ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++ register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
++ __asm__ __volatile__("t 0x6d\n\t" \
++ "sub %%g0, %%o0, %0\n\t" \
++ "movcc %%xcc, %%o0, %0\n" \
++ "1:" \
++ : "=r" (__res), "=&r" (__o0) \
++ : "1" (__o0), "r" (__o1), "r" (__o2), \
++ "r" (__o3), "r" (__g1) \
++ : "cc"); \
++ return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++ unsigned long __res; \
++ register unsigned long __g1 __asm__("g1") = __NR_##sname; \
++ register unsigned long __o0 __asm__("o0") = (unsigned long) arg1; \
++ register unsigned long __o1 __asm__("o1") = (unsigned long) arg2; \
++ register unsigned long __o2 __asm__("o2") = (unsigned long) arg3; \
++ register unsigned long __o3 __asm__("o3") = (unsigned long) arg4; \
++ register unsigned long __o4 __asm__("o4") = (unsigned long) arg5; \
++ __asm__ __volatile__("t 0x6d\n\t" \
++ "sub %%g0, %%o0, %0\n\t" \
++ "movcc %%xcc, %%o0, %0\n" \
++ "1:" \
++ : "=r" (__res), "=&r" (__o0) \
++ : "1" (__o0), "r" (__o1), "r" (__o2), \
++ "r" (__o3), "r" (__o4), "r" (__g1) \
++ : "cc"); \
++ return (type) __res; \
++}
--- /dev/null
+Description: Add support for x32 (from the Yocto project)
+Author: Daniel Schepler <dschepler@gmail.com>
+Origin: vendor
+Forwarded: no
+Bug-Debian: 702183
+Last-Update: 2013-05-06
+
+
+Index: libaio-0.3.109/src/syscall-x86_64.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-x86_64.h 2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h 2013-03-03 07:15:13.000000000 -0800
+@@ -1,8 +1,18 @@
++#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
+
+ #define __syscall_clobber "r11","rcx","memory"
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++ "d" ((long)(arg3)),"r" (__a4)); \
+ return __res; \
+ }
+
+@@ -54,10 +65,11 @@
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++register long __a5 asm ("r8") = (long) arg5; \
++__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
+- __syscall_clobber,"r8","r10" ); \
++ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
+ return __res; \
+ }
+Index: libaio-0.3.109/harness/main.c
+===================================================================
+--- libaio-0.3.109.orig/harness/main.c 2013-03-03 06:58:51.000000000 -0800
++++ libaio-0.3.109/harness/main.c 2013-03-03 07:23:40.000000000 -0800
+@@ -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)
--- /dev/null
+Description: Link against libgcc and libc to avoid unresolved symbols
+ We need to link agaisnt -lgcc, on at least hppa.
+ .
+ We also link against -lc and -Wl,--as-needed, this way 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.
+Author: Guillem Jover <guillem@debian.org>
+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
+@@ -6,7 +6,7 @@ CFLAGS ?= -g -fomit-frame-pointer -O2
+ CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=
++LINK_FLAGS=-Wl,--as-needed -lgcc -lc
+ LINK_FLAGS+=$(LDFLAGS)
+
+ soname=libaio.so.1
--- /dev/null
+Description: Fix installation of shared vs static libraries
+Author: Guillem Jover <guillem@debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2007-09-11
+
+
+---
+ Makefile | 9 ++++++++-
+ src/Makefile | 12 +++++++-----
+ 2 files changed, 15 insertions(+), 6 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -5,9 +5,11 @@ RELEASE=$(shell awk '/Release:/ { print
+ CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
+ RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
+
++DESTDIR=
+ prefix=/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
++libdevdir=$(prefix)/lib
+
+ default: all
+
+@@ -15,7 +17,12 @@ all:
+ @$(MAKE) -C src
+
+ install:
+- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
++ @$(MAKE) -C src install \
++ DESTDIR=$(DESTDIR) \
++ prefix=$(prefix) \
++ includedir=$(includedir) \
++ libdir=$(libdir) \
++ libdevdir=$(libdevdir)
+
+ 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=$(prefix)/lib
+
+ CFLAGS ?= -g -fomit-frame-pointer -O2
+ CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+@@ -53,11 +55,11 @@ $(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 755 $(libname) $(libdir)/$(libname)
+- ln -sf $(libname) $(libdir)/$(soname)
+- ln -sf $(libname) $(libdir)/libaio.so
++ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
++ install -D -m 644 libaio.a $(DESTDIR)$(libdevdir)/libaio.a
++ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
++ ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdir)/$(soname)
++ ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdevdir)/libaio.so
+
+ $(libaio_objs): libaio.h
+
--- /dev/null
+Description: Fix man page errors
+Author: Guillem Jover <guillem@debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-09
+
+
+---
+ man/io.3 | 73 +++++++++----------
+ man/io_cancel.3 | 36 ++++-----
+ man/io_fsync.3 | 42 +++++------
+ man/io_getevents.3 | 76 ++++++++++----------
+ man/io_prep_fsync.3 | 69 +++++++++---------
+ man/io_prep_pread.3 | 70 ++++++++-----------
+ man/io_prep_pwrite.3 | 68 ++++++++----------
+ man/io_queue_init.3 | 38 +++++-----
+ man/io_queue_release.3 | 38 +++++-----
+ man/io_queue_run.3 | 46 ++++++------
+ man/io_queue_wait.3 | 50 ++++++-------
+ man/io_set_callback.3 | 36 +++++----
+ man/io_submit.3 | 60 ++++++++--------
+ 28 files changed, 764 insertions(+), 799 deletions(-)
+
+--- 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 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io \- Asynchronous IO
+ .SH SYNOPSYS
+@@ -6,7 +6,7 @@ io \- Asynchronous IO
+ .B #include <errno.h>
+ .sp
+ .br
+-.B #include <libio.h>
++.B #include <libaio.h>
+ .sp
+ .fi
+ .SH DESCRIPTION
+@@ -17,9 +17,9 @@ then immediately resume normal work whil
+ executed in parallel.
+
+ These functions are part of the library with realtime functions named
+-.IR "libaio"
+-. They are not actually part of the
+-.IR "libc"
++.IR libaio .
++They are not actually part of the
++.I "libc"
+ binary.
+ The implementation of these functions can be done using support in the
+ kernel.
+@@ -27,9 +27,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 "libio.h"
++.I "libaio.h"
+ as follows.
+
+ .nf
+@@ -74,7 +74,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,54 +82,51 @@ 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"
+-.
++.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"
+-.
++.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"
+-.
++.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"
++.I 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"
++.I io_submit
+ function.
+ .TP
+ .B "IO_CMD_FSYNC"
+@@ -336,16 +333,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).
+--- 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 2 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_cancel \- Cancel io requests
+ .SH SYNOPSIS
+@@ -9,7 +9,7 @@ io_cancel \- Cancel io requests
+ .B #include <libaio.h>
+ .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 {
+@@ -33,7 +33,7 @@ have to be overwritten soon. As an exam
+ 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
+@@ -44,22 +44,22 @@ If aio_context specified by ctx_id is
+ invalid.
+ .TP
+ .B EAGAIN
+-If the iocb specified was not
++If the \fIiocb\fP specified was not
+ cancelled.
+ .TP
+ .B ENOSYS
+-if not implemented.
++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).
+--- a/man/io_fsync.3
++++ b/man/io_fsync.3
+@@ -1,10 +1,10 @@
+-./" 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"
++.\" 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 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_fsync \- Synchronize a file's complete in-core state with that on disk
+ .SH SYNOPSYS
+@@ -15,7 +15,7 @@ io_fsync \- Synchronize a file's complet
+ .B #include <libaio.h>
+ .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;
+@@ -49,7 +49,7 @@ file descriptor have terminated and the
+ 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 \fI0\fP, otherwise returns \fIerrno\fP.
+ .SH ERRORS
+ .TP
+ .B EFAULT
+@@ -68,15 +68,15 @@ The iocb contains a file descriptor that
+ .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).
+--- a/man/io_getevents.3
++++ b/man/io_getevents.3
+@@ -1,22 +1,22 @@
+-./"/* 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"
++.\"/* 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 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_getevents \- Read resulting events from io requests
+ .SH SYNOPSIS
+@@ -42,38 +42,38 @@ 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_getevents(io_context_t " ctx ", long " nr ", struct io_event *" events "[], struct timespec *" timeout ");"
+
+ .fi
+ .SH DESCRIPTION
+ Attempts to read up to nr events from
+-the completion queue for the aio_context specified by ctx.
++the completion queue for the aio_context specified by \fIctx\fP.
+ .SH "RETURN VALUES"
+ May return
+-0 if no events are available and the timeout specified
++\fI0\fP 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.
++with \fBENOSYS\fP if not implemented.
+ .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),
+-.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 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).
+--- a/man/io_prep_fsync.3
++++ b/man/io_prep_fsync.3
+@@ -1,11 +1,11 @@
+-./" 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"
++.\" 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 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_prep_fsync \- Synchronize a file's complete in-core state with that on disk
+ .SH SYNOPSYS
+@@ -16,7 +16,7 @@ io_prep_fsync \- Synchronize a file's co
+ .B #include <libaio.h>
+ .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,7 +28,8 @@ struct iocb {
+ .sp
+ .fi
+ .SH DESCRIPTION
+-This is an inline convenience function for setting up an iocbv for a FSYNC request.
++This is an inline convenience function for setting up an \fIiocbv\fP for a
++\fBFSYNC\fP request.
+ .br
+ The file for which
+ .TP
+@@ -36,33 +37,33 @@ The file for which
+ is a descriptor is set up with
+ the command
+ .TP
+-.IR "iocb->aio_lio_opcode = IO_CMD_FSYNC:
++.IR "iocb->aio_lio_opcode = IO_CMD_FSYNC"
+ .
+ .PP
+-The io_prep_fsync() function shall set up an IO_CMD_FSYNC operation
++The \fBio_prep_fsync\fP() function shall set up an \fBIO_CMD_FSYNC\fP 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 \fIaio_fildes\fP member of the \fIiocb\fP 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
++\fBio_submit\fP() 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 \fBfsync\fP(); 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 \fBio_prep_fsync\fP() fails, then, as for \fBfsync\fP(),
+ 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 \fBio_prep_fsync\fP() succeeds, then it is only the I/O that was queued
++at the time of the call to \fBio_submit\fP() 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
++This function returns immediately. To schedule the operation, the
+ function
+ .IR io_submit
+ must be called.
+@@ -70,20 +71,20 @@ 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),
+-.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).
+--- a/man/io_prep_pread.3
++++ b/man/io_prep_pread.3
+@@ -1,14 +1,14 @@
+-./" 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"
++.\" 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 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_prep_pread \- Set up asynchronous read
+ .SH SYNOPSYS
+@@ -19,7 +19,7 @@ io_prep_pread \- Set up asynchronous rea
+ .B #include <libaio.h>
+ .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,49 +31,43 @@ struct iocb {
+ };
+ .fi
+ .SH DESCRIPTION
+-.IR io_prep_pread
++.B 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"
+ bytes of the file for which
+-.TP
+ .IR "iocb->aio_fildes = fd"
+ is a descriptor are written to the buffer
+ starting at
+-.TP
+-.IR "iocb->u.c.buf = buf"
+-.
+-.br
++.IR "iocb->u.c.buf = buf" .
+ 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
++.B io_submit
+ 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
++None.
+ .SH ERRORS
+-None
++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).
+--- a/man/io_prep_pwrite.3
++++ b/man/io_prep_pwrite.3
+@@ -1,14 +1,14 @@
+-./" 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"
++.\" 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 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_prep_pwrite \- Set up iocb for asynchronous writes
+ .SH SYNOPSYS
+@@ -19,8 +19,8 @@ io_prep_pwrite \- Set up iocb for asynch
+ .B #include <libaio.h>
+ .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,26 +31,20 @@ struct iocb {
+ };
+ .fi
+ .SH DESCRIPTION
+-io_prep_write is a convenicence function for setting up parallel writes.
++\fBio_prep_write\fP is a convenicence 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
++.IR "iocb->u.c.buf = buf" .
+ 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.
+@@ -58,20 +52,20 @@ 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),
+-.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).
+--- 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 2 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_queue_init \- Initialize asynchronous io state machine
+
+@@ -10,7 +10,7 @@ io_queue_init \- Initialize asynchronous
+ .B #include <libaio.h>
+ .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
+@@ -27,7 +27,7 @@ If the operation is successful, *cxtp is
+ .SH "RETURN VALUES"
+ On success,
+ .B io_queue_init
+-returns 0. Otherwise, -error is return, where
++returns \fI0\fP. Otherwise, -error is return, where
+ error is one of the Exxx values defined in the Errors section.
+ .SH ERRORS
+ .TP
+@@ -37,27 +37,27 @@ referenced data outside of the program's
+ .TP
+ .B EINVAL
+ .I maxevents
+-is <= 0 or
++is <= \fI0\fP or
+ .IR ctx
+-is an invalid memory locattion.
++is an invalid memory location.
+ .TP
+ .B ENOSYS
+-Not implemented
++Not implemented.
+ .TP
+ .B EAGAIN
+ .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).
+--- 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 2 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_queue_release \- Release the context associated with the userspace handle
+ .SH SYNOPSIS
+@@ -8,41 +8,41 @@ io_queue_release \- Release the context
+ .B #include <libaio.h>
+ .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
+-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.
+ .SH "RETURN VALUES"
+ On success,
+ .B io_queue_release
+-returns 0. Otherwise, -error is return, where
++returns \fI0\fP. 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 unitialized aio context, the iocb pointed to by
++refers to an unitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+-contains an improperly initialized iocb,
++contains an improperly initialized \fIiocb\fP.
+ .TP
+ .B ENOSYS
+-Not implemented
++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).
+
+--- 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 2 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_queue_run \- Handle completed io requests
+ .SH SYNOPSIS
+@@ -9,17 +9,17 @@ io_queue_run \- Handle completed io requ
+ .B #include <libaio.h>
+ .br
+ .sp
+-.BI "int io_queue_run(io_context_t ctx );"
++.BI "int io_queue_run(io_context_t " ctx_id ");"
+ .sp
+ .fi
+ .SH DESCRIPTION
+ .B io_queue_run
+-Attempts to read all the events events from
+-the completion queue for the aio_context specified by ctx_id.
++Attempts to read all the events events from
++the completion queue for the aio_context specified by \fIctx_id\fP.
+ .SH "RETURN VALUES"
+ May return
+-0 if no events are available.
+-Will fail with -ENOSYS if not implemented.
++\fI0\fP if no events are available.
++Will fail with -\fBENOSYS\fP if not implemented.
+ .SH ERRORS
+ .TP
+ .B EFAULT
+@@ -27,24 +27,24 @@ Will fail with -ENOSYS if not implemente
+ 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
++.I ctx_id
++refers to an unitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+-contains an improperly initialized iocb,
++contains an improperly initialized iocb.
+ .TP
+ .B ENOSYS
+-Not implemented
++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).
+--- 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 2 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_queue_wait \- Wait for io requests to complete
+ .SH SYNOPSIS
+@@ -9,22 +9,22 @@ io_queue_wait \- Wait for io requests to
+ .B #include <libaio.h>
+ .br
+ .sp
+-.BI "int io_queue_wait(io_context_t ctx, const struct timespec *timeout);"
++.BI "int io_queue_wait(io_context_t " ctx_id ", const struct timespec *" timeout ");"
+ .fi
+ .SH DESCRIPTION
+-Attempts to read an event from
+-the completion queue for the aio_context specified by ctx_id.
++Attempts to read an event from
++the completion queue for the aio_context specified by \fIctx_id\fP.
+ .SH "RETURN VALUES"
+ May return
+-0 if no events are available and the timeout specified
++\fI0\fP 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
++returns \fI0\fP. Otherwise, -error is return, where
+ error is one of the Exxx values defined in the Errors section.
+ .SH ERRORS
+ .TP
+@@ -33,24 +33,24 @@ error is one of the Exxx values defined
+ 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
++.I ctx_id
++refers to an unitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+-contains an improperly initialized iocb,
++contains an improperly initialized iocb.
+ .TP
+ .B ENOSYS
+-Not implemented
++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).
+--- a/man/io_set_callback.3
++++ b/man/io_set_callback.3
+@@ -1,5 +1,5 @@
+-./"\ 3static 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"
++.\"static inline void io_set_callback(struct iocb *iocb, io_callback_t cb)
++.TH io_set_callback 3 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_set_callback \- Set up io completion callback function
+ .SH SYNOPSYS
+@@ -10,7 +10,7 @@ io_set_callback \- Set up io completion
+ .B #include <libaio.h>
+ .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,20 +25,22 @@ typedef void (*io_callback_t)(io_context
+ .fi
+ .SH DESCRIPTION
+ The callback is not done if the caller uses raw events from
+-io_getevents, only with the library helpers
++\fBio_getevents\fP, only with the library helpers.
+ .SH "RETURN VALUES"
++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_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).
+--- a/man/io_submit.3
++++ b/man/io_submit.3
+@@ -1,16 +1,16 @@
+-./"/* 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"
++.\"/* 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 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io_submit \- Submit io requests
+ .SH SYNOPSIS
+@@ -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
+@@ -120,16 +120,16 @@ The iocb contains a file descriptor that
+ .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).
--- /dev/null
+Description: Verbatim \n should be escaped in order to make it through roff
+Author: Stephan Springl <springl-libaio@bfw-online.de>
+Origin: vendor
+Forwarded: no
+Bug-Debian: 651833
+Last-Update: 2011-12-12
+
+
+diff --git a/man/io.3 b/man/io.3
+index d82e0d1..f277673 100644
+--- a/man/io.3
++++ b/man/io.3
+@@ -172,11 +172,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);
+@@ -195,7 +195,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;
+@@ -221,7 +221,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);
+ }
+
+@@ -281,7 +281,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);
+ }
+
--- /dev/null
+Description: Fix man page typos
+Author: Guillem Jover <guillem@debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2016-05-31
+
+---
+ man/io.3 | 2 +-
+ man/io_fsync.3 | 4 ++--
+ man/io_prep_fsync.3 | 2 +-
+ man/io_prep_pread.3 | 2 +-
+ man/io_prep_pwrite.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 +-
+ 10 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/man/io.3
++++ b/man/io.3
+@@ -1,7 +1,7 @@
+ .TH io 3 2009-06-10 "Linux 2.4" "Linux AIO"
+ .SH NAME
+ io \- Asynchronous IO
+-.SH SYNOPSYS
++.SH SYNOPSIS
+ .nf
+ .B #include <errno.h>
+ .sp
+--- a/man/io_fsync.3
++++ b/man/io_fsync.3
+@@ -7,7 +7,7 @@
+ .TH io_fsync 3 2009-06-10 "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 <errno.h>
+ .sp
+@@ -58,7 +58,7 @@ referenced data outside of the program's
+ .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
+--- a/man/io_prep_fsync.3
++++ b/man/io_prep_fsync.3
+@@ -8,7 +8,7 @@
+ .TH io_prep_fsync 3 2009-06-10 "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 <errno.h>
+ .br
+--- a/man/io_prep_pread.3
++++ b/man/io_prep_pread.3
+@@ -11,7 +11,7 @@
+ .TH io_prep_pread 3 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_prep_pread \- Set up asynchronous read
+-.SH SYNOPSYS
++.SH SYNOPSIS
+ .nf
+ .B #include <errno.h>
+ .sp
+--- a/man/io_prep_pwrite.3
++++ b/man/io_prep_pwrite.3
+@@ -11,7 +11,7 @@
+ .TH io_prep_pwrite 3 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_prep_pwrite \- Set up iocb for asynchronous writes
+-.SH SYNOPSYS
++.SH SYNOPSIS
+ .nf
+ .B #include <errno.h>
+ .br
+--- a/man/io_queue_release.3
++++ b/man/io_queue_release.3
+@@ -25,7 +25,7 @@ error is one of the Exxx values defined
+ .TP
+ .B EINVAL
+ .I ctx
+-refers to an unitialized aio context, the \fIiocb\fP pointed to by
++refers to an uninitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+ contains an improperly initialized \fIiocb\fP.
+ .TP
+--- a/man/io_queue_run.3
++++ b/man/io_queue_run.3
+@@ -28,7 +28,7 @@ referenced data outside of the program's
+ .TP
+ .B EINVAL
+ .I ctx_id
+-refers to an unitialized aio context, the \fIiocb\fP pointed to by
++refers to an uninitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+ contains an improperly initialized iocb.
+ .TP
+--- a/man/io_queue_wait.3
++++ b/man/io_queue_wait.3
+@@ -34,7 +34,7 @@ referenced data outside of the program's
+ .TP
+ .B EINVAL
+ .I ctx_id
+-refers to an unitialized aio context, the \fIiocb\fP pointed to by
++refers to an uninitialized aio context, the \fIiocb\fP pointed to by
+ .I iocbs
+ contains an improperly initialized iocb.
+ .TP
+--- a/man/io_set_callback.3
++++ b/man/io_set_callback.3
+@@ -2,7 +2,7 @@
+ .TH io_set_callback 3 2009-06-10 "Linux 2.4" Linux AIO"
+ .SH NAME
+ io_set_callback \- Set up io completion callback function
+-.SH SYNOPSYS
++.SH SYNOPSIS
+ .nf
+ .B #include <errno.h>
+ .br
+--- a/man/io_submit.3
++++ b/man/io_submit.3
+@@ -110,7 +110,7 @@ referenced data outside of the program's
+ .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
--- /dev/null
+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 <guillem@debian.org>
+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 -O
++CFLAGS+=-Wall -I../src -g -O
+ #-lpthread -lrt
+
+ all: $(PROGS)
--- /dev/null
+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 <guillem@debian.org>
+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 -O
++MK_CPPFLAGS:=-I../src
++CFLAGS=-Wall -g -O
+ #-lpthread -lrt
++MK_CFLAGS=$(CFLAGS)
++MK_LDFLAGS=main.c ../src/libaio.a $(LDFLAGS)
+
+ all: $(PROGS)
+
+ $(PROGS): %.p: %.t $(HARNESS_SRCS)
+- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c ../src/libaio.a
++ $(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=$(prefix)/lib
+
+-CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
+-SO_CFLAGS=-shared $(CFLAGS)
+-L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=-Wl,--as-needed -lgcc -lc
+-LINK_FLAGS+=$(LDFLAGS)
++MK_CPPFLAGS=-I.
++MK_CFLAGS=-nostdlib -nostartfiles -fomit-frame-pointer -fPIC $(CFLAGS)
++CFLAGS=-Wall -g -O2
++SO_CFLAGS=-shared $(MK_CFLAGS)
++L_CFLAGS=$(MK_CFLAGS)
++MK_LDFLAGS=-Wl,--as-needed -lgcc -lc $(LDFLAGS)
+
+ soname=libaio.so.1
+ minor=0
+@@ -39,10 +39,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
+@@ -52,7 +52,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
--- /dev/null
+00_arches.patch
+00_arches_sh.patch
+00_arches_sparc64.patch
+00_arches_x32.patch
+00_arches_mips.patch
+00_arches_mips_fix_padding.patch
+01_link_libs.patch
+02_libdevdir.patch
+03_man_errors.patch
+03_man_escape_backslash.patch
+03_man_typos.patch
+04_no_Werror.patch
+05_build-flags.patch
--- /dev/null
+#!/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
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
+
+lib := libaio1
+libdbg := $(lib)-dbg
+libudeb := $(lib)-udeb
+libdev := libaio-dev
+
+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=/lib/$(DEB_HOST_MULTIARCH) \
+ libdevdir=/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 -s
+ dh_installchangelogs -s ChangeLog
+ dh_installdocs -s
+ dh_installexamples -s
+ dh_installman -s
+ dh_lintian -s
+ dh_link -s
+ dh_strip -s --ddeb-migration='$(libdbg) (<< 0.3.110-2~)'
+ dh_compress -s
+ dh_fixperms -s
+ dh_makeshlibs -s --add-udeb '$(libudeb)'
+ dh_shlibdeps -s
+ dh_installdeb -s
+ dh_gencontrol -s
+ dh_md5sums -s
+ dh_builddeb -s
+
+.PHONY: clean build-indep build-arch build
+.PHONY: install-arch binary-indep binary-arch binary
--- /dev/null
+3.0 (quilt)
--- /dev/null
+# Site Directory Pattern Version Script
+version=3
+https://fedorahosted.org/releases/l/i/libaio/libaio-([\d\.]+)\.tar\.gz debian uupdate
+#http://ftp.kernel.org/pub/linux/libs/aio/ libaio-([\d\.]+)\.tar.gz debian uupdate