Commit af33a0d
enable utmpx feature for musl
musl provides stubs of those functions, and those stubs are available in the
libc crate version 0.2.172. Thus let's enable the feature so that it can
compile with musl. Note that those stubs always return a success exit value,
and commands such as "users" will report an empty list of users, when calling
those stubs.
This is consistent with the behavior of GNU coreutils which does the same thing.
The coreutils utillities using utmpx are "pinky", "uptime", "users", "who".
This is the expected behavior when using those utilities compiled with those musl utmpx stubs:
```
root@qemuarm64:~# users
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# pinky
Login Name TTY Idle When Where
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# uptime
12:58:47 up 0 min, 0 users, load average: 0.07, 0.02, 0.00
root@qemuarm64:~# echo $?
0
root@qemuarm64:~# who
root@qemuarm64:~# echo $?
0
```
Closes #1361
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>1 parent c90bca4 commit af33a0d
3 files changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
0 commit comments