xref: /netbsd-src/lib/libc/sys/fdiscard.c (revision 724e214f8deb5694564227396853fc116e940ec2)
1*724e214fSmanu /*	$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $ */
2*724e214fSmanu 
3*724e214fSmanu /*
4*724e214fSmanu  * Copyright (c) 2014 The NetBSD Foundation, Inc.
5*724e214fSmanu  * All rights reserved.
6*724e214fSmanu  *
7*724e214fSmanu  * This code is derived from software contributed to The NetBSD Foundation
8*724e214fSmanu  * by Emmanuel Dreyfus.
9*724e214fSmanu  *
10*724e214fSmanu  * Redistribution and use in source and binary forms, with or without
11*724e214fSmanu  * modification, are permitted provided that the following conditions
12*724e214fSmanu  * are met:
13*724e214fSmanu  * 1. Redistributions of source code must retain the above copyright
14*724e214fSmanu  *    notice, this list of conditions and the following disclaimer.
15*724e214fSmanu  * 2. Redistributions in binary form must reproduce the above copyright
16*724e214fSmanu  *    notice, this list of conditions and the following disclaimer in the
17*724e214fSmanu  *    documentation and/or other materials provided with the distribution.
18*724e214fSmanu  * 3. The name of the author may not be used to endorse or promote products
19*724e214fSmanu  *    derived from this software without specific prior written permission.
20*724e214fSmanu  *
21*724e214fSmanu  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22*724e214fSmanu  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23*724e214fSmanu  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24*724e214fSmanu  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25*724e214fSmanu  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26*724e214fSmanu  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27*724e214fSmanu  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28*724e214fSmanu  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29*724e214fSmanu  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30*724e214fSmanu  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*724e214fSmanu  * SUCH DAMAGE.
32*724e214fSmanu  */
33*724e214fSmanu 
34*724e214fSmanu #include <sys/cdefs.h>
35*724e214fSmanu #if defined(LIBC_SCCS) && !defined(lint)
36*724e214fSmanu __RCSID("$NetBSD: fdiscard.c,v 1.1 2014/09/25 15:08:29 manu Exp $");
37*724e214fSmanu #endif /* LIBC_SCCS and not lint */
38*724e214fSmanu 
39*724e214fSmanu #include <sys/types.h>
40*724e214fSmanu #include <sys/syscall.h>
41*724e214fSmanu #include <unistd.h>
42*724e214fSmanu 
43*724e214fSmanu int __fdiscard(int, int, off_t, off_t);
44*724e214fSmanu 
45*724e214fSmanu /*
46*724e214fSmanu  * 64-bit offset padding required for gcc 1.x
47*724e214fSmanu  */
48*724e214fSmanu int
fdiscard(int fd,off_t off,off_t len)49*724e214fSmanu fdiscard(int fd, off_t off, off_t len)
50*724e214fSmanu {
51*724e214fSmanu 	return __fdiscard(fd, 0, off, len);
52*724e214fSmanu }
53