J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | #ifndef _JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ |
| 27 | #define _JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ |
| 28 | |
| 29 | #include <sys/stat.h> |
| 30 | #include <sys/types.h> |
| 31 | |
| 32 | /** |
| 33 | * This file contains the definitions for providing 64 bit File I/O support. |
| 34 | */ |
| 35 | |
| 36 | #if !defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE |
| 37 | |
| 38 | #ifdef __GLIBC__ |
| 39 | typedef jlong longlong_t; |
| 40 | #endif |
| 41 | |
| 42 | /* |
| 43 | * This definition is from Solaris 2.6; it is required by systems that do not |
| 44 | * support large files (e.g., Solaris 2.5.1). |
| 45 | */ |
| 46 | |
| 47 | typedef longlong_t off64_t; /* offsets within files */ |
| 48 | |
| 49 | |
| 50 | #ifdef __GLIBC__ |
| 51 | /* Doesn't matter what these are, there is no 64 bit support. */ |
| 52 | typedef int u_longlong_t; |
| 53 | typedef int timestruc_t; |
| 54 | #define _ST_FSTYPSZ 1 |
| 55 | #endif /* __GLIBC__ */ |
| 56 | |
| 57 | /* |
| 58 | * The stat64 structure must be provided on systems without large file |
| 59 | * support (e.g., Solaris 2.5.1). These definitions are from Solaris 2.6 |
| 60 | * sys/stat.h and sys/types.h. |
| 61 | */ |
| 62 | |
| 63 | typedef u_longlong_t ino64_t; /* expanded inode type */ |
| 64 | typedef longlong_t blkcnt64_t; /* count of file blocks */ |
| 65 | |
| 66 | struct stat64 { |
| 67 | dev_t st_dev; |
| 68 | long st_pad1[3]; |
| 69 | ino64_t st_ino; |
| 70 | mode_t st_mode; |
| 71 | nlink_t st_nlink; |
| 72 | uid_t st_uid; |
| 73 | gid_t st_gid; |
| 74 | dev_t st_rdev; |
| 75 | long st_pad2[2]; |
| 76 | off64_t st_size; |
| 77 | timestruc_t st_atim; |
| 78 | timestruc_t st_mtim; |
| 79 | timestruc_t st_ctim; |
| 80 | long st_blksize; |
| 81 | blkcnt64_t st_blocks; |
| 82 | char st_fstype[_ST_FSTYPSZ]; |
| 83 | long st_pad4[8]; |
| 84 | }; |
| 85 | |
| 86 | #define O_LARGEFILE 0x2000 /* Solaris 2.6 sys/fcntl.h */ |
| 87 | #endif /* !_LFS_LARGEFILE */ |
| 88 | |
| 89 | #endif /* !_JAVASOFT_SOLARIS_LARGEFILE_SUPPORT_H_ */ |