dragonfly.git
19 years agoRemove unnecessary weird locking macro I added to blindly replace
YONETANI Tomokazu [Fri, 10 Dec 2004 04:09:46 +0000 (04:09 +0000)]
Remove unnecessary weird locking macro I added to blindly replace
mtx_*() functions. Original code needed the mutex functions because
spl*() functions are practically no-ops on FreeBSD 5.x and later
while they aren't on FreeBSD 4.x or DragonFly. Tested on both UP
and SMP boxes without a problem. No noticeable difference on
performance though.
DragonFly_Stable tag will be slipped in a few days if no bug reports
are posted to bugs@.

19 years agoAdd code to enforce the paralleism count (-j N) for the entire tree
Max Okumoto [Fri, 10 Dec 2004 01:16:25 +0000 (01:16 +0000)]
Add code to enforce the paralleism count (-j N) for the entire tree
of submakes spawned during processing.

We create a fifo and stuff one character into it for each job we are
allowed to run.  The name of the fifo is passed to child processes
in the MAKE_JOBS_FIFO environment variable.

A make which finds this variable on startup will open the fifo and
only spawn jobs when it managed to read a token from the fifo.
When the job completes a token is writen back to the fifo.

Slave make processes get one token for free: the one their parent
make got in order to run them.  This makes the make processes
themselves invisible in the process counts.

The net effect is that "make -j 12 -s buildworld" will start at
most 12 jobs at the same time, instead of as previously up to
65 jobs would get started.

Taken-from: FreeBSD
Author: phk

19 years agoReduce the casts off NULL in comparison with a pointer.
Max Okumoto [Fri, 10 Dec 2004 01:13:24 +0000 (01:13 +0000)]
Reduce the casts off NULL in comparison with a pointer.

19 years agoo Allow use of the ${MAKE_SHELL} variable to specify alternate
Max Okumoto [Fri, 10 Dec 2004 01:03:46 +0000 (01:03 +0000)]
o Allow use of the ${MAKE_SHELL} variable to specify alternate
  shells for make(1) to use.  Setting it to "sh" and "ksh" are the
  only values which work right ATM; I wouldn't expect "csh" to get
  you far ;)

o Include -DDEFSHELL=1 in Makefile.dist so people boostrapping will
  have a sane default.  And add DragonFly tag

o Add ability to use csh(1) as the make(1) shell.

o Expand the scope of the .SHELL specification to also cover the
  compat mode of operation and the != operator.

  While here, fixed a bug in the .SHELL directive processing when
  only the name= attribute is specified and no built-in shell matches
  this name, causing null pointer dereference.

o Fix a very long-standing error in handling .SHELL targets: this
  target uses the brk_string function to parse the line. That
  function uses static storage for both the expanded string and the
  returned argv[] vector.   The JobParseShell function simply stored
  away pointers into this static storage. On the next use of something
  like ${FOO:O} this storage would get overwritten with fatal
  results.

  This also allows us to make the shells[] array const bringing us
  one step further in making make WARNS=4 ready.

o Constify the array of predefined shells. It turns out that we
  need two versions of the structure definition for this: one with
  const char pointers, because otherwise gcc won't let us initialize
  the fields with constant strings, and one without the const,
  because we need to work with the structure.

Note: This patch is really a hack for a coping with slow /bin/sh.
      We are importing it to reduce the differences between us and
      the FreeBSD version.

19 years agoTake advantage of the .Nm utility. It remembers the first argument
Max Okumoto [Fri, 10 Dec 2004 00:41:06 +0000 (00:41 +0000)]
Take advantage of the .Nm utility.  It remembers the first argument
it was called with.

19 years agoo Reduce warns by adding default case to switch.
Max Okumoto [Fri, 10 Dec 2004 00:38:21 +0000 (00:38 +0000)]
o Reduce warns by adding default case to switch.
o Constify char pointer.

19 years agoMove catch_child() to reduce diffs between FreeBSD make.
Max Okumoto [Thu, 9 Dec 2004 23:33:36 +0000 (23:33 +0000)]
Move catch_child() to reduce diffs between FreeBSD make.

19 years agoAdd missing function description.
Max Okumoto [Thu, 9 Dec 2004 21:31:10 +0000 (21:31 +0000)]
Add missing function description.

Max

19 years agoChange a couple of the primitve list functions to be macros. This changes
Max Okumoto [Thu, 9 Dec 2004 19:16:03 +0000 (19:16 +0000)]
Change a couple of the primitve list functions to be macros. This changes
the semantic of Lst_Datum which formerly returned NULL when the argument
node was NULL. There was only one place in the source that relied on this
so change that place.

Taken-From: FreeBSD
Author: harti

19 years agoUse typedefs for the types of the functions that are passed as
Max Okumoto [Thu, 9 Dec 2004 19:08:36 +0000 (19:08 +0000)]
Use typedefs for the types of the functions that are passed as
arguments to the list functions for better readability.

19 years agoCache a pointer the last mbuf in the sockbuf for faster insertion.
Jeffrey Hsu [Wed, 8 Dec 2004 23:59:01 +0000 (23:59 +0000)]
Cache a pointer the last mbuf in the sockbuf for faster insertion.
Update it on sockbuf insertion and deletion and on user reads.
Add a new sbappendstream() function that inserts in constant time.
Use it for TCP.

19 years agoImplement generation counters as (at least) 64 bit counters. The increment
Joerg Sonnenberger [Wed, 8 Dec 2004 23:19:51 +0000 (23:19 +0000)]
Implement generation counters as (at least) 64 bit counters. The increment
and get operations are interrupt safe, but not MP-safe.

The gencount_inc implementation uses critical sections, which is the best
possible for generic IA32 code.

19 years ago- Whoops! I missed some from the previous commit. My bad, sorry.
Liam J. Foy [Wed, 8 Dec 2004 22:26:42 +0000 (22:26 +0000)]
- Whoops! I missed some from the previous commit. My bad, sorry.

Ok'ed by: Joerg@

19 years ago- Check the return value of setenv(). We should check this value since
Liam J. Foy [Wed, 8 Dec 2004 22:00:32 +0000 (22:00 +0000)]
- Check the return value of setenv(). We should check this value since
  setenv() uses both malloc and realloc.

19 years agoMark the following stuff as depricated:
Joerg Sonnenberger [Wed, 8 Dec 2004 20:36:39 +0000 (20:36 +0000)]
Mark the following stuff as depricated:
- GPLed math emulator
- GPLed dgb driver
- GPLed awe driver
- old pre-newbus rp driver (use nrp instead)
- OLDCARD aka pcic (also not build as module by default)

This can be temporary reviewd by adding "options I_WANT_DEPRICATED_STUFF"
to the kernel config. This drivers will move into the attic two
weeks from now if noone complains.

19 years ago- We should always check the setenv() call. Why? because it uses
Liam J. Foy [Wed, 8 Dec 2004 20:17:12 +0000 (20:17 +0000)]
- We should always check the setenv() call. Why? because it uses
  both realloc and malloc.
- Remove unnecessary casts.
- Bump WARNS to 6

19 years agoTrying again. Anyone see this mail?
Max Okumoto [Wed, 8 Dec 2004 19:45:30 +0000 (19:45 +0000)]
Trying again.  Anyone see this mail?

Max

19 years agoAdd my stuff.
Max Okumoto [Wed, 8 Dec 2004 19:08:25 +0000 (19:08 +0000)]
Add my stuff.

19 years agotest
Matthew Dillon [Wed, 8 Dec 2004 19:00:58 +0000 (19:00 +0000)]
test

19 years agoUnlock the namecache record when traversing a mount point, then relock and
Matthew Dillon [Wed, 8 Dec 2004 18:53:27 +0000 (18:53 +0000)]
Unlock the namecache record when traversing a mount point, then relock and
recheck for consistency.  This fixes a deadlock on e.g. dead NFS mounts.

Reported-by: David Rhodus <sdrhodus@gmail.com>
19 years agoMerge the contents of lstInt.h into the public lst.h. This let's us get
Max Okumoto [Wed, 8 Dec 2004 11:26:39 +0000 (11:26 +0000)]
Merge the contents of lstInt.h into the public lst.h. This let's us get
rid of a lot of uneccesary casts and temporary variables that have just
obfuscated the code. This also let's us implement a couple of the one-
liner list functions as macros (the first one is Lst_IsEmpty) and
simplify life once we start to throw consts on the code.

Taken-from: FreeBSD
Author: harti

19 years agoStyle: prototypes, un-register and remove some empty lines.
Max Okumoto [Wed, 8 Dec 2004 11:07:35 +0000 (11:07 +0000)]
Style: prototypes, un-register and remove some empty lines.

Taken-from: FreeBSD
Author: harti

19 years agoo Include sys/sysctl.h on all architectures not only i386.
Max Okumoto [Wed, 8 Dec 2004 10:55:16 +0000 (10:55 +0000)]
o Include sys/sysctl.h on all architectures not only i386.
o Increased WARNS to 3

Taken-from: FreeBSD
Author: harti

19 years agoTest if I can change this file.
Max Okumoto [Wed, 8 Dec 2004 08:39:40 +0000 (08:39 +0000)]
Test if I can change this file.
Removed some old text.
Max

19 years agoadd ServeRAID disk node to `MAKEDEV all' for many(> 1) people's convenience.
YONETANI Tomokazu [Wed, 8 Dec 2004 01:26:17 +0000 (01:26 +0000)]
add ServeRAID disk node to `MAKEDEV all' for many(> 1) people's convenience.

19 years ago- Remove signal.h
Liam J. Foy [Mon, 6 Dec 2004 21:13:51 +0000 (21:13 +0000)]
- Remove signal.h
- Add usage
- Static functions
- Add verbose option (nice to know what failed etc)
- Use getopt for consistency
- Make size of buf MAXPATHLEN
- Make WARNS 6 clean
- Add WARNS?= 6 to Makefile
- Update procctl man page accordingly

OK'ed by: Joerg@

19 years agoDon't include the "Hello, world" example in libz.
Joerg Sonnenberger [Mon, 6 Dec 2004 11:29:51 +0000 (11:29 +0000)]
Don't include the "Hello, world" example in libz.

19 years agoHandle all types of interrupts when operating the uhci(4) controller in
David Rhodus [Sun, 5 Dec 2004 04:24:42 +0000 (04:24 +0000)]
Handle all types of interrupts when operating the uhci(4) controller in
polled mode.

from fbsd pr: 73000

19 years agoAccept resets sent while the receive window is zero.
Jeffrey Hsu [Sat, 4 Dec 2004 21:48:25 +0000 (21:48 +0000)]
Accept resets sent while the receive window is zero.

Alternative fix to FreeBSD bug kern/72502.

