summaryrefslogtreecommitdiffstats
path: root/luni/src/main/java/android/system/StructStatVfs.java
blob: b0b7802d62a88919bad474187169cc0b86b34658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * 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 android.system;

import libcore.util.Objects;

/**
 * File information returned by {@link Os#fstatvfs} and {@link Os#statvfs}.
 *
 * @hide
 */
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*/

  /**
   * Constructs an instance with the given field values.
   */
  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;
  }

  @Override public String toString() {
    return Objects.toString(this);
  }
}