15 years agoExplicitly mention in RETURN VALUES that socket() sets
Sascha Wildner [Wed, 26 Jan 2005 21:52:36 +0000 (21:52 +0000)]
Explicitly mention in RETURN VALUES that socket() sets
errno upon failure.

Noticed-by: Liam J. Foy <liamfoy@sepulcrum.org>
15 years agoDon't build a new mbuf and bpf_mtap the old one.
Joerg Sonnenberger [Wed, 26 Jan 2005 16:15:06 +0000 (16:15 +0000)]
Don't build a new mbuf and bpf_mtap the old one.

15 years agoFix the quoting of MAKEFLAGS as noted in rev. 1.47.
Joerg Sonnenberger [Wed, 26 Jan 2005 09:44:21 +0000 (09:44 +0000)]
Fix the quoting of MAKEFLAGS as noted in rev. 1.47.
This still has a slight problem with trailing backslashes
on the comment line, but that will be documented in the man page.

Written-by: Harti Brandt, harti AT freebsd DOT org
15 years agoAdd some spaces for typographical correctness.
Joerg Sonnenberger [Wed, 26 Jan 2005 00:55:44 +0000 (00:55 +0000)]
Add some spaces for typographical correctness.

15 years ago- Add support for attaching alternative DLTs to an interface.
Joerg Sonnenberger [Wed, 26 Jan 2005 00:37:40 +0000 (00:37 +0000)]
- Add support for attaching alternative DLTs to an interface.
  The function is named bpfattach_dlt, FreeBSD used bpfattach2.
- Change bpf_mtap to take the bpf_if directly.
- Add support for BIOCSDLT and BIOCGDLT to recieve a list of DLTs
  available on an interface.

Obtained-from: FreeBSD

- Add bpf_ptap, which takes an mbuf and a header, builds a temporary
  mbuf chain and calls bpf_mtap on that.

Inspired-by: FreeBSD's bpf_mtap2
- Use the new interface for all drivers doing this by hand before.
- Include the formerly commented out support for radio headers in wi(4)
  and wlan(4).
- Change if_loop, i4b_ipr, disc and ic to prepend a uint32_t, not an int.

15 years agoRemove the _KERNEL parts.
Joerg Sonnenberger [Tue, 25 Jan 2005 23:09:42 +0000 (23:09 +0000)]
Remove the _KERNEL parts.

15 years agoRemove !_KERNEL parts.
Joerg Sonnenberger [Tue, 25 Jan 2005 22:58:42 +0000 (22:58 +0000)]
Remove !_KERNEL parts.

15 years agoFix a type in rev. 1.16
Joerg Sonnenberger [Tue, 25 Jan 2005 21:24:49 +0000 (21:24 +0000)]
Fix a type in rev. 1.16

15 years agoDisable hardware checksum support by default, it produces packet corruption.
Matthew Dillon [Tue, 25 Jan 2005 19:35:11 +0000 (19:35 +0000)]
Disable hardware checksum support by default, it produces packet corruption.
It is unclear why the corruption occurs, but certain fragmented packets
consistently reproduce it so there's a good chance that there may be alignment
or length requirements that we don't know about, or just pure hardware
brokedness with certain packets.

The checksumming can be turned on again with ifconfig for testing purposes.

 EXTRACTION from Aggelos's packet dumps ]


11:43:27.261710 > 1472 write [|nfs] (frag 8031:1480@0+)
11:43:27.261718 > udp (frag 8031:1480@1480+)
11:43:27.261729 > udp (frag 8031:1480@2960+)
11:43:27.261743 > udp (frag 8031:1480@4440+)
11:43:27.261756 > udp (frag 8031:1480@5920+)
11:43:27.261767 > udp (frag 8031:1480@7400+)
11:43:27.261781 > udp (frag 8031:1480@8880+)
11:43:27.261793 > udp (frag 8031:1480@10360+)
11:43:27.261807 > udp (frag 8031:4@11840)


13:56:59.783671 > 1472 write [|nfs] (frag 8031:1480@0+)
13:56:59.783785 > udp (frag 8031:1480@1480+)
13:56:59.783915 > udp (frag 8031:1480@2960+)
13:56:59.784037 > udp (frag 8031:1480@4440+)
13:56:59.784159 > udp (frag 8031:1480@5920+)
13:56:59.784283 > udp (frag 8031:1480@7400+)
13:56:59.784407 > udp (frag 8031:1480@8880+)
13:56:59.784527 > udp (frag 8031:1480@10360+)
13:56:59.784532 > udp (frag 8031:4@11840)

Reported-by: aoiko@cc.ece.ntua.gr (Aggelos)
Note-Also: also turned off in FreeBSD /usr/src/sys/dev/re/if_re.c:1.37

15 years agoMostly switch to the patch framework. For cvs.1.patch, it's easier to do by
Joerg Sonnenberger [Tue, 25 Jan 2005 14:00:18 +0000 (14:00 +0000)]
Mostly switch to the patch framework. For cvs.1.patch, it's easier to do by

Add a patch to let CVS ignore the environment variable CVSREADONLYFS for
remote repositories.  This allows a user to make lock-operation the
default behaviour for local repositories without cludges for remote

15 years ago- Add -v option (verbose). Taken from FreeBSD with my modifications.
Liam J. Foy [Mon, 24 Jan 2005 18:58:20 +0000 (18:58 +0000)]
- Add -v option (verbose). Taken from FreeBSD with my modifications.
- Remove unnecessary header (errno.h)
- Static functions
- Add new -v option to man page

15 years agoRepo-copy vinumparser.c and vinumutil.c from /usr/src/sys/dev/raid/vinum
Matthew Dillon [Mon, 24 Jan 2005 17:57:36 +0000 (17:57 +0000)]
Repo-copy vinumparser.c and vinumutil.c from /usr/src/sys/dev/raid/vinum
and clean up for userland compilation.

Requested-by: Joerg Sonnenberger <joerg@britannica.bec.de>
15 years agore-fix typo. Maybe its time to start drinking coffee in the morning. :-)
David Rhodus [Mon, 24 Jan 2005 15:38:30 +0000 (15:38 +0000)]
re-fix typo.  Maybe its time to start drinking coffee in the morning. :-)

15 years agoFix typo.
David Rhodus [Mon, 24 Jan 2005 15:06:07 +0000 (15:06 +0000)]
Fix typo.

Sent in by: Richard Bradshaw <theglassishalfempty@gmail.com>

15 years agoReverting all of today's changes.
Max Okumoto [Mon, 24 Jan 2005 09:38:01 +0000 (09:38 +0000)]
Reverting all of today's changes.

15 years ago- Cleanup field names in Buffer object, and add better comments.
Max Okumoto [Mon, 24 Jan 2005 06:43:00 +0000 (06:43 +0000)]
- Cleanup field names in Buffer object, and add better comments.

15 years ago- New function Buf_AppendRange(), which is given a pointer to a string and
Max Okumoto [Mon, 24 Jan 2005 05:13:58 +0000 (05:13 +0000)]
- New function Buf_AppendRange(), which is given a pointer to a string and
  a pointer to the end of the range to append to the Buffer object.

15 years ago- New function Buf_Append(), which is given a pointer to a string to
Max Okumoto [Mon, 24 Jan 2005 05:12:58 +0000 (05:12 +0000)]
- New function Buf_Append(), which is given a pointer to a string to
  append to the Buffer object.

15 years ago- Inline silly #define MACRO.
Max Okumoto [Mon, 24 Jan 2005 05:11:01 +0000 (05:11 +0000)]
- Inline silly #define MACRO.

15 years ago- Removed unnessisary append of '\0' to Buffer object. Buffer
Max Okumoto [Mon, 24 Jan 2005 05:09:30 +0000 (05:09 +0000)]
- Removed unnessisary append of '\0' to Buffer object.  Buffer
  already maintains a terminating null byte.

15 years ago- Rewrite Buffer object to maintain only write pointer. There is no
Max Okumoto [Mon, 24 Jan 2005 05:07:34 +0000 (05:07 +0000)]
- Rewrite Buffer object to maintain only write pointer.  There is no
  need to maintain both a write pointer and a length.

15 years agoUse BPF_TAP and BPF_MTAP instead of the expanded versions where possible.
Joerg Sonnenberger [Sun, 23 Jan 2005 20:23:22 +0000 (20:23 +0000)]
Use BPF_TAP and BPF_MTAP instead of the expanded versions where possible.

15 years agoGeneral clean up of lptcontrol. Similar to FreeBSD 1.15
Liam J. Foy [Sun, 23 Jan 2005 19:52:30 +0000 (19:52 +0000)]
General clean up of lptcontrol. Similar to FreeBSD 1.15
with my modifications:

- Remove many unnecessary headers and sort them
- Remove unused #define (PATH_LPCTL)
- Don't bother calling set_interrupt_status. Just call
  both open(2) and ioctl(2) in main.
