@@ -31,7 +31,9 @@ type fs_type_t = libc::c_ulong;
3131type fs_type_t = libc:: c_uint ;
3232#[ cfg( all( target_os = "linux" , target_env = "musl" ) ) ]
3333type fs_type_t = libc:: c_ulong ;
34- #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" ) ) ) ) ]
34+ #[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
35+ type fs_type_t = libc:: c_int ;
36+ #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" , target_env = "uclibc" ) ) ) ) ]
3537type fs_type_t = libc:: __fsword_t ;
3638
3739/// Describes the file system type as known by the operating system.
@@ -71,7 +73,7 @@ pub const EXT3_SUPER_MAGIC: FsType = FsType(libc::EXT3_SUPER_MAGIC as fs_type_t)
7173#[ cfg( all( target_os = "linux" , not( target_env = "musl" ) ) ) ]
7274#[ allow( missing_docs) ]
7375pub const EXT4_SUPER_MAGIC : FsType = FsType ( libc:: EXT4_SUPER_MAGIC as fs_type_t ) ;
74- #[ cfg( all( target_os = "linux" , not( target_env = "musl" ) ) ) ]
76+ #[ cfg( all( target_os = "linux" , not( any ( target_env = "musl" , target_env = "uclibc" ) ) ) ) ]
7577#[ allow( missing_docs) ]
7678pub const FUSE_SUPER_MAGIC : FsType = FsType ( libc:: FUSE_SUPER_MAGIC as fs_type_t ) ;
7779#[ cfg( all( target_os = "linux" , not( target_env = "musl" ) ) ) ]
@@ -192,12 +194,19 @@ impl Statfs {
192194 }
193195
194196 /// Optimal transfer block size
195- #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" ) ) ) ) ]
197+ #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" , target_env = "uclibc" ) ) ) ) ]
196198 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
197199 pub fn optimal_transfer_size ( & self ) -> libc:: __fsword_t {
198200 self . 0 . f_bsize
199201 }
200202
203+ /// Optimal transfer block size
204+ #[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
205+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
206+ pub fn optimal_transfer_size ( & self ) -> libc:: c_int {
207+ self . 0 . f_bsize
208+ }
209+
201210 /// Optimal transfer block size
202211 #[ cfg( target_os = "dragonfly" ) ]
203212 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
@@ -237,7 +246,15 @@ impl Statfs {
237246
238247 /// Size of a block
239248 // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
240- #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" ) ) ) ) ]
249+ #[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
250+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
251+ pub fn block_size ( & self ) -> libc:: c_int {
252+ self . 0 . f_bsize
253+ }
254+
255+ /// Size of a block
256+ // f_bsize on linux: https://github.com/torvalds/linux/blob/master/fs/nfs/super.c#L471
257+ #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" , target_env = "uclibc" ) ) ) ) ]
241258 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
242259 pub fn block_size ( & self ) -> libc:: __fsword_t {
243260 self . 0 . f_bsize
@@ -286,7 +303,14 @@ impl Statfs {
286303 }
287304
288305 /// Maximum length of filenames
289- #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" ) ) ) ) ]
306+ #[ cfg( all( target_os = "linux" , target_env = "uclibc" ) ) ]
307+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
308+ pub fn maximum_name_length ( & self ) -> libc:: c_int {
309+ self . 0 . f_namelen
310+ }
311+
312+ /// Maximum length of filenames
313+ #[ cfg( all( target_os = "linux" , not( any( target_arch = "s390x" , target_env = "musl" , target_env = "uclibc" ) ) ) ) ]
290314 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
291315 pub fn maximum_name_length ( & self ) -> libc:: __fsword_t {
292316 self . 0 . f_namelen
0 commit comments