mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Use unsigned leb128 for magnums
This commit is contained in:
parent
edd9297eba
commit
cdc54ea1fd
931 changed files with 1989 additions and 1983 deletions
|
@ -32,22 +32,14 @@
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
unsigned long getauxval(unsigned long at) {
|
||||
unsigned long res = 0;
|
||||
if (at != -1) {
|
||||
if (!IsWindows()) {
|
||||
if (!g_auxv) return 0;
|
||||
for (const unsigned long *ap = g_auxv; *ap; ap += 2) {
|
||||
if (ap[0] == at) {
|
||||
res = ap[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* TODO(jart): GetProcessImageFileName */
|
||||
}
|
||||
if (res == 0 && at == AT_EXECFN) {
|
||||
res = (uintptr_t)program_invocation_name;
|
||||
unsigned long res, *ap;
|
||||
for (ap = __auxv; ap[0]; ap += 2) {
|
||||
if (at == ap[0]) {
|
||||
return ap[1];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
if (at == AT_EXECFN) {
|
||||
return (intptr_t)__argv[0];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue