Skip to content

Commit 68f3631

Browse files
bors[bot]jirutka
andauthored
Merge #1717
1717: Define FsType constants for musl r=asomers a=jirutka These constants are provided by Linux (linux/magic.h), not libc. See rust-lang/libc#2639. Co-authored-by: Jakub Jirutka <[email protected]>
2 parents 11912bb + 23f1787 commit 68f3631

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

src/sys/statfs.rs

+52-52
Original file line numberDiff line numberDiff line change
@@ -49,160 +49,160 @@ pub struct FsType(pub fs_type_t);
4949

5050
// These constants are defined without documentation in the Linux headers, so we
5151
// can't very well document them here.
52-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
52+
#[cfg(any(target_os = "linux", target_os = "android"))]
5353
#[allow(missing_docs)]
5454
pub const ADFS_SUPER_MAGIC: FsType = FsType(libc::ADFS_SUPER_MAGIC as fs_type_t);
55-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
55+
#[cfg(any(target_os = "linux", target_os = "android"))]
5656
#[allow(missing_docs)]
5757
pub const AFFS_SUPER_MAGIC: FsType = FsType(libc::AFFS_SUPER_MAGIC as fs_type_t);
58-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
58+
#[cfg(any(target_os = "linux", target_os = "android"))]
5959
#[allow(missing_docs)]
6060
pub const AFS_SUPER_MAGIC: FsType = FsType(libc::AFS_SUPER_MAGIC as fs_type_t);
61-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
61+
#[cfg(any(target_os = "linux", target_os = "android"))]
6262
#[allow(missing_docs)]
6363
pub const AUTOFS_SUPER_MAGIC: FsType = FsType(libc::AUTOFS_SUPER_MAGIC as fs_type_t);
64-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
64+
#[cfg(any(target_os = "linux", target_os = "android"))]
6565
#[allow(missing_docs)]
6666
pub const BPF_FS_MAGIC: FsType = FsType(libc::BPF_FS_MAGIC as fs_type_t);
67-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
67+
#[cfg(any(target_os = "linux", target_os = "android"))]
6868
#[allow(missing_docs)]
6969
pub const BTRFS_SUPER_MAGIC: FsType = FsType(libc::BTRFS_SUPER_MAGIC as fs_type_t);
70-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
70+
#[cfg(any(target_os = "linux", target_os = "android"))]
7171
#[allow(missing_docs)]
7272
pub const CGROUP2_SUPER_MAGIC: FsType = FsType(libc::CGROUP2_SUPER_MAGIC as fs_type_t);
73-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
73+
#[cfg(any(target_os = "linux", target_os = "android"))]
7474
#[allow(missing_docs)]
7575
pub const CGROUP_SUPER_MAGIC: FsType = FsType(libc::CGROUP_SUPER_MAGIC as fs_type_t);
76-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
76+
#[cfg(any(target_os = "linux", target_os = "android"))]
7777
#[allow(missing_docs)]
7878
pub const CODA_SUPER_MAGIC: FsType = FsType(libc::CODA_SUPER_MAGIC as fs_type_t);
79-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
79+
#[cfg(any(target_os = "linux", target_os = "android"))]
8080
#[allow(missing_docs)]
8181
pub const CRAMFS_MAGIC: FsType = FsType(libc::CRAMFS_MAGIC as fs_type_t);
82-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
82+
#[cfg(any(target_os = "linux", target_os = "android"))]
8383
#[allow(missing_docs)]
8484
pub const DEBUGFS_MAGIC: FsType = FsType(libc::DEBUGFS_MAGIC as fs_type_t);
85-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
85+
#[cfg(any(target_os = "linux", target_os = "android"))]
8686
#[allow(missing_docs)]
8787
pub const DEVPTS_SUPER_MAGIC: FsType = FsType(libc::DEVPTS_SUPER_MAGIC as fs_type_t);
88-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
88+
#[cfg(any(target_os = "linux", target_os = "android"))]
8989
#[allow(missing_docs)]
9090
pub const ECRYPTFS_SUPER_MAGIC: FsType = FsType(libc::ECRYPTFS_SUPER_MAGIC as fs_type_t);
91-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
91+
#[cfg(any(target_os = "linux", target_os = "android"))]
9292
#[allow(missing_docs)]
9393
pub const EFS_SUPER_MAGIC: FsType = FsType(libc::EFS_SUPER_MAGIC as fs_type_t);
94-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
94+
#[cfg(any(target_os = "linux", target_os = "android"))]
9595
#[allow(missing_docs)]
9696
pub const EXT2_SUPER_MAGIC: FsType = FsType(libc::EXT2_SUPER_MAGIC as fs_type_t);
97-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
97+
#[cfg(any(target_os = "linux", target_os = "android"))]
9898
#[allow(missing_docs)]
9999
pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t);
100-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
100+
#[cfg(any(target_os = "linux", target_os = "android"))]
101101
#[allow(missing_docs)]
102102
pub const EXT4_SUPER_MAGIC: FsType = FsType(libc::EXT4_SUPER_MAGIC as fs_type_t);
103-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
103+
#[cfg(any(target_os = "linux", target_os = "android"))]
104104
#[allow(missing_docs)]
105105
pub const F2FS_SUPER_MAGIC: FsType = FsType(libc::F2FS_SUPER_MAGIC as fs_type_t);
106-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
106+
#[cfg(any(target_os = "linux", target_os = "android"))]
107107
#[allow(missing_docs)]
108108
pub const FUSE_SUPER_MAGIC: FsType = FsType(libc::FUSE_SUPER_MAGIC as fs_type_t);
109-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
109+
#[cfg(any(target_os = "linux", target_os = "android"))]
110110
#[allow(missing_docs)]
111111
pub const FUTEXFS_SUPER_MAGIC: FsType = FsType(libc::FUTEXFS_SUPER_MAGIC as fs_type_t);
112-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
112+
#[cfg(any(target_os = "linux", target_os = "android"))]
113113
#[allow(missing_docs)]
114114
pub const HOSTFS_SUPER_MAGIC: FsType = FsType(libc::HOSTFS_SUPER_MAGIC as fs_type_t);
115-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
115+
#[cfg(any(target_os = "linux", target_os = "android"))]
116116
#[allow(missing_docs)]
117117
pub const HPFS_SUPER_MAGIC: FsType = FsType(libc::HPFS_SUPER_MAGIC as fs_type_t);
118-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
118+
#[cfg(any(target_os = "linux", target_os = "android"))]
119119
#[allow(missing_docs)]
120120
pub const HUGETLBFS_MAGIC: FsType = FsType(libc::HUGETLBFS_MAGIC as fs_type_t);
121-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
121+
#[cfg(any(target_os = "linux", target_os = "android"))]
122122
#[allow(missing_docs)]
123123
pub const ISOFS_SUPER_MAGIC: FsType = FsType(libc::ISOFS_SUPER_MAGIC as fs_type_t);
124-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
124+
#[cfg(any(target_os = "linux", target_os = "android"))]
125125
#[allow(missing_docs)]
126126
pub const JFFS2_SUPER_MAGIC: FsType = FsType(libc::JFFS2_SUPER_MAGIC as fs_type_t);
127-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
127+
#[cfg(any(target_os = "linux", target_os = "android"))]
128128
#[allow(missing_docs)]
129129
pub const MINIX2_SUPER_MAGIC2: FsType = FsType(libc::MINIX2_SUPER_MAGIC2 as fs_type_t);
130-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
130+
#[cfg(any(target_os = "linux", target_os = "android"))]
131131
#[allow(missing_docs)]
132132
pub const MINIX2_SUPER_MAGIC: FsType = FsType(libc::MINIX2_SUPER_MAGIC as fs_type_t);
133-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
133+
#[cfg(any(target_os = "linux", target_os = "android"))]
134134
#[allow(missing_docs)]
135135
pub const MINIX3_SUPER_MAGIC: FsType = FsType(libc::MINIX3_SUPER_MAGIC as fs_type_t);
136-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
136+
#[cfg(any(target_os = "linux", target_os = "android"))]
137137
#[allow(missing_docs)]
138138
pub const MINIX_SUPER_MAGIC2: FsType = FsType(libc::MINIX_SUPER_MAGIC2 as fs_type_t);
139-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
139+
#[cfg(any(target_os = "linux", target_os = "android"))]
140140
#[allow(missing_docs)]
141141
pub const MINIX_SUPER_MAGIC: FsType = FsType(libc::MINIX_SUPER_MAGIC as fs_type_t);
142-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
142+
#[cfg(any(target_os = "linux", target_os = "android"))]
143143
#[allow(missing_docs)]
144144
pub const MSDOS_SUPER_MAGIC: FsType = FsType(libc::MSDOS_SUPER_MAGIC as fs_type_t);
145-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
145+
#[cfg(any(target_os = "linux", target_os = "android"))]
146146
#[allow(missing_docs)]
147147
pub const NCP_SUPER_MAGIC: FsType = FsType(libc::NCP_SUPER_MAGIC as fs_type_t);
148-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
148+
#[cfg(any(target_os = "linux", target_os = "android"))]
149149
#[allow(missing_docs)]
150150
pub const NFS_SUPER_MAGIC: FsType = FsType(libc::NFS_SUPER_MAGIC as fs_type_t);
151-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
151+
#[cfg(any(target_os = "linux", target_os = "android"))]
152152
#[allow(missing_docs)]
153153
pub const NILFS_SUPER_MAGIC: FsType = FsType(libc::NILFS_SUPER_MAGIC as fs_type_t);
154-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
154+
#[cfg(any(target_os = "linux", target_os = "android"))]
155155
#[allow(missing_docs)]
156156
pub const OCFS2_SUPER_MAGIC: FsType = FsType(libc::OCFS2_SUPER_MAGIC as fs_type_t);
157-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
157+
#[cfg(any(target_os = "linux", target_os = "android"))]
158158
#[allow(missing_docs)]
159159
pub const OPENPROM_SUPER_MAGIC: FsType = FsType(libc::OPENPROM_SUPER_MAGIC as fs_type_t);
160-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
160+
#[cfg(any(target_os = "linux", target_os = "android"))]
161161
#[allow(missing_docs)]
162162
pub const OVERLAYFS_SUPER_MAGIC: FsType = FsType(libc::OVERLAYFS_SUPER_MAGIC as fs_type_t);
163-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
163+
#[cfg(any(target_os = "linux", target_os = "android"))]
164164
#[allow(missing_docs)]
165165
pub const PROC_SUPER_MAGIC: FsType = FsType(libc::PROC_SUPER_MAGIC as fs_type_t);
166-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
166+
#[cfg(any(target_os = "linux", target_os = "android"))]
167167
#[allow(missing_docs)]
168168
pub const QNX4_SUPER_MAGIC: FsType = FsType(libc::QNX4_SUPER_MAGIC as fs_type_t);
169-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
169+
#[cfg(any(target_os = "linux", target_os = "android"))]
170170
#[allow(missing_docs)]
171171
pub const QNX6_SUPER_MAGIC: FsType = FsType(libc::QNX6_SUPER_MAGIC as fs_type_t);
172-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
172+
#[cfg(any(target_os = "linux", target_os = "android"))]
173173
#[allow(missing_docs)]
174174
pub const RDTGROUP_SUPER_MAGIC: FsType = FsType(libc::RDTGROUP_SUPER_MAGIC as fs_type_t);
175-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
175+
#[cfg(any(target_os = "linux", target_os = "android"))]
176176
#[allow(missing_docs)]
177177
pub const REISERFS_SUPER_MAGIC: FsType = FsType(libc::REISERFS_SUPER_MAGIC as fs_type_t);
178-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
178+
#[cfg(any(target_os = "linux", target_os = "android"))]
179179
#[allow(missing_docs)]
180180
pub const SECURITYFS_MAGIC: FsType = FsType(libc::SECURITYFS_MAGIC as fs_type_t);
181-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
181+
#[cfg(any(target_os = "linux", target_os = "android"))]
182182
#[allow(missing_docs)]
183183
pub const SELINUX_MAGIC: FsType = FsType(libc::SELINUX_MAGIC as fs_type_t);
184-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
184+
#[cfg(any(target_os = "linux", target_os = "android"))]
185185
#[allow(missing_docs)]
186186
pub const SMACK_MAGIC: FsType = FsType(libc::SMACK_MAGIC as fs_type_t);
187-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
187+
#[cfg(any(target_os = "linux", target_os = "android"))]
188188
#[allow(missing_docs)]
189189
pub const SMB_SUPER_MAGIC: FsType = FsType(libc::SMB_SUPER_MAGIC as fs_type_t);
190-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
190+
#[cfg(any(target_os = "linux", target_os = "android"))]
191191
#[allow(missing_docs)]
192192
pub const SYSFS_MAGIC: FsType = FsType(libc::SYSFS_MAGIC as fs_type_t);
193-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
193+
#[cfg(any(target_os = "linux", target_os = "android"))]
194194
#[allow(missing_docs)]
195195
pub const TMPFS_MAGIC: FsType = FsType(libc::TMPFS_MAGIC as fs_type_t);
196-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
196+
#[cfg(any(target_os = "linux", target_os = "android"))]
197197
#[allow(missing_docs)]
198198
pub const TRACEFS_MAGIC: FsType = FsType(libc::TRACEFS_MAGIC as fs_type_t);
199-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
199+
#[cfg(any(target_os = "linux", target_os = "android"))]
200200
#[allow(missing_docs)]
201201
pub const UDF_SUPER_MAGIC: FsType = FsType(libc::UDF_SUPER_MAGIC as fs_type_t);
202-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
202+
#[cfg(any(target_os = "linux", target_os = "android"))]
203203
#[allow(missing_docs)]
204204
pub const USBDEVICE_SUPER_MAGIC: FsType = FsType(libc::USBDEVICE_SUPER_MAGIC as fs_type_t);
205-
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "android"))]
205+
#[cfg(any(target_os = "linux", target_os = "android"))]
206206
#[allow(missing_docs)]
207207
pub const XENFS_SUPER_MAGIC: FsType = FsType(libc::XENFS_SUPER_MAGIC as fs_type_t);
208208

0 commit comments

Comments
 (0)