Support AT_PS_STRINGS in _elf_aux_info().
This will be used by setproctitle(). Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24407
This commit is contained in:
parent
ff432f5784
commit
af2831122f
@ -70,7 +70,7 @@ static pthread_once_t aux_once = PTHREAD_ONCE_INIT;
|
||||
static int pagesize, osreldate, canary_len, ncpus, pagesizes_len, bsdflags;
|
||||
static int hwcap_present, hwcap2_present;
|
||||
static char *canary, *pagesizes, *execpath;
|
||||
static void *timekeep;
|
||||
static void *ps_strings, *timekeep;
|
||||
static u_long hwcap, hwcap2;
|
||||
|
||||
#ifdef __powerpc__
|
||||
@ -135,6 +135,10 @@ init_aux(void)
|
||||
case AT_TIMEKEEP:
|
||||
timekeep = aux->a_un.a_ptr;
|
||||
break;
|
||||
|
||||
case AT_PS_STRINGS:
|
||||
ps_strings = aux->a_un.a_ptr;
|
||||
break;
|
||||
#ifdef __powerpc__
|
||||
/*
|
||||
* Since AT_STACKPROT is always set, and the common
|
||||
@ -337,6 +341,16 @@ _elf_aux_info(int aux, void *buf, int buflen)
|
||||
} else
|
||||
res = EINVAL;
|
||||
break;
|
||||
case AT_PS_STRINGS:
|
||||
if (buflen == sizeof(void *)) {
|
||||
if (ps_strings != NULL) {
|
||||
*(void **)buf = ps_strings;
|
||||
res = 0;
|
||||
} else
|
||||
res = ENOENT;
|
||||
} else
|
||||
res = EINVAL;
|
||||
break;
|
||||
default:
|
||||
res = ENOENT;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user