Home | History | Annotate | only in /src/common/lib/libc/stdlib
History log of /src/common/lib/libc/stdlib
RevisionDateAuthorComments
 1.5 24-Jul-2024  kre PR lib/58461 PR lib/58453 portability fixes

Revert previous (1.4) and make the changes properly.

If base is invalid, what gets left in *endptr by strtoimax()
is unspecified (it is not guaranteed to be either nptr or unaltered)
and so cannot (in that case) be used in any way at all.

Since it is hard to determine from some implementations of
strtoimax() whether this happened or not, simply duplicate
the validity test for base here, so we know that error (EINVAL
because base is invalid) cannot occur from strtoimax(). In that
case, if we get an EINVAL from strtoimax we can simply ignore it,
as all it can mean is the (optional in POSIX) case where no
conversion occurred (where strtoi() sets the status to ECANCELED).

Since NetBSD never did that, this all changes nothing here, but
makes strtoi() portable to other environments using a different
version of strtoimax().

NFCI.

No pullups required, nothing has really changed, there never was
a NetBSD bug to fix.
 1.4 21-Jul-2024  christos POSIX allows systems that report EINVAL when no digits are found. On
such systems the only way to differentiate EINVAL and ECANCELED is to
initialized the end pointer to NULL before the call. On EINVAL cases,
strto*max(3) will leave the pointer unmodified, so we'll read back the
original NULL. On ECANCELED cases, strto*max(3) will set it to nptr.
This also prevents UB read of endptr on an unsupported base argument.
(Alejandro Colomar)
 1.3 20-Jan-2024  christos branches: 1.3.2;
PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)
 1.2 18-Jan-2015  christos branches: 1.2.2; 1.2.18; 1.2.20; 1.2.32;
match variable names with man page (Kamil Rytarowski)
 1.1 16-Jan-2015  christos add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
 1.2.32.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #792):

common/lib/libc/stdlib/_strtoi.h: revision 1.3
lib/libc/stdlib/strtou.3: revision 1.8
lib/libc/stdlib/strtonum.c: revision 1.7
lib/libc/stdlib/Makefile.inc: revision 1.97
lib/libc/stdlib/strtoi.3: revision 1.8
lib/libc/stdlib/strtoi.3: revision 1.9
lib/libc/stdlib/strtou.3: file removal
tests/lib/libc/stdlib/t_strtoi.c: revision 1.3

PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)

generate strtou.3 from strtoi.3, grammar police

Add range tests with trailing characters.
 1.2.20.1 23-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1870):

common/lib/libc/stdlib/_strtoi.h: revision 1.3
lib/libc/stdlib/strtou.3: revision 1.8
lib/libc/stdlib/strtonum.c: revision 1.7
lib/libc/stdlib/Makefile.inc: revision 1.97
lib/libc/stdlib/strtoi.3: revision 1.8
lib/libc/stdlib/strtoi.3: revision 1.9
lib/libc/stdlib/strtou.3: file removal
tests/lib/libc/stdlib/t_strtoi.c: revision 1.3

PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)
generate strtou.3 from strtoi.3, grammar police

Add range tests with trailing characters.
 1.2.18.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.18.1 21-Apr-2020  martin Sync with HEAD
 1.2.2.2 22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.2.2.1 18-Jan-2015  snj file _strtoi.h was added on branch netbsd-7 on 2015-04-22 07:18:57 +0000
 1.3.2.1 02-Aug-2025  perseant Sync with HEAD
 1.11 06-Jul-2017  joerg branches: 1.11.6;
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.10 13-Nov-2015  christos branches: 1.10.8;
comment out 0{b,B} handling.
 1.9 12-Nov-2015  christos Fix capitalization
 1.8 12-Nov-2015  christos Recognize 0[bB] as binary (base 2)
 1.7 17-May-2013  joerg branches: 1.7.6;
Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.6 26-Apr-2013  joerg Restore standalone strtol/strtoul for citrus for now.
 1.5 16-Apr-2013  joerg Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.4 16-Apr-2013  joerg Do not use isalpha here, since we explicitly only support the Portable
Character Set as base and in theory a locale could define a ASCII
control character as letter, resulting in negations. Also avoid isdigit
here to give the compiler a better chance of deciding whether an
unsigned compare or a jump table is a better option, both are very
likely better choices than the memory indirection.
 1.3 09-Mar-2012  christos branches: 1.3.2;
Casts and type changes to fix portability issues.
- int -> size_t
- adjust width of RHS of shift
- adjust widths of types
 1.2 20-May-2009  christos branches: 1.2.6; 1.2.8;
