[PATCH] Add the statx function
Paul Eggert
eggert@cs.ucla.edu
Thu Jul 5 18:36:00 GMT 2018
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.
More information about the Libc-alpha
mailing list