Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-20 Thread enh via Toybox
On Tue, Oct 19, 2021 at 11:56 PM Rob Landley wrote: > On 10/19/21 10:57 AM, enh wrote: > > are you sure? remember that if a test is currently checked in [and > Android uses > > the toy; my test runner reports but ignores failures for tests where > readlink > > sa

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-20 Thread enh via Toybox
On Wed, Oct 20, 2021 at 10:35 AM Rob Landley wrote: > On 10/20/21 11:51 AM, enh wrote: > > for the ignorant (like me) --- are these libraries like BearSSL an extra > > abstraction on top of stuff like openssl/boringssl, or are they roughly > equivalent? > > Roughly equi

Re: [Toybox] [PATCH] wget: add TLS support

2021-10-20 Thread enh via Toybox
for the ignorant (like me) --- are these libraries like BearSSL an extra abstraction on top of stuff like openssl/boringssl, or are they roughly equivalent? (i'm just thinking ahead to what i'd have to do to get toybox wget working with boringssl because of FIPS. which, yes, makes about as much se

Re: [Toybox] The cut -C test is failing because bionic's wcwidth() doesn't match glibc or musl.

2021-10-19 Thread enh via Toybox
are you sure? remember that if a test is currently checked in [and Android uses the toy; my test runner reports but ignores failures for tests where readlink says it's not actually toybox], that means that the tests pass on Android. there's even a CTS test: ``` TEST(wchar, wcwidth_non_spacing_and_

[Toybox] [PATCH] tail: add the long option synonyms for -n and -c.

2021-10-13 Thread enh via Toybox
Believe it or not -- I struggle to believe it myself -- we've been ignoring tail's complaint that it doesn't know what --bytes means in the Android CI infrastructure since at least mid-2019. (To be fair, today wasn't the first time I'd seen that error message scroll by myself, but it was the first

[Toybox] [PATCH] pidof: fix -s.

2021-10-05 Thread enh via Toybox
Also modernize pidof.c, even though the bug was in lib. --- lib/lib.c| 3 ++- toys/lsb/pidof.c | 12 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) From 2312b42012ebc86cc5b1887d632d3fd47d7ec23f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 5 Oct 2021 14:21:30 -0

Re: [Toybox] Pending todoness.

2021-10-01 Thread enh via Toybox
gt;machine, COMPAT_UTS_MACHINE, \ >->- sizeof(COMPAT_UTS_MACHINE))) #else #define override_architecture(name)>0 #endif On Fri, Oct 1, 2021 at 10:24 AM Rob Landley wrote: > On 9/30/21 8:48 PM, enh wrote: > > > On Tue, Sep 28, 2021, 18:04 Rob Landley > > That said, according to the m

Re: [Toybox] [PATCH] Fix macOS build.

2021-09-30 Thread enh via Toybox
> On 9/28/21 7:42 PM, enh via Toybox wrote: > > > > --- > > > > lib/portability.h | 2 +- > > A better solution than the one I already committed before I saw this. :) > > Why are we not feeding --gc-sections to the mac linker? (I'm guessing it's > a

Re: [Toybox] Pending todoness.

2021-09-30 Thread enh via Toybox
Not uname, afaik: it tells the arm64 kernel to lie when you look at /proc/cpuinfo though... https://elixir.bootlin.com/linux/latest/A/ident/PER_LINUX32 On Tue, Sep 28, 2021, 18:04 Rob Landley wrote: > On 9/28/21 7:44 PM, enh wrote: > > ...oh, and that personality() wasn't an inlin

Re: [Toybox] Pending todoness.

2021-09-28 Thread enh via Toybox
On Tue, Sep 28, 2021 at 4:36 PM enh wrote: > On Tue, Sep 28, 2021 at 4:31 PM Rob Landley wrote: > > > > On 9/28/21 11:55 AM, enh wrote: > > > Thoughts/explanation of how I misunderstood what you were asking here? > (We build > > > uname for macOS host bui

[Toybox] [PATCH] Fix macOS build.

2021-09-28 Thread enh via Toybox
--- lib/portability.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 0001-Fix-macOS-build.patch Description: Binary data ___ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net

Re: [Toybox] Pending todoness.

2021-09-28 Thread enh via Toybox
On Tue, Sep 28, 2021 at 4:31 PM Rob Landley wrote: > > On 9/28/21 11:55 AM, enh wrote: > > Thoughts/explanation of how I misunderstood what you were asking here? (We > > build > > uname for macOS host builds, so I can't sync toybox if uname doesn't build.)

Re: [Toybox] Pending todoness.

2021-09-28 Thread enh via Toybox
i think you'd forgotten to `git push` before. i see that change now though, but it still doesn't work --- the constant is PER_LINUX32, not LINUX_PER32 :-) On Tue, Sep 28, 2021 at 4:16 PM Rob Landley wrote: > > On 9/28/21 11:55 AM, enh wrote: > > Thoughts/explanation of ho

Re: [Toybox] Pending todoness.

2021-09-28 Thread enh via Toybox
Thoughts/explanation of how I misunderstood what you were asking here? (We build uname for macOS host builds, so I can't sync toybox if uname doesn't build.) On Mon, Sep 27, 2021, 09:10 enh wrote: > > > On Sat, Sep 25, 2021 at 6:23 PM Rob Landley wrote: > >> O

[Toybox] [PATCH] about.html: when was Android M again?

2021-09-27 Thread enh via Toybox
M was long enough ago that even I don't remember exactly when, and I work on Android! The year is probably more meaningful to most people. --- www/about.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From ec7c6da14b563be23ab426fbef511a16f249ae7c Mon Sep 17 00:00:00 2001 From: Elliott H

Re: [Toybox] [PATCH] pmap: cleanup.

2021-09-27 Thread enh via Toybox
sets the static analyzer that's easy to just think about once and not worry about again... On Sun, Sep 26, 2021 at 1:03 PM Rob Landley wrote: > On 9/25/21 8:44 PM, enh via Toybox wrote: > > Remove unbounded scanfs. > > *shrug* I tend to trust data that comes from the kernel via

Re: [Toybox] [PATCH] lsof: explicit size for device major:minor buffer.

2021-09-27 Thread enh via Toybox
wrote: > On 9/25/21 8:55 PM, enh via Toybox wrote: > > These are 2 hex digits each with a ':' between them in the kernel. > > Major has been 12 bits and minor 20 bits since 2003. (Git annotate on the > header > says https://github.com/mpe/linux-fullhistory/commit/7a

Re: [Toybox] Pending todoness.

2021-09-27 Thread enh via Toybox
On Sat, Sep 25, 2021 at 6:23 PM Rob Landley wrote: > On 9/25/21 3:02 PM, enh wrote: > > macOS prints "Darwin", which i assumed was what you wanted? (the > built-in macOS > > uname doesn't have -o.) > > That's the kernel type. (Default output is -

[Toybox] [PATCH] The VERBOSE= behavior changed a while ago.

2021-09-25 Thread enh via Toybox
Update the documentation and github CI actions (seeing all failures on github makes sense because most people looking at failing Darwin test runs there won't be able to reproduce locally for lack of a Mac). --- .github/workflows/toybox.yml | 6 +++--- scripts/help.txt | 4 ++-- scripts

[Toybox] [PATCH] comm: stop using get_line().

2021-09-25 Thread enh via Toybox
Also use FLAG(). --- tests/comm.test | 9 + toys/posix/comm.c | 28 ++-- 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100755 tests/comm.test From 5adcdb8ae4a91da7b52facddee583d4c2be5957b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat,

[Toybox] [PATCH] lsof: explicit size for device major:minor buffer.

2021-09-25 Thread enh via Toybox
These are 2 hex digits each with a ':' between them in the kernel. --- toys/pending/lsof.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) From 1c6c67e62cea41ef2c1fad90dc7ce92cf6056521 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 25 Sep 2021 18:53:23 -0700 Subject: [PATC

[Toybox] [PATCH] pmap: cleanup.

2021-09-25 Thread enh via Toybox
Remove unbounded scanfs. Also reduce the amount of allocation and freeing by reusing the getline() buffer. Correct syntax in help. Improve error messages. Implement -p. Use FLAG() and simplify implementation slightly. --- toys/other/pmap.c | 118 +- 1

Re: [Toybox] [PATCH] Fix non-Mac build.

2021-09-25 Thread enh via Toybox
outube, since the temperatures have been high and the air quality low lately! On Sat, Sep 25, 2021 at 9:05 AM Rob Landley wrote: > You've been busy. > > On 9/24/21 6:44 PM, enh via Toybox wrote: > > Should have used #ifdef, not #if. (Really wish I could cross-compile for

Re: [Toybox] [PATCH] chvt: remove old workarounds.

2021-09-25 Thread enh via Toybox
On Sat, Sep 25, 2021 at 9:30 AM Rob Landley wrote: > On 9/24/21 7:10 PM, enh via Toybox wrote: > > We don't need the fd=fd hack for GCC 3.4 in 2021, > > Yeah, but we still needed it in 2018. > do you have a similar 7 year rule for the toolchain used to build toybox,

Re: [Toybox] [PATCH] blkid: more scanf fun.

2021-09-25 Thread enh via Toybox
yeah, there are fairly-common fs types that toybox blkid currently doesn't know too. ("LVM2_member" and "crypto_LUKS" for example.) On Sat, Sep 25, 2021 at 9:41 AM Rob Landley wrote: > On 9/24/21 7:55 PM, enh via Toybox wrote: > > The unbounded %[] here mad

Re: [Toybox] Pending todoness.

2021-09-25 Thread enh via Toybox
macOS prints "Darwin", which i assumed was what you wanted? (the built-in macOS uname doesn't have -o.) On Sat, Sep 25, 2021 at 11:29 AM Rob Landley wrote: > On 9/16/21 8:37 PM, enh wrote: > > (i think you need a needspace=1 in the Android case to make things like >

[Toybox] [PATCH] blkid: more scanf fun.

2021-09-24 Thread enh via Toybox
The unbounded %[] here made me look at the kernel, where the size of a block device name is limited to 32 bytes (including the NUL), so although the 1024 bytes of toybuf was plenty, that meant that the 32-byte buffer for "/dev/%s" was too small because the "%s" alone could require the entire buffer

[Toybox] [PATCH] chvt: remove old workarounds.

2021-09-24 Thread enh via Toybox
We don't need the fd=fd hack for GCC 3.4 in 2021, and has given names to the two magic numbers since at least Linux 2.4.0... --- toys/other/chvt.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) From 7529694f866121f1549c1aee4eea5dafb4e97528 Mon Sep 17 00:00:00 2001 From: Elliott

[Toybox] [PATCH] getline() returns -1 on EOF, not 0.

2021-09-24 Thread enh via Toybox
...but you can get 0 if you have a "no newline at end of file" file. I've been through all the current callers, and just these ones weren't using the canonical test. --- toys/lsb/mount.c | 2 +- toys/pending/init.c| 2 +- toys/pending/lsof.c| 2 +- toys/pending/userdel.c | 2 +- 4 f

Re: [Toybox] [PATCH] Fix non-Mac build.

2021-09-24 Thread enh via Toybox
(strictly the Linux build isn't *broken* [unless you build with -Werror=undef] but it is *really really noisy*. sorry about that!) On Fri, Sep 24, 2021 at 4:44 PM enh wrote: > Should have used #ifdef, not #if. (Really wish I could cross-compile for > the Mac!) > --- > lib/

[Toybox] [PATCH] Fix non-Mac build.

2021-09-24 Thread enh via Toybox
Should have used #ifdef, not #if. (Really wish I could cross-compile for the Mac!) --- lib/portability.c | 2 +- lib/portability.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) From cf08ff7212e1a486ca9c48040c87c11477593015 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 24 Sep

[Toybox] [PATCH] arp: fix the scanf %s numbers.

2021-09-24 Thread enh via Toybox
Just like every other time I've used %s with scanf, I was off by one... The number _doesn't_ include the space for the NUL. --- toys/pending/arp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 0001-arp-fix-the-scanf-s-numbers.patch Description: Binary data __

[Toybox] [PATCH] macOS: add a timer_create() and timer_settimer() to fix the build.

2021-09-24 Thread enh via Toybox
Note that these aren't equivalent to the CLOCK_MONOTONIC timer we have on Linux, but short of spinning up another thread ourselves I can't see how to implement that on macOS at present. --- lib/portability.c | 24 lib/portability.h | 10 ++ 2 files changed, 34 ins

[Toybox] [PATCH] timeout: use the monotonic clock.

2021-09-23 Thread enh via Toybox
On a desktop or server the difference between the realtime and monotonic clocks doesn't matter much, but we've seen cases on Android where something's run under timeout(1) but killed before it's had a chance to do anything because the device went into sleep shortly afterwards and by the time it cam

[Toybox] [PATCH] makedevs: stop using get_line().

2021-09-22 Thread enh via Toybox
Also use FLAG(). --- toys/other/makedevs.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) From 15666b7260c71641f076f562385df535d00db219 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 22 Sep 2021 21:08:38 -0700 Subject: [PATCH] makedevs: stop using get_line().

[Toybox] [PATCH] userdel: stop using get_line().

2021-09-22 Thread enh via Toybox
--- toys/pending/userdel.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) From 29705c01e9f11f250bd86715147d6c248fc8461d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 22 Sep 2021 20:48:19 -0700 Subject: [PATCH] userdel: stop using get_line(). --- toys/pending/use

[Toybox] [PATCH] init: stop using get_line().

2021-09-22 Thread enh via Toybox
--- toys/pending/init.c | 110 +--- 1 file changed, 52 insertions(+), 58 deletions(-) From 5d02c474b1e8b6ebba95d8d3758733a6764cf70d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 22 Sep 2021 20:33:34 -0700 Subject: [PATCH] init: stop using get_lin

[Toybox] [PATCH] crond: stop using get_line().

2021-09-22 Thread enh via Toybox
Also reuse isdotdot() from lib. --- toys/pending/crond.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) From d3e7a2849e044806f465eb52924d9b08ed7558b0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 22 Sep 2021 20:06:18 -0700 Subject: [PATCH] crond: stop using g

[Toybox] [PATCH] bootchartd: stop using get_line().

2021-09-22 Thread enh via Toybox
We don't even need to read from /proc at all here: we can get the time since boot from clock_gettime(2) directly. Also, since TT.buf is only used for the timestamp, give it that name. --- toys/pending/bootchartd.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-)

[Toybox] [PATCH] arp: just use fscanf().

2021-09-22 Thread enh via Toybox
Actually, the general get_line() -> getline() transformation isn't necessary here. These are all small fixed-size buffers in the kernel, so we can just use fscanf(). --- toys/pending/arp.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) From aa8f03152b101b927ad06ec5837b8

Re: [Toybox] [PATCH] uptime: trivial modernization.

2021-09-22 Thread enh via Toybox
On Tue, Sep 21, 2021 at 6:18 PM Rob Landley wrote: > On 9/21/21 2:56 PM, enh via Toybox wrote: > > (I was looking at this code because I was looking at the output in a bug > > report, and wasn't sure what `up 1:09` meant. It's annoying that -p is > > a lot mor

Re: [Toybox] Canonical Extending Ubuntu 14.04/16.04 LTS Support To Ten Years - Phoronix

2021-09-22 Thread enh via Toybox
On Wed, Sep 22, 2021 at 6:36 AM Rob Landley wrote: > On 9/21/21 8:18 PM, enh via Toybox wrote: > > Ironically I couldn't find a canonical source for this, but a couple of > other > > sites have a similar story (but different enough to make me think there > really > &

[Toybox] [PATCH] arp: some cleanup.

2021-09-21 Thread enh via Toybox
Remove another get_line() caller, but also fix the basic "show ARP table" behavior which was previously broken. Switch to xgetaddrinfo(). Fix failed search output to only display if we actually searched, and to match net-tools arp 2.10 output. Also use FLAG() and clean up trailing whitespace. ---

Re: [Toybox] [PATCH] grep: Make --color highlight all matches on a line.

2021-09-21 Thread enh via Toybox
On Tue, Sep 21, 2021, 18:25 Rob Landley wrote: > On 9/21/21 1:54 PM, Peter Collingbourne via Toybox wrote: > > This matches the behavior of GNU grep. > > Well, _sort_ of. The test you added won't pass TEST_HOST because: > > $ echo hello | grep --color=always l | hd > 68 65 1b 5b 30 31 3

[Toybox] Canonical Extending Ubuntu 14.04/16.04 LTS Support To Ten Years - Phoronix

2021-09-21 Thread enh via Toybox
Ironically I couldn't find a canonical source for this, but a couple of other sites have a similar story (but different enough to make me think there really is a Canonical press release doing the rounds). https://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-14.04-16.04-Ten-Years&utm_source=f

[Toybox] [PATCH] uptime: trivial modernization.

2021-09-21 Thread enh via Toybox
(I was looking at this code because I was looking at the output in a bug report, and wasn't sure what `up 1:09` meant. It's annoying that -p is a lot more readable, but doesn't include load averages, otherwise I'd be tempted to move Android's bugreports over to `uptime -p` so that no-one would eve

Re: [Toybox] [PATCH] strace: initial commit.

2021-09-20 Thread enh via Toybox
rent -- like Linux/arm -- will have broken.) On Fri, Sep 17, 2021 at 8:36 PM Rob Landley wrote: > On 9/17/21 5:54 PM, enh via Toybox wrote: > > i know when rob's talked about "toybox strace", he meant one with no > decoding, > > just raw numbers. that doesn't r

[Toybox] [PATCH] strace: fix macOS build.

2021-09-20 Thread enh via Toybox
Obviously we're never going to be able to build strace for macOS, but right now the reference to the struct was breaking even a macOS build with strace disabled! From poking at building for arm on the Raspberry Pi over the weekend, changes like this will be needed there too (because different archi

Re: [Toybox] [PATCH] strace: initial commit.

2021-09-17 Thread enh via Toybox
want "allyesconfig" to build on. i haven't even added arm/arm64 yet! (but i will do so if this gets committed.) On Fri, Sep 17, 2021 at 3:46 PM enh wrote: > This is most notably lacking -p and -f, and only covers a small subset > of system calls, but it's "useful&q

[Toybox] [PATCH] strace: initial commit.

2021-09-17 Thread enh via Toybox
This is most notably lacking -p and -f, and only covers a small subset of system calls, but it's "useful" in the sense that you can strace something like toybox date, say, and see everything. There's a fundamental assumption here that we don't need to worry about multiple personalities. (This is w

[Toybox] [PATCH] log(1): add no-arguments=>stdin behavior to match logger(1).

2021-09-16 Thread enh via Toybox
Requested by Facebook to avoid difficult quoting, but something we should do anyway just to match logger(1). Bug: https://issuetracker.google.com/199939602 --- toys/android/log.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) From 35b1da573a280e2e47552a12d0de5

Re: [Toybox] Pending todoness.

2021-09-16 Thread enh via Toybox
;.) On Thu, Sep 16, 2021 at 6:32 PM Rob Landley wrote: > On 9/16/21 8:14 PM, enh wrote: > > given that we've never had a `uname -o` on Android before, by definition > no-one > > can have any expectations of what it should output, so seems fine to me. > (you > > could mak

Re: [Toybox] Pending todoness.

2021-09-16 Thread enh via Toybox
given that we've never had a `uname -o` on Android before, by definition no-one can have any expectations of what it should output, so seems fine to me. (you could make the same argument for just letting it output "Linux", of course, but since there's _potentially_ value in knowing you're on Androi

[Toybox] [PATCH 2/2] modprobe: handle module lists correctly.

2021-09-11 Thread enh via Toybox
The while loop for -a or -r was forgetting that argv is a char**. Also: * sort the options in the help. * remove DBASE_SIZE and the comment about keeping it up to date, since we can just use ARRAY_LEN instead (though I wonder whether anyone has enough modules to benefit from a hash table rath

[Toybox] [PATCH 1/2] insmod: tiny cleanup.

2021-09-11 Thread enh via Toybox
finit_module(2) was added in Linux 3.8, and even CentOS 7.2 has 3.10, so we should be able to assume that now rather than working around its possible absence (especially in the *build* environment). I've left the runtime workaround for now, since we need that to support the stdin use case anyway.

Re: [Toybox] [PATCH] rmmod: various fixes.

2021-09-11 Thread enh via Toybox
i'm not usually a pro-bloat kind of guy, but whenever i'm dealing with modules i wish the kernel just came with example1.ko and example2.ko for me to mess around with without actually causing any problems! On Sat, Sep 11, 2021 at 10:02 AM Rob Landley wrote: > On 9/10/21 6:10 PM, e

Re: [Toybox] [PATCH] reboot/halt/poweroff: add -d.

2021-09-11 Thread enh via Toybox
On Sat, Sep 11, 2021 at 10:16 AM Rob Landley wrote: > On 9/10/21 6:31 PM, enh via Toybox wrote: > > busybox has a -d that delays before proceeding. Annoyingly systemd also > > has a -d, but that's to disable writing a wtmp shutdown entry. > > I've mostly said SEC

[Toybox] [PATCH] reboot/halt/poweroff: add -d.

2021-09-10 Thread enh via Toybox
busybox has a -d that delays before proceeding. Annoyingly systemd also has a -d, but that's to disable writing a wtmp shutdown entry. Also switch to using FLAG(). --- toys/other/reboot.c | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) From 56d9b9662df58c8e112d0059

[Toybox] [PATCH] rmmod: various fixes.

2021-09-10 Thread enh via Toybox
My original intent was to just get rid of the meaningless O_EXCL, which isn't used by the kernel, after noticing that it's passed here but not in modprobe's module removal code. But then I noticed that other rmmod implementations allow you to pass a list of modules, not just one (whereas we were i

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-07 Thread enh via Toybox
On Sat, Sep 4, 2021 at 5:33 AM Rob Landley wrote: > On 9/2/21 7:12 PM, enh wrote: > > On Thu, Sep 2, 2021 at 4:37 PM Rob Landley > > to me, if the open() succeeded but the write() failed --- we're in > weird > > > uncharted "shouldn't ha

[Toybox] [PATCH] i2cdump: fix behavior on read failure.

2021-09-06 Thread enh via Toybox
The other implementations just show Xs for the missing data and carry on. --- toys/other/i2ctools.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) From 65667bc633f4eb8079e380dfa4bdc3273bd82df5 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 6 Sep 2021 18:19:29 -0700 Subject

[Toybox] [PATCH] i2cdetect: add -q.

2021-09-04 Thread enh via Toybox
When I implemented this, I didn't actually have any i2c devices to test with, and "quick write" sounded scary, and the one person who was testing was fine with the "read byte" method of detection, so that's what I did. Now I have a couple of i2c devices connected to my Raspberry Pi, one of them res

Re: [Toybox] FYI musl's support horizon.

2021-09-03 Thread enh via Toybox
On Fri, Aug 27, 2021 at 3:21 PM Rich Felker wrote: > On Fri, Aug 27, 2021 at 10:21:51AM -0500, Rob Landley wrote: > > On 8/27/21 8:56 AM, Rich Felker wrote: > > > On Thu, Aug 26, 2021 at 03:56:47PM -0700, enh wrote: > > >> On Thu, Aug 26, 2021 at 2:34 PM Rob Landley

Re: [Toybox] FYI musl's support horizon.

2021-09-03 Thread enh via Toybox
On Fri, Aug 27, 2021 at 6:56 AM Rich Felker wrote: > On Thu, Aug 26, 2021 at 03:56:47PM -0700, enh wrote: > > On Thu, Aug 26, 2021 at 2:34 PM Rob Landley wrote: > > Rob asked me for some input on this: > > > > In my private emails somebody is trying to make

Re: [Toybox] FYI musl's support horizon.

2021-09-03 Thread enh via Toybox
On Fri, Aug 27, 2021 at 6:20 AM Rob Landley wrote: > On 8/26/21 5:56 PM, enh wrote: > > I keep telling people I could spend a focused year on JUST the test > suite and > > they don't believe me. When people talk about function testing vs > regression > >

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-03 Thread enh via Toybox
On Fri, Sep 3, 2021 at 8:48 AM Rob Landley wrote: > On 9/2/21 2:58 PM, enh wrote: > > That's why android-ndk-r21d isn't producing this warning. > > > > yeah, sorry: this is for the _host_ toybox (so glibc right now). > > It's not doing it in my host

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-02 Thread enh via Toybox
On Thu, Sep 2, 2021 at 4:37 PM Rob Landley wrote: > On 9/2/21 2:47 PM, enh wrote: > > On Wed, Sep 1, 2021 at 3:00 PM Rob Landley > <mailto:r...@landley.net>> wrote: > > > > On 8/31/21 11:16 AM, enh via Toybox wrote: > > > toys/posix/ta

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-02 Thread enh via Toybox
On Thu, Sep 2, 2021 at 9:41 AM Rob Landley wrote: > On 9/1/21 11:34 AM, Rob Landley wrote: > > I thought about typecasting it to (void) but decided to wait for a > complaint > > because A) > > > "CROSS_COMPILE=~/android/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-andro

Re: [Toybox] [PATCH] tar: fix warn_unused_result error.

2021-09-02 Thread enh via Toybox
On Wed, Sep 1, 2021 at 3:00 PM Rob Landley wrote: > On 8/31/21 11:16 AM, enh via Toybox wrote: > > toys/posix/tar.c:821:7: error: ignoring return value of > > function declared with 'warn_unused_result' attribute > > write(sefd, 0, 0); > > ^~~

Re: [Toybox] [PATCH] Fix xsignal_all_killers().

2021-09-02 Thread enh via Toybox
On Wed, Sep 1, 2021 at 9:15 AM Rob Landley wrote: > On 8/30/21 4:00 PM, enh wrote: > > Your commit changed list_signals() to start from 1 but didn't do the > same for > > xsignal_all_killers(). One character fix. > > > > yeah, i sent you a more complica

Re: [Toybox] FYI, the kernel fixed the encrypted symlink size thing.

2021-09-01 Thread enh via Toybox
huh, and fixed by a googler i know [of] too... i'll have to remember that if we have issues here again! On Wed, Sep 1, 2021 at 2:53 PM Rob Landley wrote: > It's https://github.com/torvalds/linux/commit/d18760560593 for those > following > along at home. (Plus follow-up commits to make each files

Re: [Toybox] [PATCH] file: basic Mach-O universal binary support.

2021-09-01 Thread enh via Toybox
On Wed, Sep 1, 2021 at 1:04 PM Rob Landley wrote: > On 8/31/21 6:23 PM, enh via Toybox wrote: > > PowerPC may be dead and gone, but arm64 is the new x86-64, and > > x86-64 the new PowerPC :-) > > --- > > tests/file.test | 4

[Toybox] [PATCH] file: basic Mach-O universal binary support.

2021-08-31 Thread enh via Toybox
PowerPC may be dead and gone, but arm64 is the new x86-64, and x86-64 the new PowerPC :-) --- tests/file.test | 4 toys/posix/file.c | 36 +++- 2 files changed, 35 insertions(+), 5 deletions(-) 0001-file-basic-Mach-O-universal-binary-support.patch Descript

[Toybox] [PATCH] tar: fix warn_unused_result error.

2021-08-31 Thread enh via Toybox
toys/posix/tar.c:821:7: error: ignoring return value of function declared with 'warn_unused_result' attribute write(sefd, 0, 0); ^ ~~ --- toys/posix/tar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From e54024a7b25b91338edb44cbe5edfb49ed036c6c Mon Sep 17 00:0

Re: [Toybox] [PATCH] Fix xsignal_all_killers().

2021-08-30 Thread enh via Toybox
On Mon, Aug 30, 2021 at 12:39 PM Rob Landley wrote: > On 8/30/21 10:56 AM, enh via Toybox wrote: > > Found in github CI by the existing patch tests: > > ``` > > patch: xsignal 0: Invalid argument > > ``` > > Yeah, I bumped into that right after I pushed your comm

[Toybox] [PATCH] Fix xsignal_all_killers().

2021-08-30 Thread enh via Toybox
Found in github CI by the existing patch tests: ``` patch: xsignal 0: Invalid argument ``` When I grepped for places that would be affected by my `kill -0` change, I grepped toys/, not lib/. (And I only ran the tests for the toys I touched, not all the tests, and CI was already broken so we didn't

[Toybox] Subject: [PATCH] kill: allow `kill -0` for testing process existence.

2021-08-26 Thread enh via Toybox
Allow num_to_sig(0) so kill doesn't disallow -0 because it can't round-trip, and then teach list_signals() to avoid the special case of signal 0 rather than assume that all the signals it shouldn't print don't have names now signal 0 has the name "0". --- lib/lib.c | 2 +- lib/portability.

[Toybox] [PATCH] ps: exit with exit status 1 if no processes shown.

2021-08-26 Thread enh via Toybox
This matches procps ps, and at least one LTP test relies on it. The behavior is specifically "nothing matches", not "one PID didn't match": assuming no process 666, `ps 666` exits with 1, but `ps 1 666` exits with 0. --- toys/posix/ps.c | 1 + 1 file changed, 1 insertion(+) From 800d66aeeca2cddffb

Re: [Toybox] FYI musl's support horizon.

2021-08-26 Thread enh via Toybox
On Thu, Aug 26, 2021 at 2:34 PM Rob Landley wrote: > On 8/24/21 6:27 PM, enh wrote: > > yeah, i think he (and i, when i have my bionic hat on) have an easier > problem > > than you ... this kind of thing isn't too hard in the c library because > it's > > ge

Re: [Toybox] FYI musl's support horizon.

2021-08-26 Thread enh via Toybox
yeah, i think he (and i, when i have my bionic hat on) have an easier problem than you ... supporting old kernels _usually_ (there are a few exceptions) isn't too hard in the c library because it's generally considered okay to just shrug and return -1 with errno == ENOSYS or whatever. whereas as a

Re: [Toybox] What's setransd?

2021-08-18 Thread enh via Toybox
On Wed, Aug 18, 2021 at 3:27 AM Rob Landley wrote: > I'm trying to implement tar --selinux and it really looks like > setfscreatecon() > and getfileconat() mostly boil down to simple things like "open a /proc > file and > read/write a blob of data", ala: > > int sefd = -1; > ... > if ((FLAG

Re: [Toybox] What does the xxd-pipe stuff in tests.tar do?

2021-08-17 Thread enh via Toybox
wow, i was convinced i didn't write that and it must have been something you did, but `git blame` disagrees. hmm... it looks like what happened was that i was trying to preserve the old use of hd(1)? see the minus lines at the top of this diff: -export BLOCKS=3 -SUM='head -c $(($BLOCKS*512)) | sh

Re: [Toybox] diff algorithms

2021-08-13 Thread enh via Toybox
(heh, the time i spent staring at gmail's progress bar as i attached the file make me feel more justified in my "get off my lawn!" attitude here. before now i'm not sure i even knew there _was_ a progress bar when you attach a file :-) ) On Fri, Aug 13, 2021 at 12:19 PM enh

Re: [Toybox] diff algorithms

2021-08-13 Thread enh via Toybox
take too long for me to reverse-engineer how i got into that mess in the first place, so...) On Fri, Aug 13, 2021 at 3:12 AM Rob Landley wrote: > On 8/12/21 4:27 PM, enh via Toybox wrote: > > you know how you (rob) have repeatedly expressed your desire to have a > different > > d

[Toybox] diff algorithms

2021-08-12 Thread enh via Toybox
you know how you (rob) have repeatedly expressed your desire to have a different diff implementation, and i've always either ignored you or claimed that the existing one is good enough? well ... i finally hit a case where i can tell the difference. it turns out that if you have 3 million lines in

Re: [Toybox] Kernighan's awk repo

2021-08-10 Thread enh via Toybox
27;m thinking about it is updating AOSP's copy of one-true-awk. so if you'll excuse me, i'll be on my way :-) On Tue, Aug 10, 2021 at 3:50 AM Rob Landley wrote: > On 8/9/21 11:33 AM, enh wrote: > > /me wonders whether the MIT relicensing of Plan 9 means there's now an

Re: [Toybox] [PATCH 1/2] Handle large read and write lengths.

2021-08-09 Thread enh via Toybox
On Mon, Aug 9, 2021 at 12:26 AM Rob Landley wrote: > Sorry for the delay, I have a _really_ bad cold. > > On 8/7/21 7:11 AM, Samanta Navarro wrote: > > The functions readall and writeall can return an error value by mistake > > if more than 2 GB of data are read or written. > > That was intention

Re: [Toybox] Fwd: scripts/llvm-buildall.sh? try2

2021-08-09 Thread enh via Toybox
On Fri, Aug 6, 2021 at 3:54 AM Rob Landley wrote: > Huh, forgot to click "send" on this window... > > On 8/3/21 6:53 PM, scsijon wrote: > >> And, um... huh. Well, clang-rt is part of llvm-project so... > >> > >> > https://android.googlesource.com/toolchain/llvm-project/+/refs/heads/master > >> >

Re: [Toybox] Kernighan's awk repo

2021-08-09 Thread enh via Toybox
/me wonders whether the MIT relicensing of Plan 9 means there's now an MIT licensed descendant/sibling of one true awk? On Mon, Aug 9, 2021 at 2:30 AM Rob Landley wrote: > On 8/8/21 9:03 PM, roy...@gmail.com wrote: > > Hello, > > > > Andy Chu wrote: > >> > >> On Mon, Jul 18, 2016 at 12:17 PM, R

Re: [Toybox] Questions about realpath -s

2021-07-26 Thread enh via Toybox
5, 2021 at 4:05 AM Rob Landley wrote: > You asked about: > > > On 7/23/21 4:26 PM, enh wrote: > >> realpath (-s (--no-symlinks), --relative-to) > > > > Do you want the exact behavior of the gnu one, or do you want consistent > behavior? Because: > >

Re: [Toybox] patch: add built-in versions of sha-2 family hash functions

2021-07-23 Thread enh via Toybox
On Fri, Jul 23, 2021 at 12:59 PM Rob Landley wrote: > On 6/7/21 11:14 AM, enh wrote: > > your non-POSIX cut(1) extension covers 80% of the in-the-wild use of awk > anyway > > :-) if you still talk to any of the busybox folks, we should suggest > they copy > > that ---

Re: [Toybox] ltp test failure with toybox mv

2021-07-08 Thread enh via Toybox
On Thu, Jul 8, 2021 at 3:16 AM Rob Landley wrote: > On 7/8/21 2:46 AM, Rob Landley wrote: > >> i scratched my head for a while about how to get that behavior in toybox > >> (assuming the resolution is to sigh, shake our fists at the clouds, and > work > >> around this linux oddity), and it seems

Re: [Toybox] Pondering fdlength()...

2021-07-08 Thread enh via Toybox
On Thu, Jul 8, 2021 at 12:10 AM Rob Landley wrote: > Many moons ago, trying to determine the size of a CD in a cdrom drive was a > pain, and the "binary search for last location we can actually read" was > the > only reliable way to determine the length of the image I could find. > > But I'm not

[Toybox] ltp test failure with toybox mv

2021-07-07 Thread enh via Toybox
here's a weird one... https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh#L131 test6 fails with toybox mv because toybox (reasonably enough) believes that if it failed to unlink the _files_ it obviously can't unlink their parent direc

Re: [Toybox] [PATCH] tail: implement -F (and its companion -s).

2021-07-01 Thread enh via Toybox
On Thu, Jul 1, 2021 at 9:29 AM Rob Landley wrote: > On 6/30/21 6:57 PM, enh via Toybox wrote: > > (Based on someone else's patch.) > > > > Implementing -F with inotify is a lot more work (including more > > portability shims for macOS), so this is a si

[Toybox] [PATCH] tail: implement -F (and its companion -s).

2021-06-30 Thread enh via Toybox
(Based on someone else's patch.) Implementing -F with inotify is a lot more work (including more portability shims for macOS), so this is a simpler polling implementation. Also fix my earlier mistake where xnotify_add() wasn't actually an 'x' function that exits on failure. --- lib/portability.c

Re: [Toybox] thoughts on `tail -F`?

2021-06-23 Thread enh via Toybox
On Wed, Jun 23, 2021 at 3:35 AM Rob Landley wrote: > On 6/22/21 7:33 PM, enh via Toybox wrote: > > "how hard can `tail -F` be?" i thought ... but unless i'm using inotify > wrong, > > the answer turns out to be "quite a lot harder than i expected because i

[Toybox] thoughts on `tail -F`?

2021-06-22 Thread enh via Toybox
"how hard can `tail -F` be?" i thought ... but unless i'm using inotify wrong, the answer turns out to be "quite a lot harder than i expected because i need watch the parent directory for a different set of events, and then filter those". strace tells me that coreutils actually does use inotify, w

Re: [Toybox] Allow --help after other arguments?

2021-06-14 Thread enh via Toybox
On Sun, Jun 13, 2021 at 2:49 AM Rob Landley wrote: > On 6/11/21 4:51 PM, Ryan Prichard wrote: > > On Thu, Jun 10, 2021 at 7:05 PM Rob Landley > > wrote: > > to show the help for ls. And DON'T want "chroot dir ls --help" to > show help > > output for chroot. (Or t

Re: [Toybox] patch: add built-in versions of sha-2 family hash functions

2021-06-09 Thread enh via Toybox
On Tue, Jun 8, 2021 at 11:54 PM Rob Landley wrote: > On 6/7/21 11:14 AM, enh wrote: > > On Fri, Jun 4, 2021 at 10:54 PM Rob Landley > <mailto:r...@landley.net>> wrote: > > I've always been slightly unclear on what getty.c _does_ and why > it's separ

<    2   3   4   5   6   7   8   9   10   11   >