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:
authorCorinna Vinschen <corinna@vinschen.de>2010-10-02 23:03:44 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-10-02 23:03:44 +0400
commit1da77c2678b3f69f2bc212e79df6432a9fffb61c (patch)
tree8555f453d363cac9164bc18873759a7fb9c11ed8 /winsup/cygwin/nfs.cc
parent1d694d8e5c51b5290f52f8ba1a410b686b2b333f (diff)
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Simplify.
Just call nfs_fetch_fattr3 if called via fstat. * nfs.cc (nfs_fetch_fattr3): New function to fetch NFS fattr3 info from file handle. * nfs.h (nfs_fetch_fattr3): Declare. * path.cc (symlink_info::check): Simplify NFS case. Just call nfs_fetch_fattr3.
Diffstat (limited to 'winsup/cygwin/nfs.cc')
-rw-r--r--winsup/cygwin/nfs.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/winsup/cygwin/nfs.cc b/winsup/cygwin/nfs.cc
index 46face17e..32d9ad2bf 100644
--- a/winsup/cygwin/nfs.cc
+++ b/winsup/cygwin/nfs.cc
@@ -1,6 +1,6 @@
/* nfs.cc
- Copyright 2008 Red Hat, Inc.
+ Copyright 2008, 2010 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@@ -9,6 +9,7 @@ details. */
#include "winsup.h"
#include "sys/fcntl.h"
#include "nfs.h"
+#include "ntdll.h"
struct nfs_aol_ffei_t nfs_aol_ffei = { 0, 0, sizeof (NFS_ACT_ON_LINK) - 1, 0,
NFS_ACT_ON_LINK };
@@ -16,3 +17,31 @@ struct nfs_aol_ffei_t nfs_aol_ffei = { 0, 0, sizeof (NFS_ACT_ON_LINK) - 1, 0,
uint32_t nfs_type_mapping[] = { 0, S_IFREG, S_IFDIR, S_IFBLK,
S_IFCHR, S_IFLNK, S_IFSOCK, S_IFIFO };
+NTSTATUS
+nfs_fetch_fattr3 (HANDLE h, fattr3 *fattr_buf)
+{
+ struct {
+ FILE_FULL_EA_INFORMATION ffei;
+ char buf[sizeof (NFS_V3_ATTR) + sizeof (fattr3)];
+ } ffei_buf;
+ struct {
+ FILE_GET_EA_INFORMATION fgei;
+ char buf[sizeof (NFS_V3_ATTR)];
+ } fgei_buf;
+ NTSTATUS status;
+ IO_STATUS_BLOCK io;
+
+ fgei_buf.fgei.NextEntryOffset = 0;
+ fgei_buf.fgei.EaNameLength = sizeof (NFS_V3_ATTR) - 1;
+ stpcpy (fgei_buf.fgei.EaName, NFS_V3_ATTR);
+ status = NtQueryEaFile (h, &io, &ffei_buf.ffei, sizeof ffei_buf, TRUE,
+ &fgei_buf.fgei, sizeof fgei_buf, NULL, TRUE);
+ if (NT_SUCCESS (status))
+ {
+ fattr3 *nfs_attr = (fattr3 *) (ffei_buf.ffei.EaName
+ + ffei_buf.ffei.EaNameLength + 1);
+ if (fattr_buf)
+ memcpy (fattr_buf, nfs_attr, sizeof (fattr3));
+ }
+ return status;
+}