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

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Native/Unix/System.Native/pal_io.c')
-rw-r--r--src/Native/Unix/System.Native/pal_io.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c
index c3b5aff83b..ddd56b91c9 100644
--- a/src/Native/Unix/System.Native/pal_io.c
+++ b/src/Native/Unix/System.Native/pal_io.c
@@ -166,6 +166,12 @@ static void ConvertFileStatus(const struct stat_* src, struct FileStatus* dst)
dst->BirthTime = 0;
dst->BirthTimeNsec = 0;
#endif
+
+#if defined(HAVE_STAT_FLAGS) && defined(UF_HIDDEN)
+ dst->UserFlags = ((src->st_flags & UF_HIDDEN) == UF_HIDDEN) ? PAL_UF_HIDDEN : 0;
+#else
+ dst->UserFlags = 0;
+#endif
}
// CoreCLR expects the "2" suffixes on these: they should be cleaned up in our
@@ -1460,6 +1466,28 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length,
return ret;
}
+int32_t SystemNative_LChflags(const char* path, uint32_t flags)
+{
+#if HAVE_LCHFLAGS
+ int32_t result;
+ while ((result = lchflags(path, flags)) < 0 && errno == EINTR);
+ return result;
+#else
+ (void)path, (void)flags;
+ errno = ENOTSUP;
+ return -1;
+#endif
+}
+
+int32_t SystemNative_LChflagsCanSetHiddenFlag(void)
+{
+#if defined(UF_HIDDEN) && defined(HAVE_STAT_FLAGS) && defined(HAVE_LCHFLAGS)
+ return true;
+#else
+ return false;
+#endif
+}
+
int32_t SystemNative_Symlink(const char* target, const char* linkPath)
{
return symlink(target, linkPath);