]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: introduce PRELOAD_FDS
authorMariusz Zaborski <oshogbo@FreeBSD.org>
Wed, 24 Mar 2021 21:10:33 +0000 (22:10 +0100)
committerMariusz Zaborski <oshogbo@FreeBSD.org>
Wed, 24 Mar 2021 22:40:48 +0000 (23:40 +0100)
commitf90218886fc82e7b1fdb9e241adc5d713dadabe3
tree8a080321c742e9e91ae69d30d856cedc596ec660
parent852a88a1d92500028f1364a4afc58955190db7a5
rtld: introduce PRELOAD_FDS

The new PRELOAD_FDS variable accepts a list of file descriptors
that should be loaded into the process.

This may be used to optimize a loading process - in the case when
we already have a file descriptor to the library; we don't have
to look into multiple PATH to find it.

It may also be used in capability mode to load a single additional
library without the need to open a directory that contains it.

The last use of this functionality t may be a race-free method
of loading libraries.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D29334
libexec/rtld-elf/rtld.1
libexec/rtld-elf/rtld.c
libexec/rtld-elf/tests/Makefile
libexec/rtld-elf/tests/common.c [new file with mode: 0644]
libexec/rtld-elf/tests/common.h [new file with mode: 0644]
libexec/rtld-elf/tests/ld_library_pathfds.c
libexec/rtld-elf/tests/ld_preload_fds.c [new file with mode: 0644]