mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-15 05:16:30 +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"
|
||||
|
||||
static struct {
|
||||
atomic_uint once;
|
||||
const char *res;
|
||||
char buf[PATH_MAX];
|
||||
} g_comdbg;
|
||||
|
@ -124,10 +125,11 @@ static void FindDebugBinaryInit(void) {
|
|||
* @asyncsignalsafe
|
||||
*/
|
||||
const char *FindDebugBinary(void) {
|
||||
cosmo_once(&g_comdbg.once, FindDebugBinaryInit);
|
||||
return g_comdbg.res;
|
||||
}
|
||||
|
||||
// pay startup cost to make this signal safe from the user's perspective
|
||||
__attribute__((__constructor__(10))) static void FindDebugBinaryCtor(void) {
|
||||
FindDebugBinaryInit();
|
||||
cosmo_once(&g_comdbg.once, FindDebugBinaryInit);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue