import less(1)
[unleashed/tickless.git] / usr / src / lib / libc / port / sys / stat.c
blob3a9003f71d79f6f7a22bd7d457be21f448462c00
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #include "lint.h"
28 #include <sys/types.h>
29 #include <sys/syscall.h>
30 #include <sys/stat.h>
31 #include <sys/fcntl.h>
33 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
35 int
36 fstatat64(int fd, const char *name, struct stat64 *sb, int flags)
38 return (syscall(SYS_fstatat64, fd, name, sb, flags));
41 int
42 stat64(const char *name, struct stat64 *sb)
44 return (fstatat64(AT_FDCWD, name, sb, 0));
47 int
48 lstat64(const char *name, struct stat64 *sb)
50 return (fstatat64(AT_FDCWD, name, sb, AT_SYMLINK_NOFOLLOW));
53 int
54 fstat64(int fd, struct stat64 *sb)
56 return (fstatat64(fd, NULL, sb, 0));
59 #else /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */
61 int
62 fstatat(int fd, const char *name, struct stat *sb, int flags)
64 return (syscall(SYS_fstatat, fd, name, sb, flags));
67 int
68 stat(const char *name, struct stat *sb)
70 return (fstatat(AT_FDCWD, name, sb, 0));
73 int
74 lstat(const char *name, struct stat *sb)
76 return (fstatat(AT_FDCWD, name, sb, AT_SYMLINK_NOFOLLOW));
79 int
80 fstat(int fd, struct stat *sb)
82 return (fstatat(fd, NULL, sb, 0));
85 #endif /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */