From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbcDMTmN (ORCPT ); Wed, 13 Apr 2016 15:42:13 -0400 Received: from terminus.zytor.com ([198.137.202.10]:38690 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbcDMTmJ (ORCPT ); Wed, 13 Apr 2016 15:42:09 -0400 Subject: Re: [PATCH v4 0/3] vfs: Define new syscall umask2 [formerly getumask] To: "Richard W.M. Jones" , linux-kernel@vger.kernel.org References: <1460574336-18930-1-git-send-email-rjones@redhat.com> Cc: tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, luto@kernel.org, viro@zeniv.linux.org.uk, mathieu.desnoyers@efficios.com, zab@redhat.com, emunson@akamai.com, paulmck@linux.vnet.ibm.com, aarcange@redhat.com, josh@joshtriplett.org, xemul@parallels.com, sfr@canb.auug.org.au, milosz@adfin.com, rostedt@goodmis.org, arnd@arndb.de, ebiederm@xmission.com, gorcunov@openvz.org, iulia.manda21@gmail.com, dave.hansen@linux.intel.com, mguzik@redhat.com, adobriyan@gmail.com, dave@stgolabs.net, linux-api@vger.kernel.org, gorcunov@gmail.com, fw@deneb.enyo.de, walters@verbum.org From: "H. Peter Anvin" Message-ID: <570EA006.5010608@zytor.com> Date: Wed, 13 Apr 2016 12:37:42 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1460574336-18930-1-git-send-email-rjones@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/13/16 12:05, Richard W.M. Jones wrote: > v3 -> v4: > > - Rename the syscall: getumask becomes umask2. > > - Add flags parameter, with one flag (UMASK_GET_MASK). > > - Expand the rationale for this change in the first commit message. > > > It's not possible to read the process umask without also modifying it, > which is what umask(2) does. A library cannot read umask safely, > especially if the main program might be multithreaded. > I wouldn't say "if"; that is the case when it matters. I have to say I'm skeptic to the need for umask2() as opposed to getumask(). I would also like to be able to get the umask of another process, which would argue for adding it to /proc anyway. -hpa