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:
parent
e875ad63d3
commit
7efada9d5b
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue