|
The reason we put these in wrapper-funcs/ is because we normally
dynamically include them when the corresponding symbol is available.
For example, if the C library supports symbol foo, and there is a
wrapper-funcs/foo_pre_check.c, we'll automatically include it based
on the assumption that wrapper-funcs/foo.c needs it. But if the C
library doesn't have a symbol foo, we won't include foo.c or the
foo_pre_check.c file at all. Sounds fine.
The *at family of functions is a bit different because we end up
using them both in the wrapper-funcs/ files, and in the trace code,
the latter of which we use unconditionally. This lead to a build
issue early on (see commit b27df46f349e850067ae388fe067b043abf3aecb
("libsandbox: fix missing *at pre_checks")) whereby we hacked in
these *at pre-check symbols all the time. At which point, having
them be in wrapper-funcs/ was more out of convention with how we
manage all our other APIs.
We want to support running ptrace from the sandbox binary directly
which requires linking (most of) libsandbox into it, and to that
end, hoist these pre-check functions out of wrapper-funcs. This
makes it a bit clearer that we always want to compile these.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|