GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/local/fehQlibs-23/seek.c
#include <sys/types.h>
#include "seek.h"

/**
	@file seek.c
	@author djb
	@source qmail
	@brief seek in an open file descritor
*/

off_t lseek(int fd,off_t offset,int whence);
int ftruncate(int fd, off_t length);

#define CUR 1 /* sigh */

seek_pos seek_cur(int fd)
{ return lseek(fd,(off_t) 0,CUR); }

#define END 2 /* sigh */

int seek_end(int fd)
{ if (lseek(fd,(off_t) 0,END) == -1) return -1; return 0; }

#define SET 0 /* sigh */

int seek_set(int fd,seek_pos pos)
{ if (lseek(fd,(off_t) pos,SET) == -1) return -1; return 0; }

int seek_trunc(int fd,seek_pos pos)
{ return ftruncate(fd,(off_t) pos); }