diff options
author | Elliott Hughes <enh@google.com> | 2014-04-29 00:19:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-29 00:19:20 +0000 |
commit | ab8f6767cfec18b3390f4081413dbbbbdf2308a3 (patch) | |
tree | 48ac5cb41360c77cbc9dea8ee8800370c8390e15 | |
parent | f84885a4cb1e50442776c84105d113cb4d9008a8 (diff) | |
parent | a2fac5bc3fc5c182e738aa4f3fcc64bb38dfbf5f (diff) | |
download | libcore-ab8f6767cfec18b3390f4081413dbbbbdf2308a3.zip libcore-ab8f6767cfec18b3390f4081413dbbbbdf2308a3.tar.gz libcore-ab8f6767cfec18b3390f4081413dbbbbdf2308a3.tar.bz2 |
Merge "Move StructStat and StructStatVfs now all the callers have switched over."
-rw-r--r-- | luni/src/main/java/android/system/StructStat.java | 66 | ||||
-rw-r--r-- | luni/src/main/java/android/system/StructStatVfs.java | 53 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/IoUtils.java | 1 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/StructStat.java | 90 | ||||
-rw-r--r-- | luni/src/main/java/libcore/io/StructStatVfs.java | 71 |
5 files changed, 110 insertions, 171 deletions
diff --git a/luni/src/main/java/android/system/StructStat.java b/luni/src/main/java/android/system/StructStat.java index 17221fd..f5241e1 100644 --- a/luni/src/main/java/android/system/StructStat.java +++ b/luni/src/main/java/android/system/StructStat.java @@ -23,12 +23,70 @@ package android.system; * * @hide */ -public final class StructStat extends libcore.io.StructStat { +public final class StructStat { + /** Device ID of device containing file. */ + public final long st_dev; /*dev_t*/ + + /** File serial number (inode). */ + public final long st_ino; /*ino_t*/ + + /** Mode (permissions) of file. */ + public final int st_mode; /*mode_t*/ + + /** Number of hard links to the file. */ + public final long st_nlink; /*nlink_t*/ + + /** User ID of file. */ + public final int st_uid; /*uid_t*/ + + /** Group ID of file. */ + public final int st_gid; /*gid_t*/ + + /** Device ID (if file is character or block special). */ + public final long st_rdev; /*dev_t*/ + + /** + * For regular files, the file size in bytes. + * For symbolic links, the length in bytes of the pathname contained in the symbolic link. + * For a shared memory object, the length in bytes. + * For a typed memory object, the length in bytes. + * For other file types, the use of this field is unspecified. + */ + public final long st_size; /*off_t*/ + + /** Time of last access. */ + public final long st_atime; /*time_t*/ + + /** Time of last data modification. */ + public final long st_mtime; /*time_t*/ + + /** Time of last status change. */ + public final long st_ctime; /*time_t*/ + + /** + * A file system-specific preferred I/O block size for this object. + * For some file system types, this may vary from file to file. + */ + public final long st_blksize; /*blksize_t*/ + + /** Number of blocks allocated for this object. */ + public final long st_blocks; /*blkcnt_t*/ + public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime, long st_blksize, long st_blocks) { - super(st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, - st_rdev, st_size, st_atime, st_mtime, st_ctime, - st_blksize, st_blocks); + this.st_dev = st_dev; + this.st_ino = st_ino; + this.st_mode = st_mode; + this.st_nlink = st_nlink; + this.st_uid = st_uid; + this.st_gid = st_gid; + this.st_rdev = st_rdev; + this.st_size = st_size; + this.st_atime = st_atime; + this.st_mtime = st_mtime; + this.st_ctime = st_ctime; + this.st_blksize = st_blksize; + this.st_blocks = st_blocks; } } diff --git a/luni/src/main/java/android/system/StructStatVfs.java b/luni/src/main/java/android/system/StructStatVfs.java index b0eedb7..426afcc 100644 --- a/luni/src/main/java/android/system/StructStatVfs.java +++ b/luni/src/main/java/android/system/StructStatVfs.java @@ -21,12 +21,53 @@ package android.system; * * @hide */ -public final class StructStatVfs extends libcore.io.StructStatVfs { +public final class StructStatVfs { + /** File system block size (used for block counts). */ + public final long f_bsize; /*unsigned long*/ + + /** Fundamental file system block size. */ + public final long f_frsize; /*unsigned long*/ + + /** Total block count. */ + public final long f_blocks; /*fsblkcnt_t*/ + + /** Free block count. */ + public final long f_bfree; /*fsblkcnt_t*/ + + /** Free block count available to non-root. */ + public final long f_bavail; /*fsblkcnt_t*/ + + /** Total file (inode) count. */ + public final long f_files; /*fsfilcnt_t*/ + + /** Free file (inode) count. */ + public final long f_ffree; /*fsfilcnt_t*/ + + /** Free file (inode) count available to non-root. */ + public final long f_favail; /*fsfilcnt_t*/ + + /** File system id. */ + public final long f_fsid; /*unsigned long*/ + + /** Bit mask of ST_* flags. */ + public final long f_flag; /*unsigned long*/ + + /** Maximum filename length. */ + public final long f_namemax; /*unsigned long*/ + public StructStatVfs(long f_bsize, long f_frsize, long f_blocks, long f_bfree, long f_bavail, - long f_files, long f_ffree, long f_favail, - long f_fsid, long f_flag, long f_namemax) { - super(f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, - f_files, f_ffree, f_favail, - f_fsid, f_flag, f_namemax); + long f_files, long f_ffree, long f_favail, + long f_fsid, long f_flag, long f_namemax) { + this.f_bsize = f_bsize; + this.f_frsize = f_frsize; + this.f_blocks = f_blocks; + this.f_bfree = f_bfree; + this.f_bavail = f_bavail; + this.f_files = f_files; + this.f_ffree = f_ffree; + this.f_favail = f_favail; + this.f_fsid = f_fsid; + this.f_flag = f_flag; + this.f_namemax = f_namemax; } } diff --git a/luni/src/main/java/libcore/io/IoUtils.java b/luni/src/main/java/libcore/io/IoUtils.java index 27da93f..d0c4ffe 100644 --- a/luni/src/main/java/libcore/io/IoUtils.java +++ b/luni/src/main/java/libcore/io/IoUtils.java @@ -16,6 +16,7 @@ package libcore.io; +import android.system.StructStat; import java.io.File; import java.io.FileDescriptor; import java.io.FileNotFoundException; diff --git a/luni/src/main/java/libcore/io/StructStat.java b/luni/src/main/java/libcore/io/StructStat.java deleted file mode 100644 index 29685c6..0000000 --- a/luni/src/main/java/libcore/io/StructStat.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package libcore.io; - -/** - * File information returned by fstat(2), lstat(2), and stat(2). Corresponds to C's - * {@code struct stat} from - * <a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/stat.h.html"><stat.h></a> - */ -public /* not final for android.system.StructStat */ class StructStat { - /** Device ID of device containing file. */ - public final long st_dev; /*dev_t*/ - - /** File serial number (inode). */ - public final long st_ino; /*ino_t*/ - - /** Mode (permissions) of file. */ - public final int st_mode; /*mode_t*/ - - /** Number of hard links to the file. */ - public final long st_nlink; /*nlink_t*/ - - /** User ID of file. */ - public final int st_uid; /*uid_t*/ - - /** Group ID of file. */ - public final int st_gid; /*gid_t*/ - - /** Device ID (if file is character or block special). */ - public final long st_rdev; /*dev_t*/ - - /** - * For regular files, the file size in bytes. - * For symbolic links, the length in bytes of the pathname contained in the symbolic link. - * For a shared memory object, the length in bytes. - * For a typed memory object, the length in bytes. - * For other file types, the use of this field is unspecified. - */ - public final long st_size; /*off_t*/ - - /** Time of last access. */ - public final long st_atime; /*time_t*/ - - /** Time of last data modification. */ - public final long st_mtime; /*time_t*/ - - /** Time of last status change. */ - public final long st_ctime; /*time_t*/ - - /** - * A file system-specific preferred I/O block size for this object. - * For some file system types, this may vary from file to file. - */ - public final long st_blksize; /*blksize_t*/ - - /** Number of blocks allocated for this object. */ - public final long st_blocks; /*blkcnt_t*/ - - public StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, - long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime, - long st_blksize, long st_blocks) { - this.st_dev = st_dev; - this.st_ino = st_ino; - this.st_mode = st_mode; - this.st_nlink = st_nlink; - this.st_uid = st_uid; - this.st_gid = st_gid; - this.st_rdev = st_rdev; - this.st_size = st_size; - this.st_atime = st_atime; - this.st_mtime = st_mtime; - this.st_ctime = st_ctime; - this.st_blksize = st_blksize; - this.st_blocks = st_blocks; - } -} diff --git a/luni/src/main/java/libcore/io/StructStatVfs.java b/luni/src/main/java/libcore/io/StructStatVfs.java deleted file mode 100644 index 4beb69f..0000000 --- a/luni/src/main/java/libcore/io/StructStatVfs.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package libcore.io; - -/** - * File information returned by fstatvfs(2) and statvfs(2). - */ -public /* not final for android.system.StructStatVfs */ class StructStatVfs { - /** File system block size (used for block counts). */ - public final long f_bsize; /*unsigned long*/ - - /** Fundamental file system block size. */ - public final long f_frsize; /*unsigned long*/ - - /** Total block count. */ - public final long f_blocks; /*fsblkcnt_t*/ - - /** Free block count. */ - public final long f_bfree; /*fsblkcnt_t*/ - - /** Free block count available to non-root. */ - public final long f_bavail; /*fsblkcnt_t*/ - - /** Total file (inode) count. */ - public final long f_files; /*fsfilcnt_t*/ - - /** Free file (inode) count. */ - public final long f_ffree; /*fsfilcnt_t*/ - - /** Free file (inode) count available to non-root. */ - public final long f_favail; /*fsfilcnt_t*/ - - /** File system id. */ - public final long f_fsid; /*unsigned long*/ - - /** Bit mask of ST_* flags. */ - public final long f_flag; /*unsigned long*/ - - /** Maximum filename length. */ - public final long f_namemax; /*unsigned long*/ - - public StructStatVfs(long f_bsize, long f_frsize, long f_blocks, long f_bfree, long f_bavail, - long f_files, long f_ffree, long f_favail, - long f_fsid, long f_flag, long f_namemax) { - this.f_bsize = f_bsize; - this.f_frsize = f_frsize; - this.f_blocks = f_blocks; - this.f_bfree = f_bfree; - this.f_bavail = f_bavail; - this.f_files = f_files; - this.f_ffree = f_ffree; - this.f_favail = f_favail; - this.f_fsid = f_fsid; - this.f_flag = f_flag; - this.f_namemax = f_namemax; - } -} |