mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 06:46:35 +01:00
selftests/powerpc: Add wrapper for gettid
The gettid() syscall wrapper was first introduced in glibc 2.30. This adds a wrapper for use in distros running older versions. Suggested-by: Christophe Leroy <[email protected]> Suggested-by: Michael Ellerman <[email protected]> Signed-off-by: Sandipan Das <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/8ca3b0eeda989707815d1cf337cc33f090408965.1595821792.git.sandipan@linux.ibm.com
This commit is contained in:
1 parent
e3333c5994
commit
743f3544ff
1 file changed
+10
@@ -42,6 +42,16 @@ int perf_event_enable(int fd);
|
||||
int perf_event_disable(int fd);
|
||||
int perf_event_reset(int fd);
|
||||
|
||||
#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
static inline pid_t gettid(void)
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline bool have_hwcap(unsigned long ftr)
|
||||
{
|
||||
return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr;
|
||||
|
||||
Reference in new issue
Block a user