From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932606AbdC1XnE (ORCPT ); Tue, 28 Mar 2017 19:43:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52038 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753312AbdC1XnD (ORCPT ); Tue, 28 Mar 2017 19:43:03 -0400 Date: Tue, 28 Mar 2017 16:42:27 -0700 From: Andrew Morton To: shuah@kernel.org Cc: SeongJae Park , Simon Guo , linux-kselftest@vger.kernel.org, "linux-kernel@vger.kernel.org" , Shuah Khan Subject: Re: [PATCH] selftests/vm: Set mmap()'s fd as -1 for MAP_ANONYMOUS flag Message-Id: <20170328164227.95f3cc342da28b92be45e25e@linux-foundation.org> In-Reply-To: <09a5192e-5a10-c314-4c20-55d57af40015@kernel.org> References: <20170315131926.461-1-sj38.park@gmail.com> <09a5192e-5a10-c314-4c20-55d57af40015@kernel.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Mar 2017 10:47:55 -0600 Shuah Khan wrote: > > On Wed, Mar 15, 2017 at 10:19 PM, SeongJae Park wrote: > >> Man page of mmap() says that portable applications should ensure fd > >> argument to be -1 if MAP_ANONYMOUS flag is set as below: > >> ``` > >> The mapping is not backed by any file; its contents are initialized to > >> zero. The fd and offset arguments are ignored; however, some > >> implementations require fd to be -1 if MAP_ANONYMOUS (or > >> MAP_ANON) is specified, and portable applications > >> should ensure this. > >> ``` > >> > >> However, few mmap() calls under selftests/vm/ uses 0 as fd though they > >> use MAP_ANONYMOUS flag. This commit changes the argument to be -1 as > >> recommended. > > Hi Andrew, > > Do you have comments on this patch? Please Ack it if you would > like me to take it thorugh ksefltest tree. Acked-by: Andrew Morton