+       if (filename[0] != '\0') {
+               struct stat st;
+               
+               image_fd = open(filename, O_RDONLY);
+               if (image_fd < 0) {
+                       perror("open");
+                       exit_code = EXIT_FAILURE;
+                       goto out;
+               }
+               if (fstat(image_fd, &st) < 0) {
+                       perror("fstat");
+                       exit_code = EXIT_FAILURE;
+                       goto out_close_image_fd;
+               }
+               size = st.st_size;
+
+               image = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, image_fd, 0);
+               if (image == NULL) {
+                       perror("mmap");
+                       exit_code = EXIT_FAILURE;
+                       goto out_close_image_fd;
+               }
+       }
+