Skip to content

Commit

Permalink
print pid in malloc_playground for gdb attaching
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Kyle committed Jul 2, 2018
1 parent af18931 commit 30d99c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions malloc_playground.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <inttypes.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand All @@ -21,6 +22,9 @@ void report_mcheck_fail(enum mcheck_status s)
#endif

int main(int argc, char ** argv) {

fprintf(stderr, "pid: %d\n", getpid());

char buffer[1000];
while (1) {
fprintf(stderr, "> ");
Expand Down

0 comments on commit 30d99c0

Please sign in to comment.