Skip to content

Commit 30d99c0

Browse files
committed
print pid in malloc_playground for gdb attaching
1 parent af18931 commit 30d99c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

malloc_playground.c

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <inttypes.h>
2+
#include <unistd.h>
23
#include <stdlib.h>
34
#include <stdio.h>
45
#include <string.h>
@@ -21,6 +22,9 @@ void report_mcheck_fail(enum mcheck_status s)
2122
#endif
2223

2324
int main(int argc, char ** argv) {
25+
26+
fprintf(stderr, "pid: %d\n", getpid());
27+
2428
char buffer[1000];
2529
while (1) {
2630
fprintf(stderr, "> ");

0 commit comments

Comments
 (0)