@@ -440,13 +440,6 @@ s_no_extra_traits! {
440440 pub __reserved: [ c_char; 256 ] ,
441441 }
442442
443- // FIXME(musl): musl added paddings and adjusted
444- // layout in 1.2.0 but our CI is still 1.1.24.
445- // So, I'm leaving some fields as cfg for now.
446- // ref. https://github.com/bminor/musl/commit/
447- // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392
448- //
449- // OpenHarmony uses the musl 1.2 layout.
450443 pub struct utmpx {
451444 pub ut_type: c_short,
452445 __ut_pad1: c_short,
@@ -457,31 +450,26 @@ s_no_extra_traits! {
457450 pub ut_host: [ c_char; 256 ] ,
458451 pub ut_exit: __exit_status,
459452
460- #[ cfg( target_env = "musl" ) ]
461- #[ cfg( not( target_arch = "loongarch64" ) ) ]
453+ // loongarch64 and ohos already use the new ABI
454+ #[ cfg( not( any( target_arch = "loongarch64" , target_env = "ohos" , musl_v1_2_3) ) ) ]
455+ #[ deprecated(
456+ since = "0.2.173" ,
457+ note = "The ABI of this field has changed from c_long to c_int with padding, \
458+ we'll follow that change in the future release as part of an effort to \
459+ update the musl API to reflect upstream. See #4443 for more info."
460+ ) ]
462461 pub ut_session: c_long,
463462
464- #[ cfg( target_env = "musl" ) ]
465- #[ cfg( target_arch = "loongarch64" ) ]
466- pub ut_session: c_int,
467-
468- #[ cfg( target_env = "musl" ) ]
469- #[ cfg( target_arch = "loongarch64" ) ]
463+ #[ cfg( any( target_arch = "loongarch64" , target_env = "ohos" , musl_v1_2_3) ) ]
464+ #[ cfg( not( target_endian = "little" ) ) ]
470465 __ut_pad2: c_int,
471466
472- #[ cfg( target_env = "ohos" ) ]
473- #[ cfg( target_endian = "little" ) ]
467+ #[ cfg( any( target_arch = "loongarch64" , target_env = "ohos" , musl_v1_2_3) ) ]
474468 pub ut_session: c_int,
475- #[ cfg( target_env = "ohos" ) ]
476- #[ cfg( target_endian = "little" ) ]
477- __ut_pad2: c_int,
478469
479- #[ cfg( target_env = "ohos" ) ]
480- #[ cfg( not ( target_endian = "little" ) ) ]
470+ #[ cfg( any ( target_arch = "loongarch64" , target_env = "ohos" , musl_v1_2_3 ) ) ]
471+ #[ cfg( target_endian = "little" ) ]
481472 __ut_pad2: c_int,
482- #[ cfg( target_env = "ohos" ) ]
483- #[ cfg( not( target_endian = "little" ) ) ]
484- pub ut_session: c_int,
485473
486474 pub ut_tv: crate :: timeval,
487475 pub ut_addr_v6: [ c_uint; 4 ] ,
0 commit comments