public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* C11 timespec_get(), TIME_UTC
@ 2023-03-25 20:59 Falco Girgis
  2023-03-25 21:21 ` Joel Sherrill
  0 siblings, 1 reply; 2+ messages in thread
From: Falco Girgis @ 2023-03-25 20:59 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Hey guys,

I'm a big user and fan of Newlib and have really enjoyed working with it.
In addition to it being used in a bunch of the builds I target in CI, I'm
one of the maintainers of the KallistiOS indie/homebrew SDK for the Sega
Dreamcast, which has an epic amount of modern language and stdlib support
for C and C++ thanks to you guys.

Anyway, I just encountered something today that is missing that I can't
help but feel like should really be included within the lib: support for
the C11 timespec struct, timespec_get() function, and the TIME_UTC macro,
used to simply get the current UTC time in seconds + nanoseconds:
https://en.cppreference.com/w/c/chrono/TIME_UTC

Given the amount of non-standard POSIX time functionality that is
supported, the modern C++ chrono stuff, the rest of the C stdlib, etc, it
feels like this should fall within the scope of the project. It looks like
everybody else is just doing a tiny little wrapper for it around
clock_gettime(), so it's simple to implement as well... I also see several
threads on stack overflow with people confused as to why it's not available
to them, so I'm not the only one interested.

I've never submitted a patch for anything like this before and wanted to
run this by you guys to make sure it fall within NewLib's scope before I
was going to give it a shot. What do you guys think?

Anyway, thanks again, sorry for the verbosity.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: C11 timespec_get(), TIME_UTC
  2023-03-25 20:59 C11 timespec_get(), TIME_UTC Falco Girgis
@ 2023-03-25 21:21 ` Joel Sherrill
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Sherrill @ 2023-03-25 21:21 UTC (permalink / raw)
  To: gyrovorbis; +Cc: Newlib

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

On Sat, Mar 25, 2023, 4:00 PM Falco Girgis <gyrovorbis@gmail.com> wrote:

> Hey guys,
>
> I'm a big user and fan of Newlib and have really enjoyed working with it.
> In addition to it being used in a bunch of the builds I target in CI, I'm
> one of the maintainers of the KallistiOS indie/homebrew SDK for the Sega
> Dreamcast, which has an epic amount of modern language and stdlib support
> for C and C++ thanks to you guys.
>
> Anyway, I just encountered something today that is missing that I can't
> help but feel like should really be included within the lib: support for
> the C11 timespec struct, timespec_get() function, and the TIME_UTC macro,
> used to simply get the current UTC time in seconds + nanoseconds:
> https://en.cppreference.com/w/c/chrono/TIME_UTC
>
> Given the amount of non-standard POSIX time functionality that is
> supported, the modern C++ chrono stuff, the rest of the C stdlib, etc, it
> feels like this should fall within the scope of the project. It looks like
> everybody else is just doing a tiny little wrapper for it around
> clock_gettime(), so it's simple to implement as well... I also see several
> threads on stack overflow with people confused as to why it's not available
> to them, so I'm not the only one interested.
>
> I've never submitted a patch for anything like this before and wanted to
> run this by you guys to make sure it fall within NewLib's scope before I
> was going to give it a shot. What do you guys think?
>

I will go the explanation that hi one had ever wanted it enough to
implement it. :)

Sure feel free to implement and submit it with the proper license.

>
> Anyway, thanks again, sorry for the verbosity.
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-25 21:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 20:59 C11 timespec_get(), TIME_UTC Falco Girgis
2023-03-25 21:21 ` Joel Sherrill

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).