Re: floating point woes on i386

2025-09-26 Thread RVP
ding to the types specified in the source code takes place. -RVP

Re: mtree and file names containing an asterisk

2025-08-15 Thread RVP
wildcards in the spec., as reqd. per the man-page. Give it a try. -RVP

Re: mtree and file names containing an asterisk

2025-08-14 Thread RVP
centry->flags |= flags; set(next, centry); if (root == NULL) { ``` -RVP

Re: mtree: exclude keywords from being checked

2025-08-13 Thread RVP
-K/-k: ``` mtree -R md5,size -C < /etc/mtree/set.base | mtree -ep / ``` -RVP

Re: add a "notty" flag to ttys(5) for init(8)

2025-05-17 Thread RVP
# fgrep httpd /etc/ttys """/usr/libexec/httpd -fqX /tmp"unknown on qemu# ps -Au | fgrep httpd root27217 0.0 0.0 17528 3524 ? I 8:10AM 0:00.01 /usr/libexec/httpd -fqX /tmp root22911 0.0 0.0 11900 1392 ttyE0 O+8:11AM 0:00.00 fgrep httpd qemu# ``` -RVP

Re: regcomp() signedness issues

2024-12-30 Thread RVP
ignal SIGSEGV, Segmentation fault. #0 0x00405454 in CHadd (p=0x7f7fe2d0, cs=0x7f7ff7a90058, ch=-39) at /usr/src/lib/libc/regex/regcomp.c:1769 1769cs->bmp[(unsigned)ch >> 3] |= 1 << (ch & 7); (gdb) ``` This is just PR bin/58092 (AKA lib/58910). -RVP

Re: regcomp() signedness issues

2024-12-29 Thread RVP
>> 3] & (1 << (ch & 7))) != 0) ^ cs->invert); else if (cs->icase) Thanks! This patch seems to fix PR bin/58092 at least; but, can't provoke the crash in regcomp() as shown... -RVP

Re: Fwd: Re: interactive shell detection in shrc

2024-10-01 Thread RVP
On Tue, 1 Oct 2024, RVP wrote: Ugly, but, works--after a fashion: - Only for DIRs in the CWD. - no `/' allowed in DIR. - if CMD with the same name as DIR is found in $PATH, that will be executed. (I tried defining a command_not_found_handle function but that doesn't seem to w

Re: Fwd: Re: interactive shell detection in shrc

2024-10-01 Thread RVP
t, works--after a fashion: - Only for DIRs in the CWD. - no `/' allowed in DIR. - if CMD with the same name as DIR is found in $PATH, that will be executed. (I tried defining a command_not_found_handle function but that doesn't seem to work if the command that is not found is a directory). Ayup, dunno what's up with that. -RVP

Re: [PATCH] Allow qualified filename (bar/foo) PATH searching.

