summaryrefslogtreecommitdiff
path: root/usr.bin
AgeCommit message (Collapse)Author
2000-07-02Make the m4 machine stack dynamically sized.Marc Espie
Fix strspace automatic extension. The assumption that simply updating the current pointer works is false, there are cases where previous entries on the stack would absorp vast amounts of string space, and overload the non-updated entries. To fix it, we use a shadow copy of the stack, which only records which entries are pointers within strspace, so that a resize can adjust all those pointers at once. Reviewed by millert@
2000-07-02Long tokens won't be defined macros, but they can still be output.Marc Espie
2000-07-01Add -f option to specify audio device, honor AUDIODEVICE environment vairable,Todd C. Miller
and some KNF.
2000-07-01Slightly nicer wording: begins by -> begins withMarc Espie
2000-07-01Forgot to import one estrdup from my trunk.Marc Espie
Ensure make prints sane error messages when obj/ exists.
2000-06-30do not prin tcp/udp twice. from: fgsJun-ichiro itojun Hagino
2000-06-30Recognize `+cmd' as a command that should always be executed, even inMarc Espie
make -n mode. Currently works only in sequential make mode. In parallel make mode, it's just a no-op. Useful to debug recursive Makefiles, and part of POSIX.
2000-06-30split netstat -an -f inet and netstat -an -f inet6, for consistency.Jun-ichiro itojun Hagino
Suggested by: fgs
2000-06-30warnx?/errx? paranoia (use "%s" not a bare string unless it is aTodd C. Miller
constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
2000-06-29no longer needed; good riddance for static archsTodd T. Fries
2000-06-29use %s with syslogTodd C. Miller
2000-06-28unsigned -> unsigned int (implicit int is deprecated)Marc Espie
hv is a u_int32_t. Add __BEGIN_DECLS/__END_DECLS Remove unused macro (hash_to_info). Add documentation for the hash functions.
2000-06-28Fix stupid bug in argument handling. Problem found by fries@Marc Espie
Jason, that's a candidate for stable...
2000-06-27TyopArtur Grabowski
2000-06-27initialize result. this fixes the recent problem that makes ftp coredumpFederico G. Schwindt
if epsv4 is disabled. problem reported by price@netdoor.com on misc.
2000-06-26fix pasto; noted by artHugh Graham
2000-06-26MaxStartups: limit number of unauthenticated connections, work by theo and meMarkus Friedl
2000-06-26cleanup, less cut&pasteMarkus Friedl
2000-06-26use basename(1) in examplesPaul Janzen
2000-06-25Cater to people who don't run make depend better.Marc Espie
Also forgot a few CLEANFILES.
2000-06-25correct check for bad channel ids; from Wei Dai <weidai@eskimo.com>Niels Provos
2000-06-25allow 'fmt -w width' and 'fmt -width'.Paul Janzen
ok millert@
2000-06-23Get rid of repeating error messages; From netbsd millert@ okEric Jackson
2000-06-23This patch replaces str_concat with a slightly unobfuscated version.Marc Espie
In particular, Dir_MakeFlags is abusing str_concat, and works much better with buffers.
2000-06-23This is complementary to the previous patch.Marc Espie
There is no code change in this patch, we just move the remaining `lowparse' functions to the right file, and adjust the interface file accordingly. Reviewed by miod@
2000-06-23This patch is worth a lot, speed-wise.Marc Espie
This does introduce a proper stack of IFiles to handle included files: instead of having the current file be a special case, it's also an IFile. The corresponding code is slightly unobfuscated, removing the error-prone ParseEOF function, freeing the filename systematically (thus, main.c needs to strdup stdin), and merging both include functions lookup into one. The speed gain comes from changing the IFile structure to merge with fgetln seamlessly. The low-level parse code is mostly moved to a new file, lowparse.c, to make things easier to read (see next patch as well). Accordingly, util.c gains a fgetln. Note the interaction between Parse_File, Dir_FindFile, and ReadMakefile in main.c. This patch closes a subtle memory hole (only the Makefile names, so rather small). Reviewed by miod@.
2000-06-23This is the speed-up patch, which doubles make speed (almost).Marc Espie
Use the open hashing functions for global contexts instead of List in var.c. All the preliminary work to trim down local contexts means that we don't suffer from the heavy initialization work that a hash table entails. There is some make kludgery to: - build the hashing functions as a library, - recreate hashconsts.h, even if make depend was not invoked. One point of the hashing scheme written was to separate the computation of the hash function, and the hash lookup itself. This is very convenient for make, because of those pesky special variables. hashconsts.h is there to pre-hash the correct values, which replaces a few expensive string comparisons with quick hash value comparisons, followed by one expensive string comparison. The modulus MAGICSLOTS chosen in the Makefile is ad-hoc: it is small enough to write a small switch without collision, and will need changing if the hash function changes... The function quick_lookup is the most important: it either returns an index, for a local variable, or it does compute a hashing value, and returns -1. Another somewhat controversial decision is the use of string intervals. This avoids either copying a string, or twiddling with a byte for cases such as ${VAR}. Finally, the variable name is stored within the variable itself. Since a given variable name never changes, this makes sense. All that was needed was a hash library with support for this. Note that the hashing table holds only a variable pointer AND the corresponding hashing value, WITHOUT a modulo hashtablesize. Two reasons: - hash resizes can be done faster, without having to recompute hashing values. - locality of access. The hash table fits into memory without problem. Once a candidate slot is found, we check the complete hashing value. Probability of a collision is very small (32 bits...). So bringing up the whole variable in memory at once is good: the name will almost always match, in which case we want the variable value as well, so it makes sense to put them together. The ohash functions implement open hashing, as described in Knuth, but with a variable table size. Choosing powers of 2 sizes does not yield more collisions, but it makes the hashing scheme much simpler. The thresholds at which to expand/shrink the tables seem to work well in practice. The default sizes were chosen such that the tables hardly ever shrink or expand anyways (though I've tried with smaller/larger sizes to verify that the shrinking/expanding worked correctly): larger Makefiles hold roughly 500/600 variables, which fits without trouble into a 1024-sized variable. Disregard #ifdef STATS_HASH, this is some internal scaffolding I'm using to measure make performance. The only known issue with open-hashing is that deletions cannot create empty slots, but do leave slots marked as `occupied once' so that lookup works. We use a well-known optimization which records those pseudo-empty slots while looking up values. If the value is not found, the pseudo-empty slot is returned to be filled. If the value is found, it is swapped with the pseudo-empty slot. This is an improvement in both cases, since this shortens the length of lookup chains, eventually pushing the pseudo-empty slots to the end. Reviewed by millert@ and miod@
2000-06-23Open Hashing library, based on Knuth.Marc Espie
Some interface work to make it as fast as possible.
2000-06-23This patch separates local contexts from global contexts for good.Marc Espie
Apart from a few casts, VAR_GLOBAL and friends are separate data structures, so we use a small array for local variables. We also junk allVars, since TargFreeGN can release local nodes, and var.c has explicit lists for its variables already. Reviewed millert@ and miod@.
2000-06-23In various places, VAR_CMD is used to actually mean `no real context',Marc Espie
since lookup will start with VAR_CMD in any case. This fixes VarFind and Var_Parse to handle ctxt == NULL correctly, and replace those confusing VAR_CMD with proper NULL pointers. This patch also handles three small details: - .CURDIR is necessarily set in VAR_GLOBAL, - suffix handling for archives copies two hard-coded variables, for which it can use a quick path, - typos in TargFreeGN. Reviewed millert@, miod@.
2000-06-23Once those special variable are taken care of, other Var functions can takeMarc Espie
the GNode's context directly. We rename that special Lst to `SymTable *' in prevision of things to come. Along the line, we lose the special GNodes affected to VAR_CMD, VAR_GLOBAL, VAR_ENV, which become simple Lsts... This is not a problem, except when getting to a context's name for debugging (handled very nicely by offsetof). Again, this is a preparatory patch, which does not gain anything except for cleaning up issues... Reviewed by millert@ and miod@, like the previous patch
2000-06-23Start of variable fixes and speed-ups.Marc Espie
This patch may seem a bit non-sensical at first. It simply introduces some new interface. Specifically, recognizes that some variable names (.TARGET/$@, .OODATE/$?, .ALLSRC/$>, .IMPSRC/$<, .PREFIX/$*, .ARCHIVE/$!, .MEMBER/$%) are `special' (the actual variables which are local to a target, e.g. GNode). Currently, The Varq functions (for Varquick access) are only stubs to the normal functions. This fixes a very important detail before proceeding to turn variable lists into hash tables: if every GNode holds a hash table, initialization times for those will be very costly. But generic GNodes only hold those seven special variables... which can be stored directly into a small array; the only general cases are the environment, the command line and global variables.
2000-06-23Trivial consequences of the previous list changes:Marc Espie
- audit code for Lst_Datum, it's never applied to an empty pointer, so check can be removed -> turn into a macro, - Lst_First, Lst_Last can become macro as well - specialized version of Lst_Succ (Lst_Adv) to use in loops where it cannot fail, - Lst_Open can no longer fail. Trim down corresponding code. Reviewed millert@, miod@
2000-06-22Missing CVS idents; ok markusDamien Miller
2000-06-22missing atomicio; report from Steve.Marquess@DET.AMEDD.ARMY.MILMarkus Friedl
2000-06-21add epsv4 command, which turns off epsv on ipv4 (off by dfeault)Jun-ichiro itojun Hagino
automagicaslly disable epsv on ipv4, if epsv fails for single connection. merge from netbsd-current. req from fgs.
2000-06-21missing free; nuke old commentMarkus Friedl
2000-06-20getopt(3) returns -1, not EOFAaron Campbell
2000-06-20another oops, time to sleep.Federico G. Schwindt
remove spaces.
2000-06-20fix warnings during compilation. replace a few more calloc's withFederico G. Schwindt
malloc's; no need to clean the buffer for fgets.
2000-06-20add OpenBSD tag.Federico G. Schwindt
2000-06-20oops from my prev commit. move param.h above mount.h so NGROUPS is found.Federico G. Schwindt
2000-06-20weird. missing OpenBSD tags.Federico G. Schwindt
2000-06-20add openbsd tags. rearrange headers as per style(9) and indent.Federico G. Schwindt
replace some strcpy by strlcpy.
2000-06-20even more declarationsFederico G. Schwindt
2000-06-20replace some calloc's with malloc's since there is no point in callFederico G. Schwindt
memset for a sprintf buffer. fix malloc's len.
2000-06-20add missing declarations and includes.Federico G. Schwindt
2000-06-20kill show_usage, it's only a printf. i'll replace this by err and friendsFederico G. Schwindt
2000-06-20OpenBSD tagMarkus Friedl
2000-06-20no include <des.h> anymoreNiels Provos