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
jsing
4a0a502bf4
Do not mask errno if we fail to open /dev/diskmap. Also, fall through
rather than returning so that realname still gets assigned.
ok millert@ deraadt@ thib@
13 years ago
sthen
ec4391eaa9
s/ands/and/, from Tobias Ulmer
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
otto
be0afe8548
save errno dance in wrterror() and malloc_dump(); prompted by and ok deraadt@
13 years ago
otto
535636b5df
introduce symbolic constant for initial number of regions
13 years ago
otto
01b4849121
zap regions_bits and rework MALLOC_MAXSHIFT a bit; ok djm@
13 years ago
otto
6ebcec8c72
Avoid fp computations for stats, this make calling malloc_dump() safe in more
cases.
13 years ago
otto
86e4380bcc
fix comment, the bitmap is an array of u_short now
13 years ago
otto
fc442e2a61
Introduce leak detection code for MALLOC_STATS
13 years ago
otto
e726d97c87
Move MALLOC_STATS code to bottom of file, so the real stuff is more at the top.
13 years ago
otto
0ec9d0391a
Up until now, malloc scanned the bits of the chunk bitmap from
position zero, skipping a random number of free slots and then
picking the next free one. This slowed things down, especially if
the number of full slots increases.
This changes the scannning to start at a random position in the
bitmap and then taking the first available free slot, wrapping if
the end of the bitmap is reached. Of course we'll still scan more
if the bitmap becomes more full, but the extra iterations skipping
free slots and then some full slots are avoided.
The random number is derived from a global, which is incremented
by a few random bits every time a chunk is needed (with a small optimization
if only one free slot is left).
Thanks to the testers!
13 years ago
otto
fe5a32734e
Now that we use an array of u_short for the chunk bitmap change a few
1UL to 1U.
13 years ago
otto
dcc6e6f049
More efficient scanning for free chunks while not losing any randomization;
thanks to all testers.
13 years ago
otto
9679bf7a9f
Tweak the description of the optional parts around =. Found this in my
tree, no idea where it came from; ok millert@ jmc@
13 years ago
stsp
4ddc8c789a
Add a wcswidth man page (based on FreeBSD), and fix the implementation
to return -1 in case of an unprintable character.
ok nicm jmc
13 years ago
espie
9766982215
tweak for clarity, ok millert@, jmc@
13 years ago
deraadt
563890ecd9
wrong type for variable; spotted by christian.siebert@cs.tu-chemnitz.de
ok guenther
14 years ago
guenther
48c37b4271
Fix PR 6267: recheck POSIXLY_CORRECT each time getopt_long() starts a new
argv and don't suppress the handling of leading '-' in optstring when
POSIXLY_CORRECT is set.
Based on patch from Eric Blake.
ok and manpage update from millert@, manpage ok jmc@
14 years ago