File: pwrite.c

package info (click to toggle)
libnbcompat 20240319-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: ansic: 18,476; sh: 3,046; makefile: 92; awk: 20
file content (12 lines) | stat: -rw-r--r-- 318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
/* $NetBSD: pwrite.c,v 1.1 2010/04/20 00:32:23 joerg Exp $ */

static ssize_t
working_pwrite(int fd, const void *buf, size_t nbytes, off_t off)
{
	if (lseek(fd, off, SEEK_SET) == -1)
		return -1;
	return write(fd, buf, nbytes);
}

#undef pwrite
#define	pwrite(fd, buf, nbytes, off) working_pwrite(fd, buf, nbytes,off)