- Remove modes in open(2)

15 years agoUse memchr(3) instead of a hand-rolled loop.
Chris Pressey [Sun, 23 Jan 2005 19:41:23 +0000 (19:41 +0000)]
Use memchr(3) instead of a hand-rolled loop.

Requested-by: joerg
15 years agoFix kerberos5 build by adding some headers files. These should be generated on
Eirik Nygaard [Sun, 23 Jan 2005 18:55:26 +0000 (18:55 +0000)]
Fix kerberos5 build by adding some headers files. These should be generated on
the fly, but the make depend step is acting up.

Reported by: joerg

15 years agoether_input already handles BPF and dropping of
Joerg Sonnenberger [Sun, 23 Jan 2005 18:50:50 +0000 (18:50 +0000)]
ether_input already handles BPF and dropping of
non-local packages, so stop doing this. Use BPF_MTAP instead of the
expanded version.

15 years agoReplace IPv6 related manual pages that may have violated
Hiroki Sato [Sun, 23 Jan 2005 17:03:13 +0000 (17:03 +0000)]
Replace IPv6 related manual pages that may have violated
the IETF's copyright.

Obtained from: KAME and OpenBSD (via FreeBSD)

15 years ago- Remove a duplicate unnecessary check on errno. strtol(3) will only ever set
Liam J. Foy [Sun, 23 Jan 2005 16:30:07 +0000 (16:30 +0000)]
- Remove a duplicate unnecessary check on errno. strtol(3) will only ever set
  errno to ERANGE which is already checked.

15 years agoRemove the support for lib/csu/${MACHINE_ARCH}-elf.
Joerg Sonnenberger [Sun, 23 Jan 2005 15:36:42 +0000 (15:36 +0000)]
Remove the support for lib/csu/${MACHINE_ARCH}-elf.
This should also prevent some people from shooting themselves with
partly cleaned sources.

15 years agoConsolidate ifqueue macros for the upcoming ALTQ work.
Joerg Sonnenberger [Sun, 23 Jan 2005 13:47:24 +0000 (13:47 +0000)]
Consolidate ifqueue macros for the upcoming ALTQ work.
We don't use ifqueue locking and don't intend to add it,
so the whole IF_LOCK / IF_UNLOCK compatibility with
FreeBSD 5 can just be removed. Similiar the "unlocked"
(with leading _) are replaced with the normal versions.
IF_QEMPTY from the i4b sources is added to iv_var.h for
symmetry with the ALTQ macros, but not yet used elsewhere.

15 years agoUse __DEQUALIFY, not only __DECONST to get rid of the volatile too.
Joerg Sonnenberger [Sun, 23 Jan 2005 13:26:37 +0000 (13:26 +0000)]
Use __DEQUALIFY, not only __DECONST to get rid of the volatile too.
This is safe for fuword (any interesting architecture has atomic
fetch instructions for integers) and the other uses doesn't touch
the memory at all.

15 years agoAdd forward declaration of struct vnode to fix compiler warning.
Joerg Sonnenberger [Sun, 23 Jan 2005 13:24:20 +0000 (13:24 +0000)]
Add forward declaration of struct vnode to fix compiler warning.

15 years agoAdjust calling convention for idp_input, idp_output and spp_input to match
Joerg Sonnenberger [Sun, 23 Jan 2005 13:21:44 +0000 (13:21 +0000)]
Adjust calling convention for idp_input, idp_output and spp_input to match
what the rest of the kernel uses in protosw.

15 years agoAdd missing 'by' in the license text of the man page.
Joerg Sonnenberger [Sun, 23 Jan 2005 13:06:13 +0000 (13:06 +0000)]
Add missing 'by' in the license text of the man page.
Hook seq(1) into the build process.

15 years agoNow that we generate the ethernet header in place in the mbuf instead
Jeffrey Hsu [Sun, 23 Jan 2005 06:41:55 +0000 (06:41 +0000)]
Now that we generate the ethernet header in place in the mbuf instead
of in a secondary buffer, we have to remove space for the old ethernet
header before we send a packet waiting for ARP resolution back to
ether_output() again.

15 years agoAdd a simple tool to generate a sequence of numbers, without all the
Joerg Sonnenberger [Sat, 22 Jan 2005 19:09:40 +0000 (19:09 +0000)]
Add a simple tool to generate a sequence of numbers, without all the
difficulty of jot. A very similiar tool is part of plan9 and GNU's

