@@ -656,7 +656,7 @@ pub const INIT_PROCESS: c_short = 5;
656656pub const LOGIN_PROCESS : c_short = 6 ;
657657pub const USER_PROCESS : c_short = 7 ;
658658pub const DEAD_PROCESS : c_short = 8 ;
659- // musl does not define ACCOUNTING
659+ pub const ACCOUNTING : c_short = 9 ;
660660
661661pub const SFD_CLOEXEC : c_int = 0x080000 ;
662662
@@ -888,6 +888,10 @@ pub const _CS_V7_ENV: c_int = 1149;
888888
889889pub const CLONE_NEWTIME : c_int = 0x80 ;
890890
891+ pub const UT_HOSTSIZE : usize = 256 ;
892+ pub const UT_LINESIZE : usize = 32 ;
893+ pub const UT_NAMESIZE : usize = 32 ;
894+
891895cfg_if ! {
892896 if #[ cfg( target_arch = "s390x" ) ] {
893897 pub const POSIX_FADV_DONTNEED : c_int = 6 ;
@@ -898,6 +902,18 @@ cfg_if! {
898902 }
899903}
900904
905+ macro_rules! deprecated_utmpx {
906+ ( $( $vis: vis fn $fn: ident $args: tt $( -> $ret: ty) ?; ) * ) => {
907+ $(
908+ #[ deprecated(
909+ since = "0.2.172" ,
910+ note = "musl provides `utmp` as stubs and an alternative should be preferred; see https://wiki.musl-libc.org/faq.html"
911+ ) ]
912+ $vis fn $fn $args $( -> $ret) ?;
913+ ) *
914+ } ;
915+ }
916+
901917extern "C" {
902918 pub fn sendmmsg (
903919 sockfd : c_int ,
@@ -984,12 +1000,15 @@ extern "C" {
9841000 fd : c_int ,
9851001 ) -> c_int ;
9861002
987- pub fn getutxent ( ) -> * mut utmpx ;
988- pub fn getutxid ( ut : * const utmpx ) -> * mut utmpx ;
989- pub fn getutxline ( ut : * const utmpx ) -> * mut utmpx ;
990- pub fn pututxline ( ut : * const utmpx ) -> * mut utmpx ;
991- pub fn setutxent ( ) ;
992- pub fn endutxent ( ) ;
1003+ deprecated_utmpx ! {
1004+ pub fn getutxent( ) -> * mut utmpx;
1005+ pub fn getutxid( ut: * const utmpx) -> * mut utmpx;
1006+ pub fn getutxline( ut: * const utmpx) -> * mut utmpx;
1007+ pub fn pututxline( ut: * const utmpx) -> * mut utmpx;
1008+ pub fn setutxent( ) ;
1009+ pub fn endutxent( ) ;
1010+ pub fn utmpxname( file: * const c_char) -> c_int;
1011+ }
9931012}
9941013
9951014// Alias <foo> to <foo>64 to mimic glibc's LFS64 support
0 commit comments