[PATCH 2/5] os: Remove unused pread/pwrite functions
Mikhail Gusarov
dottedmag at dottedmag.net
Fri Jun 11 11:22:48 PDT 2010
Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
os/utils.c | 33 ---------------------------------
1 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/os/utils.c b/os/utils.c
index 92bfad3..2678d24 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1874,37 +1874,4 @@ lockit (int fd, short what)
(void)fcntl (fd, F_SETLKW, &lck);
}
-
-/* SCO OpenServer 5 lacks pread/pwrite. Emulate them. */
-ssize_t
-pread (int fd, void *buf, size_t nbytes, off_t offset)
-{
- off_t saved;
- ssize_t ret;
-
- lockit (fd, F_RDLCK);
- saved = lseek (fd, 0, SEEK_CUR);
- lseek (fd, offset, SEEK_SET);
- ret = read (fd, buf, nbytes);
- lseek (fd, saved, SEEK_SET);
- lockit (fd, F_UNLCK);
-
- return ret;
-}
-
-ssize_t
-pwrite (int fd, const void *buf, size_t nbytes, off_t offset)
-{
- off_t saved;
- ssize_t ret;
-
- lockit (fd, F_WRLCK);
- saved = lseek (fd, 0, SEEK_CUR);
- lseek (fd, offset, SEEK_SET);
- ret = write (fd, buf, nbytes);
- lseek (fd, saved, SEEK_SET);
- lockit (fd, F_UNLCK);
-
- return ret;
-}
#endif /* __SCO__ */
--
1.7.1
More information about the xorg-devel
mailing list