This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> // errno, duh | |
#include <seccomp.h> // seccomp, duh | |
#include <stdio.h> // fprintf | |
#include <stdlib.h> // exit | |
#include <sys/types.h> // fork | |
#include <unistd.h> // fork | |
static const char const mystring[] = "allow this fprintf\n"; | |
void run_child(void) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdio.h> | |
static void print_line(int indent_level, const char *format, ...) | |
{ | |
int i; | |
for (i = 0; i < indent_level; i++) | |
fprintf(stdout, " "); | |
va_list(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdio.h> | |
static void print_line(int indent_level, const char *format, ...) | |
{ | |
int i; | |
for (i = 0; i < indent_level; i++) | |
fprintf(stdout, " "); | |
va_list(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void print_instr(struct bpf_instr *instr) | |
{ | |
fprintf(stdout, "\t\t\t\top = 0x%x\n", instr->op); | |
fprintf(stdout, "\t\t\t\tjt type = %d hash = 0x%lx\n", instr->jt.type, | |
instr->jt.tgt.hash); | |
fprintf(stdout, "\t\t\t\tjf type = %d hash = 0x%lx\n", instr->jf.type, | |
instr->jf.tgt.hash); | |
fprintf(stdout, "\t\t\t\tk type = %d hash = 0x%lx\n", instr->k.type, | |
instr->k.tgt.hash); |
NewerOlder