Re: format strings in libexpat

2023-02-20 Thread Joerg Sonnenberger
On Sat, Feb 18, 2023 at 08:22:56AM +, Miod Vallat wrote: > libexpat assumes the compiler might not know of the C99 format > specifiers for ptrdiff_t and size_t, and tries to guess alternative > format strings. The problem is the printf runtime. There is no good way to detect the support

Re: Inconsistent isdigit(3) man page

2023-01-21 Thread Joerg Sonnenberger
Am Fri, Jan 20, 2023 at 09:32:38AM -0700 schrieb Bob Beck: > Various spec docs seem all over the place on this, so I am also > paging Dr. Posix in this email... Hi Philip! :) Is isdigit() > safe from being screwed up by locale or not? I think this POSIX.1-2017 (i.e. Open Group Issue 7), locales

Re: ssh: progress meter: prefer setitimer(2) to alarm(3)

2022-12-31 Thread Joerg Sonnenberger
On Sat, Dec 31, 2022 at 04:16:18PM -0500, Scott Cheloha wrote: > Even Windows went with Linux: WSL2 has Linux syscall compatibility, WSL2 is running a Linux kernel under HyperV. WSL1 is the system call translation layer. Joerg

Re: ssh-keygen(1): by default generate ed25519 key (instead of rsa)

2022-11-07 Thread Joerg Sonnenberger
Am Tue, Nov 08, 2022 at 01:23:52PM +1100 schrieb Darren Tucker: > On Tue, 8 Nov 2022 at 11:05, Joerg Sonnenberger wrote: > > Am Mon, Nov 07, 2022 at 12:53:43PM +0100 schrieb Renaud Allard: > [...] > > > Wouldn't it also be a good idea for ssh client to also try the ed

Re: ssh-keygen(1): by default generate ed25519 key (instead of rsa)

2022-11-07 Thread Joerg Sonnenberger
Am Mon, Nov 07, 2022 at 12:53:43PM +0100 schrieb Renaud Allard: > > > On 11/6/22 15:29, Job Snijders wrote: > > Dear all, > > > > Support for using Ed25519 for server and user authentication was > > introduced in 2014. I like the compactness of Ed25519 public keys. > > > > Perhaps now is a

Re: ssh-keygen(1): by default generate ed25519 key (instead of rsa)

2022-11-06 Thread Joerg Sonnenberger
On Sun, Nov 06, 2022 at 04:29:59PM +0100, Solène Rapenne wrote: > Le Sun, 6 Nov 2022 14:29:52 +, > Job Snijders a écrit : > > > Dear all, > > > > Support for using Ed25519 for server and user authentication was > > introduced in 2014. I like the compactness of Ed25519 public keys. > > > >

Re: wc(1): add -L flag to write length of longest line

2022-09-29 Thread Joerg Sonnenberger
On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > wc counts items in files. Finding the longest item indeed sounds > like a task better suited to awk. Finding outliers, means and counting are all parts of the same basic class of operations. A good implementation of all of them

SSH_USER_AUTH

2022-09-18 Thread Joerg Sonnenberger
Hello, does anyone still know the motivation for SSH_USER_AUTH pointing to a file with the data instead of containing it directly? It makes the use a bit more annoying and the only argument I can come up with is not putting up to about 4KB into the environment. Joerg

Re: quiz(6): update european countries

2022-07-04 Thread Joerg Sonnenberger
On Mon, Jul 04, 2022 at 05:44:33PM -0400, Daniel Dickman wrote: > I also noticed NetBSD removed The Hague as a capital of The Netherlands, > but I disagree with that. Maybe some of the Dutch folks on this mailing > list can weigh in which is right. Amsterdam is the capital, The Hague is the

Re: Picky, but much more efficient arc4random_uniform!

2022-05-18 Thread Joerg Sonnenberger
Am Wed, May 18, 2022 at 12:49:21PM +0200 schrieb Steffen Nurpmeso: > What surprised me was that the Apple code requires more calls, and > that today divisions and multiplications still matter. I think it > was the Cyrix 166+ (or was it Athlon 1600+) where +,-,<<,>> was > one cycle, * was ten

Re: Picky, but much more efficient arc4random_uniform!

2022-05-17 Thread Joerg Sonnenberger
Am Fri, May 13, 2022 at 09:43:26AM -0500 schrieb Luke Small: > I made a couple new versions of a new kind of arc4random_uniform-like > function and some example functions which use them. Instead of having a > sufficiently large random number greater than the modulus, I pick a random > number using

Re: EVFILT_USER and kevent(2)

2022-04-30 Thread Joerg Sonnenberger
Am Sat, Apr 30, 2022 at 10:05:05PM +0100 schrieb Stuart Henderson: > On 2022/04/30 13:51, Visa Hankala wrote: > > I am in two minds about EVFILT_USER. On the one hand, having it on > > OpenBSD might help with ports. > > No opinion on the addition, but I don't think we ran into this in ports > so

Re: clang: compile static analyzer

2022-03-23 Thread Joerg Sonnenberger
Am Fri, Jan 21, 2022 at 12:45:56AM +0100 schrieb Steffen Nurpmeso: > Fwiw, i have been astonished by this thread. I found scan-build > to generate a lot of false warnings, so much indeed that i stopped > using it .. in summer 2017. I've spend time on the static analyzer output in NetBSD and I

Re: Stop mentioning ld(1) warning messages in mktemp.3 and tmpnam.3

2021-11-04 Thread Joerg Sonnenberger
On Thu, Nov 04, 2021 at 06:30:29PM -0600, Theo de Raadt wrote: > Joerg Sonnenberger wrote: > > > On Thu, Nov 04, 2021 at 10:12:32PM +0100, Frederic Cambus wrote: > > > I'm building myself a small tool [1] to display .gnu.warning.* sections > > > names in ELF ob

Re: Stop mentioning ld(1) warning messages in mktemp.3 and tmpnam.3

2021-11-04 Thread Joerg Sonnenberger
On Thu, Nov 04, 2021 at 10:12:32PM +0100, Frederic Cambus wrote: > I'm building myself a small tool [1] to display .gnu.warning.* sections > names in ELF objects along with their content, and will check which > other projects use those sections. So far, aside from us, FreeBSD, > NetBSD, and

Re: Should 80MB of RAM be enough for kernel relinking on i386?

2021-09-23 Thread Joerg Sonnenberger
On Thu, Sep 23, 2021 at 09:21:46PM +0100, Stuart Henderson wrote: > (the extra register used by PIE > hurts i386 mode a lot more than amd64 > mode with its extra registers), Just for the sake of correctness: it hurts much less on x86_64, because there is IP-relative addressing for code *and*

Re: iked(8): Increase the default Child SA data lifetime limit

2021-08-02 Thread Joerg Sonnenberger
On Tue, Aug 03, 2021 at 01:12:54AM +0300, Vitaliy Makkoveev wrote: > Index: sbin/iked/types.h > === > RCS file: /cvs/src/sbin/iked/types.h,v > retrieving revision 1.43 > diff -u -p -r1.43 types.h > --- sbin/iked/types.h 13 May 2021

Re: getopt.3 bugs section

2021-01-09 Thread Joerg Sonnenberger
On Sat, Jan 09, 2021 at 02:07:32PM +0100, Christian Weisgerber wrote: > Edgar Pettijohn: > > > In the BUGS section for the getopt(3) manual it mentions not using > > single digits for options. I know spamd uses -4 and -6 there are > > probably others. Should they be changed? Or is the manual

Re: [PATCH 3/6] crypto: cast: convert to use new modes 64-bit helpers

2020-06-27 Thread Joerg Sonnenberger
On Sat, Jun 27, 2020 at 10:36:58PM +0300, Dmitry Baryshkov wrote: > + * 3. All advertising materials mentioning features or use of this software > + *must display the following acknowledgement: > + *"This product includes cryptographic software written by > + * Eric Young

Re: libkern: ffs() for arm64

2020-06-08 Thread Joerg Sonnenberger
On Mon, Jun 08, 2020 at 11:16:59PM +0200, Christian Weisgerber wrote: > I blame dlg@ for making me scrutinize the POWER7 instruction set, > which led me to the clz instruction, which led me to ffs(). I > wanted to add this to libc, but then realized the futility because > the compiler already

Re: locale thread support

2020-05-22 Thread Joerg Sonnenberger
On Fri, May 22, 2020 at 01:50:44PM +0200, Marc Espie wrote: > uselocale is fine, but it is not on windows, so highly portable code tends to > prefer strtod_l... The problem with uselocale is two fold and why I explicitly decided to not implement it in NetBSD: (1) It can come at a significant

Re: Clarify drand48() return values

2019-12-19 Thread Joerg Sonnenberger
On Thu, Dec 19, 2019 at 04:19:36PM -0800, j...@bitminer.ca wrote: > > Clarify that drand48 returns values not including 1.0. > > Index: src/lib/libc/stdlib/rand48.3 > === > RCS file: /cvs/src/lib/libc/stdlib/rand48.3,v > retrieving

Re: amd64: i8254_delay(): simpler microsecond->ticks conversion

2019-05-20 Thread Joerg Sonnenberger
On Sun, May 19, 2019 at 12:25:04PM -0500, Scott Cheloha wrote: > guenther@ has pointed out in a separate mail that I can make the diff > smaller with a cast and that it's acceptable here. As with the code > it's replacing I've left a comment explaining what we're doing. There is a rather obvious

Re: signal to process or posix thread