19 years agoFix the boottime calculation when the time of day is set in absolute terms.
Matthew Dillon [Sat, 4 Dec 2004 20:38:45 +0000 (20:38 +0000)]
Fix the boottime calculation when the time of day is set in absolute terms.
We want boottime to be calculated based on the current real time minus our
best uptime guess.  gd_time_seconds survives a lot of time issues and is our
best uptime guess and since it is already used to calculate the new basetime,
we can just assign boottime to basetime.

Note that boottime is not defined quite the same way as basetime.  The
system's internal timebase is not compensated for drift or ever jumped,
and is guarenteed to be monotonically increasing.  Drift compensation is
accomplished by adjusting basetime, so basetime will always slowly diverge
from boottime if e.g. ntpd is running.

Submitted-by: Paul Herman <pherman@frenchfries.net>
19 years agoHandle window updates inside header prediction to increase the hit rate.
Jeffrey Hsu [Sat, 4 Dec 2004 10:14:27 +0000 (10:14 +0000)]
Handle window updates inside header prediction to increase the hit rate.

19 years agoWe have to replicate listening IPv6 sockets in the wildcard table
Jeffrey Hsu [Sat, 4 Dec 2004 06:27:59 +0000 (06:27 +0000)]
We have to replicate listening IPv6 sockets in the wildcard table
because they're also used to match incoming IPv4 connections.

19 years agoReturn retval if the second sysctl failed, not NULL.
Joerg Sonnenberger [Sat, 4 Dec 2004 00:34:36 +0000 (00:34 +0000)]
Return retval if the second sysctl failed, not NULL.

19 years ago- strings.h -> string.h
Liam J. Foy [Fri, 3 Dec 2004 22:51:47 +0000 (22:51 +0000)]
- strings.h -> string.h
- Malloc sets errno. Use err and not errx.
- Static functions
- Make WARNS 6 clean
- Add WARNS?= 6

19 years agoReplace div_pcblist / rip_pcblist / udp_pcblist with in_pcblist_global.
Joerg Sonnenberger [Fri, 3 Dec 2004 20:29:53 +0000 (20:29 +0000)]
Replace div_pcblist / rip_pcblist / udp_pcblist with in_pcblist_global.
This is a slight change of semantic for rip sockets, which have now a
jail check too.

19 years agoMake rp(4) compilable again. Don't even think about unloading this stuff.
Joerg Sonnenberger [Fri, 3 Dec 2004 17:59:20 +0000 (17:59 +0000)]
Make rp(4) compilable again. Don't even think about unloading this stuff.

Spotted-by: corecode.
Fix a warning by not inling functions used only once.

19 years agoRemove unused tcpdump sources.
Joerg Sonnenberger [Fri, 3 Dec 2004 16:05:43 +0000 (16:05 +0000)]
Remove unused tcpdump sources.

19 years agoDon't read userland pointers directly, copy them first into kernel land
Joerg Sonnenberger [Wed, 1 Dec 2004 21:38:50 +0000 (21:38 +0000)]
Don't read userland pointers directly, copy them first into kernel land
and verify the location.

Security-fix for CAN-2004-1066 (FreeBSD-SA-04:17.procfs).

Submitted-by: Colin Percival <colin.percival@wadham.ox.ac.uk>
Credits: Bryan Fulton, Ted Unangst, and the SWAT analysis tool
         Coverity, Inc.

19 years ago- Remove registers from rcorder
Liam J. Foy [Wed, 1 Dec 2004 19:44:53 +0000 (19:44 +0000)]
- Remove registers from rcorder
- Bump WARNS upto 6 while here

Submitted by: Steve Mynott <steve.mynott@gmail.com>

19 years ago- Remove unnecessary casts
Liam J. Foy [Wed, 1 Dec 2004 18:27:06 +0000 (18:27 +0000)]
- Remove unnecessary casts
- Static usage
- Add WARNS 6
- Add $DragonFly$ tag

19 years agojob.c: 1.51->1.52
Joerg Sonnenberger [Wed, 1 Dec 2004 15:50:51 +0000 (15:50 +0000)]
job.c: 1.51->1.52
Author: ru
Log:
"unset verbose" is 13 characters, not 10.

job.c:1.58->1.59
Author: harti
Log:
Get rid of the shell table sentinel. It isn't needed anymore because
JobMatchShell returns NULL when no shell name matches since revision 1.51.

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Use __arysize(shells) instead of expanding it manually.

19 years agocompat.c:1.38->1.39
Joerg Sonnenberger [Wed, 1 Dec 2004 15:44:20 +0000 (15:44 +0000)]
compat.c:1.38->1.39
job.c:1.55->1.56
Author: harti
Log:
Fix a (very) long standing bug in make (this has been there probably
from the beginning). Make used to handle all its interrupt-time stuff
directly from the signal handler, including calls to printf, accessing
global data and so on. This is of course wrong and could provoke a core
dump when interrupting make. Just set a flag in the signal handler and
do everything else from the main thread.

PR:             bin/29103

config.h:1.14->1.15
main.c:1.97->1.98
parse.c:1.57->1.58
Author: harti
Log:
Eliminate the define for POSIX and build with Posix behaviour.
Our make has been build with POSIX enabled from the first day
and the ifdef'ed out code served no purpose.

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agocond.c:1.27->1.28
Joerg Sonnenberger [Wed, 1 Dec 2004 15:17:28 +0000 (15:17 +0000)]
cond.c:1.27->1.28
make.h:1.23->1.24
parse.c:1.55->1.56
Author: harti
Log:
Improve make's diagnostic of mistmatched .if-.endif. This patch is
slightly different from the patch in the PR. The problem is, that
make handles .if clauses inside false .if clauses simply by
counting them - it doesn't put them onto the conditional stack, nor even
parses them so we need an extra line number stack for these ifs.

