From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71519 invoked by alias); 20 Oct 2016 16:55:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 71498 invoked by uid 89); 20 Oct 2016 16:55:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=baby X-HELO: mail-vk0-f45.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=KL7SWSkBRuf2LGPZ6a/ZBuXgU4Ff8frKMrmsLU7W4oY=; b=i81dBm26Lr6q3nkPanJ04g5DyjIfjRJ3PO9Wh4WBed1/epC8dZLb5Qg+aghJVbX4tG w0w5USC/11MXZU1mDjuqPrR2N8Z/4fSve8DiC6RWjgxf8FWnzv8X7Zyx2HsloEoAQU4/ GaJa1lMQYiyRm+LjT+DTb/ZSaxwREP7pHIggfdtBhvLzbE+hUQ4VOmuknmhkqrt4T6yM LuJFnsOYothc7Nfl8fLHHY3dFBTC8BDqxAY3cASlQDMG49kdUrsF7C/F4mbf8R1VhOS0 46/5AMRd7TS49gCLxPzjNtRZUpJuzePkZdv7i+osq8GxKc49j/DY8g8CzU6zpEp/+Pfx vRqQ== X-Gm-Message-State: AA6/9Rk4X8ZDPwH1nDQEOYbNnGHg6gJnSLrR2EdhQ/I3GhjlQVt+I84xfBexz87Gf+pMaGZf X-Received: by 10.31.148.22 with SMTP id w22mr2222189vkd.87.1476982508177; Thu, 20 Oct 2016 09:55:08 -0700 (PDT) Subject: Re: [PATCH v2] Linux: consolidate rename() To: Joseph Myers References: <1476924756-31448-1-git-send-email-ynorov@caviumnetworks.com> <0b76f92f-0c56-b239-3820-ff38a707c382@linaro.org> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <91e758ff-7aac-5dc0-2c3e-220b69ecaf2d@linaro.org> Date: Thu, 20 Oct 2016 16:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00340.txt.bz2 On 20/10/2016 13:31, Joseph Myers wrote: > 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). Yes, for this specific patch it seems sensible to split it in smaller changes. > >> 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). Indeed I did not take this constraint in consideration (an architecture that only supports renameat2).