From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80688 invoked by alias); 5 Jul 2018 18:36:55 -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 80559 invoked by uid 89); 5 Jul 2018 18:36:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:854 X-HELO: zimbra.cs.ucla.edu Subject: Re: [PATCH] Add the statx function To: Florian Weimer , libc-alpha@sourceware.org References: <20180630224103.4501543994575@oldenburg.str.redhat.com> From: Paul Eggert Openpgp: preference=signencrypt Message-ID: <4934579e-a05c-3dcc-0b26-5ec09e03fbb3@cs.ucla.edu> Date: Thu, 05 Jul 2018 18:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180630224103.4501543994575@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-07/txt/msg00142.txt.bz2 Florian Weimer wrote: > + *buf =3D (struct statx) > + { > + /* We copy everything from fstat64, which corresponds the basic > + fstat64. */ > + .stx_mask =3D STATX_BASIC_STATS, That assignment to *BUF unnecessarily clears all *BUF fields not mentioned.= It=20 should be a bit more efficient to have a separate assignment for each menti= oned=20 field, e.g., 'buf->stx_mask =3D STATX_BASIC_STATS;'. That "corresponds the" isn't grammatical and the comment has an incorrect=20 "fstat64" and an unnecessary "We". The comment could be just "Copy everythi= ng=20 from ST." or better yet it could just be omitted (it's pretty obvious). > +int statx (int __dirfd, const char *__path, int __flags, > + unsigned int __mask, struct statx *__buf) > + __THROW __nonnull ((2, 5)); The two pointer parameters should both be declared with __restrict.