]> git.proxmox.com Git - mirror_edk2.git/blobdiff - InOsEmuPkg/Unix/Sec/SecMain.c
Add support for SerialPortLib that maps into POSIX StdIn and StdOut. Add a device...
[mirror_edk2.git] / InOsEmuPkg / Unix / Sec / SecMain.c
index ff5eff0c07fe8e437e033ffbb7a2ecd885e21930..41b66b3bc0fd9c12ef60d5690f5049be80159f70 100644 (file)
@@ -354,18 +354,19 @@ MapFile (
   VOID    *res;
   UINTN   FileSize;
 
-  fd = open (FileName, O_RDONLY);
+  fd = open (FileName, O_RDWR);
   if (fd < 0) {
     return EFI_NOT_FOUND;
   }
   FileSize = lseek (fd, 0, SEEK_END);
 
 
-  res = MapMemory (fd, FileSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE);
+  res = MapMemory (fd, FileSize, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED);
 
   close (fd);
 
-  if (res == MAP_FAILED) {
+  if (res == NULL) {
+    perror ("MapFile() Failed");
     return EFI_DEVICE_ERROR;
   }