xref: /freebsd/lib/libc/sys/aio_suspend.c (revision d7847a8d351436a4654bd2c746bc9c04401160ee)
1*d7847a8dSBrooks Davis /*
2*d7847a8dSBrooks Davis  * Copyright (c) 2014 The FreeBSD Foundation.
3*d7847a8dSBrooks Davis  *
4*d7847a8dSBrooks Davis  * Portions of this software were developed by Konstantin Belousov
5*d7847a8dSBrooks Davis  * under sponsorship from the FreeBSD Foundation.
6*d7847a8dSBrooks Davis  *
7*d7847a8dSBrooks Davis  * Redistribution and use in source and binary forms, with or without
8*d7847a8dSBrooks Davis  * modification, are permitted provided that the following conditions
9*d7847a8dSBrooks Davis  * are met:
10*d7847a8dSBrooks Davis  * 1. Redistributions of source code must retain the above copyright
11*d7847a8dSBrooks Davis  *    notice(s), this list of conditions and the following disclaimer as
12*d7847a8dSBrooks Davis  *    the first lines of this file unmodified other than the possible
13*d7847a8dSBrooks Davis  *    addition of one or more copyright notices.
14*d7847a8dSBrooks Davis  * 2. Redistributions in binary form must reproduce the above copyright
15*d7847a8dSBrooks Davis  *    notice(s), this list of conditions and the following disclaimer in
16*d7847a8dSBrooks Davis  *    the documentation and/or other materials provided with the
17*d7847a8dSBrooks Davis  *    distribution.
18*d7847a8dSBrooks Davis  *
19*d7847a8dSBrooks Davis  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
20*d7847a8dSBrooks Davis  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*d7847a8dSBrooks Davis  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*d7847a8dSBrooks Davis  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
23*d7847a8dSBrooks Davis  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*d7847a8dSBrooks Davis  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*d7847a8dSBrooks Davis  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26*d7847a8dSBrooks Davis  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27*d7847a8dSBrooks Davis  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28*d7847a8dSBrooks Davis  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29*d7847a8dSBrooks Davis  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*d7847a8dSBrooks Davis  */
31*d7847a8dSBrooks Davis 
32*d7847a8dSBrooks Davis #include <sys/types.h>
33*d7847a8dSBrooks Davis #include <sys/aio.h>
34*d7847a8dSBrooks Davis #include "libc_private.h"
35*d7847a8dSBrooks Davis 
36*d7847a8dSBrooks Davis __weak_reference(__sys_aio_suspend, __aio_suspend);
37*d7847a8dSBrooks Davis 
38*d7847a8dSBrooks Davis #pragma weak aio_suspend
39*d7847a8dSBrooks Davis int
40*d7847a8dSBrooks Davis aio_suspend(const struct aiocb * const iocbs[], int niocb,
41*d7847a8dSBrooks Davis     const struct timespec *timeout)
42*d7847a8dSBrooks Davis {
43*d7847a8dSBrooks Davis 	return (((int (*)(const struct aiocb * const[], int,
44*d7847a8dSBrooks Davis 	    const struct timespec *))
45*d7847a8dSBrooks Davis 	    *(__libc_interposing_slot(INTERPOS_aio_suspend)))
46*d7847a8dSBrooks Davis 	    (iocbs, niocb, timeout));
47*d7847a8dSBrooks Davis }
48