<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>On 2020-03-27 18:41, Joel Sherrill wrote:<br>
</p>
<blockquote type="cite"
cite="mid:CAF9ehCXA8966YDFBY=YV1B3LpZXh2GHMHh447OXdaOO=pcRg2Q@mail.gmail.com">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Mar 27, 2020 at 12:12
PM Eshan Dhawan <<a href="mailto:eshandhawan51@gmail.com"
moz-do-not-send="true">eshandhawan51@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Mar 26, 2020 at
11:18 AM Sebastian Huber <<a
href="mailto:sebastian.huber@embedded-brains.de"
target="_blank" moz-do-not-send="true">sebastian.huber@embedded-brains.de</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>
<p>On 25/03/2020 20:33, Joel Sherrill wrote:<br>
</p>
<blockquote type="cite">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Mar 25,
2020 at 12:17 AM Eshan Dhawan <<a
href="mailto:eshandhawan51@gmail.com"
target="_blank" moz-do-not-send="true">eshandhawan51@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed,
Mar 25, 2020 at 4:01 AM Joel Sherrill <<a
href="mailto:joel@rtems.org"
target="_blank" moz-do-not-send="true">joel@rtems.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On
Tue, Mar 24, 2020 at 4:57 PM Eshan
Dhawan <<a
href="mailto:eshandhawan51@gmail.com"
target="_blank"
moz-do-not-send="true">eshandhawan51@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Hello everyone,</div>
<div>As <a
class="gmail_plusreply"
id="gmail-m_3108884564936584680gmail-m_-3723575998770395837gmail-m_7264151322156336212gmail-m_6755986261809983477gmail-m_4381290465950915824plusReplyChip-3"
href="mailto:vaibhav.varodek@gmail.com" target="_blank"
moz-do-not-send="true">@Vaibhav
Gupta</a> suggested I have
also added adding file
descriptor functions to my GSOC
project.</div>
<div>I went through the mailing
list archives for more
information.<br>
</div>
<div>RTEMS as its own file
descriptor so the functions need
to be implemented from scratch.<br>
</div>
<div>I wanted to get more
information related to it.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>What's the set of functions you
are proposing for those not tracking
your draft proposal? </div>
</div>
</div>
</blockquote>
<div>Link: <a
href="https://docs.google.com/document/d/1n-JOFUbFn6V1kViAGWsEGbVHL9MxlMyKP0BbZhEA1Rs/edit?usp=sharing"
target="_blank" moz-do-not-send="true">https://docs.google.com/document/d/1n-JOFUbFn6V1kViAGWsEGbVHL9MxlMyKP0BbZhEA1Rs/edit?usp=sharing</a></div>
<div>I haven't searched about the functions
in the list yet. The list was made by
Vaibhav, last year and he told me that it
could be added to proposal this year as
well.<br>
</div>
<div>I read the archives that these need to
be written from scratch.<br>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>Maybe not. I found at least this
implementation of renameat() which was
implemented on top of existing calls:</div>
<div><br>
</div>
<div><a
href="https://github.com/lattera/freebsd/blob/master/contrib/openbsm/bin/auditdistd/renameat.h"
target="_blank" moz-do-not-send="true">https://github.com/lattera/freebsd/blob/master/contrib/openbsm/bin/auditdistd/renameat.h</a></div>
<div><br>
</div>
<div>It should be in a C file but that shows it
can be done. That directory has a lot of these
methods.</div>
</div>
</blockquote>
<p>Adding the *at() functions with an RTEMS-specific
implementation would be nice (and not difficult).
The generic renameat() implementation for example
changes the current directory. One of the goals of
this API is to avoid exactly this. In glibc/Linux
for example a system call is used:</p>
<p>
<a
href="https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/renameat.c;h=901d61f37e10d0c2df245c01bb2ef980d00e8f52;hb=HEAD"
target="_blank" moz-do-not-send="true">https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/renameat.c;h=901d61f37e10d0c2df245c01bb2ef980d00e8f52;hb=HEAD</a></p>
<p><a
href="https://github.com/torvalds/linux/blob/master/fs/namei.c#L4590"
target="_blank" moz-do-not-send="true">https://github.com/torvalds/linux/blob/master/fs/namei.c#L4590</a></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I'm not disagreeing that a generic implementation is
undesirable long-term but these methods have not been present
for 30 years and no one has complained about their absence. I
would propose generic implementations be added and a ticket
filed to add RTEMS specific implementations if someone
complains about the performance. </div>
<div><br>
</div>
<div>I see adding them now as a higher effort task that brings
little value. These are for standards compliance and not
performance critical.</div>
</div>
</blockquote>
<p>I would prefer to have real implementations and not just a
Potemkin village. Changing the current working directory (there is
only on in RTEMS by default) can lead to hard to find bugs.</p>
<p>All these functions are probably easy to implement. With
LIBIO_GET_IOP() and LIBIO_GET_IOP_WITH_ACCESS() you get the iop
from the file descriptor. Then we have to add a variant of
rtems_filesystem_eval_path_start_with_root_and_current() which
uses the location of the iop as the initial currentloc. The root
and current global locations can be set to
rtems_filesystem_global_location_null.<br>
</p>
</body>
</html>