* syscalls.cc (open): Handle O_DIRECTORY flag.

* include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
	* include/cygwin/version.h: Bump API minor number.
This commit is contained in:
Corinna Vinschen
2009-02-11 16:06:39 +00:00
parent 29915d8ef2
commit 64d6e1d43e
4 changed files with 20 additions and 2 deletions

View File

@@ -969,6 +969,12 @@ open (const char *unix_path, int flags, ...)
res = -1;
set_errno (ELOOP);
}
else if ((flags & O_DIRECTORY) && !fh->pc.isdir ())
{
delete fh;
res = -1;
set_errno (ENOTDIR);
}
else if (((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) && fh->exists ())
{
delete fh;