mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
fuse: Implement write syscall (RHBZ#592883).
This commit is contained in:
@@ -653,7 +653,17 @@ fg_write (const char *path, const char *buf, size_t size,
|
||||
|
||||
dir_cache_invalidate (path);
|
||||
|
||||
return -ENOSYS; /* XXX */
|
||||
/* See fg_read. */
|
||||
const size_t limit = 2 * 1024 * 1024;
|
||||
if (size > limit)
|
||||
size = limit;
|
||||
|
||||
int r;
|
||||
r = guestfs_pwrite (g, path, buf, size, offset);
|
||||
if (r == -1)
|
||||
return error ();
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -207,6 +207,17 @@ for ts in 12345 1234567 987654321; do
|
||||
[ "$(stat -c %Y timestamp)" -eq $ts ]
|
||||
done
|
||||
|
||||
stage Checking writes
|
||||
cp hello.txt copy.txt
|
||||
echo >> copy.txt
|
||||
echo world >> copy.txt
|
||||
echo bigger >> copy.txt
|
||||
echo biggest >> copy.txt
|
||||
[ "$(cat copy.txt)" = "hello
|
||||
world
|
||||
bigger
|
||||
biggest" ]
|
||||
|
||||
# These ones are not yet tested by the current script:
|
||||
#stage XXX statfs/statvfs
|
||||
#stage XXX xattr operations
|
||||
|
||||
Reference in New Issue
Block a user