bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 2/3] hurd: Implement O_TMPFILE


From: Amos Jeffries
Subject: Re: [RFC PATCH 2/3] hurd: Implement O_TMPFILE
Date: Tue, 13 Dec 2022 03:00:36 +1300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 13/12/2022 12:46 am, Sergey Bugaev wrote:
@@ -90,6 +95,21 @@ __file_name_lookup_at (int fd, int at_flags,
          }
      }
+ if ((orig_flags & __O_TMPFILE) == __O_TMPFILE)
+    {
+      /* What we have looked up is not the file iteself, but actually

s/iteself/itself.\/

+         the directory to create the file in.  Do that now.  */
+      file_t dir = result;
+
+      err = __dir_mkfile (dir, orig_flags & ~O_TMPFILE, mode, &result);
+      __mach_port_deallocate (__mach_task_self (), dir);
+      if (err)
+        {
+          __hurd_fail (err);
+          return MACH_PORT_NULL;
+        }
+    }
+
    return result;
  }

HTH
Amos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]