@@ -86,6 +86,9 @@ int mkdirat(int, const char *, mode_t);
int mknodat(int, const char *, mode_t, dev_t);
int mkfifoat(int, const char *, mode_t);
+#ifdef _BSD_SOURCE
+int lchmod(const char *, mode_t);
+#endif
#ifdef __cplusplus
}
@@ -0,0 +1,7 @@
+#include <sys/stat.h>
+#include <fcntl.h>
+
+int lchmod(const char *path, mode_t mode)
+{
+ return fchmodat(AT_FDCWD, path, mode, AT_SYMLINK_NOFOLLOW);
+}