1 /* 2 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. 3 * 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5 * 6 * This code is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License version 2 only, as 8 * published by the Free Software Foundation. Oracle designates this 9 * particular file as subject to the "Classpath" exception as provided 10 * by Oracle in the LICENSE file that accompanied this code. 11 * 12 * This code is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * version 2 for more details (a copy is included in the LICENSE file that 16 * accompanied this code). 17 * 18 * You should have received a copy of the GNU General Public License version 19 * 2 along with this work; if not, write to the Free Software Foundation, 20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21 * 22 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 23 * or visit www.oracle.com if you need additional information or have any 24 * questions. 25 * 26 */ 27 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT 28 package sun.nio.fs; 29 30 // BEGIN Android-changed: Use constants from android.system.OsConstants. http://b/32203242 31 // Those constants are initialized by native code to ensure correctness on different architectures. 32 // AT_SYMLINK_NOFOLLOW (used by fstatat) and AT_REMOVEDIR (used by unlinkat) as of July 2018 do not 33 // have equivalents in android.system.OsConstants so left unchanged. 34 import android.system.OsConstants; 35 36 class UnixConstants { UnixConstants()37 private UnixConstants() { } 38 39 static final int O_RDONLY = OsConstants.O_RDONLY; 40 41 static final int O_WRONLY = OsConstants.O_WRONLY; 42 43 static final int O_RDWR = OsConstants.O_RDWR; 44 45 static final int O_APPEND = OsConstants.O_APPEND; 46 47 static final int O_CREAT = OsConstants.O_CREAT; 48 49 static final int O_EXCL = OsConstants.O_EXCL; 50 51 static final int O_TRUNC = OsConstants.O_TRUNC; 52 53 static final int O_SYNC = OsConstants.O_SYNC; 54 55 static final int O_DSYNC = OsConstants.O_DSYNC; 56 57 static final int O_NOFOLLOW = OsConstants.O_NOFOLLOW; 58 59 static final int S_IAMB = get_S_IAMB(); 60 61 static final int S_IRUSR = OsConstants.S_IRUSR; 62 63 static final int S_IWUSR = OsConstants.S_IWUSR; 64 65 static final int S_IXUSR = OsConstants.S_IXUSR; 66 67 static final int S_IRGRP = OsConstants.S_IRGRP; 68 69 static final int S_IWGRP = OsConstants.S_IWGRP; 70 71 static final int S_IXGRP = OsConstants.S_IXGRP; 72 73 static final int S_IROTH = OsConstants.S_IROTH; 74 75 static final int S_IWOTH = OsConstants.S_IWOTH; 76 77 static final int S_IXOTH = OsConstants.S_IXOTH; 78 79 static final int S_IFMT = OsConstants.S_IFMT; 80 81 static final int S_IFREG = OsConstants.S_IFREG; 82 83 static final int S_IFDIR = OsConstants.S_IFDIR; 84 85 static final int S_IFLNK = OsConstants.S_IFLNK; 86 87 static final int S_IFCHR = OsConstants.S_IFCHR; 88 89 static final int S_IFBLK = OsConstants.S_IFBLK; 90 91 static final int S_IFIFO = OsConstants.S_IFIFO; 92 93 static final int R_OK = OsConstants.R_OK; 94 95 static final int W_OK = OsConstants.W_OK; 96 97 static final int X_OK = OsConstants.X_OK; 98 99 static final int F_OK = OsConstants.F_OK; 100 101 static final int ENOENT = OsConstants.ENOENT; 102 103 static final int EACCES = OsConstants.EACCES; 104 105 static final int EEXIST = OsConstants.EEXIST; 106 107 static final int ENOTDIR = OsConstants.ENOTDIR; 108 109 static final int EINVAL = OsConstants.EINVAL; 110 111 static final int EXDEV = OsConstants.EXDEV; 112 113 static final int EISDIR = OsConstants.EISDIR; 114 115 static final int ENOTEMPTY = OsConstants.ENOTEMPTY; 116 117 static final int ENOSPC = OsConstants.ENOSPC; 118 119 static final int EAGAIN = OsConstants.EAGAIN; 120 121 static final int ENOSYS = OsConstants.ENOSYS; 122 123 static final int ELOOP = OsConstants.ELOOP; 124 125 static final int EROFS = OsConstants.EROFS; 126 127 static final int ENODATA = OsConstants.ENODATA; 128 129 static final int ERANGE = OsConstants.ERANGE; 130 131 static final int EMFILE = OsConstants.EMFILE; 132 133 // S_IAMB are access mode bits, therefore, calculated by taking OR of all the read, write and 134 // execute permissions bits for owner, group and other. get_S_IAMB()135 private static int get_S_IAMB() { 136 return (OsConstants.S_IRUSR | OsConstants.S_IWUSR | OsConstants.S_IXUSR | 137 OsConstants.S_IRGRP | OsConstants.S_IWGRP | OsConstants.S_IXGRP | 138 OsConstants.S_IROTH | OsConstants.S_IWOTH | OsConstants.S_IXOTH); 139 } 140 // END Android-changed: Use constants from android.system.OsConstants. http://b/32203242 141 142 143 static final int AT_SYMLINK_NOFOLLOW = 0x100; 144 static final int AT_REMOVEDIR = 0x200; 145 } 146