From: Joseph Myers <joseph@codesourcery.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] Linux: consolidate rename()
Date: Thu, 20 Oct 2016 15:32:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1610201517130.15386@digraph.polyomino.org.uk> (raw)
In-Reply-To: <0b76f92f-0c56-b239-3820-ff38a707c382@linaro.org>
On Thu, 20 Oct 2016, Adhemerval Zanella wrote:
> I think the idea is to remove the 'generic' folder and let the
> sysdeps/unix/sysv/linux/ be the generic Linux implementation (which makes
> more sense IMHO and avoid confusion in which folder to imply).
That's fine, but when there are so many deficiencies in a single patch it
seems to make sense to suggest it be split into baby steps, so supporting
systems with only renameat2 is separate from unifying the implementations
of these functions into a single set of sources, which is separate from
any change of the rename function from using the rename syscall to using
the renameat syscall on platforms that have the rename syscall (if such a
change is desired at all).
> Now, related to patch I think a simpler implementation for both
> rename and renameat would be just:
>
> * sysdeps/unix/sysv/linux/rename.c:
>
> int
> rename (const char *old, const char *new)
> {
> #ifdef __NR_rename
> return INLINE_SYSCALL_CALL (rename, old, new);
> #else
> return INLINE_SYSCALL_CALL (renameat, AT_FDCWD, old, AT_FDCWD, new);
> #endif
> }
That of course is an implementation for the present situation of not
handling renameat2-only architectures, and a further conditional would be
needed for handling such architectures (but with a division into baby
steps, supporting renameat2 here would be separate from combining the
support for rename and renameat syscalls).
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2016-10-20 15:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 0:53 Yury Norov
2016-10-20 7:11 ` Andreas Schwab
2016-10-20 11:23 ` Yury Norov
2016-10-20 12:35 ` Andreas Schwab
2016-10-20 12:53 ` Yury Norov
2016-10-20 13:16 ` Joseph Myers
2016-10-20 13:58 ` Adhemerval Zanella
2016-10-20 15:32 ` Joseph Myers [this message]
2016-10-20 16:55 ` Adhemerval Zanella
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=alpine.DEB.2.20.1610201517130.15386@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).