23 int chmod(
char const* fn,
int am) {
24 return _chmod(fn, am);
27 int fchmod(
int fd, mode_t
mode) {
28 HANDLE
h = (HANDLE)_get_osfhandle(fd);
29 if (h == INVALID_HANDLE_VALUE) {
33 FILE_ATTRIBUTE_TAG_INFO attr{};
34 if (!GetFileInformationByHandleEx(
35 h, FileAttributeTagInfo, &attr,
sizeof(attr))) {
39 if (mode & _S_IWRITE) {
40 attr.FileAttributes &= ~FILE_ATTRIBUTE_READONLY;
42 attr.FileAttributes |= FILE_ATTRIBUTE_READONLY;
45 if (!SetFileInformationByHandle(
46 h, FileAttributeTagInfo, &attr,
sizeof(attr))) {
54 int lstat(
const char* path,
struct stat* st) {
55 return stat(path, st);
58 int mkdir(
const char* fn,
int ) {
folly::Optional< PskKeyExchangeMode > mode