This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add the statx function


Florian Weimer wrote:

+  *buf = (struct statx)
+    {
+      /* We copy everything from fstat64, which corresponds the basic
+         fstat64.  */
+      .stx_mask = STATX_BASIC_STATS,

That assignment to *BUF unnecessarily clears all *BUF fields not mentioned. It should be a bit more efficient to have a separate assignment for each mentioned field, e.g., 'buf->stx_mask = STATX_BASIC_STATS;'.

That "corresponds the" isn't grammatical and the comment has an incorrect "fstat64" and an unnecessary "We". The comment could be just "Copy everything 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]