[PATCH-n] Add statx conditionals for wordsize-32 *xstat.c
Joseph Myers
joseph@codesourcery.com
Wed Dec 5 16:32:00 GMT 2018
On Thu, 29 Nov 2018, Mao Han wrote:
> +# ifdef __NR_fstat64
> int rc = INLINE_SYSCALL (fstat64, 2, fd, buf);
> return rc ?: stat_overflow (buf);
> +# else
> + struct statx tmp;
> + int rc = INLINE_SYSCALL (statx, 5, fd, "", AT_EMPTY_PATH,
> + STATX_BASIC_STATS, &tmp);
> + if (rc == 0)
> + __cp_stat64_statx ((struct stat64 *)buf, &tmp);
> + return rc ?: stat_overflow (buf);
> +# endif
I think that in all these cases where overflow checks are needed, it would
be best for the "return rc ?: stat_overflow (buf);" to be outside the
#ifdef conditionals, because if it's needed with one syscall, it's needed
with both of them.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list