9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Gorka Guardiola <paurea@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] openat()
Date: Sat, 6 Apr 2024 00:29:45 +0200	[thread overview]
Message-ID: <CACm3i_j7gAmW+rGHMQG2dD=++FCADEX+ujonX_dAV2OEP5E2qw@mail.gmail.com> (raw)
In-Reply-To: <17123537830.EbFe44.28920@composer.9fans.topicbox.com>

[-- Attachment #1: Type: text/plain, Size: 2009 bytes --]

On Fri, Apr 5, 2024, 23:49 Alyssa M via 9fans <9fans@9fans.net> wrote:

> Are you thinking narrowly about "What changes to the Plan 9 kernel would
> you make to emulate the Linux openat() system call" or more generally about
> "How would you design a facility for plan 9 that provides an equivalent
> service?
>

Yes, this is what I understood between my first answer and the second. You
don't want to rewalk the path and you already have the fid with the
directory part walked in the chan of dirfd. I think that if you walk the
remaining path from that chan (cloning it) you preserve the same guarantees
provided by openat.



> As I understand it from the rationale section on the linux man page, the
> call exists to avoid a race condition between checking that a directory
> exists and doing something to a path containing it. An additional motivator
> is providing the effect of additional current working directories notably
> for Linux threads (which presumably don't have their own. I think
> 'threads'  (processes that share memory) on Plan 9 do???).
>
> This is all based on the assumption that holding a file/directory open
> keeps it alive and in existence... which on Plan 9, I think it doesn't,
> does it? As I understand it, remove can remove a file or directory that is
> open, which is not like UNIX/Linux...
>
> Sorry, I'm just trying to understand the question.
>
>
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/T675e737e776e5a9c-M77db5ff0993c7da831142e92>
>

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T675e737e776e5a9c-M1c147cadc76c65a4fbb9aa76
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 2787 bytes --]

  reply	other threads:[~2024-04-05 22:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 19:50 ron minnich
2024-04-05 20:12 ` Gorka Guardiola
2024-04-05 20:15   ` Gorka Guardiola
2024-04-05 20:36     ` Gorka Guardiola
2024-04-05 21:22       ` ron minnich
2024-04-05 21:43         ` Bakul Shah via 9fans
2024-04-05 21:49         ` Alyssa M via 9fans
2024-04-05 22:29           ` Gorka Guardiola [this message]
2024-04-06  3:18             ` moody
2024-04-06 17:35               ` ron minnich
2024-04-06 19:23                 ` David Leimbach via 9fans
2024-04-06 19:54                 ` Bakul Shah via 9fans
2024-04-06 19:24               ` Alyssa M via 9fans
2024-04-06 20:51                 ` moody
2024-04-07  1:36                   ` Alyssa M via 9fans
2024-04-07 15:00                     ` Alyssa M via 9fans
2024-04-10 12:17                       ` wb.kloke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACm3i_j7gAmW+rGHMQG2dD=++FCADEX+ujonX_dAV2OEP5E2qw@mail.gmail.com' \
    --to=paurea@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).