Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_tlsv12/sys/src/ape/lib/ap/plan9/lseek.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include "lib.h"
2
#include <unistd.h>
3
#include <errno.h>
4
#include "sys9.h"
5
 
6
/*
7
 * BUG: errno mapping
8
 */
9
off_t
10
lseek(int d, off_t offset, int whence)
11
{
12
	long long n;
13
	int flags;
14
 
15
	flags = _fdinfo[d].flags;
16
	if(flags&(FD_BUFFERED|FD_BUFFEREDX|FD_ISTTY)) {
17
		errno = ESPIPE;
18
		return -1;
19
	}
20
	n = _SEEK(d, offset, whence);
21
	if(n < 0)
22
		_syserrno();
23
	return n;
24
}