Re: ksh: PROMPT_COMMAND

2022-08-03 Thread Damien Miller
On Thu, 4 Aug 2022, Christian Weisgerber wrote: > Damien Miller: > > > bash has a PROMPT_COMMAND that allows a command to be executed before > > each PS1 prompt is displayed. I've found this useful on occasion, so > > this is the same thing for ksh(1). > > PS1 is evaluated each time the prompt

Re: parallel divert packet soreceive

2022-08-03 Thread Vitaliy Makkoveev
Also, I like to have exclusive layer locks like `tcp_lock’, `udp_lock’, etc.. And take them with shared netlock held as the first step of inet sockets unlocking. > On 4 Aug 2022, at 02:13, Vitaliy Makkoveev wrote: > >> On 4 Aug 2022, at 01:36, Alexander Bluhm wrote: >> >> Hi, >> >> Divert

Re: wc(1): accelerate word counting

2022-08-03 Thread Scott Cheloha
On Wed, Nov 17, 2021 at 08:37:53AM -0600, Scott Cheloha wrote: > In wc(1) we currently count words, both ASCII and multibyte, in a > getline(3) loop. > > This makes sense in the multibyte case because stdio handles all the > nasty buffer resizing for us. We avoid splitting a multibyte between >

Re: parallel divert packet soreceive

2022-08-03 Thread Vitaliy Makkoveev
> On 4 Aug 2022, at 01:36, Alexander Bluhm wrote: > > Hi, > > Divert packet has a strange design as it calls the protocol layer > directly from pf. As pf runs in parallel, divert_packet() has a > XXXSMP comment and kernel lock. This gives the opportunity to make > experiments. > > I added a

parallel divert packet soreceive

2022-08-03 Thread Alexander Bluhm
Hi, Divert packet has a strange design as it calls the protocol layer directly from pf. As pf runs in parallel, divert_packet() has a XXXSMP comment and kernel lock. This gives the opportunity to make experiments. I added a mutex in inet PCB layer. It can be taken directly in protocol input

Re: ksh: PROMPT_COMMAND

2022-08-03 Thread Christian Weisgerber
Damien Miller: > bash has a PROMPT_COMMAND that allows a command to be executed before > each PS1 prompt is displayed. I've found this useful on occasion, so > this is the same thing for ksh(1). PS1 is evaluated each time the prompt is displayed. You can put a command in $() in there.

Re: random(6): undefined cast and error checking

2022-08-03 Thread lucic71
>On Wed, Aug 03, 2022 at 08:26:20AM -0600, Theo de Raadt wrote: >> luci...@bronze.ctrl-c.club wrote: >> >> > Another way to solve this problem would be to trim the numbers with >> > something like this: if (denom > UINT32_MAX) denom = UINT32_MAX. >> >> And then document that the program returns

Re: random(6): undefined cast and error checking

2022-08-03 Thread Theo Buehler
On Wed, Aug 03, 2022 at 08:26:20AM -0600, Theo de Raadt wrote: > luci...@bronze.ctrl-c.club wrote: > > > Another way to solve this problem would be to trim the numbers with > > something like this: if (denom > UINT32_MAX) denom = UINT32_MAX. > > And then document that the program returns

Re: random(6): undefined cast and error checking

2022-08-03 Thread Theo de Raadt
luci...@bronze.ctrl-c.club wrote: > Another way to solve this problem would be to trim the numbers with > something like this: if (denom > UINT32_MAX) denom = UINT32_MAX. And then document that the program returns incorrect results? > >However, using drand48() will mean using a floating point

Re: random(6): undefined cast and error checking

2022-08-03 Thread lucic71
>luci...@bronze.ctrl-c.club wrote: > >> This patch solves two problems. >> >> First, abort if denom is greater than UINT32_MAX. arc4random_uniform >> expects an uint32_t. If floor(denom) is greater than UINT32_MAX then >> the cast is undefined behaviour. > >This isn't a very important program,

Re: rpki-client: add connect() MAX_CONTIMEOUT for rsync/rrdp

2022-08-03 Thread Job Snijders
On Tue, Aug 02, 2022 at 12:27:57PM -0600, Theo de Raadt wrote: > I don't see any way this can be tested in less than 24 hours. Good idea. I've set up a fast testrig that runs two instances in parallel in a 'while true' loop (with and without the changeset), each with their own cachedir on MFS.