PR:             bin/61257
Submitted by:   Mikhail Teterin <mi@aldan.algebra.com>

parse.c:1.56->1.57
uthor: harti
Log:
Fix handling of comments on .elif lines. The patch given in a followup
to the PR failed, because the line skipping function is actually called
from two places in the code to do quite different things (this should
be two functions probably): in a false .if to skip to the next line
beginning with a dot and to collect .for loops. In the seconds case we
should not skip comments, because they are actually harder to handle than
we need for the .if case and should defer this to the main code.

PR:             bin/25627
Submitted by:   Seth Kingsley (original patch)

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agovar.c: 1.44->1.45
Joerg Sonnenberger [Wed, 1 Dec 2004 15:09:44 +0000 (15:09 +0000)]
var.c: 1.44->1.45
Author: ru
Log:
Moved the code for :U and :L modifiers where it belongs, so that
the fallback for SysV (now in POSIX) variable substitution works
for old_string arguments starting with 'U' or 'L'.

var.c:1.45->1.46
Author: harti
Log:
Allow variable substitutions in SYSV variable substitutions like
$(SRC:.c=$O). This brings us closer to other makes.

Reviewed by:    ru
Obtained from:  NetBSD

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agovar.c: 1.42->1.43
Joerg Sonnenberger [Wed, 1 Dec 2004 15:06:55 +0000 (15:06 +0000)]
var.c: 1.42->1.43
make.1: 1.63->1.64
Author: marcel, ru
Log:
Implement the O modifier. The O modifier sorts the words in a
variable. The implementation is based upon the patch sent to
arch@, but modified to be compatible with NetBSD. The modifier
that does a reverse sort has been dropped for now, but the
ability to add one later has been preserved.

