--- a/src/main/java/net/starlark/java/eval/cpu_profiler_posix.cc
+++ b/src/main/java/net/starlark/java/eval/cpu_profiler_posix.cc
@@ -41,7 +41,7 @@ Java_net_starlark_java_eval_CpuProfiler_
 
 static int fd;  // the write end of the profile event pipe
 
-pid_t gettid(void) {
+pid_t sys_gettid(void) {
 #ifdef __linux__
   return (pid_t)syscall(SYS_gettid);
 #else  // darwin
@@ -63,7 +63,7 @@ void onsigprof(int sig) {
   }
 
   // Send an event containing the int32be-encoded OS thread ID.
-  pid_t tid = gettid();
+  pid_t tid = sys_gettid();
   uint32_t tid_be = htonl(tid);
   int r = write(fd, (void *)&tid_be, sizeof tid_be);
   if (r < 0) {
@@ -100,7 +100,7 @@ void onsigprof(int sig) {
 // static native jint gettid();
 extern "C" JNIEXPORT jint JNICALL
 Java_net_starlark_java_eval_CpuProfiler_gettid(JNIEnv *env, jclass clazz) {
-  return gettid();
+  return sys_gettid();
 }
 
 // makeFD: return new FileDescriptor(fd)
