add function fc_gettid
parent
505893dc4c
commit
4b9e2d6517
3
HISTORY
3
HISTORY
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
Version 1.56 2022-01-29
|
||||||
|
* add function fc_gettid
|
||||||
|
|
||||||
Version 1.55 2022-01-12
|
Version 1.55 2022-01-12
|
||||||
* fastcommon php extension adapt to php 8
|
* fastcommon php extension adapt to php 8
|
||||||
* function fast_mblock_batch_alloc changed
|
* function fast_mblock_batch_alloc changed
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include "common_define.h"
|
#include "common_define.h"
|
||||||
|
#ifdef OS_LINUX
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#endif
|
||||||
#include "fc_memory.h"
|
#include "fc_memory.h"
|
||||||
#include "ini_file_reader.h"
|
#include "ini_file_reader.h"
|
||||||
|
|
||||||
|
|
@ -1212,6 +1216,21 @@ static inline int fc_check_realloc_iovec_array(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline pid_t fc_gettid()
|
||||||
|
{
|
||||||
|
#ifdef OS_LINUX
|
||||||
|
|
||||||
|
#ifdef SYS_gettid
|
||||||
|
return (pid_t)syscall(SYS_gettid);
|
||||||
|
#else
|
||||||
|
return getpid();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
return getpid();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue