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