1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 23:35:36 -08:00
Commit Graph

34 Commits

Author SHA1 Message Date
guenther
4af81b37ce The improbable occurred: strlcpy(3) and strlcat(3) are in POSIX-2024.
memmem(3) was also added.  Update #include visibility and manpages
and add restrict qualifiers.

"never thought I'd see this day" millert@
2024-08-03 20:13:23 +00:00
otto
bc8a30fccf strmode takes a mode_t, not an int; prompted by Collin Funk.
ok kettenis@ deraadt@ tb@
2024-06-23 07:08:26 +00:00
schwarze
3a628b46e7 New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.

With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
2017-09-05 03:16:13 +00:00
millert
6ecde746de Move the 10 (!) defintions of NULL to their own mini header file and
update the NULL definition for C++11.  OK deraadt@ guenther@ kettenis@
2016-09-09 18:12:37 +00:00
millert
e7fbb21cb1 POSIX says that ffs(), strcasecmp(), strncasecmp(), r?index() and
the b* byte functions belong in strings.h, not string.h so break
them out of string.h into a new strings.h.  As long as there is no
POSIX or X/OPEN define in use string.h will pull in strings.h.
OK naddy@ deraadt@
2015-11-20 23:40:32 +00:00
guenther
8cf7d58c8a Delete duplicate conditional
diff from frantisek holop (minusf (at) obiit.org)
2014-08-10 02:49:24 +00:00
matthew
abf4a3ad42 Add timingsafe_memcmp().
ok deraadt, jmc, tedu
2014-06-13 02:12:17 +00:00
tedu
2fa321beb4 add explicit_bzero to libc. implementation subject to change, but start
the ball rolling. ok deraadt.
2014-01-22 21:06:45 +00:00
ajacoutot
2eb94c6c34 Add an implementation of memmem() -- from FreeBSD with some tweaks.
Requires a libc minor bump, committing now so that we have up-to-date
snapshots for the upcoming hackathon.

joint work with millert@
man page bits ok jmc@
input and ok millert@, guenther@, deraadt@
2013-05-13 10:37:02 +00:00
guenther
82d303adbd Add 'restrict' per POSIX, per prodding by tedu@. (Might permit more warnings?)
Tweak standards exposure of memchr (never) and strdup (POSIX-2008)
Remove unnecessary tests of __BSD_VISIBLE

ok millert@
2013-04-11 03:08:47 +00:00
guenther
1ef6a089d2 strsignal() was added to POSIX-2008; strerror_r() was in the base
of POSIX-2001, without the XSI qualifier.  Adjust conditionals to match.

ok millert@
2012-03-25 20:04:18 +00:00
guenther
4f2939c2f9 Add stpcpy() and stpncpy(), pointless crap that made it into POSIX.
Includes friendly linker warning to wake up those dumb enough to use it.

Committing for kettenis@, who ran away to the hills after writing it
2012-01-17 02:48:01 +00:00
jsg
c4ff7bee63 As pointed out by Richard Guenther our definition
of NULL was incorrect for c++ compilers that aren't
gcc (or pretend to be gcc like clang).

ok miod@
2011-07-03 18:51:01 +00:00
miod
0c2a5da7f0 Define NULL as a void * instead of a long integer, as required by Single Unix.
Kernel and bootblocks still use the old 0L value until all the NULL abuses
in the code are fixed.
2011-04-06 11:39:42 +00:00
matthew
03cd71ad9d Add timingsafe_bcmp(3) to libc, mention that it's already in the
kernel in kern(9), and remove it from OpenSSH.

ok deraadt@, djm@
2010-09-24 13:33:00 +00:00
tedu
243f393511 add posix_madvise, posix_memalign, strndup, and strnlen. mostly from
brad and millert, with hints from guenther, jmc, and otto I think.
ok previous.
2010-05-18 22:24:54 +00:00
millert
6d0ae6a4bc add memrchr(3) 2007-09-03 14:36:40 +00:00
millert
c916d9484c Adapt things to use __type_t instead of _BSD_TYPE_T_
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
2006-01-06 18:53:04 +00:00
millert
52a0e6034e First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE.  Also fix several namespace
pollution issues, including the byte order defines.  OK deraadt@
2005-12-13 00:35:22 +00:00
deraadt
e31daa1591 strcasestr(3), a case-insensitive version of strstr(3). already in netbsd
and freebsd, apparently written by torek, the man we never see anymore;
submitted by jcs, but he is not around right now for the libc major crank
so i sneak it in for him
2005-03-30 03:04:16 +00:00
avsm
0208a84f6f add bounds check for src pointer in bcopy(3) as well as dest pointer,
noticed by millert@
2004-06-20 17:47:07 +00:00
avsm
89b95c1c6c add __bounded__ attributes for userland headers; enabled with -Wbounded
ok deraadt@
2003-08-01 17:38:33 +00:00
avsm
3e87668a71 backout the __bounded__ attributes for a while; requested by deraadt@ 2003-06-26 19:34:17 +00:00
avsm
585be00bb5 Mark various standard library functions with the __bounded__ attribute.
You must have an up-to-date gcc for this!
deraadt@ ok
2003-06-26 18:35:13 +00:00
millert
e33d3bd3b8 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-02 19:34:12 +00:00
marc
da0518e2e7 add prototype for strerror_r 2002-11-21 20:42:39 +00:00
millert
8248c2b451 NULL is now 0L so it is the same size as a pointer.
OK mickey@ and discussed with deraadt@
2002-10-25 21:55:28 +00:00
millert
c72b5b24e1 Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically. 2002-02-16 21:27:05 +00:00
espie
ad7ac144d1 Be thorough about NULL as __null for C++. 1999-09-17 13:13:46 +00:00
d
92efb73507 Add thread-safety to libc, so that libc_r will build (on i386 at least).
All POSIX libc api now there (to P1003.1c/D10)
  (more md stuff is needed for other libc/arch/*)
  (setlogin is no longer a special syscall)
Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS).
Doc some re-entrant routines
Add libc_r to intro(3)
dig() uses some libc srcs and an extra -I was needed there.
Add more md stuff to libc_r.
Update includes for the pthreads api
Update libc_r TODO
1998-11-20 11:18:22 +00:00
millert
60b9f01daf protos for strlcat, strlcpy 1998-11-04 19:35:48 +00:00
deraadt
c1f33f9635 move proto to unistd.h 1998-02-10 02:19:46 +00:00
niklas
5ea2d675e0 Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now.  Added openBSD tags.
1997-09-21 10:45:23 +00:00
deraadt
df930be708 initial import of NetBSD tree 1995-10-18 08:37:01 +00:00