diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-12-10 16:43:30 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-12-10 16:43:30 +0000 |
commit | cbfb7b1b23fe1e382298b45cbcb214c8d088ac77 (patch) | |
tree | f6d910bd202c12e32ec9561900b61b35ecdaca60 /winsup/cygwin/path.h | |
parent | 6c64fb2fda86ae252db928f9e5595463b2ae36c5 (diff) | |
download | cygnal-cbfb7b1b23fe1e382298b45cbcb214c8d088ac77.tar.gz cygnal-cbfb7b1b23fe1e382298b45cbcb214c8d088ac77.tar.bz2 cygnal-cbfb7b1b23fe1e382298b45cbcb214c8d088ac77.zip |
* autoload.cc (SHFileOperationA): Drop definition.
* ntdll.h (struct _FILE_RENAME_INFORMATION): Define.
* path.cc (fs_info::update): Note length of rootdir prefix in
root_len.
(get_nt_native_path): New function, taking over functionality of
path_conv::get_nt_native_path.
(path_conv::get_nt_native_path): Just call get_nt_native_path.
* path.h (get_nt_native_path): Declare.
(struct fs_info): New member root_len.
(fs_info::length): New inline method returning root_len.
(path_conv::rootdir): New inline method returning rootdir prefix.
* syscalls.cc (try_to_bin): Rewrite using only system calls.
(unlink_nt): Call try_to_bin with additional handle to open file
parameter.
(statvfs): Use path_conv::rootdir method.
* wincap.h: Define has_recycle_dot_bin throughout.
* wincap.cc: Ditto.
Diffstat (limited to 'winsup/cygwin/path.h')
-rw-r--r-- | winsup/cygwin/path.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index e011575f2..9b4c85ea2 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -15,6 +15,8 @@ details. */ #include <fcntl.h> #include <ntdef.h> +extern PUNICODE_STRING get_nt_native_path (const char *, UNICODE_STRING &); + inline bool has_attribute (DWORD attributes, DWORD attribs_to_test) { @@ -85,6 +87,7 @@ class symlink_info; struct fs_info { private: + int root_len; __ino64_t name_hash; struct status_flags { @@ -106,6 +109,7 @@ struct fs_info void clear () { name_hash = 0; + root_len = 0; flags () = serial () = 0; is_remote_drive (false); has_buggy_open (false); @@ -121,6 +125,7 @@ struct fs_info } inline DWORD& flags () {return status.flags;}; inline DWORD& serial () {return status.serial;}; + inline int length () const {return root_len;} IMPLEMENT_STATUS_FLAG (bool, is_remote_drive) IMPLEMENT_STATUS_FLAG (bool, has_buggy_open) @@ -150,6 +155,17 @@ class path_conv device dev; bool case_clash; + int rootdir (char *buf) const + { + if (!fs.length ()) + return fs.length (); + strncpy (buf, path, fs.length ()); + /* The length is always stored with trailing backslash. Make sure the + backslash is actually present in the returned path. */ + buf[fs.length () - 1] = '\\'; + buf[fs.length ()] = '\0'; + return fs.length (); + } bool isremote () const {return fs.is_remote_drive ();} bool has_acls () const {return fs.has_acls (); } bool hasgood_inode () const {return fs.hasgood_inode (); } |