mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Abstract the libraries getting of the tid
Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Kees Cook <kees.cook@canonical.com>
This commit is contained in:
parent
0d9a39bd26
commit
2c110ed3d5
1 changed files with 10 additions and 5 deletions
|
@ -37,16 +37,21 @@
|
|||
#define default_symbol_version(real, name, version) \
|
||||
__asm__ (".symver " #real "," #name "@@" #version)
|
||||
|
||||
static inline pid_t aa_gettid(void)
|
||||
{
|
||||
#ifdef SYS_gettid
|
||||
return syscall(SYS_gettid);
|
||||
#else
|
||||
return getpid();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int setprocattr(const char *path, const char *buf, int len)
|
||||
{
|
||||
int rc = -1;
|
||||
int fd, ret, ctlerr = 0;
|
||||
char *ctl = NULL;
|
||||
#ifdef SYS_gettid
|
||||
pid_t tid = syscall(SYS_gettid);
|
||||
#else
|
||||
pid_t tid = getpid();
|
||||
#endif
|
||||
pid_t tid = aa_gettid();
|
||||
|
||||
if (!buf) {
|
||||
errno = EINVAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue