mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-16 05:46:25 +00:00
Fix --ftrace
This commit is contained in:
parent
6baf6cdb10
commit
c2420860e6
1 changed files with 3 additions and 1 deletions
|
@ -38,6 +38,7 @@
|
||||||
#include "libc/sysv/consts/prot.h"
|
#include "libc/sysv/consts/prot.h"
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
|
atomic_uint once;
|
||||||
const char *res;
|
const char *res;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
} g_comdbg;
|
} g_comdbg;
|
||||||
|
@ -124,10 +125,11 @@ static void FindDebugBinaryInit(void) {
|
||||||
* @asyncsignalsafe
|
* @asyncsignalsafe
|
||||||
*/
|
*/
|
||||||
const char *FindDebugBinary(void) {
|
const char *FindDebugBinary(void) {
|
||||||
|
cosmo_once(&g_comdbg.once, FindDebugBinaryInit);
|
||||||
return g_comdbg.res;
|
return g_comdbg.res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pay startup cost to make this signal safe from the user's perspective
|
// pay startup cost to make this signal safe from the user's perspective
|
||||||
__attribute__((__constructor__(10))) static void FindDebugBinaryCtor(void) {
|
__attribute__((__constructor__(10))) static void FindDebugBinaryCtor(void) {
|
||||||
FindDebugBinaryInit();
|
cosmo_once(&g_comdbg.once, FindDebugBinaryInit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue