Re: (b)make: Outputting a huge variable value

2024-05-17 Thread RVP
mands associated with a target are executed in a single shell invocation as opposed to the traditional one shell invocation per line. So, in non-compat mode, make runs the shell with `-s' instead of `-c' and therefore, here-docs will work. -RVP

Re: (b)make: Outputting a huge variable value

2024-05-16 Thread RVP
sr/src/sys/kern/*.c main: .PHONY make -V X | wc -c $ make 4938515 $ -RVP

Re: -mdoc: how to handle surrounding types?

2024-02-08 Thread RVP
quot; .Sh DESCRIPTION This .Fn signal ``` (the `cm' string is for nroff only) -RVP

Re: tar vs device special files

2023-10-28 Thread RVP
, (dev_t) + tar_atol(header->rdevminor, sizeof(header->rdevminor))); + } + tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining); return (err); } ``` -RVP

Re: bin/57544: sed(1) and regex(3) problem with encoding

2023-09-03 Thread RVP
On Wed, 30 Aug 2023, Christos Zoulas wrote: Why don't we make next and end unsigned char so that all instances are fixed? :) My original attempt did just that, but then I had to cast to char in a lot more places to get libc to build. -RVP

Re: bin/57544: sed(1) and regex(3) problem with encoding

2023-07-26 Thread RVP
cc = GETNEXT(); ``` -RVP

Re: Trivial program size inflation

2023-07-05 Thread RVP
if there are any problems (apart from `-pie -fPIE' which doesn't work with `-static -pg' in any case). -RVP--- gcc-std.spec2023-07-05 21:45:17.067947887 + +++ gcc-pg.spec 2023-07-05 21:49:25.062647745 + @@ -53,7 +53,7 @@ %{!static|static-pie:--eh-frame-hdr} %{m32:-m elf_i386

Re: Trivial program size inflation

2023-07-05 Thread RVP
/config/netbsd.h /usr/src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h /usr/src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h (I had to fiddle with them to get `-pg' working with shared libs...) -RVP

Re: Trivial program size inflation

2023-07-04 Thread RVP
On Tue, 4 Jul 2023, RVP wrote: I think lld(1) does things differently. I'll check this later... And I was right! On Linux (what I have at hand now): ``` $ clang -fuse-ld=lld -Wl,-Map=map.txt -static -s -o foo foo.c -L. -lmm $ fgrep -A3 ./libmm.a map.txt [...] -- 224c30

Re: Trivial program size inflation

2023-07-04 Thread RVP
On Tue, 4 Jul 2023, Joerg Sonnenberger wrote: On Tue, Jul 04, 2023 at 08:38:22AM +, RVP wrote: b) the alloc functions in libc.a not being marked as being "weak". This doesn't really matter at all, in fact, it is likely going to make the situation *worse*. You're right

Re: Trivial program size inflation

2023-07-04 Thread RVP
On Tue, 4 Jul 2023, RVP wrote: So, we should: a) collapse the newly added functions back into a single file. Ah, looks like this patch will need a free_aligned_sized() to free the aligned memory. Regular free(), realloc() won't work here (as-is). -RVP

Re: Trivial program size inflation

2023-07-04 Thread RVP
d0 T realloc $ ``` HTH, -RVP

Re: Trivial program size inflation

2023-07-03 Thread RVP
On Mon, 3 Jul 2023, RVP wrote: Somebody should maybe add calloc() to bsdmalloc. And posix_memalign() (any others?) too, else you end up with 2 different arenas and free()/realloc() operating on the wrong one. -RVP

Re: Trivial program size inflation

2023-07-03 Thread RVP
er. Yes, except this doesn't work (as expected) with bsdmalloc because it doesn't implement calloc(), so the linker will get that (and all the je_* stuff now) from libc.a again. :) Somebody should maybe add calloc() to bsdmalloc. -RVP

Re: Trivial program size inflation

2023-07-02 Thread RVP
On Sun, 2 Jul 2023, Emmanuel Dreyfus wrote: On Sat, Jul 01, 2023 at 02:25:03PM +, RVP wrote: Not to forget the code for C++ support. And, of course even static binaries may call dlopen() and friends. So that dl*() and the ELF bits right there. At least in 9.3, dlopen() in a static binary

Re: Trivial program size inflation

2023-07-01 Thread RVP
in the default C/POSIX locale that all programs start in, libc loads the appropriate shared lib from /usr/lib/i18n/ in order to handle standard things like LC_CTYPE, LC_NUMERIC, etc. -RVP

Re: Trivial program size inflation

2023-07-01 Thread RVP
and NSS on an as-needed basis. -RVP

Re: Trivial program size inflation

2023-07-01 Thread RVP
that dl*() and the ELF bits right there. If you want to slim your static binary down, use a different libc first :) -RVP

Re: old style tail(1) options and bin/57483

2023-06-30 Thread RVP
'. You can ditch every other compat as far as I'm concerned. You can even remove obsolete() entirely and I wouldn't shed any tears. -RVP

Re: printf(1), sh(1), POSIX.2 and octal escape sequences

2023-06-28 Thread RVP
Couple of ways to do that: ``` $ printf '\0777' | hexdump -C 3f 37 |?7| 0002 $ printf '\77\067' 3f 37 |?7| 0002 $ ``` -RVP

Re: printf(1), sh(1), POSIX.2 and octal escape sequences

2023-06-28 Thread RVP
) What's good for the goose is also good for the gander, I say. Cheers! -RVP

Re: printf(1), sh(1), POSIX.2 and octal escape sequences

2023-06-28 Thread RVP
houldn't \777 be interpreted as '\77' octal then the digit 7; \677 -> \67 octal then 7 etc. ? Better to do what the C compiler does: try converting up to 3 digits, and if the result of the conversion is > 255, complain. -RVP

Re: unresolvable R_X86_64_NONE relocation against symbol `__sF'

2023-05-18 Thread RVP
. -RVP

Re: unresolvable R_X86_64_NONE relocation against symbol `__sF'

2023-05-18 Thread RVP
itself? -RVP

Re: Proposed chown(8)/chgrp(1) enhancement

2023-04-28 Thread RVP
be the default behaviour. -RVP

Re: jemalloc profiling

2023-04-27 Thread RVP
/jemalloc_internal_defs.h -RVP

Re: flock(2): locking against itself?

2023-04-18 Thread RVP
with a much less intrusive change. Try libtickit--that uses callbacks (I think): https://www.leonerd.org.uk/code/libtickit/ -RVP

Re: flock(2): locking against itself?

2023-04-16 Thread RVP
;, "vi", NULL); err(1, "exec /usr/bin/vi failed"); } ``` But, vi, at least, fails to run like this. So, I think using a pty is the simplest, not to say standard, solution here... -RVP

Re: setreuid(2)?

2022-11-09 Thread RVP
ages, and found only about half-a-dozen instances, and most of them "safe": either not exec()ing binaries or only relying on setreuid() if _POSIX_SAVED_IDS is not available. But, of course, you guys would already know all this... -RVP

Re: setreuid(2)?

2022-11-08 Thread RVP
(uid, uid) != 0) err(1, "setreuid(%d, %d) failed", uid, uid); printf("%s: UID=%d, EUID=%d\n", *argv, getuid(), geteuid()); return 0; } ---END y.c--- -RVP

Re: unhide reallocarray

2022-10-31 Thread RVP
=-D_OPENBSD_SOURCE /usr/src/tools/mandoc/Makefile:HOST_CPPFLAGS+= -D_OPENBSD_SOURCE /usr/src/usr.bin/sdiff/Makefile:CPPFLAGS+=-D_OPENBSD_SOURCE /usr/src/usr.sbin/gpioctl/Makefile:CPPFLAGS+=-D_OPENBSD_SOURCE /usr/src/usr.sbin/pf/Makefile.inc:CPPFLAGS+= -D_OPENBSD_SOURCE $ ``` -RVP

Re: grep -r: add default "."

2022-09-05 Thread RVP
; and, FreeBSD's fgrep is just regcomp(REG_NOSPEC) :). -RVP

Re: grep -r: add default "."

2022-09-03 Thread RVP
On Sat, 3 Sep 2022, Martin Husemann wrote: How about fixing the bsd version we have in tree instead? Maybe FreeBSD or OpenBSD already did that and we can borrwo? There is also the home-grown agcre in othersrc which looks (mostly) feature-complete... -RVP

Re: grep -r: add default "."

2022-09-02 Thread RVP
On Fri, 2 Sep 2022, Thomas Klausner wrote: I'd like the change the behaviour to match what GNU grep does. Comments? FreeBSD's and OpenBSD's grep (both non-GNU) do the same thing, so it makes sense to harmonize NetBSD's (old GNU) grep -r behaviour too. -RVP

Re: unhide reallocarray

2022-08-30 Thread RVP
.) -RVP

Re: sh(1) and ksh(1) default PATH

2022-08-15 Thread RVP
On Mon, 15 Aug 2022, Hauke Fath wrote: On Sun, 14 Aug 2022 09:04:21 + (UTC), RVP wrote: Linux has a pam_env.so which reads /etc/environment and /etc/environment.d/* for this kind of thing. I was looking for something like that on NetBSD a while back... login.conf(5) can set PATH. Yeah

Re: sh(1) and ksh(1) default PATH

2022-08-14 Thread RVP
Linux has a pam_env.so which reads /etc/environment and /etc/environment.d/* for this kind of thing. I was looking for something like that on NetBSD a while back... -RVP

lib/libcrypt/crypt-argon2.c: ctx.{out,outlen} assigned twice

2022-02-11 Thread RVP
*/ /* and easier cleanup */ - ctx.out = (uint8_t *)ebuf; - ctx.outlen = sizeof(ebuf); - ctx.out = (uint8_t *)encodebuf; ctx.outlen = sizeof(encodebuf); ---END--- Thanks, -RVP