Submitted-by: Brian Ginsbach <ginsbach@pressenter.com>
15 years agoNo longer used.
Eirik Nygaard [Sat, 22 Jan 2005 16:17:41 +0000 (16:17 +0000)]
No longer used.

15 years ago- Complete re-write of sasc.
Liam J. Foy [Sat, 22 Jan 2005 14:01:36 +0000 (14:01 +0000)]
- Complete re-write of sasc.

Ok'ed by: Joerg, and others.

15 years ago- put #ifdef around PrintAddr() proto type.
Max Okumoto [Sat, 22 Jan 2005 11:34:41 +0000 (11:34 +0000)]
- put #ifdef around PrintAddr() proto type.

15 years ago- We use vfork() so if execv fails we should use _exit().
Max Okumoto [Sat, 22 Jan 2005 11:28:03 +0000 (11:28 +0000)]
- We use vfork() so if execv fails we should use _exit().

15 years ago- Move PrintAddr() into only file that uses it.
Max Okumoto [Sat, 22 Jan 2005 11:14:30 +0000 (11:14 +0000)]
- Move PrintAddr() into only file that uses it.

- Put #ifdef around PrintAddr()

15 years agoMove libutil up above KERBEROS5 libs and remove the duplicate entry when
Eirik Nygaard [Fri, 21 Jan 2005 13:01:03 +0000 (13:01 +0000)]
Move libutil up above KERBEROS5 libs and remove the duplicate entry when
WITH_KERBEROS5 is defined during build.

15 years agoFrom FreeBSD:
Joerg Sonnenberger [Fri, 21 Jan 2005 11:09:40 +0000 (11:09 +0000)]
From FreeBSD:
MFC 1.98:
    Plug a mem leak in vinum_scandisk().

15 years agoThe vnode reclamation code contains a race whereby a blocking condition may
Matthew Dillon [Thu, 20 Jan 2005 18:08:54 +0000 (18:08 +0000)]
The vnode reclamation code contains a race whereby a blocking condition may
occur between the clearing of an inode's bitmap bit, the removal of the
inode from the hash table, and the reclamation of the related vnode.

This can cause a file create to block on the vnode undergoing reclamation
if it happens to select the same inode (a case which is more likely these
days due to dirpref).  To avoid the race, adjust UFS to *NOT* allocate
inode numbers which are still present in the inode hash table.

This race is NOT a bug, or at least it is not a known cause for existing bugs,
but both the standard vnode code and especially the softupdates code is
so complex that I am not taking any chances.  As of this commit both FreeBSD-4,
FreeBSD-5, and DragonFly are known to have rare 'dup alloc' and other
related filesystem/inode panics and this commit removes one variable from
that equation.

15 years agoReplace the cache-point linear search algorithm for VM map entries with
Matthew Dillon [Thu, 20 Jan 2005 18:00:38 +0000 (18:00 +0000)]
Replace the cache-point linear search algorithm for VM map entries with
a red-black tree.  This makes VM map lookups O(log N) in all cases.

Note that FreeBSD seems to have gone the splay-tree route, but I really
dislike the fact that splay trees are constantly writing to memory even
for simple lookups.  This would also limit our ability to implement a
separate hinting/caching mechanism.  A red-black tree is basically a
binary tree with internal nodes containing real data in addition to the leafs,
simlar to a B+Tree.  A red-black tree is very similar to a splay tree but it
does not attempt to modify the data structure for pure lookups.

Caveat: we tried to revive the map->hint mechanism but there is currently
a serious crash/lockup bug related to it so it is disabled in this commit.

Submitted-by: Eirik Nygaard <eirikn@kerneled.com>
Using-Red-Black-Macros-From: NetBSD (sys/tree.h)

15 years agoProperly vget() vnodes that the syncer intends to VOP_FSYNC(), rather then
Matthew Dillon [Thu, 20 Jan 2005 17:52:03 +0000 (17:52 +0000)]
Properly vget() vnodes that the syncer intends to VOP_FSYNC(), rather then
just locking the vnode.  The original FreeBSD code allowed a vnode to be
locked without being refd, but DragonFly requires that a vnode be ref'd
if it is going to be locked.  This fixes a rare panic that can occur when
the syncer is flushing a vnode that mainline code tries to access at the
same time.

This also brings the syncer inline with the filesystem sync code which has
been using normal vget()'s for several months now.

Reported-by: David Rhodus
15 years agoSort sections.
Max Okumoto [Thu, 20 Jan 2005 00:31:22 +0000 (00:31 +0000)]
Sort sections.

Taken-from: FreeBSD
Author: ru

15 years agoAdd a man page for this program.
Max Okumoto [Wed, 19 Jan 2005 21:58:04 +0000 (21:58 +0000)]
Add a man page for this program.

15 years agoWhitespace cleanup.
Eirik Nygaard [Wed, 19 Jan 2005 19:05:21 +0000 (19:05 +0000)]
Whitespace cleanup.

15 years agoChange lockcount->lockcountnb in an assertion.
Matthew Dillon [Wed, 19 Jan 2005 18:57:00 +0000 (18:57 +0000)]
Change lockcount->lockcountnb in an assertion.

Noticed-by: David Rhodus <sdrhodus@gmail.com>
15 years agoKerberos no longer comes with it's own telnet. Always build the one in
Eirik Nygaard [Wed, 19 Jan 2005 18:22:53 +0000 (18:22 +0000)]
Kerberos no longer comes with it's own telnet. Always build the one in

15 years agoKerberos no longer comes with it's own telnet, so always build the one in
Eirik Nygaard [Wed, 19 Jan 2005 18:20:47 +0000 (18:20 +0000)]
Kerberos no longer comes with it's own telnet, so always build the one in

15 years agoANSI and whitespace cleanup. No operational changes.
David Rhodus [Wed, 19 Jan 2005 18:00:39 +0000 (18:00 +0000)]
ANSI and whitespace cleanup.  No operational changes.

15 years agoAdd some descriptive comments.
Matthew Dillon [Wed, 19 Jan 2005 17:41:20 +0000 (17:41 +0000)]
Add some descriptive comments.

15 years agoWhen a PCMCIA networking card is removed the IF code may free() the network
Matthew Dillon [Wed, 19 Jan 2005 17:30:54 +0000 (17:30 +0000)]
When a PCMCIA networking card is removed the IF code may free() the network
interface before processing has completed on pending packets, leaving a
dangling pointer in the mbuf and causing a crash.

The two solutions are to either ref-count the network interface on a
per-packet basis or to synchronize against consumers of the packet.
ref-counting is very expensive in an MP system so we have chosen to
synchronize against consumers by sending a NOP message to all protocol
processing threads and waiting for it to be replied.  This only occurs when
an interface is being brought down and is not expected to introduce any
performance issues.

Crash-Reported-by: Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>
15 years agoRemove left-over.
Joerg Sonnenberger [Wed, 19 Jan 2005 11:51:46 +0000 (11:51 +0000)]
Remove left-over.

15 years agoTest commit.
Hiroki Sato [Tue, 18 Jan 2005 23:26:09 +0000 (23:26 +0000)]
Test commit.

15 years agoIgnore zero length mbuf in bus_dmamap_load_mbuf.
Joerg Sonnenberger [Tue, 18 Jan 2005 14:02:05 +0000 (14:02 +0000)]
Ignore zero length mbuf in bus_dmamap_load_mbuf.

Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
15 years agoUnlike printf(3), fwrite(3) doesn't stop at the first NUL character
Chris Pressey [Tue, 18 Jan 2005 03:13:52 +0000 (03:13 +0000)]
Unlike printf(3), fwrite(3) doesn't stop at the first NUL character
it finds in the string; and since the full length of the string was
being passed to fwrite(3), sysctl(8) commands were mistakenly
outputting a NUL character after their text output.

Fix by only fwrite(3)ing the string up to the first NUL character.

Discovered-by: y0netan1
15 years agoUse PCIB_ROUTE_INTERRUPT instead of PCI_ROUTE_INTERRUPT, the latter is
Joerg Sonnenberger [Mon, 17 Jan 2005 20:24:46 +0000 (20:24 +0000)]
long dead. Remove the declaration in pci_if.m to avoid future problems.

Spotted-by: corecode
15 years agoAvoid possible copyright problems and add the copyright of the
Joerg Sonnenberger [Mon, 17 Jan 2005 17:50:21 +0000 (17:50 +0000)]
Avoid possible copyright problems and add the copyright of the
original code and the third clause.

15 years agoRaise WARNS to 6.
Chris Pressey [Mon, 17 Jan 2005 07:27:45 +0000 (07:27 +0000)]
Raise WARNS to 6.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agoRaise WARNS to 6.
Chris Pressey [Mon, 17 Jan 2005 01:49:24 +0000 (01:49 +0000)]
Raise WARNS to 6.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agoRaise WARNS to 6:
Chris Pressey [Sun, 16 Jan 2005 21:40:42 +0000 (21:40 +0000)]
Raise WARNS to 6:
- Use parentheses in a logical condition to prevent ambiguous
  interpretation (by humans, who are imperfect C parsers.)  In doing
  so, simplify it:  x == 0 implies (x != 1 and x != 2).

