jmc
8d7d8263de
.Xr typos;
ok deraadt@
22 years ago
jmc
81a92b2d75
.Xr's;
typos in man page section
ok deraadt@
22 years ago
kjell
804f08787d
Fix a pasto. (There is no ULLONG_MIN, for hopefully obvious reasons)
ok millert
22 years ago
millert
156f1b279a
Use int32_t, not long since this deals with 32bit quantities.
Inspired by a change in NetBSD and reported by Jan Johansson.
22 years ago
deraadt
a3ae0324b4
of of
22 years ago
deraadt
04ad54fbad
fix a variety of missing or wrong MLINKS
22 years ago
deraadt
2101454931
re-stir if pid changes; markus & me
22 years ago
jmc
a23019ca33
typos;
ok deraadt@
22 years ago
millert
949ecbd97d
Add sanity check to prevent int oflow for very large allocations.
Also fix a signed vs. unsigned issue while I am at it.
Found by Jim Geovedi. OK deraadt@
22 years ago
millert
36f3924c0e
Move the rounds into separate functions on sparc64 so gcc's optimizer
doesn't blow up. This is a hack but is better than compiling sha1.c
with -O0 on sparc64. From NetBSD (mrg).
deraadt@ OK
22 years ago
millert
bd747228df
o Ansi function headers
o Add __BEGIN_DECLS/__END_DECLS to include files
o Safe macros
o Remove useless variable assignment in the End function of *hl.c
o Some minor KNF, needs more
From Dan Weeks
22 years ago
mickey
b20c936570
use proper __findenv() prototype; millert@ ok
22 years ago
millert
b0758fbef2
Document BSD behavior of accepting '-' within optstring as long as
it is not the fist character of optstring (since that would conflict
with GNU semantics).
Update the bit on "W;" within optstring when called as getopt (not
getopt_long) to current reality.
22 years ago
millert
8cbc8395f9
When doing permutation, only treat "-" as an option if it was specified
in optstring. Problem noticed by Theo.
22 years ago
millert
dccaef8649
Fix pasto, spotted by lebel@
22 years ago
millert
cb897658ca
In BUGS section, append a warning to not use '-' as the first character
of optstring to avoid a semantic conflict with GNU getopt.
22 years ago
millert
34fcaee308
SUS (and apparently 1003.1-2001) say to check optstring for NULL
22 years ago
millert
b29867fc14
If we are passed "-" in argv and the user didn't specify '-' in optstring,
return -1 like POSIX requires.
22 years ago
millert
72e2001bda
BSD getopt() supports '-' in the optstring so we should too.
This is used by a few programs such as man and su.
22 years ago
millert
d58f8a4c5b
Fix pasto in last commit.
22 years ago
millert
03be658a41
For getopt_long_only() we *do* want to match single-character options
as shortcuts for long ones, but only if this would not conflict with
a short option in optstring. Now binutils gas works.
22 years ago
millert
22eaf3990b
In srandomdev(), if we can't access /dev/arandom, use the sysctl() instead.
We don't want to use the sysctl() by default since we are reading more
than just a few bytes of entropy when setting up the state.
22 years ago
millert
def8d6bd9d
Fix two compatibility issues with our getopt_long_only() vs. the GNU version:
o Check for long options even when not at the beginning of an option.
For instance, if -a is a short option w/o an arg and -static is a
boolean long option then -astatic is valid for getopt_long_only().
o If a potential long argument does not match longopts and the first
character is not a short option, print a warning and skip the rest
of the argument.
Also clean up some trailing whitespace and change return value of
parse_long_options() from -2 to -1 when unmatched and in long_only mode.
With these fixes the binutils ld seems happy with our getopt_long_only()
22 years ago
millert
da126e4ad2
Correctly handle -Wlong_arg (no space between -W and long_arg) when "W;"
is in optstring.
22 years ago
millert
2208de30a3
Reorganize this so that getopt_only_only() works correctly.
In order for getopt_only_only() to work we need to check for long
options before short ones. I have merged getopt_internal and
getopt_long_internal into a single function with the actual long
args parsing broken out into a separate function.
This also simplifies the flow of control.
22 years ago
millert
671dc74fb7
make getopt_long and getopt_long_only protos match getopt.h
22 years ago
millert
26eca9994a
Add "RETURN VALUES" sections
22 years ago
millert
6f124adcac
.Xr getopt_long
22 years ago
millert
ab0180d5e4
Whoops, add missing #ifdef REPLACE_GETOPT
22 years ago
millert
da213272c0
fix typo
22 years ago
millert
52c5998342
GNU-like getopt_long() from NetBSD with changes by me to support
getopt_long_only(). At some point this should replace the BSD
getopt(3) but we are not there yet.
While I am here add protection from the multiple getopt() definitions
due to conflicting standards.
22 years ago
millert
47c7c08921
Crank all library major numbers. Needed due to the fact that we
now build libraries with propolice enabled. Without this, existing
binaries (such as ports/packages) that link with any system library
other than libc will fail with an undefined symbol of "___guard"
(__guard on ELF).
Pointed out by markus@ and discussed with deraadt@
22 years ago
millert
5a1579637f
Add ecvt(), fcvt() and gcvt() for standard compliance and legacy code.
22 years ago
tdeval
2a55c1e776
Honour malloc_junk ('J') with realloc(3), and fix page_dir shrink update.
22 years ago
cloder
852a863c23
Warn if atexit(3) fails. Change some tabs to spaces. Use
STDERR_FILENO instead of 2.
OK millert@
22 years ago
millert
1670acafb5
Add HISTORY section
22 years ago
millert
73ff679f9f
.Xr atoll(3) and add missing .Xr of atol(3) in atoll(3) man page.
22 years ago
millert
811f857cf2
Take advantage of the libc minor bump and add atoll(3)
22 years ago
marc
e44f851320
Add strerror_r and functions versions of getchar_unlocked and
22 years ago
marc
eefd3d97b6
thread safe libc -- 2nd try. OK miod@, millert@
22 years ago
marc
2b7dd8d384
back out previous patch.. there are still some vax/m68k issues
22 years ago
marc
80b718f7ee
libc changes for thread safety. Tested on:
22 years ago
dhartmei
f29e2452e5
Move __cleanup into mprotect'ed page to prevent unintentional modifications
similar to the atexit handlers. Idea and help deraadt@, ok deraadt@
22 years ago
henning
d67bb87548
missing include, ok theo
22 years ago
dhartmei
cef62f0908
re-enable function pointer table protection, this time make sure that
malloc.c gets the first mmap() call (since it depends on that, for its
sbrk(0) use). ok deraadt@
22 years ago
deraadt
f73c2b1c58
do not export error_table
22 years ago
miod
6819b734ce
Suggest better types in examples; from NetBSD
22 years ago
millert
ca00f6f3e4
mark pw_error() __dead since it exits
22 years ago
dhartmei
3e0b53c913
Back it out, it breaks something in perl (seen with spamassassin), debug
first.
22 years ago
deraadt
968c135966
permit calloc(0, N) and calloc(N, 0) -- malloc(0) does the right thing; markus miod ok
22 years ago