src/virtio/vulkan/vn_common.c: In function ‘vn_ring_monitor_acquire’:
src/virtio/vulkan/vn_common.c:129:16: error: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Werror=implicit-function-declaration]
129 | pid_t tid = gettid();
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22489>
#include "vn_common.h"
#include <stdarg.h>
+#include <sys/syscall.h>
#include "util/log.h"
#include "util/os_misc.h"
static bool
vn_ring_monitor_acquire(struct vn_ring *ring)
{
- pid_t tid = gettid();
+ pid_t tid = syscall(SYS_gettid);
if (!ring->monitor.threadid && tid != ring->monitor.threadid &&
mtx_trylock(&ring->monitor.mutex) == thrd_success) {
/* register as the only waiting thread that monitors the ring. */
void
vn_ring_monitor_release(struct vn_ring *ring)
{
- if (gettid() != ring->monitor.threadid)
+ if (syscall(SYS_gettid) != ring->monitor.threadid)
return;
ring->monitor.threadid = 0;