mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Allow the use of readlinkat over readlink.
This can be useful in situations where readlink is disallowed.
This commit is contained in:
parent
126252a7e6
commit
e8ec9528ab
3 changed files with 27 additions and 0 deletions
|
|
@ -961,7 +961,12 @@ malloc_conf_init(sc_data_t *sc_data) {
|
|||
* Try to use the contents of the "/etc/malloc.conf"
|
||||
* symbolic link's name.
|
||||
*/
|
||||
#ifndef JEMALLOC_READLINKAT
|
||||
linklen = readlink(linkname, buf, sizeof(buf) - 1);
|
||||
#else
|
||||
linklen = readlinkat(AT_FDCWD, linkname, buf,
|
||||
sizeof(buf) - 1);
|
||||
#endif
|
||||
if (linklen == -1) {
|
||||
/* No configuration specified. */
|
||||
linklen = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue