Welcome to mirror list, hosted at ThFree Co, Russian Federation.

aio.h « include « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 523a47870c6e9d46bc2683751d75391b244779f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* aio.h: Support for Posix asynchronous i/o routines.

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifndef _AIO_H
#define _AIO_H

#include <sys/features.h>
#include <sys/queue.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <limits.h> // for AIO_LISTIO_MAX, AIO_MAX, and AIO_PRIO_DELTA_MAX

/* defines for return value of aio_cancel() */
#define AIO_ALLDONE     0
#define AIO_CANCELED    1
#define AIO_NOTCANCELED 2

/* defines for 'mode' argument of lio_listio() */
#define LIO_NOWAIT      0
#define LIO_WAIT        1

/* defines for 'aio_lio_opcode' element of struct aiocb */
#define LIO_NOP         0
#define LIO_READ        1
#define LIO_WRITE       2

#ifdef __cplusplus
extern "C" {
#endif

/* struct __liocb is Cygwin-specific */
struct __liocb {
    volatile uint32_t    lio_count;
    struct sigevent     *lio_sigevent;
};

/* struct __wincb is Cygwin-specific */
struct __wincb {
    int32_t              status; /* These two fields must be first... */
    uintptr_t            info;   /* ...and must be adjacent, in this order */
    void                *event;
};

/* struct aiocb is defined by Posix */
struct aiocb {
    /* these elements of aiocb are Cygwin-specific */
    TAILQ_ENTRY(aiocb)   aio_chain;
    struct __liocb      *aio_liocb;
    struct __wincb       aio_wincb;
    ssize_t              aio_rbytes;
    int                  aio_errno;
    /* the remaining elements of aiocb are defined by Posix */
    int                  aio_lio_opcode;
    int                  aio_reqprio; /* Not yet implemented; must be zero */
    int                  aio_fildes;
    volatile void       *aio_buf;
    size_t               aio_nbytes;
    off_t                aio_offset;
    struct sigevent      aio_sigevent;
};

/* function prototypes as defined by Posix */
int     aio_cancel  (int, struct aiocb *);
int     aio_error   (const struct aiocb *);
int     aio_fsync   (int, struct aiocb *);
int     aio_read    (struct aiocb *);
ssize_t aio_return  (struct aiocb *);
int     aio_suspend (const struct aiocb *const [], int,
                        const struct timespec *);
int     aio_write   (struct aiocb *);
int     lio_listio  (int, struct aiocb *__restrict const [__restrict], int,
                        struct sigevent *__restrict);

#ifdef __cplusplus
}
#endif
#endif /* _AIO_H */