summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-27 09:48:22 +0100
committerRichard Jones <rjones@redhat.com>2010-05-27 09:48:22 +0100
commit6b500f1b8e1ac8d28c485a5591c2833b18cc86e2 (patch)
treeb9d7bf6181bd281ee3d5a78a7cef890b9efc1cc9 /daemon
parentc1e3cff523d72e8110cbc568a3c280e57c2aabca (diff)
downloadlibguestfs-6b500f1b8e1ac8d28c485a5591c2833b18cc86e2.tar.gz
libguestfs-6b500f1b8e1ac8d28c485a5591c2833b18cc86e2.tar.xz
libguestfs-6b500f1b8e1ac8d28c485a5591c2833b18cc86e2.zip
New API: fallocate64 (replaces fallocate).
guestfs_fallocate takes an integer for the length, effectively limiting it to creating 1GB files. This new call takes an int64_t for the length, but is otherwise identical.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/fallocate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/daemon/fallocate.c b/daemon/fallocate.c
index 49474307..0c948fff 100644
--- a/daemon/fallocate.c
+++ b/daemon/fallocate.c
@@ -31,6 +31,17 @@
int
do_fallocate (const char *path, int len)
{
+ if (len < 0) {
+ reply_with_error ("length < 0");
+ return -1;
+ }
+
+ return do_fallocate64 (path, len);
+}
+
+int
+do_fallocate64 (const char *path, int64_t len)
+{
int fd;
CHROOT_IN;