/* Write block to given position in file without changing file pointer.
POSIX version.
- Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997-1999, 2002, 2011-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
#include <errno.h>
-#if HAVE_PWRITE
-
-ssize_t
-pwrite (int fd, const void *buf, size_t nbyte, off_t offset)
-# undef pwrite
-{
- if (offset < 0)
- {
- errno = EINVAL;
- return -1;
- }
- return pwrite (fd, buf, nbyte, offset);
-}
-
-#else
-
-# define __libc_lseek(f,o,w) lseek (f, o, w)
-# define __set_errno(Val) errno = (Val)
-# define __libc_write(f,b,n) write (f, b, n)
+#define __libc_lseek(f,o,w) lseek (f, o, w)
+#define __set_errno(Val) errno = (Val)
+#define __libc_write(f,b,n) write (f, b, n)
/* Note: This implementation of pwrite is not multithread-safe. */
return result;
}
-
-#endif