2 * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 #include <fs_interface.h>
8 #include <NodeMonitor.h>
14 #include <errno_private.h>
17 #define RETURN_AND_SET_ERRNO(err) \
26 truncate(const char *path
, off_t newSize
)
31 stat
.st_size
= newSize
;
32 status
= _kern_write_stat(-1, path
, true, &stat
, sizeof(struct stat
),
35 RETURN_AND_SET_ERRNO(status
);
40 ftruncate(int fd
, off_t newSize
)
45 stat
.st_size
= newSize
;
46 status
= _kern_write_stat(fd
, NULL
, false, &stat
, sizeof(struct stat
),
49 RETURN_AND_SET_ERRNO(status
);