source: trunk/minix/lib/posix/_truncate.c@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 443 bytes
Line 
1#include <lib.h>
2#include <string.h>
3#define truncate _truncate
4#define ftruncate _ftruncate
5#include <unistd.h>
6
7PUBLIC int truncate(const char *_path, off_t _length)
8{
9 message m;
10 m.m2_p1 = (char *) _path;
11 m.m2_i1 = strlen(_path)+1;
12 m.m2_l1 = _length;
13
14 return(_syscall(FS, TRUNCATE, &m));
15}
16
17PUBLIC int ftruncate(int _fd, off_t _length)
18{
19 message m;
20 m.m2_l1 = _length;
21 m.m2_i1 = _fd;
22
23 return(_syscall(FS, FTRUNCATE, &m));
24}
Note: See TracBrowser for help on using the repository browser.