Re: possible bug in fseek of buffered files shared between processes (example uses stdin)

2021-11-03 Thread RVP
of the file descriptor after fflush() on streams open for read() is not mandated by POSIX.1-2017. but, fflush() causing an underlying seek seems useful. I'll see what I can do this weekend. -RVP

Re: possible bug in fseek of buffered files shared between processes (example uses stdin)

2021-11-02 Thread RVP
On Tue, 2 Nov 2021, Christos Zoulas wrote: In article , RVP wrote: This looks like a useful behaviour to add to the libc close routines. I agree! A first cut is something like this: ---START PATCH--- diff -urN stdio.orig/fclose.c stdio/fclose.c --- stdio.orig/fclose.c 2012-03-15 18:22

Re: possible bug in fseek of buffered files shared between processes (example uses stdin)

2021-11-02 Thread RVP
add to the libc close routines. -RVP

Re: Strange pthread_self() return value

2021-06-11 Thread RVP
en hwloc is compiled on NetBSD? 2. Does a `make check' of hwloc on NetBSD pass? -RVP

Re: proposal: remove traditional C support from lint

2021-03-18 Thread RVP
never defined [233] Add `-z' for those. I also usually add `-nu' because /usr/libdata/llib-lc.ln is MIA in 9.1_STABLE. -RVP

