random: Provide missing gettid() declaration

Provide missing declaration of gettid() function necessary for entropy
generation for hash table in the _rand_init_seed() function in the
src/libnm-glib-aux/nm-random-utils.c.

Fixes: 3649efe2b5 ('glib-aux: put more effort into seeding GRand fallback for nm_utils_random_bytes()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/754

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/918
This commit is contained in:
Lukasz Majewski 2021-07-07 12:52:10 +02:00 committed by Thomas Haller
parent dd595c6c1d
commit e874c5bf6b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 10 additions and 7 deletions

View file

@ -30,6 +30,16 @@ nm_is_ascii(char ch)
/*****************************************************************************/
#include <sys/syscall.h>
static inline pid_t
_nm_gettid(void)
{
return (pid_t) syscall(SYS_gettid);
}
#define gettid() _nm_gettid()
/*****************************************************************************/
pid_t nm_utils_gettid(void);
gboolean _nm_assert_on_main_thread(void);

View file

@ -75,13 +75,6 @@ raw_getpid(void)
#endif
}
static inline pid_t
_nm_gettid(void)
{
return (pid_t) syscall(SYS_gettid);
}
#define gettid() _nm_gettid()
/* we build with C11 and thus <uchar.h> provides char32_t,char16_t. */
#define HAVE_CHAR32_T 1
#define HAVE_CHAR16_T 1