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