1 /* Enqueue and list of read or write requests, 64bit offset version.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
23 #include <semaphore.h>
29 lio_listio64 (mode, list, nent, sig)
31 struct aiocb64 *const list[];
39 /* Check arguments. */
40 if (mode != LIO_WAIT && mode != LIO_NOWAIT)
46 /* Request the semaphore. */
47 sem_wait (&__aio_requests_sema);
49 /* Now we can enqueue all requests. Since we already acquired the
50 semaphore the enqueue function need not do this. */
51 for (cnt = 0; cnt < nent; ++cnt)
52 if (list[cnt] != NULL && list[cnt]->aio_lio_opcode != LIO_NOP)
53 if (__aio_enqueue_request ((aiocb_union *) list[cnt],
54 list[cnt]->aio_lio_opcode | 128, 0) >= 0)
55 /* Successfully enqueued. */
58 /* Signal that we've seen an error. `errno' and the error code
59 of the aiocb will tell more. */
62 /* Release the semaphore. */
63 sem_post (&__aio_requests_sema);