Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-05-13 07:21:39 +0400
committerChristopher Faylor <me@cgf.cx>2005-05-13 07:21:39 +0400
commit66582dd6e7e63a2c179357e61fe2ccd53c83b02b (patch)
tree835a3aa965c077db8abf82eb3f2978bbfcc8e7d6 /winsup/cygwin/path.h
parentcf55bf5ee88f0c91a9663d92dba3497c99c8d6fd (diff)
* cygtls.cc (_cygtls::remove): Eliminate compiler warning.
* dir.cc (mkdir): Check path for writability. (rmdir): Ditto. Remove check for special directories. * path.cc (path_conv::check): Set PATH_RO for virtual devices. Set error if read-only and asked for writability. * path.h (pathconv_arg): Add PC_WRITABLE. (path_types): Add PATH_RO. (path_conv::isro): Add (currently unused) check for read-only filesystem. Return "ENOSHARE" when we know a share doesn't exist. * include/sys/mount.h: Add MOUNT_RO flag. * autoload.cc (WNetGetResourceInformationA): Import. * fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual existence of remote system rather than always assuming that it exists.
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r--winsup/cygwin/path.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index f21c4b999..1c6310326 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -39,7 +39,8 @@ enum pathconv_arg
PC_NULLEMPTY = 0x0020,
PC_CHECK_EA = 0x0040,
PC_POSIX = 0x0080,
- PC_NO_ACCESS_CHECK = 0x00800000
+ PC_NO_ACCESS_CHECK = 0x00800000,
+ PC_WRITABLE = 0x00400000
};
enum case_checking
@@ -51,7 +52,7 @@ enum case_checking
#define PC_NONULLEMPTY -1
-#include <sys/mount.h>
+#include "sys/mount.h"
enum path_types
{
@@ -62,6 +63,7 @@ enum path_types
PATH_NOTEXEC = MOUNT_NOTEXEC,
PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
PATH_ENC = MOUNT_ENC,
+ PATH_RO = MOUNT_RO,
PATH_ALL_EXEC = (PATH_CYGWIN_EXEC | PATH_EXEC),
PATH_NO_ACCESS_CHECK = PC_NO_ACCESS_CHECK,
PATH_LNK = 0x01000000,
@@ -149,6 +151,7 @@ class path_conv
int is_lnk_special () const {return is_fs_device () || isfifo () || is_lnk_symlink ();}
int issocket () const {return dev.devn == FH_UNIX;}
int iscygexec () const {return path_flags & PATH_CYGWIN_EXEC;}
+ bool isro () const {return !!(path_flags & PATH_RO);}
bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;}
bool has_attribute (DWORD x) const {return exists () && (fileattr & x);}
int isdir () const {return has_attribute (FILE_ATTRIBUTE_DIRECTORY);}