Commit graph

30351 commits

Author SHA1 Message Date
Philippe Charnier 9448def93e Correct use of .Nm. Add rcsid. -Wall. Add -p flag in usage string (was missing). 1998-07-15 06:51:38 +00:00
Bruce Evans 30166fabb6 Cast between longs and pointers via intptr_t. There shouldn't be
nearly so many casts here.  Casting an pointer that was an integer
back to an integer just to compare it with -1 is bad, and casting
it back just to compare it with NULL is just wrong.
1998-07-15 06:51:14 +00:00
Philippe Charnier 25f014db91 Correct use of .Nm. Add rcsid. Remove unused #includes. Use warn().
Errx(1, "malloc failed") is better than err(1, NULL).
1998-07-15 06:48:52 +00:00
Philippe Charnier e345a80d5d Correct use of .Nm. Remove unused #includes. Use warn(). cosmetic in usage()
string.
Translate 0 sec 1000000 usec to 1 sec 0 usec.
1998-07-15 06:45:02 +00:00
Bruce Evans d4d88b1e4d Cast between u_longs and object pointers via uintptr_t.
Access the entry address as a uintfptr_t, not as a long, and not
necessarily as what modload(8) passes (it takes a u_long from the
exec header and passes a u_int).
1998-07-15 06:39:12 +00:00
Philippe Charnier 1109d2e0ee Do not uppercase first letter in syslog() string. 1998-07-15 06:38:53 +00:00
Philippe Charnier 06389a253a Add Id. .Nm nologin -> .Nm. 1998-07-15 06:37:07 +00:00
Philippe Charnier 6ca76744cb Correct use of .Nm. Do not dot terminate syslog() strings. Remove unused
#includes. Add rcsid. -Wall.
1998-07-15 06:35:20 +00:00
Philippe Charnier 9b4d716bbb Do not dot terminate syslog() string. Remove unused #includes. Add rcsid. -Wall. 1998-07-15 06:33:15 +00:00
Philippe Charnier f6f3d50730 Correct use of .Nm. Remove unused #includes. Short usage() string, see man
page for details.
1998-07-15 06:30:38 +00:00
Philippe Charnier 27750b35a5 Add prototypes. Check malloc() return value. Use err(). Remove unused #includes
Do not \n nor dot terminate syslog()/err() messages. -Wall.
1998-07-15 06:28:05 +00:00
Philippe Charnier 7485340223 Correct improper use of .Sm. Document -d flag. Correct use of .Nm. Remove
unused #includes. Add usage(). Use warnx(). Correct spelling. Abort when
malloc() fails.
1998-07-15 06:21:41 +00:00
Bruce Evans aae0aa4593 Cast between longs and pointers via intptr_t. The results of fuword()
should be checked before casting.  The results of suword() should be
checked.
1998-07-15 06:19:33 +00:00
Philippe Charnier 109d5f9fa4 .Nm mount_union -> .Nm. 1998-07-15 06:13:45 +00:00
Philippe Charnier 6036829ceb Correct use of .Nm. Use .Ar when appropriate. Remove unused #includes. Typos. 1998-07-15 06:12:32 +00:00
Bruce Evans 1ede4662be Cast longs to intptr_t before casting them to pointers.
Fixed bitrot in pseudo-declaration of `struct fcntl_args'.  fcntl()
is now broken in some cases when ints are larger than longs.
1998-07-15 06:10:16 +00:00
Philippe Charnier fdb8d8965b Correct use of .Nm. Remove unused #includes. 1998-07-15 06:08:47 +00:00
Bruce Evans c2da0fd903 Cast pointers to intptr_t instead of or before casting to long.
Fixed bitrot in K&R support (suword() now takes a long word).
Didn't fix corresponding bitrot in store.9 and fetch.9.

The correct types for the store and fetch families are problematic.
The `word' functions are unfortunately named and need to be split
to handle ints/longs/object pointers/function pointers.  Storing
argv[] as longs is quite broken when longs are longer than pointers,
but usually works because it clobbers variables that will soon be
reinitialized.
1998-07-15 05:21:48 +00:00
Bruce Evans 7cd99438f8 Cast u_longs to uintptr_t before casting them to pointers. Don't
attempt to even partially support systems with function pointers
larger than object pointers.
1998-07-15 05:00:26 +00:00
Bruce Evans 6a206dd96a Cast function pointers to uintfptr_t before casting them to u_long.
Hopefully caddr_t is large enough to hold function pointers.

Cast object pointers to uintptr_t before casting them to u_long.

Types are wronger than usual for the PT_READ_U case.  ptrace() can
only return ints, but longs are accessed.
1998-07-15 04:43:49 +00:00
John Polstra 3bc25faee6 Add support for a new archetype "printf0" for the "format" function
attribute.  It is like the existing "printf" archetype, except that
it doesn't complain if the format string is a null pointer.  See
the node "Function Attributes" in the GCC info pages if you don't
know what this is all about.

This change will allow us to add format string checking for the
err(3) family of functions.
1998-07-15 04:22:45 +00:00
Bruce Evans 15c7382561 Cast pointers to [u]intptr_t instead of to [unsigned] long. 1998-07-15 04:17:55 +00:00
Bruce Evans 4b81ec76d1 Cast the value returned by strtoul() to a uintptr_t before casting
it to a pointer.  There's nothing better than strtoul() for reading
pointers from strings, but the range checking should be better.
1998-07-15 04:03:54 +00:00
Bruce Evans fc93c1bd67 Cast virtual addresses that happen to be represented as u_longs to
uintptr_t before casting them to pointers.  Explicit u_longs should
never be used to represent virtual addresses... (vm_offset_t is
normally right).
1998-07-15 03:58:57 +00:00
Joseph Koshy 06d073b9a9 Fix inconsistent port numbering in man page.
PR: 7250
Submitted-by: Norihiro Kumagai <kuma@jp.freebsd.org>
1998-07-15 03:32:45 +00:00
Bruce Evans a23d65bfc8 Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively.  Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.
1998-07-15 02:32:35 +00:00
Søren Schmidt aad7cac45a Add support for the AVer Media range of cards. 1998-07-14 21:19:58 +00:00
Guy Helmer 9629cc1275 Revert "POSIX saved uids change". seteuid(2) is not POSIX, and
FreeBSD does not have _POSIX_SAVED_IDS enabled.  Thanks to Warner Losh
and Ollivier Robert for pointing this out, and Bruce Evans for explaining
the role of _POSIX_SAVED_IDS.
1998-07-14 19:07:30 +00:00
Andrey A. Chernov dfb1b7aea6 Provide meaningful errno value on error return 1998-07-14 18:27:43 +00:00
Mike Smith bf707fd0b2 Add missing register name defines. 1998-07-14 17:13:23 +00:00
Bruce Evans eb95adeff5 Print pointers using %p instead of attempting to print them by
casting them to long, etc.  Fixed some nearby printf bogons (sign
errors not warned about by gcc, and style bugs, but not truncation
of vm_ooffset_t's).
1998-07-14 12:26:15 +00:00
Bruce Evans 101eeb7f9f Print pointers using %p instead of attempting to print them by
casting them to long, etc.  Fixed some nearby printf bogons (sign
errors not warned about by gcc, and style bugs, but not truncation
of vm_ooffset_t's).

Use slightly less bogus casts for passing pointers to ddb command
functions.
1998-07-14 12:14:58 +00:00
Bruce Evans 3cc954df66 Don't pretend to support ix86's with 16-bit ints by using longs
just to ensure 32-bit variables.  Doing so broke i386's with 64-bit
longs.
1998-07-14 11:42:05 +00:00
Bruce Evans b017a12bfd If object pointers need to be cast to [unsigned] integers, then cast
to [u]intptr_t instead of to [u_]long.

Don't cast pointers to integers just to do ordinary pointer arithmetic
on them, especially when the casts use gcc's feature of casting lvalues.
1998-07-14 11:34:22 +00:00
Bruce Evans 88472e74e8 Avoid some casts of pointers to integers (of possibly different sizes). 1998-07-14 11:19:32 +00:00
Bruce Evans af01fff37b ioctl() request args are unsigned longs, so don't attempt to store
them as ints.  Among other bugs, doing so at best caused benign
overflow followed by fatal sign extension on machines with 32-bit
ints and 64-bit longs.
1998-07-14 10:32:27 +00:00
Joseph Koshy f69e804d24 Make `dump' exit codes confirm to manual page.
PR: 5346
Style-check-by: bde
1998-07-14 09:19:47 +00:00
Joseph Koshy fa0bc432ca Add $Id$.
PR:		7251
Submitted by:   Norihiro Kumagai <kuma@jp.freebsd.org>
1998-07-14 08:28:15 +00:00
Joseph Koshy cdcd36c48e Add $Id$.
PR: 7249
1998-07-14 08:18:51 +00:00
Dag-Erling Smørgrav cf1414e15e Inserted missing .Bl in the FILES section.
Unknowingly pointed out by: Snob Art Genre <benedict@echonyc.com>
1998-07-14 07:55:27 +00:00
Amancio Hasty 596e9516c8 I checked in the wrong version yesterday . The correct version is 1.38
Amancio
1998-07-14 07:11:20 +00:00
Bruce Evans 8f5aca410f Don't pretend to support ix86's with 16-bit ints and 32-bit registers
by using longs just to ensure 32-bit variables.  Long variables don't
fit in 32-bit registers on ix86's with 64-bit longs.
1998-07-14 06:17:28 +00:00
Bruce Evans 37889b394a Changed to the C9x draft spelling of the (unsigned) integral type
suitable for holding object pointers (ptrint_t -> uintptr_t).
Added corresponding signed type (intptr_t).  Changed/added
corresponding non-C9x types for function pointers to match.  Don't
use nonstandard types to implement these types, and don't comment
on them in <machine/types.h>.
1998-07-14 05:09:48 +00:00
Bill Paul 7841095906 Add list of Compaq and Olicom ethernet cards that work with the
ThunderLAN driver to the 'supported hardware' section.
1998-07-14 02:14:13 +00:00
Stefan Eßer c3673cc077 Add US Mirror site to MASTER_SITE_KDE. 1998-07-13 23:39:02 +00:00
Bill Paul fb1305c426 Declare pointers to CSR register space to be volatile. This seems to
cure the problems I was having with interrupts not being acknowledged
on time. This fixes a problem I observed where starting two ping -f
processes at 10Mbps would cause an adapter check due to TX GO commands
being issued before TXEOC interrupts were being acked.

Also fix a small problem with tl_start(): the mechanism I was using
to queue new packets onto the TX chain was bogus.

Change adapter check handler so that it resets card state after
tl_softreset() is stored.

Moved all EEPROM-related macro definitions into if_tlreg.h.

Don't allow an autoneg session to start until after the TX queue has
been drained, and don't transmit anything until after the autoneg
session is complete.

Also add support for two more Compaq ThunderLAN-based cards, and three
cards from Olicom which also use the ThunderLAN chip. The only thing
different about the Olicom cards is that they store the station address
at a different location within the EEPROM.
1998-07-13 18:15:48 +00:00
Bruce Evans 5914e1ea80 Removed a bogus forward struct declaration.
Cleaned up ifdefs.
1998-07-13 12:20:07 +00:00
Bruce Evans 0c8d2590e3 Fixed some longs that should have been fixed-sized types. 1998-07-13 12:12:25 +00:00
Bruce Evans 9105bb4680 Fixed overflow and sign extension bugs in
`len = min(so->so_snd.sb_cc, win) - off;'.  min() has type u_int
and `off' has type int, so when min() is 0 and `off' is 1, the RHS
overflows to 0U - 1 = UINT_MAX.  `len' has type long, so when
sizeof(long) == sizeof(int), the LHS normally overflows to to the
correct value of -1, but when sizeof(long) > sizeof(int), the LHS
is UINT_MAX.

Fixed some u_long's that should have been fixed-sized types.
1998-07-13 11:53:59 +00:00
Bruce Evans 07a4df4fee Declare tcp_seq and tcp_cc as fixed-size types. Half fixed type
mismatches exposed by this (the prototype for tcp_respond() didn't
match the  function definition lexically, and still depends on a
gcc feature to match if ints have more than 32 bits).
1998-07-13 11:09:52 +00:00