2005-12-20 15:18:16 +01:00
|
|
|
#include <lib.h>
|
2006-01-11 18:14:51 +01:00
|
|
|
#include <string.h>
|
2005-12-20 15:18:16 +01:00
|
|
|
#define truncate _truncate
|
|
|
|
#define ftruncate _ftruncate
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
PUBLIC int truncate(const char *_path, off_t _length)
|
|
|
|
{
|
|
|
|
message m;
|
2006-01-11 18:14:51 +01:00
|
|
|
m.m2_p1 = (char *) _path;
|
|
|
|
m.m2_i1 = strlen(_path)+1;
|
|
|
|
m.m2_l1 = _length;
|
2005-12-20 15:18:16 +01:00
|
|
|
|
2010-06-08 15:58:01 +02:00
|
|
|
return(_syscall(VFS_PROC_NR, TRUNCATE, &m));
|
2005-12-20 15:18:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PUBLIC int ftruncate(int _fd, off_t _length)
|
|
|
|
{
|
|
|
|
message m;
|
2006-01-11 18:14:51 +01:00
|
|
|
m.m2_l1 = _length;
|
|
|
|
m.m2_i1 = _fd;
|
2005-12-20 15:18:16 +01:00
|
|
|
|
2010-06-08 15:58:01 +02:00
|
|
|
return(_syscall(VFS_PROC_NR, FTRUNCATE, &m));
|
2005-12-20 15:18:16 +01:00
|
|
|
}
|