2018-07-01 Thread Joerg Sonnenberger
On Fri, Jun 29, 2018 at 04:21:17PM +0200, Alexander Bluhm wrote: > The problem is that POSIX has signals that are sent to processes > and signals sent to individual threads. Our kernel does not support > this properly. Well, not exactly. POSIX has synchronous and asynchronous signals. I.e.

Re: cast __swapXX in _endian.h to help the compiler

2018-01-12 Thread Joerg Sonnenberger
On Thu, Jan 11, 2018 at 01:53:00PM +1000, David Gwynne wrote: > this silences the warnings when building dhclient. You might want to check if __builtin_bswap16 and friends exist first and prefer to use them directly. Joerg

Re: use inline functions instead of __statement

2018-01-04 Thread Joerg Sonnenberger
On Thu, Jan 04, 2018 at 09:35:36AM +1000, David Gwynne wrote: > these days you can use inline functions to get the same effect, but > it is a more obvious and standard language feature. If you want to go that way, you still should very likely mark the functions as always_inline, otherwise the

Re: sign of char on arm64

2017-12-14 Thread Joerg Sonnenberger
On Thu, Dec 14, 2017 at 12:17:56PM +0100, Mark Kettenis wrote: > Pretty sure Linux uses the same defaults for the signedness of char as > everybody else. But since both signed and unsigned char have to work, > it might very well be that the rust developers decided to ignore this > largely

Re: Implement __cxa_thread_atexit

2017-11-22 Thread Joerg Sonnenberger
On Mon, Nov 20, 2017 at 10:07:33PM +0100, Mark Kettenis wrote: > > Date: Sun, 19 Nov 2017 23:13:05 +0100 > > From: Joerg Sonnenberger <jo...@bec.de> > > > > On Sun, Nov 19, 2017 at 11:05:31PM +0100, Joerg Sonnenberger wrote: > > > On Sun, Nov 19, 2017 a

Re: Implement __cxa_thread_atexit

2017-11-19 Thread Joerg Sonnenberger
On Sun, Nov 19, 2017 at 11:05:31PM +0100, Joerg Sonnenberger wrote: > On Sun, Nov 19, 2017 at 10:04:45PM +0100, Mark Kettenis wrote: > > Here is an update diff that implements __cxa_thread_atexit which is > > emitted by clang (and modern gcc) to implement certain aspects of > &g

Re: Implement __cxa_thread_atexit

2017-11-19 Thread Joerg Sonnenberger
On Sun, Nov 19, 2017 at 10:04:45PM +0100, Mark Kettenis wrote: > Here is an update diff that implements __cxa_thread_atexit which is > emitted by clang (and modern gcc) to implement certain aspects of > C++11 thread_local. Note that without providing __cxa_thread_atexit, gcc will not detect it

Re: kq_count earlier!

2017-10-09 Thread Joerg Sonnenberger
On Mon, Oct 09, 2017 at 12:27:50PM +0200, Martin Pieuchot wrote: > On 09/10/17(Mon) 12:22, Joerg Sonnenberger wrote: > > On Mon, Oct 09, 2017 at 12:15:46PM +0200, Martin Pieuchot wrote: > > > Diff below is a small cleanup to keep the accounting of events in > > > syn

Re: kq_count earlier!

2017-10-09 Thread Joerg Sonnenberger
On Mon, Oct 09, 2017 at 12:15:46PM +0200, Martin Pieuchot wrote: > Diff below is a small cleanup to keep the accounting of events in > sync with the number of events on the list. This is a noop for the > moment, but it's small & easy part to review of my upcoming diff. Well, not counting the

Re: sin() implementation

2017-09-29 Thread Joerg Sonnenberger
On Fri, Sep 29, 2017 at 11:16:24AM +0200, Alexandre Ratchov wrote: > On Wed, Sep 27, 2017 at 03:09:48PM +0200, Joerg Sonnenberger wrote: > > On Wed, Sep 27, 2017 at 08:40:26AM +0200, Alexandre Ratchov wrote: > > > Even on modern amd64s integer arithmetics and bitwise operation

Re: sin() implementation

