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 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 #include <sys/types.h>
29 #include <sys/syscall.h>
31 #include <sys/fcntl.h>
33 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
36 fstatat64(int fd
, const char *name
, struct stat64
*sb
, int flags
)
38 return (syscall(SYS_fstatat64
, fd
, name
, sb
, flags
));
42 stat64(const char *name
, struct stat64
*sb
)
44 return (fstatat64(AT_FDCWD
, name
, sb
, 0));
48 lstat64(const char *name
, struct stat64
*sb
)
50 return (fstatat64(AT_FDCWD
, name
, sb
, AT_SYMLINK_NOFOLLOW
));
54 fstat64(int fd
, struct stat64
*sb
)
56 return (fstatat64(fd
, NULL
, sb
, 0));
59 #else /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */
62 fstatat(int fd
, const char *name
, struct stat
*sb
, int flags
)
64 return (syscall(SYS_fstatat
, fd
, name
, sb
, flags
));
68 stat(const char *name
, struct stat
*sb
)
70 return (fstatat(AT_FDCWD
, name
, sb
, 0));
74 lstat(const char *name
, struct stat
*sb
)
76 return (fstatat(AT_FDCWD
, name
, sb
, AT_SYMLINK_NOFOLLOW
));
80 fstat(int fd
, struct stat
*sb
)
82 return (fstatat(fd
, NULL
, sb
, 0));
85 #endif /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */