All modern procfs systems implement "/proc/self/"
for the running process. Just
fd = open("/proc/self/maps", O_RDONLY);
If you still wish to create the path string yourself then you have to use sprintf
char filename[128];
sprintf(filename, "/proc/%d/maps", getpid());
fd = open(filename, O_RDONLY);