mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
f7f08de520
git-svn-id: file:///svn/toku/tokudb@48334 c7de825b-a66e-492c-adef-691d508d4ae1
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
|
#ident "$Id$"
|
|
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
|
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
#include <config.h>
|
|
#include <stdio.h>
|
|
#include <toku_stdint.h>
|
|
#include <unistd.h>
|
|
#include <toku_assert.h>
|
|
#include "toku_os.h"
|
|
#if defined(HAVE_SYSCALL_H)
|
|
# include <syscall.h>
|
|
#endif
|
|
#if defined(HAVE_SYS_SYSCALL_H)
|
|
# include <sys/syscall.h>
|
|
#endif
|
|
#if defined(HAVE_PTHREAD_NP_H)
|
|
# include <pthread_np.h>
|
|
#endif
|
|
|
|
// since we implement the same thing here as in toku_os_gettid, this test
|
|
// is pretty pointless
|
|
static int gettid(void) {
|
|
#if defined(__NR_gettid)
|
|
return syscall(__NR_gettid);
|
|
#elif defined(SYS_gettid)
|
|
return syscall(SYS_gettid);
|
|
#elif defined(HAVE_PTHREAD_GETTHREADID_NP)
|
|
return pthread_getthreadid_np();
|
|
#else
|
|
# error "no implementation of gettid available"
|
|
#endif
|
|
}
|
|
|
|
int main(void) {
|
|
assert(toku_os_getpid() == getpid());
|
|
assert(toku_os_gettid() == gettid());
|
|
return 0;
|
|
}
|