diff options
author | Richard Jones <rjones@redhat.com> | 2009-10-30 16:10:45 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-11-02 16:37:51 +0000 |
commit | 2eb19f526164a978c373a760deb30854d56b62ce (patch) | |
tree | 33798414007f6d8bdf78e6cef6a354efad642f18 /daemon/file.c | |
parent | 00425c073e5c0743ef425cd12108a85ac36b15f4 (diff) | |
download | libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.tar.gz libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.tar.xz libguestfs-2eb19f526164a978c373a760deb30854d56b62ce.zip |
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.
Diffstat (limited to 'daemon/file.c')
-rw-r--r-- | daemon/file.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/daemon/file.c b/daemon/file.c index 212aff28..7e2f062a 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -232,6 +232,23 @@ do_chown (int owner, int group, const char *path) } int +do_lchown (int owner, int group, const char *path) +{ + int r; + + CHROOT_IN; + r = lchown (path, owner, group); + CHROOT_OUT; + + if (r == -1) { + reply_with_perror ("lchown: %s: %d.%d", path, owner, group); + return -1; + } + + return 0; +} + +int do_exists (const char *path) { int r; |