This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] y2038: linux: Provide __timerfd_gettime64 implementation
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Paul Eggert <eggert at cs dot ucla dot edu>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at gotplt dot org>, Florian Weimer <fweimer at redhat dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>, Carlos O'Donell <carlos at redhat dot com>
- Date: Tue, 10 Dec 2019 00:52:00 +0000
- Subject: Re: [PATCH 1/2] y2038: linux: Provide __timerfd_gettime64 implementation
- Ironport-sdr: 97t6gOIVE1r8AsYSS/VUiGtDHPhJvxYeB0ip2n9W40tZQh7kbhH5YOBNUEBrF+/E6SlW1tuZJJ AncQGdT+hqrLqoVEALg1QvhrwkfQl21nKB3vmJSXdQpcvScYUA7E1PpURqiuNF68ktN2RMKxxl fwSpEaCe0X0QuXAwjBo1OM2WMJUNQPqoB9RPB4A1+IE7vR0Dxj5KzgTgBQd/O5nB+dsGc7+Vxz 0BL2nEqndX4an2xONY6WdJF0Ie0+vGO9VJKu3150PNAi8IOxo35ftHytdtzouXewYeZMep5MNC n8M=
- Ironport-sdr: xBeQeyU9CbygaPGvlH+hlEUdGbEn57zLyXrTbuM7MR6w+TtCdXbN6V+YoTvyec6Qhj+St2F4hn Bw41pu48nYq/nIeQcY/yHytArojGym8gV0bMU6PsxrZRkAF47s330LYlb2la9geHJg+zBh9QgU ze9VOXvSFdc1y20vWZHBLxPEiQ9d7dpg+NkhOZQHRytWuIA+ITqnudJuDGYORtKSvvFYxbX55L utjWiqaCu7PwMh0Llg4ln4qDQgeSsZz2G9NTYxeqVaNEQy5kDhlv+lrVlUqw09mdW37IxsqMym bDk=
- References: <20191206231004.10380-1-lukma@denx.de>
On Sat, 7 Dec 2019, Lukasz Majewski wrote:
> diff --git a/sysdeps/unix/sysv/linux/timerfd_gettime.c b/sysdeps/unix/sysv/linux/timerfd_gettime.c
> new file mode 100644
> index 0000000000..498605369b
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/timerfd_gettime.c
> @@ -0,0 +1,69 @@
> +/* Copyright (C) 2003-2019 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> + Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
New files need to have a descriptive comment before the copyright notice,
and no "Contributed by" line, and only have previous years in the
copyright notice if genuinely incorporating copyrightable content from
previous files from those years.
> +int
> +__timerfd_gettime64 (int fd, struct __itimerspec64 *value)
> +{
> + if (fd < 0)
> + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EBADF);
Why? In general, such checks are only needed in userspace if correct
function semantics means not passing such a case to the kernel at all, as
opposed to letting the kernel return an error for it.
The same comments apply to patch 2/2.
--
Joseph S. Myers
joseph@codesourcery.com