15 years agoRaise WARNS to 6.
Chris Pressey [Sun, 16 Jan 2005 21:14:51 +0000 (21:14 +0000)]
Raise WARNS to 6.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agoWARNS=6. The __DECONST is save, because execv doesn't mess with the strings,
Joerg Sonnenberger [Sun, 16 Jan 2005 19:17:28 +0000 (19:17 +0000)]
WARNS=6. The __DECONST is save, because execv doesn't mess with the strings,
but can't be specified as such.

15 years agoSupport PORTDIRNAME and PKGORIGIN.
Joerg Sonnenberger [Sun, 16 Jan 2005 17:53:35 +0000 (17:53 +0000)]

15 years agoDon't print the override warning for package-name.
Joerg Sonnenberger [Sun, 16 Jan 2005 17:14:16 +0000 (17:14 +0000)]
Don't print the override warning for package-name.

Instead of trying to guess the PKGNAME, just ask the override port for it.
*Warning*: incorrectly written override ports (using bsd.port.mk) might
produce end-less loops.  The old behaviour didn't correctly handle

15 years agoUpdate the kerberos5 build framework to work with heimdal 0.6.3.
Eirik Nygaard [Sun, 16 Jan 2005 14:25:47 +0000 (14:25 +0000)]
Update the kerberos5 build framework to work with heimdal 0.6.3.

Based on: Kerberos5 build framework from FreeBSD.

15 years agoMerge from vendor branch HEIMDAL:
Eirik Nygaard [Sun, 16 Jan 2005 14:07:46 +0000 (14:07 +0000)]
Merge from vendor branch HEIMDAL:
Add heimdal-0.6.3

15 years agoAdd heimdal-0.6.3
Eirik Nygaard [Sun, 16 Jan 2005 14:07:46 +0000 (14:07 +0000)]
Add heimdal-0.6.3

15 years agoAdd directory /usr/include/kadm5.
Eirik Nygaard [Sun, 16 Jan 2005 13:31:24 +0000 (13:31 +0000)]
Add directory /usr/include/kadm5.

Submitted by: Richard Nyberg <rnyberg@it.su.se>

15 years agoFix type. It is pkgs and not pksgs.
Eirik Nygaard [Sun, 16 Jan 2005 11:18:16 +0000 (11:18 +0000)]
Fix type. It is pkgs and not pksgs.

15 years agoRaise WARNS to 6:
Chris Pressey [Sun, 16 Jan 2005 04:59:53 +0000 (04:59 +0000)]
Raise WARNS to 6:
- Keep const parameters const while casting.

15 years agoRaise WARNS to 6.
Chris Pressey [Sun, 16 Jan 2005 04:28:00 +0000 (04:28 +0000)]
Raise WARNS to 6.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agoRaise WARNS to 6:
Chris Pressey [Sat, 15 Jan 2005 08:36:25 +0000 (08:36 +0000)]
Raise WARNS to 6:
- Constify a string constant;
- Compare a pointer with NULL, not zero.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agofalloc() was not returning an error code on failure.
Matthew Dillon [Fri, 14 Jan 2005 19:28:10 +0000 (19:28 +0000)]
falloc() was not returning an error code on failure.

Reported-by: David Rhodus <sdrhodus@gmail.com>
15 years agoBack out part of rev 1.24. The intention the quoting backfires and bad
Joerg Sonnenberger [Fri, 14 Jan 2005 11:30:16 +0000 (11:30 +0000)]
Back out part of rev 1.24. The intention the quoting backfires and bad
quoting is generated. Running 'make all-depends-list' in x11-fonts/libXft
does something like this:
PARENT_CHECKED=/usr/ports/x11-fonts/fontconfig /usr/ports/devel/pkgconfig
/usr/ports/print/freetype2 /usr/ports/devel/gmake /usr/ports/converters/libiconv

After quoting this becomes:
PARENT_CHECKED=/usr/ports/x11-fonts/fontconfig\ /usr/ports/devel/pkgconfi
/usr/ports/print/freetype2\ /usr/ports/devel/gmake\ /usr/ports/converters/libico

The next make tries to do this, the following happens:
before: PARENT_CHECKED=/usr/ports/x11-fonts/fontconfig /usr/ports/devel/pkgconfi
after: PARENT_CHECKED=/usr/ports/x11-fonts/fontconfig\ /usr/ports/devel/pkgconfi
and the final \\ confuses the shell.