Set endptr if the base is not supported. The opengroup spec does not special
case this condition. Note: glibc has the same problem.
 1.1 20-Aug-2008  joerg branches: 1.1.2; 1.1.8;
Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.1.8.1 23-Jul-2009  jym Sync with HEAD.
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 20-Aug-2008  wrstuden file _strtol.h was added on branch wrstuden-revivesa on 2008-09-18 04:54:18 +0000
 1.2.8.1 26-Aug-2017  snj Pull up following revision(s) (requested by joerg in ticket #1460):
common/lib/libc/stdlib/_strtol.h: 1.11 via patch
common/lib/libc/stdlib/_strtoul.h: 1.11 via patch
tests/lib/libc/stdlib/t_strtol.c: 1.6-1.7
Fix testing of returned entptr, and fix three affected tests.
From kamil@ via PR lib/49632
--
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.2.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.6.1 17-Apr-2012  yamt sync with head
 1.3.2.1 23-Jun-2013  tls resync from head
 1.7.6.1 17-Nov-2017  snj Pull up following revision(s) (requested by joerg in ticket #1448):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.10.8.1 10-Jul-2017  martin Pull up following revision(s) (requested by joerg in ticket #112):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.11.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.11.6.1 21-Apr-2020  martin Sync with HEAD
 1.11 06-Jul-2017  joerg branches: 1.11.6;
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.10 05-Nov-2016  riastradh branches: 1.10.6;
Set *endptr in all paths out of strtoul and family.

XXX pullup-6
XXX pullup-7
 1.9 13-Nov-2015  christos branches: 1.9.2;
comment out 0{b,B} handling.
 1.8 12-Nov-2015  christos Recognize 0[bB] as binary (base 2)
 1.7 17-May-2013  joerg branches: 1.7.6; 1.7.8; 1.7.10;
Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.6 26-Apr-2013  joerg Restore standalone strtol/strtoul for citrus for now.
 1.5 16-Apr-2013  joerg Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.4 16-Apr-2013  joerg Do not use isalpha here, since we explicitly only support the Portable
Character Set as base and in theory a locale could define a ASCII
control character as letter, resulting in negations. Also avoid isdigit
here to give the compiler a better chance of deciding whether an
unsigned compare or a jump table is a better option, both are very
likely better choices than the memory indirection.
 1.3 22-Mar-2012  christos branches: 1.3.2;
bring the casts to the operands, not the operation results.
 1.2 09-Mar-2012  christos Casts and type changes to fix portability issues.
- int -> size_t
- adjust width of RHS of shift
- adjust widths of types
 1.1 20-Aug-2008  joerg branches: 1.1.2; 1.1.4; 1.1.22; 1.1.26; 1.1.30;
Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.1.30.1 11-Jul-2017  snj Pull up following revision(s) (requested by riastradh in ticket #1421):
common/lib/libc/stdlib/_strtoul.h: revision 1.10
Set *endptr in all paths out of strtoul and family.
 1.1.26.1 11-Jul-2017  snj Pull up following revision(s) (requested by riastradh in ticket #1421):
common/lib/libc/stdlib/_strtoul.h: revision 1.10
Set *endptr in all paths out of strtoul and family.
 1.1.22.2 26-Aug-2017  snj Pull up following revision(s) (requested by joerg in ticket #1460):
common/lib/libc/stdlib/_strtol.h: 1.11 via patch
common/lib/libc/stdlib/_strtoul.h: 1.11 via patch
tests/lib/libc/stdlib/t_strtol.c: 1.6-1.7
Fix testing of returned entptr, and fix three affected tests.
From kamil@ via PR lib/49632
--
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.1.22.1 11-Jul-2017  snj Pull up following revision(s) (requested by riastradh in ticket #1421):
common/lib/libc/stdlib/_strtoul.h: revision 1.10
Set *endptr in all paths out of strtoul and family.
 1.1.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.1 17-Apr-2012  yamt sync with head
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 20-Aug-2008  wrstuden file _strtoul.h was added on branch wrstuden-revivesa on 2008-09-18 04:54:18 +0000
 1.3.2.1 23-Jun-2013  tls resync from head
 1.7.10.1 18-Jan-2017  skrll Sync with netbsd-5
 1.7.8.1 20-Dec-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1310):
common/lib/libc/stdlib/_strtoul.h: revision 1.10
Set *endptr in all paths out of strtoul and family.
 1.7.6.2 17-Nov-2017  snj Pull up following revision(s) (requested by joerg in ticket #1448):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.7.6.1 18-Dec-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1310):
common/lib/libc/stdlib/_strtoul.h: revision 1.10
Set *endptr in all paths out of strtoul and family.
XXX pullup-6
XXX pullup-7
 1.9.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.10.6.1 10-Jul-2017  martin Pull up following revision(s) (requested by joerg in ticket #112):
common/lib/libc/stdlib/_strtol.h: revision 1.11
common/lib/libc/stdlib/_strtoul.h: revision 1.11
tests/lib/libc/stdlib/t_strtol.c: revision 1.7
Fix ISO C compliance: strtol of "0xX" should give the largest valid
numeric prefix, which is 0.
 1.11.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.11.6.1 21-Apr-2020  martin Sync with HEAD
 1.2 29-Jun-2024  rin getopt(): Make this built for _KERNEL || _STANDALONE

NFC as a libc routine.
 1.1 29-Jun-2024  rin getopt.c: Migrate from lib/libc/stdlib to common/lib/libc/stdlib
 1.4 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.3 17-Nov-2008  jnemeth branches: 1.3.50; 1.3.70;
oops, converted some #ifndef into #if defined...
 1.2 17-Nov-2008  jnemeth Convert all #ifdef _KERNEL to #if defined (_KERNEL) || defined(_STANDALONE)
from Bernd Ernesti on source-changes@. This fixes a build breakage
with i386/amd64 bootblocks.
 1.1 16-Nov-2008  ad Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
 1.3.70.1 02-Aug-2025  perseant Sync with HEAD
 1.3.50.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.3.50.1 21-Apr-2020  martin Sync with HEAD
 1.1 11-Dec-2013  joerg branches: 1.1.4; 1.1.8; 1.1.30;
Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
 1.1.30.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.1.30.1 21-Apr-2020  martin Sync with HEAD
 1.1.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.1 11-Dec-2013  tls file mi_vector_hash.c was added on branch tls-maxphys on 2014-08-19 23:45:14 +0000
 1.1.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.1 11-Dec-2013  yamt file mi_vector_hash.c was added on branch yamt-pagecache on 2014-05-22 11:26:30 +0000
 1.2 16-Nov-2008  ad Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
 1.1 16-Nov-2008  ad Make qsort() available in libkern.
 1.7 12-Dec-2021  andvar fix various typos in comments.
 1.6 22-Feb-2020  fox common/lib/libc/stdlib: Fix possible signed integer overflow.

common/lib/libc/stdlib/random.c:482:6 can result in signed integer overflow.

This bug was reported by UBSan runs.

The change has been tested using the following program to generate random numbers
in both the old and the new library and can be used to verify the correctness of the
library after the change.

#include <stdio.h>
#include <stdlib.h>

#define COUNT 1000 * 1000

int
main(void)
{
int i;
FILE *fp = fopen("numbers.txt", "w");

srandom(0xdeadbeef);

for(i = 0; i < COUNT; i++) {
fprintf(fp, "%ld\n", random());
}

fclose(fp);

return 0;
}

Reviewed by: riastradh@ , kamil@
 1.5 08-Feb-2016  dholland branches: 1.5.16; 1.5.20;
whitespace
 1.4 12-Jun-2014  christos update for the new function signatures of initstate/srandom
 1.3 21-Dec-2005  christos branches: 1.3.56; 1.3.70;
Add the old small random from the libkern and use it for now.
 1.2 21-Dec-2005  christos Make this compile for the kernel again.
 1.1 20-Dec-2005  christos Merge libkern + libc common files. As requested by core.
 1.3.70.1 10-Aug-2014  tls Rebase.
 1.3.56.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.20.1 29-Feb-2020  ad Sync with head.
 1.5.16.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.16.2 21-Apr-2020  martin Sync with HEAD
 1.5.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 28-Nov-2019  roy Make it easier to use strtoi and strtou in downsteam applications
without the need to define HAVE_NBTOOL_CONFIG_H and yet allow -Wundef
not to log any warnings.
 1.2 01-May-2015  christos branches: 1.2.16;
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
 1.1 16-Jan-2015  christos branches: 1.1.2;
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
 1.1.2.3 16-May-2015  snj Pull up following revision(s) (requested by christos in ticket #781):
common/lib/libc/stdlib/strtoi.c: revision 1.2
common/lib/libc/stdlib/strtou.c: revision 1.2
distrib/sets/lists/debug/mi: revision 1.113
distrib/sets/lists/tests/mi: revision 1.617
lib/libc/include/namespace.h: revision 1.178
lib/libc/stdlib/Makefile.inc: revision 1.90 via patch
lib/libc/stdlib/strtoi.3: revisions 1.1, 1.2
lib/libc/stdlib/strtol.3: revision 1.32
lib/libc/stdlib/strtou.3: revisions 1.1, 1.2
lib/libc/stdlib/strtoul.3: revisions 1.30, 1.31
tests/lib/libc/stdlib/Makefile: revision 1.25
tests/lib/libc/stdlib/t_strtoi.c: revision 1.1
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
--
Sort ERRORS and SEE ALSO.
--
Sort ERRORS and SEE ALSO.
--
Sort SEE ALSO.
 1.1.2.2 22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.1.2.1 16-Jan-2015  snj file strtoi.c was added on branch netbsd-7 on 2015-04-22 07:18:57 +0000
 1.2.16.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.16.2 21-Apr-2020  martin Sync with HEAD
 1.2.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.2 02-Dec-2013  joerg branches: 1.2.4; 1.2.8; 1.2.30;
Fix aliases.
 1.1 02-Dec-2013  lneto changed lua_Number to int64_t
 1.2.30.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.30.1 21-Apr-2020  martin Sync with HEAD
 1.2.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 02-Dec-2013  tls file strtoimax.c was added on branch tls-maxphys on 2014-08-19 23:45:14 +0000
 1.2.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.4.1 02-Dec-2013  yamt file strtoimax.c was added on branch yamt-pagecache on 2014-05-22 11:26:30 +0000
 1.7 16-Apr-2013  joerg branches: 1.7.30;
Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.6 22-Aug-2008  matt branches: 1.6.2; 1.6.24;
Properly deal with LIBC namespace issues.
 1.5 22-Aug-2008  dogcow Unbork cross-builds in tools/compat/
 1.4 20-Aug-2008  oster Fix build breakage by adding appropriate #includes.
Patch from joerg@
 1.3 20-Aug-2008  joerg Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.2 18-Dec-2006  christos branches: 1.2.18;
remove bogus (void)&var; from Anon Ymous
 1.1 08-Oct-2006  thorpej branches: 1.1.2;
- Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.1.2.2 08-Oct-2006  thorpej - Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.1.2.1 08-Oct-2006  thorpej file strtoll.c was added on branch newlock2 on 2006-10-08 03:14:56 +0000
 1.2.18.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.24.1 23-Jun-2013  tls resync from head
 1.6.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.30.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.30.1 21-Apr-2020  martin Sync with HEAD
 1.3 28-Nov-2019  roy Make it easier to use strtoi and strtou in downsteam applications
without the need to define HAVE_NBTOOL_CONFIG_H and yet allow -Wundef
not to log any warnings.
 1.2 01-May-2015  christos branches: 1.2.16;
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
 1.1 16-Jan-2015  christos branches: 1.1.2;
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
 1.1.2.3 16-May-2015  snj Pull up following revision(s) (requested by christos in ticket #781):
common/lib/libc/stdlib/strtoi.c: revision 1.2
common/lib/libc/stdlib/strtou.c: revision 1.2
distrib/sets/lists/debug/mi: revision 1.113
distrib/sets/lists/tests/mi: revision 1.617
lib/libc/include/namespace.h: revision 1.178
lib/libc/stdlib/Makefile.inc: revision 1.90 via patch
lib/libc/stdlib/strtoi.3: revisions 1.1, 1.2
lib/libc/stdlib/strtol.3: revision 1.32
lib/libc/stdlib/strtou.3: revisions 1.1, 1.2
lib/libc/stdlib/strtoul.3: revisions 1.30, 1.31
tests/lib/libc/stdlib/Makefile: revision 1.25
tests/lib/libc/stdlib/t_strtoi.c: revision 1.1
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
--
Sort ERRORS and SEE ALSO.
--
Sort ERRORS and SEE ALSO.
--
Sort SEE ALSO.
 1.1.2.2 22-Apr-2015  snj Pull up following revision(s) (requested by roy in ticket #648):
common/lib/libc/stdlib/_strtoi.h: revisions 1.1, 1.2
common/lib/libc/stdlib/strtoi.c: revision 1.1
common/lib/libc/stdlib/strtou.c: revision 1.1
distrib/sets/lists/base/ad.aarch64: patch
distrib/sets/lists/base/ad.arm: patch
distrib/sets/lists/base/ad.mips: patch
distrib/sets/lists/base/ad.powerpc: patch
distrib/sets/lists/base/md.amd64: patch
distrib/sets/lists/base/md.sparc64: patch
distrib/sets/lists/base/shl.mi: patch
distrib/sets/lists/comp/mi: revision 1.1939
distrib/sets/lists/debug/ad.aarch64: patch
distrib/sets/lists/debug/ad.arm: patch
distrib/sets/lists/debug/ad.mips: patch
distrib/sets/lists/debug/ad.powerpc: patch
distrib/sets/lists/debug/md.amd64: patch
distrib/sets/lists/debug/md.sparc64: patch
distrib/sets/lists/debug/shl.mi: patch
include/inttypes.h: revision 1.11
lib/libc/shlib_version: patch
lib/libc/stdlib/Makefile.inc: revision 1.84
lib/libc/stdlib/strtol.3: revisions 1.27-1.31
lib/libc/stdlib/strtoul.3: revisions 1.26-1.29
sys/lib/libkern/Makefile.libkern: revision 1.37
sys/lib/libkern/libkern.h: revision 1.117
tools/compat/Makefile: revision 1.73
tools/compat/compat_defs.h: revision 1.101
tools/compat/configure.ac: revision 1.83
tools/compat/configure: revision 1.82
tools/compat/nbtool_config.h.in: revision 1.36
add strto{i,u} from Kamil Rytarowski as discussed in tech-userlevel.
--
strtoi and strtou additions
--
strtoi and strtou for the kernel
--
strtoi and strtou additions
--
strtoi and strtou man pages
--
strto{i,u}
--
regen
--
Remove trailing whitespace.
--
match variable names with man page (Kamil Rytarowski)
--
cleanups from (Kamil Rytarowski)
--
add strtoi strtou (Kamil Rytarowski)
--
PR/49640: Kamil Rytarowski: Improve error printing
--
Use existing month for Dd.
 1.1.2.1 16-Jan-2015  snj file strtou.c was added on branch netbsd-7 on 2015-04-22 07:18:57 +0000
 1.2.16.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.16.2 21-Apr-2020  martin Sync with HEAD
 1.2.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.3 20-Aug-2008  oster branches: 1.3.62;
Fix build breakage by adding appropriate #includes.
Patch from joerg@
 1.2 20-Aug-2008  joerg Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.1 20-Dec-2005  christos branches: 1.1.28;
Merge libkern + libc common files. As requested by core.
 1.1.28.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.62.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.3.62.1 21-Apr-2020  martin Sync with HEAD
 1.6 16-Apr-2013  joerg branches: 1.6.30;
Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.5 10-Sep-2008  joerg branches: 1.5.2; 1.5.24;
Prepare use of strtoull, strtoumax and strtoimax in tools/compat by
including nbtool_config.h.
 1.4 22-Aug-2008  matt Properly deal with LIBC namespace issues.
 1.3 20-Aug-2008  oster Fix build breakage by adding appropriate #includes.
Patch from joerg@
 1.2 20-Aug-2008  joerg Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.1 08-Oct-2006  thorpej branches: 1.1.2; 1.1.26;
- Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.1.26.2 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.1.26.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.2 08-Oct-2006  thorpej - Move strtoll.c and strtoull.c from libc/stdlib to common/libc/stdlib.
- Add strtoll.c and strtoull.c to libkern.
 1.1.2.1 08-Oct-2006  thorpej file strtoull.c was added on branch newlock2 on 2006-10-08 03:14:56 +0000
 1.5.24.1 23-Jun-2013  tls resync from head
 1.5.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.30.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.6.30.1 21-Apr-2020  martin Sync with HEAD
 1.6 16-Apr-2013  joerg branches: 1.6.30;
Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.5 10-Sep-2008  joerg branches: 1.5.2; 1.5.24;
Prepare use of strtoull, strtoumax and strtoimax in tools/compat by
including nbtool_config.h.
 1.4 22-Aug-2008  matt Properly deal with LIBC namespace issues.
 1.3 20-Aug-2008  oster Fix build breakage by adding appropriate #includes.
Patch from joerg@
 1.2 20-Aug-2008  joerg Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
 1.1 22-Apr-2006  thorpej branches: 1.1.28;
Move strtoumax.c from libc/stdlib to common/libc/stdlib and include it
in libkern. Required for new code coming soon.
 1.1.28.2 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.1.28.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.24.1 23-Jun-2013  tls resync from head
 1.5.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.30.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.6.30.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed