okan
068b7390b9
remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.
ok guenther@
12 years ago
naddy
dc3b42db1e
remove reference to no longer existing description of nonexistent devices;
ok deraadt@ tedu@, wording tweaks jmc@
12 years ago
naddy
2cc386be9a
fix an off-by-one error where the return value would point to the
character after the '\0'; ok guenther@
12 years ago
deraadt
99a773bc80
use PAGE_SHIFT instead of PGSHIFT, in preperation for future
param.h symbol reduction.
ok guenther
12 years ago
guenther
de1260708b
Zap extra spaces from function pointer arguments
Pointed out by Joachim Schipper (joachim at joachimschipper.nl)
12 years ago
guenther
0de5d83a35
Describe tdelete()'s return value correctly and update the related CAVEAT
Based on a note from Steffen Daode Nurpmeso (sdaoden at googlemail.com)
ok jmc@
12 years ago
tedu
d2b5b55b87
after a talk with ariane, use MAP_FIXED for mquery to avoid the cost of
scanning for free space if the hint isn't available.
also, on further inspection, this will prevent pmap_prefer from "improving"
our hint.
12 years ago
matthew
5ba17ff2cc
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
Pointed out by Jorden Verwer on tech@
ok deraadt; no objections from djm or otto
12 years ago
tedu
d8de214e9d
two changes which should improve realloc. first, fix zapcacheregion to
clear out the entire requested area, not just a perfect fit. second,
use mquery to check for room to avoid getting an address we don't like
and having to send it back.
12 years ago
tedu
bd225324bc
two small fixes to free page cache. first, we need two nibbles of random
in order to span the the entire cache. second, on free use the same offset
to put things in the cache instead of always starting at zero.
ok otto
12 years ago
matthew
5294f450b0
Support larger-than-page-alignment requests in posix_memalign() by
overallocating and then releasing unneeded memory pages.
ok otto
12 years ago
guenther
1dcb8b96d7
Update STANDARDS section for a few <stdlib.h> functions
Update SYNOPSIS for setkey() to show it's in <stdlib.h>
ok jmc@, millert@
12 years ago
guenther
085560da45
Improve standards conformance: ecvt(), fcvt(), gcvt(), mktemp(), ttyslot(),
and valloc() are not in the current version, while posix_memalign() mkstemp(),
and mkdtemp() are, and setstate()'s argument has lost a bogus 'const'.
ok millert@ jmc@ espie@ kettenis@; ports build testing by naddy@
12 years ago
matthew
42e1ef3f21
Add strnlen() to libkern.
ok deraadt
12 years ago
deraadt
d00b320411
alloca is NOT machine dependent; it has exactly the same
effective result. its use is NOT discouraged -- it is not
common, but when you need it, there is nothing else that will do.
12 years ago
jmc
dfc0bf8b46
tweak previous;
12 years ago
deraadt
21ec91c765
simplify the strlcpy/strlcat manual page substantially. do less
explaining of "what a C string is", and make it more clear that these
functiosn BEHAVE EXACTLY LIKE snprintf with "%s"! (anyone who wants
to write a 'strlcpy considered harmful' paper should probably write a
'strlcpy and snprintf considered harmful' paper instead).
note to those from other projects reading this commit message: It would
be very good if this new manual was picked up in your project.
ok jmc millert krw
12 years ago
guenther
9e295b8d95
Bump standards years, as we conform to the new versions too
ok jmc@
12 years ago
guenther
9130ff4a31
strsignal() was standardized in POSIX-2008
ok millert@
12 years ago
millert
4f8263876c
Fix a bug where random() always returns 0 when srandom() is seeded
with 0. Use 1 and not 0 as the first element of the state array,
similar to what glibc does. OK nicm@
12 years ago
otto
c5909da5cf
- Test for the retrieved page address not being NULL. This turns free((void*)1)
into an bogus pointer error instead of a segfault.
- Document that we use the assumption that a non-MAP_FIXED mmap() with
hint 0 never returns NULL.
13 years ago
guenther
b9eb8d7d32
Revert previous diff as it resulted in the wrong return code when
the last node is deleted. Instead, resolve the Coverity warning
by returning (node *)1 when you delete the root node.
based an idea from millert@. ok otto@
13 years ago
jmc
12a4b62866
fix SEE ALSO;
13 years ago
guenther
53bd3de409
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
13 years ago
jmc
ba1b360181
grammar;
13 years ago
espie
5f50153fda
this is sparta^WPOSIX 2008
okay millert@
13 years ago
lum
85192fb304
strdup and strndup both use malloc. Make this fact explicit.
ok jmc@
13 years ago
schwarze
1babd3d2a4
Complete the HISTORY of all syscalls that exist since Version 1 AT&T UNIX.
All facts from http://minnie.tuhs.org/cgi-bin/utree.pl , checked by sobrado@.
Feedback and ok jmc@ jmc@ (sic, Jason checked and ok'ed this twice).
13 years ago
otto
7f73468da7
Make struct chunk_info a variable sized struct, wasting less
space for meta data by only allocating space actually needed for
the bitmap (modulo alignment requirements). ok deraadt@
13 years ago
jmc
16f1cecda2
some minor tweaks;
13 years ago
jmc
f30a4c031e
make -column lists pretty again;
specifically, rewrite them to permit some markup in the column headers,
and use "Ta" instead of literal tabs; mandoc does not currently match groff
100%, but a mandoc fix may be some time off, and we've gone enough releases
with poorly formatting column lists.
in some cases i have rewritten the lists as -tag, where -column made
little sense.
13 years ago
jmc
a9a87846de
in column lists, enforce the following ordering:
.Bl -column header1 header2 ... <Bl flags>
mixing things up confuses mandoc, and adding flags in can screw up the list.
this hopefully just makes things a bit safer (and more consistent).
(one more bit of work left and all column lists should format how we want)
13 years ago
jmc
758ce3a339
tweak previous;
13 years ago
schwarze
52886b1c8c
update HISTORY and SEE ALSO for all of string(3), together with various
smaller improvements; jmc@ and nicm@ both ask me to get this in because
further tweaking will be easier in-tree
13 years ago
jmc
5d26e77ff3
occured -> occurred;
13 years ago
miod
3f8c480969
Recent Single Unix will malloc memory if the second argument of realpath()
is NULL, and third-party software is starting to rely upon this.
Adapted from FreeBSD via Jona Joachim (jaj ; hcl-club , .lu), with minor
tweaks from nicm@ and yours truly.
13 years ago
millert
331d605754
Sync wcslcpy and wcslcat with strlcpy and strlcat. OK deraadt@
13 years ago
otto
10c1e27ddb
Show (in the example) that < and > can be used multiple times; ok jmc@
jasper@
13 years ago
jasper
32dcb18e53
- add a MALLOC_OPTIONS section header. the content is already there, but having
a section will help people looking for just the MALLOC_OPTIONS.
ok otto@ jmc@
13 years ago
otto
d6855c0895
on malloc flag S, set cache size to 0; will catch even more
use-after-free bugs; ok krw@ dlg@ pirofti@
13 years ago
nicm
7eb859116b
Minor function name tweaks.
13 years ago
nicm
fbd15bedaa
Instead of documenting all the wide string functions in wmemchr(3), add
individual pages (based on the existing string man pages). By Tim van
der Molen (tbvdm at xs4all dot nl) after a suggestion by millert@.
ok deraadt
13 years ago
nicm
73506d1ba1
After a certain amount of fighting with the mbstowcs API, remove L from
the wcsdup example.
ok stsp
13 years ago
jmc
fef4fd0bd9
no more math(3);
13 years ago
nicm
0cded3a64f
Fix some awful code in the example, pointed out by millert@.
13 years ago
nicm
69ccac0496
Add wcsdup(), from NetBSD.
ok deraadt matthew
13 years ago
tedu
d874c625f1
as man page states, lower case undoes upper case. add support for little s,
no security, for consistency. use of this option is discouraged. :)
ok deraadt guenther millert
13 years ago
naddy
eea0705fca
fix wcscasecmp() parameters; <wchar.h> was correct
13 years ago
jmc
091afd940e
tweak previous (my fault);
13 years ago
espie
7b1036f191
wcs(n)casecmp support, manpage comments from jmc@, okay deraadt@
13 years ago