1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Copyright Sean Kelly 2005 - 2009.
5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6  * Authors:   Sean Kelly, Alex Rønne Petersen
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 
10 /*          Copyright Sean Kelly 2005 - 2009.
11  * Distributed under the Boost Software License, Version 1.0.
12  *    (See accompanying file LICENSE or copy at
13  *          http://www.boost.org/LICENSE_1_0.txt)
14  */
15 module core.sys.posix.sys.uio;
16 
17 import core.sys.posix.config;
18 public import core.sys.posix.sys.types; // for ssize_t
19 
20 version (OSX)
21     version = Darwin;
22 else version (iOS)
23     version = Darwin;
24 else version (TVOS)
25     version = Darwin;
26 else version (WatchOS)
27     version = Darwin;
28 
29 version (Posix):
30 extern (C) nothrow @nogc:
31 
32 //
33 // Required
34 //
35 /*
36 struct iovec
37 {
38     void*  iov_base;
39     size_t iov_len;
40 }
41 
42 ssize_t // from core.sys.posix.sys.types
43 size_t  // from core.sys.posix.sys.types
44 
45 ssize_t readv(int, const scope iovec*, int);
46 ssize_t writev(int, const scope iovec*, int);
47 */
48 
49 version (CRuntime_Glibc)
50 {
51     struct iovec
52     {
53         void*  iov_base;
54         size_t iov_len;
55     }
56 
57     ssize_t readv(int, const scope iovec*, int);
58     ssize_t writev(int, const scope iovec*, int);
59 }
60 else version (Darwin)
61 {
62     struct iovec
63     {
64         void*  iov_base;
65         size_t iov_len;
66     }
67 
68     ssize_t readv(int, const scope iovec*, int);
69     ssize_t writev(int, const scope iovec*, int);
70 }
71 else version (FreeBSD)
72 {
73     struct iovec
74     {
75         void*  iov_base;
76         size_t iov_len;
77     }
78 
79     ssize_t readv(int, const scope iovec*, int);
80     ssize_t writev(int, const scope iovec*, int);
81 }
82 else version (NetBSD)
83 {
84     struct iovec
85     {
86         void*  iov_base;
87         size_t iov_len;
88     }
89 
90     ssize_t readv(int, const scope iovec*, int);
91     ssize_t writev(int, const scope iovec*, int);
92 }
93 else version (OpenBSD)
94 {
95     struct iovec
96     {
97         void*  iov_base;
98         size_t iov_len;
99     }
100 
101     ssize_t readv(int, const scope iovec*, int);
102     ssize_t writev(int, const scope iovec*, int);
103 }
104 else version (DragonFlyBSD)
105 {
106     struct iovec
107     {
108         void*  iov_base;
109         size_t iov_len;
110     }
111 
112     ssize_t readv(int, const scope iovec*, int);
113     ssize_t writev(int, const scope iovec*, int);
114 }
115 else version (Solaris)
116 {
117     struct iovec
118     {
119         void* iov_base;
120         size_t iov_len;
121     }
122 
123     ssize_t readv(int, const scope iovec*, int);
124     ssize_t writev(int, const scope iovec*, int);
125 }
126 else version (CRuntime_Bionic)
127 {
128     struct iovec
129     {
130         void*  iov_base;
131         size_t iov_len;
132     }
133 
134     int readv(int, const scope iovec*, int);
135     int writev(int, const scope iovec*, int);
136 }
137 else version (CRuntime_Musl)
138 {
139     struct iovec
140     {
141         void*  iov_base;
142         size_t iov_len;
143     }
144 
145     ssize_t readv(int, const scope iovec*, int);
146     ssize_t writev(int, const scope iovec*, int);
147 }
148 else version (CRuntime_UClibc)
149 {
150     struct iovec
151     {
152         void*  iov_base;
153         size_t iov_len;
154     }
155 
156     ssize_t readv(int, const scope iovec*, int);
157     ssize_t writev(int, const scope iovec*, int);
158 }
159 else
160 {
161     static assert(false, "Unsupported platform");
162 }