diff options
Diffstat (limited to 'cygwin_util.c')
-rw-r--r-- | cygwin_util.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cygwin_util.c b/cygwin_util.c new file mode 100644 index 000000000..13bd66347 --- /dev/null +++ b/cygwin_util.c | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * | ||
3 | * cygwin_util.c | ||
4 | * | ||
5 | * Author: Corinna Vinschen <vinschen@cygnus.com> | ||
6 | * | ||
7 | * Copyright (c) 2000 Corinna Vinschen <vinschen@cygnus.com>, Duisburg, Germany | ||
8 | * All rights reserved | ||
9 | * | ||
10 | * Created: Sat Sep 02 12:17:00 2000 cv | ||
11 | * | ||
12 | * This file contains functions for forcing opened file descriptors to | ||
13 | * binary mode on Windows systems. | ||
14 | */ | ||
15 | |||
16 | #include "config.h" | ||
17 | |||
18 | #ifdef HAVE_CYGWIN | ||
19 | #include <fcntl.h> | ||
20 | #include <io.h> | ||
21 | |||
22 | int binary_open(const char *filename, int flags, mode_t mode) | ||
23 | { | ||
24 | return open(filename, flags | O_BINARY, mode); | ||
25 | } | ||
26 | |||
27 | int binary_pipe(int fd[2]) | ||
28 | { | ||
29 | int ret = pipe(fd); | ||
30 | if (!ret) { | ||
31 | setmode (fd[0], O_BINARY); | ||
32 | setmode (fd[1], O_BINARY); | ||
33 | } | ||
34 | } | ||
35 | #endif | ||