Thanks to asmodai for suggesting a make problem as source.

15 years agoInstead of messing around with sprintf, use asprintf to do the allocation
Joerg Sonnenberger [Fri, 14 Jan 2005 07:14:15 +0000 (07:14 +0000)]
Instead of messing around with sprintf, use asprintf to do the allocation
for us. Don't read before the start of the string, if "" is passed in.

15 years agostrl* conversion.
Joerg Sonnenberger [Fri, 14 Jan 2005 07:03:59 +0000 (07:03 +0000)]
strl* conversion.

Original-patch-by: Andre Nathan <andre@digirati.com.br>
15 years agoReplace temporary allocation from alloca with malloc/free.
Joerg Sonnenberger [Fri, 14 Jan 2005 06:51:38 +0000 (06:51 +0000)]
Replace temporary allocation from alloca with malloc/free.

Requested-by: dillon
15 years agoRaise WARNS to 6:
Chris Pressey [Fri, 14 Jan 2005 06:38:41 +0000 (06:38 +0000)]
Raise WARNS to 6:
- Use a full array initializer element;
- Fix signedness issues.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
15 years agoRaise WARNS to 6.
Chris Pressey [Fri, 14 Jan 2005 06:02:45 +0000 (06:02 +0000)]
Raise WARNS to 6.

Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_dom>
15 years agoFix typo in error message.
Chris Pressey [Fri, 14 Jan 2005 06:00:04 +0000 (06:00 +0000)]
Fix typo in error message.

Submitted-by: Roland Hammerle <rjh_at_who_dot_net>
15 years agoTesting auth forwarding. Me am idiot!
Justin C. Sherrill [Fri, 14 Jan 2005 05:08:17 +0000 (05:08 +0000)]
Testing auth forwarding.  Me am idiot!

15 years agoMinor correction in umtx_*() calls, the mutex pointer should point to
Matthew Dillon [Fri, 14 Jan 2005 04:21:16 +0000 (04:21 +0000)]
Minor correction in umtx_*() calls, the mutex pointer should point to
volatile store.  Also correct the type, we are expecting to point to an

15 years agoMinor correction in umtx_*() calls, the mutex pointer should point to
Matthew Dillon [Fri, 14 Jan 2005 04:19:55 +0000 (04:19 +0000)]
Minor correction in umtx_*() calls, the mutex pointer should point to
volatile store.

15 years agoAdd umtx.c, a simple utility which implements userland mutexes using
Matthew Dillon [Fri, 14 Jan 2005 04:15:12 +0000 (04:15 +0000)]
Add umtx.c, a simple utility which implements userland mutexes using
the new umtx_*() system calls.  Compile normally and play around, e.g.:

umtx -v -t 10 /tmp/lock.dat sleep 5
umtx -v -t 10 /tmp/lock.dat ls

The test code includes some simple ^C cleanup code as well, though I
don't block signals during the global variable fixup so there is a race in
the ^C cleanup code.

15 years agoAdd missing kern_umtx.c to sys/conf/files.
Matthew Dillon [Fri, 14 Jan 2005 03:25:31 +0000 (03:25 +0000)]
Add missing kern_umtx.c to sys/conf/files.

