mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Markus Wichmann <nullplan@gmx.net>
Cc: musl@lists.openwall.com
Subject: Re: [musl] __convert_scm_timestamps() probably breaks with struct timeval
Date: Fri, 2 Jun 2023 12:56:45 -0400	[thread overview]
Message-ID: <20230602165643.GV4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <ZHoQ63TdgsLM3Z5Q@voyager>

On Fri, Jun 02, 2023 at 05:55:23PM +0200, Markus Wichmann wrote:
> Hello,
> 
> never mind. I overlooked that you define suseconds_t as _Int64. I
> thought it was long. Of course, that changes everything.
> 
> Wondering why I thought it was long, I looked at POSIX again, and it
> says:
> 
> |The implementation shall support one or more programming environments
> |in which the [width] of [...] suseconds_t [...] [is] no greater than the
> |width of type long.
> 
> (Quoted from https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html)

That's legacy cruft from C89 days that used to require an environment
where off_t is no wider than long, which probably led to the whole
paragraph being ignored.

> So suseconds_t is not supposed to be larger than long. But I suppose you
> can only pick your poison here. Disregard that one requirement of POSIX
> or make timeval and timespec have different representations.

It's not about whether timeval and timespec have different
representations; that'd be fine, and in fact they do!

Rather, it's about whether the user and kernelspace (64-bit) timeval
types are in agreement. If not, there's a lot more mess to deal with.

Rich

  reply	other threads:[~2023-06-02 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02 14:49 Markus Wichmann
2023-06-02 15:23 ` Rich Felker
2023-06-02 15:55   ` Markus Wichmann
2023-06-02 16:56     ` Rich Felker [this message]
2023-06-02 15:54 ` Alexey Izbyshev

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=20230602165643.GV4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=nullplan@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).