@@ -90,7 +90,18 @@ fn display_message_queues(_args: &Args) {
9090 break ;
9191 }
9292
93- let key = msg_ds. msg_perm . __key ; // Ensure the correct field name for your system
93+ let key = {
94+ #[ cfg( not( target_env = "musl" ) ) ]
95+ {
96+ msg_ds. msg_perm . __key // Ensure the correct field name for your system
97+ }
98+
99+ // TODO: What placeholder value should go here?
100+ #[ cfg( target_env = "musl" ) ]
101+ {
102+ 0_i32
103+ }
104+ } ;
94105 let mode = msg_ds. msg_perm . mode ;
95106 let uid = msg_ds. msg_perm . uid ;
96107 let gid = msg_ds. msg_perm . gid ;
@@ -154,10 +165,24 @@ fn display_shared_memory(_args: &Args) {
154165 continue ;
155166 }
156167
157- #[ cfg( target_os = "macos" ) ]
158- let key = shmbuf. shm_perm . _key ; // Check for the correct field name on your system
159- #[ cfg( not( target_os = "macos" ) ) ]
160- let key = shmbuf. shm_perm . __key ; // Check for the correct field name on your system
168+ // Prevent accidental shadowing by using a block
169+ let key = {
170+ #[ cfg( target_os = "macos" ) ]
171+ {
172+ shmbuf. shm_perm . _key // Check for the correct field name on your system
173+ }
174+
175+ #[ cfg( all( not( target_os = "macos" ) , not( target_env = "musl" ) ) ) ]
176+ {
177+ shmbuf. shm_perm . __key // Check for the correct field name on your system
178+ }
179+
180+ // TODO: What placeholder value should go here?
181+ #[ cfg( all( not( target_os = "macos" ) , target_env = "musl" ) ) ]
182+ {
183+ 0_i32
184+ }
185+ } ;
161186 let mode = shmbuf. shm_perm . mode ;
162187 let uid = shmbuf. shm_perm . uid ;
163188 let gid = shmbuf. shm_perm . gid ;
@@ -187,6 +212,7 @@ fn display_shared_memory(_args: &Args) {
187212 }
188213}
189214
215+ #[ cfg( not( target_env = "musl" ) ) ]
190216fn display_semaphores ( _args : & Args ) {
191217 use libc:: { semctl, semid_ds, IPC_STAT } ;
192218 use std:: ffi:: CStr ;
@@ -238,6 +264,12 @@ fn display_semaphores(_args: &Args) {
238264 }
239265}
240266
267+ #[ cfg( target_env = "musl" ) ]
268+ fn display_semaphores ( _args : & Args ) {
269+ // TODO
270+ unimplemented ! ( ) ;
271+ }
272+
241273fn get_current_date ( ) -> String {
242274 // Retrieve the current date and time in a human-readable format
243275 let now = Local :: now ( ) ;
0 commit comments