Re: Waiting for Randot (or: nia and maya were right and I was wrong)

2021-01-14 Thread RVP
On Thu, 14 Jan 2021, nia wrote: On Thu, Jan 14, 2021 at 09:43:44PM +, RVP wrote: Is this OK (or, it is hopelessly insecure)?: If you have the same secure randomness as everyone else you don't have secure randomness. True, generally, but I was thinking of a) the hopeless cases, b

Re: Waiting for Randot (or: nia and maya were right and I was wrong)

2021-01-14 Thread RVP
random bits from a truely random file. The random file is generated anew each time an distrib. image is built. If one needs 256 bits to seed /dev/random, then a 32K random file should suffice. The other alternative is the user mashing the keyboard and moving a mouse for a few minutes. -RVP

Re: wsmoused broken since 9.1

2020-12-26 Thread RVP
On Wed, 23 Dec 2020, Martin Husemann wrote: On Wed, Dec 23, 2020 at 06:56:31AM +, RVP wrote: /usr/sbin/wsmoused has been non-working since slightly before 9.1 was released. Specifically, any button click or release generates: Can you narrow down the pullup that broke it? I was mis

Re: wsmoused broken since 9.1

2020-12-23 Thread RVP
in -current? Yes. -RVP

Re: EDID from multiple displays using ioctl(WSDISPLAYIO_GET_EDID)

2020-12-23 Thread RVP
On Wed, 23 Dec 2020, Michael van Elst wrote: If you had multiple wsdisplay* instances, there would be some corresponding ttyE* that you could send the ioctl to. Hmm: wsdisplay0 at intelfb0; wsdisplay1 at nouveaufb0 ? What about multiple multiple monitors connected to the same card? -RVP

wsmoused broken since 9.1

2020-12-23 Thread RVP
-10-21 06:17:38.666544347 + @@ -71,7 +71,7 @@ static int X_Console = -1; static int X_Console_Delay = 5; -#ifdef WSMOUSED_SELECTION_MODE +#ifdef WSMOUSED_ACTION_MODE extern struct mode_bootstrap Action_Mode; #endif #ifdef WSMOUSED_SELECTION_MODE ---END--- Thanks, -RVP

EDID from multiple displays using ioctl(WSDISPLAYIO_GET_EDID)

2020-12-23 Thread RVP
unavailable. -RVP

Re: set -o emacs when su?

2020-11-11 Thread RVP
ing set -o emacs each time, but that is...less than satisfactory. Use "su -l" and add that emacs option to /root/.shrc -RVP