mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix unportable pid_t printing in calltrace(3).
This commit is contained in:
parent
7fbd8cdfa6
commit
ac3928bfc8
1 changed files with 3 additions and 2 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <calltrace.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -31,13 +32,13 @@ extern "C" void asm_calltrace();
|
|||
|
||||
extern "C" void calltrace_print_function(size_t index, unsigned long ip)
|
||||
{
|
||||
fprintf(stdout, "[pid=%i %s] %zu: 0x%lx\n", getpid(),
|
||||
fprintf(stdout, "[pid=%ji %s] %zu: 0x%lx\n", (intmax_t) getpid(),
|
||||
program_invocation_short_name, index, ip);
|
||||
}
|
||||
|
||||
extern "C" void calltrace()
|
||||
{
|
||||
fprintf(stdout, "[pid=%i %s] Calltrace: (%s)\n", getpid(),
|
||||
fprintf(stdout, "[pid=%ji %s] Calltrace: (%s)\n", (intmax_t) getpid(),
|
||||
program_invocation_short_name, program_invocation_name);
|
||||
asm_calltrace();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue