ray
8e0491f90a
First pass at removing clauses 3 and 4 from NetBSD licenses.
Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.
OK deraadt@
16 years ago
jmc
392400ba76
grammar fixes;
16 years ago
otto
5292ed61a9
remove _MALLOC_LOCK_INIT; major bump; ok deraadt@
16 years ago
landry
592f3fe88a
Add strtof() to libc, some ports seem to like it. Currently it's a simple
call to strtod() with bounding check.
Discussed with pyr@ and otto@
ok otto@ deraadt@
16 years ago
jmc
ef3228a332
fix an Xr, and use a more appropriate macro;
16 years ago
deraadt
badc137d26
arc4random_stir() does not use /dev/arandom anymore, but sysctl kern.arandom
16 years ago
djm
5a2233d09c
fix math screwup that reintroduced a bias for upper_bounds in range
(2^30,2^31). Nothing in the tree yet requests random numbers bounded
by this range.
report jakob!deraadt; ok deraadt@
16 years ago
jmc
c52fe5a85f
kill an Xr to a non-existent man page, ulimit(1);
16 years ago
otto
a8ec3b0eb8
remove recalloc(3); it is buggy and impossible to repair without big
costs; ok jmc@ for the man page bits; ok millert@ deraadt@
16 years ago
djm
d34ab18f72
Use arc4random_buf() when requesting more than a single word of output
Use arc4random_uniform() when the desired random number upper bound
is not a power of two
ok deraadt@ millert@
16 years ago
kurt
2815da0a3f
- do not call pthread_atfork(3) handlers when a multithreaded program
calls vfork(2). "untested, but looks OK" marc@
- document vfork(2), popen(3) and system(3) don't call atfork handlers
in multithreaded programs. okay jmc@
16 years ago
millert
ae51485cf0
Zero state buffers on return. OK deraadt@
16 years ago
ray
df36c8d862
bcmp(3) tries to return length, which is a size_t, as an int.
Instead, just return 1 if there is a difference.
Found by lint.
OK millert.
16 years ago
jmc
8c8d34acf3
- add NAME entries for arc4random_buf and arc4random_uniform
- simplify a macro call (Do/Dc -> Dq)
16 years ago
deraadt
d065788062
Add missing MLINKS
16 years ago
otto
ffe451fa53
diff from djm@ committed at his request:
introduce two new APIs for requesting strong random numbers:
arc4random_buf() - fill an arbitrary memory range with random numbers
arc4random_uniform() - return a uniformly distributed random number
below
a specified upper bound, avoiding the bias that comes from a naive
"arc4random() % upper_bound" construction.
these mirror similarly-named functions in the kernel;
lots of discussion deraadt@ mcbride@
16 years ago
ray
c94408a321
- len is size_t, but n uses len and is an int. Matching those types
should be good, plus it prevents weird things from happening if
len > INT_MAX.
- Since n is now size_t, compare it against 0 instead of >= 0.
- temp is used to store individual bytes, so use char instead
(matches fp and tp).
- millert noted that the comma operator may not guarantee order of
execution, so replace with semicolons.
Found by lint, OK millert.
16 years ago
ray
7e316934cd
Convert c to unsigned char, like it says in the manual. Also add
cast to make it explicit.
Found by lint, OK millert.
16 years ago
otto
412c84799c
use pgfree pool like other code does to reserve free list slots.
prevents a few "cannot free mem because i need mem to free mem"
scenarios (one found by weingart@). ok weingart@ millert@ miod@
16 years ago
art
444fc7d450
The digest in the example seems to have been generated
by code that does not do zero padding. The example code does. Fix.
millert@ ok
16 years ago
kurt
f4c406b83b
- make arc4random*() functions thread safe. Use a custom spinlock function
instead of the generic pthread macros since free(3) uses __arc4_getbyte()
when freeing small sized allocations and the generic pthread macros call
malloc(3).
- eliminate passing pointers to a static variable with global scope (rs)
for additional code clarity and reduction.
- shlib minor bumps for libc and libpthread due to new functions.
From andreas@ with some bits from me. okay tedu@ marc@ w/some spot
checking from millert@
17 years ago
martynas
924f910592
typos; ok jmc@
sys/dev/pci/pciide.c from naddy@
17 years ago
jmc
e4b49a8636
copy in FILES from pw_lock.3 to vipw.8: as nick points out, it should at
least document /etc/ptmp;
while i'm at it, might as well tidy it up and make it consistent across
these pages;
17 years ago
tobias
a1236056e5
Put limits.h in front of stdlib.h as style(9) recommends.
OK millert@
17 years ago
tobias
c9440635f0
strtod may return HUGE_VAL on overflow, which is defined in math.h.
Therefore added math.h to SYNPOSIS.
OK millert@
17 years ago
chl
10f5e46272
Add parentheses to avoid warning:
"suggest parentheses around && within ||"
ok millert@
17 years ago
miod
d178cbce71
Make sure to use unique target names so that make -j does not break;
feedback and ok espie@
17 years ago
pyr
31ac1d57bb
add a RETURN VALUES section.
ok jmc@
17 years ago
jmc
dbae57ca40
add HISTORY; shortened version of diff from Ilya A. Kovalenko
ok millert
17 years ago
deraadt
68e05a5470
comment inside comment
17 years ago
chl
cf0e72fea8
Add missing header to avoid warning
ok millert@ ray@
17 years ago
deraadt
58f16dd9e2
no need to talk about bits; ok millert jmc
17 years ago
millert
6441b2ef99
Update free(3) section--we use mmap()/munmap(), not brk().
Based on a diff from Mike Belopuhov. OK jmc@
17 years ago
jmc
018d78d2bc
remove trailing whitespace;
17 years ago
millert
7726c7baf2
Add __cxa_atexit() support for gcc3. This provides support for shared object destructors called at dlclose() time. Inspired by similar changes in FreeBSD and NetBSD.
17 years ago
millert
63cad49094
add recaloc(3)
17 years ago
millert
f5ac8d80cf
add memrchr(3)
17 years ago
deraadt
93a9caecd5
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
17 years ago
millert
ad911583f0
Clarify the example about avoiding overflow. OK ray@ deraadt@
17 years ago
ray
e35f6842e2
Show how to use strcspn(3) to trim newlines.
OK jmc and millert.
17 years ago
millert
85fcb3d91b
Reference limits.h, not sys/param.h since we document using PATH_MAX
OK otto@
17 years ago
jmc
abd50361c7
from ginsbach@netbsd, -r1.18:
Document that getopt_long(3) can and will accept unique abbreviated long
option names. This feature has been present since getopt_long(3) was first
released in NetBSD 1.5. This is also standard GNU getopt_long(3) behavior.
ok millert
17 years ago
millert
1b911c12d6
Document behavior when no conversion could be performed. Adapted
from FreeBSD. With help from jmc@.
17 years ago
jmc
14302f5699
convert to new .Dd format;
17 years ago
moritz
a7932d616e
Make it clear, that the line returned does not have a
trailing newline in contrast to fgetln(3).
ok ray@ jmc@ millert@
17 years ago
jmc
1ee5d8c8dd
macros at start of line require a `.';
17 years ago
pyr
9755492ad5
Document the lack of error return value in arc4random.
Sync the documentation in getpid with arc4random's format.
17 years ago
millert
92657c3d56
Support for optional args separated with whitespace was removed
some time ago--it caused too many problems.
17 years ago
tedu
95e05a31f0
remove some bogus *p from charles longeau
ok deraadt millert
17 years ago
ray
ba27cbd12b
Get rid of useless #if 0 block, especially since the code is included
immediately after.
OK millert@.
17 years ago