[PATCH 2/5] os: Remove unused pread/pwrite functions
Jamey Sharp
jamey at minilop.net
Fri Jun 11 11:46:13 PDT 2010
Reviewed-by: Jamey Sharp <jamey at minilop.net>
I'd suggest squashing the deletion of lockit into this patch too, so
the entire __SCO__ block goes away together.
It looks like the last use of pread in xserver was deleted when xprint
went away, and I can't find any uses of pwrite in the git history.
Neither is currently used by any driver either, though I'm not sure
about libraries used by the server or drivers. I guess implementing
pread/pwrite is the library's problem if it needs it though.
On Fri, Jun 11, 2010 at 11:22 AM, Mikhail Gusarov
<dottedmag at dottedmag.net> wrote:
> 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
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list