public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v3 1/2] support: Add support_socket_so_timestamp_time64
Date: Mon, 24 Jan 2022 08:45:26 -0300	[thread overview]
Message-ID: <db79e0c0-bdd6-6b40-72ac-4c87f18f4afb@linaro.org> (raw)
In-Reply-To: <87ee51708n.fsf@oldenburg.str.redhat.com>



On 21/01/2022 09:16, Florian Weimer wrote:
> * 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?
> 

It does not make sense indeed, all supported architecture already support 
direct socket syscall with a kernel with 64 bit time_t support (v5.1.).
I will remove it.

  reply	other threads:[~2022-01-24 11:45 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
2022-01-24 11:45     ` Adhemerval Zanella [this message]
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=db79e0c0-bdd6-6b40-72ac-4c87f18f4afb@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --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).