145313Sdt/*
245313Sdt * Copyright (c) 1992, 1993
345313Sdt *	The Regents of the University of California.  All rights reserved.
445313Sdt *
545313Sdt * Redistribution and use in source and binary forms, with or without
645313Sdt * modification, are permitted provided that the following conditions
745313Sdt * are met:
845313Sdt * 1. Redistributions of source code must retain the above copyright
945313Sdt *    notice, this list of conditions and the following disclaimer.
1045313Sdt * 2. Redistributions in binary form must reproduce the above copyright
1145313Sdt *    notice, this list of conditions and the following disclaimer in the
1245313Sdt *    documentation and/or other materials provided with the distribution.
1345313Sdt * 4. Neither the name of the University nor the names of its contributors
1445313Sdt *    may be used to endorse or promote products derived from this software
1545313Sdt *    without specific prior written permission.
1645313Sdt *
1745313Sdt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1845313Sdt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1945313Sdt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2045313Sdt * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2145313Sdt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2245313Sdt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2345313Sdt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2445313Sdt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2545313Sdt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2645313Sdt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2745313Sdt * SUCH DAMAGE.
2845313Sdt */
2945313Sdt
3045313Sdt#if defined(LIBC_SCCS) && !defined(lint)
3145313Sdtstatic char sccsid[] = "@(#)mmap.c	8.1 (Berkeley) 6/17/93";
3245313Sdt#endif /* LIBC_SCCS and not lint */
3392986Sobrien#include <sys/cdefs.h>
3492986Sobrien__FBSDID("$FreeBSD$");
3545313Sdt
3645313Sdt#include <sys/types.h>
3745313Sdt#include <sys/syscall.h>
3845313Sdt#include <unistd.h>
39171219Speter#include "libc_private.h"
4045313Sdt
4145313Sdt/*
4245313Sdt * This function provides 64-bit offset padding that
4345313Sdt * is not supplied by GCC 1.X but is supplied by GCC 2.X.
4445313Sdt */
4545313Sdtssize_t
4645313Sdtpread(fd, buf, nbyte, offset)
4745313Sdt	int	fd;
4845313Sdt	void   *buf;
4945313Sdt	size_t	nbyte;
5045313Sdt	off_t	offset;
5145313Sdt{
52171219Speter
53171219Speter	if (__getosreldate() >= 700051)
54171219Speter		return (__sys_pread(fd, buf, nbyte, offset));
55171219Speter	else
56171219Speter		return (__sys_freebsd6_pread(fd, buf, nbyte, 0, offset));
5745313Sdt}
58