#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>

#define BSIZE 200

int main(void) {
	char buffer[BSIZE];
	int const pid = getpid();
	snprintf(buffer, BSIZE, "/proc/%d/maps", pid);
	FILE * const maps = fopen(buffer, "r");
	while (fgets(buffer, BSIZE, maps) != NULL) {
		unsigned long from, to;
		int const r = sscanf(buffer, "%lx-%lx", &from, &to);
		if (r != 2) {
			puts("!");
			continue;
		}
		if ((from <= (uintptr_t)&fopen) && ((uintptr_t)&fopen < to)) {
			char const * name = strchr(buffer, '/');
			if (name) {
				printf("%s", name);
			} else {
				puts("?");
			}
		}
	}
	fclose(maps);
}