Document the `O' modifier.

19 years agoAdd rdate(8). This supports both SNTP(RFC 2030) and RFC 868.
Joerg Sonnenberger [Wed, 1 Dec 2004 15:04:43 +0000 (15:04 +0000)]
Add rdate(8). This supports both SNTP(RFC 2030) and RFC 868.

Obtained-from: OpenBSD

19 years agoMove ntp.org's ntp into the attic.
Joerg Sonnenberger [Wed, 1 Dec 2004 14:17:22 +0000 (14:17 +0000)]
Move ntp.org's ntp into the attic.

19 years agoChange the default for ntpd back to -s, the bug which triggered this
Joerg Sonnenberger [Wed, 1 Dec 2004 04:16:42 +0000 (04:16 +0000)]
Change the default for ntpd back to -s, the bug which triggered this
has been fixed.

19 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Merge from vendor branch NTPD:
Force commited to annotate missing log message.

Sync with OpenBSD. Most of the local changes have been merged back.

This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.

19 years agoForce commited to annotate missing log message.
Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Force commited to annotate missing log message.

Sync with OpenBSD. Most of the local changes have been merged back.

This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.

19 years agoForce commited to annotate missing log message.
Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Force commited to annotate missing log message.

Sync with OpenBSD. Most of the local changes have been merged back.

This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.

19 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
Merge from vendor branch NTPD:
*** empty log message ***

19 years ago*** empty log message ***
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
*** empty log message ***

19 years ago*** empty log message ***
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
*** empty log message ***

19 years agojob.c:1.52->1.53
Joerg Sonnenberger [Wed, 1 Dec 2004 02:02:14 +0000 (02:02 +0000)]
job.c:1.52->1.53
job.h:1.22->1.23
main.c:1.92->1.93
Author: harti
Log:
Remove the remote stuff from make. This actually never worked in our make
because the necessary files were not imported with the original import.
If somebody really needs it, there is still the devel/pmake port.

This is just the first step and removes just everything that is ifdef'ed out.
Otherwise the code is unchanged.

Checked by:     md5

Approved by:    no objections on arch@

config.h:1.12->1.13
job.c:1.53->1.54
job.h:1.23->1.24
Author: harti
Log:
Now with the remote job support removed there can be no remote jobs and
no jobs that need to be remigrated. Remove the flags and the associated
code.

config.h:1.13->1.14
main.c:1.93->1.94
Author: phk
Log:
Get rid of now unused maxLocal variables.

job.c:1.54->1.55
job.h:1.24->1.25
main.c:1.94->1.95
Author: phk
Log:
Get rid of more local/remote leftovers

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agomake.1: 1.77->1.78
Joerg Sonnenberger [Wed, 1 Dec 2004 01:31:52 +0000 (01:31 +0000)]
make.1: 1.77->1.78
Author: harti
Log:
Make explicit that MAKEOBJDIRPREFIX and MAKOBJDIR must be set
as environment variables and should not be set on make's command
line. They happen to work accidentially as command line variables
too when none of the sub-makes wants to play games with them (because
make is putting command line variables into the environment and will
find them there later on). Makefile.inc1 wants to change
MAKEOBJDIRPREFIX. In this case one cannot set it on the command line.

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoMakefile: 1.32->1.33
Joerg Sonnenberger [Wed, 1 Dec 2004 01:29:31 +0000 (01:29 +0000)]
Makefile: 1.32->1.33
main.c: 1.90->1.91
nonints.h: 1.22->1.23
var.c: 1.47->1.48
Author: harti
Log:
Put variable assignments on .MAKEFLAGS and .MFLAGS targets into
the .MAKEFLAGS variable so that these are also passed to sub-makes.
This makes the handling of variables in the command environment more
consistent.

PR:             bin/68853
Submitted by:   Martin Kamerhofer <data@sbox.tugraz.at>

make.1:1.78->1.79
Author: ru
Log:
Document the effects of modifying the .MAKEFLAGS internal
variable and using the .MAKEFLAGS special target, and the
differences between them.

Reviewed by:    harti

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Slightly adjust the change Var_Quote to not cast away a const.

19 years agoMakefile: 1.31->1.32
Joerg Sonnenberger [Wed, 1 Dec 2004 01:10:17 +0000 (01:10 +0000)]
Makefile: 1.31->1.32
main.c: 1.89->1.90
nonints.h: 1.21->1.22
var.c: 1.46->1.47
Author: harti
Log:
Put variable assignments from the command line into the MAKEFLAGS
variable as required by POSIX. This causes such variables to be
pushed into all sub-makes called by the make (except when the MAKEFLAGS
variable is explicitely changed in the sub-make's environment).
This makes them also mostly un-overrideable in sub-makes except on the
sub-make's command line. Therefor specifying 'make CC=icc' will cause
icc to be used as C compiler in all sub-makes no matter what the Makefiles
itself try to do to the CC variable.

This patch also corrects the handling of the MFLAGS variable. MFLAGS
contains all the command line flags but not the command line variable
assignments. The evaluation of the .MFLAGS or .MAKEFLAGS target now
changes both MFLAGS and MAKEFLAGS (they used to change MAKEFLAGS only).
Makefiles can use MFLAGS for their own purposes given that they do not
except MFLAGS to be undefined at the beginning and that they don't evaluate
.MFLAGS or .MAKEFLAGS. MFLAGS should be removed for POSIX compliance,
but it is unfortunately heavily used by the X makefiles.

This has been extensively tested by port builds (thanks to portmgr), new
worlds and kernels.

PR:             standards/57295 (1st part above)
Submitted by:   James E. Flemer <jflemer@alum.rpi.edu>
Approved by:    portmgr
Obtained from:  NetBSD (1st part above)
MFC after:      4 weeks

make.1: 1.75->1.76
Author: harti
Log:
Correct the description of the MFLAGS and .MAKEFLAGS variables. Add
the MFLAGS target. Document that variable assignments from the MAKEFLAGS
environment variable and the .MAKEFLAGS and .MFLAGS target have the
same precedence as command line variable assignments.

make.1: 1.76->1.77
Author: harti
Log:
Correct the .Dd date. Pluralize 'assignment' in one place.

Requested by: ru

19 years agoSwitch a strncpy into a strlcpy. I'm not sure why this triggers propolice,
Joerg Sonnenberger [Tue, 30 Nov 2004 20:12:21 +0000 (20:12 +0000)]
Switch a strncpy into a strlcpy. I'm not sure why this triggers propolice,
the use seems to be correct.

19 years agoRemove struct ipprotosw. It's identical to protosw, so use the generic
Joerg Sonnenberger [Tue, 30 Nov 2004 19:21:26 +0000 (19:21 +0000)]
Remove struct ipprotosw. It's identical to protosw, so use the generic
version directly.

19 years agoDon't include stddef.h from the kernel.
Joerg Sonnenberger [Tue, 30 Nov 2004 19:17:08 +0000 (19:17 +0000)]
Don't include stddef.h from the kernel.

19 years agoMakefile:1.30->1.31
Joerg Sonnenberger [Tue, 30 Nov 2004 19:12:57 +0000 (19:12 +0000)]
Makefile:1.30->1.31
compat.c:1.36->1.37
job.c:1.49->1.50
Author: harti
Log:
Implement POSIX's '+' flag for command lines. This flag causes a line
to be executed even when -n is given on the command line to make. This is
very handy for calls to submakes.

This is slightly changed from the original patch as obtained from NetBSD.
The NetBSD variant prints lines which have both '+' and '@' when -n
is specified. The commited version always obeys '@'.

Bump MAKE_VERSION so Makefiles can use this conditionally.

PR:             standards/66357 (partly)
Submitted by:   Mark Baushke <mdb@juniper.net>
Obtained from:  NetBSD

make.1:1.74->1.75
Author: harti
Log:
Bump the date in .Dd for the recent '+' flag commit.

Requested by: ru

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoFix a bug in ESTALE handling for NFS. If we get ESTALE in vn_open() we
Matthew Dillon [Tue, 30 Nov 2004 18:59:52 +0000 (18:59 +0000)]
Fix a bug in ESTALE handling for NFS.  If we get ESTALE in vn_open() we
want to retry the operation, but if we cannot re-resolve the namespace
(i.e. the file is really gone) we were incorrectly calling vput(vp) where
vp might have been NULL.

Reported-by: David Rhodus <sdrhodus@gmail.com>
19 years agomake.1: 1.67->1.68
Joerg Sonnenberger [Tue, 30 Nov 2004 18:18:06 +0000 (18:18 +0000)]
make.1: 1.67->1.68
Author: ru
Log:
Markup nits.

make.1: 1.70->1.71
Author: ru
Log:
Mechanically kill hard sentence breaks.

make.1: 1.71->1.72
Author: keramida
Log:
Remove the dependency of the :C/regexp/replacement/ variable modifier
from the :S modifier which follows a bit further below.  This way the
reader can read each of these two descriptions without having to jump
back and forth in the manpage.

PR:             docs/26943
Submitted by:   Alex Kapranoff <alex@kapran.bitmcnit.bryansk.su>

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoparse.c: 1.53->1.54
Joerg Sonnenberger [Tue, 30 Nov 2004 17:58:41 +0000 (17:58 +0000)]
parse.c: 1.53->1.54
Author: ru
Log:
Added the new .warning directive.

Submitted by:   Cyrille Lefevre

make.1: 1.66->1.67
Author: ru
Log:
Document the new .warning directive.

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agojob.h: 1.20->1.21
Joerg Sonnenberger [Tue, 30 Nov 2004 17:39:41 +0000 (17:39 +0000)]
job.h: 1.20->1.21
Author: scottl
Log:
Change the select timeout from 100ms to 2 seconds now that SIGCHILD is
handled.

parse.c: 1.51->1.52
Author: ru
Log:
Make it possible to ``.undef ${VAR}'' (expanding VAR to get
the variable name to undef).

Submitted by:   Cyrille Lefevre

parse.c: 1.50->1.51
Author: ru
Log:
Fixed line numbering inside the .for loops.

Submitted by:   Cyrille Lefevre

for.c:1.20->1.21
nonints.h:1.19->1.20
parse.c:1.52->1.53
Author: ru
Log:
Reworked the fix to print the useful line number on error in
the .for loop:

- Replaced four global variables in parse.c with one.
- Made Parse_FromString() accept the "lineno" as an argument.
- Fixed line numbering when there are escaped newlines in the
  body of the .for loop.

Adopted from:   NetBSD

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoFix a bug that leads to a crash when binat rules of the form
Joerg Sonnenberger [Tue, 30 Nov 2004 16:02:21 +0000 (16:02 +0000)]
Fix a bug that leads to a crash when binat rules of the form
'binat from ... to ... -> (if)' are used, where the interface
is dynamic. reported by kos(at)bastard(dot)net, analyzed by
Pyun YongHyeon

Obtained-from: OpenBSD

19 years agodir.c: 1.31->1.32
Joerg Sonnenberger [Tue, 30 Nov 2004 15:52:57 +0000 (15:52 +0000)]
dir.c: 1.31->1.32
Author: ru
Log:
Fix a bug that prevented exists() from finding "foo/", "foo/."
and "foo/.." when ".PATH: foo" was also given.

PR:             bin/34062

Members:
        dir.c:1.31->1.32

compat.c: 1.35->1.36
main.c: 1.84->1.85
Author: ru
Log:
Make the -q option DTRT in the compat mode.

PR:     48210

var.c: 1.43->1.44
Author: ru
Log:
Fix a bug in variable parsing code that could cause a segfault.

PR:             bin/46203
Submitted by:   Stefan Farfeleder <stefan@fafoe.dyndns.org>

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoauthor: ru
Joerg Sonnenberger [Tue, 30 Nov 2004 15:22:46 +0000 (15:22 +0000)]
author: ru
Log:
- Cut out the code that caches the "." directory out of Dir_Init()
  into a separate function, Dir_InitDot().

- Postpone the current and object directories detection (and caching
  of the "." directory) until after all command line arguments are
  parsed.  This makes the -C option DTRT.

PR:             bin/47149

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agomain.c: 1.81->1.82
Joerg Sonnenberger [Tue, 30 Nov 2004 15:04:56 +0000 (15:04 +0000)]
main.c: 1.81->1.82
Author: imp
Log:
No need to check to see if we're running a version of FreeBSD 3.0 current or
newer anymore.

cond.c: 1.26->1.27
Author: imp
Log:
Keep up with minor changes to NetBSD.  Consider a variable empty when
not define.

Obtained From: NetBSD (rev 1.18; sjg)

for.c: 1.19->1.20
Author: ru
Log:
Command line variables take precedence over global variables.
Make this true in the .for loops too.  The following fragment,

        FOO=    foo bar

        all:
        .for f in ${FOO}
                @echo ${f}
        .endfor

when run as "make FOO=xxx" should print "xxx".  (OpenBSD had
this bug fixed for some time.)

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoSet DFPORTSDIR. It will be used by "make index" soon.
Joerg Sonnenberger [Tue, 30 Nov 2004 14:48:58 +0000 (14:48 +0000)]
Set DFPORTSDIR. It will be used by "make index" soon.

19 years agoConvert some broken cases where Error is called, but we try to continue,
Joerg Sonnenberger [Tue, 30 Nov 2004 14:27:25 +0000 (14:27 +0000)]
Convert some broken cases where Error is called, but we try to continue,
to Fatal errors, because the logic that we use to try to continue is far
too broken, and makes things look and act weird, because we end up pointing
past the end of a buffer boundry into freed memory in the caller, as we
don't come close to setting the lengthPtr to a sane value.

Reviewed by:    make@

(This only changes failure cases which would have died horrid deaths to
 explicit clean death failure cases.)

Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years ago- Constify most of the function
Liam J. Foy [Mon, 29 Nov 2004 21:45:00 +0000 (21:45 +0000)]
- Constify most of the function
- Static functions
- Fix some data types

19 years ago- Sync with FreeBSD
Liam J. Foy [Mon, 29 Nov 2004 20:27:30 +0000 (20:27 +0000)]
- Sync with FreeBSD
- Remove unneeded variable (Pflag)
- Only call chflags on directories once
- Static functions
- Remove main proto
- Minor cleans

19 years agoAllow "make index" to actually by fixing lots of smaller glitches all over
Joerg Sonnenberger [Sun, 28 Nov 2004 22:29:19 +0000 (22:29 +0000)]
Allow "make index" to actually by fixing lots of smaller glitches all over
the (dfports) tree.

- PORTSDIR must be kept for bsd.port.pre.mk, because it is used to include
  e.g. bsd.python.mk
- The DFPORTS_WARNING change didn't work as intended and neither did the
  old version. We want be quiet about redirections if we have any of the
  special targets to process (like describe), which does include the
  output of the cd command. We also want to define the .BEGIN rule only
  once. This is now protected by the better named _DFPORTS_REDIRECT
- Define another bunch of variables, normally provided by bsd.port.mk.
  This should fix the mysterious warnings encountered.

19 years ago- Fix setmode. Setmode can fail due to malloc. We should print the correct
Liam J. Foy [Sun, 28 Nov 2004 21:17:07 +0000 (21:17 +0000)]
- Fix setmode. Setmode can fail due to malloc. We should print the correct
  error message if malloc does fail and not print incorrect file mode.

19 years agoMore cleans
Liam J. Foy [Sun, 28 Nov 2004 20:20:42 +0000 (20:20 +0000)]
More cleans

- Remove registers
- Static functions
- Make WARNS 6 clean
- Add $DragonFly$ tag to Makefile

19 years agoCover the verbosity code in {}, otherwise the newline is printed everytime.
Joerg Sonnenberger [Sun, 28 Nov 2004 16:51:50 +0000 (16:51 +0000)]
Cover the verbosity code in {}, otherwise the newline is printed everytime.

Noticed-by: Sascha Wildner <saw@online.de>
19 years ago- Remove unnecessary casts
Liam J. Foy [Sun, 28 Nov 2004 16:38:21 +0000 (16:38 +0000)]
- Remove unnecessary casts
- Bump WARNS upto 6

19 years agoMissing return-value check for malloc.
Joerg Sonnenberger [Sun, 28 Nov 2004 15:40:43 +0000 (15:40 +0000)]
Missing return-value check for malloc.

Noticed-by: Santtu Hyrkkö <santtu.hyrkko@gmail.com>
19 years agoReorganise the nlist handling a bit, use an enum instead of preprocessor
Joerg Sonnenberger [Sat, 27 Nov 2004 17:54:10 +0000 (17:54 +0000)]
Reorganise the nlist handling a bit, use an enum instead of preprocessor
defines.

Idea-from: FreeBSD.

Remove all the symbols which don't exist in our kernel anymore. Fix the
entry for SI (si__tty instead of si_tty).

19 years agoFix a stupid fault in the last condition. The code should be skipped, if
Joerg Sonnenberger [Sat, 27 Nov 2004 13:22:26 +0000 (13:22 +0000)]
Fix a stupid fault in the last condition. The code should be skipped, if
the variable DFPORTS_WARNING is already defined, not the other way around.

19 years agoRemove some !FreeBSD compat code, which produces warnings on DragonFly.
Joerg Sonnenberger [Fri, 26 Nov 2004 14:47:04 +0000 (14:47 +0000)]
Remove some !FreeBSD compat code, which produces warnings on DragonFly.

19 years agoDon't define the .BEGIN with the override message twice for modules
Joerg Sonnenberger [Fri, 26 Nov 2004 14:06:57 +0000 (14:06 +0000)]
Don't define the .BEGIN with the override message twice for modules
using bsd.port.pre.mk / bsd.port.post.mk.

Pointed-out-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
19 years ago- Add new -vv option. If the -v flag is specified more than once,
Liam J. Foy [Thu, 25 Nov 2004 19:45:30 +0000 (19:45 +0000)]
- Add new -vv option. If the -v flag is specified more than once,
  chown will print the filename, followed by the old and new numeric
  user/group ID. (Obtained from FreeBSD with my modifications)
- Static functions and globals
- Remove global hflag
- Fix some casts
- Make WARNS?= 6 clean
- Add WARNS?= 6
- Constify id()
- Remove '?' case
- Update chown.8 for the addition of +vv

Ok'ed: Joerg@

19 years agoFix warnings about yyerror, yylex and yy_unput
Joerg Sonnenberger [Thu, 25 Nov 2004 01:20:33 +0000 (01:20 +0000)]
Fix warnings about yyerror, yylex and yy_unput

19 years agoFix parameters for comparision function.
Joerg Sonnenberger [Thu, 25 Nov 2004 01:01:33 +0000 (01:01 +0000)]
Fix parameters for comparision function.

19 years agoAdd the basic of libkcore. Switch pstat to use kcore/kinfo backing,
Joerg Sonnenberger [Wed, 24 Nov 2004 22:51:01 +0000 (22:51 +0000)]
Add the basic of libkcore. Switch pstat to use kcore/kinfo backing,
defaulting to kcore for now.

19 years agoComment out extra tokens after #else and #endif.
Joerg Sonnenberger [Wed, 24 Nov 2004 12:49:27 +0000 (12:49 +0000)]
Comment out extra tokens after #else and #endif.

19 years agoChange the include order of archive_string.h and archive_prviate.h.
Joerg Sonnenberger [Wed, 24 Nov 2004 10:20:45 +0000 (10:20 +0000)]
Change the include order of archive_string.h and archive_prviate.h.
The original order doesn't play well with the patching framework,
because the C preprocessor looks into the source directory first
for #include "".

19 years agoCleanup some ESTALE issues on the client when files are replaced on
Matthew Dillon [Wed, 24 Nov 2004 08:37:16 +0000 (08:37 +0000)]
Cleanup some ESTALE issues on the client when files are replaced on
an NFS server.  Even though the attribute cache has expired DragonFly
still maintains a vnode in the namecache.  If a file is replaced on the
server the vnode's file handle will become invalid.

Force re-resolution of the namecache entry rather then replacing the vnode's
file handle, so programs with open descriptors to the dead file continue to
get a proper error return while lookups succeed in finding the new version
of the file.

In this patch ESTALE is checked in strategic places:  stat(), access(), and
open().  It is an imperfect solution at the moment but it seems to work pretty
well.  This should bring NFS client operations back up to FreeBSD-4.x
standards.

19 years agoo Give make(1) the ability to use KQUEUE to wait for worker
Matthew Dillon [Wed, 24 Nov 2004 07:24:17 +0000 (07:24 +0000)]
o Give make(1) the ability to use KQUEUE to wait for worker
  processes instead of polling for them.
o Bootstrapping aid from pre-kqueue(2) systems, e.g.
  4.0-RELEASE.
o Treat kevent(2) returning an error EINTR as the non-error
  it is.

Note: the KQUEUE feature is disabled in FreeBSD and in DragonFly.

Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD

19 years agoo Fix proto type
Matthew Dillon [Wed, 24 Nov 2004 07:20:51 +0000 (07:20 +0000)]
o Fix proto type
o Mention that the left-hand side of the comparison conditional
  must always be a variable expansion.  Do not lie that
  debugging .for loops is a no-op.
o Update tutorial.
o Update man page.
o Fixed the abuses of .Ql visible on stderr in troff mode.
o Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
  Add FreeBSD Id tag where missing.

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD

19 years agoo Pacify ``make -f /dev/null -V FOO''.
Matthew Dillon [Wed, 24 Nov 2004 07:19:14 +0000 (07:19 +0000)]
o Pacify ``make -f /dev/null -V FOO''.
o Add empty default cases where they should be, remove
  non-local execution stuff in compat.c which doesn't even
  have preprocessor-conditional-hidden support code, and
  add a debugging statement where we might end up with a
  nil list somehow, but where I doubt it.
o Makeing make(1) WARNS=6 cleanup
o In lieu of a good way to prevent every possible looping
  in make(1), stop there from being more than 500 processes
  forked by make(1), to prevent a forkbomb from happening,
  in a dumb and mechanical way.
o Some ANSI changes that we missed

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD

19 years agoo Print a warning when we are given two scripts for one target.
Matthew Dillon [Wed, 24 Nov 2004 07:15:46 +0000 (07:15 +0000)]
o Print a warning when we are given two scripts for one target.
  This is neither as wide-reaching nor intensive as NetBSD's
  similar, but the warning uses the same text.
o Remove local prototypes for main().
o Don't declare things as extern when they will be static.
o When formatting the time for a target, use %H instead of %k,
  which is mostly the same, but uses a non-extension option.
o Document the parsing bug.
o Fix spurious three-space indentation in a four-space indentation
  file.
o Remove 6-years-stale #if0, the behaviour isn't ever going to
  be limited to compatible mode, as far as I know, since we use
  it...
o Code that has been #if0'd with the comment "WHY" since revision
  1.1 can disappear.

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD (as with the previous patches)

19 years agopatch-4.10: Clean some includes and remove ifdef __STDC__, -Wall cleanup,
Matthew Dillon [Wed, 24 Nov 2004 07:11:33 +0000 (07:11 +0000)]
patch-4.10: Clean some includes and remove ifdef __STDC__, -Wall cleanup,
unifdef -D__STDC__, Sort #includes, remove <sys/types.h> (made redundant
by <sys/param.h>), add <signal.h> (needed for sigaction()),
Unbreak compilation on RELENG_4.

Submitted-by: Max Okumoto <okumoto@ucsd.edu>
19 years agoAdd a SECURITY section which describes the kern.ckptgroup sysctl among
Hiten Pandya [Wed, 24 Nov 2004 02:56:43 +0000 (02:56 +0000)]
Add a SECURITY section which describes the kern.ckptgroup sysctl among
other things.

While I am here, cleanup the manual page:

- correct mdoc(7)
- restructure some sentences for readability
- add reference to signal(3) under SEE ALSO

19 years agoRemove the checkpoint module. checkpointing is now integrated into the kernel
Matthew Dillon [Tue, 23 Nov 2004 20:04:10 +0000 (20:04 +0000)]
Remove the checkpoint module.  checkpointing is now integrated into the kernel
via kern/kern_checkpoint.c (same code as checkpt.c and support.c just
migrated to a new file).

19 years agoRemove checkpt/ from Makefile.modules. checkpt is not integrated into the
Matthew Dillon [Tue, 23 Nov 2004 20:03:40 +0000 (20:03 +0000)]
Remove checkpt/ from Makefile.modules.  checkpt is not integrated into the
kernel as kern/kern_checkpoint.c

19 years agoIt is sys_checkpoint.2 not checkpoint.2
Eirik Nygaard [Tue, 23 Nov 2004 19:05:53 +0000 (19:05 +0000)]
It is sys_checkpoint.2 not checkpoint.2

Submitted by: Michal Belczyk <diavul@bsd.krakow.pl> and
              Michael Neumann <mneumann@ntecs.de>