X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpwrite.c;h=220b7ea7498eee4dafcf5ee8b57b6b99c5d12d87;hb=d462d9f08cc8fd534ccae14c878f9c7c18112237;hp=4a913571dec973c5c0e7815f1c91b01e90742f79;hpb=872abb203f6a4ddde61e37912d97e622b89a2f7a;p=gnulib.git diff --git a/lib/pwrite.c b/lib/pwrite.c index 4a913571d..220b7ea74 100644 --- a/lib/pwrite.c +++ b/lib/pwrite.c @@ -1,6 +1,6 @@ /* 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-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -24,25 +24,9 @@ #include -#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. */ @@ -78,5 +62,3 @@ pwrite (int fd, const void *buf, size_t nbyte, off_t offset) return result; } - -#endif