2024-09-30 Thread RVP
$ gcc13/gcc ... $ clang-18/cc ... etc,... but, what should be done for: {base,dir}name(), {get,set}progname(), and err*()/warn*()? And, of course, realpath() (add a `-m' to the binary?). -RVP

Re: interactive shell detection in shrc

2024-09-30 Thread RVP
trary programs, then I have no clue, Thierry :). But, for POSIX (Bourne) shells, they should set `i' in `$-'. Not sure why one would additionally want to examine $SHELL here. (I've not read all the emails in this thread, so may have missed that part.) -RVP

Re: interactive shell detection in shrc

2024-09-30 Thread RVP
. SHELL=/bin/ksh ... $ sh -i $ printenv ... SHELL=/bin/ksh ... and the same result with "sh -l" (supposed to be considered a login shell). So how can the test be reliable in all circumstances? Set SHELL explicitly? ``` $ echo $SHELL /bin/bash $ env SHELL=/bin/dash dash $ echo $SHELL /bin/dash $ ``` -RVP

Re: Fwd: Re: interactive shell detection in shrc

2024-09-30 Thread RVP
x27;s /bin/sh (and dash) which doesn't allow it. (Mixed up my Qemu instances--sorry!) -RVP

Re: Fwd: Re: interactive shell detection in shrc

2024-09-29 Thread RVP
oo $ if "$foo"; then echo set; else echo unset; fi ``` or, to create (mildly) obfuscated fork-bombs: ``` ''(){ ''|''&};'' ``` -RVP

Re: interactive shell detection in shrc

2024-09-26 Thread RVP
= , , 5= , , 6= , , *=, , @=, $ cmp <(bash ./x.sh) <(dash ./x.sh) ``` whereas dash-0.5.12 substitutes a naked `$@' with a space (which seems wrong to me--not even sure if a bare `$@' makes sense--as opposed to `"$@"' which is well defined). The thing to realise in your script is that only 1 string is passed to the a() function. The other 2 `$*' are elided since they're not in quotes and empty. And, `"$*"' ends up (ie. as $1) to a() as `original 3 args ($1, $2, $3) are empty with only the 2 separators in between 'em. -RVP

Re: Fwd: Re: interactive shell detection in shrc

2024-09-24 Thread RVP
On Tue, 24 Sep 2024, RVP wrote: | if "${___SHRC:-:}" A syntax error of yours? No, that becomes `if ":" ...' $___SHRC is undefined or empty. You need to write it that way, else it's a syntax error. Sorry, I meant to say a "command not found" error

Re: Fwd: Re: interactive shell detection in shrc

2024-09-24 Thread RVP
ycode 31 = s S a A keycode 33 = f F d D keycode 35 = h H g G keycode 38 = l L k K keycode 49 = n N m M keycode 52 = period greater slash question keycode 219 = Mode_switch EoF $ ``` You produce the broken keys using Win+adjacent-to-broken key. (Why is the script called `qey.sh' instead of `key.sh'? Because the `k' key is broken :)) -RVP

Re: sh(1): POSIX "Command Search and Execution"

2024-09-22 Thread RVP
orld ``` Of course, if you add/delete/rename commands (or dirs. in PATH), you'll have to recreate the functions again (`hash -r` equiv.). -RVP

Re: mysterious remquo bug

2024-09-15 Thread RVP
correct) result, and then passes this to printf(). Try again with -O and/or -fno-builtin, or a different compiler for more fun. Also here: https://www.unitedbsd.com/d/1427-long-double-trouble -RVP

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

2024-05-17 Thread RVP
lity mode is off, all commands 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
!= cat /usr/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
" .Sh DESCRIPTION This .Fn signal ``` (the `cm' string is for nroff only) -RVP

Re: tar vs device special files

2023-10-28 Thread RVP
er->rdevmajor))); + archive_entry_set_rdevminor(entry, (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
G_EESCAPE); cc = GETNEXT(); ``` -RVP

Re: Trivial program size inflation

2023-07-05 Thread RVP
yway). Only lightly tested. Tell me 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 @@ %{!s

Re: Trivial program size inflation

2023-07-04 Thread RVP
al/gpl3/gcc/dist/gcc/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 [...] -- 2

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: 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
6420 W aligned_alloc 64d0 W calloc 5d50 T free 55f0 T malloc 7470 W posix_memalign 5fd0 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-02 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-01 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
t in either. Even 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
e i18n and NSS on an as-needed basis. -RVP

Re: Trivial program size inflation

2023-07-01 Thread RVP
riends. So 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
[+-]N'. 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
7). (my emphasis) 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
te values, shouldn'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
functionally the same as the ones in your log file. -RVP

Re: unresolvable R_X86_64_NONE relocation against symbol `__sF'

2023-05-18 Thread RVP
tch/libfetch.a file itself? -RVP

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

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

Re: jemalloc profiling

2023-04-27 Thread RVP
malloc/internal/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
NetBSD source for usages, 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
stdout); if (setreuid(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
:CPPFLAGS+=-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
or the heavy lifting; 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
again.) -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
the repositioning 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
ur to add to the libc close routines. -RVP

Re: Strange pthread_self() return value

2021-06-11 Thread RVP
' when 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
k out 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
-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
/wsmoused.c 2020-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
randr unavailable. -RVP

Re: set -o emacs when su?

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