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 1/2] y2038: linux: Provide __timerfd_gettime64 implementation


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


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