2 * This Cplant(TM) source code is the property of Sandia National
5 * This Cplant(TM) source code is copyrighted by Sandia National
8 * The redistribution of this Cplant(TM) source code is subject to the
9 * terms of the GNU Lesser General Public License
10 * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
12 * Cplant(TM) Copyright 1998-2004 Sandia Corporation.
13 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
14 * license for use of this work by or on behalf of the US Government.
15 * Export of this program may require a license from the United States
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 * Questions or comments about this library should be sent to:
37 * Sandia National Laboratories, New Mexico
39 * Albuquerque, NM 87185-1110
45 * Native file system support.
51 * stat struct from asm/stat.h, as returned
52 * by alpha linux kernel
54 struct _sysio_native_stat {
58 unsigned int st_nlink;
63 unsigned long st_atime;
64 unsigned long st_mtime;
65 unsigned long st_ctime;
66 unsigned int st_blksize;
68 unsigned int st_flags;
72 #define SYSIO_COPY_STAT(src, dest) \
74 memset((dest), 0, sizeof((*dest))); \
75 (dest)->st_dev = (src)->st_dev; \
76 (dest)->st_ino = (src)->st_ino; \
77 (dest)->st_mode = (src)->st_mode; \
78 (dest)->st_nlink = (src)->st_nlink; \
79 (dest)->st_uid = (src)->st_uid; \
80 (dest)->st_gid = (src)->st_gid; \
81 (dest)->st_rdev = (src)->st_rdev; \
82 (dest)->st_size = (src)->st_size; \
83 (dest)->st_atime = (src)->st_atime; \
84 (dest)->st_mtime = (src)->st_mtime; \
85 (dest)->st_ctime = (src)->st_ctime; \
86 (dest)->st_blksize = (src)->st_blksize; \
87 (dest)->st_blocks = (src)->st_blocks; \
88 (dest)->st_flags = (src)->st_flags; \
89 (dest)->st_gen = (src)->st_gen; \
93 #define _sysio_native_stat intnl_stat
94 #define SYSIO_COPY_STAT(src, dest) *(dest) = *(src)
100 #if _LARGEFILE64_SOURCE && defined(SYS_lstat64)
101 #define SYSIO_SYS_stat SYS_lstat64
102 #elif defined(SYS_lstat)
103 #define SYSIO_SYS_stat SYS_lstat
105 #if _LARGEFILE64_SOURCE && defined(SYS_fstat64)
106 #define SYSIO_SYS_fstat SYS_fstat64
107 #elif defined(SYS_fstat)
108 #define SYSIO_SYS_fstat SYS_fstat
110 #if _LARGEFILE64_SOURCE && defined(SYS_truncate64)
111 #define SYSIO_SYS_truncate SYS_truncate64
112 #elif defined(SYS_truncate)
113 #define SYSIO_SYS_truncate SYS_truncate
115 #if _LARGEFILE64_SOURCE && defined(SYS_ftruncate64)
116 #define SYSIO_SYS_ftruncate SYS_ftruncate64
117 #elif defined(SYS_ftruncate)
118 #define SYSIO_SYS_ftruncate SYS_ftruncate
120 #if defined(SYS_open)
121 #define SYSIO_SYS_open SYS_open
123 #if defined(SYS_close)
124 #define SYSIO_SYS_close SYS_close
126 #if _LARGEFILE64_SOURCE && defined(SYS_lseek64)
127 #define SYSIO_SYS_lseek SYS_lseek64
128 #elif defined(SYS_lseek)
129 #define SYSIO_SYS_lseek SYS_lseek
131 #if defined(SYS__llseek)
132 #define SYSIO_SYS__llseek SYS__llseek
134 #if defined(SYS_read)
135 #define SYSIO_SYS_read SYS_read
137 #if defined(SYS_write)
138 #define SYSIO_SYS_write SYS_write
140 #if defined(SYS_readv)
141 #define SYSIO_SYS_readv SYS_readv
143 #if defined(SYS_writev)
144 #define SYSIO_SYS_writev SYS_writev
146 #if _LARGEFILE64_SOURCE && defined(SYS_pread64)
147 #define SYSIO_SYS_pread SYS_pread64
148 #elif defined(SYS_pread)
149 #define SYSIO_SYS_pread SYS_pread
151 #if _LARGEFILE64_SOURCE && defined(SYS_pwrite64)
152 #define SYSIO_SYS_pwrite SYS_pwrite64
153 #elif defined(SYS_pwrite)
154 #define SYSIO_SYS_pwrite SYS_pwrite
156 #if _LARGEFILE64_SOURCE && defined(SYS_fcntl64)
157 #define SYSIO_SYS_fcntl SYS_fcntl64
158 #elif defined(SYS_fcntl)
159 #define SYSIO_SYS_fcntl SYS_fcntl
161 #if defined(SYS_fsync)
162 #define SYSIO_SYS_fsync SYS_fsync
164 #if ALPHA_LINUX && defined(SYS_osf_fdatasync)
165 #define SYSIO_SYS_fdatasync SYS_osf_fdatasync
166 #elif defined(SYS_fdatasync)
167 #define SYSIO_SYS_fdatasync SYS_fdatasync
169 #if defined(SYS_chmod)
170 #define SYSIO_SYS_chmod SYS_chmod
172 #if defined(SYS_fchmod)
173 #define SYSIO_SYS_fchmod SYS_fchmod
175 #if defined(SYS_chown)
176 #define SYSIO_SYS_chown SYS_chown
178 #if defined(SYS_fchown)
179 #define SYSIO_SYS_fchown SYS_fchown
181 #if defined(SYS_umask)
182 #define SYSIO_SYS_umask SYS_umask
184 #if defined(SYS_mkdir)
185 #define SYSIO_SYS_mkdir SYS_mkdir
187 #if defined(SYS_rmdir)
188 #define SYSIO_SYS_rmdir SYS_rmdir
190 #if defined(SYS_getdirentries)
191 #if _LARGEFILE64_SOURCE && defined(SYS_getdirentries64)
192 #define SYSIO_SYS_getdirentries SYS_getdirentries64
193 #elif defined(SYS_getdirentries)
194 #define SYSIO_SYS_getdirentries SYS_getdirentries
197 #if _LARGEFILE64_SOURCE && defined(SYS_getdents64)
198 #define SYSIO_SYS_getdents64 SYS_getdents64
199 #elif defined(SYS_getdents)
200 #define SYSIO_SYS_getdents SYS_getdents
202 #if defined(SYS_link)
203 #define SYSIO_SYS_link SYS_link
205 #if defined(SYS_unlink)
206 #define SYSIO_SYS_unlink SYS_unlink
208 #if defined(SYS_symlink)
209 #define SYSIO_SYS_symlink SYS_symlink
211 #if defined(SYS_rename)
212 #define SYSIO_SYS_rename SYS_rename
214 #if defined(SYS_readlink)
215 #define SYSIO_SYS_readlink SYS_readlink
217 #if defined(SYS_utimes)
218 #define SYSIO_SYS_utimes SYS_utimes
220 #if defined(SYS_utime)
221 #define SYSIO_SYS_utime SYS_utime
223 #if defined(SYS_socketcall)
224 #define SYSIO_SYS_socketcall SYS_socketcall
226 #if defined(SYS_socket)
227 #define SYSIO_SYS_socket SYS_socket
229 #if defined(SYS_accept)
230 #define SYSIO_SYS_accept SYS_accept
232 #if defined(SYS_bind)
233 #define SYSIO_SYS_bind SYS_bind
235 #if defined(SYS_listen)
236 #define SYSIO_SYS_listen SYS_listen
238 #if defined(SYS_connect)
239 #define SYSIO_SYS_connect SYS_connect
241 #if defined(SYS_ioctl)
242 #define SYSIO_SYS_ioctl SYS_ioctl