2017-09-27 Thread Joerg Sonnenberger
On Wed, Sep 27, 2017 at 08:40:26AM +0200, Alexandre Ratchov wrote: > Even on modern amd64s integer arithmetics and bitwise operations are > faster (and more precise in many cases) than floating point > equivalents. Can you actually substanciate this claim? The basic x87 instructions (FLD, FST,

Re: Implement __cxa_thread_atexit

2017-08-11 Thread Joerg Sonnenberger
On Fri, Aug 11, 2017 at 04:31:44PM +0200, Mark Kettenis wrote: > The diff below implements __cxa_thread_atexit(). Calls to this > function are emitted by the compiler to schedule running desctructors > for thread_local objects when a thread terminates or calls exit(3). > The Linux implementation

Re: Fix libexec/ld.so/dlclose regress

2017-08-03 Thread Joerg Sonnenberger
On Wed, Aug 02, 2017 at 09:03:30PM +0200, Mark Kettenis wrote: > Couldn't convince clang not to inline duplicateFun() into bbTest2(). > Splitting things out in a seperate file avoids the issue. Fixes the > regression test. Have you tried the combiniation of noinline attribute with asm

Re: clang ld.so regress failures

2017-08-02 Thread Joerg Sonnenberger
On Wed, Aug 02, 2017 at 12:09:13AM -0400, Ted Unangst wrote: > Mark Kettenis wrote: > > FAIL libexec/ld.so/dlclose/test1/prog3/prog3 > > > > This fails because clang doesn't respect ELF interposition: > > > > http://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html > > > > We

Re: clang ld.so regress failures

2017-08-01 Thread Joerg Sonnenberger
On Tue, Aug 01, 2017 at 04:46:17PM +0200, Mark Kettenis wrote: > FAIL libexec/ld.so/dlclose/test1/prog3/prog3 > > This fails because clang doesn't respect ELF interposition: > > http://lists.llvm.org/pipermail/llvm-dev/2016-November/107625.html > > We generally frown upon interposition

Re: Standard conformance of strtol(3)

2017-07-06 Thread Joerg Sonnenberger
On Thu, Jul 06, 2017 at 03:42:19PM +0200, Marc Espie wrote: > 7.20.1.4 (3) If the value of base is zero, the expected form of the subject > sequence is that of an integer constant *as described in 6.4.4.1*, optionally > preceded by a plus or minus sign but not including an integer suffix [...] >

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Joerg Sonnenberger
On Mon, May 29, 2017 at 06:54:52PM +0100, Stuart Henderson wrote: > On 2017/05/29 20:26, Vadim Zhukov wrote: > > The clang and gcc behave differently regarding executing tools. > > While gcc simply runs what he said to, clang tries to be clever > > and always find absolute path for a tool,

Re: clang: ignore -fno-force-addr

2017-04-19 Thread Joerg Sonnenberger
On Wed, Apr 19, 2017 at 10:30:43AM -0600, Todd C. Miller wrote: > In general, if -fdo-something is supported I think it should also > accept -fno-do-something. Since this was seen in the wild, patching > llvm makes the most sense. Bonus points if you can get it upstreamed. The positive forms of

Re: CFI directives support in binutils

2017-04-17 Thread Joerg Sonnenberger
On Mon, Apr 17, 2017 at 10:45:37PM +0200, Mark Kettenis wrote: > This diff extends the support for CFI in binutils with a few > directives emitted by clang. Most of the code is stolen from > FreeBSD's GPLv2 binutils. Support for the .cfi_sections directive is > incomplete; basically we just

Re: httpd/libtls: TLS client certificate revocation checking

2017-04-01 Thread Joerg Sonnenberger
On Sat, Apr 01, 2017 at 07:53:05PM +1030, Jack Burton wrote: > One common example of that happening is when a cert gets revoked because > its private key has been lost/stolen and the user needs a new cert > associated with the same identity. An even more common example is when > a cert expires &

Re: httpd/libtls: TLS client certificate revocation checking

2017-03-31 Thread Joerg Sonnenberger
On Fri, Mar 31, 2017 at 01:03:44PM -0700, William Ahern wrote: > Basically, anything short of passing through the entire certificate is going > to be severely limiting and frustrating, to the point of uselessness. Passing down the common name is normally enough, but not doing that makes it nearly

Re: SVM instructions

2017-03-17 Thread Joerg Sonnenberger
On Wed, Mar 15, 2017 at 09:05:56PM +0100, Mark Kettenis wrote: > Clang only accepts SVM instructions with explicit operands, for > example: > > vmload %rax You might want to look at the aliases e.g. for monitor/mwait. Should be pretty easy to extend as long as we are talkign about pure

Re: Linking userland with lld

2017-01-21 Thread Joerg Sonnenberger
On Sat, Jan 21, 2017 at 10:58:59AM +0100, Mark Kettenis wrote: > The problem here is that the code uses the SHA1 functions in > libcrypto, but doesn't explicitly link against that library. With our > ancient binutils we don't notice this, because we link against libtls, > which as a DT_NEEDED

Re: Build kernels with -ffreestanding?

2016-12-24 Thread Joerg Sonnenberger
On Sat, Dec 24, 2016 at 12:08:35AM +0100, Mark Kettenis wrote: > We can get those optimizations back by doing: > > #define memcpy(d, s, n) __builtin_memcpy((d), (s), (n)) You might still want to put a prototype in, just before the define. Joerg

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 11:27:15AM -0800, Philip Guenther wrote: > This is a form we use inside _libc_ so that calls to those functions > generated by gcc will be redirected to aliases with hidden visibility > and thus be local calls, without using the PLT. If that won't work > with clang, then

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Fri, Dec 23, 2016 at 06:43:42PM +0100, Mark Kettenis wrote: > > Date: Fri, 23 Dec 2016 18:13:45 +0100 > > From: Joerg Sonnenberger <jo...@bec.de> > > > > On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > > > I'm assuming clang handles

Re: ld.so: -fno-builtin?

2016-12-23 Thread Joerg Sonnenberger
On Thu, Dec 22, 2016 at 10:35:25PM -0800, Philip Guenther wrote: > I'm assuming clang handles asm names like gcc, such that declaring >void *memcpy(void *__restrict, const void *__restrict, __size_t) > __dso_hidden __asm("_dl_memcpy"); > > will make even internally generated calls go to

Re: ld.so: -fno-builtin?

2016-12-22 Thread Joerg Sonnenberger
On Thu, Dec 22, 2016 at 05:47:05PM +0100, Christian Weisgerber wrote: > Building ld.so with clang on amd64 fails with undefined references > to memset and memcpy. That is odd, since neither function appears > in the source. Apparently clang optimizes the _dl_memset and > _dl_bcopy functions into

Re: LLVM: use OpenBSD target code for AArch64

2016-11-24 Thread Joerg Sonnenberger
On Fri, Nov 25, 2016 at 12:37:10AM +0100, Patrick Wildt wrote: > This diff makes LLVM do all the OpenBSD stuff for AArch64. > > ok? If you plan to submit this upstream, you should also update the test cases accordingly. Joerg

Re: enforce zero options

2016-10-12 Thread Joerg Sonnenberger
On Wed, Oct 12, 2016 at 03:53:17PM +0200, Jan Stary wrote: > I don't get it: why do we need to handle -- > in utils which take no options and no arguments? Are you sure they will never handle options in the future? Joerg

Re: Modernize arm assembly in the kernel

2016-09-21 Thread Joerg Sonnenberger
On Wed, Sep 21, 2016 at 10:10:43AM +0200, Mark Kettenis wrote: > 1. In GNU as, .align 0 is equivalent to .align 2, but with clang's >internal assembler .align 0 means "no alignment". It might be even better to use .balign or .p2align. > 2. Using "ldr" to load a constant into a register is

Re: C startup code: make crtbegin code safe for clang

2016-08-04 Thread Joerg Sonnenberger
On Mon, Aug 01, 2016 at 07:28:34PM +0200, Stefan Kempf wrote: > The constructor and destructor tables are declared as arrays with one > non-NULL element. Walking those until a NULL element is reached looks > like out-of-bound accesses to newer compilers, and they turn the code > into infinite

Re: exp.3: remove ancient history and some markup tweaks

2016-05-30 Thread Joerg Sonnenberger
On Mon, May 30, 2016 at 04:30:10PM +0200, Marc Espie wrote: > On Mon, May 30, 2016 at 03:34:04PM +0200, Joerg Sonnenberger wrote: > > On Mon, May 30, 2016 at 02:16:20PM +0200, Theo Buehler wrote: > > > It may be somewhat interesting to mention why expm1(x) = exp(x) - 1 and >

Re: exp.3: remove ancient history and some markup tweaks

2016-05-30 Thread Joerg Sonnenberger
On Mon, May 30, 2016 at 02:16:20PM +0200, Theo Buehler wrote: > It may be somewhat interesting to mention why expm1(x) = exp(x) - 1 and > log1p(x) = log(1 + x) are provided and what their historical purpose is. > However, as mlarkin@ put it: are any of our users of exp(3) going to > seriously be

Re: siginfo_t.si_addr should be void*

2016-04-27 Thread Joerg Sonnenberger
On Wed, Apr 27, 2016 at 06:04:32PM -0400, i80...@foxquill.com wrote: > POSIX specifies that siginfo_t.si_addr must be void*. OpenBSD currently > defines it as caddr_t. This breaks some userspace programs, such as the > following minimal case: This > The following patch builds the base system

Re: Overflowable int -> size_t in grep

2015-12-07 Thread Joerg Sonnenberger
On Mon, Dec 07, 2015 at 02:32:50AM -0500, Michael McConville wrote: > Otto Moerbeek wrote: > > On Mon, Dec 07, 2015 at 01:36:22AM -0500, Michael McConville wrote: > > > This isn't a grave issue, but I came across it while exploring integer > > > overflow and think it's worth sharing. > > > > > >

Re: unify xmalloc (was Re: [patch] cvs: retire xfree())

2015-11-08 Thread Joerg Sonnenberger
On Sun, Nov 08, 2015 at 08:36:52AM +, Nicholas Marriott wrote: > On Sat, Nov 07, 2015 at 08:42:14PM -0500, Ted Unangst wrote: > > Tobias Stoeckmann wrote: > > > Is this okay for ssh and tmux, which are out to be very portable? > > > Nicholas mentioned that malloc is not required to set errno.

Re: __progname in base

2015-11-07 Thread Joerg Sonnenberger
On Sat, Nov 07, 2015 at 12:20:42PM +0100, Tobias Stoeckmann wrote: > Index: bin/mt/mt.c > === > RCS file: /cvs/src/bin/mt/mt.c,v > retrieving revision 1.36 > diff -u -p -u -p -r1.36 mt.c > --- bin/mt/mt.c 12 Nov 2013 04:36:02

Re: __progname in base

2015-11-07 Thread Joerg Sonnenberger
On Sat, Nov 07, 2015 at 03:32:11PM +0100, Joerg Sonnenberger wrote: > As Ingo recently reminded me, OpenBSD actually did add getprogname() at > some point, which needs need a actually manual forward definition. Too early for writing. It does *not* need such an ugly manual extern decla

Re: [patch] cat's main never return

2015-08-29 Thread Joerg Sonnenberger
On Sun, Aug 30, 2015 at 12:10:03AM +0200, Fritjof Bornebusch wrote: If exit(3) is always called, than why not changing the return value to *void*? Because ISO C says that in non-freestanding environment, main should retutrn int. Joerg

Re: kern_tame.c: fix strncmp call

2015-08-23 Thread Joerg Sonnenberger
On Sun, Aug 23, 2015 at 03:29:46PM -0700, patrick keshishian wrote: On 8/23/15, Caspar Schutijser cas...@schutijser.com wrote: Patch below. Thanks, Caspar Schutijser Index: sys/kern/kern_tame.c === RCS file:

Re: qsort.3 big O notation

2015-03-03 Thread Joerg Sonnenberger
On Tue, Mar 03, 2015 at 05:02:39PM +0100, frantisek holop wrote: i leave the battle about lg vs log to others, but i prefer 'log' as there is a man page for that and there is none for 'lg'... If anything, it should be log because that is the name of the mathematical function. libm is

Re: ntpd: prefer %z when formatting size_t

2015-02-10 Thread Joerg Sonnenberger
On Mon, Feb 09, 2015 at 10:32:55PM -0600, Brent Cook wrote: Pretty trivial conversion. ok? Well, if it is size_t, it should be %zu. Joerg

Re: [PATCH] update zlib to 1.2.8

2014-12-23 Thread Joerg Sonnenberger
On Tue, Dec 23, 2014 at 10:54:15PM +0200, Timo Myyrä wrote: I was trying to port notmuch mail indexer but got little stuck with it as it requires newer Zlib version than whats in base. It is easy to patch notmuch, the requirement is rather silly. FYI. Joerg

Re: switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Joerg Sonnenberger
On Sat, Aug 09, 2014 at 11:37:02PM +1000, Jonathan Gray wrote: clang only has an integrated preprocessor and does not have a standalone preprocessor or the option of using one. Huh? clang-cpp will certainly act as standalone preprocessor. Joerg

Re: switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Joerg Sonnenberger
On Sun, Aug 10, 2014 at 12:29:24AM +1000, Jonathan Gray wrote: On Sat, Aug 09, 2014 at 04:17:51PM +0200, Joerg Sonnenberger wrote: On Sat, Aug 09, 2014 at 11:37:02PM +1000, Jonathan Gray wrote: clang only has an integrated preprocessor and does not have a standalone preprocessor

Re: [PATCH 2/7] fix type string conversion warning

2014-06-02 Thread Joerg Sonnenberger
On Mon, Jun 02, 2014 at 12:33:14PM -0400, Ted Unangst wrote: What compiler warns about this? It's perfectly fine to pass a nonconst string to a function that takes a const string. char * vs unsigned char *? Joerg

Re: LLVM warning in dev/ic/uhci.c

2013-12-04 Thread Joerg Sonnenberger
On Wed, Dec 04, 2013 at 12:24:50PM +0100, Mark Kettenis wrote: Sorry, but I disagree with LLVM here. It shouldn't complain about static inline functions. Then mark them as unused, just like you would with a static variable you insist on keeping. Joerg

Re: Weard security report

2013-11-06 Thread Joerg Sonnenberger
On Wed, Nov 06, 2013 at 10:24:53AM -0500, sven falempin wrote: == /var/db/cloud.json diffs (-OLD +NEW) == --- /dev/null Fri Oct 25 01:30:33 2013 +++ /var/db/cloud.json Thu Oct 17 17:21:15 2013 This just means that the file was created as opposed to empty. Joerg

Re: ksh global PWD env variable

2013-07-21 Thread Joerg Sonnenberger
On Sun, Jul 21, 2013 at 10:01:33PM +0200, Alexander Hall wrote: I for one don't see a general interest in knowing ones parents potentially faked wd. You can find out your wd by saner means. There is no way to find the logical path without help from the shell. Joerg

Re: rm(1) static addition

2013-04-27 Thread Joerg Sonnenberger
On Sat, Apr 27, 2013 at 09:09:25PM +0200, Franco Fichtner wrote: On backtrace(3) (which is a GNU thing, I know), static functions don't show up with their respective names even though they are in the binary. That's a tad annoying, but I am not aware of any other limitation. Can someone please

Re: fun with libtool for masochistic guys

2012-07-12 Thread Joerg Sonnenberger
On Thu, Jul 12, 2012 at 12:33:18AM +0200, Marc Espie wrote: On Wed, Jul 11, 2012 at 11:24:37PM +0200, Joerg Sonnenberger wrote: On Wed, Jul 11, 2012 at 03:13:19PM +0200, Marc Espie wrote: On Wed, Jul 11, 2012 at 01:08:43PM +0200, Joerg Sonnenberger wrote: On Wed, Jul 11, 2012 at 10:57

Re: fun with libtool for masochistic guys

2012-07-11 Thread Joerg Sonnenberger
On Wed, Jul 11, 2012 at 10:57:21AM +0200, Marc Espie wrote: 1/ Turns out GNU libtool simply *removes* stuff it doesn't understand while linking. I find that no more buggy than GCC passing all unknown junk to ld... Joerg

Re: fun with libtool for masochistic guys

2012-07-11 Thread Joerg Sonnenberger
On Wed, Jul 11, 2012 at 03:13:19PM +0200, Marc Espie wrote: On Wed, Jul 11, 2012 at 01:08:43PM +0200, Joerg Sonnenberger wrote: On Wed, Jul 11, 2012 at 10:57:21AM +0200, Marc Espie wrote: 1/ Turns out GNU libtool simply *removes* stuff it doesn't understand while linking. I find

Re: cron: fix incorrect error message

2012-05-08 Thread Joerg Sonnenberger
On Tue, May 08, 2012 at 06:19:55PM +0200, Thomas Pfaff wrote: On Tue, 8 May 2012 09:55:53 -0400 Okan Demirmen o...@demirmen.com wrote: Not really a pasto; from putenv(): P = (char **)realloc(lastenv, sizeof(char *) * (cnt + 2)); *puke* Ok? If you want to drop the first cast,

Re: escape man(1) arguments from glob(3)

2011-11-20 Thread Joerg Sonnenberger
On Sun, Nov 20, 2011 at 12:57:40PM +0100, Ingo Schwarze wrote: Hi Joerg, Joerg Sonnenberger wrote on Sun, Nov 20, 2011 at 06:00:16AM +0100: On Sun, Nov 20, 2011 at 02:27:39AM +0100, Ingo Schwarze wrote: Or we need the patch below. It looks a bit messy, but i think it is safe

Re: escape man(1) arguments from glob(3)

2011-11-19 Thread Joerg Sonnenberger
On Sun, Nov 20, 2011 at 02:27:39AM +0100, Ingo Schwarze wrote: Or we need the patch below. It looks a bit messy, but i think it is safe. Thoughts, OKs? Invert the logic. Check with strcspn first, if there is a character that needs quoting. This is not the default case after all. If you do,

Re: mmap diff for patch(1)

2011-11-11 Thread Joerg Sonnenberger
On Fri, Nov 11, 2011 at 10:20:19AM +0100, Otto Moerbeek wrote: On Fri, Nov 11, 2011 at 03:04:28PM +0800, Michael W. Bombardieri wrote: Sorry, let me try that again... Forgot to clean up file descriptor ifd. AFAIK, this works without this diff. What problem are you trying to solve? Some

Re: compat linux pipe2() circus

2011-09-19 Thread Joerg Sonnenberger
On Tue, Sep 20, 2011 at 01:41:35AM +0300, Paul Irofti wrote: This time its their pipe2 system call which adds flags to the pipe call. Its the unix-ish way apparently to turn pipes into files on a kernel filesystem, or so they claim. No, the idea is to make it possible to set O_CLOEXEC

Re: wcsdup

2011-07-05 Thread Joerg Sonnenberger
On Tue, Jul 05, 2011 at 01:52:06PM -0400, Todd C. Miller wrote: if ((p = wcsdup(Lfoobar)) == NULL) { or just split it into two lines. Using the comma operator that way is correct but likely to confuse some readers. Also, what is that 'L' doing there before the foobar? Is it some sort

Simplified RCS keyword expansion

2011-04-21 Thread Joerg Sonnenberger
Hi all, below is a possible replacement for rcs.c's rcs_expand_keywords. Since my use case doesn't care about time zones, the rcs_set_tz is missing, but otherwise it should work without further changes. The memrchr might need to be replaced with an inline loop, but that's one of the few saner GNU

Re: namespace.h

2011-04-20 Thread Joerg Sonnenberger
On Tue, Apr 19, 2011 at 11:15:49PM -0500, Amit Kulkarni wrote: where is a listing of all functions implemented in openbsd's libc? Is src/lib/libc/include/namespace.h consist of functions not implemented or its a relic? namespace.h is used for protecting the libc namespace. A library may

Re: Compiling the kernel with pcc

2011-04-05 Thread Joerg Sonnenberger
On Tue, Apr 05, 2011 at 11:09:14AM +0200, Pascal Stumpf wrote: Ok, I seem to have misread the standard there, sorry. Anyway, I've done some tests with all three compilers, and gotten three different behaviours: Can you please say explicitly which GCC version you are talking about? The behavior

Re: http gzip support for ftp

2011-01-14 Thread Joerg Sonnenberger
On Fri, Jan 14, 2011 at 06:08:54PM +0100, Marc Espie wrote: On Sun, Jan 09, 2011 at 04:21:51PM -0500, Ted Unangst wrote: Downloading things can go a lot faster if the server and client support http compression. This is easily added to the ftp program's http support. It consists of two

Re: nc -U -u (Unix datagram socket support)

2011-01-07 Thread Joerg Sonnenberger
On Fri, Jan 07, 2011 at 01:32:27PM -0700, Theo de Raadt wrote: I think it is important that people who do use mktemp(3) realize that they must loop over failure (creating a new path each time), and they need to use a do not use the path from elsewhere unless the code that opens it returns

Re: Adding support for Camellia on OpenSSH.

2010-07-19 Thread Joerg Sonnenberger
On Mon, Jul 19, 2010 at 09:02:35PM -0400, Ted Unangst wrote: On Mon, Jul 19, 2010 at 8:22 PM, Joerg Sonnenberger jo...@britannica.bec.de wrote: On Mon, Jul 19, 2010 at 06:37:21PM -0400, STeve Andre' wrote: On Monday 19 July 2010 18:26:15 Ted Unangst wrote: Free software you can't modify

Re: socket buffers

2010-07-03 Thread Joerg Sonnenberger
On Sat, Jul 03, 2010 at 11:54:17AM +0100, Stuart Henderson wrote: Does anyone know offhand the reason why network connections fail if socket buffers are set above 256k? You might have to patch sb_max for that. Joerg

Re: socket buffers

2010-07-03 Thread Joerg Sonnenberger
On Sat, Jul 03, 2010 at 05:40:45PM +0200, Claudio Jeker wrote: 35M, that is insane. Either they have machines with infinite memory or you can kill the boxes easily. You don't need 35MB per client connection if interfaces like sendfile(2) are used. All the kernel has to guarantee in that case is

Re: Bug in gcc 3?

2010-06-01 Thread Joerg Sonnenberger
On Tue, Jun 01, 2010 at 09:14:53PM +0200, Tim van der Molen wrote: Would this be a bug in gcc or am I overlooking something? == has a higher precendence than += and therefore binds stronger. See operator(7). Joerg

Re: #include sys/types.h in sys/mman.h

2010-02-24 Thread Joerg Sonnenberger
On Wed, Feb 24, 2010 at 05:38:14PM -0700, Theo de Raadt wrote: On Wednesday 24 February 2010 15:57:43 Ingo Schwarze wrote: In OpenBSD, we usually include headers in other headers if that is required by a relevant standard, in particular by POSIX. I don't know where you get this idea

Re: #include sys/types.h in sys/mman.h

2010-02-24 Thread Joerg Sonnenberger
On Wed, Feb 24, 2010 at 07:56:27PM -0700, Theo de Raadt wrote: http://www.opengroup.org/onlinepubs/9699919799/ And this is exactly the problem with POSIX. When was that change made? It is the same kind of requirement as ISO C99 has for size_t. The primary header for size_t is stddef.h,

Re: If you are one of the cool kids who cranks kern.bufcachepercent up..

2010-01-09 Thread Joerg Sonnenberger
On Sat, Jan 09, 2010 at 02:41:02PM -0800, Philip Guenther wrote: I find your lack of faith in the compiler disturbing. I find your lack of type checking before trolling disturbing. stares at the code Ummm, what? AFAICT, the only difference between the two variants that I can see is

Re: kernel hacking

2009-12-10 Thread Joerg Sonnenberger
On Thu, Dec 10, 2009 at 08:54:30PM +0100, Thomas Pfaff wrote: A few books on this topic in general worth mentioning is Modern Operating Systems by Tanenbaum, Operating Systems: Design and Implementation. The latter one details the MINIX system, though. Modern Operating Systems is mostly of

Re: too many cpus

2009-12-07 Thread Joerg Sonnenberger
On Mon, Dec 07, 2009 at 12:50:33AM -0500, Ted Unangst wrote: Fortunately, help is on the way. Patch below combines all cpu states into a single line, for that classic top look even on the most impressive of modern hardware. Upstream top (and the version e.g. on Linux, NetBSD etc) use 1 for