From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v3 1/2] support: Add support_socket_so_timestamp_time64
Date: Fri, 21 Jan 2022 13:16:08 +0100 [thread overview]
Message-ID: <87ee51708n.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20211213143643.1182659-2-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Mon, 13 Dec 2021 11:36:42 -0300")
* Adhemerval Zanella:
> +bool
> +support_socket_so_timestamp_time64 (int fd)
> +{
> +#ifdef __linux__
> +# if __LINUX_KERNEL_VERSION >= 0x050100 \
> + || __WORDSIZE == 64 \
> + || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64)
> + return true;
> +# else
> + int level = SOL_SOCKET;
> + int optname = COMPAT_SO_TIMESTAMP_NEW;
> + int optval;
> + socklen_t len = sizeof (optval);
> +
> + int r = syscall (__NR_getsockopt, fd, level, optname, &optval, &len);
> +# ifdef __NR_socketcall
> + if (r == -1 && errno == ENOSYS)
> + {
> + long int args[] = { fd, level, optname, (long int) &optval,
> + sizeof (optval) };
> + r = syscall (__NR_socketcall, 15 /* SOCKOP_getsockopt */ , args);
> + }
> +# endif
> + return r != -1;
> +# endif
> +#else
> + return false;
> +#endif
> +}
Is the socketcall fallback really required? Why would anyone backport
time64 support without also backporting direct system call support?
Thanks,
Florian
next prev parent reply other threads:[~2022-01-21 12:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-13 14:36 [PATCH v3 0/2] Fix 64-bit time_t ancillary socket conversion Adhemerval Zanella
2021-12-13 14:36 ` [PATCH v3 1/2] support: Add support_socket_so_timestamp_time64 Adhemerval Zanella
2022-01-21 12:16 ` Florian Weimer [this message]
2022-01-24 11:45 ` Adhemerval Zanella
2021-12-13 14:36 ` [PATCH v3 2/2] linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350) Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ee51708n.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).