Re: [hackers] [sbase][PATCH] cron: fix repeat for random, and format code

From: Elie Le Vaillant <eolien55_AT_disroot.org>
Date: Thu, 19 Dec 2024 17:16:30 +0100

Hi,

On Thu Dec 19, 2024 at 12:55 PM CET, Roberto E. Vargas Caballero wrote:
> I am sorry, there are so many patches, just fixing them
> that is impossible to follow anything. I am going to revert
> the changes to cron, but I am going to keep the last version
> of the random functions.
>
> Can you resend your patches for cron with a clean history and
> the current head?

Will do. I made some tweaks to the random functions which improve
them somewhat (better constants, no reentrant versions). I also
added an ifdef that uses arc4random on OpenBSD.

Maybe those aren't essential. The constants are objectively better
(they make the underlying LCG succeed more at spectral tests).
I think it's better to remove code we don't use, and we don't use
the reentrant versions. I'm not sure about arc4random, maybe it's
overkill?

On a somewhat-related note, I have implementations for:
- realpath(1). Not POSIX, but present in most Linuxes and in
  Net, Free and OpenBSD.
- shuf(1). Not POSIX, nor BSD, but it makes sense as the
  alternative would be jot(1) from the BSDs, which I believe
  would render seq(1) useless, and be overcomplicated.
  Simplifies sort(1) (no -R flag), but also has a different
  behavior on identical lines.
- tac(1). Not POSIX nor BSD, but coreutils and toy,busy-box.
  Simplifies tail(1) and sort(1) (no -r flag for either).
- ts(1). Moreutils, toybox and OpenBSD have it. I believe it
  can sometimes be useful.

What patches should I send?

With the sbase-ubase branch/unification, the project has somewhat
shifted in scope (a bit broader). Would it be adapted for this
branch?

I'm willing to work on a dc(1) implementation. Should I use
libzahl?

Cheers,
Elie Le Vaillant
Received on Thu Dec 19 2024 - 17:16:30 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 19 2024 - 17:24:42 CET