11.1Smanu/*	$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $ */
21.1Smanu
31.1Smanu/*
41.1Smanu * Copyright (c) 2014 The NetBSD Foundation, Inc.
51.1Smanu * All rights reserved.
61.1Smanu *
71.1Smanu * This code is derived from software contributed to The NetBSD Foundation
81.1Smanu * by Emmanuel Dreyfus.
91.1Smanu *
101.1Smanu * Redistribution and use in source and binary forms, with or without
111.1Smanu * modification, are permitted provided that the following conditions
121.1Smanu * are met:
131.1Smanu * 1. Redistributions of source code must retain the above copyright
141.1Smanu *    notice, this list of conditions and the following disclaimer.
151.1Smanu * 2. Redistributions in binary form must reproduce the above copyright
161.1Smanu *    notice, this list of conditions and the following disclaimer in the
171.1Smanu *    documentation and/or other materials provided with the distribution.
181.1Smanu * 3. The name of the author may not be used to endorse or promote products
191.1Smanu *    derived from this software without specific prior written permission.
201.1Smanu *
211.1Smanu * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
221.1Smanu * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
231.1Smanu * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
241.1Smanu * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
251.1Smanu * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
261.1Smanu * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
271.1Smanu * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
281.1Smanu * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
291.1Smanu * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301.1Smanu * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311.1Smanu * SUCH DAMAGE.
321.1Smanu */
331.1Smanu
341.1Smanu#include <sys/cdefs.h>
351.1Smanu#if defined(LIBC_SCCS) && !defined(lint)
361.1Smanu__RCSID("$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $");
371.1Smanu#endif /* LIBC_SCCS and not lint */
381.1Smanu
391.1Smanu#include <sys/types.h>
401.1Smanu#include <sys/syscall.h>
411.1Smanu#include <unistd.h>
421.1Smanu
431.1Smanuint __fdiscard(int, int, off_t, off_t);
441.1Smanu
451.1Smanu/*
461.1Smanu * 64-bit offset padding required for gcc 1.x
471.1Smanu */
481.1Smanuint
491.1Smanufdiscard(int fd, off_t off, off_t len)
501.1Smanu{
511.1Smanu	return __fdiscard(fd, 0, off, len);
521.1Smanu}
53