rt-utils: Add gettid()

We still lack a gettid implemenation from libc.

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
This commit is contained in:
Daniel Wagner 2014-11-05 10:09:44 +01:00 committed by Clark Williams
parent e875ad63d3
commit 7efada9d5b
2 changed files with 8 additions and 0 deletions

View File

@ -22,4 +22,6 @@ int event_disable_all(void);
const char *policy_to_string(int policy);
uint32_t string_to_policy(const char *str);
pid_t gettid(void);
#endif /* __RT_UTILS.H */

View File

@ -16,6 +16,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/syscall.h> /* For SYS_gettid definitions */
#include "rt-utils.h"
#include "rt-sched.h"
#include "error.h"
@ -311,3 +312,8 @@ uint32_t string_to_policy(const char *str)
return 0;
}
pid_t gettid(void)
{
return syscall(SYS_gettid);
}