Re: /bin/sh = STDIN functions, var scope messing

2013-05-28 Thread Václav Zeman
On 27 May 2013 21:58, Reid Linnemann wrote: from SH(1) Note that unlike some other shells, sh executes each process in a pipe- line with more than one command in a subshell environment and as a child of the sh process. I'm taking this to mean that redirecting to sh_f has sh_f

Re: Performance improvement to strnlen().

2013-05-27 Thread Václav Zeman
On 26 May 2013 21:01, Lee Thomas wrote: On 2013-05-26 08:00, Václav Zeman wrote: On 05/25/2013 10:27 PM, Lee Thomas wrote: + lp = (const unsigned long *)((uintptr_t)str ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) mask80); I do not think that this correct C

Re: Performance improvement to strnlen().

2013-05-27 Thread Václav Zeman
On 27 May 2013 12:25, Adam Nowacki wrote: On 2013-05-27 10:37, Václav Zeman wrote: On 26 May 2013 21:01, Lee Thomas wrote: On 2013-05-26 08:00, Václav Zeman wrote: On 05/25/2013 10:27 PM, Lee Thomas wrote: + lp = (const unsigned long *)((uintptr_t)str ~LONGPTR_MASK); + va

Re: Performance improvement to strnlen().

2013-05-27 Thread Václav Zeman
On 27 May 2013 12:20, Lee Thomas wrote: On 2013-05-27 04:37, Václav Zeman wrote: On 26 May 2013 21:01, Lee Thomas wrote: On 2013-05-26 08:00, Václav Zeman wrote: On 05/25/2013 10:27 PM, Lee Thomas wrote: + lp = (const unsigned long *)((uintptr_t)str ~LONGPTR_MASK); + va

Re: Performance improvement to strnlen().

2013-05-26 Thread Václav Zeman
On 05/25/2013 10:27 PM, Lee Thomas wrote: Hello FreeBSD devs, I have found a performance improvement to libc's strnlen(). lib/libc/string/strnlen.c is a trivial byte-by-byte implementation, where strlen.c has a smarter word-by-word implementation. I have implemented strnlen similarly to

Re: Unsigned Integer Encoding

2012-08-15 Thread Václav Zeman
On 08/15/2012 10:33 AM, Daniel Grech wrote: Hi, I have what is probably a really elementary question but I can't seem to figure it out. In the following snippet of code, why is it that a and b do not have the same value in the end ? : #define uint32_t unsigned int #define uint16_t

Re: Wide character types

2012-06-07 Thread Václav Zeman
On 6 June 2012 12:03, Andrew Turner wrote: I've been working on getting the ARM EABI working with FreeBSD. As part of the EABI spec the Procedure Call Standard for the ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an unsigned short with the former as the preferred

Re: dup3 syscall - atomic set O_CLOEXEC with dup2

2012-01-12 Thread Václav Zeman
On Thu, 12 Jan 2012 22:07:58 -0500, Eitan Adler wrote: Okay - here is version 2 (compile and run tested) Index: sys/kern/kern_descrip.c === --- sys/kern/kern_descrip.c (revision 229830) +++ sys/kern/kern_descrip.c (working