]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: gettid() is Linux-specific
authorAndrea Bolognani <abologna@redhat.com>
Mon, 4 Dec 2017 15:22:02 +0000 (16:22 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 5 Dec 2017 10:28:19 +0000 (11:28 +0100)
commit77117e18b703534c43e4e78caf060d7b06653ed8
tree761d9f067f99b1c8f3e326a631010a228ce05bbd
parent6dde44c86fb806ab2932b413e368548a52866538
util: gettid() is Linux-specific

The manual page clearly states that

  gettid() is Linux-specific and should not be used in programs
  that are intended to be portable.

Unfortunately, it looks like macOS implemented the functionality
and defined SYS_gettid accordingly, only to deprecate syscall()
altogether with 10.12 (Sierra), released last late year.

To avoid compilation errors, call gettid() on Linux only.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virthread.c