aio_suspend.c revision 277317
164562Sgshapiro/*
294334Sgshapiro * Copyright (c) 2014 The FreeBSD Foundation.
364562Sgshapiro * All rights reserved.
464562Sgshapiro *
564562Sgshapiro * Portions of this software were developed by Konstantin Belousov
664562Sgshapiro * under sponsorship from the FreeBSD Foundation.
764562Sgshapiro *
864562Sgshapiro * Redistribution and use in source and binary forms, with or without
964562Sgshapiro * modification, are permitted provided that the following conditions
1064562Sgshapiro * are met:
1164562Sgshapiro * 1. Redistributions of source code must retain the above copyright
1264562Sgshapiro *    notice(s), this list of conditions and the following disclaimer as
1364562Sgshapiro *    the first lines of this file unmodified other than the possible
1490792Sgshapiro *    addition of one or more copyright notices.
1590792Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright
1690792Sgshapiro *    notice(s), this list of conditions and the following disclaimer in
1777349Sgshapiro *    the documentation and/or other materials provided with the
1864562Sgshapiro *    distribution.
1964562Sgshapiro *
2064562Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
2190792Sgshapiro * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2264562Sgshapiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23141858Sgshapiro * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
2464562Sgshapiro * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2577349Sgshapiro * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2664562Sgshapiro * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
2764562Sgshapiro * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2864562Sgshapiro * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
2964562Sgshapiro * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
3064562Sgshapiro * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3164562Sgshapiro */
3264562Sgshapiro
3364562Sgshapiro#include <sys/cdefs.h>
3490792Sgshapiro__FBSDID("$FreeBSD: stable/10/lib/libc/sys/aio_suspend.c 277317 2015-01-18 11:54:20Z kib $");
3564562Sgshapiro
3690792Sgshapiro#include <sys/types.h>
3790792Sgshapiro#include <sys/aio.h>
3864562Sgshapiro#include "libc_private.h"
3990792Sgshapiro
4064562Sgshapiro__weak_reference(__sys_aio_suspend, __aio_suspend);
4164562Sgshapiro
4264562Sgshapiro#pragma weak aio_suspend
4364562Sgshapiroint
4464562Sgshapiroaio_suspend(const struct aiocb * const iocbs[], int niocb,
4564562Sgshapiro    const struct timespec *timeout)
4664562Sgshapiro{
4764562Sgshapiro
4864562Sgshapiro	return (((int (*)(const struct aiocb * const[], int,
4964562Sgshapiro	    const struct timespec *))
5064562Sgshapiro	    __libc_interposing[INTERPOS_aio_suspend])(iocbs, niocb, timeout));
5164562Sgshapiro}
5290792Sgshapiro