4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/types.h>
36 * SUSv3 - file advisory information
38 * This function does nothing, but that's OK because the
39 * Posix specification doesn't require it to do anything
40 * other than return appropriate error numbers.
42 * In the future, a file system dependent fadvise() or fcntl()
43 * interface, similar to madvise(), should be developed to enable
44 * the kernel to optimize I/O operations based on the given advice.
49 posix_fadvise(int fd
, off_t offset
, off_t len
, int advice
)
54 case POSIX_FADV_NORMAL
:
55 case POSIX_FADV_RANDOM
:
56 case POSIX_FADV_SEQUENTIAL
:
57 case POSIX_FADV_WILLNEED
:
58 case POSIX_FADV_DONTNEED
:
59 case POSIX_FADV_NOREUSE
:
66 if (fstat64(fd
, &statb
) != 0)
68 if (S_ISFIFO(statb
.st_mode
))
77 posix_fadvise64(int fd
, off64_t offset
, off64_t len
, int advice
)
82 case POSIX_FADV_NORMAL
:
83 case POSIX_FADV_RANDOM
:
84 case POSIX_FADV_SEQUENTIAL
:
85 case POSIX_FADV_WILLNEED
:
86 case POSIX_FADV_DONTNEED
:
87 case POSIX_FADV_NOREUSE
:
94 if (fstat64(fd
, &statb
) != 0)
96 if (S_ISFIFO(statb
.st_mode
))