Skip to content

Commit 785a60c

Browse files
Add a few functions & POSIX error codes to Windows API
1 parent 53bdffc commit 785a60c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/windows/mod.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,49 @@ pub const ENOTEMPTY: ::c_int = 41;
183183
pub const EILSEQ: ::c_int = 42;
184184
pub const STRUNCATE: ::c_int = 80;
185185

186+
// POSIX Supplement (from errno.h)
187+
pub const EADDRINUSE: ::c_int = 100;
188+
pub const EADDRNOTAVAIL: ::c_int = 101;
189+
pub const EAFNOSUPPORT: ::c_int = 102;
190+
pub const EALREADY: ::c_int = 103;
191+
pub const EBADMSG: ::c_int = 104;
192+
pub const ECANCELED: ::c_int = 105;
193+
pub const ECONNABORTED: ::c_int = 106;
194+
pub const ECONNREFUSED: ::c_int = 107;
195+
pub const ECONNRESET: ::c_int = 108;
196+
pub const EDESTADDRREQ: ::c_int = 109;
197+
pub const EHOSTUNREACH: ::c_int = 110;
198+
pub const EIDRM: ::c_int = 111;
199+
pub const EINPROGRESS: ::c_int = 112;
200+
pub const EISCONN: ::c_int = 113;
201+
pub const ELOOP: ::c_int = 114;
202+
pub const EMSGSIZE: ::c_int = 115;
203+
pub const ENETDOWN: ::c_int = 116;
204+
pub const ENETRESET: ::c_int = 117;
205+
pub const ENETUNREACH: ::c_int = 118;
206+
pub const ENOBUFS: ::c_int = 119;
207+
pub const ENODATA: ::c_int = 120;
208+
pub const ENOLINK: ::c_int = 121;
209+
pub const ENOMSG: ::c_int = 122;
210+
pub const ENOPROTOOPT: ::c_int = 123;
211+
pub const ENOSR: ::c_int = 124;
212+
pub const ENOSTR: ::c_int = 125;
213+
pub const ENOTCONN: ::c_int = 126;
214+
pub const ENOTRECOVERABLE: ::c_int = 127;
215+
pub const ENOTSOCK: ::c_int = 128;
216+
pub const ENOTSUP: ::c_int = 129;
217+
pub const EOPNOTSUPP: ::c_int = 130;
218+
pub const EOTHER: ::c_int = 131;
219+
pub const EOVERFLOW: ::c_int = 132;
220+
pub const EOWNERDEAD: ::c_int = 133;
221+
pub const EPROTO: ::c_int = 134;
222+
pub const EPROTONOSUPPORT: ::c_int = 135;
223+
pub const EPROTOTYPE: ::c_int = 136;
224+
pub const ETIME: ::c_int = 137;
225+
pub const ETIMEDOUT: ::c_int = 138;
226+
pub const ETXTBSY: ::c_int = 139;
227+
pub const EWOULDBLOCK: ::c_int = 140;
228+
186229
// signal codes
187230
pub const SIGINT: ::c_int = 2;
188231
pub const SIGILL: ::c_int = 4;
@@ -335,6 +378,8 @@ extern "C" {
335378
n: size_t,
336379
) -> ::size_t;
337380

381+
pub fn time(destTime: *mut time_t) -> time_t;
382+
338383
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
339384
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
340385
pub fn memcpy(
@@ -425,6 +470,9 @@ extern "C" {
425470
pub fn isatty(fd: ::c_int) -> ::c_int;
426471
#[link_name = "_lseek"]
427472
pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long;
473+
#[link_name = "_lseeki64"]
474+
pub fn lseek64(fd: ::c_int, offset: c_longlong, origin: ::c_int)
475+
-> c_longlong;
428476
#[link_name = "_pipe"]
429477
pub fn pipe(
430478
fds: *mut ::c_int,

0 commit comments

Comments
 (0)