1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2012 Index Data
3 * See the file LICENSE for details.
8 * \brief Returns printable thread ID
30 #include <yaz/thread_id.h>
32 void yaz_thread_id_cstr(char *buf, size_t buf_max)
36 #elif YAZ_POSIX_THREADS
37 pthread_t t = pthread_self();
40 for (i = 0; i < sizeof(t); i++)
42 if (strlen(buf) >= buf_max-2)
44 sprintf(buf + strlen(buf), "%02x", ((const unsigned char *) &t)[i]);
54 * c-file-style: "Stroustrup"
55 * indent-tabs-mode: nil
57 * vim: shiftwidth=4 tabstop=8 expandtab