Refresh 01-gnulib-directory.patch
[gnulib.git] / doc / posix-functions / open.texi
1 @node open
2 @section @code{open}
3 @findex open
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/open.html}
6
7 Gnulib module: open, fchdir
8
9 Portability problems fixed by the Gnulib module open:
10 @itemize
11 @item
12 On platforms where @code{off_t} is a 32-bit type, @code{open} may not work
13 correctly with files larger than 2 GB.  (Cf. @code{AC_SYS_LARGEFILE}.)
14 @item
15 This function does not fail when the file name argument ends in a slash
16 and (without the slash) names a nonexistent file or a file that is not a
17 directory, on some platforms:
18 FreeBSD 7.2, AIX 7.1, HP-UX 11.00, Solaris 9, Irix 5.3.
19 @item
20 This function does not support the @code{O_NONBLOCK} flag when it is defined
21 by the gnulib module @code{nonblocking} on some platforms:
22 mingw.
23 @item
24 On Windows platforms (excluding Cygwin), this function does usually not
25 recognize the @file{/dev/null} filename.
26 @end itemize
27
28 Portability problems fixed by the Gnulib module fchdir:
29 @itemize
30 @item
31 On Windows platforms (excluding Cygwin), this function fails to open a
32 read-only descriptor for directories.
33 @end itemize
34
35 Portability problems not fixed by Gnulib:
36 @itemize
37 @item
38 On Windows, this function returns a file handle in @code{O_TEXT} mode by
39 default; this means that it translates '\n' to CR/LF by default.  Use the
40 @code{O_BINARY} flag if you need reliable binary I/O.
41 @end itemize