This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Linux: consolidate rename()
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Yury Norov <ynorov at caviumnetworks dot com>
- Cc: <libc-alpha at sourceware dot org>, <zackw at panix dot com>, <schwab at linux-m68k dot org>, <arnd at arndb dot de>
- Date: Thu, 20 Oct 2016 13:13:19 +0000
- Subject: Re: [PATCH v2] Linux: consolidate rename()
- Authentication-results: sourceware.org; auth=none
- References: <1476924756-31448-1-git-send-email-ynorov@caviumnetworks.com>
On Thu, 20 Oct 2016, Yury Norov wrote:
> Tested on arm64/lp64 which supports renameat and renameat2,
> and aarch64/ilp32 which supports renameat2 only.
There's clearly something very wrong with your test environment that you
need to resolve before submitting any more glibc patches at all. If you'd
tested this patch you should have seen linknamespace tests failing because
rename is in standards that do not include renameat, and the localplt test
failing because you're calling an exported function that isn't using the
libc_hidden_proto/libc_hidden_def machinery (even non-exported functions
have to use that machinery when called within the same library, but
failure to do so is less visible from test results).
Just leave rename.c in sysdeps/unix/sysv/linux/generic and add a case for
it to use the renameat2 syscall and you avoid all these issues; on
platforms with the rename syscall, there is no benefit from going via
other syscalls, and calling renameat from rename rather than using
syscalls introduces unnecessary complications. (But you must still test
by running the full glibc testsuite and actually investigating any
failures seen.)
--
Joseph S. Myers
joseph@codesourcery.com