guenther
e724eb6002
Only two of the *rand48.c files need <math.h>, so just #include it in them
9 years ago
schwarze
59ebc4a004
use .Va for global variables, and .Vt where the type is included
9 years ago
guenther
8924f66047
Remove cast of int* to int*
9 years ago
guenther
ec1a04d68c
For now, permit overriding of the malloc family, to make emacs happy
9 years ago
guenther
08d5782520
Wrap <pwd.h> so that calls go direct and the symbols are all weak.
Hide bcrypt_autorounds(), prefixing with an underbar for static builds.
9 years ago
guenther
1fc79c3ad9
Overshot w/PROTO_DEPRECATED: seed48_deterministic() is used internally
9 years ago
millert
adeece9d95
The number of rounds is just two digits in the salt. We've already
verified that they are there via isdigit() so we can convert from
ASCII to an int without using atoi(). OK guenther@ deraadt@
9 years ago
guenther
c8272cfe98
Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak.
Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the
arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
9 years ago
guenther
0228ab119c
__strsignal() is now declared in hidden/signal.h
9 years ago
guenther
82b9f1a0d5
Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go direct
and the symbols not in the C standard are weak
9 years ago
guenther
c9c56d2879
Wrap <unistd.h> so that internal calls go direct and they're all weak symbols
Delete unused 'fd' argument from internal function oldttyname()
9 years ago
guenther
2682fe544f
Wrap <getopt.h> to make the functions weak and make access to the initialized
variables go direct. (Common variables cannot be aliased.)
9 years ago
guenther
c34714da97
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
ok deraadt@
9 years ago
bcook
2c1adf355f
Add support for building arc4random with MSVC.
By default, MSVC's stdlib.h defines min(), so we need to spell out something
less common to avoid picking it up.
ok deraadt@ beck@ miod@
9 years ago
guenther
02ef5130b7
Pull in namespace.h when building all .c files using gcc's -include option,
so that we can provide asm labels for the memcpy/memset/__stack_smash_handler
calls that it generates ab initio. Eliminate direct #includes of it. Make
sure it's a dependency of all objects (unnecessary for asm, but close enough).
ok deraadt@
9 years ago
schwarze
a9afc2531c
reduce .Nd to one line and kill .Tn while here
9 years ago
schwarze
b0143d710b
missing commas at the end of .Nm lines in the NAME section
9 years ago
guenther
4f5bcc4530
Fix aliasing of sys_errlist, sys_nerr, sys_siglist, and sys_signame
to eliminate duplicate copies of the tables and get direct access internally
ok kettenis@ deraadt@
9 years ago
guenther
6c7e0ac243
Use new framework for wrapping cat{open,gets,close}(), eliminating
_cat* in the process.
ok kettenis@
9 years ago
guenther
3e2a03de0a
Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and
not be overridable or use the PLT. Then, apply that framework to most of
the functions in stdio.h, string.h, err.h, and wchar.h. Delete the
should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here.
tests clean on i386, amd64, sparc64, powerpc, and mips64
naming feedback from kettenis@ and millert@
ok kettenis@
9 years ago
guenther
8858b239f2
Move the __rand48_* declarations into rand48.h, and then hide both them
and __dorand48() and __rand48_deterministic
ok deraadt@
9 years ago
deraadt
70232307a6
All these files include <stdlib.h>, so do not need to cast
malloc/calloc/realloc* returns.
9 years ago
tedu
a295a8a9de
call it bcrypt in the man page too
9 years ago
tedu
1b0313eadb
permit "bcrypt" as an alias for "blowfish". this is, after all, what
99% of the world calls it.
allow just "bcrypt" without params to mean auto-tune ("bcrypt,a").
default remains 8 rounds (for now)
ok deraadt
9 years ago
jeremy
a0ab23b345
Unbreak, add errno header
OK tedu@
9 years ago
tedu
8cf39d5a4a
set errno in null cases, just in case.
9 years ago
tedu
ece73ab6e1
standards compliant error return (null). will make ruby happier, at least.
ok deraadt jeremy
9 years ago
millert
7b99cfa53d
Just return if nmemb is 0. Avoids a NULL dereference and is
consistent with the behavior of the other libc sort functions.
OK deraadt@
9 years ago
millert
482e9aac5b
Remove needless casts. There's no reason to cast delim to char *
when we can just make spanp const char * to match it. OK deraadt@
9 years ago
millert
4ab11614ee
Make index/rindex weak aliases of strchr/strrchr since they are not
part of the ISO C standard and have also been dropped from POSIX.
OK guenther@ kettenis@
9 years ago
bluhm
4498258510
If crypt(3) is called with an unknown setting, return NULL instead
of some undefined value.
OK tedu@
9 years ago
guenther
69ecb65582
Add dlclose(3) to SEE ALSO
ok millert@ jmc@ schwarze@
9 years ago
guenther
726c811e97
When checking flags that will be passed to open(), test the O_ACCMODE portion
separately to avoid false negatives.
ok miod@ millert@
9 years ago
nicm
fadf08888f
Another couple of commas in the wrong place, ok jmc
9 years ago
guenther
04a5d5b45d
Make pthread_atfork() track the DSO that called it like atexit() does,
unregistering callbacks if the DSO is unloaded. Move the callback
handling from libpthread to libc, though libpthread still overrides the
inner call to handle locking and thread-library reinitialization.
Major version bump for both libc and libpthread.
verification that this fixes various ports ajacoutot@
asm assistance miod@; ok millert@ deraadt@
9 years ago
tedu
bd36abfa7c
bludgeon DES support out of crypt. long live the bcrypt.
9 years ago
tedu
b4484c676a
improve realloc. when expanding a region, actually use the free page cache
instead of simply zapping it. this can save many syscalls in a program
that repeatedly grows and shrinks a buffer, as observed in the wild.
9 years ago
tedu
e87c880491
remove incorrect statement. the standard *does* require calloc to check
for overflow. stop talking about old broken systems, there's little use
for such info.
9 years ago
millert
9b1817bc73
Update comment to match code; Caspar Schutijser
9 years ago
tedu
236787ace7
we don't let strtonum errors bleed through now.
9 years ago
tedu
6e172aaf1a
Set errno to EINVAL, instead of letting ERANGE escape out.
Printing strerror() in that case will say result too large, even if rounds is
actually too small. invalid is less specific, but less incorrect.
ok millert
9 years ago
tedu
ade522ddbc
update siphash manpages to reflect change in return type spelling.
ok dlg
9 years ago
tedu
6b550eb5a9
Use standard spelling for types, and rename local variable from "free".
No actual change, but makes it easier to reuse the code elsewhere.
Suggested by Andre Smagin
9 years ago
tedu
f560a5c78d
lsearch and lfind return void *
9 years ago
jmc
a4b14a72e4
use a width specifier for lists, and Sq rather than Dq for single letters
to avoid swamping it;
9 years ago
tedu
486708efb7
the possible algos for pref should be documented here
9 years ago
dlg
eed98717a6
userland gets static on functions only used within a file.
ok tedu@
9 years ago
schwarze
cdb05c968a
macro fixes from Kaspars at Bankovskis dot net;
also fixing one typo in fts(3) while here
9 years ago
schwarze
72a38c830c
Use .Rv where appropriate, and move it to RETURN VALUES;
remove .Tn, and a few minor macro adjustments.
Patch from Kaspars at Bankovskis dot net.
9 years ago
tedu
29b14402f1
dial the time back to about 0.1s, closer to the original targets and
friendlier for users. requested by deraadt
9 years ago