From 2eb19f526164a978c373a760deb30854d56b62ce Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 30 Oct 2009 16:10:45 +0000 Subject: New API calls: truncate, truncate_size, mkdir_mode, utimens, lchown. truncate, truncate_size: Used to truncate files to a particular size, or to zero bytes. mkdir_mode: Like mkdir but allows you to also specify the initial permissions for the new directory. utimens: Set timestamp on a file with nanosecond accuracy. lchown: Corresponding to lchown(2) syscall (we already have chown). The implementation is complicated by the fact that we had to add an Int64 parameter type to the generator. --- daemon/dir.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'daemon/dir.c') diff --git a/daemon/dir.c b/daemon/dir.c index 1ca62868..b603cfd0 100644 --- a/daemon/dir.c +++ b/daemon/dir.c @@ -99,6 +99,23 @@ do_mkdir (const char *path) return 0; } +int +do_mkdir_mode (const char *path, int mode) +{ + int r; + + CHROOT_IN; + r = mkdir (path, mode); + CHROOT_OUT; + + if (r == -1) { + reply_with_perror ("mkdir_mode: %s", path); + return -1; + } + + return 0; +} + static int recursive_mkdir (const char *path) { -- cgit