@@ -90,7 +90,18 @@ fn display_message_queues(_args: &Args) {
90
90
break ;
91
91
}
92
92
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
+ } ;
94
105
let mode = msg_ds. msg_perm . mode ;
95
106
let uid = msg_ds. msg_perm . uid ;
96
107
let gid = msg_ds. msg_perm . gid ;
@@ -154,10 +165,24 @@ fn display_shared_memory(_args: &Args) {
154
165
continue ;
155
166
}
156
167
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
+ } ;
161
186
let mode = shmbuf. shm_perm . mode ;
162
187
let uid = shmbuf. shm_perm . uid ;
163
188
let gid = shmbuf. shm_perm . gid ;
@@ -187,6 +212,7 @@ fn display_shared_memory(_args: &Args) {
187
212
}
188
213
}
189
214
215
+ #[ cfg( not( target_env = "musl" ) ) ]
190
216
fn display_semaphores ( _args : & Args ) {
191
217
use libc:: { semctl, semid_ds, IPC_STAT } ;
192
218
use std:: ffi:: CStr ;
@@ -238,6 +264,12 @@ fn display_semaphores(_args: &Args) {
238
264
}
239
265
}
240
266
267
+ #[ cfg( target_env = "musl" ) ]
268
+ fn display_semaphores ( _args : & Args ) {
269
+ // TODO
270
+ unimplemented ! ( ) ;
271
+ }
272
+
241
273
fn get_current_date ( ) -> String {
242
274
// Retrieve the current date and time in a human-readable format
243
275
let now = Local :: now ( ) ;
0 commit comments