History log of /openbsd-src/sys/lib/libkern/libkern.h (Results 1 – 25 of 37)
Revision Date Author Comments
# e86eac0a 21-Dec-2023 jsg <jsg@openbsd.org>

add strnstr(9) string search within character limit

From Mike Barcroft in FreeBSD. Added to FreeBSD in 2001, Linux in 2010.
Used in amdgpu.

ok deraadt@


# e1bcc96d 26-Feb-2020 visa <visa@openbsd.org>

Remove non-__STDC__ assert macros from <lib/libkern/libkern.h>.
The macros are defined in a part of the header where a C compiler
is required. In addition, the macros expand to C code, so it looks
un

Remove non-__STDC__ assert macros from <lib/libkern/libkern.h>.
The macros are defined in a part of the header where a C compiler
is required. In addition, the macros expand to C code, so it looks
unnecessary to define the asserts with traditional cpp in mind.

OK cheloha@, mpi@

show more ...


# 85f30cb4 25-Apr-2018 dlg <dlg@openbsd.org>

use size_t for the size of buffers and strings, not int.

sprinkle some bounded attributes while here.

ok deraadt@


# a972b4a4 13-Jul-2014 uebayasi <uebayasi@openbsd.org>

KASSERTMSG(9): New kernel assertion with message

KASSERT() is annoying as it only prints the expression as a string. If you
(developers) want to know a little more information, you have to do:

#i

KASSERTMSG(9): New kernel assertion with message

KASSERT() is annoying as it only prints the expression as a string. If you
(developers) want to know a little more information, you have to do:

#ifdef DIAGNOSTIC
if (bad)
panic(...);
#endif

KASSERTMSG() replaces it into a single line:

KASSERTMSG(!bad, ...);

Taken from NetBSD.

(There is a concern that KASSERT() messages are too long; consume more memory,
and not friendly for small monitors. This have to be considered & revisited
later.)

"Like" from henning@
Man page review & advices from jmc@ and schwarze@

show more ...


# b5be37d2 10-Jun-2014 deraadt <deraadt@openbsd.org>

mop up #ifdef _KERNEL goo; ok miod


# 4193b9a6 19-Jan-2014 deraadt <deraadt@openbsd.org>

Initialize ci_randseed better using arc4random() + a trick. Remove the
libkern srandom() API since it is not suitable for this use.
ok kettenis miod


# 383d2989 11-Jul-2013 jsg <jsg@openbsd.org>

add fls/flsl functions to find the last bit set in a value
from FreeBSD
ok mikeb@ haesbaert@ deraadt@


# 4d8b4d23 08-Jun-2013 sf <sf@openbsd.org>

Add CTASSERT macro, for compile time assertions

ok kettenis@


# f264d37a 26-Apr-2012 matthew <matthew@openbsd.org>

Add strnlen() to libkern.

ok deraadt


# f5d2eefe 10-Jan-2011 tedu <tedu@openbsd.org>

add a new function, explicit_bzero, to be used for erasing "secret" stuff.
unlike normal bzero, we guarantee that the compiler will not optimize out
calls to this function for otherwise dead variable

add a new function, explicit_bzero, to be used for erasing "secret" stuff.
unlike normal bzero, we guarantee that the compiler will not optimize out
calls to this function for otherwise dead variables.
to be adjusted as needed when compilers and linkers get smarter.
ok deraadt miod

show more ...


# bee02bad 20-Jul-2010 matthew <matthew@openbsd.org>

Add OpenSSH's timingsafe_bcmp() to libkern.

ok djm@, deraadt@


# 83d1cf15 24-May-2009 jsg <jsg@openbsd.org>

ansi func decls


# 6a46a94a 15-Oct-2008 deraadt <deraadt@openbsd.org>

make random(9) return per-cpu values (by saving the seed in the cpuinfo),
which are uniform for the profclock on each cpu in a SMP system (but using
a different seed for each cpu). on all cpus, avoi

make random(9) return per-cpu values (by saving the seed in the cpuinfo),
which are uniform for the profclock on each cpu in a SMP system (but using
a different seed for each cpu). on all cpus, avoid seeding with a value out
of the [0, 2^31-1] range (since that is not stable)
ok kettenis drahn

show more ...


# 7a79cc70 04-May-2007 deraadt <deraadt@openbsd.org>

locc() is dead, spotted by miod


# 3b42588c 04-May-2007 deraadt <deraadt@openbsd.org>

move bcd tables to the only place that uses them (the unused mcd driver);
ok miod


# a26aa419 07-Aug-2004 deraadt <deraadt@openbsd.org>

ansi and some missing protos


# b857d3ea 21-Jun-2004 itojun <itojun@openbsd.org>

add bounded attribute to some functions. anil tested and ok'ed


# 125da6d1 06-May-2004 deraadt <deraadt@openbsd.org>

add back strchr/strrchr; from dhartmei


# 8b360a9e 23-Jun-2003 millert <millert@openbsd.org>

Remove strcat() and strcpy() prototypes since we no longer have those
functions in kernel-land. Noticed by Jim Rees; OK deraadt@


# 29295d1c 02-Jun-2003 millert <millert@openbsd.org>

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


# c4071fd1 14-Mar-2002 millert <millert@openbsd.org>

First round of __P removal in sys


# a052a096 18-Dec-2000 provos <provos@openbsd.org>

strlcat and strlcpy into libkern.


# 6aca4c3c 16-Jun-2000 millert <millert@openbsd.org>

Pull memcmp() into libkern.


# 8452143d 30-Nov-1997 mickey <mickey@openbsd.org>

missed from last bcd2bin commit


# 34b21645 04-Nov-1997 chuck <chuck@openbsd.org>

add prototype for memchr


12