Windows: Implement a wrapper of the open() function.

The wrapper does two things:
- Requests to open /dev/null are redirected to open the nul pseudo file.
- A request to open a file that currently exists as a directory on
  Windows fails with EACCES; this is changed to EISDIR.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-11-15 22:22:47 +01:00
parent 23326d14ed
commit 3e4a1ba07b
2 changed files with 23 additions and 0 deletions

View File

@ -137,6 +137,9 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out);
* replacements of existing functions
*/
int mingw_open (const char *filename, int oflags, ...);
#define open mingw_open
char *mingw_getcwd(char *pointer, int len);
#define getcwd mingw_getcwd