@@ -55,13 +55,16 @@ type fs_type_t = libc::c_ulong;
55
55
type fs_type_t = libc:: c_uint ;
56
56
#[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
57
57
type fs_type_t = libc:: c_ulong ;
58
+ #[ cfg( all( target_os = "linux" , target_env = "ohos" ) ) ]
59
+ type fs_type_t = libc:: c_ulong ;
58
60
#[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
59
61
type fs_type_t = libc:: c_int ;
60
62
#[ cfg( all(
61
63
target_os = "linux" ,
62
64
not( any(
63
65
target_arch = "s390x" ,
64
66
target_env = "musl" ,
67
+ target_env = "ohos" ,
65
68
target_env = "uclibc"
66
69
) )
67
70
) ) ]
@@ -73,6 +76,7 @@ type fs_type_t = libc::__fsword_t;
73
76
target_os = "android" ,
74
77
all( target_os = "linux" , target_arch = "s390x" ) ,
75
78
all( target_os = "linux" , target_env = "musl" ) ,
79
+ all( target_os = "linux" , target_env = "ohos" ) ,
76
80
all(
77
81
target_os = "linux" ,
78
82
not( any( target_arch = "s390x" , target_env = "musl" ) )
@@ -279,7 +283,7 @@ pub const XENFS_SUPER_MAGIC: FsType =
279
283
#[ cfg( linux_android) ]
280
284
#[ allow( missing_docs) ]
281
285
pub const NSFS_MAGIC : FsType = FsType ( libc:: NSFS_MAGIC as fs_type_t ) ;
282
- #[ cfg( all( linux_android, not( target_env = "musl" ) ) ) ]
286
+ #[ cfg( all( linux_android, not( target_env = "musl" ) , not ( target_env = "ohos" ) ) ) ]
283
287
#[ allow( missing_docs) ]
284
288
pub const XFS_SUPER_MAGIC : FsType = FsType ( libc:: XFS_SUPER_MAGIC as fs_type_t ) ;
285
289
@@ -322,7 +326,8 @@ impl Statfs {
322
326
/// Optimal transfer block size
323
327
#[ cfg( any(
324
328
target_os = "android" ,
325
- all( target_os = "linux" , target_env = "musl" )
329
+ all( target_os = "linux" , target_env = "musl" ) ,
330
+ all( target_os = "linux" , target_env = "ohos" )
326
331
) ) ]
327
332
pub fn optimal_transfer_size ( & self ) -> libc:: c_ulong {
328
333
self . 0 . f_bsize
@@ -334,6 +339,7 @@ impl Statfs {
334
339
not( any(
335
340
target_arch = "s390x" ,
336
341
target_env = "musl" ,
342
+ target_env = "ohos" ,
337
343
target_env = "uclibc"
338
344
) )
339
345
) ) ]
@@ -379,6 +385,13 @@ impl Statfs {
379
385
self . 0 . f_bsize
380
386
}
381
387
388
+ /// Size of a block
389
+ // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
390
+ #[ cfg( all( target_os = "linux" , target_env = "ohos" ) ) ]
391
+ pub fn block_size ( & self ) -> libc:: c_ulong {
392
+ self . 0 . f_bsize
393
+ }
394
+
382
395
/// Size of a block
383
396
// f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
384
397
#[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
@@ -393,6 +406,7 @@ impl Statfs {
393
406
not( any(
394
407
target_arch = "s390x" ,
395
408
target_env = "musl" ,
409
+ target_env = "ohos" ,
396
410
target_env = "uclibc"
397
411
) )
398
412
) ) ]
@@ -463,6 +477,7 @@ impl Statfs {
463
477
not( any(
464
478
target_arch = "s390x" ,
465
479
target_env = "musl" ,
480
+ target_env = "ohos" ,
466
481
target_env = "uclibc"
467
482
) )
468
483
) ) ]
0 commit comments