Noticed-by: David Rhodus
15 years agoDon't remove /usr/bin/perl if it's a symlink, which was probably
YONETANI Tomokazu [Fri, 14 Jan 2005 03:13:51 +0000 (03:13 +0000)]
Don't remove /usr/bin/perl if it's a symlink, which was probably
created by `use.perl port'.

Ok'ed-by: David Rhodus

15 years agoInitial part of DEVICE_POLLING support for wi(4). Still some rough edges,
Joerg Sonnenberger [Fri, 14 Jan 2005 02:35:09 +0000 (02:35 +0000)]
Initial part of DEVICE_POLLING support for wi(4). Still some rough edges,
e.g. occasional timeouts, but working otherwise.

15 years agoInitial jail support for varsyms.
Joerg Sonnenberger [Fri, 14 Jan 2005 02:25:08 +0000 (02:25 +0000)]
Initial jail support for varsyms.

15 years agoAdd syscall primitives for generic userland accessible sleep/wakeup
Matthew Dillon [Fri, 14 Jan 2005 02:20:27 +0000 (02:20 +0000)]
Add syscall primitives for generic userland accessible sleep/wakeup
functions.  These functions are capable of sleeping and waking up based on
a generic user VM address.  Programs capable of sharing memory are also
capable of interaction through these functions.

Also regenerate our system calls.

umtx_sleep(ptr, matchvalue, timeout)

    If *(int *)ptr (userland pointer) does not match the matchvalue,
    sleep for timeout microseconds.  Access to the contents of *ptr plus
    entering the sleep is interlocked against calls to umtx_wakeup().
    Various error codes are turned depending on what causes the function
    to return.  Note that the timeout may not exceed 1 second.

utmx_wakeup(ptr, count)

    Wakeup at least count processes waiting on the specified userland
    address.  A count of 0 wakes all waiting processes up.  This function
    interlocks against umtx_sleep().

The typical race case showing resolution between two userland processes is
shown below.  A process releasing a contested mutex may adjust the contents
of the pointer after the kernel has tested *ptr in umtx_sleep(), but this does
not matter because the first process will see that the mutex is set to a
contested state and will call wakeup after changing the contents of the
pointer.  Thus, the kernel itself does not have to execute any
compare-and-exchange operations in order to support userland mutexes.

    PROCESS 1 PROCESS 2 ******** RACE#1 ******

    cmp_exg(ptr, FREE, HELD)
. cmp_exg(ptr, HELD, CONTESTED)
. umtx_sleep(ptr, CONTESTED, 0)
. [kernel tests *ptr]     <<<< COMPARE vs
    cmp_exg(CONTESTED, FREE) . <<<< CHANGE
. tsleep(....)
    umtx_wakeup(ptr, 1) .
. .
. .

    PROCESS 1 PROCESS 2 ******** RACE#2 ******

    cmp_exg(ptr, FREE, HELD)
cmp_exg(ptr, HELD, CONTESTED)
umtx_sleep(ptr, CONTESTED, 0)
    cmp_exg(CONTESTED, FREE) <<<< CHANGE vs
    umtx_wakeup(ptr, 1)
[kernel tests *ptr] <<<< COMPARE

These functions are very loosely based on Jeff Roberson's umtx work in
FreeBSD.  These functions are greatly simplified relative to that work in
order to provide a more generic mechanism.

This is precursor work for a port of David Xu's 1:1 userland threading

15 years agoRemove the old system perl binary when performing 'make upgrade'.
David Rhodus [Thu, 13 Jan 2005 23:29:40 +0000 (23:29 +0000)]
Remove the old system perl binary when performing 'make upgrade'.

This fixes several problems such a 'make index' which traversed the PATH
and would use the old system perl.

15 years agoFollowup note last commit: FreeBSD PR/66242, FreeBSD/1.68 originally
Matthew Dillon [Thu, 13 Jan 2005 23:20:07 +0000 (23:20 +0000)]
Followup note last commit: FreeBSD PR/66242, FreeBSD/1.68 originally
submitted by Dmitry Sivachenko.

15 years agoDo not early terminate if ^C is hit just as a valid job is returned by
Matthew Dillon [Thu, 13 Jan 2005 23:17:17 +0000 (23:17 +0000)]
Do not early terminate if ^C is hit just as a valid job is returned by
wait*(), otherwise the job termination will not be properly recorded.

15 years agoproc0 is still used by e.g. smbfs to fork off a kernel thread and certain
Matthew Dillon [Thu, 13 Jan 2005 23:10:11 +0000 (23:10 +0000)]
proc0 is still used by e.g. smbfs to fork off a kernel thread and certain
namecache records may be NULL.  Handle the case.

15 years agoOops, undo accidental commit. The last commit was not related to the
Matthew Dillon [Thu, 13 Jan 2005 23:08:03 +0000 (23:08 +0000)]
Oops, undo accidental commit.  The last commit was not related to the
datagram reconnection bug for these particular files.

15 years agowx(4) is gone. Also remove the module itself.
Sascha Wildner [Thu, 13 Jan 2005 23:06:05 +0000 (23:06 +0000)]
wx(4) is gone. Also remove the module itself.

15 years agoWhen re-connecting an already connected datagram socket be sure to clean
Matthew Dillon [Thu, 13 Jan 2005 23:05:32 +0000 (23:05 +0000)]
When re-connecting an already connected datagram socket be sure to clean
up its pending error state, which may be set in some rare conditions
resulting in the connect() syscall returning a bogus error and making
application believe that the attempt to change association has failed,
when in fact it has succeeded.

Submitted-by: Maxim Sobolev <sobomax@FreeBSD.org>
Taken-from: FreeBSD/1.225 (Maxim Sobolev)