fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
seek.c
Go to the documentation of this file.
1#include <sys/types.h>
2#include "seek.h"
3
11off_t lseek(int fd,off_t offset,int whence);
12int ftruncate(int fd, off_t length);
13
14#define CUR 1 /* sigh */
15
17{
18 return lseek(fd,(off_t) 0,CUR);
19}
20
21#define END 2 /* sigh */
22
23int seek_end(int fd)
24{
25 if (lseek(fd,(off_t) 0,END) == -1) return -1;
26 return 0;
27}
28
29#define SET 0 /* sigh */
30
31int seek_set(int fd,seek_pos pos)
32{
33 if (lseek(fd,(off_t) pos,SET) == -1) return -1;
34 return 0;
35}
36
37int seek_trunc(int fd,seek_pos pos)
38{
39 return ftruncate(fd,(off_t) pos);
40}
int ftruncate(int fd, off_t length)
int seek_trunc(int fd, seek_pos pos)
Definition: seek.c:37
int seek_set(int fd, seek_pos pos)
Definition: seek.c:31
#define END
Definition: seek.c:21
#define SET
Definition: seek.c:29
int seek_end(int fd)
Definition: seek.c:23
seek_pos seek_cur(int fd)
Definition: seek.c:16
off_t lseek(int fd, off_t offset, int whence)
#define CUR
Definition: seek.c:14
unsigned long seek_pos
Definition: seek.h:4