aboutsummaryrefslogtreecommitdiff
path: root/winsup/utils
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-03-08 21:54:58 +0100
committerCorinna Vinschen <corinna@vinschen.de>2024-03-08 21:54:58 +0100
commit06aa5a751682118ef1d7f2456f8937b4ac181fac (patch)
treee1713ac629843aec0d175f2ba379df3324a1e477 /winsup/utils
parent2100c6ef0dee120c316b7bea42bf5e93c281e808 (diff)
downloadnewlib-06aa5a751682118ef1d7f2456f8937b4ac181fac.zip
newlib-06aa5a751682118ef1d7f2456f8937b4ac181fac.tar.gz
newlib-06aa5a751682118ef1d7f2456f8937b4ac181fac.tar.bz2
Cygwin: FS_IOC_[GS]ETFLAGS: handle pinned and unpinned attributes
Add FS_PINNED_FL and FS_UNPINNED_FL flags and handle them with mode bits 'p' and 'u' in chattr(1) and lsattr(1). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/chattr.c8
-rw-r--r--winsup/utils/lsattr.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/winsup/utils/chattr.c b/winsup/utils/chattr.c
index 4b07413..4ba9771 100644
--- a/winsup/utils/chattr.c
+++ b/winsup/utils/chattr.c
@@ -53,10 +53,12 @@ struct
{ FS_OFFLINE_FL, 'o', NULL },
{ FS_NOTINDEXED_FL, 'n', "Notindexed" },
{ FS_ENCRYPT_FL, 'e', "Encrypted" },
+ { FS_PINNED_FL, 'p', "Pinned" },
+ { FS_UNPINNED_FL, 'u', "Unpinned" },
{ FS_CASESENS_FL, 'C', "Casesensitive" },
{ 0, '\0', NULL },
};
-const char *supp_list = "rhsatSrconeC";
+const char *supp_list = "rhsatSrconepuC";
void
print_flags (uint64_t flags)
@@ -245,7 +247,7 @@ usage (FILE *stream)
" -H, --help this help text\n"
" -v, --version display the program version\n"
"\n"
- "The format of 'mode' is {+-=}[acCehnrsSt]\n"
+ "The format of 'mode' is {+-=}[acCehnprsStu]\n"
"\n"
"The operator '+' causes the selected attributes to be added to the\n"
"existing attributes of the files; '-' causes them to be removed; and\n"
@@ -264,6 +266,8 @@ usage (FILE *stream)
" 'n', 'Notindexed': file or directory is not to be indexed by the\n"
" content indexing service\n"
" 'e', 'Encrypted': file is encrypted\n"
+ " 'p', 'Pinned': file is pinned\n"
+ " 'u', 'Unpinned': file is unpinned\n"
" 'C', 'Casesensitive': directory is handled case sensitive\n");
exit (stream == stdout ? 0 : 1);
}
diff --git a/winsup/utils/lsattr.c b/winsup/utils/lsattr.c
index 7002280..50935f6 100644
--- a/winsup/utils/lsattr.c
+++ b/winsup/utils/lsattr.c
@@ -53,6 +53,8 @@ struct
{ FS_OFFLINE_FL, 'o', "Offline" },
{ FS_NOTINDEXED_FL, 'n', "Notindexed" },
{ FS_ENCRYPT_FL, 'e', "Encrypted" },
+ { FS_PINNED_FL, 'p', "Pinned" },
+ { FS_UNPINNED_FL, 'u', "Unpinned" },
{ FS_CASESENS_FL, 'C', "Casesensitive" },
{ 0, '\0', NULL },
};
@@ -218,6 +220,8 @@ usage (FILE *stream)
" 'n', 'Notindexed': file or directory is not to be indexed by the\n"
" content indexing service\n"
" 'e', 'Encrypted': file is encrypted\n"
+ " 'p', 'Pinned': file is pinned\n"
+ " 'u', 'Unpinned': file is unpinned\n"
" 'C', 'Casesensitive': directory is handled case sensitive\n"
" (Windows 10 1803 or later, local NTFS only,\n"
" WSL must be installed)\n");
@@ -284,7 +288,7 @@ main (int argc, char **argv)
ret = 1;
}
else if (lsattr (argv[optind]))
- ret = 1;
+ ret = 1;
}
return ret;
}