Joerg Sonnenberger [Mon, 10 Jan 2005 17:40:32 +0000 (17:40 +0000)]
Fix two small bugs in getopt_long_only handling:
- a short option followed by a long option is parsed as that
(inspired by OpenBSD)
- the place variable has to be reset after long option parsing failed
Joerg Sonnenberger [Mon, 10 Jan 2005 16:45:15 +0000 (16:45 +0000)]
Add support for getopt_long_only. It allows using long options with a single
dash by prefering them over aggregated short options.
Max Okumoto [Mon, 10 Jan 2005 16:21:14 +0000 (16:21 +0000)]
- Move code into buff.c by converting #define macros to real functions.
Joerg Sonnenberger [Mon, 10 Jan 2005 15:38:16 +0000 (15:38 +0000)]
Move the handling of '--' as argument into getopt_internal. Add a parameter
to getopt_internal and getopt_internal_short to activate support for long
options. Disable the special 'W' handling for getopt(). Correctly handle
long option like arguments ('--l') as arguments '-' and 'l'.
Joerg Sonnenberger [Mon, 10 Jan 2005 14:11:40 +0000 (14:11 +0000)]
Move short option parsing into its own function. Constify the local char *
pointer.
Max Okumoto [Mon, 10 Jan 2005 12:36:06 +0000 (12:36 +0000)]
- Replace Buf_Discard(buf, size) with Buf_Clear(buf). This simplifies
the code, and make clear what is taking place.
YONETANI Tomokazu [Mon, 10 Jan 2005 05:00:37 +0000 (05:00 +0000)]
- clean up a leftover in binutils215/ld
- rm: /usr/libexec/binutils214: is a directory
Noticed-by: David Rhodus
Max Okumoto [Mon, 10 Jan 2005 01:07:42 +0000 (01:07 +0000)]
- Last of the easy constifications.
Max Okumoto [Sun, 9 Jan 2005 23:14:42 +0000 (23:14 +0000)]
- Constify more functions.
Max Okumoto [Sun, 9 Jan 2005 23:03:28 +0000 (23:03 +0000)]
- Cleanup white space. style(9)
Joerg Sonnenberger [Sun, 9 Jan 2005 22:50:10 +0000 (22:50 +0000)]
RIP Perl.
Max Okumoto [Sun, 9 Jan 2005 22:23:25 +0000 (22:23 +0000)]
- Moved unused argc, temp variable into small scope.
Max Okumoto [Sun, 9 Jan 2005 18:32:28 +0000 (18:32 +0000)]
Increase WARNS to 6
Max Okumoto [Sun, 9 Jan 2005 17:05:33 +0000 (17:05 +0000)]
- Move sh_builtin string array into shellneed(). It is the only
function that uses it.
- Correct comment describing shellneed() function.
- Since shellneed() can never return -1, remove code that checks
for it in the caller.
Liam J. Foy [Sun, 9 Jan 2005 16:20:54 +0000 (16:20 +0000)]
- Add WARNS 6 and make WARNS 6 clean
- Remove registers
- Move global variables into main()
- Static utmpcmp()
- Remove cast in switch()
- Remove duplicate utmpcmp prototype
- Minor cleanup (ANSI, remove (void))
- Add $DragonFly$ tag
Submitted by: Richard Bradshaw <theglassishalfempty@gmail.com>
Joerg Sonnenberger [Sun, 9 Jan 2005 16:01:23 +0000 (16:01 +0000)]
Don't create binutils 2.14 and perl directories. Remove perl and
binutils214 [later only, if gcc34 and binutils215 are installed].
Joerg Sonnenberger [Sun, 9 Jan 2005 15:41:38 +0000 (15:41 +0000)]
It's WARNS?=6, not WARNS=6.
Noticed-by: corecode.
Liam J. Foy [Sun, 9 Jan 2005 13:38:52 +0000 (13:38 +0000)]
- Add WARNS 6
Liam J. Foy [Sun, 9 Jan 2005 13:30:06 +0000 (13:30 +0000)]
- Add -k option for whois.krnic.net (hold details of IP address
allocations within Korea) - FreeBSD
- Remove unnecessary casts
- Constify
- Update man page to reflect new option (-k)
Chris Pressey [Sun, 9 Jan 2005 04:43:33 +0000 (04:43 +0000)]
Raise WARNS to 6:
- Add function prototypes.
- Rename a parameter.
Submitted-by: Larry Lansing <lansil_at_fuzzynerd_dot_com>
Matthew Dillon [Sun, 9 Jan 2005 03:06:48 +0000 (03:06 +0000)]
Add /sbin/mountctl to the build.
Matthew Dillon [Sun, 9 Jan 2005 03:06:14 +0000 (03:06 +0000)]
Revamp the argument format a bit, add basic suppot for creating, deleting,
and listing journals. None of the option features can be specified yet,
and the journaling code is only logging a few VOPs at the moment for testing
purposes, but you can actually create a journaling stream now.
Matthew Dillon [Sun, 9 Jan 2005 03:04:53 +0000 (03:04 +0000)]
Add support for retrieving the journal status via mountctl. Increase some
of the buffer limits.
Matthew Dillon [Sat, 8 Jan 2005 23:22:35 +0000 (23:22 +0000)]
This is the initial skeleton for the new mountctl utility. Manual page,
options parsing, sanity checks, and the scan-callback framework.
Max Okumoto [Sat, 8 Jan 2005 22:27:02 +0000 (22:27 +0000)]
Constify more functions.
Max Okumoto [Sat, 8 Jan 2005 21:58:23 +0000 (21:58 +0000)]
Constifying functions.
Joerg Sonnenberger [Sat, 8 Jan 2005 21:33:34 +0000 (21:33 +0000)]
ANSIfy. Fix various warnings. Statify.
Submitted-by: Peter Schuller <peter.schuller@infidyne.com>
Max Okumoto [Sat, 8 Jan 2005 20:17:05 +0000 (20:17 +0000)]
Constify more functions.
Chris Pressey [Sat, 8 Jan 2005 19:39:40 +0000 (19:39 +0000)]
Further cleanup:
- When fs_Bytes is zero, assign NULL (rather than "") to fs_Data.
- Check that fs_Bytes is nonzero before subsequently using fs_Data.
Requested-by: dillon
Tested-by: typical usage of installer
Joerg Sonnenberger [Sat, 8 Jan 2005 19:19:26 +0000 (19:19 +0000)]
Don't clobber match_str in buildmatch by strdup'ing the string internally.
Submitted-by: Peter Schuller <peter.schuller@infidyne.com>
Additionally remove func_name define, use __func__ instead.
Matthew Dillon [Sat, 8 Jan 2005 19:17:01 +0000 (19:17 +0000)]
Fix a memory leak in regex.
Submitted-by: Steve Mynott <steve.mynott@gmail.com>
Taken-from: http://www.freebsd.org/cgi/query-pr.cgi?pr=75656
Matthew Dillon [Sat, 8 Jan 2005 18:57:48 +0000 (18:57 +0000)]
Fix one of probably several smbfs issues. smbfs is improperly tracking
open() and close() calls and closing the remote FID on the last close().
This appears to be done due to the limited number of FIDs available.
The problem is that the vnode might still be referenced and used by mapped
memory (mmap), so smbfs_getpages and putpages will seg-fault the user
program if there is no open descriptor on the file.
For now temporarily reopen and reclose the file. This is inefficient, but
it should work. The whole tracking section of smbfs really needs a rewrite.
There are guarenteed to be many other issues with smbfs.
Reported-by: Rumko <rumcic@gmail.com>
Max Okumoto [Sat, 8 Jan 2005 13:13:22 +0000 (13:13 +0000)]
Add missing #include
Max Okumoto [Sat, 8 Jan 2005 12:38:32 +0000 (12:38 +0000)]
Constify more functions.
Matthew Dillon [Sat, 8 Jan 2005 11:58:46 +0000 (11:58 +0000)]
Do not specify the -B option when executing the sub-make. In the BSD
make, -B is a compatibility option to execute shell commands one per line.
In GNU make (as of vers 3.80) -B is --always-make, which forces all targets
to be made regardless of whether they are out of date or not.
Since both GNU make and our make use MAKEFLAGS to pass build flags between
invocations, -B gets propogated down the chain into the gnu make and blows
everything to itsy bitsy little pieces.
Max Okumoto [Sat, 8 Jan 2005 11:40:46 +0000 (11:40 +0000)]
Constify more functions.
Jeffrey Hsu [Sat, 8 Jan 2005 09:50:17 +0000 (09:50 +0000)]
Increase the default TCP maximum segment size from 512 to 1460.
The modern consensus is that 1500 is a safe MTU to use for the Internet.
Jeffrey Hsu [Sat, 8 Jan 2005 09:46:17 +0000 (09:46 +0000)]
Remove the sysctl options for altering the initial TCP congestion window size.
They violate the TCP spec and don't really buy the user anything, especially
now that we have RFC3390 support for larger initial window sizes on by default.
Jeffrey Hsu [Sat, 8 Jan 2005 09:26:32 +0000 (09:26 +0000)]
Remove the sysctl options for altering the initial TCP congestion window size.
They violate the TCP spec and don't really buy the user anything, especially
now that we have RFC3390 support for larger initial window sizes on by default.
Jeffrey Hsu [Sat, 8 Jan 2005 03:27:21 +0000 (03:27 +0000)]
Fix copyright notice.
Same as FreeBSD rev 1.9 to uthread_mattr_init.c and rev 1.8 to
uthread_mattr_kind_np.c.
Matthew Dillon [Fri, 7 Jan 2005 20:30:21 +0000 (20:30 +0000)]
While removing a memory leak, rev 1.32 introduced a
free-memory-and-reuse-it-after. Correct both problems and
make rcp -r work again under /etc/malloc.conf -> AJ.
Submitted-by: Xin LI <delphij@frontfree.net>
Taken-From: FreeBSD/1.37 charnier
PR: FreeBSD:bin/54969
Matthew Dillon [Fri, 7 Jan 2005 20:19:54 +0000 (20:19 +0000)]
Correct two bugs that may result in incorrect CBCP response for
administrator specified number.
The implementation in our version transmits extra zero byte that is a
violation of the Microsoft PPP Callback Control Protocol section 3.2[1].
This can lead to incorrect behavior on certain devices, as reported
in bin/50613.
Confirmed with: cbcp.c in ppp's cvs, rev. 1.4 and 1.15 [2]
Submitted-by: Xin LI <delphij@frontfree.net>
Taken-From: FreeBSD/rev1.7
Submitted-to-FreeBSD-by: Dmitry Pryanishnikov <dmitry at atlantis.dp.ua>
PR: FreeBSD:bin/50613
Matthew Dillon [Fri, 7 Jan 2005 20:15:47 +0000 (20:15 +0000)]
Merge ... FreeBSD rev. 1.36+1.37 of ip_nat.c. Conditionalize declarations
properly when LARGE_NAT is not defined.
Submitted-by: Xin LI <delphij@frontfree.net>
Max Okumoto [Fri, 7 Jan 2005 11:46:31 +0000 (11:46 +0000)]
Change variable name from retstr to ret. Reduce diffs between FreeBSD
Jeffrey Hsu [Fri, 7 Jan 2005 05:42:59 +0000 (05:42 +0000)]
Catch up to recent rtlookup() changes.
Submitted by: Tim Wickberg <me@k9mach3.org>
Chris Pressey [Fri, 7 Jan 2005 02:43:41 +0000 (02:43 +0000)]
Raise WARNS to 6:
- Constify a string variable;
- Parentheses around an assignment in a test.
And style(9):
- Remove casts to void when ignoring return values;
- Remove `register' keywords;
- Make check against '\0' explicit.
Chris Pressey [Fri, 7 Jan 2005 02:32:50 +0000 (02:32 +0000)]
Raise WARNS to 6:
- Make an extern declaration global.
And style(9):
- Remove `register' keywords;
- Braces around multiline blocks;
- Remove casts to void when ignoring return values;
- Make tests against NULL and 0 explicit;
- Untangle a particularly convoluted conditional printf().
Max Okumoto [Thu, 6 Jan 2005 23:29:09 +0000 (23:29 +0000)]
Add missing prototype that I missed with spliting up nonints.h
Chris Pressey [Thu, 6 Jan 2005 22:37:46 +0000 (22:37 +0000)]
Clarify/clean up code, make fewer assumptions about types:
- Store pids/gids/uids/devs in a union instead of casting to a long;
- Don't use the nonspecific LT_GENERIC list type;
- Add a more specific LT_PPID list type for parent pids;
- Use NODEV to indicate the lack of a specified device;
- Make the makelist() function more straightforward:
- use only one switch statement instead of two cascading ones;
- introduce a helper function parse_pid() to parse pids;
- No functional changes.
Matthew Dillon [Thu, 6 Jan 2005 22:31:16 +0000 (22:31 +0000)]
Fix a kernel crash that occurs when the SMB protocol stack is used. The
SMB protocol stack is still hacked to create a kernel thread with a
process structure attached to it (when we really ought to be using a pure
kernel thread... this is the only subsystem that still doesn't). However,
the SMB code was not properly cleaning the process structure up on exit
resulting in a corrupt process a list. A 'ps' equivalent occuring after
this situation occurs can crash the kernel.
Reported-by: Rumko <rumcic@gmail.com>
Max Okumoto [Thu, 6 Jan 2005 21:06:25 +0000 (21:06 +0000)]
enomem() is only used in one file, make it static.
Max Okumoto [Thu, 6 Jan 2005 21:04:20 +0000 (21:04 +0000)]
Removed unused routines:
Buf_GetByte()
Buf_GetBytes()
Buf_UngetByte()
Buf_UngetBytes()
Chris Pressey [Thu, 6 Jan 2005 21:00:33 +0000 (21:00 +0000)]
Style(9):
- braces around multiline blocks
- no blank line at start of function
- remove extraneous semicolon.
Jeffrey Hsu [Thu, 6 Jan 2005 17:59:32 +0000 (17:59 +0000)]
Now that I understand the poorly written BSD routing code and what
it was trying to do, rewrite it in a clear and concise manner.
The old rtalloc1() code written by CSRG had a number of problems:
1. it was not clear which route was being returned
2. it was not clear what was being reported
3. it hid the essential radix tree lookup operation inside a series of
conditional tests and inline assignments
4. it had multiple gotos to the inside of if statements
5. it intermixed reporting code with the operational logic of lookup
and cloning
6. it assigns multiple times to key variables
7. it has unnecessary assignments to key variables
8. it overloaded the "report" argument parameter, to have two
different semantics
9. it misnamed the key route lookup function "rtalloc1", obscuring all uses
of route lookup.
In contrast to the rtalloc1 code in FreeBSD 4 or the even more convoluted
rtalloc1 code in FreeBSD 5, the DragonFlyBSD version
A. has a clear control flow that makes the common case obvious
by highlighting the core call to the radix tree look up function,
eliminating gotos into if statements,
and completely separating out the special-case cloning logic
B. makes it clear which route is being returned
by only assigning once to the key "rt" variable
and by expliciting returning "rt" or "clonedroute"
C. abstracts out the reporting code into its own reporting API
D. cleans up the semantics of the "report" argument parameter to
only indicate whether to report a miss and not whether to clone
E. introduces a simple single-argument API for caller that want to clone
and those that do not.
Jeffrey Hsu [Thu, 6 Jan 2005 17:54:35 +0000 (17:54 +0000)]
Fix compile error.
Jeffrey Hsu [Thu, 6 Jan 2005 17:38:26 +0000 (17:38 +0000)]
Move a global variable into local scope for MP safety.
Joerg Sonnenberger [Thu, 6 Jan 2005 17:34:25 +0000 (17:34 +0000)]
style(9) cleanup.
Joerg Sonnenberger [Thu, 6 Jan 2005 17:32:44 +0000 (17:32 +0000)]
Add _DIAGASSERT macro for library internal usage. This is not active by
default.
Obtained-from: NetBSD
Sascha Wildner [Thu, 6 Jan 2005 14:54:57 +0000 (14:54 +0000)]
- Fix a comment typo.
- Fix bogus ${FOO:Mbar} tests where the actual intent is to check
if the result set is empty. While here, replace non-bogus empty
string comparisons with equivalent empty() checks.
[FreeBSD rev. 1.68]
Max Okumoto [Thu, 6 Jan 2005 13:18:58 +0000 (13:18 +0000)]
Hiding pointer in typedefs is evil. 'Buffer *' -> 'Buffer'
Max Okumoto [Thu, 6 Jan 2005 11:41:47 +0000 (11:41 +0000)]
Add missing header files to CVS, for check in on 2005/01/06 10:52:59.
Max Okumoto [Thu, 6 Jan 2005 11:35:27 +0000 (11:35 +0000)]
Merge the remaining lst routines into a single file, and remove
the single function files.
Max Okumoto [Thu, 6 Jan 2005 10:53:00 +0000 (10:53 +0000)]
Clean up include header mess. Split nonints into separate header files.
Headers now only include other headers so they can compile. Source
files include all required headers.
Jeffrey Hsu [Thu, 6 Jan 2005 09:14:13 +0000 (09:14 +0000)]
Cosmetic cleanups.
Jeroen Ruigrok/asmodai [Thu, 6 Jan 2005 08:43:35 +0000 (08:43 +0000)]
Add icmp6 alias.
Submitted by: Jake Maciejewski
Jeroen Ruigrok/asmodai [Thu, 6 Jan 2005 08:33:11 +0000 (08:33 +0000)]
Get rid of the register keyword.
Submitted by: Steve Mynott
Matthew Dillon [Thu, 6 Jan 2005 05:23:45 +0000 (05:23 +0000)]
Make sure the temporary .c file generated from the .y file is properly
removed by the make clean target.
Chris Pressey [Thu, 6 Jan 2005 03:21:00 +0000 (03:21 +0000)]
Raise WARNS of newfs to 6:
- Use static char buffer instead of string constant;
- Move and add some function prototypes;
- Don't reuse a scratch variable, use a real pid_t to hold the
result of a fork();
- Cast variables as needed (mainly to u_long and u_int32) to avoid
signed-unsigned comparison warnings;
- Rename some variables to avoid name clashes;
- Mark some parameters as unused;
- Add MOPT_NULL as a struct mntopt constant for terminating a list.
And apply some style(9):
- Move out some loop invariant code, for clarity;
- Remove `register' keywords;
- Make explicit some checks against NULL.
Based-on-patch-by: Peter Schuller
<peter_dot_schuller_at_infidyne_dot_com>
Tested-by: typical usage of installer
Sascha Wildner [Thu, 6 Jan 2005 01:20:01 +0000 (01:20 +0000)]
Replace perl code with a sed script.
Max Okumoto [Thu, 6 Jan 2005 00:24:37 +0000 (00:24 +0000)]
Removed unintentional added macro.
Max Okumoto [Wed, 5 Jan 2005 23:32:25 +0000 (23:32 +0000)]
Fix compilation for the USE_KQUEUE case.
Submitted by: Emil Mikulic <emikulic@dmr.ath.cx>
Taken-from: FreeBSD
Author: harti
Max Okumoto [Wed, 5 Jan 2005 23:30:35 +0000 (23:30 +0000)]
maxJobs is declared extern in job.h so it cannot be static in job.c.
Submitted by: Andreas Jochens; Robert Millan <rmh@debian.org>
PR: bin/75210
Taken-from: FreeBSD
Author: harti
Max Okumoto [Wed, 5 Jan 2005 23:28:20 +0000 (23:28 +0000)]
Remove cleanup functions. There is no reason to free memory
just before exiting (especially given the number of memory leaks) -
it just costs time.
Taken-from: FreeBSD
Author: harti
Max Okumoto [Wed, 5 Jan 2005 22:21:46 +0000 (22:21 +0000)]
Reduce diff between FreeBSD. kqueue code doesn't crash the kernel.
Joerg Sonnenberger [Wed, 5 Jan 2005 22:03:51 +0000 (22:03 +0000)]
Unhook Perl from build.
Max Okumoto [Wed, 5 Jan 2005 20:10:40 +0000 (20:10 +0000)]
Move VarREError() to different position in var.c to reduce diffs from FReeBSD.
Liam J. Foy [Wed, 5 Jan 2005 18:42:33 +0000 (18:42 +0000)]
- Remove both sys/wait.h & sys/types.h - unnecessary
- Remove registers
- Static functions & Constify arguments
Joerg Sonnenberger [Wed, 5 Jan 2005 18:21:20 +0000 (18:21 +0000)]
Move sa_X macros under _KERNEL protection for now.
Liam J. Foy [Wed, 5 Jan 2005 16:24:19 +0000 (16:24 +0000)]
- UNIX conformance: If -r -f on non-existent directory, don't emit error.
(FreeBSD, 1.52)
- Constify
Ok'ed by: Joerg@
Joerg Sonnenberger [Wed, 5 Jan 2005 15:33:11 +0000 (15:33 +0000)]
Mark binutils-2.14 as dead.
Joerg Sonnenberger [Wed, 5 Jan 2005 15:26:05 +0000 (15:26 +0000)]
WARNS=6 safeness:
- GC myname, not used
- constify a lot of string references
- remove done(), use atexit instead
- fix the signal handler, it must not call fclose and can't use exit therefore
- rename local variables which collidate with globals
Joerg Sonnenberger [Wed, 5 Jan 2005 15:14:04 +0000 (15:14 +0000)]
Merge FreeBSD rev 1.70:
When specifying an interface to ifconfig, first look up the interface
index, then retrieve statistics for that index, rather than retrieving
all interfaces and then looking for a matching name. This allows the
user to refer to an interface via an alias name.
Joerg Sonnenberger [Wed, 5 Jan 2005 11:51:18 +0000 (11:51 +0000)]
Add ISO C99's _Exit, which is identical to _exit.
Chris Pressey [Wed, 5 Jan 2005 02:40:23 +0000 (02:40 +0000)]
Raise WARNS to 6:
- Constify some strings;
- Remove `register' and/or add `int' to variable declarations
as appropriate.
Chris Pressey [Wed, 5 Jan 2005 02:33:25 +0000 (02:33 +0000)]
Raise WARNS to 6.
Chris Pressey [Wed, 5 Jan 2005 02:30:23 +0000 (02:30 +0000)]
Raise WARNS to 6.
Chris Pressey [Wed, 5 Jan 2005 00:46:52 +0000 (00:46 +0000)]
Raise WARNS to 6:
- Mark a parameter as unused.
Chris Pressey [Wed, 5 Jan 2005 00:45:31 +0000 (00:45 +0000)]
Raise WARNS to 6.
Chris Pressey [Wed, 5 Jan 2005 00:38:38 +0000 (00:38 +0000)]
Raise WARNS to 6.
Chris Pressey [Wed, 5 Jan 2005 00:34:36 +0000 (00:34 +0000)]
Raise WARNS to 6:
- Constify a string.
Chris Pressey [Wed, 5 Jan 2005 00:33:50 +0000 (00:33 +0000)]
Raise WARNS to 6:
- Constify the typecast in a macro.
Chris Pressey [Wed, 5 Jan 2005 00:32:50 +0000 (00:32 +0000)]
Raise WARNS to 6:
- Initialize a variable before use.
Matthew Dillon [Tue, 4 Jan 2005 23:08:13 +0000 (23:08 +0000)]
WARNS 2->6 and a minor code readability cleanup.
Submitted-by: Jeandre du Toit <jeandre.dutoit@gmail.com>
Joerg Sonnenberger [Tue, 4 Jan 2005 22:25:26 +0000 (22:25 +0000)]
Don't install old GDB documentation.
Joerg Sonnenberger [Tue, 4 Jan 2005 20:00:34 +0000 (20:00 +0000)]
RIP
Joerg Sonnenberger [Tue, 4 Jan 2005 19:58:53 +0000 (19:58 +0000)]
Merge from vendor branch DHCP:
Update isc-dhcp to 3.0.2rc3 using patch infrastructure.
Also include the server and relay, but currently without rcNG script.
Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Joerg Sonnenberger [Tue, 4 Jan 2005 19:58:54 +0000 (19:58 +0000)]
Update isc-dhcp to 3.0.2rc3 using patch infrastructure.
Also include the server and relay, but currently without rcNG script.
Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Joerg Sonnenberger [Tue, 4 Jan 2005 19:58:53 +0000 (19:58 +0000)]
Update isc-dhcp to 3.0.2rc3 using patch infrastructure.
Also include the server and relay, but currently without rcNG script.
Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
Joerg Sonnenberger [Tue, 4 Jan 2005 19:14:18 +0000 (19:14 +0000)]
Switch from binutils 2.14 to binutils 2.15.
Joerg Sonnenberger [Tue, 4 Jan 2005 18:56:58 +0000 (18:56 +0000)]
Replace sockstat(1) Perl script with the C version from FreeBSD 5.
This doesn't use the binary scan to determine the buffer size, but
calls the sysctl directly twice.
More work is needed to separate the lists again, but this can be
done in tree.