diff options
Diffstat (limited to 'src/libstddjb/seek_set.c')
-rw-r--r-- | src/libstddjb/seek_set.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstddjb/seek_set.c b/src/libstddjb/seek_set.c new file mode 100644 index 0000000..b5883ac --- /dev/null +++ b/src/libstddjb/seek_set.c @@ -0,0 +1,13 @@ +/* ISC license. */ + +#include <sys/types.h> +#include <unistd.h> +#include <skalibs/djbunix.h> + +#define SET 0 /* sigh */ + +int seek_set (int fd, long pos) +{ + if (lseek(fd, (off_t) pos, SET) == -1) return -1 ; + return 0 ; +} |