• jot source via FTP?

    From Winston@21:1/5 to All on Sat Dec 25 09:29:20 2021
    Is the FreeBSD source code for all its pieces (individually) still
    available via FTP? It didn't seem so at ftp://ftp.freebsd.org/ .
    It looks like the choices are now 1) GIT, perhaps still
    2) Subversion, and 3) download and unpack an entire system tarball
    of ~180MB.

    In any case, the actual question I'm trying to answer is:
    Does jot(1) use arc4random(3) [as its man page says] or does it
    use arc4random_uniform(3)?

    Thanks in advance, and Merry Christmas.
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mikea@mikea.ath.cx@21:1/5 to Winston on Sat Dec 25 17:17:33 2021
    Winston <wbe@ubeblock.psr.com.invalid> wrote in <ydlf08ahbz.fsf@UBEblock.psr.com>:

    Is the FreeBSD source code for all its pieces (individually) still
    available via FTP? It didn't seem so at ftp://ftp.freebsd.org/ .
    It looks like the choices are now 1) GIT, perhaps still
    2) Subversion, and 3) download and unpack an entire system tarball
    of ~180MB.

    In any case, the actual question I'm trying to answer is:
    Does jot(1) use arc4random(3) [as its man page says] or does it
    use arc4random_uniform(3)?

    Thanks in advance, and Merry Christmas.
    -WBE

    Merry Christmas!

    Looks like it uses arc4random.

    From /usr/src/usr.bin/jot on my FreeBSD-12 system:

    321 for (i = 1; i <= reps || infinity; i++) {
    322 if (use_random)
    323 y = random() / divisor;
    324 else
    325 y = arc4random() / divisor;
    326 if (putdata(y * x + begin, !(reps - i)))
    327 errx(1, "range error in conversion");
    328 }
    329 } else
    330 for (i = 1, x = begin; i <= reps || infinity; i++, x += s)
    331 if (putdata(x, !(reps - i)))
    332 errx(1, "range error in conversion");
    333 if (!nofinalnl)
    334 putchar('\n');
    335 exit(0);
    336 }
    337
    338 /*
    339 * Send x to stdout using the specified format.
    340 * Last is true if this is the set's last value.
    jot.c lines 307-340/517 byte 8665/12548 69% (press RETURN)

    --
    "But you've got to hand it to IBM, they know how to design
    hardware. The servers all had handles to pick them up and throw
    them out of the window...." -- Juergen Nieveler in the Monastery

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to I originally on Sat Dec 25 13:44:15 2021
    I originally asked:
    Does jot(1) use arc4random(3) [as its man page says] or does it
    use arc4random_uniform(3)?

    Thanks in advance, and Merry Christmas.

    to which mikea@mikea.ath.cx very kindly replied:
    Merry Christmas!

    Looks like it uses arc4random.

    From /usr/src/usr.bin/jot on my FreeBSD-12 system:

    321 for (i = 1; i <= reps || infinity; i++) {
    322 if (use_random)
    323 y = random() / divisor;
    324 else
    325 y = arc4random() / divisor;
    326 if (putdata(y * x + begin, !(reps - i)))
    327 errx(1, "range error in conversion");
    328 }
    329 } else
    330 for (i = 1, x = begin; i <= reps || infinity; i++, x += s)
    331 if (putdata(x, !(reps - i)))
    332 errx(1, "range error in conversion");
    333 if (!nofinalnl)
    334 putchar('\n');
    335 exit(0);
    336 }
    337
    338 /*
    339 * Send x to stdout using the specified format.
    340 * Last is true if this is the set's last value.
    jot.c lines 307-340/517 byte 8665/12548 69% (press RETURN)

    THANK YOU! By providing that bit of the source, you even answered my
    more specific question: What random number function does "jot -r" use?
    [I didn't consider jot might use different ones in different cases.]
    I see above it uses random().

    I've also now discovered sort of an answer to my first question:

    Is the FreeBSD source code for all its pieces (individually) still
    available via FTP?

    While it's HTTPS, not FTP, I see the source for the individual programs
    (such as jot.c) are available at github without having to log in, set up
    an account, etc., so it's just as easy to use as the FTP tree was.

    Thanks, Mike! Now, back to trying to figure out why I'm getting
    skewed results in certain cases ...
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Weisgerber@21:1/5 to Winston on Mon Dec 27 19:30:18 2021
    On 2021-12-25, Winston <wbe@UBEBLOCK.psr.com.invalid> wrote:

    Is the FreeBSD source code for all its pieces (individually) still
    available via FTP? It didn't seem so at ftp://ftp.freebsd.org/ .
    It looks like the choices are now 1) GIT, perhaps still
    2) Subversion, and 3) download and unpack an entire system tarball
    of ~180MB.

    You can look at individual files using the "cgit" FreeBSD Git
    repository browser. I don't know if it was an infrastructure update
    or if it's a technological improvement, but this is much faster
    than the old svnweb.

    https://cgit.freebsd.org/src/tree/usr.bin/jot/jot.c

    --
    Christian "naddy" Weisgerber naddy@mips.inka.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Winston@21:1/5 to I previously on Tue Dec 28 03:27:41 2021
    I previously asked:
    Is the FreeBSD source code for all its pieces (individually) still
    available via FTP? It didn't seem so at ftp://ftp.freebsd.org/ .
    It looks like the choices are now 1) GIT, perhaps still
    2) Subversion, and 3) download and unpack an entire system tarball
    of ~180MB.

    to which Christian Weisgerber <naddy@mips.inka.de> kindly replied:
    You can look at individual files using the "cgit" FreeBSD Git
    repository browser. I don't know if it was an infrastructure update
    or if it's a technological improvement, but this is much faster
    than the old svnweb.

    https://cgit.freebsd.org/src/tree/usr.bin/jot/jot.c

    That's good to know. For the moment, though, I found that the individual pieces are available from www.freebsd.org with just a web browser, using
    a similar path to get just jot.c, so while it's HTTPS instead of FTP, at
    least the pieces are available individually.
    -WBE

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)