minix/lib/libc/posix/_truncate.c
2010-06-08 13:58:01 +00:00

24 lines
461 B
C

#include <lib.h>
#include <string.h>
#define truncate _truncate
#define ftruncate _ftruncate
#include <unistd.h>
PUBLIC int truncate(const char *_path, off_t _length)
{
message m;
m.m2_p1 = (char *) _path;
m.m2_i1 = strlen(_path)+1;
m.m2_l1 = _length;
return(_syscall(VFS_PROC_NR, TRUNCATE, &m));
}
PUBLIC int ftruncate(int _fd, off_t _length)
{
message m;
m.m2_l1 = _length;
m.m2_i1 = _fd;
return(_syscall(VFS_PROC_NR, FTRUNCATE, &m));
}