Compare commits

...
1616 Commits
Author SHA1 Message Date
cvs2svn a964be6d2c This commit was manufactured by cvs2svn to create tag
'RELENG_4_1_0_RELEASE'.
2000-07-26 21:12:35 +00:00
Jordan K. Hubbard dc30028e8a Fix up for 4.1-RELEASE (good thing my build fell over for another
reason and had to be restarted - this would have been embarassing).

Noticed by:	Bruce A Mah <[email protected]>
2000-07-26 21:12:34 +00:00
Jordan K. Hubbard 706276d54f MFC: fix last-minute paste-o 2000-07-26 12:20:24 +00:00
Jordan K. Hubbard ea5b20a895 Now we're in 4.1-STABLE 2000-07-26 11:35:21 +00:00
Jordan K. Hubbard bd6b22825f Set to 4.1-RELEASE for tag. 2000-07-26 11:31:58 +00:00
Sheldon Hearn 3d381dd6ba MFC: describe syncer(4)-related sysctls. 2000-07-26 08:54:44 +00:00
Jordan K. Hubbard e8cbb7c5eb Disable X servers which don't exist for non-i386 machines
Requested-by:	obrien
2000-07-26 08:20:28 +00:00
Dag-Erling Smørgrav 10162cff31 MFC: revert to old behavior of deleting the output file when interrupted.
Approved by:	jkh
2000-07-26 07:56:16 +00:00
Dag-Erling Smørgrav 9b9e86aec0 MFC: Sync with -CURRENT (work around bugs in FTP and HTTP servers)
Approved by:	jkh
2000-07-26 07:54:18 +00:00
John Baldwin 0ac2d4e8b8 MFC: Build a non-crypto tcpdump for the bin dist.
Approved by:	jkh
2000-07-26 07:24:13 +00:00
John Baldwin 4e962c3513 MFC: Allow the xterm termcap to be selected.
Approved by:	jkh
2000-07-26 06:47:56 +00:00
Jordan K. Hubbard 7b1fc5e6e7 Add md.4 to build list.
Requested by:	ben
2000-07-26 06:40:55 +00:00
John Baldwin 70e347a07f MFC: Symlink /bin and /sbin to /stand on the boot floppy.
Approved by:	jkh
2000-07-26 06:32:05 +00:00
Mark Ovens b665309b38 MFC rev 1.12 Fix minor typo
PR:		20108
Submitted by:	Doug Lee
2000-07-25 23:24:26 +00:00
Wilko Bulte 9427edfa27 Document PCI_PARITY SRM flag. Document ECU use. 2000-07-25 13:11:29 +00:00
Sheldon Hearn a55c0eec2c MFC rev 1.9: add missing braces 2000-07-25 13:04:41 +00:00
Kris Kennaway 1f60ba6137 Note KAME import and format-string code audit. 2000-07-25 11:13:12 +00:00
Kris Kennaway 7265e1844c MFC: Don't build telnetd if NO_OPENSSL defined (now that I have permission :-)
Approved by:	jkh
2000-07-25 09:33:43 +00:00
Brian Feldman 73c988a2d5 MFC: check for truncated files and also set VTEXT on external included files
Approved by:	jkh
2000-07-25 08:20:19 +00:00
Jordan K. Hubbard 87a8d2ef5c MFC: fix date hack 2000-07-25 08:16:37 +00:00
Paul Saab 38e13cac21 MFC:
fsync.c:
[rev 1.2] typos and spelling fixes.

fsync.1:
[rev 1.3] typos and spelling fixes.
[rev 1.4] Avoid the need to capitalize an extraneous argument to
the Nm macro and be more precise about the handling of command-line
arguments.

Approved by:	jkh
2000-07-25 07:48:25 +00:00
Jordan K. Hubbard cba8fade7e MFC: tcpip screen clear, nuke X_AS_PACKAGE 2000-07-25 07:45:19 +00:00
Mitsuru IWASAKI 1f0e1ae558 MFC: pcic.c 1.93 -> 1.94
Fix a bug so that we have correct number of pccard instances in pcic_attach().

Reviewed by:	imp
Approved by:	jkh
2000-07-25 04:39:19 +00:00
Kris Kennaway a49a5c1300 Back out previous unapproved commit, it went to the wrong branch. 2000-07-25 01:11:18 +00:00
Kris Kennaway 42dcebdd3f Don't build crypto-enabled telnetd if NO_OPENSSL is defined, since it
attempts to link against libcrypto.
2000-07-25 01:11:17 +00:00
Brian Feldman e78a248db5 MFC: util.c rev 1.3, fix for stupid complaining about no trailed LF
Approved by:	jkh
2000-07-25 00:30:14 +00:00
David E. O'Brien 50d2a89e37 <sys/systm.h> must come in out-of-sorted order for proper prototyping.
Approved by:	JKH
2000-07-24 21:51:05 +00:00
Jordan K. Hubbard 0f37b82f56 MFC: fixes to eliminate USAResident and outdated crypto comments. 2000-07-24 18:46:47 +00:00
Sheldon Hearn 00fc993ecd MFC rev 1.12: general clean-up 2000-07-24 18:05:28 +00:00
Sheldon Hearn e79d2757b0 MFC rev 1.41 and 1.42: two nits 2000-07-24 15:05:11 +00:00
Sheldon Hearn 2fe7772c28 MFC rev 1.4: add EXAMPLES section. 2000-07-24 14:46:11 +00:00
Wilko Bulte b423c8e2e7 document support for IDE root/boot, remove a few unsupported/untested SCSI
cards, remove some PCMCIA cards.
2000-07-24 11:11:56 +00:00
Jonathan Lemon eda83fe3c2 When shutdown(s, SHUT_RD) is called, it calls sorflush(), which uses
bzero to wipe out the socket buffer.  However, this is not the right
thing to do, as some state may need to be kept (SB_SEL, SB_AIO, SB_KNOTE).
In particular, erasing the si_note entry will cause a panic in
filt_sordetach() later, when the system attempts to remove the knote
from the SLIST.

Add a workaround which leaves the si_note field alone.  The real fix
is to only clear out those fields which need to be reset, rather than
using bzero() to swat everything.  However, this close to -release, a
minimal fix was chosen in order to keep changes to a minimum.

Reviewed by:	dillon, wollman (in concept)
Approved by:	jkh
2000-07-24 05:15:22 +00:00
Nick Sayer 343520487f MFC: apm -d requres writable file descriptor
Approved by: jkh
2000-07-23 23:48:44 +00:00
Wilko Bulte 082e61ea3f Remove the 'going nowhere' warning as this belongs in the RELNOTES only 2000-07-23 20:26:04 +00:00
John Baldwin 26a898ce71 MFC: Update mouse menu text: "4" -> "6".
Approved by:	jkh
2000-07-23 20:14:36 +00:00
Matthew Dillon fea67202f5 Clarify RFMEM operation for rfork, which in fact clones the entire
address space (whether segments are shared or not), and does NOT
    split the stack.
2000-07-23 19:55:16 +00:00
Greg Lehey 62cac52999 MFC 1.115: Enable building Vinum on alpha.
Reminded-by:    Bernd Walter <[email protected]>
Approved-by:	jkh
2000-07-23 03:33:21 +00:00
Warner Losh 8af8d42f6b Minor clarifications:
o this file applies to stable.
	o note historical nature of parts of this file more clearly so that
	  people don't get confused about the non-optional nature of the
	  kernel upgrade building instructions.
2000-07-23 03:05:37 +00:00
David E. O'Brien 3660b809ee MFC: rev 1.9 (enhanced PATH)
Approved by:	JKH
2000-07-22 20:10:52 +00:00
Sheldon Hearn b79386490e MFC rev 1.37: remove reference to KERN_UPDATEINTERVAL and syncer(4). 2000-07-22 15:40:29 +00:00
Stefan Eßer 2e3ee62c97 MFC: support 64bit integer operands 2000-07-22 11:49:45 +00:00
Sheldon Hearn e976c1e0b9 MFC rev 1.16: rework FILES to cover symlinks and MAKEDEV 2000-07-22 10:24:52 +00:00
Doug Rabson ad18737c76 MFC: Add support for PC87303 chipset. 2000-07-22 09:09:36 +00:00
Jordan K. Hubbard 67ab5879ab MFC: add beforeinstall target which ensures ${BINDIR} exists. 2000-07-22 08:45:55 +00:00
Jordan K. Hubbard 744689d5d4 MFC: print start and stop times for release. 2000-07-22 08:45:26 +00:00
Bill Fenner ecbd7a36ef Merge 1.1.1.5: bring in free() bugfix from tcpdump.org
Approved by:	jkh via obrien
2000-07-22 07:27:10 +00:00
Kazutaka YOKOTA ccf9238b52 MFC: try to fix "psmintr out of sync..."
Approved by:	jkh
2000-07-22 04:09:21 +00:00
Warner Losh 4e7c905bf2 MFC: Don't define XE_DEBUG.
Approved by: jkh
2000-07-21 22:38:24 +00:00
Wilko Bulte b129da97af Make "going nowhere without my init" remark less controversial.
Make it clear that some people claim this is a reproducible problem
whereas others claim otherwise. I'm gonna yell on -alpha for testing of RC
by those who say it is a reproducible one.

Requested by: jkh
2000-07-21 22:38:05 +00:00
Wilko Bulte c61e54decc AS4100 also does not allow install from CD.
Submitted by:	obrien
Approved by:	jkh
2000-07-21 21:43:08 +00:00
Wilko Bulte 27dd9ae9fc document AS2100A not supported, TGA nono for console, 'going nowhere without
my init' pitfalls

Approved by:	jkh
2000-07-21 21:15:48 +00:00
Archie Cobbs f2dfe41b43 MFC: allocate memory with M_NOWAIT instead of M_WAITOK to avoid kernel panic.
Approved by:	jhk
2000-07-21 20:45:58 +00:00
Jordan K. Hubbard 9d236e38d1 MFC: add an xterm terminal type entry for people using such terminals.
Promised to:	mjacob
2000-07-21 20:43:49 +00:00
John Baldwin 28aaf63a39 MFC: Properly test the 16-bit signature at the end of the MBR.
Approved by:	jkh
2000-07-21 20:22:56 +00:00
John Baldwin dcd5b9ba5d MFC: Add in the second half of the Slovenian FTP mirror entry so sysinstall
compiles again.
2000-07-21 18:56:43 +00:00
Dag-Erling Smørgrav 724d700502 MFC: don't print summary in quiet mode (cosmetic) 2000-07-21 14:23:22 +00:00
Dag-Erling Smørgrav 2197aaf139 MFC: Sync with -CURRENT (most notably, fix resume and proxy problems)
Approved by:	jkh
2000-07-21 11:20:05 +00:00
David Malone cfb4c85341 MCF: 1.15 dirs.c and 1.17 tape.c.
Don't try to make files immutable (ie. chflags) before setting access times.

Approved by:	jkh
2000-07-21 09:00:08 +00:00
Jordan K. Hubbard 62ad85efac MFC: Add Slovenia to FTP site list 2000-07-21 06:07:33 +00:00
Nick Sayer b503a9bdf0 MFC - bridge_refresh sysctl
Approved by:	jhb
2000-07-21 04:48:56 +00:00
John Baldwin 52bcec6f19 MFC: Add the 3ware RAID adapter. 2000-07-20 23:10:19 +00:00
David E. O'Brien a75c6d7408 MFC: rev 1.10 (fix 32-bit type problem)
libskey was returning nonsensical results (e.g. /usr/bin/key) on the Alpha
2000-07-20 20:13:42 +00:00
David E. O'Brien f4cb140d3c MFC: rev 1.15 (fix dhcp_option_ev_name's formal parameter's type) 2000-07-20 19:52:51 +00:00
Warner Losh 6ac124d56c device xe0 at isa -> device xe. Xircom ethernets have not isa
attachments.  This is a merge from GENERIC.  Since LNIT isn't used to
build anything in the release process, I'm fudging a little on the
freeze time...  I hope jkh doesn't mind.
2000-07-20 19:07:02 +00:00
Hajimu UMEMOTO a7a1fe81d6 MFC rev 1.26 -> 1.28: Copy canonname for *ahost, into static buffer. 2000-07-20 18:56:10 +00:00
John Baldwin e3009dc890 MFC: Add a missing quote so this compiles. 2000-07-20 17:43:25 +00:00
Matt Jacob 90eac804bf MFC: isp man page changes 2000-07-20 17:35:20 +00:00
cvs2svn bd73645d91 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-20 17:17:50 +00:00
Warner Losh 0fd5828e8f MFC: make apm read only 2000-07-20 17:01:17 +00:00
Warner Losh 719a5e9b6c MFC: Try to open readonly when you don't need write privs 2000-07-20 16:59:20 +00:00
Warner Losh c08ca7e5d3 MFC: need write to do anything to the machine, read for info only 2000-07-20 16:51:21 +00:00
Sheldon Hearn 725b1893d9 MFC: link pcm.4 to snd.4 2000-07-20 15:54:42 +00:00
Hajimu UMEMOTO 2dcc5d730d MFC rev 1.10 -> 1.11: Add some examples for IPv6 addresses.
PR:		conf/18614
Submitted by:	James Housley <[email protected]>
2000-07-20 15:17:44 +00:00
Hajimu UMEMOTO 6877bab512 MFC: Fix buffer size of ALIGNed buffer.
PR:		bin/20053
Submitted by:	Alex Kapranoff <[email protected]>
2000-07-20 15:03:28 +00:00
Sheldon Hearn 87c301151a MFC rev 1.14: add FILES section. 2000-07-20 14:20:06 +00:00
Andrey A. Chernov 374f9d1322 MFC: sync with main termcap 2000-07-20 14:10:41 +00:00
Assar Westerlund 3cf2ea87c7 MFC: merge in syslog fixes, do not call syslog with variabel as format string 2000-07-20 14:04:34 +00:00
Andrey A. Chernov 24c358ae24 MFC: remove AX for mono, fix latin2 mono 2000-07-20 14:04:20 +00:00
Alexey Zelkin b11054f214 MFC: correct default value for -s option 2000-07-20 13:29:48 +00:00
Andrey A. Chernov 0a92f3e597 MFC: cons: add AX 2000-07-20 13:19:22 +00:00
Andrey A. Chernov a4d0a3e648 MFC: reset only bold on SGR 39 2000-07-20 13:14:08 +00:00
Sheldon Hearn 450b22b1bc MFC rev 1.4: fix a typo and a nit 2000-07-20 13:06:27 +00:00
David E. O'Brien 212a5eed32 MFC: rev 1.13 (use install(1) rather than cp) 2000-07-20 11:16:05 +00:00
Brian Somers 6dd6726e00 MFC: Don't mis-interpret sockaddr_in6 structures as sockaddr_in structures
when purging routes.
2000-07-20 10:38:43 +00:00
Kris Kennaway 2836fb8111 MFC: Don't call vfprintf-like functions without a format string. 2000-07-20 10:35:28 +00:00
David E. O'Brien cc79c2dd05 MFC: rev 1.8 (need /usr/sbin/for arp(8)) 2000-07-20 10:30:12 +00:00
David E. O'Brien 46e32530ef MFC: upgrade to Patchlevel 3 of the ISC 2.0 dhcp client.
(need to set the shell script's PATH setting in the environment)
2000-07-20 10:27:40 +00:00
David E. O'Brien 5aa9d015a2 MFC: upgrade to Patchlevel 3 of the ISC 2.0 dhcp client. 2000-07-20 10:26:14 +00:00
Sheldon Hearn 23a2f21e97 MFC: replace the obsolete update(4) page with one for syncer(4). 2000-07-20 07:37:41 +00:00
cvs2svn e0dac163b0 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-20 07:31:53 +00:00
Kris Kennaway ed4bb30bc9 La-de-da..have another crack at unbreaking world. Can we get Darren a
commemorative plaque or something? :-)

Submitted by:	Nat Lanza <[email protected]>
2000-07-20 06:40:45 +00:00
David E. O'Brien ee5c35be73 MFC: KNF'ize. 2000-07-20 06:12:13 +00:00
David E. O'Brien e5bb07c7ed MFC: set `boothowto' approapiately if our console is a serial one. 2000-07-20 05:56:37 +00:00
Kris Kennaway 963553fa63 Yet another world fixage.
Submitted by:	Bryan Liesner <[email protected]>
2000-07-20 05:46:06 +00:00
Marcel Moolenaar 6894ac6cdc Revert implementation of setfsuid and setfsgid due to security
issues.

Requested by: rwatson
Backed by: kris
2000-07-20 05:31:56 +00:00
Paul Saab 124a159bc9 MFC: It would help if taskqueue was actually compiled. :)
Forgotten by:	dfr
2000-07-20 05:17:56 +00:00
Kris Kennaway 95efa94b4c Fix yet another world breakage.
Submitted by:	Nat Lanza <[email protected]>
2000-07-20 05:15:19 +00:00
David E. O'Brien 47a14c6a96 MFC: set `boothowto' approapiately if our console is a serial one. 2000-07-20 05:13:00 +00:00
Kris Kennaway 58eac067c7 Attempt to unbreak world.
Submitted by:	Nat Lanza <[email protected]>
2000-07-20 04:57:19 +00:00
David Nugent 450d529990 MFC: Allow -D -g with empty group to reset default group to none
PR:             bin/5717
2000-07-20 04:44:27 +00:00
David E. O'Brien 80b37ecb95 GDB on the Alpha has a problem most likey due to being out of sync with
the matching Binutils version (in this case GDB 5.0 matches Binutils 2.10.0).

Andrew Gallatin has found GCC 2.95.2 + Binutils 2.10.0 puts include file
names in the symbol table.  This apparently causes two problems:
The first being that that init_header_files() is never called, this causes
an immediate SEGV in add_this_object_header_file().  The second being that
end_symtab() is being called twice, and this is corrupting gdb's memory
somehow.

This is a hack fix, but it will get us thru 4.1-RELEASE until GDB 5.0
makes it to RELENG_4.

Submitted by:	gallatin
2000-07-20 03:18:28 +00:00
John Baldwin 71c5b433e9 MFC: - Add WORLD_FLAGS and KERNEL_FLAGS.
- Don't quote MD_ROOT_SIZE.
2000-07-20 03:12:53 +00:00
Mike Smith a9efb803af Add the 3ware ATA RAID driver 2000-07-20 02:51:02 +00:00
Mike Smith cda29f45ee MFC - reduce confusing verbosity. 2000-07-20 02:32:35 +00:00
Mike Smith 7ef2721789 Last commit missed twe_disk.c due to committer-editor incompatibility. 2000-07-20 02:29:14 +00:00
Mike Smith 1f4c495902 Ack, the MFC of the 'twe' driver missed out on updating this. 2000-07-20 02:27:37 +00:00
Dag-Erling Smørgrav 83cab6e19f MFC: fix the case where the file name is preceded by a lone slash. 2000-07-20 02:05:26 +00:00
John Baldwin 42aab7dff3 MFC: - Clarify some of the text in sysinstall in regards to the cryto bits.
- Note that we are up to about 3600 ports now rather than about 3000
       ports.
2000-07-20 01:53:39 +00:00
Kris Kennaway 78f8d0eee3 MFC: XBONEHACK 2000-07-20 00:45:07 +00:00
Paul Saab 196b5480cc MFC: fsync(1) 2000-07-20 00:41:26 +00:00
David Nugent 2a1a2c1ac6 MFC: Fix -h - in usermod.
PR:		bin/19999
2000-07-20 00:25:17 +00:00
David E. O'Brien 5109314672 MFC: rev 1.80 (turn on USB devices) 2000-07-20 00:19:38 +00:00
David E. O'Brien 3fda56775a Add note reminding people adding USB devices that they must be also added
to release/scripts/dokern.sh.
2000-07-20 00:17:39 +00:00
John Baldwin f077738952 Put the arguments to SYSCTL_LONG() in the right order. 2000-07-20 00:11:27 +00:00
David E. O'Brien 78fce0ecdc MFC: rev 1.261 (add ftp.freebsd.org snaps) 2000-07-20 00:00:45 +00:00
Dag-Erling Smørgrav 5d74d3d4a6 MFC: fix bugs related to resumed HTTP transfers. 2000-07-20 00:00:01 +00:00
Darren Reed e70653fea8 cleanup 2000-07-19 23:34:29 +00:00
Darren Reed b2c4b4594b commit 3.4.8 to releng4 2000-07-19 23:27:56 +00:00
Darren Reed a1fce657bc actually commit merged diffs to the trunk 2000-07-19 23:00:52 +00:00
Archie Cobbs d0f1ad17b6 Revert previous checkin to unbreak build. 2000-07-19 22:58:52 +00:00
Wilko Bulte d1e9a109d8 note DEFPA FDDI brokenness. 2000-07-19 22:40:07 +00:00
Archie Cobbs 46b5087c4c Revert previous commit, which reverted the commit before that.
The previous committer did not alert the 2x previous committer
that he was reverting the commit, and in the meantime the 2x
previous committer fixed the problem elsewhere, causing the
previous commit to no longer be valid.
2000-07-19 21:43:52 +00:00
Cameron Grant f938b54a68 activate newpcm ds1 driver 2000-07-19 21:21:05 +00:00
Cameron Grant 021ba4d2ed mfc: many fixes 2000-07-19 21:18:46 +00:00
Marcel Moolenaar e59c84c0ec MFC: implementation of linux_pread and linux_pwrite.
PR: 17991
2000-07-19 21:12:39 +00:00
Marcel Moolenaar 3344f6a053 MFC: rev 1.32: linux_pread and linux_pwrite prototypes
PR: 17991
2000-07-19 21:11:10 +00:00
Cameron Grant 7d913f9481 mfc rev 1.15 2000-07-19 20:12:58 +00:00
Bill Fumerola 974525a8de MFC: 1.5 - -lcompat isn't needed anymore (roberto)
1.6 - bitrot in DPADD fixed (bde)

Requested by:	obrien
2000-07-19 19:31:41 +00:00
Wilko Bulte 0a9175709b document we have new hardware models supported
document Rawhide does not want to boot install floppies
2000-07-19 19:29:29 +00:00
Ben Smithurst b2d1c5b99f MFC: clarify that -k needs the console on stdin, and add example. 2000-07-19 19:15:09 +00:00
Ben Smithurst 346313d25e MFC: document the rc.d system. 2000-07-19 19:09:42 +00:00
Ben Smithurst f9975905f0 MFC: PR 20015:
1.  Correct FTP site for 4.0-stable snapshots and delete sentence
    fragment immediately following.

2.  Add FDDI section to table of contents (see #5 below) and add
    one line of whitespace.

3.  In userland section, document csh->tcsh, more->less, and
    colorized ls.

4.  In Ethernet section, do:

        s/gigabit ethernet/Gigabit Ethernet/
        s/fast ethernet/Fast Ethernet/
        s/ethernet/Ethernet/

5.  Pull DEC DEFPA/DEFEA *FDDI* cards out of the *Ethernet* section
    and into their own second-level section.

6.  Add missing period in section header in ATM section.

7.  Tweak upgrading sectio with some new text, not sure if this is
    much better though.

8.  Add a blurb about the -stable mailing list.
2000-07-19 19:06:02 +00:00
Archie Cobbs 42ecf1982d MFC: fix breakage caused by ether_aton() prototype change. 2000-07-19 16:33:02 +00:00
Archie Cobbs c3e15b16b9 MFC: fix breakage caused by ether_aton() prototype change. 2000-07-19 16:26:56 +00:00
Archie Cobbs 2a92ef7fdf MFC: fix build breakage. 2000-07-19 16:07:37 +00:00
SADA Kenji da29a0b856 MFC: Fixd with alias missing. 2000-07-19 15:25:18 +00:00
Ruslan Ermilov 6b605b9c1a Backout ``const'ify parameters to ethers(3) routines'' patch
from RELENG_4 until issue is resolved in 5.0-CURRENT.
2000-07-19 15:24:07 +00:00
Brian Somers 20d40aef90 MFC: set if_type 2000-07-19 15:14:34 +00:00
Darren Reed 744b9254bb pullup changes from -current 2000-07-19 14:38:34 +00:00
Andrew Gallatin b4a03676c0 MFC 1.83: Fix an alpha-only race which causes the transmit side of the chip to
lock up under moderate to heavy load
2000-07-19 14:36:36 +00:00
Darren Reed 63a9889802 merge code changes from 3.4.4 to 3.4.8 2000-07-19 14:28:07 +00:00
cvs2svn c557084ecd This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-19 13:52:49 +00:00
MIHIRA Sanpei Yoshiro 6dc70c1a90 Merge pccard.conf from current. 1.108 -> 1.123 2000-07-19 12:58:12 +00:00
David E. O'Brien fa5a092898 Fix DTTERM colorization problem.
Submitted by:	Larry Rosenman <[email protected]>
2000-07-19 12:41:00 +00:00
Ruslan Ermilov cf317c3226 MFC: (rev 1.3) Use proper <bsd.kmod.mk>. 2000-07-19 12:35:41 +00:00
Ruslan Ermilov 66a2fbdcf3 Damn, committed the wrong version. 2000-07-19 10:04:17 +00:00
Ruslan Ermilov b7e06c2871 MFC: A driver for programming the AGP hardware. 2000-07-19 09:48:05 +00:00
Paul Saab c817403b25 MFC: less 2000-07-19 09:24:26 +00:00
Alan Cox ab7efc62a5 MFC: [rev 1.66] If devclass_alloc_unit() is called with a wired unit #,
and this # is busy, only search upwards for a free slot to use.  This
 broke unit numbering on ATA systems where PCI attached controllers
 come before the mainboard ones.
2000-07-19 09:18:48 +00:00
Dag-Erling Smørgrav d7680ac351 MFC: don't force passive mode 2000-07-19 09:14:44 +00:00
Kelly Yancey 83160a94c3 MFC: merge in various cosmetic cleanups:
Add unsigned sysctl types; change certain existing sysctl oids to
	utilize the new types. Teach sysctl(8) about these types.

	Convert SYSCTL_LONG to accept a val parameter like all of the other
	SYSCTL_XXX macros.

	Add support to sysctl(8) for arrays of longs.

	Make sysctl(8) display dev_t's the same way as ls(1).
2000-07-19 06:24:06 +00:00
Hajimu UMEMOTO 31cc3a5c56 To define A RR to root (.) is valid in DNS. So, h_name = "" shouldn't
be treated as NULL.

PR:		bin/19816
Submitted by:	Bill Fenner <[email protected]>
Reviewed by:	Atsushi Onoe <[email protected]>
2000-07-19 06:22:01 +00:00
Sheldon Hearn 3e413989d1 MFC rev 1.39: explain the dependence on the terminal's capabilities. 2000-07-19 06:19:15 +00:00
Marcel Moolenaar 6d4d16989b MFC: Implement setfsuid and setfsgid.
PR: 16993
2000-07-19 03:53:07 +00:00
Marcel Moolenaar 8f96f8d9dc MFC: rev 1.39: Simplify F_GETOWN and F_SETOWN fcntl commands.
PR: 16946
2000-07-19 02:58:47 +00:00
Archie Cobbs b1e3a2ca55 MFC: const'ify parameters to ethers(3) routines. 2000-07-19 01:40:14 +00:00
David E. O'Brien 9fafa5b55b MFC: rev 1.30 (remove -kthread) 2000-07-19 00:30:53 +00:00
Josef Karthauser 804dc4707a MFC: Mention the new "cdid" command to cdcontrol. 2000-07-19 00:27:04 +00:00
Josef Karthauser 583be38487 MFC: cdcontrol.1 (rev1.23), cdcontrol.c (rev1.27)
Add a new command, 'cdid', to calculate and display a serial number
     for a cd, using the algorithm that the cddb database uses.
2000-07-19 00:22:08 +00:00
Josef Karthauser 6c9cdc988c MFC: revision 1.26
Fix the ^D -> core dump problem properly.  ^D == "quit" again.
2000-07-18 23:47:11 +00:00
Archie Cobbs 6ef5cfa19d MFC: make "ifconfig" with no arguments equivalent to "ifconfig -a".
Approved by:	jkh
2000-07-18 22:54:30 +00:00
Wilko Bulte fcb0e2d463 document added support for parallel ports 2000-07-18 22:47:21 +00:00
Wilko Bulte 97d64b052b document support for parallel ports
add warning to be careful with PCI bridge chips

Obtained from:	Doug Rabson <[email protected]>'s ppc commit
2000-07-18 22:45:37 +00:00
Jonathan Lemon bd175b9445 MFC: kqueue API changes 2000-07-18 21:49:41 +00:00
Jonathan Lemon 25ccfd73dd MFC: kqueue API change + latest changes from -current 2000-07-18 21:49:12 +00:00
Doug Rabson 481d3372c2 MFC: taskqueue api. 2000-07-18 21:12:43 +00:00
Dag-Erling Smørgrav dcd49ea29b Don't reply "not a plain file" when the requested file doesn't exist. 2000-07-18 21:11:07 +00:00
Ben Smithurst 729f4472b2 MFC: remove description of -t, don't mark the word "and" as a flag.
Approved by:	des
2000-07-18 21:07:38 +00:00
Ben Smithurst 61110af19a MFC:
braces -> brackets for [ and ]
  brackets -> angle brackets for < and >
  clean up the text about creating usage() messages
  define what is meant by `braces' and `brackets'
2000-07-18 21:03:00 +00:00
Hajimu UMEMOTO e96b211bc2 MFC: (rev 1.16 -> 1.17) If ipv6_enable is set to yes, do IPv6 setup
for PCCARD ethernet card.  This is still at staring point and end
node case only.
2000-07-18 20:50:57 +00:00
Doug Rabson 17cb33ade5 MFC: Port ppc driver to alpha 2000-07-18 20:39:05 +00:00
Mark Ovens b0857cf5d9 MFC: Document the builtin echo command 2000-07-18 19:35:38 +00:00
Warner Losh 076f5c13d1 MFC: doc change for reset/iosize/memsize and nit in syslog call.
util.c            1.15
pccard.conf.5     1.16

Forgotten by: imp
Submitted by: mihira-san <sanpei>
2000-07-18 18:29:27 +00:00
Wilko Bulte 8f0379148f Document restrictions around PCI bridge chips on AS4100 & 8200
Submitted by:	Matthew Jacob <[email protected]>
2000-07-18 18:28:49 +00:00
David E. O'Brien e8ee1b1413 Make the default BUILDNAME contain "STABLE" to match this branch.
Approved by:	JKH
2000-07-18 18:16:45 +00:00
Wilko Bulte 40a4c6d434 various cleanups, point people to freebsd-alpha@ 2000-07-18 18:04:47 +00:00
Wilko Bulte 2a4696d896 document serial console habits of AS2100[A]. 2000-07-18 17:49:25 +00:00
Sheldon Hearn 0c56bab446 MFC: cross-reference mount_nfs(8) and showmount(8). 2000-07-18 17:38:29 +00:00
David Malone abf9d14c72 MFC: Bring RELENG_4 into sync with -current.
builtins.c 1.20         Allow ident to take -d without -r
        builtins.c 1.21         Replace send(..., MSG_EOF) with write(...)
        builtins.c 1.22         ident types cleanup
        builtins.c 1.23         more ident types cleanup
                                Remove switch for nonexistant -R flag
        builtins.c 1.24         ident multi-packet fixes
        inetd.8 1.49            clarify ident -d examples
        inetd.8 1.48            allow ident to take -d without -r
        inetd.8 1.47            typo fix
        inetd.c 1.81            use IPv4 mapped IPv6 address when requested
2000-07-18 16:47:17 +00:00
Sheldon Hearn 46d3c97e66 MFC rev 1.60: fix a comment for TCPCTL_KEEPINIT. 2000-07-18 16:45:47 +00:00
David Malone 443a8c25d1 MFC: 1.3 Avoid splitting ident requests across several packets. 2000-07-18 16:41:11 +00:00
David Malone 3264931df9 MFC: 1.101 Avoid some vrele panics in rename. 2000-07-18 13:19:13 +00:00
Alexander Langer 7aed3c61f5 - Adjust documentation for new soft updates copyright to match
HEAD's NOTES.

PR:		19982
Submitted by:	Adam McDougall <[email protected]>

- Enable ``options SOFTUPDATES'' to match both, GENERIC and HEAD's NOTES.

Approved by:	roberto
2000-07-18 13:10:24 +00:00
Sheldon Hearn 26c4d5a017 MFC: pull up to rev 1.44 . 2000-07-18 12:06:22 +00:00
Sheldon Hearn cb38e6c7ff MFC rev 1.15 - 1.16: Fix inclusions and honour UT_NAMESIZE . 2000-07-18 11:38:24 +00:00
Hajimu UMEMOTO 95d2558bd4 MFC: (rev 1.8 -> 1.9) Sshd writes connected host into utmp directly.
If the connection is via IPv6, the hostname is trimed due to the
length of IPv6 address.  This change saves it as possible.
I have a grudge against the shortage of UT_HOSTSIZE.
2000-07-18 10:25:37 +00:00
Maxim Sobolev e65b696ab5 MFC: "-s" option to check size of installed package(s). 2000-07-18 10:12:30 +00:00
Sheldon Hearn ee6a4f5f57 MFC: make sbsize a size instead of a number. 2000-07-18 09:45:40 +00:00
Jun-ichiro itojun Hagino 033d8e7a3e MFC 1.90 -> 1.91, Samuel confirmed that it improves PR17909.
improve route/nd cache cleanup on interface removal.
CAVEAT: haven't really tested it yet, please report
2000-07-18 09:29:50 +00:00
David E. O'Brien 4251d087b3 MFC: allow the Fix-it functionality to detect that we are on a serial console.
PR:		19837
Submitted by:	Doug Ambrisko <[email protected]>
Approved by:	JKH
2000-07-18 09:16:43 +00:00
Hajimu UMEMOTO 32ad25520c MFC: Fix an unmatched opening quote.
PR:		conf/20000
Submitted by:	Alex Kapranoff <[email protected]>
2000-07-18 08:47:37 +00:00
Hajimu UMEMOTO e0f65104be MFC: Add IPv6 scoped address support.
It enables us to control link-local connections by interface like
this:

    ALL : [fe80::%ed0]/10 : allow
    ALL : [fe80::]/10 : deny
2000-07-18 08:34:57 +00:00
Alexander Langer 959003b42f MFC: Drop index(3) and rindex(3) from SEE ALSO. 2000-07-18 08:26:20 +00:00
Matt Jacob 8307b732b3 MFC:Roll back target mode f/w to 7.55. 2000-07-18 07:24:00 +00:00
Matt Jacob e9ddc9edcf MFC: correct missing portion of complete STRNCAT cleanup. 2000-07-18 07:20:53 +00:00
Dag-Erling Smørgrav 52a85ef4ff MFC: Failure to stat does not necessarily imply failure to retrieve 2000-07-18 07:13:59 +00:00
Matt Jacob 2eba555b9c MFC:Add in some new IN_XXX and CT_XXXX flags in preparation
for the rototilling that !*$)~@!$_@*_(~@$*_(~@$*~@$*
Qlogic F/W changes will need.
2000-07-18 07:07:26 +00:00
Matt Jacob 836db5992c MFC:If debugging set, zero out an incoming response entry
when we're done reading it (makes checking things easier).
Before calling isp_notify_ack make sure we're at RUNSTATE-
elsewise we can be responding to LIPs or SCSI bus resets
before we've finished some of the wiring.
2000-07-18 07:05:58 +00:00
Matt Jacob 04d396a55f MFC (rev 1.42)- lots of target mode changes. 2000-07-18 07:03:42 +00:00
Matt Jacob 9b54ae5632 MFC: Raise debug level for some messages. Fix botched inversion
about MBOX_COMMAND_ERROR vs. MBOX_COMMAND_PARAM_ERROR.
2000-07-18 06:47:19 +00:00
Matt Jacob bb90379156 MFC:Preserve CAM_DIS_DISCONNECT as passed up from SIM (like
CAM_TAG_ACTION_VALID and CAM_DIR_MASK). Remove redundant
CAM_DEBUG line. Spiff up CAM_DEBUG printout for commands
and move the printout up to the top where we can see it,
even for the pending_ua/pending_ca cass. Add missing
newline in a CAM_DEBUG.
2000-07-18 06:44:14 +00:00
Matt Jacob 94d1478564 MFC:Keep interrupts blocked for all of isp_pci_attach. Redo DMA routines
for target mode for cleanliness and accuracy.
2000-07-18 06:41:46 +00:00
Warner Losh c3b5cba32f MFC: logstr functionality
file.c		1.31
cardd.c		1.54
cardd.h		1.24
pccard.conf.5	1.17
2000-07-18 04:59:39 +00:00
Matt Jacob dacc8db399 MFC:
Don't get stuck in a loop calling exit from an atexit routine. Clean
up cam_fill_ctio usage to passed atio flags. Clear periph_priv area
of new ctio so if the kernel is dumb enough to look at them (this is
a SECURITY hole) the panic will be obvious instead of subtle.

Clean up after oneself on exit.
2000-07-18 04:42:03 +00:00
David E. O'Brien 28e4736c5a MFC: rev 1.3 (now at version 1.0) 2000-07-18 04:15:56 +00:00
John Polstra 9a6e97f0c0 MFC: Make "ldconfig" with no arguments behave the same as "ldconfig -R".
ldconfig.8:	1.19 -> 1.20
	ldconfig.c:	1.31 -> 1.32
2000-07-18 02:24:33 +00:00
John Polstra 94511e52c7 MFC: Block signals while holding the exclusive lock to avoid locking
against self.  The revisions merged are:

    alpha/lockdflt.c:	1.5 -> 1.6
    i386/lockdflt.c:	1.5 -> 1.6

I discussed this merge with the release engineer and we agreed that
this particular merge would best be done as soon as possible, rather
than waiting until just before the 4.1 code freeze when it couldn't
receive the benefit of testing with the ports it is intended to
fix.  (It should fix Mozilla and other user threads based programs.
And it should fail to break any linuxthreads based programs.)

Approved by:	jkh
2000-07-18 02:15:22 +00:00
Jason Evans f88ea02a10 MFC: Change my email address in the copyright notices for the sake of
consistency ([email protected] --> [email protected]).
2000-07-18 02:05:57 +00:00
Jason Evans 26947b4288 MFC: Add a sendfile() wrapper, so that calls to sendfile() do not block the
entire process.
2000-07-18 01:57:21 +00:00
Bill Fumerola 378656c2ba Update this so -r groks the 4.1-RELEASE tree. After the release I will
revisit this poor, poor method and put in something that I don't have to
bump every release.

Requested by:	obrien
2000-07-18 01:50:09 +00:00
cvs2svn 34937f7b56 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-18 01:38:20 +00:00
Andrey A. Chernov dceb3eda96 MFC: FreeBSD ID, Euro, bg keyboard description 2000-07-18 00:47:53 +00:00
Jason Evans 6b579a7276 MFC: Add missing man pages and merge minor changes to existing pages. 2000-07-18 00:35:46 +00:00
Andrey A. Chernov 4c1a559200 MFC: cp1251 fonts 2000-07-18 00:35:12 +00:00
Jason Evans 8e53f39053 MFC: Deal correctly with statically initialized condition variables in
pthread_cond_signal(), pthread_cond_broadcast(), and
pthread_cond_timedwait().

PR:	bin/18099
2000-07-17 23:11:49 +00:00
Brian Somers 7e45650fd3 MFC: add -z, correct usage and a diagnostic
Requested by:	obrien
2000-07-17 23:07:13 +00:00
Warner Losh c413b7a76b Spelling errors 2000-07-17 22:26:16 +00:00
Jason Evans 5ddeab1625 MFC: Add a test framework, convert existing tests to work with the
framework, and add a test for semaphores.
2000-07-17 22:18:33 +00:00
Dag-Erling Smørgrav dc81f49071 MFC: everything since the last one. 2000-07-17 22:03:10 +00:00
John Baldwin 4d209f48cf MFC: The new 1024 byte boot0 that supports the EDD BIOS extensions. 2000-07-17 21:27:26 +00:00
John Baldwin 02821588bd MFC: Teach boot0cfg about the new multi-sector boot0. 2000-07-17 21:26:59 +00:00
John Baldwin 923caadcbd MFC: Update to support MBR boot loaders longer than 1 sector. 2000-07-17 21:26:09 +00:00
John Baldwin 92c55c4389 MFC: Teach sysinstall to support MBR boot loaders of multiple sectors.
Remove all the 1024 cylinder checks as they no longer apply.
2000-07-17 21:25:37 +00:00
John Baldwin f3793b88fa MFC: Support MBR boot loaders more than 1 sector long. 2000-07-17 21:24:55 +00:00
Archie Cobbs 1f978f3571 MFC: make all Ethernet drivers use ether_ifattach() ether_ifdetach() 2000-07-17 21:24:40 +00:00
Wilko Bulte 1c5912a06e document FICL support in the loader
nuke a few unsupported SCSI adapters
2000-07-17 20:38:32 +00:00
Luigi Rizzo 437b7bee1b MFC: close pr 19544 - ipfw pipe delete causes panic when no pipes define 2000-07-17 20:06:16 +00:00
Bill Paul 8f0d65b2f6 MFC: kue(4) and cue(4) don't need miibus. 2000-07-17 19:05:59 +00:00
Alexander Langer a460d39629 MFC: Add SEE ALSO 2000-07-17 19:05:24 +00:00
Sheldon Hearn 63d5d13fdf MFC rev 1.31: pwd instead of cwd 2000-07-17 17:33:48 +00:00
Sheldon Hearn 5e06a95bc3 MFC: Import the new md(4) manual page now that MD_NSECT is an option. 2000-07-17 13:53:12 +00:00
Sheldon Hearn df331198b2 MFC: Rename MDNSECT to MD_NSECT and add it to options and LINT. 2000-07-17 13:48:40 +00:00
cvs2svn ff0b720ced This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-17 13:13:05 +00:00
Sheldon Hearn afcc676b55 MFC rev 1.8: locale support done 2000-07-17 10:42:48 +00:00
Ruslan Ermilov 996bc59c64 MFC: (rev 1.40) refer to rc.conf(5) on how to start natd(8) during boot. 2000-07-17 10:11:03 +00:00
Kris Kennaway 256d6c4af5 MFC: Merge updated KAME documentation. 2000-07-17 07:47:14 +00:00
Kris Kennaway 72d930e81e MFC: Updated manpages 2000-07-17 07:43:58 +00:00
Kris Kennaway c3a9ff919e MFC: Remove IPSEC_IPV6FWD (avoid unexpected behaviour on IPv6 forwarding) 2000-07-17 07:16:50 +00:00
Matt Jacob d3805793d1 MFC:Whoops- forgot to commit this other pearl from Justin- only set or
clear CAM_TAG_ACTION_VALID if this is an XPT_SCSI_IO CCB (otherwise,
the peripheral driver knows best...)..
2000-07-17 00:44:25 +00:00
Dag-Erling Smørgrav 7187fcea9f MFC: #ifdef DEBUG -> #ifndef NDEBUG 2000-07-16 23:19:57 +00:00
Ben Smithurst 63190dd5af MFC: clarify that CVSup doesn't understand comments in refuse files. 2000-07-16 20:35:44 +00:00
Hajimu UMEMOTO 7e8fdbf995 MFC: IPv6 support.
IPv6 configuration is only done by rtsol.  Does someone really
need manual configuration? :-)
You can specify IPv6 DNS server as well.
We have only one server ftp7.jp.freebsd.org that speaks IPv6
in this time.  ftp7.jp speaks IPv4 as well and also listed as
Japan #7.
2000-07-16 17:30:00 +00:00
Hajimu UMEMOTO 8c6a7ca6cb MFC: Separate parsing code of 229 replies from the code for 227 and 228.
Don't assume 227 and 228 replies enclose remote address with parentheses.
(rev 1.36 -> 1.37)
2000-07-16 16:41:25 +00:00
Boris Popov 1552f65c1b MFC: rev 1.265 - Fix support for more than 256 simultaneous mounts
with theoretical limit of 2^16 mounts per fs type.
2000-07-16 13:18:55 +00:00
Boris Popov 2265fa2e37 MFC: rev 1.49 - correct execution order of SYSINITs within the same
subsystem.
2000-07-16 13:13:32 +00:00
Wilko Bulte 5b54f318b3 Document Ethernet card reqs for SRM boot. Note that 8255x (fxp)
does not work correctly on alpha. If this gets fixed before 4.1R hits
the streets *please* notify me.
2000-07-16 11:35:12 +00:00
David E. O'Brien d98be20460 MFC: revs 1.28-29 (squeeze more out of the BOOTMFS install kernel)
Approved by:	JKH
2000-07-16 06:40:42 +00:00
Warner Losh e9fd3cc02f MFC: 1.97 blurb on the crypto stuff. 2000-07-16 06:04:43 +00:00
Kenneth D. Merry 0db96370f6 MFC: Get rid of non-existent CAM 'scan' device.
PR:		19961
Submitted by:	Cyrille Lefevre <[email protected]>
2000-07-16 02:52:24 +00:00
Dag-Erling Smørgrav 40af4470dc Mention libfetch-related changes. 2000-07-16 02:06:44 +00:00
Dag-Erling Smørgrav 39a5a01e1e MFC: Use libfetch 2000-07-16 01:58:42 +00:00
David Nugent e1811eedfb [MFC] Add tcsh as a valid default shell 2000-07-16 01:48:12 +00:00
Dag-Erling Smørgrav 7ee95268b1 MFC: libfetch-based fetch(1) 2000-07-16 01:16:46 +00:00
Dag-Erling Smørgrav b8208390d6 MFC: synch with -CURRENT 2000-07-16 01:13:37 +00:00
David Malone b9c57fd923 MFC: 1.18 Ensure devices, fifos, etc have length 0. 2000-07-15 22:47:07 +00:00
Bill Paul ce9f1403ec MFC: fix support for Macronix MX98715AEC-C/D/E chips with small
multicast hash tables
2000-07-15 17:56:38 +00:00
Andrey A. Chernov cdcfcede28 MFC: octal numbers parsing 2000-07-15 17:19:28 +00:00
Andrey A. Chernov 5228fba672 MFC: shorten 49m attrs resetting expr 2000-07-15 14:14:45 +00:00
Andrey A. Chernov a7ea07cd8d MFC: reset attrs on 39/49m, unify comments 2000-07-15 13:48:21 +00:00
Ben Smithurst 791a870513 MFC: make NAME section less confusing 2000-07-15 13:05:35 +00:00
Kris Kennaway 4d92c58cb4 MFC: Merge KAME 2000/07 code. 2000-07-15 07:52:50 +00:00
Kris Kennaway 5bc9481d42 MFC: Merge KAME 2000/07 code. 2000-07-15 07:38:52 +00:00
Kris Kennaway e6d0854e13 MFC: Merge KAME 2000/07 code. 2000-07-15 07:29:31 +00:00
Kris Kennaway 8b0561f190 MFC: Merge KAME 2000/07/01 code. 2000-07-15 07:14:44 +00:00
Brian Feldman de4bebdf7b MFC: convert ktrgenio() to use a uio to fix a DoS. 2000-07-15 06:32:25 +00:00
David E. O'Brien 1dbc97bf4c MFC: rev 1.86 (add SOFTUPDATES) 2000-07-15 06:07:34 +00:00
Robert Watson 7ff4ba0de1 o MFC of 1.22, which forces use of short fortunes instead of long ones 2000-07-15 03:33:01 +00:00
Robert Watson 7ee0b4f7b1 o MFC asmodai's spelling improvement from /etc/root (1.12) 2000-07-15 03:31:10 +00:00
Robert Watson 12013ebd2c o MFC updates to dot.cshrc and dot.login in /src/share/skel to reflect
similar MFC's done by asmodai to /src/etc/root.  5.0-CURRENT user
  dot files are now on synch with 4.0-STABLE.
o This includes the updates in 1.11 of dot.cshrc and 1.15 of dot.login
2000-07-15 03:18:07 +00:00
Archie Cobbs 551d294924 MFC: (rev. 1.4) set NG_INVALID flag when destroying node. 2000-07-14 22:36:23 +00:00
John Baldwin 6a5a88d1df MFC: Build modules with world and clean up the kernel builds. 2000-07-14 22:25:41 +00:00
David Nugent 887eb398a8 MFC: Allow useradd -d <dir> to work without other changes.
PR:		bin/19649
2000-07-14 22:10:32 +00:00
Matt Jacob cbbcd6a92c MFC:Don't, when doing cam_fill_ctio, add a SIMPLE Q tag unless
TAG_ACTION_VALID is set.
2000-07-14 21:10:26 +00:00
Bill Paul 5fea23d46f MFC: merge in support for Accton EN1217D card. (Macronix chip: just add
the PCI IDs.)
2000-07-14 20:48:33 +00:00
Robert Watson 36ce76e69a o MFC changes in revisions 1.56 and 1.57 from 5.0-CURRENT to 4.0-STABLE
o 1.56 (rwatson)
    o Further limitations on process use of getpriority() and setpriority()
    by jailed processes.  Addresses problem described in kern/17878.
o 1.57 (phk)
    fix a typo {in microtime warning printf format}
2000-07-14 20:47:52 +00:00
Matt Jacob 43d82bbbee MFC (1.6, 1.7):
Some additional TARGIOCCLEAREXCEPTION ioctls added as
needed. Make use of the new TARGIODEBUG ioctl (i.e., add
an option for it's use).

Obtained (partially) from:	[email protected]
2000-07-14 20:31:39 +00:00
Matt Jacob f50998bd4b MFC:Thanks for Andrew Gallatin pointing out that freeing contigmalloc'd
items via free is bad.
2000-07-14 20:20:02 +00:00
Matt Jacob bf28989c2b Empty commit (sorry about the last) for putting in message:
MFC:Pick up some changes from Justin (add tagged queing support, remember
to splx(s) if cam_extend_get fails and we return ENXIO, reset ccb flags
when we push ATIOs back to the SIM, do some data increment fixes, set
priority of command based on whether CAM_DIS_DISCONNECT is set and related
changes).

Add in some more CAM_DEBUG_PERIPH debug statements and also add in support
for TARGIODEBUG which then will enable or disable CAM_DEBUG_PERIPH tracing
for an instance.
2000-07-14 20:17:42 +00:00
Matt Jacob 848f374e3d Empty commit (sorry about the last) for putting in message:
MFC: Add a TARGIODEBUG ioctl to allow for CAM_DEBUG_PERIPH tracing on
an opened target instance.
2000-07-14 20:17:18 +00:00
Matt Jacob 56b00f61b3 Empty commit (sorry about the last) for putting in message:
MFC: Properly initialize softc. Do some minor SCSI_CDB6_LEN changes.
2000-07-14 20:16:48 +00:00
Matt Jacob 10c37b91f1 Empty commit (sorry about the last) for putting in message:
MFC:Some prettifying for the quirk comments.

Add a SA_QUIRK_NO_MODESEL type and use it for the OnStream real SCSI
device (not the broken one). This one is still broken in that it can't
be set to the same fixed block size it reports [ unflattering comments
about this company elided ].

If we're unable to set buffered mode on, complain, but drive on. It's
not a fatal error to not be in buffered mode.
2000-07-14 20:15:51 +00:00
Matt Jacob b8e902937a Empty commit (sorry about the last) for putting in message:
MFC: Add SCSI_CDB6_LEN macro (where 0 ==> 256).
2000-07-14 20:14:19 +00:00
Matt Jacob 93fc58e7da scsi_sa.c 2000-07-14 20:12:09 +00:00
David Malone b309c41436 MFC: 1.40 List inode numbers of suid files. WARNING: Will produce a lot
output the first time this run as it replaces the list without inode
	numbers.
2000-07-14 19:36:00 +00:00
David Malone f4e6c5f84d MFC: 1.25 Fix moving symlinks across partitions. 2000-07-14 19:17:27 +00:00
Bill Paul 0efcbc1350 MFC: close PR #19904 (call sf_setmulti() at the right point in sf_init()). 2000-07-14 19:12:53 +00:00
Ben Smithurst b5bdeb1afc MFC: rev 1.14 2000-07-14 18:09:05 +00:00
John Baldwin fdde763ed7 MFC: Error out at the beginning if NOPORTS without NODOC. 2000-07-14 18:04:47 +00:00
John Baldwin 00c1f35eea - Add a note about supporting USB out of the box. 2000-07-14 17:28:22 +00:00
Stephen McKay 9854a0793c MFC(rev 1.8): Spelling. 2000-07-14 14:19:37 +00:00
Neil Blakey-Milner 629b2937a1 MFC: 1.222) install /etc/ssl/openssl.cnf
MFC: 1.223) don't build manpages if NOMAN has been set
2000-07-14 13:48:50 +00:00
Neil Blakey-Milner 54c1c1aacb MFC: 1.5 consistent sysctl variables, 1.6 sentence restructuring. 2000-07-14 12:42:03 +00:00
Yoshihiro Takahashi 3df48b4b47 Merged from sys/i386/i386/userconfig.c revision 1.175.2.2. 2000-07-14 12:35:28 +00:00
John Baldwin 2881e1ac5e MFC: Add ftp4.tw.freebsd.org. 2000-07-14 10:40:31 +00:00
Jeroen Ruigrok van der Werven 9f36a9c67a MFC: fix typo. Neerest -> Nearest. 2000-07-14 10:28:44 +00:00
John Baldwin fe8e91db96 MFC: Use struct uc_device in userconfig instead of struct isa_device. 2000-07-14 10:21:34 +00:00
John Baldwin 721cd8e17c MFC: Fix annoynance where you would be asked repeatedly whether or not to
assume the network was configured during multi-user mode.
2000-07-14 09:27:00 +00:00
John Baldwin 73a7d22d3d MFC: Make it easier to disable non-English documentation and ports readmes.
Add the AUTO_KEYBOARD_DETECT option which defaults to off.
2000-07-14 09:24:50 +00:00
Peter Wemm 4055dc96a3 MFC: use MAKE_RSAINTL instead of WITH_RSAINTL - that is what the Makefile
uses and is consistant with the others (MAKE_KERBEROS etc).
2000-07-14 09:23:46 +00:00
John Baldwin 5a9685c245 MFC: Use DOCDISTFILES instead of DISTFILES. 2000-07-14 09:16:07 +00:00
John Baldwin 184100f266 MFC: Make releases a bit more error-resistant. 2000-07-14 09:14:02 +00:00
John Baldwin 763c7aad18 MFC: Axe the loader.config and kernel.config files on the kern and boot
floppies.
2000-07-14 09:10:03 +00:00
John Baldwin b78a4af76e MFC: Add #include's to quiet warning. 2000-07-14 08:14:05 +00:00
John Baldwin 52ae3f5bab MFC: Mention the krb5 distribution. 2000-07-14 08:12:18 +00:00
John Baldwin b45b3911b5 MFC: Update the Australian NTP server and add two French FTP mirrors. 2000-07-14 08:03:31 +00:00
John Baldwin edd76eaa18 MFC: Add support for the mouse_flags rc.conf variable to sysinstall. 2000-07-14 07:51:47 +00:00
John Baldwin fbcdf636e1 MFC: Don't try to look up the hostname of the FTP server when installing
through a HTTP proxy.
2000-07-14 07:20:41 +00:00
John Baldwin 2645dd1013 MFC: Add the 'Z' key to the fdisk editor to toggle the units of the slice
sizes.
2000-07-14 07:05:17 +00:00
John Baldwin e7114ef0e1 MFC: Don't die fatally if we can't open a disk. Also, sync up the comments
to minimize diffs.
2000-07-14 06:54:35 +00:00
John Baldwin 3af5512b7b MFC: Refresh the aout ldconfig table. 2000-07-14 06:38:19 +00:00
John Baldwin b2bb34bdca MFC: _PATH_DEV'ify libdisk and fix a misspelling in an error message. 2000-07-14 06:30:59 +00:00
John Baldwin da254dfc21 - Add a note about supporting USB out of the box.
- Add a note about the changes to the i386 bootstrap to support working
  around the 1024 cylinder.
2000-07-14 05:49:05 +00:00
Kenneth D. Merry 06b15c6416 Mention the new camcontrol 'format' functionality. 2000-07-14 05:17:49 +00:00
Yoshihiro Takahashi e9e9c198fc Merged from sys/boot/i386/libi386/biosdisk.c revision 1.31. 2000-07-14 04:23:45 +00:00
Yoshihiro Takahashi ce64f535c2 Merged from sys/i386/conf/GENERIC revision 1.246.2.7. 2000-07-14 03:57:35 +00:00
David E. O'Brien 737545b140 We are now in 4.1-RC (release candidate) mode.
Only newvers.sh will need to be changed for 4.1-R.
2000-07-14 00:03:01 +00:00
David E. O'Brien a7e26c5339 MFC: rev 1.25 (reverts rev 1.24) 2000-07-13 22:42:13 +00:00
Daniel Harris 231b7f9b4a MFC: 1.10: Add some missing articles (as in a, an, the). 2000-07-13 21:17:33 +00:00
Andrey A. Chernov ab7e81a486 MFC: to prevent various MAILTO abusing call sendmail as user 2000-07-13 18:52:23 +00:00
Bill Paul 0dcc861b81 Temporarily disable support for hardware checksum offload in the Tigon
driver. According to dg, ftp.freesoftware.com will begin transmitting
packets with bogus checksums after about 12 hours under load and won't
stop until the interface is reset. I'm not at all sure how to track this
bug down right now since it's most likely in the firmware, and we want
this to at least be stable for the 4.1 release.
2000-07-13 18:19:11 +00:00
Wilko Bulte a29ac6b0c9 Document non-support by SRM for Symbios895 on PC164
Submitted by: Christian Weisgerber <[email protected]>
2000-07-13 18:12:47 +00:00
David Malone 8dc04b7e26 MFC: 1.7 -> 1.8
Clarify example and fix typo.
2000-07-13 16:41:41 +00:00
John Hay bf5e7d2875 Fix the world and releases.
PR:		19889
Submitted by:	Udo Schweigert <[email protected]>
2000-07-13 16:31:10 +00:00
Warner Losh 0a67393d4a Add xe driver back. It works for a while now in -stable and is needed in
GENERIC for successful installations using it.
2000-07-13 16:13:46 +00:00
Neil Blakey-Milner 1e6433e1a3 MFC: Update st(4) and sd(4) references to sa(4) and da(4) respectively. 2000-07-13 08:44:50 +00:00
Alan Cox 977425bc56 MFC 1.175: vm_object_shadow(): Remove an incorrect assertion. 2000-07-13 08:30:31 +00:00
David Greenman 78e61d468b Quirk entry for TeraSolutions TRC-22 RAID controller to keep mintags
from dropping below 55 due to temporary resource shortages.
2000-07-13 07:58:04 +00:00
David Greenman 4cbbf884d4 Brought in changes from rev 1.81: optimizations. 2000-07-13 07:53:06 +00:00
David Greenman d87e7e14ed Merged undocumented bug fix from rev 1.41: Fix for timer race that can
cause a panic.
2000-07-13 07:45:50 +00:00
David E. O'Brien a0bdf11637 MFC: rev 1.33 (add dev/ppbus for lptio.h) 2000-07-13 06:28:47 +00:00
Matt Jacob 557a640a9b Handle (for now) trivial one level bridge case so we can get the
slot that the bridge happens to be in so we get interrupts working
on bridged cards.
2000-07-13 03:45:11 +00:00
John Baldwin f9692fa078 MFC: Zero the tv_usec field in the atv timeval struct for infinite timeouts
in select() and poll().
2000-07-13 02:15:25 +00:00
Peter Wemm db8c2ff864 MFC [1.92] Critical non-SMP fix. Without this, a context switch happens
for *every* syscall, slowing down syscalls a lot.  (eg: 1.6 million
getpid() calls per second drops to 400K calls/sec)

Matt forgot this when he MFC'ed the SMP changes to RELENG_4.  Without
this, AST_RESCHED is an undefined symbol in /kernel.  It is particularly
interesting that gas/ld do not notice it.
2000-07-13 02:00:56 +00:00
Brian Somers d9ad8d5843 MFC: Cure latency on a single-link MP connection 2000-07-13 00:01:09 +00:00
Archie Cobbs d048a217c0 MFC: (rev. 1.3) use ng_queue_data() instead of NG_SEND_DATAQ() 2000-07-12 23:56:33 +00:00
David E. O'Brien df556fbf3e MFC: rev 1.113 (install /usr/include/dev/ppbus) 2000-07-12 22:56:00 +00:00
John Baldwin f8cce538b1 MFC: Fix select() and poll() to handle timeouts correctly when called with
less than 1 second of uptime.
2000-07-12 22:52:36 +00:00
Ben Smithurst ae6ab690f8 minor typo and whitespace fixes.
PR:		19583
Submitted by:	Bruce A. Mah <[email protected]>
		(one other error spotted by jhb)
2000-07-12 21:51:22 +00:00
Daniel Harris bf6d711fd0 MFC: 1.7: Spelling (embedd to embed) fix and change a comma to a semicolon. 2000-07-12 20:41:11 +00:00
Ben Smithurst a0c7f455ba MFC: mention 'amd -H' in synopsis. 2000-07-12 20:34:02 +00:00
Ben Smithurst 7071d16e96 Mention mtree(8) exclusion support. 2000-07-12 20:28:28 +00:00
Ben Smithurst 94cb5b63f2 MFC: clarify dir/ls/nlist commands. 2000-07-12 19:04:41 +00:00
cvs2svn 5a5cb9d267 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-12 16:39:14 +00:00
David Nugent 27888b02c7 MFC: Skip comments in master.passwd
PR:		bin/19664
2000-07-12 11:09:40 +00:00
Jeroen Ruigrok van der Werven 2c569c0da5 MFC: Really fix some output cosmetics so that the finger -s output is
properly lined up
2000-07-12 09:52:36 +00:00
David E. O'Brien 771a487e8b MFC: rev 1.10
<machine/lpt.h> does not exist anymore.  use <dev/ppbus/lptio.h> now.

Forgotten by:	obrien^2
2000-07-12 08:27:56 +00:00
Assar Westerlund 3b862d9e44 MFC: make sure we do not write out non-printable characters in file
names and symbolic links (by default)

PR:		bin/19354
2000-07-12 06:19:14 +00:00
John Baldwin 6f66be2e19 MFC: Always install boot loader forth files and default loader.conf during
installworld.
2000-07-12 05:16:49 +00:00
John Polstra 701aa2303e MFC 1.6 -> 1.7: Deprecate the dllockinit interface. 2000-07-12 04:54:12 +00:00
John Polstra d2325b6c39 MFC: Use spinlocks + nanosleep for thread locking to make it work
with all threads packages.  Revamp data structures to allow
non-exclusive locking in most cases.  Deprecate dllockinit() and
make it a do-nothing stub.  Merges in the following deltas:

    src/libexec/rtld-elf/rtld.c			1.46
    src/libexec/rtld-elf/rtld.h			1.18
    src/libexec/rtld-elf/alpha/lockdflt.c	1.5
    src/libexec/rtld-elf/alpha/rtld_machdep.h	1.4
    src/libexec/rtld-elf/alpha/rtld_start.S	1.4
    src/libexec/rtld-elf/i386/lockdflt.c	1.5
    src/libexec/rtld-elf/i386/rtld_machdep.h	1.4
2000-07-12 04:49:06 +00:00
Jason Evans 4667c82218 MFC: Always do the right thing if there are multiple sigwait()ers for the
same signal.
2000-07-12 04:47:27 +00:00
John Polstra a38a9833ad MFC 1.10 -> 1.11: Eliminate unaligned accesses while relocating. 2000-07-12 04:32:30 +00:00
John Polstra ad2443fdda MFC 1.19 -> 1.20: Fix .Po usage. 2000-07-12 02:17:17 +00:00
John Polstra 5cbf51af5f MFC 1.10 -> 1.11: Fix missing DPADDs and some style bugs. 2000-07-12 02:14:47 +00:00
Archie Cobbs bec723d71a MFC: (rev 1.5) update to reflect new ng_ether(4) hooks. 2000-07-11 20:50:28 +00:00
Archie Cobbs 1252806759 MFC: make the ng_ether(4) node type dynamically loadable 2000-07-11 20:46:56 +00:00
Paul Saab a914f21190 MFC: [rev 1.180] ed_ioctl() can be called from ifpromisc() after
the card has been removed, don't panic on a NULL pointer in that
case.
2000-07-11 20:06:18 +00:00
Ruslan Ermilov b2f59c1dc1 MFC: (rev 1.33) Don't call warn() with no format string. 2000-07-11 20:00:57 +00:00
Brian Somers c8059ba46d MFC: Add a bunch of system users 2000-07-11 16:56:01 +00:00
Paul Saab b545bdc0df MFC: [rev 1.16] Add a NO_TCSH knob. 2000-07-11 14:35:27 +00:00
MIHIRA Sanpei Yoshiro 1247f4a751 MFC: 1.11 Correct typo in description string: CANNOT' -> CAN'. 2000-07-11 14:07:10 +00:00
Yoshihiro Takahashi 123159a007 MFC: Disabled ida, amr and mlx devices. 2000-07-11 12:38:51 +00:00
Yoshihiro Takahashi 2c8609be2e MFC: machine/lpt.h -> dev/ppbus/lptio.h 2000-07-11 12:04:02 +00:00
Ben Smithurst 4901b526d8 MFC: clarify -S option (s/transfer/file downlod/) 2000-07-11 11:56:51 +00:00
Ben Smithurst 4d1ed1560f MFC: sa_siginfo -> sa_sigaction 2000-07-11 11:53:58 +00:00
Warner Losh ed85262720 MFC: 1.29 fixes the disk going away and then coming back problem 2000-07-11 06:02:49 +00:00
Warner Losh 0b8e60d5b2 Add note about the requirement to do a make buildkernel. Despite
having it in the instructions for UPDATING, people got burned by not
doing it when the new binutils came into the tree.
2000-07-11 05:59:02 +00:00
Paul Saab 5d0e6f26ab MFC: [rev 1.10] Display carriage return properly on the remote side
of the connection when talking to non-freebsd machines.
2000-07-11 01:37:17 +00:00
John Baldwin 06bc5adf33 MFC: document the AUTODETECT_KEYBOARD flag. 2000-07-10 23:03:48 +00:00
Paul Saab 03f45b885c MFC: [rev 1.14] Document the -S flag in the usage() function. 2000-07-10 21:38:27 +00:00
Archie Cobbs e6684dbb9d MFC: move the securelevel check into linker_load_file() 2000-07-10 21:31:58 +00:00
cvs2svn 209a6f5a68 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-10 19:20:09 +00:00
Brian S. Dean f8c4dd457f MFC rev 1.32: Plug the hole where rshd would bypass a proper .rhosts
check if the password was empty.
2000-07-10 17:19:31 +00:00
Nick Hibma d05cd64b43 Remove DIAGASSERT 2000-07-10 15:37:05 +00:00
Sheldon Hearn 1083e477fe MFC: Update for csh(1) -> tcsh(1) upgrade. 2000-07-10 10:42:58 +00:00
Paul Saab b5a7a55d08 MFC: ncurses 5.1 prerelease (20000701)
Add files forgotten in previous commit
2000-07-10 09:58:06 +00:00
David E. O'Brien 5f543405de MFC: rev 1.6 (install the general binutils info files)
PR:     16585
2000-07-10 09:57:20 +00:00
Paul Saab ec805cae0d MFC: ncurses 5.1 prerelease (20000701) 2000-07-10 09:54:51 +00:00
David E. O'Brien 2e649496c1 MFC: rev 1.8 (use a MI version of this now(dev/ppbus/lptio.h)) 2000-07-10 09:29:10 +00:00
David E. O'Brien e56355504e MFC: move adv.4, adw.4, aha.4, ahb.4, bktr.4, bt.4, dpt.4, ed.4, joy.4,
ppc.4, sym.4, and wi.4 to the MI area.
2000-07-10 09:26:41 +00:00
David E. O'Brien ad57d45b78 MFC: rev 1.28 (document "-alias") 2000-07-10 09:19:00 +00:00
David E. O'Brien af494413a4 MFC: remove bogus 'l' suffixes in FP register to register instructions 2000-07-10 09:16:28 +00:00
David E. O'Brien 7a535a693b MFC: use the MI versions of crtbegin and crtend from the "common" directory.
* This fixes the ordering of global constructors and destructors on the
  Alpha.
* This makes crt{i,n}.S empty shells (for link command line compatibility).
2000-07-10 09:15:28 +00:00
David E. O'Brien 966528b5f2 MFC: Tcsh is also a base supplied shell. 2000-07-10 08:47:17 +00:00
David E. O'Brien ef4bca0bf6 Do not build modules with the world bulid unless MODULES_WITH_WORLD
is defined.
2000-07-10 08:22:34 +00:00
Ollivier Robert 50a88cdd3b MFC: create links from ata.4 to {acd,ad,afd,ast}.4.
change references to wd.4 by correct ad.4.
2000-07-10 08:00:52 +00:00
Matt Jacob 7b2a5ca673 MFC: Do the same thing for TurboLaser that was done for Rawhide- make room
for secondary (bridged) PCI busses by making primary PCI instances
16 units apart.
2000-07-10 03:26:19 +00:00
Matt Jacob 08aac9ca4c MFC:
Don't let the infrastructure assign the 'next' PCI bus for us.
Instead, for now (until we get a pci infrastructure cleanup),
assign the PCI bus number to be mcpcia bus instance << 4. This
is to allow secondary bridges some room to be recongnized on
4100 systems.
2000-07-10 00:36:02 +00:00
Matt Jacob 81eed8b85b MFC:
Coordinate with change to mcpcia_pci.c- major primary busses on each
hose are 16 PCI instances apart. This allows us to recognize secondary
PCI busses (at least to a first level) until the pci infrastructure is
fixed.

Turn on support for secondary cycles, too.  Redo debug printouts.
2000-07-10 00:35:30 +00:00
Mark Murray 6cfec0d1e0 MFC: New World Order in crypto distributions via cvsup. 2000-07-09 16:18:56 +00:00
Jun-ichiro itojun Hagino 5c7450e87c repair IPv6 multicast (join to :: means all multi)
From: ume
2000-07-09 11:31:52 +00:00
David E. O'Brien bf901a4dbf MFC: revs 1.14-15 (fixes needed for Binutils 2.10.0) 2000-07-08 23:44:44 +00:00
Wilko Bulte f446e0805c Add some info on SCSI for PC164
Submitted by:	[email protected]
2000-07-08 19:51:06 +00:00
Daniel Harris cdd3a9648d MFC: 1.14, first appeared in 2.9BSD. 2000-07-08 18:26:58 +00:00
Daniel Harris bb289120b3 MFC: Typo: "is unreliably by default" to "is unreliable by default".
PR:	19411
Submitted by:	Benno Rice <[email protected]>
2000-07-08 14:43:34 +00:00
Boris Popov a87ccd369e MFC: free memory on module unloading. 2000-07-08 14:35:56 +00:00
David E. O'Brien da4a74e382 Bump __FreeBSD_version due to the Binutils 2.10.0 upgrade. 2000-07-08 10:09:58 +00:00
David E. O'Brien 7d7515836f This is FreeBSD 4.x, not 5.0. 2000-07-08 10:02:25 +00:00
David E. O'Brien d39385e84d MFC: rev 1.12 (save previous dynamic linker) 2000-07-08 10:01:43 +00:00
Will Andrews 4cfe61fd87 MFC: Fix exit code if process does not exist. 2000-07-08 05:15:33 +00:00
Matt Jacob 27ddb0d5db MFC: fix for make release, etc.. 2000-07-08 02:14:15 +00:00
Brian Somers c2649bd905 MFC: Correct setproctitle() call 2000-07-08 01:12:33 +00:00
Andrew Gallatin 7a1c2a40e1 MFC 1.29: use contigfree() 2000-07-08 00:15:57 +00:00
John Baldwin 568fd2f6bb MFC: Lots of bootstrap fixes and features:
- Add $FreeBSD$ to README
- Coment fix for the if_wx module in loader.conf
- Axe all the unneeded m4 files (yay!)
- EDD support in mbr, boot1 and boot2, and the loader
- inline functions in boot2 that are only used once to gain 68 bytes of
  free space
- emulate the WBINVD instruction in BTX
- remove cruft from the cdldr Makefile
- improve hard disk probe checking as well as lsdev enhancements in the
  loader
2000-07-07 21:12:34 +00:00
David E. O'Brien 69e33ecb3a Make the UC copyright match the installed /COPYRIGHT. 2000-07-07 18:33:50 +00:00
Boris Popov c72e366670 MFC:
If kernel compiled with INVARIANTS clear all references to the removed
memory type and print warning message if not all memory of that
type is freed.
2000-07-07 14:15:20 +00:00
Yoshihiro Takahashi 384f95dcd9 Sync with sys/conf/Makefile.i386 revision 1.179.2.2. 2000-07-07 12:36:58 +00:00
Peter Wemm ce611ff881 MFC: parts of 1.80: call gensetdefs in the correct place. It was being
called *way* too early, leading to the sets to be terminated in the
.kld files and making them useless for linking into a static kernel.
2000-07-07 09:49:48 +00:00
Peter Wemm 06e934645d MFC: 1.85: use an extra .. for one more nesting level. This should make
it comparable with -CURRENT and therefore easier to build a 4.x kernel
under -current and vice versa.
2000-07-07 09:45:29 +00:00
David E. O'Brien 6bf0cb5d3a MFC: revs 1.82-84 (use sys/conf/kmod.mk now to make /sys self contained) 2000-07-07 09:09:41 +00:00
David E. O'Brien 47bfd35ff0 MFC: Change our ELF binary branding to match the SCO (as USL) method in
the latest SVR4 ELF spec
2000-07-07 08:32:13 +00:00
David E. O'Brien aa69c7f0ec MFC: white space sync 2000-07-07 08:31:34 +00:00
Andrey A. Chernov 44d9d36741 MFC: tabs 2000-07-07 08:29:33 +00:00
David E. O'Brien 375068e4de MFC: rev 1.3 (debugging support when using libc_r's pthreads) 2000-07-07 07:44:37 +00:00
David E. O'Brien dd7ad53bc1 Upgrade to Binutils 2.10.0. 2000-07-07 05:34:33 +00:00
David E. O'Brien 867b68e401 Upgrade to Binutils 2.10.0. 2000-07-07 04:31:12 +00:00
David E. O'Brien c61cd1a832 MFC: rev 1.28 Regenerated (fixed the calculation of sy_nargs in sysent tables). 2000-07-07 01:38:58 +00:00
David E. O'Brien f571de6489 MFC: rev 1.33 Regenerated (fixed the calculation of sy_nargs in sysent tables). 2000-07-07 01:38:13 +00:00
David E. O'Brien 81772b59e0 MFC:
Use "nm | awk ..." instead of genassym(1) to generate symbol value headers.
Symbol values are now represented using array sizes (4 arrays per symbol
so that 16-bit machines can represent 64-bit values) instead of being raw
binary values.
2000-07-07 01:36:35 +00:00
David E. O'Brien 9cca497a9d MFC: rev 1.4
Use "nm | awk ..." instead of genassym(1) to generate symbol value headers.
Symbol values are now represented using array sizes (4 arrays per symbol
so that 16-bit machines can represent 64-bit values) instead of being raw
binary values.
2000-07-07 01:31:16 +00:00
David E. O'Brien 9b3422d6e4 MFC: rev 1.1{4,6} (use sys/conf/kmod.mk to make /sys self contained)
rev 1.15 (make MI)
     rev 1.17 (use getassym script)
2000-07-07 01:30:28 +00:00
David E. O'Brien eef5b4dfd5 MFC: rev 1.35-36(use sys/conf/kmod.mk to make /sys self contained)
rev 1.37 (use getassym script)
2000-07-07 01:29:00 +00:00
David E. O'Brien d2aa485211 MFC: rev 1.10 (remove unneeded #includes) 2000-07-07 01:23:45 +00:00
David E. O'Brien 7a69a52439 MFC: Regenerated (fixed the calculation of sy_nargs in sysent tables). 2000-07-07 01:22:45 +00:00
David E. O'Brien ecba3b861a MFC: rev 1.31
Fixed the return type for exit() and the args struct tag several NOPROTO
syscalls including exit().  These entries were unused, so the bugs had no
effect, but the the args struct tag will be used to calculate sy_nargs
correctly.  exit() was wrong in all emulators.
2000-07-07 01:18:21 +00:00
David E. O'Brien f97505514d MFC: rev 1.21 (remove unneeded #includes) 2000-07-07 01:16:52 +00:00
David E. O'Brien ee99765c76 MFC: rev 1.78 (remove unneeded #include)
rev 1.79 (Linux allows to mmap annonymous with a file descriptor passed,
	           FreeBSD doesn't.  In the Linux emulation layer, ignore the fd
			   passed when MAP_ANON is specified.)
2000-07-07 01:15:20 +00:00
David E. O'Brien 75e8ac38b1 MFC: rev 1.3 (style fixes) 2000-07-07 01:12:07 +00:00
David E. O'Brien 118e0424c9 MFC: rev 1.51 (style fixes) 2000-07-07 01:09:51 +00:00
David E. O'Brien 229eea0db6 MFC: rev 1.83 (sort sys includes) 2000-07-07 00:45:16 +00:00
David E. O'Brien 91c6aab4d6 MFC: x86 ASM cleanups allowed/required with/by Binutils 2.10.0.
1. Do not specify the size to operations; allow the assembler to decide.
   (we often were mixing 32-bit operations with 16-bit operands)
2. AT&T asm syntax requires a leading '*' in front of the operand for
   indirect calls and jumps.
2000-07-07 00:38:51 +00:00
David E. O'Brien 873c7968ec MFC: Use MI lptio.h, rather than MD lpt.h. 2000-07-07 00:30:40 +00:00
David E. O'Brien a904106e1c MFC:
1.  build modules with kernel
2.  use objcopy to strip the gcc2_compiled. symbol from kernels
3.  use "nm | awk ..." instead of genassym(1)
4.  move kmod.mk from share/mk to /sys
2000-07-07 00:29:28 +00:00
Kris Kennaway bdef1367a0 Don't allow printf directives in PAGER
Obtained from:	OpenBSD
2000-07-07 00:23:20 +00:00
David E. O'Brien b9c7e39ae8 MFC: rev 1.3 (record the new PALcode revision in the pcs structure after
changing to run OSF/1 PALcode)
2000-07-07 00:20:49 +00:00
David E. O'Brien 10c1242d8e MFC: rev 1.4
Remove AGAIN definition, as FICL 2.04 provides it.  Add strlen, and 2>r 2r>
2000-07-07 00:15:53 +00:00
David E. O'Brien e03ee5debd MFC: rev 1.6 (Modify boot-conf so it can take a kernel or directory name
as a parameter and DTRT)
	 rev 1.7 (add version checking)
	 rev 1.8 (fix usage of the word environment?)
2000-07-07 00:14:34 +00:00
David E. O'Brien ec338b964a MFC: rev 1.8 (allow compliation on standard i386) 2000-07-07 00:11:23 +00:00
David E. O'Brien 10618f4020 White space commit to remove differences with the HEAD. 2000-07-07 00:09:45 +00:00
David E. O'Brien 70629e46f0 MFC: rev 1.18 (make MI as `sizeof' returns different sizes on different
platforms)
2000-07-07 00:08:34 +00:00
David E. O'Brien b5d4a42dbe MFC: rev 1.1{6,8} (place original builtins in a vocabulary called
"builtins" and fix vocabulary juggling)
MFC: rev 1.7
     * Remove the setting of sourceid from bf_vm(), as bf_vm() really has
       no clue.
     * set sourceid to 0 when booting, which is the correct setting for stdin.
     * set sourceid to an arbitrary fd when include'ing, preserving and
       restoring the previous sourceid.
2000-07-07 00:07:08 +00:00
David E. O'Brien 756c2616b8 MFC: rev 1.23
* Remove the setting of sourceid from bf_vm(), as bf_vm() really has no clue.
* set sourceid to 0 when booting, which is the correct setting for stdin.
* set sourceid to an arbitrary fd when include'ing, preserving and restoring
  the previous sourceid.
2000-07-07 00:01:24 +00:00
David E. O'Brien b3db32c3d9 MFC: rev 1.7
Only probe network settings on the first open of the network device.
The alpha firmware takes a seriously long time to open the network device
the first time.
2000-07-07 00:00:26 +00:00
David E. O'Brien cd1a41b26b MFC: rev 1.14 (fix 'q' or 'Q' for the show command) 2000-07-06 23:59:28 +00:00
David E. O'Brien e7e3cef62b MFC: rev 1.18 (boot /kernel.old if /kernel is missing) 2000-07-06 23:58:16 +00:00
David E. O'Brien c24432e6f0 MFC: rev 1.3 (clean up cruft) 2000-07-06 23:54:54 +00:00
David E. O'Brien 191eb32cbd MFC: rev 1.2 (emove metion of the 'magic options) 2000-07-06 23:53:25 +00:00
David E. O'Brien c41a56466e MFC: upgrade to FICL 2.04 and fix issues on the Alpha platform. 2000-07-06 23:51:46 +00:00
David E. O'Brien 3383f19d6b MFC: Add setenv, getenv, setenv?, unsetenv, copyin and copyout,
ANS CORE EXT and SOURCE-ID.
      Also don't use FP regs on the Alpha in libficl and other Alpha
	  needed fixes.
2000-07-06 23:45:00 +00:00
David E. O'Brien b24278a2e0 MFC: Commonly install manpages and backup previous loader. 2000-07-06 23:35:17 +00:00
David E. O'Brien c65eded03b MFC: add FreeBSD Ids. 2000-07-06 23:29:48 +00:00
David E. O'Brien 0719608a61 MFC: Commonly install manpages and backup previous loader. 2000-07-06 23:27:28 +00:00
Andrey A. Chernov 85ffb74447 MFC: upgrade to 4.1 2000-07-06 23:11:11 +00:00
Andrey A. Chernov 595099b414 MFC: upgrade to 4.1 2000-07-06 23:04:36 +00:00
David E. O'Brien 3aee87a881 MFC: clean up all of the 16-bit assembly code in the x86 bootstrap to work
with Binutils 2.10.0 -- all the old m4 macros are no longer needed.

Also MFC rev 1.18-22 sys/boot/i386/btx/btx/btx.s (change string and support
                     new instructions).
2000-07-06 23:04:33 +00:00
David E. O'Brien 7f748e6367 MFC: Change our ELF binary branding to match the SCO (as USL) method in
the latest SVR4 ELF spec.
2000-07-06 22:42:19 +00:00
David E. O'Brien 13c7715f7b MFC: Change our ELF binary branding to match the SCO (as USL) method in
the latest SVR4 ELF spec.
2000-07-06 22:26:41 +00:00
John-Mark Gurney 8e2d8ce245 MFC: merge in rev 1.3 through 1.10 2000-07-06 22:23:09 +00:00
David E. O'Brien a846081312 MFC: Upgrade to Binutils 2.10.0. 2000-07-06 22:16:12 +00:00
David E. O'Brien aed6a96c48 MFC: rev 1.44-45 (fix LDADD)
rev 1.46 (debugging support when using libc_r's pthreads)
     rev 1.47-48 (upgrade to Binutils 2.10.0)
2000-07-06 22:12:46 +00:00
David E. O'Brien 2390f50b84 MFC: rev 1.22 (debugging support when using libc_r's pthreads) 2000-07-06 22:08:50 +00:00
David E. O'Brien 7d9490d9df MFC: rev 1.3 (debugging support when using libc_r's pthreads) 2000-07-06 22:08:07 +00:00
Andrey A. Chernov ee8762a725 MFC: curses -> termcap 2000-07-06 22:06:24 +00:00
David E. O'Brien 3d1ecd9f80 MFC: 1.13 (debugging support when using libc_r's pthreads) 2000-07-06 21:56:42 +00:00
David E. O'Brien eef6e7d85e MFC: rev 1.6
Change our ELF binary branding to match the SCO (as USL) method in the latest
SVR4 ELF spec.
2000-07-06 21:46:59 +00:00
David E. O'Brien ee2ffd26e7 MFC: upgrade to version 4.1. 2000-07-06 21:45:03 +00:00
David E. O'Brien abff5f4e0f Upgrade to Binutils 2.10.0. 2000-07-06 21:33:51 +00:00
Paul Saab cdcf87294b MFC: Delay calling the device cleanup routines until the absolute
last moment.
2000-07-06 00:34:03 +00:00
Bill Paul 9eb5672306 MFC: Close PR# 19617: add support for VIA VT6102 NICs to VIA Rhine
driver
2000-07-05 21:43:59 +00:00
Andrey A. Chernov 3ceb8741c8 MFC: alt months 2000-07-05 21:03:56 +00:00
Gerard Roudier 31102137ca MFC: `cvs log -r1.17 -r1.18 sym_hipd.c' to get full log.
Significant changes:
- Remove obsolete informations from the README.sym file.
- Check also against DT_DATA_IN phase on parity/crc error.
  (Merged from Pamela Delaney's changes in the Linux driver)
- Fix support for phase mismatch handling from the C code for
  the C1010 (only useful for testing issue).
- Add an asynchonous notification handler for `lost device'
  (AC_LOST).
2000-07-05 20:37:53 +00:00
Matt Jacob 9ac958a865 MFC:
Oops! If we're deciding a command is now really dead, make *darned*
sure that it really is by issuing a ISPCTL_ABORT_CMD just on the
off chance the f/w will start it up again and, ha ha, start using
the DMA resources we gave it but are now taking away.
2000-07-05 18:59:32 +00:00
Matt Jacob ee8f5914ca MFC:
Clean up ISPCTL_ABORT_CMD function to not be too chatty if it succeeds,
or even if it fails with INVALID_PARM (which just means that the handle
doesn't refer to an active commane).
2000-07-05 18:58:47 +00:00
Matt Jacob ac31856e15 MFC: add lines for WX (Intel Gig Ether) and ispfw (ISP Firmware) modules. 2000-07-05 18:36:17 +00:00
Sheldon Hearn 6564e96498 MFC rev 1.20: correct usage() output for --exclude. 2000-07-05 10:32:59 +00:00
Sheldon Hearn ceaf6abdb0 MFC rev 1.63: fix typo. 2000-07-05 10:09:16 +00:00
Jordan K. Hubbard 91becd249d MFC: ignore memory disks 2000-07-05 07:20:23 +00:00
Peter Wemm 2bd8ab81c5 MFC: NO_TCSH and WITH_RSAINTL hooks 2000-07-05 00:05:59 +00:00
Wilko Bulte 9ae9824ae4 [MFC]: follow Matt's MFC of:
- Sable, DemiSable, Lynx support
- Rawhide support
- UP1000 support

Obtained from:	Matt's heads up
2000-07-04 20:24:01 +00:00
Andrey A. Chernov 8d11ea018d MFC: colorls 2000-07-04 18:45:27 +00:00
Yoshihiro Takahashi c226261be4 MFC: Added PC-98 support. 2000-07-04 12:33:56 +00:00
David E. O'Brien a4f7e87717 MFC: rev 1.37 [sort the sys includes] 2000-07-04 06:12:24 +00:00
David E. O'Brien 92b807be17 MFC: get all offical GCC bug fixes from 2.95.2-release to 26-May-2000. 2000-07-04 06:01:51 +00:00
David E. O'Brien 442caf2729 MFC: rev 1.7 [Yell about -O2 on the Alpha. Forceably downgrade -O2+ if
"FORCE_OPTIMIZATION_DOWNGRADE" is defined when GCC is built.]
2000-07-04 05:55:22 +00:00
David E. O'Brien c2447dfc70 MFC: Clean up the FreeBSD configuration files -- better seperation of
MI & MD bits, and don't use svr4.h.
2000-07-04 05:51:05 +00:00
David E. O'Brien f070f0d04e MFC: rev 1.49 [don't include svr4.h as it is not needed by the FreeBSD
config cleanup]
2000-07-04 05:42:47 +00:00
David E. O'Brien 3be82adc64 MFC: move c-decl out of libcc_int.a as it is not used across all C-like
backends and its symbols conflicts with several cc1plus sources.
2000-07-04 05:41:39 +00:00
David E. O'Brien 860b4863a3 MFC: rev 1.6 [make the build-tools objects weirder named] 2000-07-04 05:39:50 +00:00
David E. O'Brien 6515385ad3 MFC: rev 1.13 [Move some cflag contents to where they are acutally used]
rev 1.14 [clean f77.1]
2000-07-04 05:37:17 +00:00
David E. O'Brien 9a86dd8ae7 MFC: Move some cflag contents down to where they are acutally used. 2000-07-04 05:34:54 +00:00
David E. O'Brien b534d38ce2 MFC: Improve build granularity by introducing NO_CPP and NO_CXX. 2000-07-04 05:32:51 +00:00
David E. O'Brien 733a48bba4 MFC: upgrade csh to tcsh. 2000-07-04 05:29:28 +00:00
David E. O'Brien c0395a7dd2 MFC: add all the various new keymaps. 2000-07-04 05:28:24 +00:00
David E. O'Brien 6f4719ea02 MFC: remove Global. It now lives in /usr/ports/ 2000-07-04 05:26:12 +00:00
Paul Saab 83cb554141 MFC: [rev 1.12] Remove unneeded #include. 2000-07-04 03:58:47 +00:00
Matt Jacob 953b7fa37f MFC: oops- MFC that I am the maintainer... 2000-07-04 02:34:49 +00:00
Matt Jacob 25360fe99c MFC:
Add UP1000 to GENERIC.

Add AlphaServer 2000 (demi-sable), 2100 (sable), and 2100A (lynx) support.
Only PCI and on-board ISA peripherials are supported at this time.

Add option for Rawhide (AlphaServer 4100 systems).
2000-07-04 02:33:47 +00:00
Matt Jacob 49da41564e MFC: Remove obsolete isp_dogactive tag.
Add 8 bits of volatile mailbox busy mask- this will be the bitmask
of output mailbox values we want to get back out of the chip once
a mailbox command is done. Add storage for the maximum number of
output mailbox registers to the softc.  Set ISP_MAX_LUNS to be off
of new isp_maxluns tag in softc.  Change our 'fabdev' tag to
'loggedin'.  Increase size (and add defines for) topology storage.

Roll minor version numbers.
2000-07-04 02:31:19 +00:00
Matt Jacob 92d99305d8 MFC: Add mailbox bitmask macros (numbers of available mailbox registers
based upon Qlogic chip type). Define maximum mailboxes. Add INT_PENDING_MASK
macro. Change mailbox offset macro name.

cleanup i_int_X vs. uint_X definitions

The storage for WWN from NVRAM is actually the PORT WWN, not the NODE WWN.
2000-07-04 02:30:09 +00:00
Matt Jacob 9142187c1c MFC: add MBOX_GET_RESOURCE_COUNT command 2000-07-04 02:29:24 +00:00
Matt Jacob 9c5a03ddee MFC: add "disable autodisconnect" flags 2000-07-04 02:28:55 +00:00
Matt Jacob cc010aab96 MFC: Remove all ISP2100_SCCLUN define based code and replace it with runtime
comparisons against the tag isp_maxluns- if > 16, we're SCCLUN based.

On initial regular SCSI startup, disable auto-disconnect.
2000-07-04 02:28:28 +00:00
Matt Jacob 15a12e9668 MFC: Fix completely stupid and idiotiuc sprintfs in isp_inline.h with
with the STRNCAT function.

Add an isp_handle_index function- this is prepatory to loading more into
the handle (i.e., generation number), so we will now need a function that
will take a handle and return a flat index [ 0 .. maxhandles-1 ] for
auxillary routines that need an index to get at buddy store values
(like dma maps or xflist pointers).
2000-07-04 02:27:47 +00:00
Matt Jacob 250d7106a2 MFC: Roll platform minor number. Force definition of SCSI_ISP_FABRIC
(we always support fabric now). Remove SCCLUN definition (we always
support SCCLUN now, if we load the f/w). Add typedef definition of an
external firmware fetch function.

Clean up private storage so that we can use the spriv_field0 to
store a bitmask of whether we've set a value into ccb->ccb_h.status,
whether we're in the watchdog routine for this command now, whether
we've set a grace period for this command and whether this command is
actually done.

See comments of rev 1.45 of isp.c for more complete information.

Add in isp_lock/isp_unlock inlines. Add in an islocked/intsok flag
to isp_osinfo substructure (all in prep for SMP). Define MBOX_WAIT_COMPLETE
and MBOX_NOTIFY_COMPLETE macros so that we can now (temp) use tsleep
to wait for mailbox completion. Requires us to guess whether we're
servicing an interrupt or not- will use intr_nesting_level.

Add local strncat function.
2000-07-04 02:26:34 +00:00
Matt Jacob 60b5983773 MFC (1.35, 1.36, 1.37, 1.38, 1.39, 1.40): (yes, these should be a better
set of comments- basically synchronization of changes to watchdog timeouts).
2000-07-04 02:25:14 +00:00
Matt Jacob 3060b94fb5 MFC (revisions 1.42 - 1.46) - I'm not going to replicate all of the
comments- particularily for 1.45.
2000-07-04 02:23:12 +00:00
Matt Jacob d46de200d2 MFC (1.47): Change startup locking. Use new isp_handle_index function
for indexing off of handles to get dma maps.

MFC (1.46): Clean up firmware load issues and remove darn near all config
options.  Force alphas to prefer mem mapping as the default.

Basically, we have a pointer to a function which we can call which will
return us a pointer to firmware for the card we have. We call this function
(if it's non-NULL) with the address of our mdvec f/w pointer.

The way this works is that if ispfw (as a module or a static) is loaded,
it initializes the pointer in isp_pci, so we can call into to it to fetch
a pointer to a f/w set.

If ispfw is MOD_UNLOADed, it's retained a pointer to our mdvec f/w pointers,
which then get zeroed out so we don't have any references to data that's
now gone from kernel memory. Removing the f/w saves ~360KBytes.

Alas, there is no autounload mechanism that works for is here.
2000-07-04 02:20:30 +00:00
Matt Jacob d5487070e0 MFC: Remove all but one (ISP_TARGET_MODE) option for isp. 2000-07-04 02:17:41 +00:00
Matt Jacob bb38f026db MFC: Add ispfw as an optional 'device' (for static linking) 2000-07-04 02:16:20 +00:00
Matt Jacob 50a48337bf MFC: add wx module 2000-07-04 02:12:13 +00:00
Matt Jacob fb3200d755 MFC: add ispfw module. 2000-07-04 02:11:04 +00:00
Matt Jacob 7b6a16ad37 MFC: Remove asm_pci.h from this branch- we now have the ispfw module. 2000-07-04 02:08:35 +00:00
Matt Jacob f15b5b5940 MFC: Pull in the latest firmware and add the ispfw module to this branch. 2000-07-04 02:07:52 +00:00
cvs2svn 394b56b7ca This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-07-04 02:06:01 +00:00
Matt Jacob 970f920a95 MFC: support for Rawhide (4100), sable, demisable && lynx, and UP1000 systems. 2000-07-04 02:02:53 +00:00
Matt Jacob 7b091a11f9 MFC (1.52): Add a SA_QUIRK_NO_MODESEL type and use it for the OnStream real SCSI
device (not the broken one). This one is still broken in that it can't
be set to the same fixed block size it reports [ unflattering comments
about this company elided ].

If we're unable to set buffered mode on, complain, but drive on. It's
not a fatal error to not be in buffered mode.

MF (1.46): Per Justin's request- remove his name from Copyright.
2000-07-04 01:59:44 +00:00
Matt Jacob b4db493aec MFC (1.23): Sometimes there isn't an ISA bus configured. 2000-07-04 01:57:37 +00:00
Matt Jacob 463c9adbf3 MFC: fix CVS/RCS headers 2000-07-04 01:57:05 +00:00
Matt Jacob 8632cdc383 MFC(1.8): Use bus_space_handle_t instead of bus_space_tag_t to hold the result
from rman_get_bushandle().
2000-07-04 01:55:55 +00:00
Matt Jacob 663d601001 MFC (1.4, 1.5): Support bounce buffers for ISA DMA on the alpha.
This is required for the irongate chipset (used in the UP1000) which
does not support scatter/gather DMA. We'll still use scatter gather if
the core logic chipset supports it.
2000-07-04 01:55:19 +00:00
Matt Jacob 22fbec8206 MFC:Allow platform specific isa interrupt setup & teardown routines in
preparation for sable/lynx support
2000-07-04 01:54:16 +00:00
Matt Jacob 14b2d19b1f MFC: Add support for the Alpha Processor, Inc. UP1000 system. 2000-07-04 01:51:04 +00:00
Matt Jacob a962db4085 MFC(1.7): (infrastructure for) ppc driver on alpha 2000-07-04 01:50:24 +00:00
Matt Jacob 2f309218d7 MFC:
(1.82) Add support for the Alpha Processor, Inc. UP1000 system.

(1.81) Do an explicit getenv on boot_verbose. Now that we have a real FICL boot
loader for alpha (Yay!) we still need to explicitly look for boot_verbose-
I assume because the boothowto flags aren't passed to us at boot like x86.

(1.80) Some white-box (NT) systems have SRM which reports a systype that's
the negative of their blue-box (UNIX/OVMS) counterpart.  This was
causing us to panic early in the boot process because we weren't
expecting a negative index into the cpuinit[] array.

(1.79) Fix DELAY function to use the RPCC cycle counter register.
2000-07-04 01:48:34 +00:00
Matt Jacob 0cce866da6 MFC: Support bounce buffers for ISA DMA on the alpha. This is required for the
irongate chipset (used in the UP1000) which does not support scatter/gather
DMA.  We'll still use scatter gather if the core logic chipset supports it.
2000-07-04 01:46:11 +00:00
Matt Jacob 28f40b79b7 MFC: fix CVS/RCS header. 2000-07-04 01:44:23 +00:00
Matt Jacob ff6cbfa2f8 MFC: Rawhide (4100) support- need to keep a console as we configure... 2000-07-04 01:44:09 +00:00
Matt Jacob d25c830c8d MFC: Add support for Rawhide, Sable, DemiSable, Lynx and UP1000 systems.
Pull back api_cpuinit as part of the latter.
2000-07-04 01:43:31 +00:00
Matt Jacob 4d5cde0e88 MFC:
"Add AlphaServer 2000 (demi-sable), 2100 (sable), and 2100A (lynx) support.
Only PCI and on-board ISA peripherials are supported at this time.
This support has been only lightly tested due to a lack of response to my
call for testers on the freebsd-alpha mailing list.  It works quite well
on the one AS2100 on which it has been tested, but it may not work on
an AS2100A and should therefore be regarded as experimental."

While this may be considered experimental, this should and is being
moved back to the stable branch so there is at least something to work
with before the tree stumps start being dynamited as part of the SMP
rototillage.
2000-07-04 01:42:22 +00:00
Matt Jacob 063e768fb6 MFC: Rawhide (4100) support- MCPCIA is the PCI bus interface 2000-07-04 01:41:25 +00:00
Matt Jacob bc2256ef17 MFC: Add support for the Alpha Processor, Inc. UP1000 system. 2000-07-04 01:40:18 +00:00
Matt Jacob 71ceba7ff7 MFC: Rawhide (4100) support- MCBUS is the primary IO bus 2000-07-04 01:39:24 +00:00
Matt Jacob 7b245619bb MFC: Rawhide (4100) support. 2000-07-04 01:38:51 +00:00
Matt Jacob 15f533b0f8 MFC:
"Add AlphaServer 2000 (demi-sable), 2100 (sable), and 2100A (lynx) support.

Only PCI and on-board ISA peripherials are supported at this time.
This support has been only lightly tested due to a lack of response to my
call for testers on the freebsd-alpha mailing list.  It works quite well
on the one AS2100 on which it has been tested, but it may not work on
an AS2100A and should therefore be regarded as experimental."

While this may be considered experimental, this should and is being
moved back to the stable branch so there is at least something to work
with before the tree stumps start being dynamited as part of the SMP
rototillage.
2000-07-04 01:38:28 +00:00
Matt Jacob db1420d771 MFC:Add support for the Alpha Processor, Inc. UP1000 system. 2000-07-04 01:36:19 +00:00
Matt Jacob 7994d3a6ce MFC(1.148): Update 'hose' (actually, MCPCIA instance #) for Alpha
Rawhide systems.
2000-07-04 01:35:10 +00:00
Paul Saab a564d9da25 MFC: [rev 1.30] Fix style bugs in rev.1.28. 2000-07-04 01:18:09 +00:00
Paul Saab b1ad650c95 MFC: [rev 1.10] Fix rmdir -p a/b/c/. 2000-07-04 01:13:36 +00:00
Paul Saab 29dfb4ec5e MFC: Fix misspelling of DPADD as DPADDA and some misformattings. 2000-07-04 01:04:55 +00:00
Paul Saab 339f3b3bcf MFC: Remove redundat extern declaration. Add $FreeBSD$ 2000-07-04 01:02:23 +00:00
Paul Saab ac26ebc13c MFC: Add links to "edit" to ease tech support's job. 2000-07-04 00:51:35 +00:00
Peter Wemm cf6f2c12ad MFC: deal with rsa_eay.c using USA_RESIDENT to set a safe default. 2000-07-03 22:53:31 +00:00
Paul Saab b85dec9af3 MFC: bind 8.2.3-T5B 2000-07-03 22:47:21 +00:00
Matt Jacob 0a6959fc0a MFC: fix CVS/RCS headers. 2000-07-03 20:08:01 +00:00
Matt Jacob 4a59381a42 MFC(1.15): Avoid dividing by zero when beeping with a zero pitch. This was bad. 2000-07-03 20:04:17 +00:00
Matt Jacob 06cebea477 MFC: Fix CVS/RCS headers. 2000-07-03 19:59:44 +00:00
David E. O'Brien 9f11634768 MFC: patchlevel 2 changes 2000-07-03 18:53:48 +00:00
Josef Karthauser 3657b038c7 MFC: revision 1.36.
Add fflagstostr and strtofflags prototypes.
2000-07-03 18:09:40 +00:00
Sheldon Hearn 1e7a3de465 MFC rev 1.4: Remove extraneous commas and fix run-on mark-up. 2000-07-03 12:22:30 +00:00
Brian Somers 9a30f89851 MFC: Correct printf-style format error
Load ng_ether if posssible
     Make MP & sync ``!program'' links work
     Don't override the peers MRRU with our local MTU setting
2000-07-03 10:23:53 +00:00
Nick Hibma 1da65dd7d0 MFC:
Add a bug to the usbd.conf man page
Make a line of code less ambiguous.
2000-07-03 09:14:17 +00:00
Ruslan Ermilov 792b0bd86d MFC: (rev 1.13) fix a null-dereference problem.
PR:		19069
2000-07-03 08:20:11 +00:00
Paul Saab eee21bf447 MFC: Protect against comments in /etc/{passwd,group} 2000-07-03 06:58:43 +00:00
Paul Saab b0702e3080 MFC:
traceroute.c
[rev 1.12] Bypass IPsec for traceroute invoked by root.
[rev 1.13] Correct FreeBSD id place. Also correct vendor rcsid.

Makefile
[rev 1.12] Bypass IPsec for traceroute invoked by root.
[rev 1.13] Don't compile in IPsec support when NOIPSEC is defined.
2000-07-03 06:41:38 +00:00
Paul Saab ef57b88fee MFC: Add prototype to quiet warnings. 2000-07-03 06:31:56 +00:00
Paul Saab 4ef68ba7e7 MFC: Add -s option for dumping current values of the mixer. 2000-07-03 06:30:06 +00:00
Paul Saab b181aa2d1e MFC:
Fix description of `-i' and `-w' options.
Fix spelling of `TeX'.
Move historical formats into a separate list, to make thier cruftiness
clear.
2000-07-03 06:26:10 +00:00
Paul Saab 36efbb4cdb MFC: Add -p option to prevent lpd(8) from opening a listening
socket.
2000-07-03 06:25:02 +00:00
Paul Saab 4ff4df7b97 MFC: [rev 1.14] Quit on EOF from terminal instead of redisplaying
the prompt.
2000-07-03 06:23:49 +00:00
Paul Saab aac314c81e MFC: [rev 1.13] Print files submitted at the same instant in
deterministic order.
2000-07-03 06:22:35 +00:00
Paul Saab a4c59fe5eb MFC: Add -y option which doesn't ask for confimation, but still
shows progress.
2000-07-03 06:15:14 +00:00
Nick Hibma fdb75ab25f Include libusb in the build 2000-07-02 14:54:22 +00:00
Nick Hibma 02801e4d1b MFC:
libusb from NetBSD by Lennart Augustsson.
(Not updating lib/Makefile is intentional. Will be done later once I've
tested things)
2000-07-02 13:14:00 +00:00
Nick Hibma 8108d5fc7e MFC:
Add rudimentary support for detach
Be better behaved when initialisation fails, i.e. deallocate resources.
Make the message about setting up the BIOS correctly a i386 specific thing.
Add the define for the 440MX motherboard (ICH0, UHCI)
Save the resources in the softc
2000-07-02 12:42:40 +00:00
Nick Hibma 074c4338dc MFC:
Make the hub driver behave more like Windows does. Some device rely on
a specific boot up sequence for them to work right *sigh*
2000-07-02 12:35:15 +00:00
Nick Hibma 25e915c536 MFC:
Add define for Zip 250.
Add detection code for InSystem USB cable.
Make some code less ambiguous.
(Y-E Data floppy) We match on the device, not the revision of the device/
Make two printfs distinct so it is easier to spot where the problem
occurred.
2000-07-02 12:31:42 +00:00
Nick Hibma d634475991 MFC: Add define for OpenBSD. Fix typo. 2000-07-02 12:25:31 +00:00
Nick Hibma 09e1521e11 MFC: Hide a DPRINTF behind level 2. 2000-07-02 12:23:14 +00:00
Nick Hibma e3a30b0334 MFC: Remove define that is no longer needed 2000-07-02 12:21:34 +00:00
Nick Hibma 8b3ee53457 MFC:
Additional quirks for Wacom Tablet and MCT hubs
2000-07-02 12:19:56 +00:00
Nick Hibma 919d496eda MFC:
Implement SIGIO.
Add additional debugging info
2000-07-02 12:16:54 +00:00
Nick Hibma e67f9f4aec MFC: Additional defines. 2000-07-02 12:14:44 +00:00
Nick Hibma 8caba68982 MFC: Update the NetBSD Id 2000-07-02 12:09:16 +00:00
Nick Hibma 04d2ac4233 Reset all endpoints on open. 2000-07-02 11:58:30 +00:00
Nick Hibma f85a059834 MFC: Swapped comments 2000-07-02 11:54:39 +00:00
Nick Hibma 2282bcf521 MFC: Update Lennart's e-mail address. 2000-07-02 11:44:00 +00:00
Paul Saab 0ba4ef57c4 MFC: [rev 1.40] Catch the usage() function up to the command line
changes.  Add -I and remove -e.
2000-07-02 11:42:58 +00:00
Paul Saab 09d589d3c1 MFC: [rev 1.15] Doubling the size of MAXSIZE. 2000-07-02 11:34:44 +00:00
Nick Hibma 42656335a4 MFC: maintain the proper old position in the HID decoder. Change Lennart's
e-mail address
2000-07-02 11:27:27 +00:00
Paul Saab 9e2c5c95c4 MFC: [rev 1.13] Check whether we read as many bytes as we expected. 2000-07-02 11:23:52 +00:00
Paul Saab 9078482b99 MFC: Use errx(), remove unused #include. Correct SYNOPSIS 2000-07-02 11:19:29 +00:00
Paul Saab 77c58b102c MFC:
[rev 1.9]  Fix warning I should have caught in the previous commit.
[rev 1.10] Make cmp -s work properly if skip values are given.
2000-07-02 11:14:42 +00:00
Paul Saab a198063ccc MFC:
Makefile [rev 1.5] Fix LDADD and style bugs from DPADD and LDADD.
du.1 [rev 1.16] Better use of .Nm and .Ar.
du.c [rev 1.19] Use warnx(), -Wall cleaning and remove unused #include.
2000-07-02 10:45:29 +00:00
Paul Saab ff80c22866 MFC: Add a new option: -m enables searching for memory-mapped files. 2000-07-02 10:28:38 +00:00
Paul Saab 7a601ea795 MFC: Add support for msdos and cd9660 filesystems. 2000-07-02 10:20:25 +00:00
Paul Saab 3a7ffea87f MFC: [rev 1.39] Remove unneeded include. 2000-07-02 10:05:43 +00:00
Paul Saab 8c1b1a19ee MFC: Rescale the IOstat bars. Remove unneeded includes. 2000-07-02 10:03:17 +00:00
Paul Saab 487aacda9a MFC:
quota.1 [rev 1.8] Remove incorrect use of .Nm.
quota.c [rev 1.12] Wrap long lines, Unwrap short lines
2000-07-02 09:57:51 +00:00
Paul Saab 2d3baae6dc MFC: Sync SYNOPSIS and usage() string. 2000-07-02 09:52:14 +00:00
Paul Saab 32b12ab483 MFC:
limits.1 [rev 1.15] Properly use .Nm, .Em, .Pa etc.
limits.c [rev 1.8]  Make usage() a simplier function.
2000-07-02 09:50:17 +00:00
Paul Saab d9430d368c MFC: [rev 1.14] Fix a buffer overflow. 2000-07-02 09:44:55 +00:00
Paul Saab 1528962d13 MFC: Use errx(). .Nm fixes 2000-07-02 09:34:27 +00:00
Paul Saab f2bcc56299 MFC: Let cmp(1) grow in -x option to print differences in contemporarry
hex format rather than the mixed decimal/octal format of -l.
2000-07-02 09:28:37 +00:00
Andrey A. Chernov 8707649c92 MFC: call login_close() 2000-07-02 04:17:57 +00:00
Kenneth D. Merry 33a5c4260c MFC, rev 1.26:
When printing out the transfer rate display for 'camcontrol inquiry',
use the current setting for tagged queueing when deciding whether or not to
print "Tagged Queueing Enabled" instead of using the device's actual
capabilities.

Reported by:	Gustavo Vieira Goncalves Coelho Rios <[email protected]>
Reviewed by:	mjacob
Tested for RELENG_4 by:	markm, nectar, will
2000-07-01 23:47:37 +00:00
Kenneth D. Merry 86f6312a89 MFC, rev 1.86:
Disable multi-lun probing on Hitachi DK31* drives.

PR:		misc/18793
Submitted by:	Paul Haddad <[email protected]>
Tested for RELENG_4 by: markm, nectar, will
2000-07-01 23:45:47 +00:00
Kenneth D. Merry 9440208b90 MFC: camcontrol.c rev 1.25, camcontrol.8 rev 1.23
Eliminate the default device name (da) and unit number (0) in camcontrol.

This may break some scripts, but with the number of ways users can damage
a system with this tool, it's important to make sure they specify which
device they want to talk to.

Suggested by:	joerg
Tested for RELENG_4 by:	markm, nectar, will
2000-07-01 23:44:10 +00:00
Kenneth D. Merry 3460c6748c MFC, rev 1.24:
Send 'camcontrol help' usage output to stdout instead of stderr, so it
can be viewed more easily with a pager.

Regular (i.e. short) usage output is still sent to stderr.

PR:			bin/12358
Submitted by:		Christian Weisgerber <[email protected]>
Tested for RELENG_4 by:	markm, nectar, will
2000-07-01 23:41:17 +00:00
Kenneth D. Merry 9a9d0b5d91 MFC, rev 1.22:
Use the Ic (Internal command) mdoc macro to denote camcontrol subcommands.

Submitted by:	sheldonh
Tested for RELENG_4 by: markm, nectar, will
2000-07-01 23:38:03 +00:00
Kenneth D. Merry 754e504d42 MFC, Implement a new camcontrol function, 'camcontrol format'.
Merged files/revisions:

camcontrol.c:		rev 1.23
camcontrol.8:		rev 1.21
libcam/Makefile:	rev 1.7
scsi_da.c:		rev 1.49
scsi_da.h:		rev 1.5

Tested for RELENG_4 by:	markm, nectar, will
2000-07-01 23:35:49 +00:00
Andrey A. Chernov 3af102fd40 MFC: make shure argv is always NULL-terminated 2000-07-01 22:38:28 +00:00
Nick Hibma 047a79cc56 MFC: Wrong speed. 2000-07-01 21:32:28 +00:00
Andrey A. Chernov 32f4d1f4c7 MFC: enable SIGCHLD for childs 2000-07-01 21:26:37 +00:00
Hajimu UMEMOTO 4a378e74d5 MFC: DNS IPv6 transport support 2000-07-01 19:33:05 +00:00
Brian S. Dean 3b06c47a49 MFC rev 1.14: fix calling semantics wrt suser() in ipcperm(). 2000-07-01 14:33:49 +00:00
Roger Hardiman 8a6ea4f96c MFC: Add .image.list to list of files to delete 2000-07-01 13:54:34 +00:00
Paul Saab 4e3eee501a MFC: Change the output of truss to more closely resemble SysV's. 2000-07-01 12:45:51 +00:00
Paul Saab 5848d02f29 MFC: [rev 1.6] Use F_SETFL with arg of 0 to clear O_NONBLOCK. 2000-07-01 12:38:24 +00:00
Paul Saab 3110f35b90 MFC: Add usage. Also document flags -d and -t in banner. 2000-07-01 12:32:35 +00:00
Paul Saab 74b36d1cb2 MFC: #include <errno.h> where needed. Kill extern int errno;.
Minor warnings in tip corrected.
2000-07-01 12:24:23 +00:00
Paul Saab dd4dddae84 MFC: /dev/rXXX -> /dev/XXX 2000-07-01 11:33:43 +00:00
Paul Saab 8fae36cc6f MFC: [rev 1.5] Install mailer.conf as ${BINOWN}, ${BINGRP}. 2000-07-01 11:05:40 +00:00
Paul Saab a485fc643e MFC: [rev 1.9] remove extern int errno; include errno.h 2000-07-01 10:46:25 +00:00
Paul Saab 2ce4c75797 MFC: [rev 1.15] Use %Ef instead of hardcoded %b %e. 2000-07-01 10:42:33 +00:00
Paul Saab e94060c94a MFC: [rev 1.7] Do not dot terminate lines in FILES section. 2000-07-01 10:41:01 +00:00
Paul Saab 81313c07b9 MFC: [rev 1.3] Clean y.output and fix some style bugs. 2000-07-01 10:38:54 +00:00
Paul Saab 56d5d8700e MFC: [rev 1.4] Match err(3) prototype. 2000-07-01 10:37:21 +00:00
Paul Saab 09a76f4665 MFC:
env.c [rev 1.8,1.9]
Fix a situation where a pointer which should point to dynamically
allocated memory was instead pointed to a static string.

misc.c [rev 1.9] entry.c [rev 1.11]
Catch and report memory allocation failures.

do_command.c [rev 1.16]
Catch and report fdopen failures.
2000-07-01 10:35:07 +00:00
Paul Saab 5199e0142e MFC: Do not add progname in err() strings, it will be printed twice 2000-07-01 10:21:34 +00:00
Paul Saab 04c70f1a88 MFC: 1000000 usec -> 1 sec 0 usec; fix. 2000-07-01 10:18:02 +00:00
Paul Saab f164d253e5 MFC: Fix missing DPADD and style bugs. 2000-07-01 10:11:54 +00:00
Paul Saab 67d7d6790b MFC: [rev 1.9] Adjust the width of the first column in output from
"sa -m" to match the max length of user names.
2000-07-01 10:06:41 +00:00
Paul Saab 0155dbab71 MFC: [rev 1.6] Convert to errx(). 2000-07-01 08:32:48 +00:00
Paul Saab 0ec93aa429 MFC:
[rev 1.60] Enable 8bit chars excepting high controls.
[rev 1.63] Prevent a non-exploitable remote buffer overflow.
2000-07-01 08:30:37 +00:00
Paul Saab 5e4a04f5d5 MFC: [rev 1.21] Update references to disk and tape devices. 2000-07-01 08:10:59 +00:00
Paul Saab 30f9694c25 MFC: [rev 1.7] Fix occurences of nos_tun to nos-tun. 2000-07-01 08:09:45 +00:00
Paul Saab 94ec6bec0c MFC: [rev 1.11] Clarify error message. 2000-07-01 08:07:49 +00:00
Paul Saab 280796eef0 MFC:
[rev 1.37] /dev/rXXX -> /dev/XXXX
[rev 1.38] Add QNX 4 partitions to fdisk's list.
[rev 1.39] ADd plan9 partitions to fdisk's list.
2000-07-01 08:01:55 +00:00
Paul Saab a94bacff8a Back this out. This really does not give us the version number of
the kld's.

Pointed out by:		bp
2000-07-01 07:56:00 +00:00
Paul Saab 139548a97e MFC: [rev 1.2] Use the same order in DPADD as in LDADD. 2000-07-01 07:42:36 +00:00
Paul Saab 9484654df2 MFC: [rev 1.32] Remove xref to mount_lfs. 2000-07-01 07:39:53 +00:00
Paul Saab 2a1d44f622 MFC: Display version number of each kld module when using the -v
flag.
2000-07-01 07:37:50 +00:00
Paul Saab 9d67f7c498 MFC: [rev 1.10] Block devices are gone. 2000-07-01 07:32:37 +00:00
Paul Saab 588d3b4e0d MFC: /dev/rXXX -> /dev/XXX 2000-07-01 06:47:47 +00:00
Paul Saab d8bf7d747f MFC: Add include of errno.h where needed, remove extern int errno
where not.
2000-07-01 06:31:52 +00:00
Paul Saab e153613ab0 MFC: Remove unused includes. 2000-07-01 06:23:36 +00:00
Paul Saab 1f0ba10b41 MFC: [rev 1.7] 1000000 usec -> 1 sec 0 usec; fix 2000-07-01 06:11:51 +00:00
Paul Saab 7121f47886 MFC:
[rev 1.7] Make the fore_dnld program more robust and reliable.
[rev 1.8] Remove unused #include.
2000-07-01 06:06:46 +00:00
Paul Saab 624ea18ac5 MFC: Remove unused #include. 2000-07-01 06:02:14 +00:00
Paul Saab ebb1d7255f MFC: Only detect Linksys PCMCIA cards when in a pccard environment. 2000-07-01 05:51:38 +00:00
Paul Saab 6d9ba1e6c5 MFC:
kvm.c [rev 1.14]
Change the return value of kvm_read/kvm_write to be -1 on error.

kvm.c [rev 1.13], kvm_getswapinfo [rev 1.11], kvm_proc.c [rev 1.26]
-Wall, which caught a real bug where buflen wasn't being set properly.
2000-07-01 05:39:52 +00:00
Roger Hardiman a9190b69e5 MFC: Add 'bridge' to list of sections to clean 2000-07-01 04:44:44 +00:00
Paul Saab 6ae863c83e MFC: [rev 1.7] Remove test for block device. 2000-07-01 03:13:10 +00:00
Paul Saab a5a95cfa05 MFC: [rev 1.17] Fix warn format. 2000-07-01 03:11:59 +00:00
Paul Saab b2c3854934 MFC: [rev 1.30] Remove unused #include. 2000-07-01 03:08:59 +00:00
Paul Saab dcaf1f3604 MFC: [rev 1.13] Use %Ef 2000-07-01 03:04:35 +00:00
Paul Saab 54a61a2fd1 MFC: [rev 1.20] Add -g for gigabyte sizes. 2000-07-01 03:02:08 +00:00
Paul Saab 0066d5c87b MFC: [rev 1.10] Fixed LDADD. Using ${LIBM} instead of -lm gave the
wrong libm in most cases and broke the world in some cases.
2000-07-01 03:00:16 +00:00
Paul Saab 749a51e804 MFC: [rev 1.10] 1000000 usecs to 1 sec conversion 2000-07-01 01:34:11 +00:00
Paul Saab 995a1ebb0b MFC: [rev 1.4] Remove duplicated ';' statement delimiters. 2000-07-01 01:28:10 +00:00
Paul Saab c9cb94fb4b MFC: sync with rev 1.13 2000-06-30 23:02:12 +00:00
Nick Sayer e0446b4df3 MFC: 1.11 2000-06-30 16:49:41 +00:00
Nick Sayer 35c176ff83 MFC: 1.19 2000-06-30 16:46:58 +00:00
Garrett Wollman 46ff7cb0dc MFC: spelling an markup fixes from 1.27 through 1.29. 2000-06-30 16:14:07 +00:00
Andrey A. Chernov d17a1b532b MFC: update cons* 2000-06-30 14:02:53 +00:00
Thomas Gellekum 48f5cb73c9 MFC: Install a VGA font for use under X. Doc update. 2000-06-30 11:06:17 +00:00
Paul Saab 5348088fa8 MFC: doc fixes. 2000-06-30 09:54:06 +00:00
Paul Saab d3e59a8f25 MFC: Add DIAGNOSTICS section name and other doc fixes. 2000-06-30 09:51:59 +00:00
Paul Saab 546d70e0ed MFC: remove unknown OPTIONS section name. Getopt returns -1. 2000-06-30 09:47:52 +00:00
Paul Saab c908e3b3cd MFC: Do not dot terminate err() string. Cross reference using .Xr 2000-06-30 09:45:00 +00:00
Paul Saab cbafbfd70f MFC: typo/spelling fixes 2000-06-30 08:43:45 +00:00
Paul Saab 3ddd8420dd MFC: less 2000-06-30 01:03:16 +00:00
Paul Saab 96a3115d75 MFC: /dev/rXXX -> /dev/XXX 2000-06-29 23:49:34 +00:00
Archie Cobbs 461b1a3bbe MFC: (revs. 1.6, 1.7): seq numbers, race condition, ack algorithm 2000-06-29 21:45:39 +00:00
Matthew Hunt cbc6ce3995 MFC: Add \a and \e to echo -e. 2000-06-29 20:51:59 +00:00
Andrey A. Chernov 6f02358d0c MFC: alt_month assigning 2000-06-29 17:24:37 +00:00
Ruslan Ermilov 8dca31a768 MFC: (rev 1.39) "Ease understanding" of how -punch_fw works. 2000-06-29 10:06:27 +00:00
Dag-Erling Smørgrav ac365fd452 Prettify, add $FreeBSD$ and claim maintainership 2000-06-29 09:28:26 +00:00
Hajimu UMEMOTO 9bb4a95866 MFC: Don't call _getipnodebyname_multi(). It fixes the problem that
getaddrinfo() accidentally returns IPv4 mapped IPv6 address instead
of native IPv4 address.
Now, getaddinfo() is scoped address ready.  You can put scoped
address within /etc/hosts.
2000-06-29 08:39:28 +00:00
Dag-Erling Smørgrav f325efaaa8 MFC: everything since RELENG_4 branched 2000-06-29 08:26:26 +00:00
Ollivier Robert 358c7ac1dc MFC: Fix building with -DDEBUG. 2000-06-29 08:23:26 +00:00
Ollivier Robert ba69801acb MFC: Bring the ancontrol buffer oflows fixes here too. 2000-06-29 08:18:38 +00:00
Ollivier Robert a3dc9d0d49 MFC: Fix potential buffer overflows (even if ancontrol is not setuid). 2000-06-29 08:14:54 +00:00
Satoshi Asami 945478703f MFC: extra directories (excluding perl5.006 changes). 2000-06-29 07:39:52 +00:00
Andrey A. Chernov 6fdceb7fc4 MFC: localization 2000-06-28 19:19:04 +00:00
Jason Evans 0976e378df MFC: Fix typo in SEE ALSO section. 2000-06-28 03:16:41 +00:00
Josef Karthauser ac01b81856 MFC: Remove the getflags/setflags functions. Their functionality has
been replaced with the libc functions fflagstostr and strtofflags.
2000-06-28 02:45:57 +00:00
Josef Karthauser 7c6e002bd5 MFC: Use the new fflagstostr and strtofflags functions in libc. 2000-06-28 02:33:17 +00:00
Josef Karthauser a588b737ee MFC: strtofflags and fflagstostr are functions for converting between
file flag strings such as 'noschg', or 'schg,uunlnk' and their
     internal argument forms such as would be given to chflags(2).
     [forced commit to get the log message in - due to a remote cvs
     commit failure this file was added to RELENG_4 without a commit
     message.]
2000-06-28 01:56:38 +00:00
Josef Karthauser 12b9ffbb9b MFC: strtofflags and fflagstostr are functions for converting between
file flag strings such as 'noschg', or 'schg,uunlnk' and their
     internal argument forms such as would be given to chflags(2).
2000-06-28 01:52:24 +00:00
Josef Karthauser fa9e49dab8 MFC: strtofflags and fflagstostr are functions for converting between
file flag strings such as 'noschg', or 'schg,uunlnk' and their
     internal argument forms such as would be given to chflags(2).
2000-06-28 01:28:22 +00:00
David Nugent d5c4e10f4b MFC: Detect changes if the edit lasts < 1 second.
PR:		bin/4238
2000-06-28 00:24:45 +00:00
Josef Karthauser 2e334a213f MFH: Don't assume that the output of strftime for "%c" ("national
representation of time and date") won't change in time.
     Instead of hard coding the locations of the time elements and
     hoping that they don't move use strftime to generate the
     desired formats in the first place.
2000-06-28 00:18:22 +00:00
Alfred Perlstein c72a3e5247 MFC: 1.85, don't panic on strange filetypes 2000-06-27 23:14:07 +00:00
Jason Evans eda4480be0 MFC: Don't allow pthread_suspend_np()/pthread_resume_np() to cause
pthread_mutex_lock(), pthread_cond_trywait(), and pthread_cond_wait() to
return EINTR.
2000-06-27 21:20:46 +00:00
Garrett Wollman 593907b4d0 MFC: -Z flag; Sheldon's mdoc fixes. 2000-06-27 19:55:40 +00:00
Ruslan Ermilov 6b56f179d8 Argh, MFC failed last time for this file. 2000-06-27 16:59:42 +00:00
Ruslan Ermilov 89efc37b28 MFC:
- new options: -redirect_proto, -target_addr, -punch_fw
- obsoleted option: -pptpalias
- LSNAT support
2000-06-27 16:54:20 +00:00
Ruslan Ermilov b1a961edb8 MFC: fixed PunchFWHole(). 2000-06-27 16:44:13 +00:00
Ruslan Ermilov 2f62774cdd MFC: remove ``nat pptp'' as this is now done transparently by libalias. 2000-06-27 16:35:12 +00:00
Ruslan Ermilov 9a3a008e72 MFC:
- Added support for FTP EPRT (RFC 2428) command.
- Added support for passive mode FTP servers behind NAT.
- Added security checks for FTP aliasing.
- Load Sharing using IP Network Address Translation (RFC 2391).
- Real PPTP support.
2000-06-27 16:29:31 +00:00
Jeroen Ruigrok van der Werven f3b39d17ad MFC: Fix source_rc_confs comment
Fix NFS mounting shell code
	Fix /var/spoool/lock deletion

Reminded by:	Doug Barton <[email protected]>
2000-06-27 09:43:30 +00:00
David E. O'Brien a28b7387be Ugrade to version 2.0 PL 1. 2000-06-26 23:24:36 +00:00
David E. O'Brien e3dbcf5374 Ugrade to version 2.0 PL 1. 2000-06-26 23:07:22 +00:00
Archie Cobbs 0ceb54f0a7 MFC: token returned by NgSendMsg() and NgSendAsciiMsg() 2000-06-26 19:49:47 +00:00
Jordan K. Hubbard decbe87c56 Update this file for RELENG_4 branch
Submitted by:	Bruce A. Mah <[email protected]>
PR:		19495
2000-06-26 15:46:18 +00:00
Alexander Langer a4930c1643 MFC: mcontext_t -> ucontext_t 2000-06-26 15:01:52 +00:00
Sheldon Hearn 915f59dafc MFC rev 1.8: Remove obsoleted info about linking from contrib 2000-06-26 14:09:01 +00:00
cvs2svn d0c4b1ba87 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-06-26 08:06:25 +00:00
David Nugent 6038fd0dfe MFC: Fixes virtual host selection from /etc/ftphosts.
PR:		bin/19390
2000-06-26 05:44:43 +00:00
David Nugent 0097e29672 MFC: don't dereference NULL in userdel. 2000-06-26 01:16:08 +00:00
Andrew Gallatin 00339489d8 MFC: fix for unaligned access trap when booting alphas diskless 2000-06-25 19:32:49 +00:00
Dag-Erling Smørgrav e5ef2d3fd0 Unbreak Alpha world.
Submitted by:	 kato
2000-06-25 15:18:00 +00:00
Warner Losh afb85591d2 MFC: softupdate information 2000-06-25 08:27:08 +00:00
Boris Popov 59165f63b2 MFC: do not perform any operation with mbuf after inserting it in the
driver queue.
2000-06-25 02:23:39 +00:00
Matt Jacob b86b8fe1d7 MFC: If swdpio1 doesn't clear, we have a reversed (or disconnected) cable.
Change the message to indicate that it could also be a disconnected cable,
and return okay from wx_hw_intialize *anyway*. This allows us to contineu
to set the station address and when we do get link up, we're ready to roll.
2000-06-25 02:05:47 +00:00
Mike Pritchard 2db507dbfb MFC: remove some mis-leading text from the "Libraries" section. 2000-06-24 23:03:42 +00:00
Mike Pritchard 3c95b47caa MFC: re-implement the fix from rev 1.6 that was lost during the
lite-2 merge.
2000-06-24 22:48:15 +00:00
Matthew Dillon eb05dca747 MFC from -current
Add rc.conf variables for ip_portraneg_first, ip_portrange_last, and
    ipsec_enable (specifies file).  These items must be handled before
    any daemons are started or, for example, named might use too low
    a port for your fireall.
2000-06-24 20:51:27 +00:00
Ruslan Ermilov 03ffd6e9ca MFC: -Wall cleanup, `gateport' type fix. 2000-06-24 15:35:46 +00:00
Andrey A. Chernov 8cf71d59dc MFC: c_fmt 2000-06-24 12:39:43 +00:00
Ollivier Robert 77e6a8817a MFC: forgot to commit the -Wall addition from a previous MFC. 2000-06-23 18:47:47 +00:00
Ollivier Robert 076bb8ea6b MFC: makes the code -Wall -Wmissing-prototype clean. 2000-06-23 18:45:41 +00:00
Ollivier Robert 0a2a364239 MFC: This patch adds the -mindepth and -maxdepth options to find(1), which
behave as in GNU find (and of course as described in the manual page
      diff included).  I think these options would be useful for some people.

      Some missing $FreeBSD$ tags are also added.

PR:	bin/18941
2000-06-23 18:38:46 +00:00
Alexander Langer 3063a96181 MFC: RELENG_4 is FreeBSD-STABLE now. 2000-06-23 17:51:17 +00:00
Ollivier Robert ed21836875 MFC:
The find -perm option currently supports an exact match,
          or if the mode is preceded by a '-', it checks for a match
          in at least the bits specified on the command line.  It is
          often desirable to find things with any execute or setuid or
          setgid bits set.

PR:		bin/10169
2000-06-23 17:45:22 +00:00
Ruslan Ermilov e1995c01d4 MFC: (rev 1.17) Get rid of segfault in a `site %s' case. 2000-06-23 14:42:13 +00:00
KATO Takenori 9bf18d2f2b MFC (rev 1.20: fix for the EPSON_MEMWIN option). 2000-06-23 12:05:24 +00:00
Yoshihiro Takahashi 0a357eda0f MFC: Define PC98 when MACHINE == pc98. 2000-06-23 11:20:52 +00:00
Peter Wemm c8ddb2dcb5 MFC: delete; repocopied to src/sys/ufs/ffs 2000-06-23 00:12:08 +00:00
Peter Wemm c46bdd4cc0 MFC: new bsd-style unrestricted license text 2000-06-22 19:27:42 +00:00
Hajimu UMEMOTO d1b2943563 MFC: Inhibit successful DAD messages and "no default interface" messages.
It seems that people find them too noisy.
(ND6_DEBUG will enable them)
2000-06-22 19:11:29 +00:00
Jun-ichiro itojun Hagino 5f1fd1a636 correct bad TTL with packets generated by v4 mapped udp. MFC 1.8->1.9 2000-06-22 16:50:33 +00:00
Sheldon Hearn 58ea5cbcfc MFC rev 1.14 and rev 1.15: Fix -i and remove an unused variable. 2000-06-22 12:58:19 +00:00
Sheldon Hearn f642f5eb06 NetBSD's @ shortcuts were merged onto RELENG_4 on 14 March 2000.
Reflect the change in the appropriate manual page.
2000-06-22 12:50:15 +00:00
Yoshihiro Takahashi a27520aae1 Sync with sys/dev/syscons/scterm-sc.c revisions 1.4.2.2 and 1.4.2.3. 2000-06-22 10:04:40 +00:00
Yoshihiro Takahashi 07a1f58444 Sync with sys/i386/conf/GENERIC revision 1.246.2.6. 2000-06-22 09:37:43 +00:00
Sheldon Hearn e3a4328970 MFC rev 1.2: Fix transcription errors. 2000-06-22 08:48:03 +00:00
Sheldon Hearn 555216ed29 MFC rev 1.5: Fix transcription errors. 2000-06-22 08:47:34 +00:00
Sheldon Hearn 4f9b2f139e MFC rev 1.2: Use sub-sections, rationalize diag lists and break lines
as per accepted style.
2000-06-22 08:34:08 +00:00
Peter Wemm 164dca0cb9 Activate soft updates in GENERIC by default (It is filtered from BOOTMFS) 2000-06-22 06:03:12 +00:00
Jordan K. Hubbard ae436a5b0e MFC: keep SOFTUPDATES off the boot floppy. 2000-06-22 05:58:54 +00:00
Archie Cobbs 642bf4ae05 MFC: (rev. 1.18) don't try to apply ipfw filtering to non-IP packets. 2000-06-21 23:54:37 +00:00
Archie Cobbs 876d82a959 MFC: add MLINKS for the functions defined in netgraph(3) 2000-06-21 23:01:43 +00:00
Wilko Bulte c48cb91608 [MFC]: OpenVMS labeled disks also seem to give the installer fits.
Warning to be removed when alpha/17642 is fixed.
2000-06-21 19:59:16 +00:00
Andrey A. Chernov 5ad4631147 MFC: Korean date, %EF 2000-06-21 14:11:47 +00:00
KATO Takenori f599a69858 MFC: CPU_PPRO2CELERON and CPU_L2_LATENCY options to support Socket 8 to
370 converters.
2000-06-21 12:22:38 +00:00
Yoshihiro Takahashi cc9a153647 MFC: Fixed to support RSA98-III non-pnp mode. 2000-06-21 11:23:52 +00:00
Yoshihiro Takahashi e89906b676 MFC: Terminate aic_ids[]. 2000-06-21 09:37:09 +00:00
Dag-Erling Smørgrav 9ea44cf9cc Include linprocfs in the build now that it has been verified to work. 2000-06-21 09:36:40 +00:00
Dag-Erling Smørgrav 4b3fc74024 MFC: textvp_fullpath(), revive /proc/pid/file. 2000-06-21 09:33:43 +00:00
Dag-Erling Smørgrav 724de9a4fb MFC: textvp_fullpath() 2000-06-20 18:26:59 +00:00
Brian Somers b58448d849 MFC: Understand comments in passwd and group files 2000-06-20 17:42:36 +00:00
Alexander Langer 0c763d0af9 MFC: Fix "This aid in pin pointing" typo. 2000-06-20 15:42:57 +00:00
Stefan Eßer b5629377de MFC: Fix cut-n-paste error (rev 1.27) 2000-06-20 15:41:44 +00:00
Alexander Langer 0d3e1704ed MFC: mdoc style cleanup. 2000-06-20 15:06:11 +00:00
Alexander Langer 6bc75c32bc MFC: Fix groff confusion in PS output. 2000-06-20 10:55:45 +00:00
Alexander Langer c155b0ad3c MFC: /etc/weekly -> /etc/periodic/weekly/320.whatis 2000-06-20 10:42:06 +00:00
Alexander Langer 9a25c6d335 MFC: rc.local is no longer in a default installation. 2000-06-20 10:32:11 +00:00
Brian Somers 19615d268a MFC: Allow padding in LQR ECHO requests 2000-06-20 09:14:38 +00:00
Ollivier Robert aad54e571c MFC: security fixes: suser() check and splimp/splx bug. 2000-06-20 05:33:18 +00:00
Brian Somers 2729f4526f MFC: Don't mis-match interface names in iface_Create() 2000-06-19 21:44:17 +00:00
David Greenman 8642ad5e72 Merged changes from rev 1.80: support for 82559ER. 2000-06-19 00:54:30 +00:00
Gary Jennejohn b4de1302e9 Add support for the Am79C973. Tested on my laptop.
Note that, according to the data sheet, the Am79C975
has the same device ID. The main difference seems to be that
the Am79C975 supports WakeonLan.
2000-06-18 08:03:51 +00:00
Paul Saab 26793cef6e MFC: Allow newer Linksys 10/100 PCMCIA cards to work. 2000-06-18 06:08:09 +00:00
David Nugent 777f6346bd MFC recent bug fixes. 2000-06-18 05:45:11 +00:00
Paul Saab 064cea0b96 MFC: Add option ALT_BREAK_TO_DEBUGGER. 2000-06-18 04:43:44 +00:00
Matt Jacob e308a562bb MFC:Fix breakage where we never were attaching SES devices because inq_len
was not being set > 0.
2000-06-18 04:22:37 +00:00
Wilko Bulte a68aad8392 [MFC] explanation of hoses, re-synced some other cleanups 2000-06-17 20:27:22 +00:00
Hajimu UMEMOTO 97f98462a8 MFC: Make sure to use native IPv4 address, even if getaddrinfo()
returns IPv4 mapped IPv6 address.
2000-06-17 18:43:56 +00:00
Yoshihiro Takahashi e659f15a71 MFC: Rename GENERIC98 to GENERIC. 2000-06-17 03:43:09 +00:00
Yoshihiro Takahashi d19818594b Sync with sys/conf/files.i386 revision 1.307.2.4. 2000-06-17 03:39:48 +00:00
Matt Jacob 9494821b38 MFC:Fix this driver to (finally) work with switches. Some more black
magic from the linux driver.
2000-06-16 22:58:03 +00:00
Satoshi Asami 674a247434 MFC 1.92: kterm-color entry.
Approved by:	ache
2000-06-16 18:57:37 +00:00
Ruslan Ermilov 6f2204ec84 MFC:
- rev 1.27: fix buffer overflow with the command line arguments.
- rev 1.30: remove unused parameter.
2000-06-16 09:50:42 +00:00
Brian Somers 2df915fe2d MFC: Add `set urgent none'' and `set ifqueue'' 2000-06-15 17:08:28 +00:00
Wilko Bulte 05cc4fc42b [MFC]: Document that alpha install CDs are now bootable. No need to muck
around with floppies. Also document (for lack of a more appropriate place/file)
the problems the installer has when other disks are present with a BSD
disk label on them. Please remove this warning when the problem is fixed.

PR: alpha/17642
2000-06-14 18:33:51 +00:00
Mitsuru IWASAKI e97d59550e MFC: bios.c 1.32 -> 1.33
Fix gdt pointer for the current cpu on SMP.
This will support power-off only.  Fix for suspend/resume will come later.

Submitted by:	[email protected]
Reviewed by:	jlemon
2000-06-14 18:03:11 +00:00
Alexander Langer f4a4e55900 MFC: /etc/weekly --> /etc/periodic/weekly/310.locate 2000-06-14 17:45:17 +00:00
Hajimu UMEMOTO f7cf24b266 MFC: Mention about -4 and -6 options. 2000-06-14 16:31:26 +00:00
Gerard Roudier 80d6348ece MFC: update sym_hipd.c to revision 1.16.
Previous MFC came from revision 1.13.
Fixes the user settings report problem with Tekram
layout NVRAM for devices configured for Fast-40 and
uses `bus space' instead of legacy IO/MMIO methods.
Other changes that make the patch larger than it
could have been are not dangerous for -stable and it
would have been less safe, in my opinion, to try
to revert them prior to this MFC.
2000-06-14 16:14:46 +00:00
Bruce Evans 2e4ffa3f74 MFC (1.67: fixed allocation of unit numbers). 2000-06-14 15:56:27 +00:00
Andrey A. Chernov 37e53f0291 MFC: "op" for xterm-color 2000-06-14 15:09:22 +00:00
Andrey A. Chernov e5167cf6f3 MFC: add libxpg4 2000-06-14 14:58:49 +00:00
Martin Cracauer 44ca7bef1c Merge fixes that has been in -current for a while. 2000-06-14 13:42:25 +00:00
Alexander Langer b1cea3d85f MFC: options USER_LDT is required for these functions. 2000-06-14 13:40:30 +00:00
KATO Takenori d05e2d56c6 MFC: Celeron recognition (rev. 1.82). 2000-06-14 13:02:54 +00:00
Luigi Rizzo e386e73546 MFC: fix behaviour of "ipfw pipe show" 2000-06-14 10:09:30 +00:00
John W. De Boskey 91368684b7 MFC: 1.7
Add 'tools' to the list of tarballs to be extracted when 'all' is
specified as the distribution.

PR:		18927
Submitted by:	Stephen J. Roznowski <[email protected]>
2000-06-14 05:02:09 +00:00
Mike Smith 7a8af3795c MFC: mention geometry bug with the Mylex driver. 2000-06-14 04:13:40 +00:00
cvs2svn 890e32b21d This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-06-13 22:28:51 +00:00
David E. O'Brien 2932cf65b6 MFC. 2000-06-13 18:10:27 +00:00
cvs2svn dbbc395010 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-06-13 18:09:46 +00:00
Alexander Langer 59c5eb6d7d MFC: mdoc improvements and better readability of the text.
Requested by:	obrien
2000-06-13 17:12:44 +00:00
Ruslan Ermilov 9eb6c7a4f9 MFC:
- rev 1.14: add appropriate MLINKS for rc.*
- rev 1.15: enable installation of picobsd.8
2000-06-13 13:46:25 +00:00
Ruslan Ermilov b93e3bd7c9 MFC: (rev 1.29) treat \t and \n inside /boot.config as whitespaces. 2000-06-13 13:22:34 +00:00
Alexander Langer 6e0b5a1d0f MFC: Fix typo: turn of -> turn off 2000-06-13 12:54:54 +00:00
Paul Saab 0de8efd2e9 MFC: Correctly set the Maximum DHCP Message Size. 2000-06-13 09:33:25 +00:00
Ruslan Ermilov fe08d50e3e MFC: (rev 1.5) make `ssh-agent -k' work for csh(1)-like shells. 2000-06-13 09:17:32 +00:00
Ruslan Ermilov af8892ca63 MFC: cosmetics. 2000-06-13 09:14:54 +00:00
Alan Cox 106faf402a MFC: [rev 1.31] Check "flags" in cpu_fork() before dereferencing "p2". 2000-06-13 09:06:46 +00:00
Ruslan Ermilov 61577ad971 MFC: Remove a no-option MD5. 2000-06-13 08:42:05 +00:00
Ruslan Ermilov b7aaa05bb9 MFC: (rev 1.31) Document /usr/lib/aout. 2000-06-13 08:32:59 +00:00
Ruslan Ermilov 4e10331a2d MFC: (rev 1.110) Unbroke `make symlinks; make copies' sequence. 2000-06-13 08:10:34 +00:00
Nick Hibma d28d23f0c3 Regen. after MFC. 2000-06-13 07:58:48 +00:00
Ruslan Ermilov 0aea79b735 MFC: /usr/mdec has gone. 2000-06-13 07:58:30 +00:00
Nick Hibma 292b25347a MFC: New IDs 2000-06-13 07:58:19 +00:00
Ruslan Ermilov fd38af6891 MFC: (rev 1.11) add additional path for info to /usr/X11R6/info. 2000-06-13 07:33:36 +00:00
Ruslan Ermilov 8d3534426f MFC: (rev 1.21) restore backwards compatible -R option. 2000-06-13 07:17:27 +00:00
Ruslan Ermilov eb32c14127 MFC: (rev 1.133) do not call icmp_error() if ipfirewall(4) denied packet. 2000-06-13 07:12:34 +00:00
John W. De Boskey 3f3e152142 MFC: 1.24 to 4.x df -g support 2000-06-13 03:19:40 +00:00
Andrey A. Chernov 5577a0cd97 MFC: bump major for 3.x binaries 2000-06-13 00:42:40 +00:00
John Baldwin bd90d99ff9 MFC: Clarify the description of some of the err() and warn() functions as
well as some mdoc fixups.
2000-06-12 23:52:58 +00:00
Alexander Langer 59b7a874b7 Remove the 4.x-cvsup from RELENG_4. They should have never been in this
branch.

Pointed out by:	billf
2000-06-12 17:22:44 +00:00
Alexander Langer c555f68b93 RELENG_4 is FreeBSD-STABLE now. 2000-06-12 17:15:55 +00:00
Alexander Langer f96edbbdf7 RELENG_4 is FreeBSD-STABLE now, not RELENG_3.
PR:		17677
Submitted by:	Nathan <[email protected]>
Reviewed by:	asmodai
2000-06-12 16:56:49 +00:00
Alexander Langer 029c17c4bf MFC: Add bus_alloc_resource.9 and bus_release_resource.9
Approved by:	asmodai
2000-06-12 14:05:11 +00:00
Ruslan Ermilov 72a905bb5a MFC: (rev 1.68) -mdoc fixes. 2000-06-12 09:47:20 +00:00
Brian Somers f2327ea33a MFC: Hard sentence breaks and trailing space tidy-ups 2000-06-12 09:06:58 +00:00
Kris Kennaway 6e25b83a10 MFC: Fix syntax error 2000-06-11 21:42:21 +00:00
Luigi Rizzo 7ecfce6d8c MFC: Bring WF2Q+ support in dummynet. Read the ipfw(8) manpage for
documentation. Except for recompiling ipfw, old ipfw configurations
involving dummynet pipes work unmodified.
2000-06-11 18:39:44 +00:00
Søren Schmidt 698fb3cecd MFC:
Update with latest fixes from -current, brings -stable functionality
up to and including following -current revisions:

ata-all.c  $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.57 2000/05/28 07:51:23
ata-all.h  $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.27 2000/04/09 15:08:26
ata-disk.c $FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.69 2000/05/23 19:05:56
ata-dma.c  $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.38 2000/05/23 19:05:56
atapi-cd.h $FreeBSD: src/sys/dev/ata/atapi-cd.h,v 1.18 2000/05/28 07:50:19
2000-06-11 17:02:46 +00:00
Jonathan Lemon d8cb367423 MFC: r1.50, KASSERT() debugging support. 2000-06-11 16:40:06 +00:00
Brian Somers 77e2301643 MFC: Don't oan about padding characters 2000-06-11 12:22:30 +00:00
Seigo Tanimura 84ed0cec48 MFC: Fix minor numbers, locking, the return value of rpattach()
and baud_table.
2000-06-11 07:04:42 +00:00
Kris Kennaway 85fa479083 MFC: Link against -lmd 2000-06-11 05:32:11 +00:00
Matthew Dillon 8a0439de62 MFC 1.37, fix memory leak in mount_nfs background mode 2000-06-11 05:25:18 +00:00
Mike Smith 453a5b8c71 MFC: in APIC_IO mode, ignore the ISA PIC 2000-06-10 22:57:25 +00:00
Kris Kennaway 759c9424ba MFC: Security botch 2000-06-10 22:36:12 +00:00
David E. O'Brien 6e2de6f842 MFC: begin the upgrade of /bin/csh for 4.1-R. 2000-06-10 22:26:04 +00:00
cvs2svn d4840d255c This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-06-10 22:20:55 +00:00
Mike Smith fe3e11179c MFC: improved RAID controller verbiage 2000-06-10 19:42:27 +00:00
Mike Smith 3af2ea02b0 MFC: fix for too-low s/g tables. 2000-06-10 19:23:28 +00:00
Matthew Dillon 4a4d5adc9f MFC 1.54, make serial interrupts optimal on SMP boxes again.
Submitted-by: bde
2000-06-10 17:54:45 +00:00
Paul Saab d945674ac7 MFC: 1.21 Include a RFC 1533 "Maximum DHCP Message Size" option in
our request.
2000-06-09 19:31:57 +00:00
Kris Kennaway 7c3c9173da Gut the list of changes which applied to the 3.x/4.x branch, since
we're now tracking changes to 4.0-STABLE.

Add OPIE and OpenSSH updates.
2000-06-09 08:28:43 +00:00
Kris Kennaway 8df7dce672 MFC: Create DSA key at boot if it doesn't exist 2000-06-09 07:25:15 +00:00
Kris Kennaway 54c89f7728 MFC: OpenSSH 2.1.0 2000-06-09 07:23:25 +00:00
Kris Kennaway 843966b97e MFC: OpenSSH 2.1.0 snapshot 2000-06-09 07:18:47 +00:00
Kris Kennaway dbc1b0b4eb MFC: Extra functions for use by OpenSSH 2000-06-09 07:16:42 +00:00
Kris Kennaway 34388d7059 MFC: opie 2.32 plus changes from OpenBSD 2000-06-09 07:15:02 +00:00
Kris Kennaway b60f35f5e8 MFC: OpenSSH 2.1.0 snapshot 2000-06-09 07:10:31 +00:00
John Baldwin 8895937130 Oops, forgot to MFC the actual USB support in sysinstall. 2000-06-08 23:08:24 +00:00
John Baldwin 31b362f410 MFC: USB support during installation and enabling of USB in the
GENERIC kernel.
2000-06-08 23:07:29 +00:00
Jonathan Lemon cdbae149df MFC: r1.43, fix for connections hanging in LAST_ACK state. 2000-06-08 15:33:55 +00:00
Jonathan Lemon 835e27304f MFC: correct boundary checks against IP options 2000-06-08 15:11:50 +00:00
Jeroen Ruigrok van der Werven c049bc436c MFC: Remove spurious newline character. 2000-06-08 13:31:20 +00:00
Greg Lehey 875638bb16 Clarify which bit of the daemon config disables configuration saves.
This is still terrible.  I need to finally implement variables.

Reported-by:	jmg
2000-06-08 07:27:35 +00:00
Kris Kennaway 2cb84d580d MFC: Typo, update example code 2000-06-08 07:18:03 +00:00
Kris Kennaway b6b88e4892 MFC: Typo 2000-06-08 07:11:22 +00:00
Kris Kennaway ae2b1b1bf4 MFC: Silence warnings 2000-06-08 06:24:44 +00:00
Kris Kennaway 412c792a12 MFC: fork() -> vfork() 2000-06-08 06:15:38 +00:00
Greg Lehey ec99425c57 MFC: Bring up to date with -CURRENT. 2000-06-08 02:08:50 +00:00
Greg Lehey bd9f6bc2ae MFC: Bring in sync with -CURRENT. Significant changes include:
- Add dumpconfig command.
- Fix data corruption problems in RAID-4 and RAID-5 revive.
2000-06-08 02:00:23 +00:00
Greg Lehey fc7abe829c MFC: Bring in sync with -CURRENT. Significant changes include:
- Add dumpconfig command.
- Allow interruption of long-running subcommands with SIGINTR (^C).
- Move default command history file to /var/log/vinum_history, and be
  paranoid about existing files.
2000-06-08 01:53:16 +00:00
Wilko Bulte 71da5b4fdc MFC some backlogged updates. 2000-06-07 18:02:01 +00:00
Bill Paul d6ded6941e MFC: remember to call mii_pollstat() when link comes up, remember to
set 'ignore pause frames' bit in XMAC during initialization.
2000-06-07 17:15:40 +00:00
Bill Paul c2760e4f6a MFC: try to fix watchdog timeouts so that the interface recovers
correctly without tripping over tsleep() at interrupt context.
2000-06-07 17:13:51 +00:00
Bill Paul c56f9ceb38 MFC the autoneg fixes to the if_dc and dcphy driver(s). 2000-06-07 17:11:23 +00:00
John Baldwin 504bd512cb MFC: Support the OHCI controller's IRQ mapping on newer Alpha's. 2000-06-07 01:45:03 +00:00
John Baldwin 5eb5e892bd MFC: Make USB keyboard option machine independent. 2000-06-07 00:06:19 +00:00
Wilko Bulte 30432979cc MFC: [Miata]: document SRM upgrade requirement when experiencing SRM
'scancode' errors after halting FreeBSD.
2000-06-06 19:36:02 +00:00
Dag-Erling Smørgrav ad8c9711b0 MFC: Makefile for linprocfs 2000-06-06 11:53:28 +00:00
Joerg Wunsch 063528928b MFC 1.778, mention that sppp is required for i4bisppp 2000-06-06 10:32:13 +00:00
Andrey A. Chernov 598b9ebaa7 MFC: wording 2000-06-06 06:15:39 +00:00
Andrey A. Chernov 2d0b10de3c MFC: ANSI attribute -> video attribute 2000-06-06 00:20:38 +00:00
Andrey A. Chernov d8ca4776ae MFC: cosmetique, fix comments about 'ansi' colors 2000-06-06 00:14:33 +00:00
Andrey A. Chernov c4bb5b297c MFC: initial-> normal, mark ANSI 2000-06-06 00:04:08 +00:00
Andrey A. Chernov 10df6c93a6 MFC: initial colors, color tables 2000-06-05 23:50:41 +00:00
Andrey A. Chernov c2a0ce080e MFC: E[...x parameters ranges 2000-06-05 23:25:28 +00:00
Andrey A. Chernov f93d068772 MFC: E[39m E[49m E[...x described 2000-06-05 23:02:54 +00:00
Andrey A. Chernov b686364452 MFC: fix "op" 2000-06-05 22:22:12 +00:00
Andrey A. Chernov 1190f5ed6d MFC: implement E[39m and E[49m 2000-06-05 22:17:13 +00:00
Mitsuru IWASAKI cbbf378f6a MFC: recent pccardc/pccardd changes.
- Improvement of of pccard cis tuple parsing capability.
 - Add support multi io window.
 - Add ioctl() in read_ether() so that pccardd ensure reading its ether
   address from the attribute memory area.
 - Add CIS string comparison function with regex(3) matching feature.
 - Add atching additional information strings followed by version string.

	pccardc/printcis.c	1.11 -> 1.12
	pccardd/cardd.c		1.47 -> 1.52
	pccardd/cardd.h		1.21 -> 1.23
	pccardd/file.c		1.28 -> 1.29
	pccardd/pccard.conf.5	1.14 -> 1.15
	pccardd/readcis.c	1.18 -> 1.19
	pccardd/readcis.h	1.12 -> 1.13
	pccardd/util.c		1.13 -> 1.14

Reviewed by:	imp
Approved by:	imp, jkh
Obtained from:	PAO
2000-06-05 14:59:03 +00:00
Brian Somers 7864852d8b MFC: Use a ppp trigger address of 0.0.0.0 2000-06-05 11:05:05 +00:00
Dag-Erling Smørgrav ee6c4a6172 MFC: linprocfs 2000-06-05 10:14:04 +00:00
Andrey A. Chernov 5720e2761b MFC: remove libxpg4 2000-06-04 23:19:48 +00:00
Andrey A. Chernov e716019251 Bump version after libxpg4 merging 2000-06-04 21:52:28 +00:00
Andrey A. Chernov ee14f23695 MFC: libxpg4 now fake 2000-06-04 21:49:57 +00:00
Andrey A. Chernov cd67ecf46a MFC: libxpg4 merging 2000-06-04 21:47:39 +00:00
Tim Vanderhoek 59a43a56fe MFC r.1.23: Use ``rm -f'' if -f (Force) was given to pkg_delete 2000-06-04 16:46:33 +00:00
cvs2svn bcbdc6452f This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-06-04 14:58:41 +00:00
Tim Vanderhoek 5fb2f505a6 MFC: fix memory leak that sometimes occured if getent() failed 2000-06-04 01:31:56 +00:00
Tim Vanderhoek e4d60cc53a MFC: fix memory leak on login_close() 2000-06-04 01:29:23 +00:00
Hajimu UMEMOTO 9e8b821520 MFC: IPv6 support. 2000-06-03 17:18:12 +00:00
Hajimu UMEMOTO 1b0a34e4bd MFC: IPv6 support. 2000-06-03 17:00:56 +00:00
Hajimu UMEMOTO 7b381be68f MFC: We should see the ai_canonname menber of the first addrinfo
structure in the linked list.  RFC2553 mentions only first.
2000-06-03 16:58:26 +00:00
Hajimu UMEMOTO 32d8173ae7 MFC: Don't pass scope-id to EPRT command. 2000-06-03 16:54:17 +00:00
Hajimu UMEMOTO 546b52af6c MFC: Replace isurl() with isipv6addr(). 2000-06-03 16:53:03 +00:00
Brian Somers ccf0ec128c MFC: Handle open/dial from state DATALINK_READY properly
Don't disable the autoload timer at the wrong time
     Use a SOCK_DGRAM socketpair() for synchronous "!program" devices
     Send a HUP to "!program" devices when they're closed
     Drop packets when the fsm header length is bigger than the payload
     Create /etc/resolv.conf with the correct umask (when dns is enabled)
     Don't dump core when trying to write a new resolv.conf
     Add some more verbose ``inappropriate peer'' diagnostics in MP mode
     Pass all packets through libalias in NAT mode
     Describe ``enable proxy'' a bit more
     chmod local-domain diagnostic sockets correctly
     When a PPPoTCP connection fails, don't moan about invalid syntax
2000-06-03 02:53:15 +00:00
Boris Popov e7c45a4cab MFC: reserve major number for the nsmb device. 2000-06-03 02:48:59 +00:00
Archie Cobbs b7734b7cec MFC: receive statistics 2000-06-02 22:42:23 +00:00
Archie Cobbs a29b2971b9 MFC: only pass the address family to if_simloop() 2000-06-02 22:39:09 +00:00
Archie Cobbs 591edda266 MFC: (rev 1.3) fix buffer overflow bug in NgSendAsciiMsg() 2000-06-02 21:54:10 +00:00
Alfred Perlstein 3ca5f13a43 MFC: document sbsize. 2000-06-02 20:53:55 +00:00
Tim Vanderhoek 912bdd1b05 MFC: NO_LPR option 2000-06-02 18:57:00 +00:00
Greg Lehey 1f7f22843a MFC. This appears to have been omitted by accident in an earlier
commitfest.

expand_table: Avoid a race condition which may have been contributing
to the random corruption, panics and hangs we've been seeing in RAID-5
plexes, particularly with ata drives.
2000-06-02 04:26:11 +00:00
Greg Lehey da103a5a53 MFC: parityrebuild: write the parity block back to the correct
subdisk.

HEADS UP: This fixes a serious data corruption bug when using the
userland command 'rebuildparity'.
2000-06-02 04:20:35 +00:00
Warner Losh bd25b92a9b MFC: Bring in the combocard patches from 1.20 2000-06-01 20:00:40 +00:00
Warner Losh 69d58e6b24 MFC: Latest xircom fixes. xe will now work in -stable 2000-06-01 01:23:53 +00:00
Mike Smith 617376495a MFC: correctly program I/O APIC IDs to avoid interrupt collisions.
Submitted by:	tegge
2000-05-31 21:42:22 +00:00
Kenneth D. Merry 9a5766cadc MFC, DVD ioctls.
scsi_cd.c rev 1.36
scsi_cd.h rev 1.4
dvdio.h   rev 1.3
2000-05-31 03:14:38 +00:00
Mike Smith 009e260ce3 Re-enable the K6 MTRR support, after extensive soak-testing in -current. 2000-05-30 15:51:17 +00:00
Darren Reed ab1198ee60 add IPFILTER_DEFAULT_BLOCK in opt_ipfilter.h 2000-05-30 14:35:04 +00:00
Andrey A. Chernov a332545726 MFC: last line TAB not cause scrolling 2000-05-29 18:38:33 +00:00
Joerg Wunsch 7956004626 MFC: rev 1.37, apply fixup to the media blocksize reported by the drive. 2000-05-29 18:16:24 +00:00
Matthew Dillon be17c8808b MFC 1.158, fix minor bug in vm_pageout_page_stats() 2000-05-29 17:45:03 +00:00
Yoshihiro Takahashi fd61824c56 Sync with sys/boot/i386/btx/btx/btx.s revision 1.15.2.1. 2000-05-29 11:55:20 +00:00
Jeroen Ruigrok van der Werven 5e7a9d54b5 MFC: - add source_rc_confs
Reminded of, while working on the readline MFC, by:
	Mike Harding <[email protected]>
2000-05-28 19:17:20 +00:00
Jeroen Ruigrok van der Werven 8504f73ad2 MFC: - most of these settings moved to cshrc 2000-05-28 15:20:18 +00:00
Jeroen Ruigrok van der Werven ea358e2604 MFC: - typo fix
- set umask, EDITOR
	- fix comments
2000-05-28 15:13:28 +00:00
Jeroen Ruigrok van der Werven fa9be106cc MFC: - clarify comments
- pull in source_rc_confs
2000-05-28 15:03:01 +00:00
Jeroen Ruigrok van der Werven 7f2ac632a2 MFC: - document the CXXFLAGS variable 2000-05-28 14:53:51 +00:00
Jeroen Ruigrok van der Werven e26b801dbf MFC: - show mounted filesystem differences 2000-05-28 14:26:21 +00:00
Jeroen Ruigrok van der Werven 50d2915314 MFC: - fix divert rule number 2000-05-28 14:10:35 +00:00
Jeroen Ruigrok van der Werven 51e0667460 MFC: - NFS fs mounting cleanup 2000-05-28 14:07:40 +00:00
Jeroen Ruigrok van der Werven d756773b47 MFC: - comment clarifications
- fix path consistency
2000-05-28 13:58:41 +00:00
Jeroen Ruigrok van der Werven 623d55aca0 MFC: - Use tabs instead of spaces 2000-05-28 13:52:50 +00:00
Jeroen Ruigrok van der Werven 4d88951380 MFC: - do not refer to automount(8) 2000-05-28 13:17:30 +00:00
Jeroen Ruigrok van der Werven 8ee9d5ed5b MFC: - fix some GMT -> UTC occurences
- various fixes with regard to summer time
	- various other sanity fixes
2000-05-28 13:05:44 +00:00
Andrey A. Chernov 854a42b2c9 MFC: do not sense ALKED in non K_XLATE modes since it never set 2000-05-28 12:48:22 +00:00
Jeroen Ruigrok van der Werven c7431897f8 MFC: - fix typo
- clarification
2000-05-28 12:40:06 +00:00
Jeroen Ruigrok van der Werven 1e1f9d2651 MFC: - make sure KRNLOBJDIR gets mkdir'd
- add gperf to the bootstrap tools
2000-05-28 12:33:40 +00:00
Warner Losh fb958785e1 MFC: Be more agressive about initializing cardbus bridges, especially
TI based ones.  No reports of problems have come in because of these
changes.
	pcic_p.c	1.20->1.21
	pcic_p.h	1.10->1.11

Reminded by: [email protected] (MIHIRA Yoshiro)
2000-05-28 06:19:15 +00:00
Tim Vanderhoek 7aaf6e8b27 MFC: The latest in fortunes 2000-05-28 05:28:37 +00:00
cvs2svn b08ea31439 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-28 05:06:39 +00:00
Chris Costello 6a332fec63 MFC: Misspelled "undefined". 2000-05-27 22:06:46 +00:00
Warner Losh 27021c2b48 MFC: 1.10, 1.11 (probe order and unload message) 2000-05-27 21:34:06 +00:00
Warner Losh 397d0d5ad5 MFC rev 1.58 2000-05-27 21:31:42 +00:00
Warner Losh f7a569df34 Add two things:
1) Note the ABI change in the kernel requiring new kernel
	and new modules after approx May 1.
	2) Note ldconfig -R being needed sometimes when updating from 3.x
	to -stable.
2000-05-27 21:24:09 +00:00
Wilko Bulte 6dc4f852cc Add suggested comment for TCP_DROP_SYNFIN and TCP_RESTRICT_RST
PR:             conf/18124
Submitted by:   Matt Heckaman <[email protected]>
2000-05-27 18:05:50 +00:00
Warner Losh cb61625dfc Merge pccard.conf from current. 1.98 -> 1.107 2000-05-27 04:52:48 +00:00
Yoshihiro Takahashi 0b90c122f6 MFC: Supported the mss on PC-98 and Sound Blaster 98. 2000-05-26 12:11:47 +00:00
Seigo Tanimura 187ed9f7fb MFC(rev 1.300): Add SUP1670. 2000-05-26 11:43:28 +00:00
Darren Reed 0057ff3e7a define CSUM_DELAY_DATA to match merge 2000-05-26 07:28:03 +00:00
Darren Reed 6e78189bb0 ignore RST when adding state 2000-05-26 02:13:46 +00:00
Nick Sayer 49d964b040 MFC: v1.63
Approved by:	jkh
2000-05-25 20:43:09 +00:00
Dirk Froemberg 47f52fcf47 MFC: Remove -a from mkisofs' argument list. 2000-05-25 20:18:00 +00:00
Dag-Erling Smørgrav a14c2def4f MFC: man page for twe driver
Forgotten by:	msmith
2000-05-25 15:29:27 +00:00
Thomas Gellekum 4a2f67e9e7 MFC: Add missing source files.
PR:		18631
2000-05-25 09:54:28 +00:00
Jonathan Lemon 5fd9412aa9 MFC: rev 1.106, checksums for multicast loopback.
PR:	kern/18741
2000-05-25 02:33:46 +00:00
Mike Smith 8939328872 MFC: teach libdisk about 'twe' disks 2000-05-25 02:24:50 +00:00
Jonathan Lemon f075597652 MFC: rev 1.134, cast sizeof() calls to keep things signed. 2000-05-25 02:19:13 +00:00
Jonathan Lemon 4a76f35d50 MFC: r1.21, fix for checksum inversion. 2000-05-25 02:15:07 +00:00
Mike Smith 402753e637 MFC: twe driver support 2000-05-25 01:57:29 +00:00
Mike Smith 18c00c7317 MFC: manpages for the twe driver 2000-05-25 01:55:10 +00:00
Mike Smith e9e2fe89b2 MFC: Add the 3ware Escalade driver to the build 2000-05-25 01:54:08 +00:00
Mike Smith 10d00bb005 MFC: the 3ware Escalade driver 2000-05-25 01:53:35 +00:00
Mike Smith f7adedd55b MFC: new driver for the 3ware Escalade family of ATA RAID controllers. 2000-05-25 01:50:48 +00:00
cvs2svn ba5376dbfd This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-24 23:48:16 +00:00
Mike Smith 9c42318277 MFC: twe driver majors 2000-05-24 23:21:25 +00:00
Archie Cobbs 7b2be49518 MFC: Add hook for IPv6. 2000-05-24 21:36:40 +00:00
Archie Cobbs 0c9a355456 MFC: add "inet6" hook, Makefile cleanups 2000-05-24 21:35:45 +00:00
Andrew Gallatin 61e1bd658f MFC enough to make the alpha kernel compile again after SMP and random MFCs.
Sigh.  Doesn't anybody test on alphas?
2000-05-24 14:20:58 +00:00
Andrew Gallatin cc90b38301 MFC 1.12, one step toward making a RELENG_4 kernel compile 2000-05-24 14:18:30 +00:00
Mike Pritchard c7d29e58fa MFC: Update the man page to match utmp.h. 2000-05-24 13:29:24 +00:00
Mike Pritchard 1e8f7bc85e MFC: Correct an xref. 2000-05-24 13:25:52 +00:00
Mike Pritchard abdb48432b MFC: minor mdoc cleanup. 2000-05-24 13:24:04 +00:00
Mike Pritchard e53d5aa0b6 MFC: Correct usage of ".Bd -literal" macro. 2000-05-24 13:15:58 +00:00
Darren Reed b7526ea4ba do not add state upon RST 2000-05-24 05:30:30 +00:00
Archie Cobbs 32807f2fe8 MFC: Move BPF and bridging code into ether_input() 2000-05-24 01:48:00 +00:00
Nick Hibma 43cde79801 MFC:
- use malloc instead of buffers (phk).
- put more code between ifdefs.
- remove superfluous includes.
2000-05-24 00:20:57 +00:00
Jason Evans b66e4a0869 MFC: Fix memory leaks for pthread_set_name_np(). 2000-05-23 21:30:13 +00:00
Jonathan Lemon 785a6e7b79 MFC: correctly pick the NCR chip. 2000-05-23 19:30:35 +00:00
Andrey A. Chernov 0c58d4e8c5 MFC: trace -> _nc_trace 2000-05-23 13:42:29 +00:00
Yoshihiro Takahashi ad79a245db MFC: Fixed return value of adv_attach function. 2000-05-23 10:13:25 +00:00
Warner Losh 1623195bae MFC: Latest pccard kernel bits 2000-05-23 03:57:04 +00:00
Jonathan Lemon d549c74d98 MFC: pull in new PCI device IDS for the IDA driver. 2000-05-22 17:58:30 +00:00
Mike Smith 0f0bd6baa2 MFC: include opt_rootdevname.h
Submitted by:	"Jeffrey S. Sharp" <[email protected]>
2000-05-22 17:26:36 +00:00
Yoshihiro Takahashi b28a601642 MFC: Use bus_space stuff. 2000-05-22 13:14:56 +00:00
Yoshihiro Takahashi 100df8a86a The adv driver is already converted to new-bus architecture. 2000-05-22 13:09:50 +00:00
Warner Losh d0646ae734 MFC: errno.h and don't read .editrc file from dot 2000-05-22 06:07:00 +00:00
Jonathan Lemon 8ef680403f MFC: fix problem with interaction between delayed checksums & IPFilter. 2000-05-21 21:41:44 +00:00
Andrew Gallatin 3509e75baa MFC 1.11: Prevent vidcontrol -i from crashing alphas 2000-05-21 01:19:38 +00:00
Will Andrews 4c3d2121b1 MFC: loud debugging facility documentation (-dl).
Approved by:	jkh
2000-05-20 20:18:49 +00:00
Will Andrews f021a6ac4d MFC: loud debugging facility (-dl).
Better patch submitted by:	steve
Reviewed by:			phk, steve, chuckr, obrien
				Lyndon Nerenberg <[email protected]>
Approved by:			jkh
2000-05-20 20:04:02 +00:00
David E. O'Brien e13f070e00 MFC: rev 1.3 (use different filenames) 2000-05-20 05:51:17 +00:00
Greg Lehey 564545771a MFC: Don't forget 'stripe' and 'mirror' commands when we turn off
debugging.

Submitted-by: mdodd
2000-05-20 03:23:49 +00:00
Mike Smith f3706c3fc0 MFC: description and syntax of ROOTDEVNAME 2000-05-19 20:47:09 +00:00
Yoshihiro Takahashi 7fbcba63e8 Sync with sys/i386/conf/GENERIC revision 1.246. 2000-05-19 16:34:22 +00:00
Joerg Wunsch d72a616340 MFC rev 1.6 rst0 -> rsa0 2000-05-19 16:03:36 +00:00
Seigo Tanimura 51f7a10b57 MFC(rev 1.299): Add RSS0262. 2000-05-19 10:07:23 +00:00
Dag-Erling Smørgrav d2b6b104a8 MFC: brucify, support alternate time format, archive to separate directory,
specify files on command line
2000-05-19 09:21:30 +00:00
Seigo Tanimura a7ae432439 MFC(rev 1.298): Add ACH2012. 2000-05-19 03:50:04 +00:00
Peter Wemm 85bdbd0051 MFC: document ECONNRESET 2000-05-19 01:04:05 +00:00
Peter Wemm 855f42f529 MFC 1.63: return ECONNRESET instead of EINVAL when trying to do a
get{sock|peer}name() on a socket that has been reset.
2000-05-19 00:57:17 +00:00
Paul Saab 2bd1b92196 MFC: Reactivate forth on the alpha. You *MUST* build and install
a current libstand to make this work.
2000-05-18 08:10:54 +00:00
Paul Saab 1149f976ef MFC:
[sbrk.c 1.3] Ensure that sbrk returns 16 byte aligned addresses.
[_setjmp.S 1.3] Dont use floating point registers.
2000-05-18 08:01:16 +00:00
Seigo Tanimura 4baef56164 MFC(rev 1.297): Add a couple of new PnP IDs. 2000-05-18 02:12:21 +00:00
David E. O'Brien f7646dedad MFC: GDB 4.16 files not part of our GDB 4.18. 2000-05-17 20:10:43 +00:00
David E. O'Brien e0245b7de1 MFC: rev 1.47 (callback.c) 2000-05-17 19:31:38 +00:00
Yoshinobu Inoue da0f4fe0ff MFC:
emoved unnecessary comma in stf addr printf in hex format,
which I mysteriously added.

Submitted by: ume
2000-05-17 03:26:15 +00:00
Garrett Wollman 16759191a0 Fix a mis-resolved conflict. 2000-05-16 20:55:19 +00:00
Jason Evans 0c0a5a3b18 MFC: Allow static compilation with linuxthreads to work. 2000-05-16 20:43:21 +00:00
Garrett Wollman 20f6e02b59 MFC: includes, punctuation. 2000-05-16 16:45:34 +00:00
Matthew Dillon 48bfc63c45 Change f_count, f_msgcount from short to int. Pad original
fields in an attempt to keep backwards compatibility with
    potential 3rd party modules.

    I didn't mean to commit this quite yet, but it got mixed in with
    the SMP commit so...
2000-05-16 16:27:32 +00:00
Tim Vanderhoek 7783998e1f MFC: Proper reference to execvp(3) 2000-05-16 15:57:26 +00:00
Yoshihiro Takahashi 236555d112 Sync with sys/i386/conf/GENERIC revision 1.246.2.4. 2000-05-16 13:51:32 +00:00
John Hay 45a7c05453 MFC: Make the N2 isa cards probe again. Remove the unused frame relay hooks.
PR:		17814
2000-05-16 10:48:41 +00:00
Jeroen Ruigrok van der Werven 2483622648 MFC: Remove bogus include.
Remove unused variable.
2000-05-16 08:59:50 +00:00
Jeroen Ruigrok van der Werven b0642a9da5 MFC: Remove bogus include. 2000-05-16 08:55:54 +00:00
Jeroen Ruigrok van der Werven 17e87df543 MFC: remove dead debug code 2000-05-16 08:44:56 +00:00
Jeroen Ruigrok van der Werven 33e89f27e9 MFC: various fixes:
- sync up with OpenBSD's cat
2000-05-16 08:38:49 +00:00
Jeroen Ruigrok van der Werven a532895a91 MFC: various fixes:
- some sentencebreaks
	- typo
2000-05-16 08:31:20 +00:00
Warner Losh b468d8d5b4 Use the right number of [****] for mergemaster footnote.
Minor nits pointed out by a lot of people.
2000-05-16 07:47:22 +00:00
Matthew Dillon 3aa0904c7b MFC SMP Cleanups, regenerate syscalls 2000-05-16 07:07:52 +00:00
Matthew Dillon 55c1466131 MFC the SMP cleanup. 2000-05-16 07:04:08 +00:00
Matthew Dillon c31e42c405 MFC the SMP cleanup. 2000-05-16 06:58:13 +00:00
Tim Vanderhoek 942c28c2a0 MFC: Correct diagnostics and no complaints if chflags() gives EOPNOTSUPP 2000-05-16 05:04:54 +00:00
Chris Piazza 69fe290f2f MFC: no -g in CFLAGS 2000-05-16 04:25:19 +00:00
Garrett Wollman 07df56528c Give mtree the ability to exclude files.
PR:		16944
Requested by:	Cy Schubert
2000-05-15 20:49:59 +00:00
Matthew Dillon 01b42d297e MFC 1.112, zero out uio structure to avoid garbage pointers.
Tested by: "Sean O'Connell" <[email protected]>
2000-05-15 16:50:33 +00:00
Matthew Dillon 8c01173586 Correction: testing was done by "Paul H. Anderson" <[email protected]>. Sean
helped with another bug.
2000-05-15 16:48:12 +00:00
Matthew Dillon 94ad550a5b MFC 1.190 - fix bug in madvise MADV_WILLNEED
Reviewd by: alc
Tested by: "Sean O'Connell" <[email protected]>
2000-05-15 16:45:40 +00:00
Tim Vanderhoek b8de45ec52 MFC: fix typos (some of which will affect translators) 2000-05-15 14:56:13 +00:00
Tim Vanderhoek 811fd9b8db MFC: typo 2000-05-15 14:16:49 +00:00
Sheldon Hearn f19e5fde61 MFC rev 1.4: remove trailing whitespace. 2000-05-15 11:53:05 +00:00
Sheldon Hearn 1cb21bb950 MFC rev 1.5 and rev 1.6: Fix overly long argument lists and remove
trailing whitespace.
2000-05-15 11:44:03 +00:00
David E. O'Brien f7cc82e8ed MFC: revs 1.[56] (style + otp-md[45] bits) 2000-05-14 21:15:05 +00:00
David E. O'Brien f8a2fadabc MFC: rev 1.14 (improve diagnostic message on non-existing device)
PR:		bin/6997
Submitted-by:	Lyndon Nerenberg <[email protected]>
2000-05-14 21:06:30 +00:00
Gerard Roudier 06aaddc4df MFC: sym_fw.h, sym_fw1.h, sym_fw2.h added by a previous
batch of commits.
MFC: Support for NCR legacy devices 810, 815 and 825.
MFC: Use of BUS DMA mapping kernel interface.
MFC: Better C1010 support.
MFC: Better handling of wrong data direction and wrong
     phases.
2000-05-14 10:46:20 +00:00
Gerard Roudier 0e04122322 Add appropriate options that will preserve `ncr'
precedence over `sym' for NCR legacy devices 810,
815, 825, after merge of `sym' from -current.
2000-05-14 10:40:27 +00:00
Gerard Roudier f876d2fa87 This first batch of commits adds new driver files to
prepare `sym' driver MFC.
2000-05-14 10:33:16 +00:00
David E. O'Brien 95e1659f9f MFC: revs. 1.23 and 1.24 2000-05-14 00:29:44 +00:00
cvs2svn 342775c738 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-13 21:33:58 +00:00
Matthew Dillon a13f5c9826 MFC 1.56, guarentee local buffer alignment for ioctl 2000-05-13 19:28:13 +00:00
Jun-ichiro itojun Hagino c11c4fe22e correct possible security issue(s) in name resolution, due to use of
pre-4.9.7 BIND resolver code.
ftp://ftp.kame.net/pub/mail-list/snap-users/2348 for details.
(MFC 1.8 -> 1.9)

reviewed by:	ume
2000-05-13 18:46:13 +00:00
Nick Hibma ba25c69485 Update my e-mail address. 2000-05-13 15:06:31 +00:00
Nick Hibma ca308852b5 Remove trailing zeroes on kernel config file entries 2000-05-13 15:05:59 +00:00
Nick Hibma 2528a53103 Update the list of supported devices. 2000-05-13 15:05:27 +00:00
Tim Vanderhoek 0ff367fc6a MFC: .Xr boot0cfg 8 , 2000-05-13 14:43:14 +00:00
Tim Vanderhoek b942e3cd58 MFC: anti-fascist fix 2000-05-13 12:59:58 +00:00
Tim Vanderhoek 6fa7068c78 MFC: Change to comments only: spell FreeBSD.org correctly 2000-05-13 11:22:14 +00:00
Jonathan Lemon a90f6d6691 MFC: bugfix for uninitialized csum_flags (r1.26) 2000-05-12 16:52:19 +00:00
Alexey Zelkin 03299bf1a3 MFC: rev 1.125, fix typo 2000-05-12 10:51:24 +00:00
Alexey Zelkin 2aab88f043 MFC: rev 1.12, mdoc fixes 2000-05-12 10:24:35 +00:00
Alexey Zelkin 64e9d65bf4 MFC: rev 1.4, typo fixes 2000-05-12 10:08:22 +00:00
Alexey Zelkin d56e6910f1 MFC: rev 1.90, add MLINKS: scsi.4 -> SCSI.4, scsi.4 -> CAM.4 2000-05-12 09:15:59 +00:00
Kris Kennaway a0205d9c58 Correct typo in variable name.
Submitted by:	Mike C. Muir <[email protected]>
2000-05-12 09:15:23 +00:00
Alexey Zelkin ca3b0034c0 MFC: rev 1.21, fix driver source location 2000-05-12 09:15:04 +00:00
Alexey Zelkin eaa3023f5a MFC: rev 1.23, 1.24, use .An macros for author name definition,
add `.Sm on' directive to correct place
2000-05-12 09:13:27 +00:00
Alexey Zelkin a4ccf50ddc MFC: rev 1.19, place $FreeBSD$ tag to correct place 2000-05-12 08:54:07 +00:00
Alexey Zelkin 462f214932 MFC: rev 1.9, properly mdoc(7)'fy. 2000-05-12 08:52:33 +00:00
Alexey Zelkin 9075203591 MFC: rev 1.124, add MLINKS: bktr.4 -> booktree.4 2000-05-12 08:50:18 +00:00
Alexey Zelkin 2fc540877c MFC: rev 1.8, fix section name, remove redundant paragraph breaks,
fix typo (.Sj -> .Sh)
2000-05-12 08:47:50 +00:00
Alexey Zelkin 9c9f50ee8a MFC: rev 1.19, remove obsolete cross reference to eg(4), properly use .Nm mdoc
macro
2000-05-12 08:46:08 +00:00
Alexey Zelkin 221eaac980 (force commit) Previous commit was a MFC for rev 1.16, not 1.126 2000-05-12 08:05:45 +00:00
Alexey Zelkin a83aac64b9 MFC: rev 1.126, add missing MLINKS for queue.3 2000-05-12 08:02:37 +00:00
Cameron Grant 87404aea88 MFC: emu10k1 header file 2000-05-12 04:33:07 +00:00
Cameron Grant 933e895f05 mfc: fixes 2000-05-12 04:13:47 +00:00
Tim Vanderhoek 6f647648ab CFC: improved version of hack from prev commit 2000-05-12 04:07:57 +00:00
Cameron Grant ba8d6ee8ff MFC: many fixes 2000-05-12 03:42:35 +00:00
Cameron Grant a7e50b58cd MFC: many things 2000-05-12 03:32:13 +00:00
Cameron Grant d7b2ac81af MFC: many things including emu10k1 driver, new ess isa code, improved
ac97 support, more helper functions for drivers, improved oss
	compatibility
2000-05-12 02:32:01 +00:00
Andrey A. Chernov 403d524e65 MFC: better fix for strftime/mktime 2000-05-11 23:51:52 +00:00
Nick Sayer 1398ac3bc4 MFC: v1.12
Approved by: jkh
2000-05-11 20:17:07 +00:00
Wilko Bulte 1efb48b740 Claim support / explain white-box Alphas.
Obtained from: drew
2000-05-11 18:56:45 +00:00
David E. O'Brien f806c1b8ed random.h was being included twice for some reason. In -CURRENT I removed
the second inclusion and forgot to do it here too.
2000-05-11 16:36:33 +00:00
David E. O'Brien 6ab8eeb2e8 MFC: use MI random.h. 2000-05-11 16:33:23 +00:00
Andrew Gallatin 7304b47e24 MFC 1.80: watch out for negative systypes 2000-05-11 13:34:44 +00:00
Yoshihiro Takahashi 411c5f8623 MFC: Supported PC-98. 2000-05-11 11:10:36 +00:00
Greg Lehey 20c7d4e51e MFC: Fix a multitude of sins, including data corruption and panics. 2000-05-11 08:55:22 +00:00
Greg Lehey b4b8f590b2 MFC: Fix a multitude of sins, including data corruption and panics. 2000-05-11 08:49:23 +00:00
Brian Somers 59a9e52176 MFC: Fix a typo 2000-05-11 07:59:50 +00:00
Brian Somers b2b5d1ddc8 MFC: Mention that the default is to let external traffic route to
the internal network when NAT is enabled.

     Allow ``set target MYADDR'' to stop packets at the gateway.
2000-05-11 07:56:22 +00:00
Brian Somers 9564f73354 MFC: Revert the default behaviour for incoming connections so
that they (once again) go to the target machine rather than
     the alias address.
2000-05-11 07:54:45 +00:00
David Nugent 36c73e6f47 MFC: cosmetic change "reboot" -> "boot" 2000-05-11 06:36:27 +00:00
Jeroen Ruigrok van der Werven 22ee0c02b1 MFC: Flesh out the amr.4 manpage some more.
Submitted by:	msmith
2000-05-10 19:09:26 +00:00
David E. O'Brien eafb3a7fbe MFC: use MI random.h 2000-05-10 16:26:47 +00:00
Alexey Zelkin b102d331ae MFC: rev 1.15 2000-05-10 15:47:30 +00:00
David E. O'Brien 22c021810f MFC: use MI random.h rather than i386 specific one 2000-05-10 14:01:23 +00:00
Alexey Zelkin c899f7a75a MFC: rev 1.7, mdoc cleanup 2000-05-10 13:45:29 +00:00
Darren Reed 4d624caf8b Fix bug in dealing with "hlen == 1 and opt > 1" 2000-05-10 12:06:40 +00:00
Sheldon Hearn fdfe4c76bb Back out previous commit, which was applied to this branch in error.
Reported by:	phantom
2000-05-10 10:20:58 +00:00
Sheldon Hearn 16f80df95c MFC: One author name per call to %A. 2000-05-10 09:53:31 +00:00
David E. O'Brien e95e9158d3 MFC: fix the linking in my `sa' changes
Submitted by:	Christian Weisgerber <[email protected]>
2000-05-10 02:54:14 +00:00
David E. O'Brien 3c971919cd MFC: Use sys/random.h rather than i386 specific one. 2000-05-10 02:30:12 +00:00
David E. O'Brien 98dcccd66b MFC: Use a MI /dev/[u]random device.
Use sys/random.h rather than i386 specific one.
2000-05-10 02:04:52 +00:00
David E. O'Brien de23d8e771 MFC: rev. 1.149 (use MI sys/sys/random.h rather than a i386 specific one) 2000-05-10 01:59:53 +00:00
David E. O'Brien b749837d0f MFC: rev. 1.358 files & rev. 1.317 files.i386.
(use MI sys/sys/random.h rather than a i386 specific one)
2000-05-10 01:43:51 +00:00
Paul Saab 198e2844e9 MFC: Support for > 2GB partitions. 2000-05-09 22:23:51 +00:00
Bill Paul 0203725632 MFC: set MEM_ASSIGNED flag so iomem assignments actually work. 2000-05-09 22:04:31 +00:00
Wilko Bulte 14df5884cb Add reference to new name DIGITAL Server 330x for AlphaServer 800 2000-05-09 20:30:04 +00:00
Doug White e1bdbc8581 MFC: no more special options. 2000-05-09 18:29:54 +00:00
Dima Ruban a3595a68e1 MFC: include <machine/in_cksum.h> since in_cksum() is now a macro. 2000-05-09 18:10:54 +00:00
Matthew Hunt 3ebc719d74 MFC: It's --> Its 2000-05-09 18:09:47 +00:00
Matthew Dillon 19513c6725 MFC i386/linux/imgact_linux.c 1.36 and friends - fix #! script exec
under linux emulation to look for script binary in /compat/linux first.
2000-05-09 17:41:24 +00:00
Matthew Dillon fae2f1c3ce MFC 1.32 - remove synchronizing instruction in MP unlock code. It
turns out not to be necessary.
2000-05-09 17:36:08 +00:00
Paul Saab 361acf3ea1 MFC: Install the pxeboot manpage 2000-05-09 16:32:58 +00:00
Sheldon Hearn 92fc5ceb19 MFC: Update for csh(1) -> tcsh(1) upgrade. 2000-05-09 15:13:10 +00:00
Sheldon Hearn 53ef40deb9 MFC: Fix miscellaneous mdoc macro argument limit infringements. 2000-05-09 14:12:53 +00:00
Yoshihiro Takahashi b5cdf7af71 MFC: Add '-DPC98' to CFLAGS if MACHINE == pc98. 2000-05-09 13:47:04 +00:00
Yoshihiro Takahashi 917b4d7bc3 MFC: Added PC-98 supports. 2000-05-09 13:42:17 +00:00
Sheldon Hearn ac1ab41bf0 MFC rev 1.2: Fix Nd. 2000-05-09 13:01:56 +00:00
Matt Jacob df1244c823 MFC: add SA_QUIRK_NO_MODESEL && do not get derailed if setting buffered mode fails 2000-05-09 05:19:49 +00:00
Matt Jacob 03ee8c31fd MFC: roll core minor. Add definitions for topology. 2000-05-09 05:11:03 +00:00
Matt Jacob 97d3caf4d5 MFC: it is PORT not NODE for WWN in NVRAM 2000-05-09 05:10:31 +00:00
Matt Jacob 36d3587c0a MFC: protect macro with parens 2000-05-09 05:09:51 +00:00
Matt Jacob ef6bb44479 MFC: clarify some comments 2000-05-09 05:09:25 +00:00
Matt Jacob 38edf5fefc MFC: clean up some prototpes 2000-05-09 05:09:02 +00:00
Matt Jacob aa9d2024c8 MFC: put in the right place NA_RST_CLRD 2000-05-09 05:08:40 +00:00
Matt Jacob 952f87f595 MFC: roll platform minor 2000-05-09 05:08:11 +00:00
Matt Jacob fb1147df5c MFC: add a watchdog timeout routine 2000-05-09 05:07:55 +00:00
Matt Jacob b6b7e948ab MFC: some fabric && WWN related fixes, plus some bothces about overwriting
busses with pending Sendmarker operations.
2000-05-09 05:07:05 +00:00
Tim Vanderhoek ce66d39032 Copy From Current: ordered includes, exit on eof, errno.h 2000-05-09 04:18:38 +00:00
Tim Vanderhoek 89b6ebf5ce MFC: Bugfixes when viewing previous file 2000-05-09 03:54:49 +00:00
Tim Vanderhoek cad3353083 MFC: .Xr vgl 3 , 2000-05-09 02:56:15 +00:00
Peter Wemm 3db83ddcfb MFC: sync up with hard links instead of duplicate mknods (consuming
seperate inodes).  Also provide non-'r' tape node names.  Fix ttyA/cuaA.
2000-05-09 01:13:27 +00:00
Sheldon Hearn 7fc161b5a2 MFC rev 1.13: remove cwd from MLINKS 2000-05-08 16:32:44 +00:00
Sheldon Hearn d565578c64 MFC rev 1.6: remove ``cwd'' and fix table heading. 2000-05-08 16:31:30 +00:00
Nick Hibma 8584b01041 MFC: Add automatic rescan functionality. Add 2 includes that should have
been there. Remove the unnecessary creation of a cam_path.
2000-05-07 21:08:18 +00:00
Nick Hibma 99cea52065 MFC: If selecting a new unit number for a new device, don't pick the
first free one at the end of the list, use the first free one in the
list. This avoids ever increasing unit numbers.

Also, call BUS_NOMATCH only once, at boot. Avoids the unneeded claiming
of devices by chip whenever a PCI module is loaded.
2000-05-07 20:26:51 +00:00
Nick Hibma f78a7fb563 Regen after MFC. 2000-05-07 19:54:32 +00:00
Nick Hibma d7f7a9df9d MFC: Sync with NetBSD 2000-05-07 19:54:11 +00:00
Josef Karthauser 5b049b964d MFC: Fix a potential buffer overflow with the generation of the
pid-file name. {from revision 1.32}
VS: ----------------------------------------------------------------------
2000-05-07 18:26:51 +00:00
Nick Hibma 1416fc99b4 MFC: An update to the umass driver, now supporting Zip 250, Zip 100,
Y-E Data floppy drives, and Shuttle SCSI adapters.

The beginnings of the ATAPI transport are there as well.
2000-05-07 18:19:52 +00:00
Nick Hibma f891be9e4c MFC: Make xpt_periph available to other parts of the kernel. When sending a
rescan command to a bus, a periph is needed in xpt_done after completion of
the command.
2000-05-07 18:16:49 +00:00
Paul Saab 60aa8cbc73 MFC: Wrap the failure warnings around PXE_DEBUG in the cleanup routine. 2000-05-07 17:20:59 +00:00
Josef Karthauser 865e2fe152 MFC: Fix a potential buffer overflow in the command line argument parsing
with 'ed [MAXPATHLEN + 1 chars]'. {from revision 1.15}
2000-05-07 17:17:02 +00:00
Nick Hibma e08632a245 MFC: Include sys/bus.h 2000-05-07 14:58:03 +00:00
Nick Hibma f6653e807e MFC: Remove the define for powerhook. 2000-05-07 14:57:40 +00:00
Nick Hibma 979a383ec4 MFC: Remove unneccessary includes. 2000-05-07 14:55:55 +00:00
Nick Hibma 4ce91c332a MFC: Remove an unnecessary include. 2000-05-07 14:53:17 +00:00
Nick Hibma f595b06231 MFC: Enclose the powerhook calls in ifdefs instead of defining away the
function call.
2000-05-07 14:52:21 +00:00
Nick Hibma 110eb90512 MFC: Try and recover as many elements from the done queue after the
controller added an inverted list of TDs (tail first).
2000-05-07 14:51:15 +00:00
Nick Hibma 80a70ba6d2 MFC: Properly detach from bpf. 2000-05-07 14:49:18 +00:00
Nick Hibma f077241f1a MFC:
- Add the SmartBridges SmartLink Id.
- Properly detach from bpf.
2000-05-07 14:48:57 +00:00
Yoshihiro Takahashi ebf0cc0e63 MFC: Fixed bus_space_{read,write}_region_* functions. 2000-05-07 14:48:35 +00:00
Nick Hibma 924e430c97 MFC:
- Add the LinkSys USB10A Id.
- Properly detach from bpf
- bugfix: use the error code from usbd_open_pipe
2000-05-07 14:48:07 +00:00
Nick Hibma 774a47dd97 Regen. after MFC. 2000-05-07 14:47:01 +00:00
Nick Hibma d4b2a629ae MFC: Get all the new and fancy Ids we have collected. 2000-05-07 14:46:32 +00:00
Nick Hibma 0dd39cc3d0 MFC: Keep the bit position even when the report descriptor says POP. 2000-05-07 14:39:59 +00:00
Nick Hibma 7d10c049cb Previous commit was an MFC 2000-05-07 14:36:41 +00:00
Nick Hibma d59571a208 Make all a PHONY target, to make sure that the usbdevs*.h files are
always recreated.
2000-05-07 14:36:22 +00:00
Nick Hibma bfaaf37635 MFC: static -> Static in order to be more OpenBSD friendly. 2000-05-07 14:22:47 +00:00
Brian Somers c6658deac3 MFC: Correct a bad bug in m_prepend() 2000-05-07 10:09:24 +00:00
Kris Kennaway d5feec0a94 MFC: Remove obsolete reference to /var/db/kvm_kernel.db 2000-05-07 02:17:58 +00:00
David E. Cross db7a666366 PR: 17681
Reviewed by:	sheldonh
Obtained from:	NetBSD
MFC: Do proper byte swapping in 64bit routines.
2000-05-06 21:16:04 +00:00
Jeroen Ruigrok van der Werven 742ea4d09b MFC: fix URL.
Submitted by:	Alexander Langer <[email protected]>
2000-05-06 15:06:03 +00:00
Alexey Zelkin 8ac7aefaec MFC: rev 1.4, add integration note 2000-05-06 14:26:51 +00:00
Alexey Zelkin b5db2ba985 MFC: fix typo 2000-05-06 14:22:22 +00:00
Jeroen Ruigrok van der Werven 83431df74f MFC: Fix comparison.
Submitted by:	Maxim Sobolev <[email protected]>
2000-05-06 14:18:41 +00:00
Alexey Zelkin dfd960278c MFC: fix typo 2000-05-06 14:10:22 +00:00
Alexey Zelkin e20b2507cf MFC: rev 1.3, various mdoc cleanup, add integration note 2000-05-06 14:04:21 +00:00
Alexey Zelkin af7c1500f5 MFC: rev 1.3, various mdoc cleanups, correct pathes, add integration note 2000-05-06 13:56:08 +00:00
Alexey Zelkin ee8dc4da91 MFC: Use `Er' variable to define first column width in ERRORS section. 2000-05-06 13:34:15 +00:00
Alexey Zelkin 8ca35daa1c MFC: rev 1.35 , mdoc cleanup 2000-05-06 13:32:55 +00:00
Alexey Zelkin 309ed14654 MFC: rev 1.9, EXAMPLE -> EXAMPLES 2000-05-06 13:31:27 +00:00
Jonathan Lemon 85f115f1b9 MFC: mdoc cleanups 2000-05-06 13:09:39 +00:00
Alexey Zelkin 6bc491a10b MFC: rev 1.29, change Er's value (12 -> 17) 2000-05-06 12:13:09 +00:00
Kris Kennaway b02a64df75 MFC: Note ports-base as a mandatory collection 2000-05-06 03:46:36 +00:00
Jonathan Lemon 64c1e066ba MFC: blurb about kqueue
Reminded by: kkenn
2000-05-06 02:41:35 +00:00
Jonathan Lemon d63526fcc4 MFC: don't include <sys/select.h>. This isn't what actually breaks it,
but the fact that vi has a private copy of <sys/queue.h>, so the system
copy isn't getting pulled in.  However, removing <sys/select.h> is an
easy way to fix the problem.
2000-05-06 02:31:49 +00:00
David E. O'Brien ae9f5eb96d MFC (build screen savers other than "apm" on the Alpha) 2000-05-06 02:09:48 +00:00
Kirk McKusick 89ddae5c57 Merge in fix in delta 1.29 from current to properly reset
grace timer when files are given to a user by root.
2000-05-06 01:44:31 +00:00
Archie Cobbs de1aebbda5 MFC: (rev 1.6) document the new statistics control messages 2000-05-05 17:31:55 +00:00
Archie Cobbs bd0781e29b MFC: bug fixes & statistics 2000-05-05 17:11:39 +00:00
Jonathan Lemon e2cba5ead7 MFC: delayed checksum work. This also brings the mbuf size up to 256. 2000-05-05 13:37:06 +00:00
Jonathan Lemon e7b7b582f5 Add files that I missed in the last MFC round. This is the second
time I've missed the conf/files edit, please pass the pointy hat.

Pointed out by:   Udo Schweigert <[email protected]>
2000-05-05 12:52:17 +00:00
Bill Paul 7e8e62d194 MFC: fix rl_rxeof() to avoid unaligned access trap on alpha with NFS. 2000-05-05 12:49:38 +00:00
Yoshihiro Takahashi 6f7b444f23 MFC: Supported EGC 640x400, PEGC 640x400 and PEGC 640x480 graphics modes. 2000-05-05 09:16:16 +00:00
Yoshihiro Takahashi 4a27f2a7d9 MFC: Added UKBD_DFLT_KEYMAP option and fixed disordering. 2000-05-05 09:01:45 +00:00
Yoshihiro Takahashi f84f311876 MFC: Clean up MAXMEM routine. 2000-05-05 09:00:24 +00:00
Yoshihiro Takahashi 3e94418b8b Sync with the following changes.
Revision File
 1.15.2.1 src/sys/boot/i386/libi386/Makefile
 1.26.2.3 src/sys/boot/i386/libi386/biosdisk.c
 1.41.2.2 src/sys/boot/i386/loader/Makefile
 1.17.2.2 src/sys/boot/i386/loader/main.c
2000-05-05 08:59:06 +00:00
Yoshihiro Takahashi 0bf6ef3f3b MFC: Fixed to support JIS7 KANJI. 2000-05-05 08:55:21 +00:00
Yoshihiro Takahashi 5f8dad1f6c MFC: Removed high-resolution mode supports and added a dummy partition table. 2000-05-05 08:54:06 +00:00
Sheldon Hearn 4b0f72d621 MFC rev 1.10: use IP addresses to "allow anything". 2000-05-05 08:33:58 +00:00
Paul Saab 113af5c9f9 MFC: Remove static heap. 2000-05-05 07:26:53 +00:00
Jonathan Lemon 6508258a83 MFC: kqueue manual page. 2000-05-05 03:51:40 +00:00
Jonathan Lemon 19a37a3d92 MFC: kqueue() and kevent() 2000-05-05 03:50:08 +00:00
Archie Cobbs 7cce85fc6d MFC: field structure changed name from 'typename' -> 'type_name'. 2000-05-05 02:54:16 +00:00
Archie Cobbs 9428771d76 MFC: typename -> type_name; add ng_copy_meta() 2000-05-05 02:51:54 +00:00
Archie Cobbs 68539e05a9 MFC: fix broken multi-link fragment reassembly algorithm. 2000-05-05 02:48:39 +00:00
Archie Cobbs aebf3fb531 MFC: Document TAILQ_FOREACH_REVERSE() and CIRCLEQ_FOREACH_REVERSE() 2000-05-05 01:44:50 +00:00
Archie Cobbs 2cd9d2e646 MFC: TAILQ_FOREACH_REVERSE and CIRCLEQ_FOREACH_REVERSE 2000-05-05 01:41:41 +00:00
cvs2svn 5db372b5d2 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-04 20:19:18 +00:00
Archie Cobbs 8649d988df MFC: move netgraph node type man pages from section 8 to section 4. 2000-05-04 18:44:05 +00:00
Alexey Zelkin 2c4311b4a1 MFC: rev 1.2, update coipyright, add license 2000-05-04 18:21:53 +00:00
Alexey Zelkin 406ccf67c8 MFC: rev 1.2, code names fixes 2000-05-04 18:09:13 +00:00
Alexey Zelkin 71e940f34f MFC: rev 1.31, add libipsec 2000-05-04 17:58:54 +00:00
cvs2svn 686b448e5a This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-04 17:54:39 +00:00
Archie Cobbs f0a9e505fa MFC: move netgraph node type man pages from section 8 to section 4. 2000-05-04 17:50:59 +00:00
Paul Saab ad8efd3578 *sigh* Remove accidently commited buf/bio changes.. current and
stable have diverged too much.
2000-05-04 17:45:54 +00:00
Archie Cobbs 3b0e4a44bf MFC: move netgraph node type man pages from section 8 to section 4. 2000-05-04 17:45:24 +00:00
Alexey Zelkin 0ec8c2a2e6 MFC: mdoc(7) cleanup 2000-05-04 17:44:04 +00:00
cvs2svn 468a30f435 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-04 17:40:14 +00:00
Alexey Zelkin 438ca8148b MFC: rev 1.4, mdoc cleanup 2000-05-04 17:35:17 +00:00
Alexey Zelkin 4458bab7e4 MFC: rev 1.2, fix path 2000-05-04 17:35:00 +00:00
Alexey Zelkin 2a496f7d4d MFC: rev 1.2, add integration note, clean `.Os' macro value 2000-05-04 17:32:34 +00:00
Sheldon Hearn 18bb3fbf07 MFC rev 1.11: Remove hard sentence breaks. 2000-05-04 17:32:18 +00:00
Alexey Zelkin fc34c50fd3 MFC: rev 1.4, mdoc cleanup, add integration note 2000-05-04 17:29:48 +00:00
Alexey Zelkin 694d45d2f2 MFC: rev 1.18, remove BUGS section 2000-05-04 16:49:22 +00:00
Alexey Zelkin d8cbe8365f MFC: .Fx', .Nx' and `.Ox' are parsed and callable (document it) 2000-05-04 16:27:58 +00:00
Paul Saab 0d635ca4e8 MFC: PXE manpage 2000-05-04 13:58:00 +00:00
Paul Saab 84d10c2fdb MFC: Latest PXE and ext2fs support. 2000-05-04 13:51:39 +00:00
Paul Saab 97854f9e49 MFC: readdir support for libstand 2000-05-04 13:47:53 +00:00
cvs2svn 811074f9c9 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-05-04 11:31:17 +00:00
Jonathan Lemon 7ab0aa0d63 MFC: rename id_foo --> idad_foo and fix cdevsw naming that prevents booting. 2000-05-03 23:54:09 +00:00
Wilko Bulte 523f885fce Add PWS as abbrev. name for Miata
Submitted by: [email protected]
2000-05-03 21:04:23 +00:00
Garrett Wollman 8f77f2580b Merge markm's changes to netstat to go along with my changes to
<net/radix.h>.

Requested by:	Marco Molteni <[email protected]>
2000-05-03 19:21:35 +00:00
Garrett Wollman 4601daf795 Merge my changes for clearer struct tags in the radix tree
code.

Requested by:	Marco Molteni <[email protected]>
2000-05-03 19:17:12 +00:00
Archie Cobbs 71c26ce520 MFC: formatting tweaks. 2000-05-03 16:50:17 +00:00
John Baldwin 6443309308 MFC: Don't disable interrupts in virtual 86 mode unless we are handling a
hardware interrupt.
2000-05-03 15:48:39 +00:00
Søren Schmidt 3faec93675 MFC:
Fix for the HP burners (and possibly other broken drives to)
that fails to proberly close the disk.
2000-05-03 08:57:31 +00:00
Søren Schmidt 935a4d612d MFC: Add support for ATA66 on newer revisions of the VIA 82C596 2000-05-03 08:56:40 +00:00
Luigi Rizzo 300ef15de7 remove a useless error message 2000-05-02 16:31:05 +00:00
Seigo Tanimura c488e05530 MFC: Add FUJITSU Modem 33600 PNP/I2. (rev 1.295) 2000-05-02 06:05:50 +00:00
Tim Vanderhoek f1a8df5a98 MFC: Fix int vs. long, add missing const poisons 2000-05-02 03:00:59 +00:00
Archie Cobbs 22ffe61c4c MFC: (rev. 1.6) fix a bug in handling the debug level 2000-05-01 18:12:25 +00:00
Alexey Zelkin 6e0474e02c MFC: rev 1.5 2000-05-01 14:57:31 +00:00
Alexey Zelkin e1bcb45816 MFC: rev 1.2 2000-05-01 14:49:07 +00:00
Alexey Zelkin c074848b3d MFC: integration note, `.Os' value clear, remove unneeded comments,
mdoc(7)'fy, .Lb-ify
2000-05-01 14:43:50 +00:00
Alexey Zelkin ed759edf27 MFC: rev 1.28, add libipsec 2000-05-01 14:34:34 +00:00
Alexey Zelkin c2bb147134 MFC: rev 1.5, make manpage more FreeBSD specific 2000-05-01 14:10:15 +00:00
Peter Wemm f42902bf42 MFC: remove semconfig(2) 2000-05-01 11:16:00 +00:00
Peter Wemm 8b5b171155 MFC: remove semconfig() 2000-05-01 11:15:10 +00:00
Paul Saab 5f1c06922a MFC: 1.4 Do not attempt to free a nfs node if it is the root node. 2000-05-01 11:00:42 +00:00
Peter Wemm 9c8127832b MFC: remove semconfig() calls 2000-05-01 10:53:55 +00:00
Boris Popov 9508383f56 MFC: Count correct checksum for an IPX/NetBIOS packets. 2000-05-01 01:10:24 +00:00
Boris Popov 2c19fdb00f MFC: Handle 802.2 and SNAP frames properly. 2000-05-01 01:04:41 +00:00
Satoshi Asami 31f17a3c1b Merge 1.11. 2000-04-29 11:45:16 +00:00
Peter Wemm 46aae5e795 MFC: dire warnings about internal functions. 2000-04-29 10:15:56 +00:00
Peter Wemm 8f52f28a44 MFC: LOAD_ADDRESS isn't used here. 2000-04-29 06:31:30 +00:00
Wilko Bulte 7efe193a09 add Samsung 164BX to non-SRM mainboards. 2000-04-28 19:20:20 +00:00
Alexey Zelkin 89e6fbe778 MFC: rev 1.27, fix typo 2000-04-28 09:33:42 +00:00
Wilko Bulte 39bf7e2118 Remove PC164UX from 'might work/might have SRM'. Add warning for
non-SRM for PC164UX and XL/XLT DEC machines

Submitted by:	[email protected]
2000-04-27 20:20:46 +00:00
Bill Paul df404cb995 Grrr. Add miibus_if.h to SRCS so this will build again. *slap* 2000-04-27 20:18:34 +00:00
Bill Paul 13d41e9b33 MFC: update Tigon firmware to 12.3.21. 2000-04-27 16:01:20 +00:00
Bill Paul fe72b4478e MFC: add missing bpfdetach() stub for when bpf is disabled. 2000-04-27 15:13:43 +00:00
Bill Paul 1530999a02 MFC: merge sk driver from current, add support for 1000baseTX devices. 2000-04-27 14:48:08 +00:00
Bill Paul a2e9248b7b MFC: add xmphy and brgphy to miibus module build. 2000-04-27 14:47:25 +00:00
Bill Paul fff7401aa7 MFC: add Broadcom and XMAC PHY drivers. 2000-04-27 14:43:42 +00:00
Bill Paul 54665628cd Regenerate. 2000-04-27 14:42:48 +00:00
Bill Paul 6053092fc5 MFC: add 1000baseTX PHYs from head. 2000-04-27 14:42:26 +00:00
Dag-Erling Smørgrav f704b120a1 MFC: Document firewall_script 2000-04-27 10:43:18 +00:00
Alexey Zelkin ba915c8fff (clarification to previous commit)
MFC: rev 1.26, -lc_r -> -pthreads
2000-04-27 09:03:21 +00:00
Alexey Zelkin 361de0cb49 *** empty log message *** 2000-04-27 08:55:39 +00:00
Brian S. Dean da666b7277 MFC: Back out the hook to execute the file ${firewall_type}. The
intended purpose of the hook was to provide the ability for a
     shell program to instantiate the firewall rules instead of
     forcing them to be statically coded.  This functionality was
     already present through the use of ${firewall_script}, and I see
     no need to keep the ${firewall_type} hook around.
2000-04-27 00:54:45 +00:00
cvs2svn aa9cd25462 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-04-26 23:25:59 +00:00
Matthew Dillon 383c30fcec MFC sequential write detection heuristic. This extends the sequential
read heuristic to also cover sequential writes, causing write-behind
    to be used only for the sequential write case.  This solves a number of
    performance issues with random writes to medium sized files using
    large block sizes, as occurs with DBM files.
2000-04-26 20:36:36 +00:00
Bill Fumerola ec9ca91281 Reverse part of previous MFC, unbreak mlx
Submitted by:	msmith
2000-04-26 01:43:21 +00:00
Joerg Wunsch 8f3d06fb9d MFC: rev 1.13, reassemble a sentence. 2000-04-25 13:55:03 +00:00
Sheldon Hearn 4903d68024 MFC rev 1.53: Fix excessive parens in previous commit. 2000-04-25 09:01:22 +00:00
Jonathan Lemon f8e3a307ea MFC, rev 1.15; data corruption bug under heavy I/O load. 2000-04-25 02:29:51 +00:00
Mike Smith a089e96b58 MFC: disable returning "wedged" commands. 2000-04-24 19:56:45 +00:00
Mike Smith 27e61fdc3b MFC: documentation updates for the 'mlx' driver. 2000-04-24 19:50:04 +00:00
Mike Smith c83030c354 Attach mlxcontrol 2000-04-24 19:48:51 +00:00
Mike Smith 2c13cd0c2c MFC: control utility for 'mlx' controllers. 2000-04-24 19:44:47 +00:00
Mike Smith 91605d38e1 MFC:
- resource cleanups during attachment failures
 - grammar in diagnostics
 - fix for log message race which would show up on drive death or removal
   from an unmanaged enclosure
 - support for userland control utility
2000-04-24 19:40:50 +00:00
Doug Rabson ef17d7f8db MFC: revision 1.21 - don't prepend 'r' to devices when its not needed. 2000-04-24 14:41:54 +00:00
Mike Pritchard 8534aa3425 MFC: Fix some spelling errors. 2000-04-23 17:06:30 +00:00
Mike Pritchard 1a7232b6a7 MFC: Some minor mdoc style and spelling fixes. 2000-04-23 17:05:30 +00:00
Mike Pritchard 6a0d63a761 MFC: Fix a couple of typos and make the FILES section follow mdoc style. 2000-04-23 17:04:14 +00:00
Mike Pritchard 0eb85fe209 MFC: Minor style fixes. 2000-04-23 17:02:39 +00:00
Mike Pritchard 7357841153 MFC: Fix some spelling errors. 2000-04-23 17:00:38 +00:00
Mike Pritchard 4fd162720e MFC: Spelling fix. 2000-04-23 16:59:28 +00:00
Brian S. Dean 69e117554a MFC up to rev 1.22 - Make the '-n' flag work as advertised. 2000-04-23 16:58:55 +00:00
Mike Pritchard e979ec36a4 MFC: mdoc style fixes. 2000-04-23 16:58:37 +00:00
Mike Pritchard 940bf41701 MFC: Fix a minor grammar problem. 2000-04-23 16:57:02 +00:00
Mike Pritchard 6b1e17c021 MFC: Fix a spelling error. 2000-04-23 16:54:25 +00:00
Brian S. Dean b9c82157e5 MFC: Fix a core dump that occurs when sending a file to the remote
side.  Resurrect the 'cdelay' and 'ldelay' features.
2000-04-23 16:52:35 +00:00
Mike Pritchard b1d5dc4671 MFC: Fix the NAME section and a typo. 2000-04-23 16:51:28 +00:00
Mike Pritchard b99fb1a4a9 MFC: ancontrol first appeared in FreeBSD 4.0, not 3.0.
Also fix some minor mdoc stuff.
2000-04-23 16:43:17 +00:00
Brian S. Dean 5750f844ff MFC: Allow firewall rules to be instantiated via a shell script. 2000-04-23 16:26:29 +00:00
Alexey Zelkin 936b5f048e MFC: rev 1.2, corect ALPHAs 2000-04-23 15:13:30 +00:00
Alexey Zelkin a1f69e620b MFC: rev 1.25, .Lb macro sync note 2000-04-23 14:54:44 +00:00
Alexey Zelkin 7dec749f7c MFC: rev 1.29, add information about .Lb macro 2000-04-23 14:51:47 +00:00
Alexey Zelkin 9784694ee8 MFC: rev 1.18, add information about .Lb macro 2000-04-23 14:51:25 +00:00
Alexey Zelkin 01fce57322 MFC: rev 1.12, suggest to use .Lb macro 2000-04-23 14:48:06 +00:00
Yoshihiro Takahashi c773e361ff MFC: Fixed PC-98 support. 2000-04-23 09:59:11 +00:00
Yoshihiro Takahashi f2a01ac966 MFC: Release allocated resources and return ENXIO on error. 2000-04-23 09:54:32 +00:00
Yoshihiro Takahashi 694619707d Sync with sys/i386/conf/GENERIC revision 1.246.2.2. 2000-04-23 09:06:24 +00:00
Kenneth D. Merry 6f20d624af MFC, rev 1.21. Fix a panic in the case of a probe failure, and add a
newline in an error message.

PR:		kern/17512
Submitted by:	Louis Mamakos <[email protected]> (newline fix)
2000-04-22 20:58:45 +00:00
Kris Kennaway abc2635848 MFC: Remove reference to SHS passwords. 2000-04-22 20:46:09 +00:00
Alexey Zelkin 95f2a89368 MFC: introduce .Lb macro to libc manpages 2000-04-22 17:07:11 +00:00
Alexey Zelkin 8707bb021a MFC: introduce .Lb macro to libc manpages 2000-04-22 16:46:19 +00:00
Alexey Zelkin a7f6a73356 MFC: introduce .Lb macro to libraries manpages, some mdoc cleanup 2000-04-22 16:36:09 +00:00
Alexey Zelkin 9441c78584 MFC: rev 1.23, 1.24, introduce .Lb macro 2000-04-22 16:24:06 +00:00
Yoshihiro Takahashi ede16bc486 MFC: Changed interrupt level to splcam(). 2000-04-22 15:09:35 +00:00
Luoqi Chen 6a970be1d8 MFC: IO apics are not necessarily page aligned, they are only required to be
aligned on 1K boundary. Correct a typo that would cause problem to a second
IO apic.

Pointed out by: Steve Passe     <smp.csn.net>
2000-04-22 05:48:45 +00:00
Guido van Rooij 1da792d5fd MFC: 1.86 2000-04-21 17:49:58 +00:00
Kazutaka YOKOTA d5efaa17bc MFC: Reduce the default timeout for the three button emulation
from 200 msec to 100 msec.
2000-04-21 14:21:39 +00:00
Kazutaka YOKOTA de82524415 MFC: -3 option fix (rev 1.43). 2000-04-21 13:45:16 +00:00
Alexey Zelkin 8aaf137797 MFC: rev. 1.2 2000-04-20 15:24:40 +00:00
Alexey Zelkin 1b920f0606 MFC: rev 1.2, remove .Nm macro argument 2000-04-20 15:22:16 +00:00
David E. O'Brien 157746d2d8 MFC: rev 1.4 (revert to virgin FSF/Cygnus source) 2000-04-20 09:01:16 +00:00
Paul Saab 9f3197053a MFC: Mention the support for PXE in the release notes. 2000-04-20 06:47:45 +00:00
Kris Kennaway 7606f1ff10 MFC: Log errors to syslog if stderr is closed. 2000-04-20 04:57:46 +00:00
Yoshinobu Inoue 298ea9fe40 Change getaddrinfo() resolve order
from
  all AAAA trial, then all A trial
to
  try AAAA and A for each trial

TODO: more fix for the case where IPv4 mapped IPv6 addr is disabled

Reviewed by: ume
2000-04-20 03:31:40 +00:00
Brian Somers 805593368c MFC: Don't define USE_PIPES 2000-04-20 01:34:14 +00:00
Archie Cobbs ae6c5a5c27 MFC: Updates to the ng_iface(8) netgraph node type 2000-04-19 21:28:03 +00:00
Archie Cobbs 8750a3a8c1 MFC: add bpfdetach() function 2000-04-19 21:25:52 +00:00
Chris Costello 56a184dcc8 MFC: Fill in a missing word (`it'). 2000-04-19 02:34:20 +00:00
Peter Wemm 8d10fd8b64 MFC: 1.47: don't NULL deref in M_PREPEND() if m_prepend() fails. 2000-04-19 01:26:25 +00:00
David E. O'Brien 3171f6e34a MFC: rev 1.10 (locales warning clarification) 2000-04-18 21:09:03 +00:00
David E. O'Brien a572115ece MFC: revs 1.5 & 1.6. Both cosmetic changes. 2000-04-18 21:06:21 +00:00
David E. O'Brien 30f0abd359 MFC: in addition to our old branding method, brand using the EI_OSABI ELF
header field.
2000-04-18 20:41:11 +00:00
David E. O'Brien 273209f0cf MFC: get EI_OSABI values. 2000-04-18 20:38:42 +00:00
Joerg Wunsch 8688c4b0de MFC 1.6: southamericarand -> southafricarand 2000-04-18 16:39:26 +00:00
Steve Price 077388061b MFC: add 'wish' class support 2000-04-18 15:04:52 +00:00
Roger Hardiman 2cd2be9144 MFC: Update with multiple #include protection 2000-04-18 12:53:36 +00:00
Roger Hardiman 74419b1a54 MFC: Update to driver 2.12 2000-04-18 12:50:33 +00:00
Søren Schmidt 3c6235a772 Remove linprocfs as pr -core's request. 2000-04-18 11:24:42 +00:00
Søren Schmidt f87c43cdd1 Remove linprocfs as pr -core's request.
Since -core has requested that linprocfs be moved into the linuxulator
this never should have entered RELENG_4.
2000-04-18 10:20:47 +00:00
Bill Fumerola 0d05075b61 releng3 -> releng4 (releng3 doesn't even exist anymore)
current is 5.0, not 4.0

Submitted by:	Bob Marsh <[email protected]>
2000-04-18 06:02:04 +00:00
Archie Cobbs ec5c390c0a MFC: ng_mppc netgraph node type 2000-04-18 04:48:39 +00:00
Archie Cobbs a76955039c MFC: fix bogus const'ness 2000-04-18 04:46:01 +00:00
David E. O'Brien 587281bef7 MFC: rev 1.9 (tfaff changes) 2000-04-18 04:41:03 +00:00
Munechika SUMIKAWA aa553cbcda MFC: even if nd6_nud_hint is called, do not change a neighbor's status
unless the old status is probably reachable (i.e. the link-layer
address has already been resolved).
2000-04-17 20:31:03 +00:00
Munechika SUMIKAWA a560edcb0a MFC: ND6_HINT() should not be called unless the connection status is
ESTABLISHED.
2000-04-17 20:29:12 +00:00
Bill Paul d044cfd160 MFC: try to obtain station's source address correctly when receiving frames 2000-04-17 18:49:08 +00:00
Boris Popov 08a5ca91ce MFC: build KLD with Ethernet_II frame support by default. 2000-04-17 09:10:11 +00:00
Ruslan Ermilov 9dd10e5048 MFC: (rev 1.26) Apply TCP_EXPIRE_CONNECTED (86400 seconds) timeout only
to established connections, after SYN packets were seen from both ends.

PR:		bin/17963
2000-04-17 09:05:59 +00:00
Boris Popov 933d5c4a55 MFC: Allow to pass server timezone via TZ variable. 2000-04-17 08:34:20 +00:00
Boris Popov c620e49315 MFC: do not panic if kernel issues a request. 2000-04-17 08:25:36 +00:00
Mitsuru IWASAKI 47fe690a6d MFC:Create mfsfd/etc/defaults/ first before copying etc/defaults/pccard.conf. 2000-04-17 05:14:35 +00:00
Mitsuru IWASAKI 7b9fa15fac MFC: etc/pccard.conf.sample -> etc/defaults/pccard.conf 2000-04-17 03:14:36 +00:00
Matthew N. Dodd 5b41c79b48 MFC:
The EISA bits haven't ever worked here.
2000-04-16 14:14:29 +00:00
Yoshihiro Takahashi 3f795425aa MFC: Sync with current boot code. 2000-04-16 03:55:22 +00:00
Jeroen Ruigrok van der Werven 5c91affcf3 MFC: fix posix option typo. 2000-04-15 18:47:42 +00:00
Mitsuru IWASAKI f845ee2be0 MFC: remove pccard.conf.sample from Makefile. 2000-04-15 16:50:52 +00:00
Mitsuru IWASAKI 9e951d5d29 MFC:
Remove src/etc/pccard.conf.sample.  This file is no longer used.
The pccardd default config file is changed to /etc/defaults/pccard.conf.

Approved by:	imp, jkh
2000-04-15 11:16:33 +00:00
Mitsuru IWASAKI eac2e0d3f0 MFC: related changes on src/etc/defaults/pccard.conf.
src/etc/Makefile:				1.219 -> 1.220
src/etc/defaults/pccard.conf:			N/A -> 1.98
src/etc/defaults/rc.conf:			1.57 -> 1.58
src/share/examples/etc/README.examples:		1.5 -> 1.6

Approved by:	imp, jkh
2000-04-15 11:02:49 +00:00
Mitsuru IWASAKI df2186b330 MFC:
- default config file changed from /etc/pccard.conf to
   /etc/defaults/pccard.conf in pccardd.
 - remove etc/pccard.conf.sample.  This file is no longer used.
 - support wildcard entry for generic serial and fixed disk
   as fallthrough entry.
 - add restart capability by SIGHUP.

src/usr.sbin/pccard/pccardd/cardd.c:		1.46 -> 1.47
src/usr.sbin/pccard/pccardd/cardd.h:		1.18 -> 1.21
src/usr.sbin/pccard/pccardd/file.c:		1.24 -> 1.28
src/usr.sbin/pccard/pccardd/pccard.conf.5:	1.12 -> 1.14
src/usr.sbin/pccard/pccardd/pccardd.8:		1.17 -> 1.19
src/usr.sbin/pccard/pccardd/pccardd.c:		1.6 -> 1.9
src/usr.sbin/pccard/pccardd/readcis.c:		1.17 -> 1.18
src/usr.sbin/pccard/pccardd/readcis.h:		1.11 -> 1.12

Approved by:	imp, jkh
Obtained from:	PAO3
2000-04-15 10:56:22 +00:00
Paul Saab 0136cf15de MFC: sync up loader with current, including PXE. 2000-04-15 05:48:20 +00:00
Paul Saab 465a2e5f4e Oops.. Add this file I forgot in the previous commit.. :( 2000-04-15 03:43:56 +00:00
Paul Saab 081c7828fb MFC: sync up loader with current, including PXE. 2000-04-15 03:09:47 +00:00
Bill Paul 9cc36f3ab2 MFC: change && to || in probe routine. 2000-04-14 15:33:14 +00:00
Yoshihiro Takahashi ebbee1c436 MFC: The printf function of boot2 can't recognize "%lx" format. 2000-04-14 14:26:25 +00:00
Sheldon Hearn 10d17efe54 MFC rev 1.20: Fix Y2K bug. 2000-04-14 13:55:28 +00:00
Yoshihiro Takahashi e991f82640 MFC: Newbusify the adv driver. 2000-04-14 13:32:54 +00:00
Yoshihiro Takahashi d5f85f0cf5 MFC: Newbusify the amd driver. 2000-04-14 13:16:54 +00:00
Yoshihiro Takahashi 9a2c24dc92 MFC: Supported PC-9801-100 SCSI interface. 2000-04-14 13:13:28 +00:00
Yoshihiro Takahashi 0a4df4ff3e MFC: Newbusify the mse driver. 2000-04-14 13:11:12 +00:00
Yoshihiro Takahashi b6cf2d07e2 MFC: Added indirect pio into the bus space stuff for the NEC PC-98. 2000-04-14 13:08:59 +00:00
Wilko Bulte 8c3c7e827f Add web pointers to Multia FAQs 2000-04-14 10:29:03 +00:00
Sheldon Hearn 5129825f4f MFC rev 1.5: .Nx -> .Ux in the context of "On modern xxx systems..." 2000-04-14 10:01:13 +00:00
Jeroen Ruigrok van der Werven 0e0843b9e5 MFC: Remove trailing whitespace. 2000-04-13 19:35:07 +00:00
Wilko Bulte 1086d38605 Update Multia section with floppy boot problems & workaround. 2000-04-13 18:17:59 +00:00
Bill Fumerola 5376f98cc2 The FTP directory for 4.x changes from 4-current to 4-stable. symlinks
make this work on the ftp site right now, but this reflects reality now.
2000-04-13 15:04:05 +00:00
Sheldon Hearn 56c4c60670 MFC: Add example refuse file. 2000-04-13 14:43:56 +00:00
cvs2svn 4ed2551a19 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-04-13 14:40:41 +00:00
Yoshihiro Takahashi b251faf8e2 MFC: Fixed pcaudio. 2000-04-13 10:36:25 +00:00
Sheldon Hearn bf935ee7a5 MFC: Do not issue a warning when chflags() fails with EOPNOTSUPP. 2000-04-13 10:01:52 +00:00
Brian Somers 0213b1b8a5 MFC: Make redial & reconnect work again
Show redial/reconnect comfort messages when running ppp -background
     Reduce some diagnostics to debug level
     Rename some Alias* functions to Nat*
     Allow ``set authname'' when not in phase ESTABLISH/DEAD (just warn)
     Don't sleep (or hang) when losing the last -background/-direct link
     Correctly handle failing to run prog when a device is specified as "!prog"
     Allow hostnames as well as IP numbers
     Add diagnostics for incoming packets being ignored by libalias
     Add ``set target''
2000-04-13 00:14:43 +00:00
Brian Somers ad71a1730f MFC: Redirect incoming connections to aliasAddress by default
Use INADDR_ANY instead of 0 where appropriate
     Staticise _FindLinkIn and wrap GetDestPort with #ifndef NO_FW_PUNCH
2000-04-13 00:11:44 +00:00
Wilko Bulte 0c5afc6039 update Monet info 2000-04-12 20:24:31 +00:00
Archie Cobbs 52887e27dc MFC: (rev. 1.13) fix uninitialized variable 2000-04-12 17:31:02 +00:00
Yoshihiro Takahashi 4790499440 MFC: The nss driver is compatible mode. 2000-04-12 13:04:08 +00:00
David E. O'Brien 783fc18bd1 MFC: rev 1.5 (dependancy fixups) 2000-04-12 06:38:34 +00:00
David E. O'Brien 982b1a7dfd MFC: rev 1.16 (depenancy fixups) 2000-04-12 06:37:15 +00:00
Ollivier Robert 155b6543b4 MFC: bug fix: Set the right default timeout to 200ms as per the manpage.
PR:             bin/17879
Submitted by:   Samuel Tardieu <[email protected]>
2000-04-11 11:11:15 +00:00
Wes Peters 51c443df58 De-pessimize checking of runt packets. Patch was created vs.
4.0-STABLE.

PR:		17872
Submitted by:	[email protected] (C. Stephen Gunn)
2000-04-11 07:08:35 +00:00
Archie Cobbs 44794dec4e MFC (rev 1.130): SIGIO bug fix 2000-04-11 01:33:35 +00:00
Archie Cobbs a7cac79d4d MFC: minor prototype tweaks 2000-04-11 01:21:39 +00:00
Archie Cobbs a93dac9079 MFC: fix typo 2000-04-11 01:12:25 +00:00
Mike Smith 71339c22ac Major MFC:
- Reduce maximum number of commands to a safe level.
 - Introduce periodic status poll.
 - Rework command submission/completion handling to remove possible races.

This should stabilise the driver under heavy load conditions.
2000-04-11 00:12:46 +00:00
Hajimu UMEMOTO 8d635de429 MFC, Return IPv4 native address for IPv4 mapped IPv6 address, even if
A RR is not found.
2000-04-10 20:08:43 +00:00
Jeroen Ruigrok van der Werven fb25e01363 MFC: Document NO_BIND. 2000-04-10 18:53:29 +00:00
Jeroen Ruigrok van der Werven b2080b34bf MFC: ASUSCOM_IPAC works. 2000-04-10 18:34:55 +00:00
David E. O'Brien 1a3663ae50 MFC: rev 1.29 (don't prepend "r" to the device name) 2000-04-10 05:56:06 +00:00
Archie Cobbs 977181ec71 MFC: (rev 1.12) document EWOULDBLOCK. 2000-04-09 19:15:03 +00:00
Wilko Bulte 7526157367 Update DS10 description, add info on DS10L "Slate" 2000-04-06 18:10:45 +00:00
Yoshihiro Takahashi 992e658e7a Merged from sys/i386/conf/GENERIC revision 1.246.2.1. 2000-04-06 14:07:18 +00:00
Satoshi Asami 5c28bce0d7 MFC: 1.537 (use release tags for ports and doc trees) 2000-04-06 10:02:08 +00:00
Archie Cobbs 796c7dc313 MFC: (rev. 1.2) identify timezone data files by their ``TZif'' magic number 2000-04-05 18:44:01 +00:00
Ruslan Ermilov 3b88f15d03 MFC: New timezone data from ftp://elsie.nci.nih.gov/pub/tzdata2000d.tar.gz 2000-04-05 18:21:21 +00:00
Bill Fumerola 400d244dc5 Even though xe0 was commented out, people still (rightfully) think they can
just uncomment it and have it magically work. This driver _is_ broken for
4.0 and there is no way to make it work as it stands right now. Hopefully
this will cut down on the amount of (semi-bogus) "bug" reports.
2000-04-05 18:16:15 +00:00
Ruslan Ermilov 24611ae3ad MFC: (rev 1.142)
Get rid of "sticky" files when updating sources from CVS repository.
2000-04-05 17:52:02 +00:00
Sheldon Hearn 3fd09d63b5 MFC rev 1.12: MANSEC -> MANSECT 2000-04-05 14:00:53 +00:00
Sheldon Hearn 3e7455d7b1 MFC rev 1.37: Ignore passwordless, blocked out NIS password entries. 2000-04-05 13:44:35 +00:00
Yoshihiro Takahashi 9b69498bf3 Merged from sys/isa/syscons_isa.c and sys/dev/syscons/syscons.c revision
1.11.2.1 and 1.336.2.1, respectively.
2000-04-05 11:35:36 +00:00
Kris Kennaway 7f04e80273 MFC: Correct typo and interchange library names 2000-04-05 04:10:37 +00:00
Warner Losh 4a43ea40ac Minor nits in 3.4->4.0 upgrade 2000-04-04 17:05:18 +00:00
Sheldon Hearn efa5476524 MFC rev 1.9: Fix single space hard sentence break. 2000-04-04 15:44:54 +00:00
Bruce Evans 0d417f3793 MFC (1.8: fix prototype for setflags()). 2000-04-04 14:15:15 +00:00
Kris Kennaway a647efc716 MFC: Add libcrypto to LDADD 2000-04-04 07:44:57 +00:00
Brian Somers 9e3cdb66bb MFC: Don't wander off into oblivion when parsing "#" 2000-04-03 22:58:00 +00:00
John Polstra 9217428c25 MFC 1.9 -> 1.10: Document that flags can be specified as an octal
number.
2000-04-03 22:12:15 +00:00
Nick Hibma 50b50e273d Unbreak LINT: Rename atapi_start to atapi_strt in the 'old' ATAPI driver. 2000-04-03 20:13:08 +00:00
Brian Somers f0c9266e03 MFC: Plug two file descriptor leaks 2000-04-03 20:02:28 +00:00
Wilko Bulte 42db005878 Add note on SCSI floppy found on DEC3000 series 2000-04-03 19:33:21 +00:00
Sheldon Hearn 7b33103575 MFC rev 1.5: Describe static numbering. 2000-04-03 13:09:44 +00:00
Kazutaka YOKOTA a8486f7094 MFC:
- Fix SC_ALT_MOUSE_IMAGE; don't blink the mouse cursor.
- Fix non-destructive, underline text cursor.
- Unbreak LINT.

They correspond to:
syscons_isa.c 1.12, scmouse.c 1.13, scvgarndr.c 1.7,
scvidctl.c 1.20, syscons.c 1.337, 1.338, syscons.h 1.61, 1.62.
2000-04-03 13:03:54 +00:00
Kazutaka YOKOTA e7a6bca5da MFC: Reflect recent update. 2000-04-03 10:24:38 +00:00
Kazutaka YOKOTA 6531e0bf84 MFC: Reflect the recent update in moused.c. 2000-04-03 10:23:55 +00:00
Nick Hibma ee06e9bd92 MFC: Add a comment about the fact that the usb module is automatically
loaded.
2000-04-02 21:14:13 +00:00
Brian Somers d11a33163f MFC: Correct Charles Mott's email address 2000-04-02 20:24:48 +00:00
Brian Somers 5cd63cb32b MFC: Charles' email address 2000-04-02 20:18:37 +00:00
Yoshinobu Inoue b0e6606d68 MFC: Remove references to man pages that don't exist. 2000-04-02 16:39:24 +00:00
Yoshinobu Inoue 28d3671674 MFC:
Avoid using sed and awk in configure script.
2000-04-02 16:37:59 +00:00
Jeroen Ruigrok van der Werven 28810cda29 MFC: Remove BUS_[CREATE|CONNECT]_INTR.9.
Add BUS_SETUP_INTR.9.
2000-04-02 12:59:55 +00:00
Jonathan M. Bresler e056a37322 MFC: support for the LinkSys USB 10BaseT adapters
based on the ADMtek Pegasus AN986 chipset
2000-04-02 12:50:28 +00:00
cvs2svn 1247b53994 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-04-02 12:00:53 +00:00
Peter Wemm 798540aa11 MFC: make SYSVSHM limits arbitarily configurable via sysctl after boot
and other minor cleanups.
2000-04-02 08:47:17 +00:00
Jonathan M. Bresler e6231132e9 MFC: usbd(8) will autoload the usbd kld if necessary 2000-04-02 06:33:36 +00:00
Jeroen Ruigrok van der Werven 1ecd82ae8f MFC: Get rid of spurious .Fc. 2000-04-01 20:33:15 +00:00
Nick Hibma 01a21e2e11 MFC: The new USB mass storage driver, supporting Y-E Data floppy drives,
Zip 100 and 250 drives, and eSCSI dongles (some Orb 2.2Gb drives).
2000-04-01 19:33:35 +00:00
Nick Hibma bd99a86ff2 Correct my e-mail address. The skylink one is no longer working. 2000-04-01 19:13:20 +00:00
Nick Hibma b89d73558e Regen. 2000-04-01 18:59:01 +00:00
Nick Hibma ecae928abc MFC: A large number of Id's 2000-04-01 18:56:52 +00:00
Søren Schmidt e4fce3019b MFC: make ATAPI CD changers work again. 2000-04-01 14:11:43 +00:00
Yoshihiro Takahashi e438a2d7a0 MFC: Added Ratoc REX-9880/83 supports (PC-98 only). 2000-04-01 13:11:11 +00:00
Yoshihiro Takahashi 80a38f5d3e MFC: Supported PC-98. 2000-04-01 13:07:46 +00:00
Yoshihiro Takahashi 54a4e05e1a Merged from sys/isa/sio.c revision 1.291.2.1. 2000-04-01 11:42:35 +00:00
Wilko Bulte 7920f61238 - add info on TurboLaser support which was MFCed into RELENG_4
- correct info on sound on AS200 and Miata. It does work on 4.0 as
well..
2000-03-31 21:11:57 +00:00
Doug Rabson 57fa93a128 MFC: revision 1.5 2000-03-31 19:41:10 +00:00
Chris Timmons c0eca48cdf MFC rev 1.9 2000-03-31 13:11:07 +00:00
Kazutaka YOKOTA 099af5d7b7 MFC:
- Fix the three button emulation (rev 1.41).
- Remove unwanted debug output (rev 1.42).
2000-03-31 12:57:17 +00:00
Kazutaka YOKOTA db5478aa9a MFC:
- Properly keep track of I/O port resources.
- Use bus_space_read/write() to access the ports.

atkbd_isa.c 1.8, atkbdc_isa.c 1.15, atkbd.c 1.26,
atkbdc.c 1.6, atkbcreg.h 1.6, atkbdreg.h 1.6,
pcvt_hdr.h 1.37, psm.c 1.24.
2000-03-31 12:52:06 +00:00
Sheldon Hearn 8353fe6eb2 MFC: Add NO_MAILWRAPPER knob. 2000-03-31 09:25:14 +00:00
Doug Rabson f849628814 MFC revisions 1.3 and 1.4, fixes to PnP resource parsing. 2000-03-31 07:22:59 +00:00
Peter Wemm 2e1d0f2abf MFC: 1.293: add pnp id: USR3050 - U.S. Robotics 56K FAX INT 2000-03-31 07:10:20 +00:00
Yoshihiro Takahashi 02afb236f8 MFC: Added 640KB and 1232KB formats. 2000-03-31 03:41:03 +00:00
Yoshihiro Takahashi 409c824fe7 MFC: Copy from BIOS work area to the cpu_id variable (PC-98 only). 2000-03-31 03:37:03 +00:00
Yoshihiro Takahashi 1f6d634846 MFC: Commented out apm0. 2000-03-31 03:29:21 +00:00
Yoshihiro Takahashi 4b284350b5 MFC: Added PC98 version of fdisk. 2000-03-31 03:24:35 +00:00
Yoshihiro Takahashi c401563753 MFC:
- Supported display suspended mode.
 - Switch on/off not only text screen but also graphic screen.
2000-03-31 03:18:33 +00:00
Yoshihiro Takahashi d1709153d6 Merge from the following changes.
File				Revision
sys/conf/files.i386		1.303 and 1.304
sys/dev/kbd/atkbd.c		1.23
sys/dev/syscons/scterm-sc.c	1.2
sys/dev/syscons/scvgarndr.c	1.5
sys/dev/syscons/scvtb.c		1.5
sys/dev/syscons/syscons.c	1.335
sys/isa/syscons_isa.c		1.11
sys/isa/vga_isa.c		1.17
2000-03-31 03:13:52 +00:00
Andrew Gallatin e68be15e08 MFC 1.113: Move linprocfs to the i386-only section so the Alpha buildworld
has a chance at finishing..
2000-03-30 14:22:59 +00:00
Sheldon Hearn 8e78e91f6c MFC rev 1.143: Fix buildkernel and installkernel targets. 2000-03-30 13:08:32 +00:00
David E. O'Brien ce54545818 Sync up with latest vendor files. 2000-03-30 08:22:06 +00:00
Jordan K. Hubbard aa0d4aee37 MFC: look for proper hints file 2000-03-30 08:12:02 +00:00
David E. O'Brien 2a877ab383 MFC: rev 1.11 2000-03-30 08:10:38 +00:00
Yoshinobu Inoue 80b6b0e639 MFC: Prevent buffer overflow.
PR: bin/17657
Submitted by: tanimura
2000-03-30 07:14:52 +00:00
David E. O'Brien 657ef5b05a MFC: bring in GCC 2.95's libobjc codebase 2000-03-30 03:47:26 +00:00
David E. O'Brien 45a7f4e9eb MFC: rev. 1.10 (switch to 2.95 libobjc codebase) 2000-03-30 03:34:59 +00:00
cvs2svn 4f36945b70 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-30 03:23:39 +00:00
David E. O'Brien cbd5b25a26 MFC: GCC 2.95 libobjc bits 2000-03-30 02:50:18 +00:00
Bill Paul ecdc46edca MFC: close PR kern/17582, be more frugal about calling m_pullup(). 2000-03-29 20:08:33 +00:00
Bill Paul 26b6cfc406 Regen. 2000-03-29 19:58:29 +00:00
Bill Paul 0d6778e96f MFC: add new vendor/product IDs. 2000-03-29 19:56:24 +00:00
cvs2svn 58d5d7c030 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-29 14:32:35 +00:00
Yoshihiro Takahashi 735adc7764 MFC: Added the joy driver. 2000-03-29 12:24:15 +00:00
Joerg Wunsch c094c84082 MFC: add trailing newlines to the log() calls introduced in rev 1.64. 2000-03-29 07:52:50 +00:00
Chris Piazza 4600caf505 MFC: rev 1.10, export host 2000-03-29 07:11:29 +00:00
Chris Piazza 4f4dc46f11 MFC: rev 1.157, geforce2 and quadro2 2000-03-29 06:56:04 +00:00
David Greenman 1602dc778b Merged changes from rev 1.78 (if_fxp.c) and 1.10 (if_fxpvar.h): fixes
to support certain larger SEEPROMs.
2000-03-29 02:02:39 +00:00
Yoshinobu Inoue 72ea016eb2 MFC:
use CMSG_LEN() to compute ping SCM_TIMESTAMP cmsg_len.
Without this, cmsg_len size should be smaller than necessary on alpha.
2000-03-28 18:04:16 +00:00
Yoshinobu Inoue 786548060c MFC:
Don't suppress Flags and Refs info for IPv4 entries.
(They need to be suppressed by default for IPv6 entries to keep the column
size of each entries in 80.)
2000-03-28 16:56:34 +00:00
Yoshinobu Inoue 7c1ac0f2e4 MFC: Wording fixes and mdoc fixes. 2000-03-28 16:44:48 +00:00
Sheldon Hearn 25b3732189 MFC rev 1.13: Back out the new advice introduced in the previous commit. 2000-03-28 15:56:22 +00:00
Yoshihiro Takahashi e04c32e724 Sync with sys/i386/i386/machdep.c revision 1.385.2.1. 2000-03-28 12:30:05 +00:00
Sheldon Hearn 74035caef8 MFC: Update instructions for setting dumpdev before going multi-user. 2000-03-28 09:34:14 +00:00
Sheldon Hearn 79f416473f MFC: Cross-reference ldd(1) in rtld(1) and vice versa. 2000-03-28 09:04:19 +00:00
Matthew Dillon 5d52243319 MFC rc.network 1.75, rc.conf 1.55, rc.conf.5 1.65, nfs_socket.c 1.61.
Add sysctl and increase default receive udp buffer size from 2 to 4
    packets to improve client-side gigabit network performance.

Approved by: jkh
2000-03-27 21:39:53 +00:00
Matthew Dillon b6f20b870f MFC swap_pager.c 1.137, vm_pageout.c 1.54, vm_pager.h 1.25. Add
necessary spl protection.

Approved by: jkh
2000-03-27 21:34:45 +00:00
Matthew Dillon 4c96c22ad3 MFC buffer cache cleanup, geteblk fix. 2000-03-27 21:30:14 +00:00
Matt Jacob e9ee036b8e MFC: Alpha 8200 support 2000-03-27 18:33:14 +00:00
Matt Jacob fed8b895c1 MFC 1.112: Alpha 8200 support cleanup. 2000-03-27 18:31:48 +00:00
Bill Fumerola 07544e75bc MFC: Remove evidence that these files were copied from standard-supfile 2000-03-27 18:31:30 +00:00
Matt Jacob c443d2144c MFC: Changes for alpha 8200 support- increased resourc width for 'IRQ'
resources. Protection against having ISA code on platforms with no ISA bus
support.
2000-03-27 18:31:01 +00:00
Matt Jacob e43b81f846 MFC: Alpha 8200 support. 2000-03-27 18:29:55 +00:00
Matt Jacob e7dffd3105 MFC: Add prototype from promcnattach. 2000-03-27 18:29:34 +00:00
Matt Jacob e9a81f4378 MFC : support TurboLaser (AlphaServer 8X00). 2000-03-27 18:28:44 +00:00
Matt Jacob 1ef1874d8f MFC 1.16: Redo prom console code to be more correct. 2000-03-27 18:27:23 +00:00
Matt Jacob 82976da065 MFC 1.10: Redo console attachment code. Make sure halt function does
what it's supposed to.
2000-03-27 18:26:32 +00:00
Matt Jacob bc30cc731e MFC 1.6: We have a real zs_cnattach now. 2000-03-27 18:25:50 +00:00
Matt Jacob 93c58c517b MFC 1.142: Use current alpha platform to know how many bits to allocate
for a hose number.
2000-03-27 18:23:34 +00:00
John Baldwin 0708736496 MFC: STAILQ example fix. 2000-03-27 13:33:08 +00:00
Sheldon Hearn 6410c81d68 Fix a mistake in the previous commit on this branch. 2000-03-27 10:52:05 +00:00
Kris Kennaway e2b1107c58 MFC: Update CFLAGS documentation 2000-03-27 02:53:20 +00:00
David E. O'Brien 93fae68b82 MFS: Add a "magic" comment to help fixincludes realize it doesn't need to
modify this file when building GCC 2.96 [by hand or via the port].

Submitted by: Zack Weinberg <[email protected]>
2000-03-27 02:03:35 +00:00
Dag-Erling Smørgrav afce374225 MFC: s/curproc/self/ 2000-03-26 12:23:36 +00:00
John Baldwin c0f9b1dc1a MFC: Spelling fix and rewording. 2000-03-25 22:09:59 +00:00
Dag-Erling Smørgrav 3ebd4784d7 MFC: attempt to provide real values for meminfo. 2000-03-25 19:41:53 +00:00
Dag-Erling Smørgrav c9fdde545a MFC: man page for linprocfs. 2000-03-25 14:05:12 +00:00
cvs2svn 0612667471 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-25 14:03:32 +00:00
Dag-Erling Smørgrav e15d9354d1 MFC: mention linprocfs. 2000-03-25 13:47:45 +00:00
Dag-Erling Smørgrav f0dfca3a7c MFC: mount_linprocfs. 2000-03-25 13:43:17 +00:00
Dag-Erling Smørgrav 6d8114ac20 MFC: Linux /proc filesystem. 2000-03-25 13:43:11 +00:00
cvs2svn 3a11988a9b This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-25 13:23:03 +00:00
Kris Kennaway afee369a88 MFC: Update openssl handbook pointer 2000-03-25 07:31:27 +00:00
Satoshi Asami 840fb64165 Merge 1.10. 2000-03-25 00:01:34 +00:00
Jeroen Ruigrok van der Werven c4c6c339b7 MF5C: Fix spelling error. 2000-03-24 21:04:57 +00:00
Sheldon Hearn 56a43a65e8 MFC rev 1.4: Miscellaneous fixes. 2000-03-24 07:47:05 +00:00
Kris Kennaway 5bdf93e090 MFC: NO_X 2000-03-24 07:45:24 +00:00
Sheldon Hearn 8bf8ce58ac MFC rev 1.5: Miscellaneous fixes. 2000-03-24 07:44:18 +00:00
Kris Kennaway 56955b4502 MFC: NO_X knob 2000-03-24 07:39:04 +00:00
Michael Haro f79a7f6916 MFC: 1.18 fix bug with du -hd 2000-03-24 06:28:55 +00:00
Matthew Dillon 830e40d62c MFC 1.61 - fix in-kernel infinite loop in pipe_write() when reader goes
away at just the wrong moment.
2000-03-24 00:48:13 +00:00
Matthew Dillon 4c2800ded2 MFC 1.66, fix NULL pointer dereference panic when dealing with ARP
packets (probably runts) which straddle an mbuf.
2000-03-23 19:00:58 +00:00
Bruce Evans f843751d69 MFC (1.17: fixed my breakage of SPLASSERT() in rev.1.15). 2000-03-23 18:51:54 +00:00
Sheldon Hearn f6e07ddb89 MFC rev 1.4 and rev 1.5: Miscellaneous fixes. 2000-03-23 12:07:32 +00:00
Warner Losh c840113576 Fix typos. Rearrange a little. Keep the obsolete stuff at the end of
the file, but put the common items before them.

This should be fairly close to reality now.
2000-03-23 05:58:28 +00:00
Brian Feldman 183eeae102 MFC:
in6_pcb.c:
	Remove a bogus (redundant, just weird, etc.) key_freeso(so).
	There are no consumers of it now, nor does it seem there
	ever will be.

in6?_pcb.c:
	Add an if (inp->in6?p_sp != NULL) before the call to
	ipsec[46]_delete_pcbpolicy(inp).  In low-memory conditions
	this can cause a crash because in6?_sp can be NULL...

Reviewed by:	shin
2000-03-23 04:36:57 +00:00
Sheldon Hearn 2abb019147 MFC rev 1.4: Fix IgnoreUserKnownHosts. 2000-03-22 09:38:44 +00:00
Yoshihiro Takahashi 86d9039fb7 MFC: Increment number of retries before giving up. 2000-03-22 03:36:45 +00:00
Warner Losh 52da92f406 minor mods and BUILD_KERBEROS4 issues 2000-03-22 01:24:11 +00:00
Jason Evans 5cf73ea62e MFC: Fix pthread_suspend_np()/pthread_resume_np(). 2000-03-22 01:19:17 +00:00
Jordan K. Hubbard 59367397fc MFC: adapt to crypto dist. 2000-03-21 19:16:12 +00:00
cvs2svn 300bf3fa50 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-21 19:13:32 +00:00
Jeroen Ruigrok van der Werven be11ac7223 MF5C: Don't Xr interfaces which are built upon oneself. 2000-03-21 17:33:05 +00:00
Kazutaka YOKOTA 2470a988fd MFC: add support for more mice (rev 1.39, 1.40). 2000-03-21 14:46:00 +00:00
Kazutaka YOKOTA f1819d1cc6 MFC: add support for more mice (psm.c 1.24, i386/include/mouse.h 1.16,
alpha/include/mouse.h 1.17, atkbdcreg.h 1.5).
2000-03-21 14:44:12 +00:00
Jeroen Ruigrok van der Werven d22aa59955 MF5C: various fixes. 2000-03-21 13:43:03 +00:00
Luigi Rizzo 8c8f63e6d7 MFC: properly print interface name 2000-03-21 13:39:03 +00:00
Jeroen Ruigrok van der Werven a2072fc5cc Follow bde's example and install KASSERT.9. 2000-03-21 13:00:04 +00:00
Jason Evans 67be10ef73 MFC: Add a man page for aio_waitcomplete(). Update aio_cancel() to reflect
new functionality.
2000-03-21 11:21:19 +00:00
cvs2svn ce7d1eb491 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-21 10:25:23 +00:00
Brian Somers a8f574395c MFC:
Understand environment variables in commands
  Understand IP6 addresses in ``show route''
  Correct an alignment bug in ``show route''
  Add the ``resolv'' command
  Add ``dns'' logging
  Rename struct descriptor -> struct fdescriptor
  Fix some printf-style parameter-type bugs
  Use <nnn> instead of <???> when something's not understood
  Log (debug) information about incoming fragment handling
  Correct two bugs in the timer code
  Add some {Net,Open}BSD compatibility stuff
  Fix some gramar and line breaks in ppp.8

Requested by: peter
2000-03-21 10:23:20 +00:00
Paul Saab 9fc98f3380 MFC: Add sysctl kern.coredump 2000-03-21 07:12:17 +00:00
Paul Saab 950f73b33d MFC: Make SPLASSERT sysctl and boot time tunable with kern.splassertmode. 2000-03-21 06:05:36 +00:00
Paul Saab 8bfdee54b9 MFC: 1.112 Add conditional splassert. 2000-03-21 06:03:47 +00:00
Warner Losh 6c5826fb40 MFC: 1.175 1.176: remove check against valid OUIs for Linksys 2000-03-20 23:49:22 +00:00
Peter Wemm 615904db16 MFC: teach .Os and .Fx about 4.1 and 5.0 2000-03-20 23:40:45 +00:00
Brian Feldman f9dec630bb Make memcontrol(8) able to delete the segments starting at a base of 0
which it can create..
2000-03-20 22:53:32 +00:00
Bill Fumerola b486cfcc69 MFC: rev1.54 (syslogd -s) 2000-03-20 20:08:41 +00:00
Guido van Rooij e9224e67a0 MFC: add -L option to usage() 2000-03-20 18:33:52 +00:00
Yoshihiro Takahashi b4d329f87b MFC: Fixed style bugs. 2000-03-20 14:53:26 +00:00
Sheldon Hearn 95cf6f3e27 MFC rev 1.13: Move an Nm from the middle of a sentence onto its own
line.
2000-03-20 14:20:13 +00:00
Kazutaka YOKOTA 04f49fec44 MFC: White-space-only change. The file originally had screwed indentation.
(rev 1.5).
2000-03-20 14:00:55 +00:00
Kazutaka YOKOTA 9704564693 MFC: Fix bugs when painting border and the mouse cursor in the raster
text mode (rev 1.6).
2000-03-20 13:59:55 +00:00
Kazutaka YOKOTA 68dfb4c2e3 MFC: `Newbus'ified the driver (mse.c 1.50, isa_compat.h 1.32). 2000-03-20 13:58:48 +00:00
Sheldon Hearn 6bb94d58e1 MFC rev 1.13: Remove once again the erroneous xref to ld.so(1). 2000-03-20 13:32:22 +00:00
Peter Wemm 54c4f2d131 MFC rev 1.3; do not abort on unexpected packets 2000-03-20 13:03:01 +00:00
Peter Wemm 3c4cf1d028 MFC: fix a bad regexp that failed on valid names. 2000-03-20 13:00:36 +00:00
Peter Wemm aa1607ad5a MFC rev 1.8; use snprintf instead of sprintf 2000-03-20 12:52:37 +00:00
Peter Wemm 1768cb447b MFC rev 1.5; unicast/multicast correction 2000-03-20 12:50:46 +00:00
Peter Wemm f369721a98 MFC: spelling error 2000-03-20 12:36:46 +00:00
Peter Wemm 2d5f671f95 MFC: .Xr formatting 2000-03-20 12:35:06 +00:00
Peter Wemm 971a0063d6 MFC: doc update for -I 2000-03-20 12:33:15 +00:00
Peter Wemm 0f46afe406 MFC: typo/spelling fix in a visible printf() 2000-03-20 12:31:24 +00:00
Peter Wemm fa309c5d17 MFC: remove stray -DINTERNAL_LS 2000-03-20 12:30:05 +00:00
Peter Wemm e5de00b39f MFC part of 1.37; fix typo in statement: "var | flag;" -> "var |= flag;" 2000-03-20 12:28:40 +00:00
Peter Wemm a41787837f MFC rev 1.6; deal with cue devices as well 2000-03-20 12:24:56 +00:00
Peter Wemm 16f9a9769a MFC up to rev 1.93; sort; camcontrol rescan on aic insertionl new card. 2000-03-20 12:23:48 +00:00
Peter Wemm ac4831e4b9 MFC: fix tags 2000-03-20 12:21:05 +00:00
Yoshihiro Takahashi c29f820217 Sync with sys/i386/isa/isa_compat.h revision 1.27.2.1 and 1.27.2.2. 2000-03-20 12:19:46 +00:00
Sheldon Hearn fc21f54156 MFC rev 1.4: assocation -> association 2000-03-20 12:07:27 +00:00
Sheldon Hearn eff80b32fb MFC rev 1.3: Fix flag description list for the disable command. 2000-03-20 11:52:30 +00:00
Martin Cracauer 03c6fe5078 MFC: Exchange FPE_INTDIV and FPE_INTOVF for 3.x compatibility. 2000-03-20 10:27:52 +00:00
Peter Wemm 736d87d799 MFC: newbusify if_de 2000-03-20 09:44:18 +00:00
Jordan K. Hubbard 6dd217fb64 put us back on 4-stable 2000-03-20 08:48:25 +00:00
Jordan K. Hubbard ce9e2834a9 Temporary go to -release again 2000-03-20 08:47:52 +00:00
Jordan K. Hubbard f3031dc1dd Now we're in 4-STABLE 2000-03-20 08:46:02 +00:00
Jordan K. Hubbard e4a9126488 Whoops, fix a typo while I'm at it. 2000-03-20 08:45:25 +00:00
Jordan K. Hubbard 9d0c327b80 Bump ahead for release re-roll. Soren's ATA bug fix (2 devices on
one channel croak) makes this pretty necessary, so I'm re-rolling 4.0
(gack, spit, pft).
2000-03-20 08:43:54 +00:00
Paul Saab 99987baa90 MFC: 1.29 Make savecore understand only char devs exsist. 2000-03-20 08:21:30 +00:00
Peter Wemm 2e6ad5be75 MFC: this file was repo copied to sys/dev/advansys and should have gone. 2000-03-20 07:22:21 +00:00
Patrick S. Gardella e1932339b5 MF5C: Remove "conflicts" from kernel config files for picobsd.
PR:	17383
Submitted by:	 Kelly Yancey <[email protected]>
2000-03-19 19:41:04 +00:00
Brian Feldman 4f6fa01059 2"5MFC: Correctly fill the mask from the left, not the right. 2000-03-19 19:30:46 +00:00
Nick Hibma 96609c47d4 Add the ID for the SiS 5571 OHCI controller.
Remove the use of device_t parent. We can do the same thing without it.
2000-03-19 15:46:32 +00:00
Larry Lile bc2d30eea4 o MFC: Fix typo in the RapidFire 3540 adapter name
4/16/100 -> 100/16/4 so that it matches all of the others.

o MFC: Since we went to all the trouble of getting the correct
  working memory size actually use it.

* Submitted by: Nikolai Saoukh <[email protected]>
2000-03-19 15:10:35 +00:00
Jeroen Ruigrok van der Werven f7816bb405 MF5C: rev 1.3: fix name, add address 2000-03-19 14:51:20 +00:00
Jeroen Ruigrok van der Werven c1cd36ab9c MF5C: add device isic to ASUSCOM_IPAC
get rid of some quotes in i4b options
2000-03-19 10:26:40 +00:00
Yoshihiro Takahashi 124f186245 MFC: Fixed to probe extended memory. 2000-03-19 08:12:10 +00:00
Yoshihiro Takahashi c2e1ffd0a0 MFC: Changed key assign for PC-98. 2000-03-19 08:07:41 +00:00
Yoshihiro Takahashi 668324cf66 MFC: Fixed to support old parallel interface. 2000-03-19 08:05:54 +00:00
Robert Watson 669276e349 MFC: support for BIOC[GS]SEESENT ioctl and bd_seesent BPF descriptor flag
Commit message from -CURRENT:
  rwatson     2000/03/17 22:30:43 PST

  Introduce a new bd_seesent flag to the BPF descriptor, indicating whether or
  not the current BPF device should report locally generated packets or not.
  This allows sniffing applications to see only packets that are not generated
  locally, which can be useful for debugging bridging problems, or other
  situations where MAC addresses are not sufficient to identify locally
  sourced packets.  Default to true for this flag, so as to provide existing
  behavior by default.

  Introduce two new ioctls, BIOCGSEESENT and BIOCSSEESENT, which may be used
  to manipulate this flag from userland, given appropriate privilege.

  Modify bpf.4 to document these two new ioctl arguments.

  Reviewed by:  asmodai

  Revision  Changes    Path
  1.22      +9 -1      src/share/man/man4/bpf.4
  1.60      +20 -1     src/sys/net/bpf.c
  1.22      +3 -1      src/sys/net/bpf.h
  1.15      +2 -1      src/sys/net/bpfdesc.h
2000-03-19 05:55:36 +00:00
Chris Costello a842bcdbae MFC: In vn_isdisk(), return ENXIO if vp->v_rdev is NULL before passing that
pointer to anything else.
2000-03-19 02:49:26 +00:00
Larry Lile 60fffa9c54 MFC: New-bus Olicom driver
o Replace the old "oltr" driver with the completely re-written
  new-bus Olicom driver, previously known as "ol".  The new
  driver unfortunately does not support ISA cards yet.

o Update the microcode files, interface library and include files
  to the latest PowerMACH works version.  Force even byte alignment
  of adapter microcode.

o Roll in some of the patches from Nikolai Saoukh <[email protected]>.

* Approved by: Jordan K. Hubbard <[email protected]>
2000-03-19 00:32:42 +00:00
Jason Evans c6015fe000 MFC: Use __alias__ instead of alias in the definition of __strong_reference(). 2000-03-18 23:30:03 +00:00
Jason Evans 68e0539770 MFC: Define the _POSIX_SEMAPHORES feature flag. 2000-03-18 23:20:12 +00:00
Jason Evans 058b24af1b MFC: For libc_r, do not create both weak and strong symbols of the same
name.
2000-03-18 23:13:29 +00:00
Justin T. Gibbs 57606b34c8 MFC: aic7xxx.c Rev 1.42
aic7xxx.reg Rev 1.20
     aic7xxx.seq Rev 1.94
2000-03-18 23:00:13 +00:00
Justin T. Gibbs c4c452a332 MFC: Rev 1.30 2000-03-18 22:57:48 +00:00
Justin T. Gibbs fbbd81efbd MFC: Rev 1.23 2000-03-18 22:56:55 +00:00
Bill Paul a1ebc84878 MFC: add vendor/device code for yet another KLSI-based USB ethernet adapter. 2000-03-18 22:27:09 +00:00
Søren Schmidt 6bcb381c5c Remove the old DSC code, it doesn't work anymore. 2000-03-18 22:26:29 +00:00
Bill Paul a06bbaf476 MFC: update Tigon firmware to 12.3.20. 2000-03-18 22:26:06 +00:00
Jeroen Ruigrok van der Werven 47412d7cb6 MF5C: rev 1.61 of Makefile: install SPLASSERT manpage
rev 1.2 of SPLASSERT.9:	various small fixes
2000-03-18 21:54:34 +00:00
Jordan K. Hubbard 0753948cf0 MFC: rsaref back-out 2000-03-18 20:13:47 +00:00
Jeroen Ruigrok van der Werven ba8dcfc8f7 MF5C: Put the ASUSCOM entry where it belongs. 2000-03-18 19:53:51 +00:00
Jeroen Ruigrok van der Werven b7b695a389 MF5C: Put undocumented options back at the bottom.
Put debug options abve the undocumented ones.
2000-03-18 19:04:43 +00:00
Jeroen Ruigrok van der Werven f66055e511 MF5C: rev 1.754:
document npx, vfs lock and bus debugging options.
2000-03-18 18:12:33 +00:00
Bill Fenner 4c1d243906 MFC 1.59: free the socket in soabort() if the protocol couldn't. 2000-03-18 08:58:13 +00:00
Jordan K. Hubbard 9849d03ef9 MFC: reintroduce hack for rsaref package 2000-03-18 08:45:35 +00:00
Jordan K. Hubbard 48c884b741 MFC: DTRT with local distribtion 2000-03-18 08:39:45 +00:00
Jordan K. Hubbard 81f0479643 MFC: update to match current reality. 2000-03-18 08:05:56 +00:00
Jordan K. Hubbard 7a351c2158 MFC: make the "can't find an rsafoo package" messages more informative. 2000-03-18 07:20:16 +00:00
Jordan K. Hubbard 9bd1ae9fb0 MFC: update for 4.0 (albeit a bit late)
Submitted by:	[email protected]
PR:		17446
2000-03-18 06:38:47 +00:00
Jordan K. Hubbard 64f71965f8 MFC: update for 4.0 (albeit a bit late)
PR:		17446
2000-03-18 06:38:27 +00:00
Chris Piazza 38896db6e0 MFC 1.253, update australian ntp server 2000-03-18 02:58:59 +00:00
Mike Smith aa1089befb MFC: updates to the Mylex driver:
- support for 2.x firmware
 - support for firmware initialisation
 - command passthrough interface
2000-03-18 02:03:12 +00:00
Peter Wemm c1c4a981d5 MFC: fix RC misspelling, loran fast intrs 2000-03-18 00:01:04 +00:00
Peter Wemm c7983acd36 MFC: make irq's shareable 2000-03-17 23:58:20 +00:00
Peter Wemm 17ad08f628 MFC: add linksys OUI 2000-03-17 23:52:23 +00:00
Peter Wemm ee012037df MFC: reserve major 1.43 for urio 2000-03-17 22:42:48 +00:00
Peter Wemm 080027799d MFC: typo fix; 0x0x1E -> 0x1E 2000-03-17 22:41:06 +00:00
Peter Wemm fd8f951e5a MFC: round low transfer rates correctly 2000-03-17 22:39:59 +00:00
Peter Wemm 409febc1e4 MFC: spelling/typo fixes 2000-03-17 22:38:29 +00:00
Peter Wemm f80c667d6e MFC: remove #ifdef UVM 2000-03-17 22:32:56 +00:00
Bill Fumerola 92b1a58036 We are now 4.0-STABLE, bump the version number. 2000-03-17 16:45:55 +00:00
Andrey A. Chernov c2c85a945d MFC: Tremon mouse 2000-03-17 16:37:45 +00:00
Yoshihiro Takahashi 4e06750dce Sync with sys/boot/i386/libi386/biosdisk.c revision 1.26.2.1. 2000-03-17 12:52:31 +00:00
Yoshihiro Takahashi 0794517534 Sync with sys/i386/i386/userconfig.c revision 1.175 and 1.175.2.1. 2000-03-17 12:27:07 +00:00
Yoshihiro Takahashi 60700b4ae6 Backed out ppc0 flags addtion. 2000-03-17 11:37:41 +00:00
Paul Saab a74d39ef0c MFC: Remove MAX_PERF with extreme prejudice. 2000-03-17 10:47:36 +00:00
Paul Saab 76ff782b6f MFC: 1.250 Don't try so hard to make the lower 16 bits of fsids unique. 2000-03-17 10:22:17 +00:00
Paul Saab 14dd88494c MFC: 1.65 Print "previous type" correctly when INVARIANTS is defined. 2000-03-17 10:17:04 +00:00
Paul Saab 839fcf5634 MFC: 1.15 Use 64-bit math for freespace limit calculation. 2000-03-17 10:13:44 +00:00
Paul Saab d5bd67f7a9 MFC: ufs_bmap.c 1.35, ufs_lookup.c 1.34
Bug fixes for currently harmless bugs that could rise to bite the
unwary if the code were called in slightly different ways.
[ufs_bmaparray(), ufs_lookup()]
2000-03-17 10:12:15 +00:00
Chris Costello 545d727e69 MFC: Make `struct vattr *' variable names consistent (vpp->vap). 2000-03-16 22:47:03 +00:00
John Baldwin b07f02d67c MFC the loader bcache fixes.
Submitted by:	dcs
2000-03-16 18:13:37 +00:00
Yoshihiro Takahashi 1992c65515 MFC: Added 'flags 0x40' to ppc0. 2000-03-16 12:04:36 +00:00
Yoshihiro Takahashi 4cfe404eca MFC: Changed sio1 flags to 0x12000010 to enable serial console. 2000-03-16 11:54:31 +00:00
Kris Kennaway 41e117588f MFC: Fix build for NOCLEAN/NOSECURE/make release/ad infinitum :) 2000-03-16 08:47:03 +00:00
Paul Saab 6d450870fc MFC: 1.65
Use 64-bit math to decide if optimization needs to be changed.
Kirk also made structural changes, which he did not mention in the
previous commit.  Merge those as well.
2000-03-16 08:15:53 +00:00
Mike Smith b635c6b302 MFC: shorten some over-long strings 2000-03-15 21:25:35 +00:00
Sheldon Hearn 8bdb41562a MFC rev 1.17: Warn against using 3c509 in EISA mode on non-EISA systems. 2000-03-15 20:54:33 +00:00
Archie Cobbs 3ffb365ac0 MFC: (rev. 1.45) have MGETHDR() always initialize m->m_pkthdr.rcvif 2000-03-15 19:39:33 +00:00
Jonathan Lemon 67ea6a3b98 Merge rev 1.7, uninitialized variable fix. 2000-03-15 15:07:35 +00:00
Sheldon Hearn c4c4a69a45 MFC rev 1.41: Fix post-creation cleanup bug. 2000-03-15 09:36:07 +00:00
Jordan K. Hubbard eff15831c0 post-release versions 2000-03-15 08:58:45 +00:00
Jordan K. Hubbard 4641e28c8f whoops, better late than never; update the release notes 2000-03-15 08:56:45 +00:00
Brian Feldman 6261970fb0 MFC: rev.1.16, crash on read() of lpctlX fix 2000-03-15 03:28:53 +00:00
Ruslan Ermilov 0a7d464a50 MFC: (rev 1.132) Fix logging of src and dst IP addresses. 2000-03-14 20:35:20 +00:00
Søren Schmidt d281aade56 MFC: make disksort do what its supposed to. 2000-03-14 20:25:13 +00:00
Jordan K. Hubbard 3bc3e3e7a0 Add the -release check
Submitted by:	billf
2000-03-14 18:15:46 +00:00
Guy Helmer 882a774068 MFC: parsing @ shortcuts, setting hour bitmap for @hourly shortcut. 2000-03-14 14:55:59 +00:00
Sheldon Hearn 629f6b0bf2 MFC rev 1.8: Formalize the option descriptions. 2000-03-14 10:57:08 +00:00
Sheldon Hearn e1a24d8124 MFC rev 1.11: Cope with quotes around font names in /etc/rc.conf . 2000-03-14 09:31:27 +00:00
Sheldon Hearn 98fe3299b5 MFC rev 1.12: Allow tunefs -p on mounted filesystems. 2000-03-14 09:16:28 +00:00
Jordan K. Hubbard 3536cebfe7 post-release, we're 4.0-stable 2000-03-14 08:30:41 +00:00
Jordan K. Hubbard 8059c08edf 4.0-RELEASE 2000-03-14 06:01:18 +00:00
Kris Kennaway 636e8b707b MFC: Allow detection of RSAREF and use it to provide a more verbose
error message when openssh fails from a >1024 bit key.

Approved by:	jkh
2000-03-13 23:07:57 +00:00
Sheldon Hearn 8d89ba84f2 MFC rev 1.13: Back out previous commit. 2000-03-13 19:32:12 +00:00
Daniel C. Sobral 360c01d3ff MFC. 2000-03-13 19:26:08 +00:00
Jordan K. Hubbard 1518f96ea4 MFC: 1.251 2000-03-13 18:24:18 +00:00
Bill Fumerola a52267f5d2 __FreeBSD_version++;
Approved by:	"<jkh> bfumerola: go bump it yourself"
2000-03-13 17:53:55 +00:00
cvs2svn 11d9599263 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-13 17:31:46 +00:00
Jeroen Ruigrok van der Werven 48d99c98a4 MFC: 1.7 and 1.8 2000-03-13 13:44:03 +00:00
Jordan K. Hubbard 0b079fd92f MFC: 1.61 2000-03-13 09:17:32 +00:00
cvs2svn 842f308487 This commit was manufactured by cvs2svn to create branch 'RELENG_4'. 2000-03-13 04:59:44 +00:00
6380 changed files with 625561 additions and 853215 deletions

No files matched your search

+9 -6
View File
@@ -338,7 +338,7 @@ reinstall:
# be set to cross-build, we have to make sure MACHINE is set
# properly.
KERNEL?= GENERIC GENERIC98
KERNEL?= GENERIC
# The only exotic MACHINE_ARCH/MACHINE combination valid at this
# time is i386/pc98. In all other cases set MACHINE equal to
@@ -378,14 +378,16 @@ buildkernel:
@echo "--------------------------------------------------------------"
.for _kernel in ${BUILDKERNELS}
@echo "===> ${_kernel}"
mkdir -p ${KRNLOBJDIR}
cd ${KRNLCONFDIR}; \
PATH=${TMPPATH} \
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} ${_kernel}
cd ${KRNLOBJDIR}/${_kernel}; \
MAKESRCPATH=${KRNLSRCDIR}/dev/aic7xxx \
${MAKE} -f ${KRNLSRCDIR}/dev/aic7xxx/Makefile; \
${WMAKEENV} MACHINE=${MACHINE} ${MAKE} depend; \
${WMAKEENV} MACHINE=${MACHINE} ${MAKE} all
${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
${MAKE} depend; \
${WMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} ${MAKE} all
.endfor
#
@@ -395,7 +397,8 @@ buildkernel:
#
installkernel:
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${IMAKEENV} MACHINE=${MACHINE} ${MAKE} install
${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
${MAKE} install
#
# update
@@ -425,7 +428,7 @@ update:
@echo "--------------------------------------------------------------"
@echo ">>> Updating ${.CURDIR} from cvs repository" ${CVSROOT}
@echo "--------------------------------------------------------------"
cd ${.CURDIR}; cvs -q update -P -d
cd ${.CURDIR}; cvs -q update -rRELENG_4 -P -d
.endif
#
@@ -485,7 +488,7 @@ _strfile= games/fortune/strfile
bootstrap-tools:
.for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef usr.sbin/config \
gnu/usr.bin/texinfo
gnu/usr.bin/gperf gnu/usr.bin/texinfo
cd ${.CURDIR}/${_tool}; \
${MAKE} obj; \
${MAKE} depend; \
+123 -54
View File
@@ -1,9 +1,128 @@
Updating Information for FreeBSD current users
Updating Information for FreeBSD STABLE users
This file is maintained by [email protected]. Please send new entries
directly to him. See end of file for further details. For commonly
done items, please see the end of the file. Search for 'COMMON
ITEMS:'
directly to him. See end of file for further details. A reverse
chronology since 4.0 was released is included, followed by the common
items quick how-tos, followed by entries for versions of -current
prior to 4.0 Release.
20000724:
FreeBSD 4.1 Released on or about this date.
20000711:
If you use CVSUP or CTM to get CVS trees, AND you used to get
the old crypto files from internat.freebsd.org AND you check
out files from the CVS tree with the cvs command, please read
http://people.freebsd.org/~imp/internat.txt
for details on potential problems that you might have and how
to get around them.
If you are merely a mirror, or don't answer yes to each of the
clauses above, you needn't worry.
20000706:
Binutils were updated. In order to build a kernel after this
date, you must follow the updating procedure for building
kernels exactly as presented here. You may be able to get away
with doing it the old way, but if it breaks, make sure that you've
tried the "To build a kernel" section with a fresh /usr/obj
first.
20000622:
The license on the softupdates is now a standard 2 clause
BSD license. You may need to remove your symbolic links
that used to be required when updating.
20000501:
At approximately this date, an incompatible kernel change
was made which means that if you update kernels accross
this boundary, you also have to update modules, and vice
versa.
20000315:
FreeBSD 4.0 RELEASE. Historical entries follow the common
items.
****************************** 4.0 RELEASE ******************************
COMMON ITEMS:
To build a kernel
-----------------
cd /usr/src
# If you have not already done so, please buildworld here
# You will also need to update your config file to 4.0. Usually
# people tend to start with GENERIC from 4.0 and hack from there.
make buildkernel KERNEL=<YOUR_KERNEL_HERE>
make installkernel KERNEL=<YOUR_KERNEL_HERE>
# Verify that the new kernel works, it will be installed as
# /YOUR_KERNEL_HERE
chflags noschg /kernel
chflags noschg /YOUR_KERNEL_HERE
mv /kernel /kernel.old
mv /YOUR_KERNEL_HERE /kernel
chflags schg /kernel
To rebuild disk /dev entries
----------------------------
MAKEDEV should be copied from src/etc/MAKEDEV to /dev before
starting the following:
For N in the list of disks
MAKEDEV N # eg ad0
for M in the list of slices
MAKEDEV NsMa # eg ad0s1a
To rebuild everything
---------------------
make world
Except when it doesn't work :-)
To update from 3.x to 4.0 stable
--------------------------------
<see notes below> [3]
cd /usr/src
<see notes below> [2]
make buildworld
<follow directions to build/install a kernel>
cd /usr/src/sys/modules
make install
cd /usr/src/sbin/mknod
make install
<follow rebuild disk /dev entries above> [1]
reboot
<in single user>
cd /usr/src
cd gnu/usr.bin/texinfo/install-info
make install
cd ../../../..
make installworld [5]
mergemaster [4]
reboot
<multi-user>
[1] You may need to switch from wd to ad ala 19991210
[2] If you have any of the following in your /etc/make.conf,
please comment them out before following these instructions
and then do a make buildworld + make installworld after you
are back to <multi-user> above:
MAKE_KERBEROS4
[3] Update to 4.0-stable sources. Make sure that you get all
the parts. If you are using cvsup files that are older than a
couple of months, be sure they have all the components listed
in /usr/share/examples/cvsup. Crypto and secure are now
required.
[4] This step is optional, but is generally a good idea. If
you wish to use many of the new features in 4.0, you must do
this anyway.
[5] If you get warnings from ld-elf.so that it cannot load
libc.so, run 'ldconfig -R /usr/obj/usr/src/lib/libc' and repeat
the installworld target.
What follows are older entries for those people upgrading from earlier
versions of -stable.
20000308:
The binary interface of perl to its modules changed. You
@@ -617,56 +736,6 @@ http://www.freebsd.org/cgi/getmsg.cgi?fetch=827400+0+current/freebsd-current
to silence warnings from authentication programs (login, etc).
See src/etc/pam.conf for a sample.
COMMON ITEMS:
To build a kernel
-----------------
Update config, genassym and go:
cd src/usr.bin/genassym
make depend all install clean
cd ../../usr.sbin/config
make depend all install clean
cd ../../sys/i386/conf
config YOUR_KERNEL_HERE
cd ../../compile/YOUR_KERNEL_HERE
make depend && make
make install
To rebuild disk /dev entries
----------------------------
MAKEDEV should be copied from src/etc/MAKEDEV to /dev before
starting the following:
For N in the list of disks
MAKEDEV N # eg ad0
for M in the list of slices
MAKEDEV NsMa # eg ad0s1a
To rebuild everything
---------------------
make world
Except when it doesn't work.
To update from 3.x to 4.0 stable
--------------------------------
cd /usr/src
make buildworld
cd sbin/mknod
make install
<follow directions to build/install a kernel>
<follow rebuild disk /dev entries above> [*]
reboot
<in single user>
cd /usr/src
make -DNOINFO installworld
make installworld
[*] You may need to switch from wd to ad ala 19991210
FORMAT:
This file contains a list, in reverse chronologocal order, of major
+4 -1
View File
@@ -5,7 +5,6 @@ SUBDIR= cat \
chio \
chmod \
cp \
csh \
date \
dd \
df \
@@ -31,6 +30,10 @@ SUBDIR= cat \
sync \
test
.if !defined(NO_TCSH)
SUBDIR+=csh
.endif
.if !defined(NO_SENDMAIL)
SUBDIR+=rmail
.endif
+81 -14
View File
@@ -37,14 +37,13 @@
.\"
.Dd May 2, 1995
.Dt CAT 1
.Os BSD 3
.Os
.Sh NAME
.Nm cat
.Nd concatenate and print files
.Sh SYNOPSIS
.Nm cat
.Op Fl benstuv
.Op Fl
.Op Ar
.Sh DESCRIPTION
The
@@ -52,8 +51,14 @@ The
utility reads files sequentially, writing them to the standard output.
The
.Ar file
operands are processed in command line order.
A single dash represents the standard input.
operands are processed in command-line order.
If
.Ar file
is a single dash
.Pq Sq \&-
or absent,
.Nm
reads from the standard input.
.Pp
The options are as follows:
.Bl -tag -width indent
@@ -94,30 +99,92 @@ characters (with the high bit set) are printed as
.Sh DIAGNOSTICS
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh BUGS
Because of the shell language mechanism used to perform output
redirection, the command
.Dq Li cat file1 file2 > file1
will cause the original data in file1 to be destroyed!
utility exits 0 on success or >0 if an error occurred.
.Sh EXAMPLES
The command:
.Bd -literal -offset indent
.Ic cat file1
.Ed
.Pp
will print the contents of
.Ar file1
to the standard output.
.Pp
The command:
.Bd -literal -offset indent
.Ic cat file1 file2 > file3
.Ed
.Pp
will sequentially print the contents of
.Ar file1
and
.Ar file2
to the file
.Ar file3 ,
truncating
.Ar file3
if it already exists.
See the manual page for your shell (i.e.,
.Xr sh 1 )
for more information on redirection.
.Pp
The command:
.Bd -literal -offset indent
.Ic cat file1 - file2 - file3
.Ed
.Pp
will print the contents of
.Ar file1 ,
print data it receives from the standard input until it receives an
.Dv EOF
.Pq Sq ^D
character, print the contents of
.Ar file2 ,
read and output contents of the standard input again, then finally output
the contents of
.Ar file3 .
Note that if the standard input referred to a file, the second dash
on the command-line would have no effect, since the entire contents of the file
would have already been read and printed by
.Nm
when it encountered the first
.Ql \&-
operand.
.Sh SEE ALSO
.Xr head 1 ,
.Xr more 1 ,
.Xr pr 1 ,
.Xr sh 1 ,
.Xr tail 1 ,
.Xr vis 1
.Xr vis 1 ,
.Xr setbuf 3
.Rs
.%A Rob Pike
.%T "UNIX Style, or cat -v Considered Harmful"
.%J "USENIX Summer Conference Proceedings"
.%D 1983
.Re
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.2-92
specification.
.Pp
The flags
.Op Fl benstv
are extensions to the specification.
.Sh HISTORY
A
.Nm
command appeared in Version 1 AT&T UNIX.
utility appeared in
.At v1 .
.An Dennis Ritchie
designed and wrote the first man page.
designed and wrote the first man page.
It appears to have been
.Xr cat 1 .
.Sh BUGS
Because of the shell language mechanism used to perform output
redirection, the command
.Dq Li cat file1 file2 > file1
will cause the original data in file1 to be destroyed!
+2 -2
View File
@@ -96,7 +96,7 @@ main(argc, argv)
tflag = vflag = 1; /* -t implies -v */
break;
case 'u':
setbuf(stdout, (char *)NULL);
setbuf(stdout, NULL);
break;
case 'v':
vflag = 1;
@@ -249,7 +249,7 @@ raw_cat(rfd)
err(1, "%s", filename);
bsize = MAX(sbuf.st_blksize, 1024);
if ((buf = malloc(bsize)) == NULL)
err(1, NULL);
err(1, "buffer");
}
while ((nr = read(rfd, buf, bsize)) > 0)
for (off = 0; nr; nr -= nw, off += nw)
-11
View File
@@ -1,11 +0,0 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
NOSHARED?=yes
PROG= chflags
CFLAGS+=-Wall
.PATH: ${.CURDIR}/../../lib/libc/gen
SRCS= chflags.c setflags.c
.include <bsd.prog.mk>
-138
View File
@@ -1,138 +0,0 @@
.\" Copyright (c) 1989, 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
.\" $FreeBSD$
.\"
.Dd May 2, 1995
.Dt CHFLAGS 1
.Os
.Sh NAME
.Nm chflags
.Nd change file flags
.Sh SYNOPSIS
.Nm chflags
.Oo
.Fl R
.Op Fl H | Fl L | Fl P
.Oc
.Ar flags
.Ar
.Sh DESCRIPTION
The
.Nm
utility modifies the file flags of the listed files
as specified by the
.Ar flags
operand.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl H
If the
.Fl R
option is specified, symbolic links on the command line are followed.
(Symbolic links encountered in the tree traversal are not followed.)
.It Fl L
If the
.Fl R
option is specified, all symbolic links are followed.
.It Fl P
If the
.Fl R
option is specified, no symbolic links are followed.
.It Fl R
Change the file flags for the file hierarchies rooted
in the files instead of just the files themselves.
.El
.Pp
Flags are a comma separated list of keywords.
The following keywords are currently defined:
.Bd -literal -offset indent compact
arch set the archived flag (super-user only)
opaque set the opaque flag (owner or super-user only)
nodump set the nodump flag (owner or super-user only)
sappnd set the system append-only flag (super-user only)
schg set the system immutable flag (super-user only)
sunlnk set the system undeletable flag (super-user only)
uappnd set the user append-only flag (owner or super-user only)
uchg set the user immutable flag (owner or super-user only)
uunlnk set the user undeletable flag (owner or super-user only)
archived, sappend, schange, simmutable, uappend, uchange, uimmutable,
sunlink, uunlink
aliases for the above
.Ed
.Pp
Putting the letters
.Dq no
before an option causes the flag to be turned off.
For example:
.Bd -literal -offset indent compact
nouchg the immutable bit should be cleared
.Ed
.Pp
Symbolic links do not have flags, so unless the
.Fl H
or
.Fl L
option is set,
.Nm
on a symbolic link always succeeds and has no effect.
The
.Fl H ,
.Fl L
and
.Fl P
options are ignored unless the
.Fl R
option is specified.
In addition, these options override each other and the
command's actions are determined by the last one specified.
.Pp
You can use "ls -lo" to see the flags of existing files.
.Sh DIAGNOSTICS
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr ls 1 ,
.Xr chflags 2 ,
.Xr stat 2 ,
.Xr fts 3 ,
.Xr symlink 7
.Sh HISTORY
The
.Nm
command first appeared in
.Bx 4.4 .
-185
View File
@@ -1,185 +0,0 @@
/*
* Copyright (c) 1992, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1992, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)chflags.c 8.5 (Berkeley) 4/1/94";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
#include <errno.h>
#include <fts.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
extern u_long setflags __P((char **, u_long *, u_long *));
void usage __P((void));
int
main(argc, argv)
int argc;
char *argv[];
{
FTS *ftsp;
FTSENT *p;
u_long clear, set;
long val;
int Hflag, Lflag, Pflag, Rflag, ch, fts_options, oct, rval;
char *flags, *ep;
Hflag = Lflag = Pflag = Rflag = 0;
while ((ch = getopt(argc, argv, "HLPR")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
Lflag = Pflag = 0;
break;
case 'L':
Lflag = 1;
Hflag = Pflag = 0;
break;
case 'P':
Pflag = 1;
Hflag = Lflag = 0;
break;
case 'R':
Rflag = 1;
break;
case '?':
default:
usage();
}
argv += optind;
argc -= optind;
if (argc < 2)
usage();
fts_options = FTS_PHYSICAL;
if (Rflag) {
if (Hflag)
fts_options |= FTS_COMFOLLOW;
if (Lflag) {
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
}
flags = *argv;
if (*flags >= '0' && *flags <= '7') {
errno = 0;
val = strtol(flags, &ep, 8);
if (val < 0)
errno = ERANGE;
if (errno)
err(1, "invalid flags: %s", flags);
if (*ep)
errx(1, "invalid flags: %s", flags);
set = val;
oct = 1;
} else {
if (setflags(&flags, &set, &clear))
errx(1, "invalid flag: %s", flags);
clear = ~clear;
oct = 0;
}
if ((ftsp = fts_open(++argv, fts_options , 0)) == NULL)
err(1, NULL);
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
switch (p->fts_info) {
case FTS_D:
if (Rflag) /* Change it at FTS_DP. */
continue;
fts_set(ftsp, p, FTS_SKIP);
break;
case FTS_DNR: /* Warn, chflag, continue. */
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_ERR: /* Warn, continue. */
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
continue;
case FTS_SL: /* Ignore. */
case FTS_SLNONE:
/*
* The only symlinks that end up here are ones that
* don't point to anything and ones that we found
* doing a physical walk.
*/
continue;
default:
break;
}
if (oct) {
if (!chflags(p->fts_accpath, set))
continue;
} else {
p->fts_statp->st_flags |= set;
p->fts_statp->st_flags &= clear;
if (!chflags(p->fts_accpath, p->fts_statp->st_flags))
continue;
}
warn("%s", p->fts_path);
rval = 1;
}
if (errno)
err(1, "fts_read");
exit(rval);
}
void
usage()
{
(void)fprintf(stderr,
"usage: chflags [-R [-H | -L | -P]] flags file ...\n");
exit(1);
}
+1 -1
View File
@@ -193,7 +193,7 @@ done: argv += optind;
}
if (chmod(p->fts_accpath, oct ? omode :
getmode(set, p->fts_statp->st_mode)) && !fflag) {
warn(p->fts_path);
warn("%s", p->fts_path);
rval = 1;
} else {
if (vflag)
+48 -14
View File
@@ -6,36 +6,70 @@
#
# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
TCSHDIR= ${.CURDIR}/../../contrib/tcsh
.PATH: ${TCSHDIR}
PROG= csh
DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
CFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
SRCS= alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
sem.c set.c str.c time.c const.h errnum.h
.PATH: ${.CURDIR}/../../usr.bin/printf
SUBDIR= nls
DFLAGS= -D_PATH_TCSHELL='"${DESTDIR}/bin/${PROG}"'
CFLAGS+= -I${TCSHDIR} -I${.CURDIR} -I. ${DFLAGS}
SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c sh.init.c \
sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c sh.sem.c \
sh.set.c sh.time.c sh.h sh.char.h sh.dir.h sh.proc.h
SRCS+= sh.decls.h glob.c glob.h mi.termios.c mi.wait.h mi.varargs.h
SRCS+= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
tw.comp.c tw.color.c
SRCS+= ed.chared.c ed.decls.h ed.defns.c ed.h ed.init.c ed.inputl.c \
ed.refresh.c ed.screen.c ed.xmap.c ed.term.c ed.term.h
SRCS+= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
tc.who.c tc.h
SRCS+= tc.defs.c
GENHDRS= ed.defns.h sh.err.h tc.const.h
SRCS+= ${GENHDRS}
MAN1= csh.1
MLINKS= csh.1 tcsh.1
# MLINKS for Shell built in commands for which there are no userland
# utilities of the same name are handled with the associated manpage,
# builtin.1 in share/man/man1/.
CLEANFILES+=const.h errnum.h
DPADD= ${LIBTERMCAP} ${LIBCRYPT}
LDADD= -ltermcap -lcrypt
const.h: errnum.h
LINKS= ${BINDIR}/csh ${BINDIR}/tcsh
errnum.h: err.c
CLEANFILES= ${GENHDRS} csh.1
csh.1: tcsh.man
ln -sf ${.ALLSRC} ${.TARGET}
ed.defns.h: ed.defns.c
@rm -f ${.TARGET}
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
@echo '#ifndef _h_sh_error' >> ${.TARGET}
@echo '#define _h_sh_error' >> ${.TARGET}
@echo '#ifndef _h_ed_defns' >> ${.TARGET}
@echo '#define _h_ed_defns' >> ${.TARGET}
grep '[FV]_' ${TCSHDIR}/ed.defns.c | grep '^#define' >> ${.TARGET}
@echo '#endif /* _h_ed_defns */' >> ${.TARGET}
sh.err.h: sh.err.c
@rm -f ${.TARGET}
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
@echo '#ifndef _h_sh_err' >> ${.TARGET}
@echo '#define _h_sh_err' >> ${.TARGET}
egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
@echo '#endif /* _h_sh_error */' >> ${.TARGET}
@echo '#endif /* _h_sh_err */' >> ${.TARGET}
const.h: const.c
tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h
@rm -f ${.TARGET}
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
${CC} -E ${CFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
@echo '#ifndef _h_tc_const' >> ${.TARGET}
@echo '#define _h_tc_const' >> ${.TARGET}
${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | egrep 'Char STR' | \
sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
sort >> ${.TARGET}
@echo '#endif /* _h_tc_const */' >> ${.TARGET}
.include <bsd.prog.mk>
-130
View File
@@ -1,130 +0,0 @@
/*-
* Copyright (c) 1983, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)alloc.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
char *memtop = NULL; /* PWP: top of current memory */
char *membot = NULL; /* PWP: bottom of allocatable memory */
ptr_t
Malloc(n)
size_t n;
{
ptr_t ptr;
if (membot == NULL)
memtop = membot = sbrk(0);
if ((ptr = malloc(n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
}
return (ptr);
}
ptr_t
Realloc(p, n)
ptr_t p;
size_t n;
{
ptr_t ptr;
if (membot == NULL)
memtop = membot = sbrk(0);
if ((ptr = realloc(p, n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
}
return (ptr);
}
ptr_t
Calloc(s, n)
size_t s, n;
{
ptr_t ptr;
if (membot == NULL)
memtop = membot = sbrk(0);
if ((ptr = calloc(s, n)) == (ptr_t) 0) {
child++;
stderror(ERR_NOMEM);
}
return (ptr);
}
void
Free(p)
ptr_t p;
{
if (p)
free(p);
}
/*
* mstats - print out statistics about malloc
*
* Prints two lines of numbers, one showing the length of the free list
* for each size category, the second showing the number of mallocs -
* frees for each size category.
*/
void
/*ARGSUSED*/
showall(v, t)
Char **v;
struct command *t;
{
memtop = (char *) sbrk(0);
(void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
(unsigned long) membot, (unsigned long) memtop,
(unsigned long) (memtop - membot));
}
-316
View File
@@ -1,316 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)char.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include "char.h"
unsigned short _cmap[256] = {
/* nul soh stx etx */
_CTR, _CTR, _CTR, _CTR,
/* eot enq ack bel */
_CTR, _CTR, _CTR, _CTR,
/* bs ht nl vt */
_CTR, _CTR|_SP|_META, _CTR|_NL|_META, _CTR,
/* np cr so si */
_CTR, _CTR, _CTR, _CTR,
/* dle dc1 dc2 dc3 */
_CTR, _CTR, _CTR, _CTR,
/* dc4 nak syn etb */
_CTR, _CTR, _CTR, _CTR,
/* can em sub esc */
_CTR, _CTR, _CTR, _CTR,
/* fs gs rs us */
_CTR, _CTR, _CTR, _CTR,
/* sp ! " # */
_SP|_META, 0, _QF, _META,
/* $ % & ' */
_DOL, 0, _META|_CMD, _QF,
/* ( ) * + */
_META|_CMD, _META, _GLOB, 0,
/* , - . / */
0, 0, 0, 0,
/* 0 1 2 3 */
_DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
/* 4 5 6 7 */
_DIG|_XD, _DIG|_XD, _DIG|_XD, _DIG|_XD,
/* 8 9 : ; */
_DIG|_XD, _DIG|_XD, 0, _META|_CMD,
/* < = > ? */
_META, 0, _META, _GLOB,
/* @ A B C */
0, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD,
/* D E F G */
_LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP|_XD, _LET|_UP,
/* H I J K */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* L M N O */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* P Q R S */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* T U V W */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* X Y Z [ */
_LET|_UP, _LET|_UP, _LET|_UP, _GLOB,
/* \ ] ^ _ */
_ESC, 0, 0, 0,
/* ` a b c */
_QB|_GLOB|_META, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD,
/* d e f g */
_LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW|_XD, _LET|_LOW,
/* h i j k */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* l m n o */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* p q r s */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* t u v w */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* x y z { */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _GLOB,
/* | } ~ del */
_META|_CMD, 0, 0, _CTR,
#if defined(SHORT_STRINGS) && !defined(KANJI)
/****************************************************************/
/* 128 - 255 The below is supposedly ISO 8859/1 */
/****************************************************************/
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* (undef) (undef) (undef) (undef) */
_CTR, _CTR, _CTR, _CTR,
/* nobreakspace exclamdown cent sterling */
_SP, 0, 0, 0,
/* currency yen brokenbar section */
0, 0, 0, 0,
/* diaeresis copyright ordfeminine guillemotleft */
0, 0, 0, 0,
/* notsign hyphen registered macron */
0, 0, 0, 0,
/* degree plusminus twosuperior threesuperior */
0, 0, 0, 0,
/* acute mu paragraph periodcentered */
0, 0, 0, 0,
/* cedilla onesuperior masculine guillemotright */
0, 0, 0, 0,
/* onequarter onehalf threequarters questiondown */
0, 0, 0, 0,
/* Agrave Aacute Acircumflex Atilde */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* Adiaeresis Aring AE Ccedilla */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* Egrave Eacute Ecircumflex Ediaeresis */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* Igrave Iacute Icircumflex Idiaeresis */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* ETH Ntilde Ograve Oacute */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* Ocircumflex Otilde Odiaeresis multiply */
_LET|_UP, _LET|_UP, _LET|_UP, 0,
/* Ooblique Ugrave Uacute Ucircumflex */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
/* Udiaeresis Yacute THORN ssharp */
_LET|_UP, _LET|_UP, _LET|_UP, _LET|_LOW,
/* agrave aacute acircumflex atilde */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* adiaeresis aring ae ccedilla */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* egrave eacute ecircumflex ediaeresis */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* igrave iacute icircumflex idiaeresis */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* eth ntilde ograve oacute */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* ocircumflex otilde odiaeresis division */
_LET|_LOW, _LET|_LOW, _LET|_LOW, 0,
/* oslash ugrave uacute ucircumflex */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
/* udiaeresis yacute thorn ydiaeresis */
_LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
#endif /* SHORT_STRINGS && !KANJI */
};
#ifndef NLS
/* _cmap_lower, _cmap_upper for ISO 8859/1 */
unsigned char _cmap_lower[256] = {
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137,
0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
0360, 0361, 0362, 0363, 0364, 0365, 0366, 0327,
0370, 0371, 0372, 0373, 0374, 0375, 0376, 0337,
0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377,
};
unsigned char _cmap_upper[256] = {
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177,
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
0320, 0321, 0322, 0323, 0324, 0325, 0326, 0367,
0330, 0331, 0332, 0333, 0334, 0335, 0336, 0377,
};
#endif /* NLS */
-97
View File
@@ -1,97 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)char.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
#include <ctype.h>
extern unsigned short _cmap[];
#ifndef NLS
extern unsigned char _cmap_lower[], _cmap_upper[];
#endif
#define _QF 0x0001 /* '" (Forward quotes) */
#define _QB 0x0002 /* ` (Backquote) */
#define _SP 0x0004 /* space and tab */
#define _NL 0x0008 /* \n */
#define _META 0x0010 /* lex meta characters, sp #'`";&<>()|\t\n */
#define _GLOB 0x0020 /* glob characters, *?{[` */
#define _ESC 0x0040 /* \ */
#define _DOL 0x0080 /* $ */
#define _DIG 0x0100 /* 0-9 */
#define _LET 0x0200 /* a-z, A-Z, _ */
#define _UP 0x0400 /* A-Z */
#define _LOW 0x0800 /* a-z */
#define _XD 0x1000 /* 0-9, a-f, A-F */
#define _CMD 0x2000 /* lex end of command chars, ;&(|` */
#define _CTR 0x4000 /* control */
#define cmap(c, bits) \
(((c) & QUOTE) ? 0 : (_cmap[(unsigned char)(c)] & (bits)))
#define isglob(c) cmap(c, _GLOB)
#define isspc(c) cmap(c, _SP)
#define ismeta(c) cmap(c, _META)
#define iscmdmeta(c) cmap(c, _CMD)
#define letter(c) (((c) & QUOTE) ? 0 : \
(isalpha((unsigned char) (c)) || (c) == '_'))
#define alnum(c) (((c) & QUOTE) ? 0 : \
(isalnum((unsigned char) (c)) || (c) == '_'))
#ifdef NLS
#define Isspace(c) (((c) & QUOTE) ? 0 : isspace((unsigned char) (c)))
#define Isdigit(c) (((c) & QUOTE) ? 0 : isdigit((unsigned char) (c)))
#define Isalpha(c) (((c) & QUOTE) ? 0 : isalpha((unsigned char) (c)))
#define Islower(c) (((c) & QUOTE) ? 0 : islower((unsigned char) (c)))
#define Isupper(c) (((c) & QUOTE) ? 0 : isupper((unsigned char) (c)))
#define Tolower(c) (((c) & QUOTE) ? 0 : tolower((unsigned char) (c)))
#define Toupper(c) (((c) & QUOTE) ? 0 : toupper((unsigned char) (c)))
#define Isxdigit(c) (((c) & QUOTE) ? 0 : isxdigit((unsigned char) (c)))
#define Isalnum(c) (((c) & QUOTE) ? 0 : isalnum((unsigned char) (c)))
#define Iscntrl(c) (((c) & QUOTE) ? 0 : iscntrl((unsigned char) (c)))
#define Isprint(c) (((c) & QUOTE) ? 0 : isprint((unsigned char) (c)))
#else
#define Isspace(c) cmap(c, _SP|_NL)
#define Isdigit(c) cmap(c, _DIG)
#define Isalpha(c) (cmap(c,_LET) && !(((c) & META) && AsciiOnly))
#define Islower(c) (cmap(c,_LOW) && !(((c) & META) && AsciiOnly))
#define Isupper(c) (cmap(c, _UP) && !(((c) & META) && AsciiOnly))
#define Tolower(c) (_cmap_lower[(unsigned char)(c)])
#define Toupper(c) (_cmap_upper[(unsigned char)(c)])
#define Isxdigit(c) cmap(c, _XD)
#define Isalnum(c) (cmap(c, _DIG|_LET) && !(((c) & META) && AsciiOnly))
#define Iscntrl(c) (cmap(c,_CTR) && !(((c) & META) && AsciiOnly))
#define Isprint(c) (!cmap(c,_CTR) && !(((c) & META) && AsciiOnly))
#endif
+160
View File
@@ -0,0 +1,160 @@
/* config.h. Generated automatically by configure. */
/*
* config.h -- configure various defines for tcsh
*
* All source files should #include this FIRST.
*
* Edit this to match your system type.
*/
/* $FreeBSD$ */
#ifndef _h_config
#define _h_config
/****************** System dependant compilation flags ****************/
/*
* POSIX This system supports IEEE Std 1003.1-1988 (POSIX).
*/
#define POSIX
/*
* POSIXJOBS This system supports the optional IEEE Std 1003.1-1988 (POSIX)
* job control facilities.
*/
#define POSIXJOBS
/*
* POSIXSIGS Use the POSIX signal facilities to emulate BSD signals.
*/
/* #undef POSIXSIGS */
/*
* VFORK This machine has a vfork().
* It used to be that for job control to work, this define
* was mandatory. This is not the case any more.
* If you think you still need it, but you don't have vfork,
* define this anyway and then do #define vfork fork.
* I do this anyway on a Sun because of yellow pages brain damage,
* [should not be needed under 4.1]
* and on the iris4d cause SGI's fork is sufficiently "virtual"
* that vfork isn't necessary. (Besides, SGI's vfork is weird).
* Note that some machines eg. rs6000 have a vfork, but not
* with the berkeley semantics, so we cannot use it there either.
*/
#define VFORK
/*
* BSDJOBS You have BSD-style job control (both process groups and
* a tty that deals correctly
*/
#define BSDJOBS
/*
* BSDSIGS You have 4.2-style signals, rather than USG style.
* Note: POSIX systems should not define this unless they
* have sigvec() and friends (ie: 4.3BSD-RENO, HP-UX).
*/
#define BSDSIGS
/*
* BSDTIMES You have BSD-style process time stuff (like rusage)
* This may or may not be true. For example, Apple Unix
* (OREO) has BSDJOBS and BSDSIGS but not BSDTIMES.
*/
#define BSDTIMES
/*
* BSDLIMIT You have BSD-style resource limit stuff (getrlimit/setrlimit)
*/
#define BSDLIMIT
/*
* BSDNICE Your system uses setpriority() instead of nice, to
* change a processes scheduling priority
*/
#define BSDNICE
/*
* TERMIO You have struct termio instead of struct sgttyb.
* This is usually the case for SYSV systems, where
* BSD uses sgttyb. POSIX systems should define this
* anyway, even though they use struct termios.
*/
#define TERMIO
/*
* SYSVREL Your machine is SYSV based (HPUX, A/UX)
* NOTE: don't do this if you are on a Pyramid -- tcsh is
* built in a BSD universe.
* Set SYSVREL to 1, 2, 3, or 4, depending the version of System V
* you are running. Or set it to 0 if you are not SYSV based
*/
#define SYSVREL 0
/*
* YPBUGS Work around Sun YP bugs that cause expansion of ~username
* to send command output to /dev/null
*/
/* #undef YPBUGS */
/*
* SIGVOID Define this if your signal handlers return void. On older
* systems, signal returns int, but on newer ones, it returns void.
*/
#define SIGVOID
/*
* HAVEDUP2 Define this if your system supports dup2().
*/
#define HAVEDUP2
/*
* UTHOST Does the utmp file have a host field?
*/
#define UTHOST
/*
* DIRENT Your system has <dirent.h> instead of <sys/dir.h>
*/
#define DIRENT
/****************** local defines *********************/
/****************** configurable hacks ****************/
#include <stdlib.h>
/* have been moved to config_f.h */
#include "config_f.h"
#if defined(__FreeBSD__)
#define NLS_BUGS
/* we want to use the system malloc when we install as /bin/csh */
#define SYSMALLOC
#endif
#if defined(__bsdi__)
/*
* _PATH_TCSHELL if you've change the installation location (vix)
*/
# ifdef _BSDI_VERSION >= 199701
# define _PATH_TCSHELL "/bin/tcsh"
/* # undef SYSMALLOC */
# define SYSMALLOC
# else
# define _PATH_TCSHELL "/usr/contrib/bin/tcsh"
# endif
# undef NLS
# undef NLS_CATALOGS
#elif defined(__APPLE__)
# define SYSMALLOC
#else
# define NLS_CATALOGS
#endif
#define KANJI
#define DSPMBYTE
#endif /* _h_config */
/* config.h.in. Generated automatically from configure.in by autoheader. */
-167
View File
@@ -1,167 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)const.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
/*
* tc.const.c: String constants for csh.
*/
#include "csh.h"
Char STR0[] = { '0', '\0' };
Char STR1[] = { '1', '\0' };
Char STRHOME[] = { 'H', 'O', 'M', 'E', '\0' };
Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
Char STRLC_ALL[] = { 'L', 'C', '_', 'A', 'L', 'L', '\0' };
Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E', '\0' };
Char STRLC_COLLATE[] = { 'L', 'C', '_', 'C', 'O', 'L', 'L', 'A', 'T', 'E', '\0' };
Char STRLOGNAME[] = { 'L', 'O', 'G', 'N', 'A', 'M', 'E', '\0' };
Char STRLbrace[] = { '{', '\0' };
Char STRLparen[] = { '(', '\0' };
Char STRLparensp[] = { '(', ' ', '\0' };
Char STRNULL[] = { '\0' };
Char STRPATH[] = { 'P', 'A', 'T', 'H', '\0' };
Char STRPWD[] = { 'P', 'W', 'D', '\0' };
Char STRQNULL[] = { '\0' | QUOTE, '\0' };
Char STRRbrace[] = { '}', '\0' };
Char STRspRparen[] = { ' ', ')', '\0' };
Char STRTERM[] = { 'T', 'E', 'R', 'M', '\0' };
Char STRUSER[] = { 'U', 'S', 'E', 'R', '\0' };
Char STRalias[] = { 'a', 'l', 'i', 'a', 's', '\0' };
Char STRand[] = { '&', '\0' };
Char STRand2[] = { '&', '&', '\0' };
Char STRaout[] = { 'a', '.', 'o', 'u', 't', '\0' };
Char STRargv[] = { 'a', 'r', 'g', 'v', '\0' };
Char STRbang[] = { '!', '\0' };
Char STRcaret[] = { '^', '\0' };
Char STRcdpath[] = { 'c', 'd', 'p', 'a', 't', 'h', '\0' };
Char STRcent2[] = { '%', '%', '\0' };
Char STRcenthash[] = { '%', '#', '\0' };
Char STRcentplus[] = { '%', '+', '\0' };
Char STRcentminus[] = { '%', '-', '\0' };
Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l',
'i', 'n', 'k', 's', '\0' };
Char STRchild[] = { 'c', 'h', 'i', 'l', 'd', '\0' };
Char STRcolon[] = { ':', '\0' };
Char STRcwd[] = { 'c', 'w', 'd', '\0' };
Char STRdefault[] = { 'd', 'e', 'f', 'a', 'u', 'l', 't', '\0' };
Char STRdot[] = { '.', '\0' };
Char STRdotdotsl[] = { '.', '.', '/', '\0' };
Char STRdotsl[] = { '.', '/', '\0' };
Char STRecho[] = { 'e', 'c', 'h', 'o', '\0' };
Char STRequal[] = { '=', '\0' };
Char STRfakecom[] = { '{', ' ', '.', '.', '.', ' ', '}', '\0' };
Char STRfakecom1[] = { '`', ' ', '.', '.', '.', ' ', '`', '\0' };
Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
#ifdef FILEC
Char STRfilec[] = { 'f', 'i', 'l', 'e', 'c', '\0' };
#endif /* FILEC */
Char STRhistchars[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' };
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
'y', '\0' };
Char STRhistfile[] = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' };
Char STRhistory[] = { 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' };
Char STRhome[] = { 'h', 'o', 'm', 'e', '\0' };
Char STRignore_symlinks[] = { 'i', 'g', 'n', 'o', 'r', 'e', '_', 's', 'y', 'm',
'l', 'i', 'n', 'k', 's', '\0' };
Char STRignoreeof[] = { 'i', 'g', 'n', 'o', 'r', 'e', 'e', 'o', 'f', '\0' };
Char STRjobs[] = { 'j', 'o', 'b', 's', '\0' };
Char STRlistjobs[] = { 'l', 'i', 's', 't', 'j', 'o', 'b', 's', '\0' };
Char STRlogout[] = { 'l', 'o', 'g', 'o', 'u', 't', '\0' };
Char STRlong[] = { 'l', 'o', 'n', 'g', '\0' };
Char STRmail[] = { 'm', 'a', 'i', 'l', '\0' };
Char STRmh[] = { '-', 'h', '\0' };
Char STRminus[] = { '-', '\0' };
Char STRml[] = { '-', 'l', '\0' };
Char STRmn[] = { '-', 'n', '\0' };
Char STRmquestion[] = { '?' | QUOTE, ' ', '\0' };
Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' };
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
's', '\0' };
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
Char STRnoglob[] = { 'n', 'o', 'g', 'l', 'o', 'b', '\0' };
Char STRnohup[] = { 'n', 'o', 'h', 'u', 'p', '\0' };
Char STRnonomatch[] = { 'n', 'o', 'n', 'o', 'm', 'a', 't', 'c', 'h', '\0' };
Char STRnormal[] = { 'n', 'o', 'r', 'm', 'a', 'l', '\0' };
Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' };
Char STRor[] = { '|', '\0' };
Char STRor2[] = { '|', '|', '\0' };
Char STRpath[] = { 'p', 'a', 't', 'h', '\0' };
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
'a', 'l', 'u', 'e', '\0' };
Char STRprompt[] = { 'p', 'r', 'o', 'm', 'p', 't', '\0' };
Char STRprompt2[] = { 'p', 'r', 'o', 'm', 'p', 't', '2', '\0' };
Char STRpushdsilent[] = { 'p', 'u', 's', 'h', 'd', 's', 'i', 'l', 'e', 'n',
't', '\0' };
Char STRret[] = { '\n', '\0' };
Char STRsavehist[] = { 's', 'a', 'v', 'e', 'h', 'i', 's', 't', '\0' };
Char STRsemisp[] = { ';', ' ', '\0' };
Char STRshell[] = { 's', 'h', 'e', 'l', 'l', '\0' };
Char STRslash[] = { '/', '\0' };
Char STRsldotcshrc[] = { '/', '.', 'c', 's', 'h', 'r', 'c', '\0' };
Char STRsldotlogin[] = { '/', '.', 'l', 'o', 'g', 'i', 'n', '\0' };
Char STRsldthist[] = { '/', '.', 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' };
Char STRsldtlogout[] = { '/', '.', 'l', 'o', 'g', 'o', 'u', 't', '\0' };
Char STRsource[] = { 's', 'o', 'u', 'r', 'c', 'e', '\0' };
Char STRsp3dots[] = { ' ', '.', '.', '.', '\0' };
Char STRspLarrow2sp[] = { ' ', '<', '<', ' ', '\0' };
Char STRspLarrowsp[] = { ' ', '<', ' ', '\0' };
Char STRspRarrow[] = { ' ', '>', '\0' };
Char STRspRarrow2[] = { ' ', '>', '>', '\0' };
Char STRRparen[] = { ')', '\0' };
Char STRspace[] = { ' ', '\0' };
Char STRspand2sp[] = { ' ', '&', '&', ' ', '\0' };
Char STRspor2sp[] = { ' ', '|', '|', ' ', '\0' };
Char STRsporsp[] = { ' ', '|', ' ', '\0' };
Char STRstar[] = { '*', '\0' };
Char STRstatus[] = { 's', 't', 'a', 't', 'u', 's', '\0' };
Char STRsymcent[] = { '%', ' ', '\0' };
Char STRsymhash[] = { '#', ' ', '\0' };
Char STRterm[] = { 't', 'e', 'r', 'm', '\0' };
Char STRthen[] = { 't', 'h', 'e', 'n', '\0' };
Char STRtilde[] = { '~', '\0' };
Char STRtime[] = { 't', 'i', 'm', 'e', '\0' };
Char STRtmpsh[] = { '/', 't', 'm', 'p', '/', 's', 'h', '\0' };
Char STRunalias[] = { 'u', 'n', 'a', 'l', 'i', 'a', 's', '\0' };
Char STRuser[] = { 'u', 's', 'e', 'r', '\0' };
Char STRverbose[] = { 'v', 'e', 'r', 'b', 'o', 's', 'e', '\0' };
Char STRwordchars[] = { 'w', 'o', 'r', 'd', 'c', 'h', 'a', 'r', 's', '\0' };
-2220
View File
File diff suppressed because it is too large. Load diff
-1362
View File
File diff suppressed because it is too large. Load diff
-551
View File
@@ -1,551 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)csh.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
/*
* Fundamental definitions which may vary from system to system.
*
* BUFSIZ The i/o buffering size; also limits word size
* MAILINTVL How often to mailcheck; more often is more expensive
*/
#ifndef BUFSIZ
#define BUFSIZ 1024 /* default buffer size */
#endif /* BUFSIZ */
#define FORKSLEEP 10 /* delay loop on non-interactive fork failure */
#define MAILINTVL 600 /* 10 minutes */
/*
* The shell moves std in/out/diag and the old std input away from units
* 0, 1, and 2 so that it is easy to set up these standards for invoked
* commands.
*/
#define FSHTTY 15 /* /dev/tty when manip pgrps */
#define FSHIN 16 /* Preferred desc for shell input */
#define FSHOUT 17 /* ... shell output */
#define FSHERR 18 /* ... shell diagnostics */
#define FOLDSTD 19 /* ... old std input */
#ifdef PROF
#define xexit(n) done(n)
#endif
#ifdef SHORT_STRINGS
typedef short Char;
#define SAVE(a) (Strsave(str2short(a)))
#else
typedef char Char;
#define SAVE(a) (strsave(a))
#endif
/*
* Make sure a variable is not stored in a register by taking its address
* This is used where variables might be clobbered by longjmp.
*/
#define UNREGISTER(a) (void) &a
typedef void *ioctl_t; /* Third arg of ioctl */
typedef void *ptr_t;
#include "const.h"
#include "char.h"
#include "errnum.h"
#define xmalloc(i) Malloc(i)
#define xrealloc(p, i) Realloc(p, i)
#define xcalloc(n, s) Calloc(n, s)
#define xfree(p) Free(p)
#include <stdio.h>
FILE *cshin, *cshout, *csherr;
#define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR)
typedef int bool;
#define eq(a, b) (Strcmp(a, b) == 0)
/* globone() flags */
#define G_ERROR 0 /* default action: error if multiple words */
#define G_IGNORE 1 /* ignore the rest of the words */
#define G_APPEND 2 /* make a sentence by cat'ing the words */
/*
* Global flags
*/
bool chkstop; /* Warned of stopped jobs... allow exit */
bool didfds; /* Have setup i/o fd's for child */
bool doneinp; /* EOF indicator after reset from readc */
bool exiterr; /* Exit if error or non-zero exit status */
bool child; /* Child shell ... errors cause exit */
bool haderr; /* Reset was because of an error */
bool intty; /* Input is a tty */
bool intact; /* We are interactive... therefore prompt */
bool justpr; /* Just print because of :p hist mod */
bool loginsh; /* We are a loginsh -> .login/.logout */
bool neednote; /* Need to pnotify() */
bool noexec; /* Don't execute, just syntax check */
bool pjobs; /* want to print jobs if interrupted */
bool setintr; /* Set interrupts on/off -> Wait intr... */
bool timflg; /* Time the next waited for command */
bool havhash; /* path hashing is available */
#ifdef FILEC
bool filec; /* doing filename expansion */
#endif
/*
* Global i/o info
*/
Char *arginp; /* Argument input for sh -c and internal `xx` */
int onelflg; /* 2 -> need line for -t, 1 -> exit on read */
Char *ffile; /* Name of shell file for $0 */
char *seterr; /* Error message from scanner/parser */
Char *shtemp; /* Temp name for << shell files in /tmp */
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
struct timeval time0; /* Time at which the shell started */
struct rusage ru0;
/*
* Miscellany
*/
Char *doldol; /* Character pid for $$ */
int backpid; /* Pid of the last background process */
int uid, euid; /* Invokers uid */
int gid, egid; /* Invokers gid */
time_t chktim; /* Time mail last checked */
int shpgrp; /* Pgrp of shell */
int tpgrp; /* Terminal process group */
/* If tpgrp is -1, leave tty alone! */
int opgrp; /* Initial pgrp and tty pgrp */
/*
* To be able to redirect i/o for builtins easily, the shell moves the i/o
* descriptors it uses away from 0,1,2.
* Ideally these should be in units which are closed across exec's
* (this saves work) but for version 6, this is not usually possible.
* The desired initial values for these descriptors are F{SHIN,...}.
*/
int SHIN; /* Current shell input (script) */
int SHOUT; /* Shell output */
int SHERR; /* Diagnostic output... shell errs go here */
int OLDSTD; /* Old standard input (def for cmds) */
/*
* Error control
*
* Errors in scanning and parsing set up an error message to be printed
* at the end and complete. Other errors always cause a reset.
* Because of source commands and .cshrc we need nested error catches.
*/
#include <setjmp.h>
jmp_buf reslab;
#define setexit() (setjmp(reslab))
#define reset() longjmp(reslab, 1)
/* Should use structure assignment here */
#define getexit(a) memmove((char *)(a), (char *)reslab, sizeof reslab)
#define resexit(a) memmove((char *)reslab, (char *)(a), sizeof reslab)
Char *gointr; /* Label for an onintr transfer */
#include <signal.h>
sig_t parintr; /* Parents interrupt catch */
sig_t parterm; /* Parents terminate catch */
/*
* Lexical definitions.
*
* All lexical space is allocated dynamically.
* The eighth/sixteenth bit of characters is used to prevent recognition,
* and eventually stripped.
*/
#define META 0200
#define ASCII 0177
#ifdef SHORT_STRINGS
#define CHAR 0377
#define QUOTE 0100000 /* 16nth char bit used for 'ing */
#define TRIM 0077777 /* Mask to strip quote bit */
#else
#define CHAR 0177
#define QUOTE 0200 /* Eighth char bit used for 'ing */
#define TRIM 0177 /* Mask to strip quote bit */
#endif
int AsciiOnly; /* If set only 7 bits is expected in characters */
/*
* Each level of input has a buffered input structure.
* There are one or more blocks of buffered input for each level,
* exactly one if the input is seekable and tell is available.
* In other cases, the shell buffers enough blocks to keep all loops
* in the buffer.
*/
struct Bin {
off_t Bfseekp; /* Seek pointer */
off_t Bfbobp; /* Seekp of beginning of buffers */
off_t Bfeobp; /* Seekp of end of buffers */
int Bfblocks; /* Number of buffer blocks */
Char **Bfbuf; /* The array of buffer blocks */
} B;
/*
* This structure allows us to seek inside aliases
*/
struct Ain {
int type;
#define I_SEEK -1 /* Invalid seek */
#define A_SEEK 0 /* Alias seek */
#define F_SEEK 1 /* File seek */
#define E_SEEK 2 /* Eval seek */
union {
off_t _f_seek;
Char* _c_seek;
} fc;
#define f_seek fc._f_seek
#define c_seek fc._c_seek
Char **a_seek;
} ;
extern int aret; /* What was the last character returned */
#define SEEKEQ(a, b) ((a)->type == (b)->type && \
(a)->f_seek == (b)->f_seek && \
(a)->a_seek == (b)->a_seek)
#define fseekp B.Bfseekp
#define fbobp B.Bfbobp
#define feobp B.Bfeobp
#define fblocks B.Bfblocks
#define fbuf B.Bfbuf
/*
* The shell finds commands in loops by reseeking the input
* For whiles, in particular, it reseeks to the beginning of the
* line the while was on; hence the while placement restrictions.
*/
struct Ain lineloc;
bool cantell; /* Is current source tellable ? */
/*
* Input lines are parsed into doubly linked circular
* lists of words of the following form.
*/
struct wordent {
Char *word;
struct wordent *prev;
struct wordent *next;
};
/*
* During word building, both in the initial lexical phase and
* when expanding $ variable substitutions, expansion by `!' and `$'
* must be inhibited when reading ahead in routines which are themselves
* processing `!' and `$' expansion or after characters such as `\' or in
* quotations. The following flags are passed to the getC routines
* telling them which of these substitutions are appropriate for the
* next character to be returned.
*/
#define DODOL 1
#define DOEXCL 2
#define DOALL DODOL|DOEXCL
/*
* Labuf implements a general buffer for lookahead during lexical operations.
* Text which is to be placed in the input stream can be stuck here.
* We stick parsed ahead $ constructs during initial input,
* process id's from `$$', and modified variable values (from qualifiers
* during expansion in sh.dol.c) here.
*/
Char *lap;
/*
* Parser structure
*
* Each command is parsed to a tree of command structures and
* flags are set bottom up during this process, to be propagated down
* as needed during the semantics/execution pass (sh.sem.c).
*/
struct command {
short t_dtyp; /* Type of node */
#define NODE_COMMAND 1 /* t_dcom <t_dlef >t_drit */
#define NODE_PAREN 2 /* ( t_dspr ) <t_dlef >t_drit */
#define NODE_PIPE 3 /* t_dlef | t_drit */
#define NODE_LIST 4 /* t_dlef ; t_drit */
#define NODE_OR 5 /* t_dlef || t_drit */
#define NODE_AND 6 /* t_dlef && t_drit */
short t_dflg; /* Flags, e.g. F_AMPERSAND|... */
#define F_SAVE (F_NICE|F_TIME|F_NOHUP) /* save these when re-doing */
#define F_AMPERSAND (1<<0) /* executes in background */
#define F_APPEND (1<<1) /* output is redirected >> */
#define F_PIPEIN (1<<2) /* input is a pipe */
#define F_PIPEOUT (1<<3) /* output is a pipe */
#define F_NOFORK (1<<4) /* don't fork, last ()ized cmd */
#define F_NOINTERRUPT (1<<5) /* should be immune from intr's */
/* spare */
#define F_STDERR (1<<7) /* redirect unit 2 with unit 1 */
#define F_OVERWRITE (1<<8) /* output was ! */
#define F_READ (1<<9) /* input redirection is << */
#define F_REPEAT (1<<10) /* reexec aft if, repeat,... */
#define F_NICE (1<<11) /* t_nice is meaningful */
#define F_NOHUP (1<<12) /* nohup this command */
#define F_TIME (1<<13) /* time this command */
union {
Char *T_dlef; /* Input redirect word */
struct command *T_dcar; /* Left part of list/pipe */
} L;
union {
Char *T_drit; /* Output redirect word */
struct command *T_dcdr; /* Right part of list/pipe */
} R;
#define t_dlef L.T_dlef
#define t_dcar L.T_dcar
#define t_drit R.T_drit
#define t_dcdr R.T_dcdr
Char **t_dcom; /* Command/argument vector */
struct command *t_dspr; /* Pointer to ()'d subtree */
int t_nice;
};
/*
* These are declared here because they want to be
* initialized in sh.init.c (to allow them to be made readonly)
*/
extern struct biltins {
char *bname;
void (*bfunct) __P((Char **, struct command *));
short minargs, maxargs;
} bfunc[];
extern int nbfunc;
extern struct srch {
char *s_name;
short s_value;
} srchn[];
extern int nsrchn;
/*
* The keywords for the parser
*/
#define T_BREAK 0
#define T_BRKSW 1
#define T_CASE 2
#define T_DEFAULT 3
#define T_ELSE 4
#define T_END 5
#define T_ENDIF 6
#define T_ENDSW 7
#define T_EXIT 8
#define T_FOREACH 9
#define T_GOTO 10
#define T_IF 11
#define T_LABEL 12
#define T_LET 13
#define T_SET 14
#define T_SWITCH 15
#define T_TEST 16
#define T_THEN 17
#define T_WHILE 18
/*
* Structure defining the existing while/foreach loops at this
* source level. Loops are implemented by seeking back in the
* input. For foreach (fe), the word list is attached here.
*/
struct whyle {
struct Ain w_start; /* Point to restart loop */
struct Ain w_end; /* End of loop (0 if unknown) */
Char **w_fe, **w_fe0; /* Current/initial wordlist for fe */
Char *w_fename; /* Name for fe */
struct whyle *w_next; /* Next (more outer) loop */
} *whyles;
/*
* Variable structure
*
* Aliases and variables are stored in AVL balanced binary trees.
*/
struct varent {
Char **vec; /* Array of words which is the value */
Char *v_name; /* Name of variable/alias */
struct varent *v_link[3]; /* The links, see below */
int v_bal; /* Balance factor */
} shvhed, aliases;
#define v_left v_link[0]
#define v_right v_link[1]
#define v_parent v_link[2]
#define adrof(v) adrof1(v, &shvhed)
#define value(v) value1(v, &shvhed)
/*
* The following are for interfacing redo substitution in
* aliases to the lexical routines.
*/
struct wordent *alhistp; /* Argument list (first) */
struct wordent *alhistt; /* Node after last in arg list */
Char **alvec, *alvecp; /* The (remnants of) alias vector */
/*
* Filename/command name expansion variables
*/
int gflag; /* After tglob -> is globbing needed? */
#define MAXVARLEN 30 /* Maximum number of char in a variable name */
/*
* Variables for filename expansion
*/
extern Char **gargv; /* Pointer to the (stack) arglist */
extern long gargc; /* Number args in gargv */
/*
* Variables for command expansion.
*/
extern Char **pargv; /* Pointer to the argv list space */
extern long pargc; /* Count of arguments in pargv */
Char *pargs; /* Pointer to start current word */
long pnleft; /* Number of chars left in pargs */
Char *pargcp; /* Current index into pargs */
/*
* History list
*
* Each history list entry contains an embedded wordlist
* from the scanner, a number for the event, and a reference count
* to aid in discarding old entries.
*
* Essentially "invisible" entries are put on the history list
* when history substitution includes modifiers, and thrown away
* at the next discarding since their event numbers are very negative.
*/
struct Hist {
struct wordent Hlex;
int Hnum;
int Href;
struct Hist *Hnext;
} Histlist;
struct wordent paraml; /* Current lexical word list */
int eventno; /* Next events number */
int lastev; /* Last event reference (default) */
Char HIST; /* history invocation character */
Char HISTSUB; /* auto-substitute character */
/*
* strings.h:
*/
#ifndef SHORT_STRINGS
#define Strchr(a, b) strchr(a, b)
#define Strrchr(a, b) strrchr(a, b)
#define Strcat(a, b) strcat(a, b)
#define Strncat(a, b, c) strncat(a, b, c)
#define Strcpy(a, b) strcpy(a, b)
#define Strncpy(a, b, c) strncpy(a, b, c)
#define Strlen(a) strlen(a)
#define Strcmp(a, b) strcmp(a, b)
#define Strncmp(a, b, c) strncmp(a, b, c)
#define Strspl(a, b) strspl(a, b)
#define Strsave(a) strsave(a)
#define Strend(a) strend(a)
#define Strstr(a, b) strstr(a, b)
#define str2short(a) (a)
#define blk2short(a) saveblk(a)
#define short2blk(a) saveblk(a)
#define short2str(a) strip(a)
#else
#define Strchr(a, b) s_strchr(a, b)
#define Strrchr(a, b) s_strrchr(a, b)
#define Strcat(a, b) s_strcat(a, b)
#define Strncat(a, b, c) s_strncat(a, b, c)
#define Strcpy(a, b) s_strcpy(a, b)
#define Strncpy(a, b, c) s_strncpy(a, b, c)
#define Strlen(a) s_strlen(a)
#define Strcmp(a, b) s_strcmp(a, b)
#define Strncmp(a, b, c) s_strncmp(a, b, c)
#define Strspl(a, b) s_strspl(a, b)
#define Strsave(a) s_strsave(a)
#define Strend(a) s_strend(a)
#define Strstr(a, b) s_strstr(a, b)
#endif
/*
* setname is a macro to save space (see sh.err.c)
*/
char *bname;
#define setname(a) (bname = (a))
Char *Vsav;
Char *Vdp;
Char *Vexpath;
char **Vt;
Char **evalvec;
Char *evalp;
/* word_chars is set by default to WORD_CHARS but can be overridden by
the wordchars variable--if unset, reverts to WORD_CHARS */
Char *word_chars;
#define WORD_CHARS "*?_-.[]~=" /* default chars besides alnums in words */
Char *STR_SHELLPATH;
#include <paths.h>
#ifdef _PATH_BSHELL
Char *STR_BSHELL;
#endif
Char *STR_WORD_CHARS;
Char **STR_environ;
-933
View File
@@ -1,933 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "dir.h"
#include "extern.h"
/* Directory management. */
static struct directory
*dfind __P((Char *));
static Char *dfollow __P((Char *));
static void printdirs __P((void));
static Char *dgoto __P((Char *));
static void dnewcwd __P((struct directory *));
static void dset __P((Char *));
struct directory dhead; /* "head" of loop */
int printd; /* force name to be printed */
static int dirflag = 0;
/*
* dinit - initialize current working directory
*/
void
dinit(hp)
Char *hp;
{
char *tcp;
Char *cp;
struct directory *dp;
char path[MAXPATHLEN];
static char *emsg = "csh: Trying to start from \"%s\"\n";
/* Don't believe the login shell home, because it may be a symlink */
tcp = getcwd(path, MAXPATHLEN); /* see ngetwd.c for System V version */
if (tcp == NULL || *tcp == '\0') {
(void) fprintf(csherr, "csh: %s: %s\n", path, strerror(errno));
if (hp && *hp) {
tcp = short2str(hp);
if (chdir(tcp) == -1)
cp = NULL;
else
cp = hp;
(void) fprintf(csherr, emsg, vis_str(hp));
}
else
cp = NULL;
if (cp == NULL) {
(void) fprintf(csherr, emsg, "/");
if (chdir("/") == -1)
/* I am not even try to print an error message! */
xexit(1);
cp = SAVE("/");
}
}
else {
struct stat swd, shp;
/*
* See if $HOME is the working directory we got and use that
*/
if (hp && *hp &&
stat(tcp, &swd) != -1 && stat(short2str(hp), &shp) != -1 &&
swd.st_dev == shp.st_dev && swd.st_ino == shp.st_ino)
cp = hp;
else {
char *cwd;
/*
* use PWD if we have it (for subshells)
*/
if ((cwd = getenv("PWD")) != NULL) {
if (stat(cwd, &shp) != -1 && swd.st_dev == shp.st_dev &&
swd.st_ino == shp.st_ino)
tcp = cwd;
}
cp = dcanon(SAVE(tcp), STRNULL);
}
}
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
dp->di_name = Strsave(cp);
dp->di_count = 0;
dhead.di_next = dhead.di_prev = dp;
dp->di_next = dp->di_prev = &dhead;
printd = 0;
dnewcwd(dp);
}
static void
dset(dp)
Char *dp;
{
/*
* Don't call set() directly cause if the directory contains ` or
* other junk characters glob will fail.
*/
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
vec[0] = Strsave(dp);
vec[1] = 0;
setq(STRcwd, vec, &shvhed);
Setenv(STRPWD, dp);
}
#define DIR_LONG 1
#define DIR_VERT 2
#define DIR_LINE 4
static void
skipargs(v, str)
Char ***v;
char *str;
{
Char **n = *v, *s;
dirflag = 0;
for (n++; *n != NULL && (*n)[0] == '-'; n++)
for (s = &((*n)[1]); *s; s++)
switch (*s) {
case 'l':
dirflag |= DIR_LONG;
break;
case 'v':
dirflag |= DIR_VERT;
break;
case 'n':
dirflag |= DIR_LINE;
break;
default:
stderror(ERR_DIRUS, vis_str(**v), str);
break;
}
*v = n;
}
/*
* dodirs - list all directories in directory loop
*/
void
/*ARGSUSED*/
dodirs(v, t)
Char **v;
struct command *t;
{
skipargs(&v, "");
if (*v != NULL)
stderror(ERR_DIRUS, "dirs", "");
printdirs();
}
static void
printdirs()
{
struct directory *dp;
Char *s, *hp = value(STRhome);
int idx, len, cur;
if (*hp == '\0')
hp = NULL;
dp = dcwd;
idx = 0;
cur = 0;
do {
if (dp == &dhead)
continue;
if (dirflag & DIR_VERT) {
(void) fprintf(cshout, "%d\t", idx++);
cur = 0;
}
if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
(len = Strlen(hp), Strncmp(hp, dp->di_name, len) == 0) &&
(dp->di_name[len] == '\0' || dp->di_name[len] == '/'))
len = Strlen(s = (dp->di_name + len)) + 2;
else
len = Strlen(s = dp->di_name) + 1;
cur += len;
if ((dirflag & DIR_LINE) && cur >= 80 - 1 && len < 80) {
(void) fprintf(cshout, "\n");
cur = len;
}
(void) fprintf(cshout, s != dp->di_name ? "~%s%c" : "%s%c",
vis_str(s), (dirflag & DIR_VERT) ? '\n' : ' ');
} while ((dp = dp->di_prev) != dcwd);
if (!(dirflag & DIR_VERT))
(void) fprintf(cshout, "\n");
}
void
dtildepr(home, dir)
Char *home, *dir;
{
if (!eq(home, STRslash) && prefix(home, dir))
(void) fprintf(cshout, "~%s", vis_str(dir + Strlen(home)));
else
(void) fprintf(cshout, "%s", vis_str(dir));
}
void
dtilde()
{
struct directory *d = dcwd;
do {
if (d == &dhead)
continue;
d->di_name = dcanon(d->di_name, STRNULL);
} while ((d = d->di_prev) != dcwd);
dset(dcwd->di_name);
}
/* dnormalize():
* If the name starts with . or .. then we might need to normalize
* it depending on the symbolic link flags
*/
Char *
dnormalize(cp)
Char *cp;
{
#define UC (unsigned char)
#define ISDOT(c) (UC(c)[0] == '.' && ((UC(c)[1] == '\0') || (UC(c)[1] == '/')))
#define ISDOTDOT(c) (UC(c)[0] == '.' && ISDOT(&((c)[1])))
if ((unsigned char) cp[0] == '/')
return (Strsave(cp));
if (adrof(STRignore_symlinks)) {
int dotdot = 0;
Char *dp, *cwd;
cwd = (Char *) xmalloc((size_t) ((Strlen(dcwd->di_name) + 3) *
sizeof(Char)));
(void) Strcpy(cwd, dcwd->di_name);
/*
* Ignore . and count ..'s
*/
while (*cp) {
if (ISDOT(cp)) {
if (*++cp)
cp++;
}
else if (ISDOTDOT(cp)) {
dotdot++;
cp += 2;
if (*cp)
cp++;
}
else
break;
}
while (dotdot > 0)
if ((dp = Strrchr(cwd, '/'))) {
*dp = '\0';
dotdot--;
}
else
break;
if (*cp) {
cwd[dotdot = Strlen(cwd)] = '/';
cwd[dotdot + 1] = '\0';
dp = Strspl(cwd, cp);
xfree((ptr_t) cwd);
return dp;
}
else {
if (!*cwd) {
cwd[0] = '/';
cwd[1] = '\0';
}
return cwd;
}
}
return Strsave(cp);
}
/*
* dochngd - implement chdir command.
*/
void
/*ARGSUSED*/
dochngd(v, t)
Char **v;
struct command *t;
{
Char *cp;
struct directory *dp;
skipargs(&v, " [<dir>]");
printd = 0;
if (*v == NULL) {
if ((cp = value(STRhome)) == NULL || *cp == 0)
stderror(ERR_NAME | ERR_NOHOMEDIR);
if (chdir(short2str(cp)) < 0)
stderror(ERR_NAME | ERR_CANTCHANGE);
cp = Strsave(cp);
}
else if (v[1] != NULL) {
stderror(ERR_NAME | ERR_TOOMANY);
/* NOTREACHED */
return;
}
else if ((dp = dfind(*v)) != 0) {
char *tmp;
printd = 1;
if (chdir(tmp = short2str(dp->di_name)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
dcwd->di_prev->di_next = dcwd->di_next;
dcwd->di_next->di_prev = dcwd->di_prev;
dfree(dcwd);
dnewcwd(dp);
return;
}
else
cp = dfollow(*v);
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
dp->di_name = cp;
dp->di_count = 0;
dp->di_next = dcwd->di_next;
dp->di_prev = dcwd->di_prev;
dp->di_prev->di_next = dp;
dp->di_next->di_prev = dp;
dfree(dcwd);
dnewcwd(dp);
}
static Char *
dgoto(cp)
Char *cp;
{
Char *dp;
if (*cp != '/') {
Char *p, *q;
int cwdlen;
for (p = dcwd->di_name; *p++;)
continue;
if ((cwdlen = p - dcwd->di_name - 1) == 1) /* root */
cwdlen = 0;
for (p = cp; *p++;)
continue;
dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char)));
for (p = dp, q = dcwd->di_name; (*p++ = *q++) != '\0';)
continue;
if (cwdlen)
p[-1] = '/';
else
p--; /* don't add a / after root */
for (q = cp; (*p++ = *q++) != '\0';)
continue;
xfree((ptr_t) cp);
cp = dp;
dp += cwdlen;
}
else
dp = cp;
cp = dcanon(cp, dp);
return cp;
}
/*
* dfollow - change to arg directory; fall back on cdpath if not valid
*/
static Char *
dfollow(cp)
Char *cp;
{
Char *dp;
struct varent *c;
char ebuf[MAXPATHLEN];
int serrno;
cp = globone(cp, G_ERROR);
/*
* if we are ignoring symlinks, try to fix relatives now.
*/
dp = dnormalize(cp);
if (chdir(short2str(dp)) >= 0) {
xfree((ptr_t) cp);
return dgoto(dp);
}
else {
xfree((ptr_t) dp);
if (chdir(short2str(cp)) >= 0)
return dgoto(cp);
serrno = errno;
}
if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
&& (c = adrof(STRcdpath))) {
Char **cdp;
Char *p;
Char buf[MAXPATHLEN];
for (cdp = c->vec; *cdp; cdp++) {
for (dp = buf, p = *cdp; (*dp++ = *p++) != '\0';)
continue;
dp[-1] = '/';
for (p = cp; (*dp++ = *p++) != '\0';)
continue;
if (chdir(short2str(buf)) >= 0) {
printd = 1;
xfree((ptr_t) cp);
cp = Strsave(buf);
return dgoto(cp);
}
}
}
dp = value(cp);
if ((dp[0] == '/' || dp[0] == '.') && chdir(short2str(dp)) >= 0) {
xfree((ptr_t) cp);
cp = Strsave(dp);
printd = 1;
return dgoto(cp);
}
(void) strcpy(ebuf, short2str(cp));
xfree((ptr_t) cp);
stderror(ERR_SYSTEM, ebuf, strerror(serrno));
return (NULL);
}
/*
* dopushd - push new directory onto directory stack.
* with no arguments exchange top and second.
* with numeric argument (+n) bring it to top.
*/
void
/*ARGSUSED*/
dopushd(v, t)
Char **v;
struct command *t;
{
struct directory *dp;
skipargs(&v, " [<dir>|+<n>]");
printd = 1;
if (*v == NULL) {
char *tmp;
if ((dp = dcwd->di_prev) == &dhead)
dp = dhead.di_prev;
if (dp == dcwd)
stderror(ERR_NAME | ERR_NODIR);
if (chdir(tmp = short2str(dp->di_name)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
dp->di_prev->di_next = dp->di_next;
dp->di_next->di_prev = dp->di_prev;
dp->di_next = dcwd->di_next;
dp->di_prev = dcwd;
dcwd->di_next->di_prev = dp;
dcwd->di_next = dp;
}
else if (v[1] != NULL) {
stderror(ERR_NAME | ERR_TOOMANY);
/* NOTREACHED */
return;
}
else if ((dp = dfind(*v)) != NULL) {
char *tmp;
if (chdir(tmp = short2str(dp->di_name)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
else {
Char *ccp;
ccp = dfollow(*v);
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
dp->di_name = ccp;
dp->di_count = 0;
dp->di_prev = dcwd;
dp->di_next = dcwd->di_next;
dcwd->di_next = dp;
dp->di_next->di_prev = dp;
}
dnewcwd(dp);
}
/*
* dfind - find a directory if specified by numeric (+n) argument
*/
static struct directory *
dfind(cp)
Char *cp;
{
struct directory *dp;
int i;
Char *ep;
if (*cp++ != '+')
return (0);
for (ep = cp; Isdigit(*ep); ep++)
continue;
if (*ep)
return (0);
i = getn(cp);
if (i <= 0)
return (0);
for (dp = dcwd; i != 0; i--) {
if ((dp = dp->di_prev) == &dhead)
dp = dp->di_prev;
if (dp == dcwd)
stderror(ERR_NAME | ERR_DEEP);
}
return (dp);
}
/*
* dopopd - pop a directory out of the directory stack
* with a numeric argument just discard it.
*/
void
/*ARGSUSED*/
dopopd(v, t)
Char **v;
struct command *t;
{
struct directory *dp, *p = NULL;
skipargs(&v, " [+<n>]");
printd = 1;
if (*v == NULL)
dp = dcwd;
else if (v[1] != NULL) {
stderror(ERR_NAME | ERR_TOOMANY);
/* NOTREACHED */
return;
}
else if ((dp = dfind(*v)) == 0)
stderror(ERR_NAME | ERR_BADDIR);
if (dp->di_prev == &dhead && dp->di_next == &dhead)
stderror(ERR_NAME | ERR_EMPTY);
if (dp == dcwd) {
char *tmp;
if ((p = dp->di_prev) == &dhead)
p = dhead.di_prev;
if (chdir(tmp = short2str(p->di_name)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
dp->di_prev->di_next = dp->di_next;
dp->di_next->di_prev = dp->di_prev;
if (dp == dcwd)
dnewcwd(p);
else {
printdirs();
}
dfree(dp);
}
/*
* dfree - free the directory (or keep it if it still has ref count)
*/
void
dfree(dp)
struct directory *dp;
{
if (dp->di_count != 0) {
dp->di_next = dp->di_prev = 0;
}
else {
xfree((char *) dp->di_name);
xfree((ptr_t) dp);
}
}
/*
* dcanon - canonicalize the pathname, removing excess ./ and ../ etc.
* we are of course assuming that the file system is standardly
* constructed (always have ..'s, directories have links)
*/
Char *
dcanon(cp, p)
Char *cp, *p;
{
Char *sp;
Char *p1, *p2; /* general purpose */
bool slash;
Char link[MAXPATHLEN];
char tlink[MAXPATHLEN];
int cc;
Char *newcp;
/*
* christos: if the path given does not start with a slash prepend cwd. If
* cwd does not start with a path or the result would be too long abort().
*/
if (*cp != '/') {
Char tmpdir[MAXPATHLEN];
p1 = value(STRcwd);
if (p1 == NULL || *p1 != '/')
abort();
if (Strlen(p1) + Strlen(cp) + 1 >= MAXPATHLEN)
abort();
(void) Strcpy(tmpdir, p1);
(void) Strcat(tmpdir, STRslash);
(void) Strcat(tmpdir, cp);
xfree((ptr_t) cp);
cp = p = Strsave(tmpdir);
}
while (*p) { /* for each component */
sp = p; /* save slash address */
while (*++p == '/') /* flush extra slashes */
continue;
if (p != ++sp)
for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
p = sp; /* save start of component */
slash = 0;
while (*++p) /* find next slash or end of path */
if (*p == '/') {
slash = 1;
*p = 0;
break;
}
if (*sp == '\0') /* if component is null */
if (--sp == cp) /* if path is one char (i.e. /) */
break;
else
*sp = '\0';
else if (sp[0] == '.' && sp[1] == 0) {
if (slash) {
for (p1 = sp, p2 = p + 1; (*p1++ = *p2++) != '\0';)
continue;
p = --sp;
}
else if (--sp != cp)
*sp = '\0';
}
else if (sp[0] == '.' && sp[1] == '.' && sp[2] == 0) {
/*
* We have something like "yyy/xxx/..", where "yyy" can be null or
* a path starting at /, and "xxx" is a single component. Before
* compressing "xxx/..", we want to expand "yyy/xxx", if it is a
* symbolic link.
*/
*--sp = 0; /* form the pathname for readlink */
if (sp != cp && !adrof(STRignore_symlinks) &&
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
(void) Strcpy(link, str2short(tlink));
link[cc] = '\0';
if (slash)
*p = '/';
/*
* Point p to the '/' in "/..", and restore the '/'.
*/
*(p = sp) = '/';
/*
* find length of p
*/
for (p1 = p; *p1++;)
continue;
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* "/..". First, back sp up to the character past "yyy/".
*/
while (*--sp != '/')
continue;
sp++;
*sp = 0;
/*
* New length is "yyy/" + link + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
(((sp - cp) + cc + (p1 - p)) *
sizeof(Char)));
/*
* Copy new path into newcp
*/
for (p2 = cp; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
/*
* Restart canonicalization at expanded "/xxx".
*/
p = sp - cp - 1 + newcp;
}
else {
/*
* New length is link + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
((cc + (p1 - p)) * sizeof(Char)));
/*
* Copy new path into newcp
*/
for (p2 = link; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
/*
* Restart canonicalization at beginning
*/
p = newcp;
}
xfree((ptr_t) cp);
cp = newcp;
continue; /* canonicalize the link */
}
*sp = '/';
if (sp != cp)
while (*--sp != '/')
continue;
if (slash) {
for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
continue;
p = sp;
}
else if (cp == sp)
*++sp = '\0';
else
*sp = '\0';
}
else { /* normal dir name (not . or .. or nothing) */
if (sp != cp && adrof(STRchase_symlinks) &&
!adrof(STRignore_symlinks) &&
(cc = readlink(short2str(cp), tlink, sizeof(tlink) - 1)) >= 0) {
(void) Strcpy(link, str2short(tlink));
link[cc] = '\0';
/*
* restore the '/'.
*/
if (slash)
*p = '/';
/*
* point sp to p (rather than backing up).
*/
sp = p;
/*
* find length of p
*/
for (p1 = p; *p1++;)
continue;
if (*link != '/') {
/*
* Relative path, expand it between the "yyy/" and the
* remainder. First, back sp up to the character past
* "yyy/".
*/
while (*--sp != '/')
continue;
sp++;
*sp = 0;
/*
* New length is "yyy/" + link + "/.." and rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
(((sp - cp) + cc + (p1 - p))
* sizeof(Char)));
/*
* Copy new path into newcp
*/
for (p2 = cp; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
/*
* Restart canonicalization at expanded "/xxx".
*/
p = sp - cp - 1 + newcp;
}
else {
/*
* New length is link + the rest
*/
p1 = newcp = (Char *) xmalloc((size_t)
((cc + (p1 - p)) * sizeof(Char)));
/*
* Copy new path into newcp
*/
for (p2 = link; (*p1++ = *p2++) != '\0';)
continue;
for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
continue;
/*
* Restart canonicalization at beginning
*/
p = newcp;
}
xfree((ptr_t) cp);
cp = newcp;
continue; /* canonicalize the link */
}
if (slash)
*p = '/';
}
}
/*
* fix home...
*/
p1 = value(STRhome);
cc = Strlen(p1);
/*
* See if we're not in a subdir of STRhome
*/
if (p1 && *p1 == '/' &&
(Strncmp(p1, cp, cc) != 0 || (cp[cc] != '/' && cp[cc] != '\0'))) {
static ino_t home_ino = -1;
static dev_t home_dev = -1;
static Char *home_ptr = NULL;
struct stat statbuf;
/*
* Get dev and ino of STRhome
*/
if (home_ptr != p1 &&
stat(short2str(p1), &statbuf) != -1) {
home_dev = statbuf.st_dev;
home_ino = statbuf.st_ino;
home_ptr = p1;
}
/*
* Start comparing dev & ino backwards
*/
p2 = Strcpy(link, cp);
for (sp = NULL; *p2 && stat(short2str(p2), &statbuf) != -1;) {
if (statbuf.st_dev == home_dev &&
statbuf.st_ino == home_ino) {
sp = (Char *) - 1;
break;
}
if ((sp = Strrchr(p2, '/')) != NULL)
*sp = '\0';
}
/*
* See if we found it
*/
if (*p2 && sp == (Char *) -1) {
/*
* Use STRhome to make '~' work
*/
newcp = Strspl(p1, cp + Strlen(p2));
xfree((ptr_t) cp);
cp = newcp;
}
}
return cp;
}
/*
* dnewcwd - make a new directory in the loop the current one
*/
static void
dnewcwd(dp)
struct directory *dp;
{
dcwd = dp;
dset(dcwd->di_name);
if (printd && !(adrof(STRpushdsilent)))
printdirs();
}
-46
View File
@@ -1,46 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)dir.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
/*
* Structure for entries in directory stack.
*/
struct directory {
struct directory *di_next; /* next in loop */
struct directory *di_prev; /* prev in loop */
unsigned short *di_count; /* refcount of processes */
Char *di_name; /* actual name */
};
struct directory *dcwd; /* the one we are in now */
-991
View File
@@ -1,991 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
/*
* These routines perform variable substitution and quoting via ' and ".
* To this point these constructs have been preserved in the divided
* input words. Here we expand variables and turn quoting via ' and " into
* QUOTE bits on characters (which prevent further interpretation).
* If the `:q' modifier was applied during history expansion, then
* some QUOTEing may have occurred already, so we dont "trim()" here.
*/
static int Dpeekc, Dpeekrd; /* Peeks for DgetC and Dreadc */
static Char *Dcp, **Dvp; /* Input vector for Dreadc */
#define DEOF -1
#define unDgetC(c) Dpeekc = c
#define QUOTES (_QF|_QB|_ESC) /* \ ' " ` */
/*
* The following variables give the information about the current
* $ expansion, recording the current word position, the remaining
* words within this expansion, the count of remaining words, and the
* information about any : modifier which is being applied.
*/
#define MAXWLEN (BUFSIZ - 4)
#define MAXMOD MAXWLEN /* This cannot overflow */
static Char *dolp; /* Remaining chars from this word */
static Char **dolnxt; /* Further words */
static int dolcnt; /* Count of further words */
static Char dolmod[MAXMOD]; /* : modifier character */
static int dolnmod; /* Number of modifiers */
static int dolmcnt; /* :gx -> 10000, else 1 */
static int dolwcnt; /* :wx -> 10000, else 1 */
static void Dfix2 __P((Char **));
static Char *Dpack __P((Char *, Char *));
static int Dword __P((void));
static void dolerror __P((Char *));
static int DgetC __P((int));
static void Dgetdol __P((void));
static void fixDolMod __P((void));
static void setDolp __P((Char *));
static void unDredc __P((int));
static int Dredc __P((void));
static void Dtestq __P((int));
/*
* Fix up the $ expansions and quotations in the
* argument list to command t.
*/
void
Dfix(t)
struct command *t;
{
Char **pp;
Char *p;
if (noexec)
return;
/* Note that t_dcom isn't trimmed thus !...:q's aren't lost */
for (pp = t->t_dcom; (p = *pp++) != NULL;)
for (; *p; p++) {
if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */
Dfix2(t->t_dcom); /* found one */
blkfree(t->t_dcom);
t->t_dcom = gargv;
gargv = 0;
return;
}
}
}
/*
* $ substitute one word, for i/o redirection
*/
Char *
Dfix1(cp)
Char *cp;
{
Char *Dv[2];
if (noexec)
return (0);
Dv[0] = cp;
Dv[1] = NULL;
Dfix2(Dv);
if (gargc != 1) {
setname(vis_str(cp));
stderror(ERR_NAME | ERR_AMBIG);
}
cp = Strsave(gargv[0]);
blkfree(gargv), gargv = 0;
return (cp);
}
/*
* Subroutine to do actual fixing after state initialization.
*/
static void
Dfix2(v)
Char **v;
{
ginit(); /* Initialize glob's area pointers */
Dvp = v;
Dcp = STRNULL; /* Setup input vector for Dreadc */
unDgetC(0);
unDredc(0); /* Clear out any old peeks (at error) */
dolp = 0;
dolcnt = 0; /* Clear out residual $ expands (...) */
while (Dword())
continue;
}
/*
* Pack up more characters in this word
*/
static Char *
Dpack(wbuf, wp)
Char *wbuf, *wp;
{
int c;
int i = MAXWLEN - (wp - wbuf);
for (;;) {
c = DgetC(DODOL);
if (c == '\\') {
c = DgetC(0);
if (c == DEOF) {
unDredc(c);
*wp = 0;
Gcat(STRNULL, wbuf);
return (NULL);
}
if (c == '\n')
c = ' ';
else
c |= QUOTE;
}
if (c == DEOF) {
unDredc(c);
*wp = 0;
Gcat(STRNULL, wbuf);
return (NULL);
}
if (cmap(c, _SP | _NL | _QF | _QB)) { /* sp \t\n'"` */
unDgetC(c);
if (cmap(c, QUOTES))
return (wp);
*wp++ = 0;
Gcat(STRNULL, wbuf);
return (NULL);
}
if (--i <= 0)
stderror(ERR_WTOOLONG);
*wp++ = c;
}
}
/*
* Get a word. This routine is analogous to the routine
* word() in sh.lex.c for the main lexical input. One difference
* here is that we don't get a newline to terminate our expansion.
* Rather, DgetC will return a DEOF when we hit the end-of-input.
*/
static int
Dword()
{
int c, c1;
Char wbuf[BUFSIZ];
Char *wp = wbuf;
int i = MAXWLEN;
bool dolflg;
bool sofar = 0, done = 0;
while (!done) {
done = 1;
c = DgetC(DODOL);
switch (c) {
case DEOF:
if (sofar == 0)
return (0);
/* finish this word and catch the code above the next time */
unDredc(c);
/* fall into ... */
case '\n':
*wp = 0;
Gcat(STRNULL, wbuf);
return (1);
case ' ':
case '\t':
done = 0;
break;
case '`':
/* We preserve ` quotations which are done yet later */
*wp++ = c, --i;
case '\'':
case '"':
/*
* Note that DgetC never returns a QUOTES character from an
* expansion, so only true input quotes will get us here or out.
*/
c1 = c;
dolflg = c1 == '"' ? DODOL : 0;
for (;;) {
c = DgetC(dolflg);
if (c == c1)
break;
if (c == '\n' || c == DEOF)
stderror(ERR_UNMATCHED, c1);
if ((c & (QUOTE | TRIM)) == ('\n' | QUOTE))
--wp, ++i;
if (--i <= 0)
stderror(ERR_WTOOLONG);
switch (c1) {
case '"':
/*
* Leave any `s alone for later. Other chars are all
* quoted, thus `...` can tell it was within "...".
*/
*wp++ = c == '`' ? '`' : c | QUOTE;
break;
case '\'':
/* Prevent all further interpretation */
*wp++ = c | QUOTE;
break;
case '`':
/* Leave all text alone for later */
*wp++ = c;
break;
default:
break;
}
}
if (c1 == '`')
*wp++ = '`' /* i--; eliminated */;
sofar = 1;
if ((wp = Dpack(wbuf, wp)) == NULL)
return (1);
else {
i = MAXWLEN - (wp - wbuf);
done = 0;
}
break;
case '\\':
c = DgetC(0); /* No $ subst! */
if (c == '\n' || c == DEOF) {
done = 0;
break;
}
c |= QUOTE;
break;
default:
break;
}
if (done) {
unDgetC(c);
sofar = 1;
if ((wp = Dpack(wbuf, wp)) == NULL)
return (1);
else {
i = MAXWLEN - (wp - wbuf);
done = 0;
}
}
}
/* Really NOTREACHED */
return (0);
}
/*
* Get a character, performing $ substitution unless flag is 0.
* Any QUOTES character which is returned from a $ expansion is
* QUOTEd so that it will not be recognized above.
*/
static int
DgetC(flag)
int flag;
{
int c;
top:
if ((c = Dpeekc) != '\0') {
Dpeekc = 0;
return (c);
}
if (lap) {
c = *lap++ & (QUOTE | TRIM);
if (c == 0) {
lap = 0;
goto top;
}
quotspec:
if (cmap(c, QUOTES))
return (c | QUOTE);
return (c);
}
if (dolp) {
if ((c = *dolp++ & (QUOTE | TRIM)) != '\0')
goto quotspec;
if (dolcnt > 0) {
setDolp(*dolnxt++);
--dolcnt;
return (' ');
}
dolp = 0;
}
if (dolcnt > 0) {
setDolp(*dolnxt++);
--dolcnt;
goto top;
}
c = Dredc();
if (c == '$' && flag) {
Dgetdol();
goto top;
}
return (c);
}
static Char *nulvec[] = {0};
static struct varent nulargv = {nulvec, STRargv, { NULL, NULL, NULL }, 0};
static void
dolerror(s)
Char *s;
{
setname(vis_str(s));
stderror(ERR_NAME | ERR_RANGE);
}
/*
* Handle the multitudinous $ expansion forms.
* Ugh.
*/
static void
Dgetdol()
{
Char *np;
struct varent *vp = NULL;
Char name[4 * MAXVARLEN + 1];
int c, sc;
int subscr = 0, lwb = 1, upb = 0;
bool dimen = 0, bitset = 0;
char tnp;
Char wbuf[BUFSIZ];
static Char *dolbang = NULL;
dolnmod = dolmcnt = dolwcnt = 0;
c = sc = DgetC(0);
if (c == '{')
c = DgetC(0); /* sc is { to take } later */
if ((c & TRIM) == '#')
dimen++, c = DgetC(0); /* $# takes dimension */
else if (c == '?')
bitset++, c = DgetC(0); /* $? tests existence */
switch (c) {
case '!':
if (dimen || bitset)
stderror(ERR_SYNTAX);
if (backpid != 0) {
if (dolbang)
xfree((ptr_t) dolbang);
setDolp(dolbang = putn(backpid));
}
goto eatbrac;
case '$':
if (dimen || bitset)
stderror(ERR_SYNTAX);
setDolp(doldol);
goto eatbrac;
case '<' | QUOTE:
if (bitset)
stderror(ERR_NOTALLOWED, "$?<");
if (dimen)
stderror(ERR_NOTALLOWED, "$?#");
for (np = wbuf; read(OLDSTD, &tnp, 1) == 1; np++) {
*np = (unsigned char) tnp;
if (np >= &wbuf[BUFSIZ - 1])
stderror(ERR_LTOOLONG);
if (tnp == '\n')
break;
}
*np = 0;
/*
* KLUDGE: dolmod is set here because it will cause setDolp to call
* domod and thus to copy wbuf. Otherwise setDolp would use it
* directly. If we saved it ourselves, no one would know when to free
* it. The actual function of the 'q' causes filename expansion not to
* be done on the interpolated value.
*/
dolmod[dolnmod++] = 'q';
dolmcnt = 10000;
setDolp(wbuf);
goto eatbrac;
case DEOF:
case '\n':
stderror(ERR_SYNTAX);
/* NOTREACHED */
break;
case '*':
(void) Strcpy(name, STRargv);
vp = adrof(STRargv);
subscr = -1; /* Prevent eating [...] */
break;
default:
np = name;
if (Isdigit(c)) {
if (dimen)
stderror(ERR_NOTALLOWED, "$#<num>");
subscr = 0;
do {
subscr = subscr * 10 + c - '0';
c = DgetC(0);
} while (Isdigit(c));
unDredc(c);
if (subscr < 0) {
dolerror(vp->v_name);
return;
}
if (subscr == 0) {
if (bitset) {
dolp = ffile ? STR1 : STR0;
goto eatbrac;
}
if (ffile == 0)
stderror(ERR_DOLZERO);
fixDolMod();
setDolp(ffile);
goto eatbrac;
}
if (bitset)
stderror(ERR_DOLQUEST);
vp = adrof(STRargv);
if (vp == 0) {
vp = &nulargv;
goto eatmod;
}
break;
}
if (!alnum(c))
stderror(ERR_VARALNUM);
for (;;) {
*np++ = c;
c = DgetC(0);
if (!alnum(c))
break;
if (np >= &name[MAXVARLEN])
stderror(ERR_VARTOOLONG);
}
*np++ = 0;
unDredc(c);
vp = adrof(name);
}
if (bitset) {
dolp = (vp || getenv(short2str(name))) ? STR1 : STR0;
goto eatbrac;
}
if (vp == 0) {
np = str2short(getenv(short2str(name)));
if (np) {
fixDolMod();
setDolp(np);
goto eatbrac;
}
udvar(name);
/* NOTREACHED */
}
c = DgetC(0);
upb = blklen(vp->vec);
if (dimen == 0 && subscr == 0 && c == '[') {
np = name;
for (;;) {
c = DgetC(DODOL); /* Allow $ expand within [ ] */
if (c == ']')
break;
if (c == '\n' || c == DEOF)
stderror(ERR_INCBR);
if (np >= &name[sizeof(name) / sizeof(Char) - 2])
stderror(ERR_VARTOOLONG);
*np++ = c;
}
*np = 0, np = name;
if (dolp || dolcnt) /* $ exp must end before ] */
stderror(ERR_EXPORD);
if (!*np)
stderror(ERR_SYNTAX);
if (Isdigit(*np)) {
int i;
for (i = 0; Isdigit(*np); i = i * 10 + *np++ - '0')
continue;
if ((i < 0 || i > upb) && !any("-*", *np)) {
dolerror(vp->v_name);
return;
}
lwb = i;
if (!*np)
upb = lwb, np = STRstar;
}
if (*np == '*')
np++;
else if (*np != '-')
stderror(ERR_MISSING, '-');
else {
int i = upb;
np++;
if (Isdigit(*np)) {
i = 0;
while (Isdigit(*np))
i = i * 10 + *np++ - '0';
if (i < 0 || i > upb) {
dolerror(vp->v_name);
return;
}
}
if (i < lwb)
upb = lwb - 1;
else
upb = i;
}
if (lwb == 0) {
if (upb != 0) {
dolerror(vp->v_name);
return;
}
upb = -1;
}
if (*np)
stderror(ERR_SYNTAX);
}
else {
if (subscr > 0) {
if (subscr > upb)
lwb = 1, upb = 0;
else
lwb = upb = subscr;
}
unDredc(c);
}
if (dimen) {
Char *cp = putn(upb - lwb + 1);
addla(cp);
xfree((ptr_t) cp);
}
else {
eatmod:
fixDolMod();
dolnxt = &vp->vec[lwb - 1];
dolcnt = upb - lwb + 1;
}
eatbrac:
if (sc == '{') {
c = Dredc();
if (c != '}')
stderror(ERR_MISSING, '}');
}
}
static void
fixDolMod()
{
int c;
c = DgetC(0);
if (c == ':') {
do {
c = DgetC(0), dolmcnt = 1, dolwcnt = 1;
if (c == 'g' || c == 'a') {
if (c == 'g')
dolmcnt = 10000;
else
dolwcnt = 10000;
c = DgetC(0);
}
if ((c == 'g' && dolmcnt != 10000) ||
(c == 'a' && dolwcnt != 10000)) {
if (c == 'g')
dolmcnt = 10000;
else
dolwcnt = 10000;
c = DgetC(0);
}
if (c == 's') { /* [eichin:19910926.0755EST] */
int delimcnt = 2;
int delim = DgetC(0);
dolmod[dolnmod++] = c;
dolmod[dolnmod++] = delim;
if (!delim || letter(delim)
|| Isdigit(delim) || any(" \t\n", delim)) {
seterror(ERR_BADSUBST);
break;
}
while ((c = DgetC(0)) != (-1)) {
dolmod[dolnmod++] = c;
if(c == delim) delimcnt--;
if(!delimcnt) break;
}
if(delimcnt) {
seterror(ERR_BADSUBST);
break;
}
continue;
}
if (!any("htrqxes", c))
stderror(ERR_BADMOD, c);
dolmod[dolnmod++] = c;
if (c == 'q')
dolmcnt = 10000;
}
while ((c = DgetC(0)) == ':');
unDredc(c);
}
else
unDredc(c);
}
static void
setDolp(cp)
Char *cp;
{
Char *dp;
int i;
if (dolnmod == 0 || dolmcnt == 0) {
dolp = cp;
return;
}
dp = cp = Strsave(cp);
for (i = 0; i < dolnmod; i++) {
/* handle s// [eichin:19910926.0510EST] */
if(dolmod[i] == 's') {
int delim;
Char *lhsub, *rhsub, *np;
size_t lhlen = 0, rhlen = 0;
int didmod = 0;
delim = dolmod[++i];
if (!delim || letter(delim)
|| Isdigit(delim) || any(" \t\n", delim)) {
seterror(ERR_BADSUBST);
break;
}
lhsub = &dolmod[++i];
while(dolmod[i] != delim && dolmod[++i]) {
lhlen++;
}
dolmod[i] = 0;
rhsub = &dolmod[++i];
while(dolmod[i] != delim && dolmod[++i]) {
rhlen++;
}
dolmod[i] = 0;
do {
dp = Strstr(cp, lhsub);
if (dp) {
np = (Char *) xmalloc((size_t)
((Strlen(cp) + 1 - lhlen + rhlen) *
sizeof(Char)));
(void) Strncpy(np, cp, dp - cp);
(void) Strcpy(np + (dp - cp), rhsub);
(void) Strcpy(np + (dp - cp) + rhlen, dp + lhlen);
xfree((ptr_t) cp);
dp = cp = np;
didmod = 1;
} else {
/* should this do a seterror? */
break;
}
}
while (dolwcnt == 10000);
/*
* restore dolmod for additional words
*/
dolmod[i] = rhsub[-1] = delim;
if (didmod)
dolmcnt--;
else
break;
} else {
int didmod = 0;
do {
if ((dp = domod(cp, dolmod[i]))) {
didmod = 1;
if (Strcmp(cp, dp) == 0) {
xfree((ptr_t) cp);
cp = dp;
break;
}
else {
xfree((ptr_t) cp);
cp = dp;
}
}
else
break;
}
while (dolwcnt == 10000);
dp = cp;
if (didmod)
dolmcnt--;
else
break;
}
}
if (dp) {
addla(dp);
xfree((ptr_t) dp);
}
else
addla(cp);
dolp = STRNULL;
if (seterr)
stderror(ERR_OLD);
}
static void
unDredc(c)
int c;
{
Dpeekrd = c;
}
static int
Dredc()
{
int c;
if ((c = Dpeekrd) != '\0') {
Dpeekrd = 0;
return (c);
}
if (Dcp && (c = *Dcp++))
return (c & (QUOTE | TRIM));
if (*Dvp == 0) {
Dcp = 0;
return (DEOF);
}
Dcp = *Dvp++;
return (' ');
}
static void
Dtestq(c)
int c;
{
if (cmap(c, QUOTES))
gflag = 1;
}
/*
* Form a shell temporary file (in unit 0) from the words
* of the shell input up to EOF or a line the same as "term".
* Unit 0 should have been closed before this call.
*/
void
/*ARGSUSED*/
heredoc(term)
Char *term;
{
int c;
Char *Dv[2];
Char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ];
int ocnt, lcnt, mcnt;
Char *lbp, *obp, *mbp;
Char **vp;
bool quoted;
char *tmp;
if (creat(tmp = short2str(shtemp), 0600) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
(void) close(0);
if (open(tmp, O_RDWR) < 0) {
int oerrno = errno;
(void) unlink(tmp);
errno = oerrno;
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
(void) unlink(tmp); /* 0 0 inode! */
Dv[0] = term;
Dv[1] = NULL;
gflag = 0;
trim(Dv);
rscan(Dv, Dtestq);
quoted = gflag;
ocnt = BUFSIZ;
obp = obuf;
for (;;) {
/*
* Read up a line
*/
lbp = lbuf;
lcnt = BUFSIZ - 4;
for (;;) {
c = readc(1); /* 1 -> Want EOF returns */
if (c < 0 || c == '\n')
break;
if ((c &= TRIM) != '\0') {
*lbp++ = c;
if (--lcnt < 0) {
setname("<<");
stderror(ERR_NAME | ERR_OVERFLOW);
}
}
}
*lbp = 0;
/*
* Check for EOF or compare to terminator -- before expansion
*/
if (c < 0 || eq(lbuf, term)) {
(void) write(0, short2str(obuf), (size_t) (BUFSIZ - ocnt));
(void) lseek(0, 0l, L_SET);
return;
}
/*
* If term was quoted or -n just pass it on
*/
if (quoted || noexec) {
*lbp++ = '\n';
*lbp = 0;
for (lbp = lbuf; (c = *lbp++) != '\0';) {
*obp++ = c;
if (--ocnt == 0) {
(void) write(0, short2str(obuf), BUFSIZ);
obp = obuf;
ocnt = BUFSIZ;
}
}
continue;
}
/*
* Term wasn't quoted so variable and then command expand the input
* line
*/
Dcp = lbuf;
Dvp = Dv + 1;
mbp = mbuf;
mcnt = BUFSIZ - 4;
for (;;) {
c = DgetC(DODOL);
if (c == DEOF)
break;
if ((c &= TRIM) == 0)
continue;
/* \ quotes \ $ ` here */
if (c == '\\') {
c = DgetC(0);
if (!any("$\\`", c))
unDgetC(c | QUOTE), c = '\\';
else
c |= QUOTE;
}
*mbp++ = c;
if (--mcnt == 0) {
setname("<<");
stderror(ERR_NAME | ERR_OVERFLOW);
}
}
*mbp++ = 0;
/*
* If any ` in line do command substitution
*/
mbp = mbuf;
if (any(short2str(mbp), '`')) {
/*
* 1 arg to dobackp causes substitution to be literal. Words are
* broken only at newlines so that all blanks and tabs are
* preserved. Blank lines (null words) are not discarded.
*/
vp = dobackp(mbuf, 1);
}
else
/* Setup trivial vector similar to return of dobackp */
Dv[0] = mbp, Dv[1] = NULL, vp = Dv;
/*
* Resurrect the words from the command substitution each separated by
* a newline. Note that the last newline of a command substitution
* will have been discarded, but we put a newline after the last word
* because this represents the newline after the last input line!
*/
for (; *vp; vp++) {
for (mbp = *vp; *mbp; mbp++) {
*obp++ = *mbp & TRIM;
if (--ocnt == 0) {
(void) write(0, short2str(obuf), BUFSIZ);
obp = obuf;
ocnt = BUFSIZ;
}
}
*obp++ = '\n';
if (--ocnt == 0) {
(void) write(0, short2str(obuf), BUFSIZ);
obp = obuf;
ocnt = BUFSIZ;
}
}
if (pargv)
blkfree(pargv), pargv = 0;
}
}
-411
View File
@@ -1,411 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
char *seterr = NULL; /* Holds last error if there was one */
#define ERR_FLAGS 0xf0000000
#define ERR_NAME 0x10000000
#define ERR_SILENT 0x20000000
#define ERR_OLD 0x40000000
static char *errorlist[] =
{
#define ERR_SYNTAX 0
"Syntax Error",
#define ERR_NOTALLOWED 1
"%s is not allowed",
#define ERR_WTOOLONG 2
"Word too long",
#define ERR_LTOOLONG 3
"$< line too long",
#define ERR_DOLZERO 4
"No file for $0",
#define ERR_DOLQUEST 5
"$? not allowed here",
#define ERR_INCBR 6
"Incomplete [] modifier",
#define ERR_EXPORD 7
"$ expansion must end before ]",
#define ERR_BADMOD 8
"Bad : modifier in $ (%c)",
#define ERR_SUBSCRIPT 9
"Subscript error",
#define ERR_BADNUM 10
"Badly formed number",
#define ERR_NOMORE 11
"No more words",
#define ERR_FILENAME 12
"Missing file name",
#define ERR_GLOB 13
"Internal glob error",
#define ERR_COMMAND 14
"Command not found",
#define ERR_TOOFEW 15
"Too few arguments",
#define ERR_TOOMANY 16
"Too many arguments",
#define ERR_DANGER 17
"Too dangerous to alias that",
#define ERR_EMPTYIF 18
"Empty if",
#define ERR_IMPRTHEN 19
"Improper then",
#define ERR_NOPAREN 20
"Words not parenthesized",
#define ERR_NOTFOUND 21
"%s not found",
#define ERR_MASK 22
"Improper mask",
#define ERR_LIMIT 23
"No such limit",
#define ERR_TOOLARGE 24
"Argument too large",
#define ERR_SCALEF 25
"Improper or unknown scale factor",
#define ERR_UNDVAR 26
"Undefined variable",
#define ERR_DEEP 27
"Directory stack not that deep",
#define ERR_BADSIG 28
"Bad signal number",
#define ERR_UNKSIG 29
"Unknown signal; kill -l lists signals",
#define ERR_VARBEGIN 30
"Variable name must begin with a letter",
#define ERR_VARTOOLONG 31
"Variable name too long",
#define ERR_VARALNUM 32
"Variable name must contain alphanumeric characters",
#define ERR_JOBCONTROL 33
"No job control in this shell",
#define ERR_EXPRESSION 34
"Expression Syntax",
#define ERR_NOHOMEDIR 35
"No home directory",
#define ERR_CANTCHANGE 36
"Can't change to home directory",
#define ERR_NULLCOM 37
"Invalid null command",
#define ERR_ASSIGN 38
"Assignment missing expression",
#define ERR_UNKNOWNOP 39
"Unknown operator",
#define ERR_AMBIG 40
"Ambiguous",
#define ERR_EXISTS 41
"%s: File exists",
#define ERR_INTR 42
"Interrupted",
#define ERR_RANGE 43
"Subscript out of range",
#define ERR_OVERFLOW 44
"Line overflow",
#define ERR_VARMOD 45
"Unknown variable modifier",
#define ERR_NOSUCHJOB 46
"No such job",
#define ERR_TERMINAL 47
"Can't from terminal",
#define ERR_NOTWHILE 48
"Not in while/foreach",
#define ERR_NOPROC 49
"No more processes",
#define ERR_NOMATCH 50
"No match",
#define ERR_MISSING 51
"Missing %c",
#define ERR_UNMATCHED 52
"Unmatched %c",
#define ERR_NOMEM 53
"Out of memory",
#define ERR_PIPE 54
"Can't make pipe",
#define ERR_SYSTEM 55
"%s: %s",
#define ERR_STRING 56
"%s",
#define ERR_JOBS 57
"Usage: jobs [ -l ]",
#define ERR_JOBARGS 58
"Arguments should be jobs or process id's",
#define ERR_JOBCUR 59
"No current job",
#define ERR_JOBPREV 60
"No previous job",
#define ERR_JOBPAT 61
"No job matches pattern",
#define ERR_NESTING 62
"Fork nesting > %d; maybe `...` loop",
#define ERR_JOBCTRLSUB 63
"No job control in subshells",
#define ERR_BADPLPS 64
"Badly placed ()'s",
#define ERR_STOPPED 65
"%sThere are suspended jobs",
#define ERR_NODIR 66
"No other directory",
#define ERR_EMPTY 67
"Directory stack empty",
#define ERR_BADDIR 68
"Bad directory",
#define ERR_DIRUS 69
"Usage: %s [-lvn]%s",
#define ERR_HFLAG 70
"No operand for -h flag",
#define ERR_NOTLOGIN 71
"Not a login shell",
#define ERR_DIV0 72
"Division by 0",
#define ERR_MOD0 73
"Mod by 0",
#define ERR_BADSCALE 74
"Bad scaling; did you mean \"%s\"?",
#define ERR_SUSPLOG 75
"Can't suspend a login shell (yet)",
#define ERR_UNKUSER 76
"Unknown user: %s",
#define ERR_NOHOME 77
"No $home variable set",
#define ERR_HISTUS 78
"Usage: history [-rh] [# number of events]",
#define ERR_SPDOLLT 79
"$, ! or < not allowed with $# or $?",
#define ERR_NEWLINE 80
"Newline in variable name",
#define ERR_SPSTAR 81
"* not allowed with $# or $?",
#define ERR_DIGIT 82
"$?<digit> or $#<digit> not allowed",
#define ERR_VARILL 83
"Illegal variable name",
#define ERR_NLINDEX 84
"Newline in variable index",
#define ERR_EXPOVFL 85
"Expansion buffer overflow",
#define ERR_VARSYN 86
"Variable syntax",
#define ERR_BADBANG 87
"Bad ! form",
#define ERR_NOSUBST 88
"No previous substitute",
#define ERR_BADSUBST 89
"Bad substitute",
#define ERR_LHS 90
"No previous left hand side",
#define ERR_RHSLONG 91
"Right hand side too long",
#define ERR_BADBANGMOD 92
"Bad ! modifier: %c",
#define ERR_MODFAIL 93
"Modifier failed",
#define ERR_SUBOVFL 94
"Substitution buffer overflow",
#define ERR_BADBANGARG 95
"Bad ! arg selector",
#define ERR_NOSEARCH 96
"No prev search",
#define ERR_NOEVENT 97
"%s: Event not found",
#define ERR_TOOMANYRP 98
"Too many )'s",
#define ERR_TOOMANYLP 99
"Too many ('s",
#define ERR_BADPLP 100
"Badly placed (",
#define ERR_MISRED 101
"Missing name for redirect",
#define ERR_OUTRED 102
"Ambiguous output redirect",
#define ERR_REDPAR 103
"Can't << within ()'s",
#define ERR_INRED 104
"Ambiguous input redirect",
#define ERR_ALIASLOOP 105
"Alias loop",
#define ERR_HISTLOOP 106
"!# History loop",
#define ERR_ARCH 107
"%s: %s. Wrong Architecture",
#define ERR_FILEINQ 108
"Malformed file inquiry",
#define ERR_SELOVFL 109
"Selector overflow",
#define ERR_INVALID 110
"Invalid Error"
};
/*
* The parser and scanner set up errors for later by calling seterr,
* which sets the variable err as a side effect; later to be tested,
* e.g. in process.
*/
void
#if __STDC__
seterror(int id, ...)
#else
seterror(id, va_alist)
int id;
va_dcl
#endif
{
if (seterr == 0) {
char berr[BUFSIZ];
va_list va;
#if __STDC__
va_start(va, id);
#else
va_start(va);
#endif
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID;
vsnprintf(berr, sizeof(berr), errorlist[id], va);
va_end(va);
seterr = strsave(berr);
}
}
/*
* Print the error with the given id.
*
* Special ids:
* ERR_SILENT: Print nothing.
* ERR_OLD: Print the previously set error if one was there.
* otherwise return.
* ERR_NAME: If this bit is set, print the name of the function
* in bname
*
* This routine always resets or exits. The flag haderr
* is set so the routine who catches the unwind can propagate
* it if they want.
*
* Note that any open files at the point of error will eventually
* be closed in the routine process in sh.c which is the only
* place error unwinds are ever caught.
*/
void
#if __STDC__
stderror(int id, ...)
#else
stderror(id, va_alist)
int id;
va_dcl
#endif
{
va_list va;
Char **v;
int flags = id & ERR_FLAGS;
id &= ~ERR_FLAGS;
if ((flags & ERR_OLD) && seterr == NULL)
return;
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID;
(void) fflush(cshout);
(void) fflush(csherr);
haderr = 1; /* Now to diagnostic output */
timflg = 0; /* This isn't otherwise reset */
if (!(flags & ERR_SILENT)) {
if (flags & ERR_NAME)
(void) fprintf(csherr, "%s: ", bname);
if ((flags & ERR_OLD))
/* Old error. */
(void) fprintf(csherr, "%s.\n", seterr);
else {
#if __STDC__
va_start(va, id);
#else
va_start(va);
#endif
(void) vfprintf(csherr, errorlist[id], va);
va_end(va);
(void) fprintf(csherr, ".\n");
}
}
if (seterr) {
xfree((ptr_t) seterr);
seterr = NULL;
}
if ((v = pargv) != NULL)
pargv = 0, blkfree(v);
if ((v = gargv) != NULL)
gargv = 0, blkfree(v);
(void) fflush(cshout);
(void) fflush(csherr);
didfds = 0; /* Forget about 0,1,2 */
/*
* Go away if -e or we are a child shell
*/
if (exiterr || child)
xexit(1);
/*
* Reset the state of the input. This buffered seek to end of file will
* also clear the while/foreach stack.
*/
btoeof();
set(STRstatus, Strsave(STR1));
if (tpgrp > 0)
(void) tcsetpgrp(FSHTTY, tpgrp);
reset(); /* Unwind */
}
-746
View File
@@ -1,746 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/param.h>
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
/*
* System level search and execute of a command. We look in each directory
* for the specified command name. If the name contains a '/' then we
* execute only the full path name. If there is no search path then we
* execute only full path names.
*/
extern char **environ;
/*
* As we search for the command we note the first non-trivial error
* message for presentation to the user. This allows us often
* to show that a file has the wrong mode/no access when the file
* is not in the last component of the search path, so we must
* go on after first detecting the error.
*/
static char *exerr; /* Execution error message */
static Char *expath; /* Path for exerr */
/*
* Xhash is an array of HSHSIZ bits (HSHSIZ / 8 chars), which are used
* to hash execs. If it is allocated (havhash true), then to tell
* whether ``name'' is (possibly) present in the i'th component
* of the variable path, you look at the bit in xhash indexed by
* hash(hashname("name"), i). This is setup automatically
* after .login is executed, and recomputed whenever ``path'' is
* changed.
* The two part hash function is designed to let texec() call the
* more expensive hashname() only once and the simple hash() several
* times (once for each path component checked).
* Byte size is assumed to be 8.
*/
#define HSHSIZ 8192 /* 1k bytes */
#define HSHMASK (HSHSIZ - 1)
#define HSHMUL 243
static char xhash[HSHSIZ / 8];
#define hash(a, b) (((a) * HSHMUL + (b)) & HSHMASK)
#define bit(h, b) ((h)[(b) >> 3] & 1 << ((b) & 7)) /* bit test */
#define bis(h, b) ((h)[(b) >> 3] |= 1 << ((b) & 7)) /* bit set */
static int hits, misses;
/* Dummy search path for just absolute search when no path */
static Char *justabs[] = {STRNULL, 0};
static void pexerr __P((void));
static void texec __P((Char *, Char **));
static int hashname __P((Char *));
static void tellmewhat __P((struct wordent *));
static int executable __P((Char *, Char *, bool));
static int iscommand __P((Char *));
void
/*ARGSUSED*/
doexec(v, t)
Char **v;
struct command *t;
{
Char *dp, **pv, **av, *sav;
struct varent *pathv;
bool slash;
int hashval = 0, hashval1, i;
Char *blk[2];
/*
* Glob the command name. We will search $path even if this does something,
* as in sh but not in csh. One special case: if there is no PATH, then we
* execute only commands which start with '/'.
*/
blk[0] = t->t_dcom[0];
blk[1] = 0;
gflag = 0, tglob(blk);
if (gflag) {
pv = globall(blk);
if (pv == 0) {
setname(vis_str(blk[0]));
stderror(ERR_NAME | ERR_NOMATCH);
}
gargv = 0;
}
else
pv = saveblk(blk);
trim(pv);
exerr = 0;
expath = Strsave(pv[0]);
Vexpath = expath;
pathv = adrof(STRpath);
if (pathv == 0 && expath[0] != '/') {
blkfree(pv);
pexerr();
}
slash = any(short2str(expath), '/');
/*
* Glob the argument list, if necessary. Otherwise trim off the quote bits.
*/
gflag = 0;
av = &t->t_dcom[1];
tglob(av);
if (gflag) {
av = globall(av);
if (av == 0) {
blkfree(pv);
setname(vis_str(expath));
stderror(ERR_NAME | ERR_NOMATCH);
}
gargv = 0;
}
else
av = saveblk(av);
blkfree(t->t_dcom);
t->t_dcom = blkspl(pv, av);
xfree((ptr_t) pv);
xfree((ptr_t) av);
av = t->t_dcom;
trim(av);
if (*av == NULL || **av == '\0')
pexerr();
xechoit(av); /* Echo command if -x */
/*
* Since all internal file descriptors are set to close on exec, we don't
* need to close them explicitly here. Just reorient ourselves for error
* messages.
*/
SHIN = 0;
SHOUT = 1;
SHERR = 2;
OLDSTD = 0;
/*
* We must do this AFTER any possible forking (like `foo` in glob) so that
* this shell can still do subprocesses.
*/
(void) sigsetmask(0);
/*
* If no path, no words in path, or a / in the filename then restrict the
* command search.
*/
if (pathv == 0 || pathv->vec[0] == 0 || slash)
pv = justabs;
else
pv = pathv->vec;
sav = Strspl(STRslash, *av);/* / command name for postpending */
Vsav = sav;
if (havhash)
hashval = hashname(*av);
i = 0;
hits++;
do {
/*
* Try to save time by looking at the hash table for where this command
* could be. If we are doing delayed hashing, then we put the names in
* one at a time, as the user enters them. This is kinda like Korn
* Shell's "tracked aliases".
*/
if (!slash && pv[0][0] == '/' && havhash) {
hashval1 = hash(hashval, i);
if (!bit(xhash, hashval1))
goto cont;
}
if (pv[0][0] == 0 || eq(pv[0], STRdot)) /* don't make ./xxx */
texec(*av, av);
else {
dp = Strspl(*pv, sav);
Vdp = dp;
texec(dp, av);
Vdp = 0;
xfree((ptr_t) dp);
}
misses++;
cont:
pv++;
i++;
} while (*pv);
hits--;
Vsav = 0;
xfree((ptr_t) sav);
pexerr();
}
static void
pexerr()
{
/* Couldn't find the damn thing */
if (expath) {
setname(vis_str(expath));
Vexpath = 0;
xfree((ptr_t) expath);
expath = 0;
}
else
setname("");
if (exerr)
stderror(ERR_NAME | ERR_STRING, exerr);
stderror(ERR_NAME | ERR_COMMAND);
}
/*
* Execute command f, arg list t.
* Record error message if not found.
* Also do shell scripts here.
*/
static void
texec(sf, st)
Char *sf;
Char **st;
{
char **t;
char *f;
struct varent *v;
Char **vp;
Char *lastsh[2];
int fd;
unsigned char c;
Char *st0, **ost;
/* The order for the conversions is significant */
t = short2blk(st);
f = short2str(sf);
Vt = t;
errno = 0; /* don't use a previous error */
(void) execve(f, t, environ);
Vt = 0;
blkfree((Char **) t);
switch (errno) {
case ENOEXEC:
/*
* From: [email protected] (Casper H.S. Dik) If we could not execute
* it, don't feed it to the shell if it looks like a binary!
*/
if ((fd = open(f, O_RDONLY)) != -1) {
if (read(fd, (char *) &c, 1) == 1) {
if (!Isprint(c) && (c != '\n' && c != '\t')) {
(void) close(fd);
/*
* We *know* what ENOEXEC means.
*/
stderror(ERR_ARCH, f, strerror(errno));
}
}
#ifdef _PATH_BSHELL
else
c = '#';
#endif
(void) close(fd);
}
/*
* If there is an alias for shell, then put the words of the alias in
* front of the argument list replacing the command name. Note no
* interpretation of the words at this point.
*/
v = adrof1(STRshell, &aliases);
if (v == 0) {
vp = lastsh;
vp[0] = adrof(STRshell) ? value(STRshell) : STR_SHELLPATH;
vp[1] = NULL;
#ifdef _PATH_BSHELL
if (fd != -1 && c != '#')
vp[0] = STR_BSHELL;
#endif
}
else
vp = v->vec;
st0 = st[0];
st[0] = sf;
ost = st;
st = blkspl(vp, st); /* Splice up the new arglst */
ost[0] = st0;
sf = *st;
/* The order for the conversions is significant */
t = short2blk(st);
f = short2str(sf);
xfree((ptr_t) st);
Vt = t;
(void) execve(f, t, environ);
Vt = 0;
blkfree((Char **) t);
/* The sky is falling, the sky is falling! */
case ENOMEM:
stderror(ERR_SYSTEM, f, strerror(errno));
case ENOENT:
break;
default:
if (exerr == 0) {
exerr = strerror(errno);
if (expath)
xfree((ptr_t) expath);
expath = Strsave(sf);
Vexpath = expath;
}
}
}
/*ARGSUSED*/
void
execash(t, kp)
Char **t;
struct command *kp;
{
int saveIN, saveOUT, saveDIAG, saveSTD;
int oSHIN;
int oSHOUT;
int oSHERR;
int oOLDSTD;
jmp_buf osetexit;
int my_reenter;
int odidfds;
sig_t osigint, osigquit, osigterm;
if (chkstop == 0 && setintr)
panystop(0);
/*
* Hmm, we don't really want to do that now because we might
* fail, but what is the choice
*/
rechist();
osigint = signal(SIGINT, parintr);
osigquit = signal(SIGQUIT, parintr);
osigterm = signal(SIGTERM, parterm);
odidfds = didfds;
oSHIN = SHIN;
oSHOUT = SHOUT;
oSHERR = SHERR;
oOLDSTD = OLDSTD;
saveIN = dcopy(SHIN, -1);
saveOUT = dcopy(SHOUT, -1);
saveDIAG = dcopy(SHERR, -1);
saveSTD = dcopy(OLDSTD, -1);
lshift(kp->t_dcom, 1);
getexit(osetexit);
if ((my_reenter = setexit()) == 0) {
SHIN = dcopy(0, -1);
SHOUT = dcopy(1, -1);
SHERR = dcopy(2, -1);
didfds = 0;
doexec(t, kp);
}
(void) signal(SIGINT, osigint);
(void) signal(SIGQUIT, osigquit);
(void) signal(SIGTERM, osigterm);
doneinp = 0;
didfds = odidfds;
(void) close(SHIN);
(void) close(SHOUT);
(void) close(SHERR);
(void) close(OLDSTD);
SHIN = dmove(saveIN, oSHIN);
SHOUT = dmove(saveOUT, oSHOUT);
SHERR = dmove(saveDIAG, oSHERR);
OLDSTD = dmove(saveSTD, oOLDSTD);
resexit(osetexit);
if (my_reenter)
stderror(ERR_SILENT);
}
void
xechoit(t)
Char **t;
{
if (adrof(STRecho)) {
(void) fflush(csherr);
blkpr(csherr, t);
(void) fputc('\n', csherr);
}
}
void
/*ARGSUSED*/
dohash(v, t)
Char **v;
struct command *t;
{
DIR *dirp;
struct dirent *dp;
int cnt;
int i = 0;
struct varent *pathv = adrof(STRpath);
Char **pv;
int hashval;
havhash = 1;
for (cnt = 0; cnt < sizeof xhash; cnt++)
xhash[cnt] = 0;
if (pathv == 0)
return;
for (pv = pathv->vec; *pv; pv++, i++) {
if (pv[0][0] != '/')
continue;
dirp = opendir(short2str(*pv));
if (dirp == NULL)
continue;
while ((dp = readdir(dirp)) != NULL) {
if (dp->d_ino == 0)
continue;
if (dp->d_name[0] == '.' &&
(dp->d_name[1] == '\0' ||
(dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
continue;
hashval = hash(hashname(str2short(dp->d_name)), i);
bis(xhash, hashval);
/* tw_add_comm_name (dp->d_name); */
}
(void) closedir(dirp);
}
}
void
/*ARGSUSED*/
dounhash(v, t)
Char **v;
struct command *t;
{
havhash = 0;
}
void
/*ARGSUSED*/
hashstat(v, t)
Char **v;
struct command *t;
{
if (hits + misses)
(void) fprintf(cshout, "%d hits, %d misses, %d%%\n",
hits, misses, 100 * hits / (hits + misses));
}
/*
* Hash a command name.
*/
static int
hashname(cp)
Char *cp;
{
long h = 0;
while (*cp)
h = hash(h, *cp++);
return ((int) h);
}
static int
iscommand(name)
Char *name;
{
Char **pv;
Char *sav;
struct varent *v;
bool slash = any(short2str(name), '/');
int hashval = 0, hashval1, i;
v = adrof(STRpath);
if (v == 0 || v->vec[0] == 0 || slash)
pv = justabs;
else
pv = v->vec;
sav = Strspl(STRslash, name); /* / command name for postpending */
if (havhash)
hashval = hashname(name);
i = 0;
do {
if (!slash && pv[0][0] == '/' && havhash) {
hashval1 = hash(hashval, i);
if (!bit(xhash, hashval1))
goto cont;
}
if (pv[0][0] == 0 || eq(pv[0], STRdot)) { /* don't make ./xxx */
if (executable(NULL, name, 0)) {
xfree((ptr_t) sav);
return i + 1;
}
}
else {
if (executable(*pv, sav, 0)) {
xfree((ptr_t) sav);
return i + 1;
}
}
cont:
pv++;
i++;
} while (*pv);
xfree((ptr_t) sav);
return 0;
}
/* Also by:
* Andreas Luik <[email protected]>
* I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung
* Azenberstr. 35
* D-7000 Stuttgart 1
* West-Germany
* is the executable() routine below and changes to iscommand().
* Thanks again!!
*/
/*
* executable() examines the pathname obtained by concatenating dir and name
* (dir may be NULL), and returns 1 either if it is executable by us, or
* if dir_ok is set and the pathname refers to a directory.
* This is a bit kludgy, but in the name of optimization...
*/
static int
executable(dir, name, dir_ok)
Char *dir, *name;
bool dir_ok;
{
struct stat stbuf;
Char path[MAXPATHLEN + 1], *dp, *sp;
char *strname;
if (dir && *dir) {
for (dp = path, sp = dir; *sp; *dp++ = *sp++)
if (dp == &path[MAXPATHLEN + 1]) {
*--dp = '\0';
break;
}
for (sp = name; *sp; *dp++ = *sp++)
if (dp == &path[MAXPATHLEN + 1]) {
*--dp = '\0';
break;
}
*dp = '\0';
strname = short2str(path);
}
else
strname = short2str(name);
return (stat(strname, &stbuf) != -1 &&
((S_ISREG(stbuf.st_mode) &&
/* save time by not calling access() in the hopeless case */
(stbuf.st_mode & (S_IXOTH | S_IXGRP | S_IXUSR)) &&
access(strname, X_OK) == 0) ||
(dir_ok && S_ISDIR(stbuf.st_mode))));
}
/* The dowhich() is by:
* Andreas Luik <[email protected]>
* I S A GmbH - Informationssysteme fuer computerintegrierte Automatisierung
* Azenberstr. 35
* D-7000 Stuttgart 1
* West-Germany
* Thanks!!
*/
/*ARGSUSED*/
void
dowhich(v, c)
Char **v;
struct command *c;
{
struct wordent lex[3];
struct varent *vp;
lex[0].next = &lex[1];
lex[1].next = &lex[2];
lex[2].next = &lex[0];
lex[0].prev = &lex[2];
lex[1].prev = &lex[0];
lex[2].prev = &lex[1];
lex[0].word = STRNULL;
lex[2].word = STRret;
while (*++v) {
if ((vp = adrof1(*v, &aliases)) != NULL) {
(void) fprintf(cshout, "%s: \t aliased to ", vis_str(*v));
blkpr(cshout, vp->vec);
(void) fputc('\n', cshout);
}
else {
lex[1].word = *v;
tellmewhat(lex);
}
}
}
static void
tellmewhat(lex)
struct wordent *lex;
{
int i;
struct biltins *bptr;
struct wordent *sp = lex->next;
bool aliased = 0;
Char *s0, *s1, *s2, *cmd;
Char qc;
if (adrof1(sp->word, &aliases)) {
alias(lex);
sp = lex->next;
aliased = 1;
}
s0 = sp->word; /* to get the memory freeing right... */
/* handle quoted alias hack */
if ((*(sp->word) & (QUOTE | TRIM)) == QUOTE)
(sp->word)++;
/* do quoting, if it hasn't been done */
s1 = s2 = sp->word;
while (*s2)
switch (*s2) {
case '\'':
case '"':
qc = *s2++;
while (*s2 && *s2 != qc)
*s1++ = *s2++ | QUOTE;
if (*s2)
s2++;
break;
case '\\':
if (*++s2)
*s1++ = *s2++ | QUOTE;
break;
default:
*s1++ = *s2++;
}
*s1 = '\0';
for (bptr = bfunc; bptr < &bfunc[nbfunc]; bptr++) {
if (eq(sp->word, str2short(bptr->bname))) {
if (aliased)
prlex(cshout, lex);
(void) fprintf(cshout, "%s: shell built-in command.\n",
vis_str(sp->word));
sp->word = s0; /* we save and then restore this */
return;
}
}
sp->word = cmd = globone(sp->word, G_IGNORE);
if ((i = iscommand(strip(sp->word))) != 0) {
Char **pv;
struct varent *v;
bool slash = any(short2str(sp->word), '/');
v = adrof(STRpath);
if (v == 0 || v->vec[0] == 0 || slash)
pv = justabs;
else
pv = v->vec;
while (--i)
pv++;
if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
if (!slash) {
sp->word = Strspl(STRdotsl, sp->word);
prlex(cshout, lex);
xfree((ptr_t) sp->word);
} else
prlex(cshout, lex);
sp->word = s0; /* we save and then restore this */
xfree((ptr_t) cmd);
return;
}
s1 = Strspl(*pv, STRslash);
sp->word = Strspl(s1, sp->word);
xfree((ptr_t) s1);
prlex(cshout, lex);
xfree((ptr_t) sp->word);
}
else {
if (aliased)
prlex(cshout, lex);
(void) fprintf(csherr, "%s: Command not found.\n", vis_str(sp->word));
}
xfree((ptr_t) cmd);
sp->word = s0; /* we save and then restore this */
}
-712
View File
@@ -1,712 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
#define IGNORE 1 /* in ignore, it means to ignore value, just parse */
#define NOGLOB 2 /* in ignore, it means not to globone */
#define ADDOP 1
#define MULOP 2
#define EQOP 4
#define RELOP 8
#define RESTOP 16
#define ANYOP 31
#define EQEQ 1
#define GTR 2
#define LSS 4
#define NOTEQ 6
#define EQMATCH 7
#define NOTEQMATCH 8
static int exp1 __P((Char ***, bool));
static int exp2 __P((Char ***, bool));
static int exp2a __P((Char ***, bool));
static int exp2b __P((Char ***, bool));
static int exp2c __P((Char ***, bool));
static Char * exp3 __P((Char ***, bool));
static Char * exp3a __P((Char ***, bool));
static Char * exp4 __P((Char ***, bool));
static Char * exp5 __P((Char ***, bool));
static Char * exp6 __P((Char ***, bool));
static void evalav __P((Char **));
static int isa __P((Char *, int));
static int egetn __P((Char *));
#ifdef EDEBUG
static void etracc __P((char *, Char *, Char ***));
static void etraci __P((char *, int, Char ***));
#endif
int
expr(vp)
Char ***vp;
{
return (exp0(vp, 0));
}
int
exp0(vp, ignore)
Char ***vp;
bool ignore;
{
int p1 = exp1(vp, ignore);
#ifdef EDEBUG
etraci("exp0 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRor2)) {
int p2;
(*vp)++;
p2 = exp0(vp, (ignore & IGNORE) || p1);
#ifdef EDEBUG
etraci("exp0 p2", p2, vp);
#endif
return (p1 || p2);
}
return (p1);
}
static int
exp1(vp, ignore)
Char ***vp;
bool ignore;
{
int p1 = exp2(vp, ignore);
#ifdef EDEBUG
etraci("exp1 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRand2)) {
int p2;
(*vp)++;
p2 = exp1(vp, (ignore & IGNORE) || !p1);
#ifdef EDEBUG
etraci("exp1 p2", p2, vp);
#endif
return (p1 && p2);
}
return (p1);
}
static int
exp2(vp, ignore)
Char ***vp;
bool ignore;
{
int p1 = exp2a(vp, ignore);
#ifdef EDEBUG
etraci("exp3 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRor)) {
int p2;
(*vp)++;
p2 = exp2(vp, ignore);
#ifdef EDEBUG
etraci("exp3 p2", p2, vp);
#endif
return (p1 | p2);
}
return (p1);
}
static int
exp2a(vp, ignore)
Char ***vp;
bool ignore;
{
int p1 = exp2b(vp, ignore);
#ifdef EDEBUG
etraci("exp2a p1", p1, vp);
#endif
if (**vp && eq(**vp, STRcaret)) {
int p2;
(*vp)++;
p2 = exp2a(vp, ignore);
#ifdef EDEBUG
etraci("exp2a p2", p2, vp);
#endif
return (p1 ^ p2);
}
return (p1);
}
static int
exp2b(vp, ignore)
Char ***vp;
bool ignore;
{
int p1 = exp2c(vp, ignore);
#ifdef EDEBUG
etraci("exp2b p1", p1, vp);
#endif
if (**vp && eq(**vp, STRand)) {
int p2;
(*vp)++;
p2 = exp2b(vp, ignore);
#ifdef EDEBUG
etraci("exp2b p2", p2, vp);
#endif
return (p1 & p2);
}
return (p1);
}
static int
exp2c(vp, ignore)
Char ***vp;
bool ignore;
{
Char *p1 = exp3(vp, ignore);
Char *p2;
int i;
#ifdef EDEBUG
etracc("exp2c p1", p1, vp);
#endif
if ((i = isa(**vp, EQOP)) != 0) {
(*vp)++;
if (i == EQMATCH || i == NOTEQMATCH)
ignore |= NOGLOB;
p2 = exp3(vp, ignore);
#ifdef EDEBUG
etracc("exp2c p2", p2, vp);
#endif
if (!(ignore & IGNORE))
switch (i) {
case EQEQ:
i = eq(p1, p2);
break;
case NOTEQ:
i = !eq(p1, p2);
break;
case EQMATCH:
i = Gmatch(p1, p2);
break;
case NOTEQMATCH:
i = !Gmatch(p1, p2);
break;
}
xfree((ptr_t) p1);
xfree((ptr_t) p2);
return (i);
}
i = egetn(p1);
xfree((ptr_t) p1);
return (i);
}
static Char *
exp3(vp, ignore)
Char ***vp;
bool ignore;
{
Char *p1, *p2;
int i;
p1 = exp3a(vp, ignore);
#ifdef EDEBUG
etracc("exp3 p1", p1, vp);
#endif
if ((i = isa(**vp, RELOP)) != 0) {
(*vp)++;
if (**vp && eq(**vp, STRequal))
i |= 1, (*vp)++;
p2 = exp3(vp, ignore);
#ifdef EDEBUG
etracc("exp3 p2", p2, vp);
#endif
if (!(ignore & IGNORE))
switch (i) {
case GTR:
i = egetn(p1) > egetn(p2);
break;
case GTR | 1:
i = egetn(p1) >= egetn(p2);
break;
case LSS:
i = egetn(p1) < egetn(p2);
break;
case LSS | 1:
i = egetn(p1) <= egetn(p2);
break;
}
xfree((ptr_t) p1);
xfree((ptr_t) p2);
return (putn(i));
}
return (p1);
}
static Char *
exp3a(vp, ignore)
Char ***vp;
bool ignore;
{
Char *p1, *p2, *op;
int i;
p1 = exp4(vp, ignore);
#ifdef EDEBUG
etracc("exp3a p1", p1, vp);
#endif
op = **vp;
if (op && any("<>", op[0]) && op[0] == op[1]) {
(*vp)++;
p2 = exp3a(vp, ignore);
#ifdef EDEBUG
etracc("exp3a p2", p2, vp);
#endif
if (op[0] == '<')
i = egetn(p1) << egetn(p2);
else
i = egetn(p1) >> egetn(p2);
xfree((ptr_t) p1);
xfree((ptr_t) p2);
return (putn(i));
}
return (p1);
}
static Char *
exp4(vp, ignore)
Char ***vp;
bool ignore;
{
Char *p1, *p2;
int i = 0;
p1 = exp5(vp, ignore);
#ifdef EDEBUG
etracc("exp4 p1", p1, vp);
#endif
if (isa(**vp, ADDOP)) {
Char *op = *(*vp)++;
p2 = exp4(vp, ignore);
#ifdef EDEBUG
etracc("exp4 p2", p2, vp);
#endif
if (!(ignore & IGNORE))
switch (op[0]) {
case '+':
i = egetn(p1) + egetn(p2);
break;
case '-':
i = egetn(p1) - egetn(p2);
break;
}
xfree((ptr_t) p1);
xfree((ptr_t) p2);
return (putn(i));
}
return (p1);
}
static Char *
exp5(vp, ignore)
Char ***vp;
bool ignore;
{
Char *p1, *p2;
int i = 0;
p1 = exp6(vp, ignore);
#ifdef EDEBUG
etracc("exp5 p1", p1, vp);
#endif
if (isa(**vp, MULOP)) {
Char *op = *(*vp)++;
p2 = exp5(vp, ignore);
#ifdef EDEBUG
etracc("exp5 p2", p2, vp);
#endif
if (!(ignore & IGNORE))
switch (op[0]) {
case '*':
i = egetn(p1) * egetn(p2);
break;
case '/':
i = egetn(p2);
if (i == 0)
stderror(ERR_DIV0);
i = egetn(p1) / i;
break;
case '%':
i = egetn(p2);
if (i == 0)
stderror(ERR_MOD0);
i = egetn(p1) % i;
break;
}
xfree((ptr_t) p1);
xfree((ptr_t) p2);
return (putn(i));
}
return (p1);
}
static Char *
exp6(vp, ignore)
Char ***vp;
bool ignore;
{
int ccode, i = 0;
Char *cp, *dp, *ep;
if (**vp == 0)
stderror(ERR_NAME | ERR_EXPRESSION);
if (eq(**vp, STRbang)) {
(*vp)++;
cp = exp6(vp, ignore);
#ifdef EDEBUG
etracc("exp6 ! cp", cp, vp);
#endif
i = egetn(cp);
xfree((ptr_t) cp);
return (putn(!i));
}
if (eq(**vp, STRtilde)) {
(*vp)++;
cp = exp6(vp, ignore);
#ifdef EDEBUG
etracc("exp6 ~ cp", cp, vp);
#endif
i = egetn(cp);
xfree((ptr_t) cp);
return (putn(~i));
}
if (eq(**vp, STRLparen)) {
(*vp)++;
ccode = exp0(vp, ignore);
#ifdef EDEBUG
etraci("exp6 () ccode", ccode, vp);
#endif
if (*vp == 0 || **vp == 0 || ***vp != ')')
stderror(ERR_NAME | ERR_EXPRESSION);
(*vp)++;
return (putn(ccode));
}
if (eq(**vp, STRLbrace)) {
Char **v;
struct command faket;
Char *fakecom[2];
faket.t_dtyp = NODE_COMMAND;
faket.t_dflg = 0;
faket.t_dcar = faket.t_dcdr = faket.t_dspr = NULL;
faket.t_dcom = fakecom;
fakecom[0] = STRfakecom;
fakecom[1] = NULL;
(*vp)++;
v = *vp;
for (;;) {
if (!**vp)
stderror(ERR_NAME | ERR_MISSING, '}');
if (eq(*(*vp)++, STRRbrace))
break;
}
if (ignore & IGNORE)
return (Strsave(STRNULL));
psavejob();
if (pfork(&faket, -1) == 0) {
*--(*vp) = 0;
evalav(v);
exitstat();
}
pwait();
prestjob();
#ifdef EDEBUG
etraci("exp6 {} status", egetn(value(STRstatus)), vp);
#endif
return (putn(egetn(value(STRstatus)) == 0));
}
if (isa(**vp, ANYOP))
return (Strsave(STRNULL));
cp = *(*vp)++;
if (*cp == '-' && any("erwxfdzopls", cp[1])) {
struct stat stb;
if (cp[2] != '\0')
stderror(ERR_NAME | ERR_FILEINQ);
/*
* Detect missing file names by checking for operator in the file name
* position. However, if an operator name appears there, we must make
* sure that there's no file by that name (e.g., "/") before announcing
* an error. Even this check isn't quite right, since it doesn't take
* globbing into account.
*/
if (isa(**vp, ANYOP) && stat(short2str(**vp), &stb))
stderror(ERR_NAME | ERR_FILENAME);
dp = *(*vp)++;
if (ignore & IGNORE)
return (Strsave(STRNULL));
ep = globone(dp, G_ERROR);
switch (cp[1]) {
case 'r':
i = !access(short2str(ep), R_OK);
break;
case 'w':
i = !access(short2str(ep), W_OK);
break;
case 'x':
i = !access(short2str(ep), X_OK);
break;
default:
if (
#ifdef S_IFLNK
cp[1] == 'l' ? lstat(short2str(ep), &stb) :
#endif
stat(short2str(ep), &stb)) {
xfree((ptr_t) ep);
return (Strsave(STR0));
}
switch (cp[1]) {
case 'f':
i = S_ISREG(stb.st_mode);
break;
case 'd':
i = S_ISDIR(stb.st_mode);
break;
case 'p':
#ifdef S_ISFIFO
i = S_ISFIFO(stb.st_mode);
#else
i = 0;
#endif
break;
case 'l':
#ifdef S_ISLNK
i = S_ISLNK(stb.st_mode);
#else
i = 0;
#endif
break;
case 's':
#ifdef S_ISSOCK
i = S_ISSOCK(stb.st_mode);
#else
i = 0;
#endif
break;
case 'z':
i = stb.st_size == 0;
break;
case 'e':
i = 1;
break;
case 'o':
i = stb.st_uid == uid;
break;
}
}
#ifdef EDEBUG
etraci("exp6 -? i", i, vp);
#endif
xfree((ptr_t) ep);
return (putn(i));
}
#ifdef EDEBUG
etracc("exp6 default", cp, vp);
#endif
return (ignore & NOGLOB ? Strsave(cp) : globone(cp, G_ERROR));
}
static void
evalav(v)
Char **v;
{
struct wordent paraml1;
struct wordent *hp = &paraml1;
struct command *t;
struct wordent *wdp = hp;
set(STRstatus, Strsave(STR0));
hp->prev = hp->next = hp;
hp->word = STRNULL;
while (*v) {
struct wordent *new =
(struct wordent *) xcalloc(1, sizeof *wdp);
new->prev = wdp;
new->next = hp;
wdp->next = new;
wdp = new;
wdp->word = Strsave(*v++);
}
hp->prev = wdp;
alias(&paraml1);
t = syntax(paraml1.next, &paraml1, 0);
if (seterr)
stderror(ERR_OLD);
execute(t, -1, NULL, NULL);
freelex(&paraml1), freesyn(t);
}
static int
isa(cp, what)
Char *cp;
int what;
{
if (cp == 0)
return ((what & RESTOP) != 0);
if (cp[1] == 0) {
if (what & ADDOP && (*cp == '+' || *cp == '-'))
return (1);
if (what & MULOP && (*cp == '*' || *cp == '/' || *cp == '%'))
return (1);
if (what & RESTOP && (*cp == '(' || *cp == ')' || *cp == '!' ||
*cp == '~' || *cp == '^' || *cp == '"'))
return (1);
}
else if (cp[2] == 0) {
if (what & RESTOP) {
if (cp[0] == '|' && cp[1] == '&')
return (1);
if (cp[0] == '<' && cp[1] == '<')
return (1);
if (cp[0] == '>' && cp[1] == '>')
return (1);
}
if (what & EQOP) {
if (cp[0] == '=') {
if (cp[1] == '=')
return (EQEQ);
if (cp[1] == '~')
return (EQMATCH);
}
else if (cp[0] == '!') {
if (cp[1] == '=')
return (NOTEQ);
if (cp[1] == '~')
return (NOTEQMATCH);
}
}
}
if (what & RELOP) {
if (*cp == '<')
return (LSS);
if (*cp == '>')
return (GTR);
}
return (0);
}
static int
egetn(cp)
Char *cp;
{
if (*cp && *cp != '-' && !Isdigit(*cp))
stderror(ERR_NAME | ERR_EXPRESSION);
return (getn(cp));
}
/* Phew! */
#ifdef EDEBUG
static void
etraci(str, i, vp)
char *str;
int i;
Char ***vp;
{
(void) fprintf(csherr, "%s=%d\t", str, i);
blkpr(csherr, *vp);
(void) fprintf(csherr, "\n");
}
static void
etracc(str, cp, vp)
char *str;
Char *cp;
Char ***vp;
{
(void) fprintf(csherr, "%s=%s\t", str, vis_str(cp));
blkpr(csherr, *vp);
(void) fprintf(csherr, "\n");
}
#endif
-339
View File
@@ -1,339 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)extern.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
#include <sys/cdefs.h>
/*
* csh.c
*/
int gethdir __P((Char *));
void dosource __P((Char **, struct command *));
void exitstat __P((void));
void goodbye __P((void));
void importpath __P((Char *));
void initdesc __P((void));
void pintr __P((int));
void pintr1 __P((bool));
void printprompt __P((void));
void process __P((bool));
void rechist __P((void));
void untty __P((void));
int vis_fputc __P((int, FILE *));
#ifdef PROF
void done __P((int));
#else
void xexit __P((int));
#endif
/*
* dir.c
*/
void dinit __P((Char *));
void dodirs __P((Char **, struct command *));
Char *dcanon __P((Char *, Char *));
void dtildepr __P((Char *, Char *));
void dtilde __P((void));
void dochngd __P((Char **, struct command *));
Char *dnormalize __P((Char *));
void dopushd __P((Char **, struct command *));
void dopopd __P((Char **, struct command *));
struct directory;
void dfree __P((struct directory *));
/*
* dol.c
*/
void Dfix __P((struct command *));
Char *Dfix1 __P((Char *));
void heredoc __P((Char *));
/*
* err.c
*/
void seterror __P((int, ...));
void stderror __P((int, ...));
/*
* exec.c
*/
void doexec __P((Char **, struct command *));
void dohash __P((Char **, struct command *));
void dounhash __P((Char **, struct command *));
void dowhich __P((Char **, struct command *));
void execash __P((Char **, struct command *));
void hashstat __P((Char **, struct command *));
void xechoit __P((Char **));
/*
* exp.c
*/
int expr __P((Char ***));
int exp0 __P((Char ***, bool));
/*
* file.c
*/
#ifdef FILEC
int tenex __P((Char *, int));
#endif
/*
* func.c
*/
void Setenv __P((Char *, Char *));
void doalias __P((Char **, struct command *));
void dobreak __P((Char **, struct command *));
void docontin __P((Char **, struct command *));
void doecho __P((Char **, struct command *));
void doelse __P((Char **, struct command *));
void doend __P((Char **, struct command *));
void doeval __P((Char **, struct command *));
void doexit __P((Char **, struct command *));
void doforeach __P((Char **, struct command *));
void doglob __P((Char **, struct command *));
void dogoto __P((Char **, struct command *));
void doif __P((Char **, struct command *));
void dolimit __P((Char **, struct command *));
void dologin __P((Char **, struct command *));
void dologout __P((Char **, struct command *));
void donohup __P((Char **, struct command *));
void doonintr __P((Char **, struct command *));
void doprintf __P((Char **, struct command *));
void dorepeat __P((Char **, struct command *));
void dosetenv __P((Char **, struct command *));
void dosuspend __P((Char **, struct command *));
void doswbrk __P((Char **, struct command *));
void doswitch __P((Char **, struct command *));
void doumask __P((Char **, struct command *));
void dounlimit __P((Char **, struct command *));
void dounsetenv __P((Char **, struct command *));
void dowhile __P((Char **, struct command *));
void dozip __P((Char **, struct command *));
void func __P((struct command *, struct biltins *));
struct biltins *
isbfunc __P((struct command *));
void prvars __P((void));
void gotolab __P((Char *));
int srchx __P((Char *));
void unalias __P((Char **, struct command *));
void wfree __P((void));
/*
* glob.c
*/
Char **dobackp __P((Char *, bool));
void Gcat __P((Char *, Char *));
Char *globone __P((Char *, int));
int Gmatch __P((Char *, Char *));
void ginit __P((void));
Char **globall __P((Char **));
void rscan __P((Char **, void (*)(int)));
void tglob __P((Char **));
void trim __P((Char **));
#ifdef FILEC
int sortscmp __P((const ptr_t, const ptr_t));
#endif /* FILEC */
/*
* hist.c
*/
void dohist __P((Char **, struct command *));
struct Hist *
enthist __P((int, struct wordent *, bool));
void savehist __P((struct wordent *));
/*
* lex.c
*/
void addla __P((Char *));
void bseek __P((struct Ain *));
void btell __P((struct Ain *));
void btoeof __P((void));
void copylex __P((struct wordent *, struct wordent *));
Char *domod __P((Char *, int));
void freelex __P((struct wordent *));
int lex __P((struct wordent *));
void prlex __P((FILE *, struct wordent *));
int readc __P((bool));
void settell __P((void));
void unreadc __P((int));
/*
* misc.c
*/
int any __P((char *, int));
Char **blkcat __P((Char **, Char **));
Char **blkcpy __P((Char **, Char **));
Char **blkend __P((Char **));
void blkfree __P((Char **));
int blklen __P((Char **));
void blkpr __P((FILE *, Char **));
Char **blkspl __P((Char **, Char **));
void closem __P((void));
Char **copyblk __P((Char **));
int dcopy __P((int, int));
int dmove __P((int, int));
void donefds __P((void));
Char lastchr __P((Char *));
void lshift __P((Char **, int));
int number __P((Char *));
int prefix __P((Char *, Char *));
Char **saveblk __P((Char **));
void setzero __P((char *, int));
Char *strip __P((Char *));
char *strsave __P((char *));
char *strspl __P((char *, char *));
void udvar __P((Char *));
#ifndef SHORT_STRINGS
# ifdef NOTUSED
char *strstr __P((const char *, const char *));
# endif /* NOTUSED */
char *strend __P((char *));
#endif
/*
* parse.c
*/
void alias __P((struct wordent *));
void freesyn __P((struct command *));
struct command *
syntax __P((struct wordent *, struct wordent *, int));
/*
* proc.c
*/
void dobg __P((Char **, struct command *));
void dobg1 __P((Char **, struct command *));
void dofg __P((Char **, struct command *));
void dofg1 __P((Char **, struct command *));
void dojobs __P((Char **, struct command *));
void dokill __P((Char **, struct command *));
void donotify __P((Char **, struct command *));
void dostop __P((Char **, struct command *));
void dowait __P((Char **, struct command *));
void palloc __P((int, struct command *));
void panystop __P((bool));
void pchild __P((int));
void pendjob __P((void));
struct process *
pfind __P((Char *));
int pfork __P((struct command *, int));
void pgetty __P((int, int));
void pjwait __P((struct process *));
void pnote __P((void));
void prestjob __P((void));
void psavejob __P((void));
void pstart __P((struct process *, int));
void pwait __P((void));
/*
* sem.c
*/
void execute __P((struct command *, int, int *, int *));
void mypipe __P((int *));
/*
* set.c
*/
struct varent
*adrof1 __P((Char *, struct varent *));
void doset __P((Char **, struct command *));
void dolet __P((Char **, struct command *));
Char *putn __P((int));
int getn __P((Char *));
Char *value1 __P((Char *, struct varent *));
void set __P((Char *, Char *));
void set1 __P((Char *, Char **, struct varent *));
void setq __P((Char *, Char **, struct varent *));
void unset __P((Char **, struct command *));
void unset1 __P((Char *[], struct varent *));
void unsetv __P((Char *));
void setNS __P((Char *));
void shift __P((Char **, struct command *));
void plist __P((struct varent *));
/*
* time.c
*/
void donice __P((Char **, struct command *));
void dotime __P((Char **, struct command *));
void prusage __P((struct rusage *, struct rusage *,
struct timeval *, struct timeval *));
void ruadd __P((struct rusage *, struct rusage *));
void settimes __P((void));
void tvadd __P((struct timeval *, struct timeval *));
void tvsub __P((struct timeval *, struct timeval *, struct timeval *));
void pcsecs __P((long));
void psecs __P((long));
/*
* alloc.c
*/
void Free __P((ptr_t));
ptr_t Malloc __P((size_t));
ptr_t Realloc __P((ptr_t, size_t));
ptr_t Calloc __P((size_t, size_t));
void showall __P((Char **, struct command *));
/*
* str.c:
*/
#ifdef SHORT_STRINGS
Char *s_strchr __P((Char *, int));
Char *s_strrchr __P((Char *, int));
Char *s_strcat __P((Char *, Char *));
#ifdef NOTUSED
Char *s_strncat __P((Char *, Char *, size_t));
#endif
Char *s_strcpy __P((Char *, Char *));
Char *s_strncpy __P((Char *, Char *, size_t));
Char *s_strspl __P((Char *, Char *));
size_t s_strlen __P((Char *));
int s_strcmp __P((Char *, Char *));
int s_strncmp __P((Char *, Char *, size_t));
Char *s_strsave __P((Char *));
Char *s_strend __P((Char *));
Char *s_strstr __P((Char *, Char *));
Char *str2short __P((char *));
Char **blk2short __P((char **));
char *short2str __P((Char *));
char **short2blk __P((Char **));
#endif
char *short2qstr __P((Char *));
char *vis_str __P((Char *));
-685
View File
@@ -1,685 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#ifdef FILEC
#include <sys/param.h>
#include <sys/stat.h>
#include <termios.h>
#include <dirent.h>
#include <pwd.h>
#include <stdlib.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
/*
* Tenex style file name recognition, .. and more.
* History:
* Author: Ken Greer, Sept. 1975, CMU.
* Finally got around to adding to the Cshell., Ken Greer, Dec. 1981.
*/
#define ON 1
#define OFF 0
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define ESC '\033'
typedef enum {
LIST, RECOGNIZE
} COMMAND;
static void setup_tty __P((int));
static void back_to_col_1 __P((void));
static void pushback __P((Char *));
static void catn __P((Char *, Char *, int));
static void copyn __P((Char *, Char *, int));
static Char filetype __P((Char *, Char *));
static void print_by_column __P((Char *, Char *[], int));
static Char *tilde __P((Char *, Char *));
static void retype __P((void));
static void beep __P((void));
static void print_recognized_stuff __P((Char *));
static void extract_dir_and_name __P((Char *, Char *, Char *));
static Char *getentry __P((DIR *, int));
static void free_items __P((Char **));
static int tsearch __P((Char *, COMMAND, int));
static int recognize __P((Char *, Char *, int, int));
static int is_prefix __P((Char *, Char *));
static int is_suffix __P((Char *, Char *));
static int ignored __P((Char *));
/*
* Put this here so the binary can be patched with adb to enable file
* completion by default. Filec controls completion, nobeep controls
* ringing the terminal bell on incomplete expansions.
*/
bool filec = 0;
static void
setup_tty(on)
int on;
{
struct termios tchars;
(void) tcgetattr(SHIN, &tchars);
if (on) {
tchars.c_cc[VEOL] = ESC;
if (tchars.c_lflag & ICANON)
on = TCSADRAIN;
else {
on = TCSAFLUSH;
tchars.c_lflag |= ICANON;
}
}
else {
tchars.c_cc[VEOL] = _POSIX_VDISABLE;
on = TCSADRAIN;
}
(void) tcsetattr(SHIN, on, &tchars);
}
/*
* Move back to beginning of current line
*/
static void
back_to_col_1()
{
struct termios tty, tty_normal;
int omask;
omask = sigblock(sigmask(SIGINT));
(void) tcgetattr(SHOUT, &tty);
tty_normal = tty;
tty.c_iflag &= ~INLCR;
tty.c_oflag &= ~ONLCR;
(void) tcsetattr(SHOUT, TCSANOW, &tty);
(void) write(SHOUT, "\r", 1);
(void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
(void) sigsetmask(omask);
}
/*
* Push string contents back into tty queue
*/
static void
pushback(string)
Char *string;
{
Char *p;
struct termios tty, tty_normal;
int omask;
char c;
omask = sigblock(sigmask(SIGINT));
(void) tcgetattr(SHOUT, &tty);
tty_normal = tty;
tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
(void) tcsetattr(SHOUT, TCSANOW, &tty);
for (p = string; (c = *p) != '\0'; p++)
(void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
(void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
(void) sigsetmask(omask);
}
/*
* Concatenate src onto tail of des.
* Des is a string whose maximum length is count.
* Always null terminate.
*/
static void
catn(des, src, count)
Char *des, *src;
int count;
{
while (--count >= 0 && *des)
des++;
while (--count >= 0)
if ((*des++ = *src++) == 0)
return;
*des = '\0';
}
/*
* Like strncpy but always leave room for trailing \0
* and always null terminate.
*/
static void
copyn(des, src, count)
Char *des, *src;
int count;
{
while (--count >= 0)
if ((*des++ = *src++) == 0)
return;
*des = '\0';
}
static Char
filetype(dir, file)
Char *dir, *file;
{
Char path[MAXPATHLEN];
struct stat statb;
catn(Strcpy(path, dir), file, sizeof(path) / sizeof(Char));
if (lstat(short2str(path), &statb) == 0) {
switch (statb.st_mode & S_IFMT) {
case S_IFDIR:
return ('/');
case S_IFLNK:
if (stat(short2str(path), &statb) == 0 && /* follow it out */
S_ISDIR(statb.st_mode))
return ('>');
else
return ('@');
case S_IFSOCK:
return ('=');
default:
if (statb.st_mode & 0111)
return ('*');
}
}
return (' ');
}
static struct winsize win;
/*
* Print sorted down columns
*/
static void
print_by_column(dir, items, count)
Char *dir, *items[];
int count;
{
int i, rows, r, c, maxwidth = 0, columns;
if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0)
win.ws_col = 80;
for (i = 0; i < count; i++)
maxwidth = maxwidth > (r = Strlen(items[i])) ? maxwidth : r;
maxwidth += 2; /* for the file tag and space */
columns = win.ws_col / maxwidth;
if (columns == 0)
columns = 1;
rows = (count + (columns - 1)) / columns;
for (r = 0; r < rows; r++) {
for (c = 0; c < columns; c++) {
i = c * rows + r;
if (i < count) {
int w;
(void) fprintf(cshout, "%s", vis_str(items[i]));
(void) fputc(dir ? filetype(dir, items[i]) : ' ', cshout);
if (c < columns - 1) { /* last column? */
w = Strlen(items[i]) + 1;
for (; w < maxwidth; w++)
(void) fputc(' ', cshout);
}
}
}
(void) fputc('\r', cshout);
(void) fputc('\n', cshout);
}
}
/*
* Expand file name with possible tilde usage
* ~person/mumble
* expands to
* home_directory_of_person/mumble
*/
static Char *
tilde(new, old)
Char *new, *old;
{
Char *o, *p;
struct passwd *pw;
static Char person[40];
if (old[0] != '~')
return (Strcpy(new, old));
for (p = person, o = &old[1]; *o && *o != '/'; *p++ = *o++)
continue;
*p = '\0';
if (person[0] == '\0')
(void) Strcpy(new, value(STRhome));
else {
pw = getpwnam(short2str(person));
if (pw == NULL)
return (NULL);
(void) Strcpy(new, str2short(pw->pw_dir));
}
(void) Strcat(new, o);
return (new);
}
/*
* Cause pending line to be printed
*/
static void
retype()
{
struct termios tty;
(void) tcgetattr(SHOUT, &tty);
tty.c_lflag |= PENDIN;
(void) tcsetattr(SHOUT, TCSANOW, &tty);
}
static void
beep()
{
if (adrof(STRnobeep) == 0)
(void) write(SHOUT, "\007", 1);
}
/*
* Erase that silly ^[ and
* print the recognized part of the string
*/
static void
print_recognized_stuff(recognized_part)
Char *recognized_part;
{
/* An optimized erasing of that silly ^[ */
(void) fputc('\b', cshout);
(void) fputc('\b', cshout);
switch (Strlen(recognized_part)) {
case 0: /* erase two Characters: ^[ */
(void) fputc(' ', cshout);
(void) fputc(' ', cshout);
(void) fputc('\b', cshout);
(void) fputc('\b', cshout);
break;
case 1: /* overstrike the ^, erase the [ */
(void) fprintf(cshout, "%s", vis_str(recognized_part));
(void) fputc(' ', cshout);
(void) fputc('\b', cshout);
break;
default: /* overstrike both Characters ^[ */
(void) fprintf(cshout, "%s", vis_str(recognized_part));
break;
}
(void) fflush(cshout);
}
/*
* Parse full path in file into 2 parts: directory and file names
* Should leave final slash (/) at end of dir.
*/
static void
extract_dir_and_name(path, dir, name)
Char *path, *dir, *name;
{
Char *p;
p = Strrchr(path, '/');
if (p == NULL) {
copyn(name, path, MAXNAMLEN);
dir[0] = '\0';
}
else {
copyn(name, ++p, MAXNAMLEN);
copyn(dir, path, p - path);
}
}
static Char *
getentry(dir_fd, looking_for_lognames)
DIR *dir_fd;
int looking_for_lognames;
{
struct passwd *pw;
struct dirent *dirp;
if (looking_for_lognames) {
if ((pw = getpwent()) == NULL)
return (NULL);
return (str2short(pw->pw_name));
}
if ((dirp = readdir(dir_fd)) != NULL)
return (str2short(dirp->d_name));
return (NULL);
}
static void
free_items(items)
Char **items;
{
int i;
for (i = 0; items[i]; i++)
xfree((ptr_t) items[i]);
xfree((ptr_t) items);
}
#define FREE_ITEMS(items) { \
int omask;\
\
omask = sigblock(sigmask(SIGINT));\
free_items(items);\
items = NULL;\
(void) sigsetmask(omask);\
}
/*
* Perform a RECOGNIZE or LIST command on string "word".
*/
static int
tsearch(word, command, max_word_length)
Char *word;
COMMAND command;
int max_word_length;
{
static Char **items = NULL;
DIR *dir_fd;
int numitems = 0, ignoring = TRUE, nignored = 0;
int name_length, looking_for_lognames;
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
Char *entry;
#define MAXITEMS 1024
if (items != NULL)
FREE_ITEMS(items);
looking_for_lognames = (*word == '~') && (Strchr(word, '/') == NULL);
if (looking_for_lognames) {
setpwent();
copyn(name, &word[1], MAXNAMLEN); /* name sans ~ */
dir_fd = NULL;
}
else {
extract_dir_and_name(word, dir, name);
if (tilde(tilded_dir, dir) == 0)
return (0);
dir_fd = opendir(*tilded_dir ? short2str(tilded_dir) : ".");
if (dir_fd == NULL)
return (0);
}
again: /* search for matches */
name_length = Strlen(name);
for (numitems = 0; (entry = getentry(dir_fd, looking_for_lognames)) != NULL;) {
if (!is_prefix(name, entry))
continue;
/* Don't match . files on null prefix match */
if (name_length == 0 && entry[0] == '.' &&
!looking_for_lognames)
continue;
if (command == LIST) {
if (numitems >= MAXITEMS) {
(void) fprintf(csherr, "\nYikes!! Too many %s!!\n",
looking_for_lognames ?
"names in password file" : "files");
break;
}
if (items == NULL)
items = (Char **) xcalloc(sizeof(items[0]), MAXITEMS);
items[numitems] = (Char *) xmalloc((size_t) (Strlen(entry) + 1) *
sizeof(Char));
copyn(items[numitems], entry, MAXNAMLEN);
numitems++;
}
else { /* RECOGNIZE command */
if (ignoring && ignored(entry))
nignored++;
else if (recognize(extended_name,
entry, name_length, ++numitems))
break;
}
}
if (ignoring && numitems == 0 && nignored > 0) {
ignoring = FALSE;
nignored = 0;
if (looking_for_lognames)
setpwent();
else
rewinddir(dir_fd);
goto again;
}
if (looking_for_lognames)
(void) endpwent();
else
(void) closedir(dir_fd);
if (numitems == 0)
return (0);
if (command == RECOGNIZE) {
if (looking_for_lognames)
copyn(word, STRtilde, 1);
else
/* put back dir part */
copyn(word, dir, max_word_length);
/* add extended name */
catn(word, extended_name, max_word_length);
return (numitems);
}
else { /* LIST */
qsort((ptr_t) items, numitems, sizeof(items[0]),
(int (*) __P((const void *, const void *))) sortscmp);
print_by_column(looking_for_lognames ? NULL : tilded_dir,
items, numitems);
if (items != NULL)
FREE_ITEMS(items);
}
return (0);
}
/*
* Object: extend what user typed up to an ambiguity.
* Algorithm:
* On first match, copy full entry (assume it'll be the only match)
* On subsequent matches, shorten extended_name to the first
* Character mismatch between extended_name and entry.
* If we shorten it back to the prefix length, stop searching.
*/
static int
recognize(extended_name, entry, name_length, numitems)
Char *extended_name, *entry;
int name_length, numitems;
{
if (numitems == 1) /* 1st match */
copyn(extended_name, entry, MAXNAMLEN);
else { /* 2nd & subsequent matches */
Char *x, *ent;
int len = 0;
x = extended_name;
for (ent = entry; *x && *x == *ent++; x++, len++)
continue;
*x = '\0'; /* Shorten at 1st Char diff */
if (len == name_length) /* Ambiguous to prefix? */
return (-1); /* So stop now and save time */
}
return (0);
}
/*
* Return true if check matches initial Chars in template.
* This differs from PWB imatch in that if check is null
* it matches anything.
*/
static int
is_prefix(check, template)
Char *check, *template;
{
do
if (*check == 0)
return (TRUE);
while (*check++ == *template++);
return (FALSE);
}
/*
* Return true if the Chars in template appear at the
* end of check, I.e., are it's suffix.
*/
static int
is_suffix(check, template)
Char *check, *template;
{
Char *c, *t;
for (c = check; *c++;)
continue;
for (t = template; *t++;)
continue;
for (;;) {
if (t == template)
return 1;
if (c == check || *--t != *--c)
return 0;
}
}
int
tenex(inputline, inputline_size)
Char *inputline;
int inputline_size;
{
int numitems, num_read;
char tinputline[BUFSIZ];
setup_tty(ON);
while ((num_read = read(SHIN, tinputline, BUFSIZ)) > 0) {
int i;
static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
'>', '(', ')', '|', '^', '%', '\0'};
Char *str_end, *word_start, last_Char, should_retype;
int space_left;
COMMAND command;
for (i = 0; i < num_read; i++)
inputline[i] = (unsigned char) tinputline[i];
last_Char = inputline[num_read - 1] & ASCII;
if (last_Char == '\n' || num_read == inputline_size)
break;
command = (last_Char == ESC) ? RECOGNIZE : LIST;
if (command == LIST)
(void) fputc('\n', cshout);
str_end = &inputline[num_read];
if (last_Char == ESC)
--str_end; /* wipeout trailing cmd Char */
*str_end = '\0';
/*
* Find LAST occurence of a delimiter in the inputline. The word start
* is one Character past it.
*/
for (word_start = str_end; word_start > inputline; --word_start)
if (Strchr(delims, word_start[-1]))
break;
space_left = inputline_size - (word_start - inputline) - 1;
numitems = tsearch(word_start, command, space_left);
if (command == RECOGNIZE) {
/* print from str_end on */
print_recognized_stuff(str_end);
if (numitems != 1) /* Beep = No match/ambiguous */
beep();
}
/*
* Tabs in the input line cause trouble after a pushback. tty driver
* won't backspace over them because column positions are now
* incorrect. This is solved by retyping over current line.
*/
should_retype = FALSE;
if (Strchr(inputline, '\t')) { /* tab Char in input line? */
back_to_col_1();
should_retype = TRUE;
}
if (command == LIST) /* Always retype after a LIST */
should_retype = TRUE;
if (should_retype)
printprompt();
pushback(inputline);
if (should_retype)
retype();
}
setup_tty(OFF);
return (num_read);
}
static int
ignored(entry)
Char *entry;
{
struct varent *vp;
Char **cp;
if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL)
return (FALSE);
for (; *cp != NULL; cp++)
if (is_suffix(entry, *cp))
return (TRUE);
return (FALSE);
}
#endif /* FILEC */
-1520
View File
File diff suppressed because it is too large. Load diff
-961
View File
@@ -1,961 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/param.h>
#include <glob.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
static int noglob;
static int pargsiz, gargsiz;
/*
* Values for gflag
*/
#define G_NONE 0 /* No globbing needed */
#define G_GLOB 1 /* string contains *?[] characters */
#define G_CSH 2 /* string contains ~`{ characters */
#define GLOBSPACE 100 /* Alloc increment */
#define LBRC '{'
#define RBRC '}'
#define LBRK '['
#define RBRK ']'
#define EOS '\0'
Char **gargv = NULL;
long gargc = 0;
Char **pargv = NULL;
long pargc = 0;
/*
* globbing is now done in two stages. In the first pass we expand
* csh globbing idioms ~`{ and then we proceed doing the normal
* globbing if needed ?*[
*
* Csh type globbing is handled in globexpand() and the rest is
* handled in glob() which is part of the 4.4BSD libc.
*
*/
static Char *globtilde __P((Char **, Char *));
static Char **libglob __P((Char **));
static Char **globexpand __P((Char **));
static int globbrace __P((Char *, Char *, Char ***));
static void expbrace __P((Char ***, Char ***, int));
static int pmatch __P((Char *, Char *));
static void pword __P((void));
static void psave __P((int));
static void backeval __P((Char *, bool));
static int collate_range_cmp __P((int, int));
static int collate_range_cmp (c1, c2)
int c1, c2;
{
static char s1[2], s2[2];
int ret;
c1 &= UCHAR_MAX;
c2 &= UCHAR_MAX;
if (c1 == c2)
return (0);
s1[0] = c1;
s2[0] = c2;
if ((ret = strcoll(s1, s2)) != 0)
return (ret);
return (c1 - c2);
}
static Char *
globtilde(nv, s)
Char **nv, *s;
{
Char gbuf[MAXPATHLEN], *gstart, *b, *u, *e;
gstart = gbuf;
*gstart++ = *s++;
u = s;
for (b = gstart, e = &gbuf[MAXPATHLEN - 1];
*s && *s != '/' && *s != ':' && b < e;
*b++ = *s++)
continue;
*b = EOS;
if (gethdir(gstart)) {
blkfree(nv);
if (*gstart)
stderror(ERR_UNKUSER, vis_str(gstart));
else
stderror(ERR_NOHOME);
}
b = &gstart[Strlen(gstart)];
while (*s)
*b++ = *s++;
*b = EOS;
--u;
xfree((ptr_t) u);
return (Strsave(gstart));
}
static int
globbrace(s, p, bl)
Char *s, *p, ***bl;
{
int i, len;
Char *pm, *pe, *lm, *pl;
Char **nv, **vl;
Char gbuf[MAXPATHLEN];
int size = GLOBSPACE;
nv = vl = (Char **) xmalloc((size_t) sizeof(Char *) * size);
*vl = NULL;
len = 0;
/* copy part up to the brace */
for (lm = gbuf, p = s; *p != LBRC; *lm++ = *p++)
continue;
/* check for balanced braces */
for (i = 0, pe = ++p; *pe; pe++)
if (*pe == LBRK) {
/* Ignore everything between [] */
for (++pe; *pe != RBRK && *pe != EOS; pe++)
continue;
if (*pe == EOS) {
blkfree(nv);
return (-RBRK);
}
}
else if (*pe == LBRC)
i++;
else if (*pe == RBRC) {
if (i == 0)
break;
i--;
}
if (i != 0 || *pe == '\0') {
blkfree(nv);
return (-RBRC);
}
for (i = 0, pl = pm = p; pm <= pe; pm++)
switch (*pm) {
case LBRK:
for (++pm; *pm != RBRK && *pm != EOS; pm++)
continue;
if (*pm == EOS) {
*vl = NULL;
blkfree(nv);
return (-RBRK);
}
break;
case LBRC:
i++;
break;
case RBRC:
if (i) {
i--;
break;
}
/* FALLTHROUGH */
case ',':
if (i && *pm == ',')
break;
else {
Char savec = *pm;
*pm = EOS;
(void) Strcpy(lm, pl);
(void) Strcat(gbuf, pe + 1);
*pm = savec;
*vl++ = Strsave(gbuf);
len++;
pl = pm + 1;
if (vl == &nv[size]) {
size += GLOBSPACE;
nv = (Char **) xrealloc((ptr_t) nv, (size_t)
size * sizeof(Char *));
vl = &nv[size - GLOBSPACE];
}
}
break;
default:
break;
}
*vl = NULL;
*bl = nv;
return (len);
}
static void
expbrace(nvp, elp, size)
Char ***nvp, ***elp;
int size;
{
Char **vl, **el, **nv, *s;
vl = nv = *nvp;
if (elp != NULL)
el = *elp;
else
for (el = vl; *el; el++)
continue;
for (s = *vl; s; s = *++vl) {
Char *b;
Char **vp, **bp;
/* leave {} untouched for find */
if (s[0] == '{' && (s[1] == '\0' || (s[1] == '}' && s[2] == '\0')))
continue;
if ((b = Strchr(s, '{')) != NULL) {
Char **bl;
int len;
if ((len = globbrace(s, b, &bl)) < 0) {
xfree((ptr_t) nv);
stderror(ERR_MISSING, -len);
}
xfree((ptr_t) s);
if (len == 1) {
*vl-- = *bl;
xfree((ptr_t) bl);
continue;
}
len = blklen(bl);
if (&el[len] >= &nv[size]) {
int l, e;
l = &el[len] - &nv[size];
size += GLOBSPACE > l ? GLOBSPACE : l;
l = vl - nv;
e = el - nv;
nv = (Char **) xrealloc((ptr_t) nv, (size_t)
size * sizeof(Char *));
vl = nv + l;
el = nv + e;
}
vp = vl--;
*vp = *bl;
len--;
for (bp = el; bp != vp; bp--)
bp[len] = *bp;
el += len;
vp++;
for (bp = bl + 1; *bp; *vp++ = *bp++)
continue;
xfree((ptr_t) bl);
}
}
if (elp != NULL)
*elp = el;
*nvp = nv;
}
static Char **
globexpand(v)
Char **v;
{
Char *s;
Char **nv, **vl, **el;
int size = GLOBSPACE;
nv = vl = (Char **) xmalloc((size_t) sizeof(Char *) * size);
*vl = NULL;
/*
* Step 1: expand backquotes.
*/
while ((s = *v++) != NULL) {
if (Strchr(s, '`')) {
int i;
(void) dobackp(s, 0);
for (i = 0; i < pargc; i++) {
*vl++ = pargv[i];
if (vl == &nv[size]) {
size += GLOBSPACE;
nv = (Char **) xrealloc((ptr_t) nv,
(size_t) size * sizeof(Char *));
vl = &nv[size - GLOBSPACE];
}
}
xfree((ptr_t) pargv);
pargv = NULL;
}
else {
*vl++ = Strsave(s);
if (vl == &nv[size]) {
size += GLOBSPACE;
nv = (Char **) xrealloc((ptr_t) nv, (size_t)
size * sizeof(Char *));
vl = &nv[size - GLOBSPACE];
}
}
}
*vl = NULL;
if (noglob)
return (nv);
/*
* Step 2: expand braces
*/
el = vl;
expbrace(&nv, &el, size);
/*
* Step 3: expand ~
*/
vl = nv;
for (s = *vl; s; s = *++vl)
if (*s == '~')
*vl = globtilde(nv, s);
vl = nv;
return (vl);
}
static Char *
handleone(str, vl, action)
Char *str, **vl;
int action;
{
Char *cp, **vlp = vl;
switch (action) {
case G_ERROR:
setname(vis_str(str));
blkfree(vl);
stderror(ERR_NAME | ERR_AMBIG);
break;
case G_APPEND:
trim(vlp);
str = Strsave(*vlp++);
do {
cp = Strspl(str, STRspace);
xfree((ptr_t) str);
str = Strspl(cp, *vlp);
xfree((ptr_t) cp);
}
while (*++vlp);
blkfree(vl);
break;
case G_IGNORE:
str = Strsave(strip(*vlp));
blkfree(vl);
break;
default:
break;
}
return (str);
}
static Char **
libglob(vl)
Char **vl;
{
int gflgs = GLOB_QUOTE | GLOB_NOMAGIC;
glob_t globv;
char *ptr;
int nonomatch = adrof(STRnonomatch) != 0, magic = 0, match = 0;
if (!vl || !vl[0])
return (vl);
globv.gl_offs = 0;
globv.gl_pathv = 0;
globv.gl_pathc = 0;
if (nonomatch)
gflgs |= GLOB_NOCHECK;
do {
ptr = short2qstr(*vl);
switch (glob(ptr, gflgs, 0, &globv)) {
case GLOB_ABEND:
setname(vis_str(*vl));
stderror(ERR_NAME | ERR_GLOB);
/* NOTREACHED */
case GLOB_NOSPACE:
stderror(ERR_NOMEM);
/* NOTREACHED */
default:
break;
}
if (globv.gl_flags & GLOB_MAGCHAR) {
match |= (globv.gl_matchc != 0);
magic = 1;
}
gflgs |= GLOB_APPEND;
}
while (*++vl);
vl = (globv.gl_pathc == 0 || (magic && !match && !nonomatch)) ?
NULL : blk2short(globv.gl_pathv);
globfree(&globv);
return (vl);
}
Char *
globone(str, action)
Char *str;
int action;
{
Char *v[2], **vl, **vo;
int gflg;
noglob = adrof(STRnoglob) != 0;
gflag = 0;
v[0] = str;
v[1] = 0;
tglob(v);
gflg = gflag;
if (gflg == G_NONE)
return (strip(Strsave(str)));
if (gflg & G_CSH) {
/*
* Expand back-quote, tilde and brace
*/
vo = globexpand(v);
if (noglob || (gflg & G_GLOB) == 0) {
if (vo[0] == NULL) {
xfree((ptr_t) vo);
return (Strsave(STRNULL));
}
if (vo[1] != NULL)
return (handleone(str, vo, action));
else {
str = strip(vo[0]);
xfree((ptr_t) vo);
return (str);
}
}
}
else if (noglob || (gflg & G_GLOB) == 0)
return (strip(Strsave(str)));
else
vo = v;
vl = libglob(vo);
if ((gflg & G_CSH) && vl != vo)
blkfree(vo);
if (vl == NULL) {
setname(vis_str(str));
stderror(ERR_NAME | ERR_NOMATCH);
}
if (vl[0] == NULL) {
xfree((ptr_t) vl);
return (Strsave(STRNULL));
}
if (vl[1] != NULL)
return (handleone(str, vl, action));
else {
str = strip(*vl);
xfree((ptr_t) vl);
return (str);
}
}
Char **
globall(v)
Char **v;
{
Char **vl, **vo;
int gflg = gflag;
if (!v || !v[0]) {
gargv = saveblk(v);
gargc = blklen(gargv);
return (gargv);
}
noglob = adrof(STRnoglob) != 0;
if (gflg & G_CSH)
/*
* Expand back-quote, tilde and brace
*/
vl = vo = globexpand(v);
else
vl = vo = saveblk(v);
if (!noglob && (gflg & G_GLOB)) {
vl = libglob(vo);
if ((gflg & G_CSH) && vl != vo)
blkfree(vo);
}
else
trim(vl);
gargc = vl ? blklen(vl) : 0;
return (gargv = vl);
}
void
ginit()
{
gargsiz = GLOBSPACE;
gargv = (Char **) xmalloc((size_t) sizeof(Char *) * gargsiz);
gargv[0] = 0;
gargc = 0;
}
void
rscan(t, f)
Char **t;
void (*f) __P((int));
{
Char *p;
while ((p = *t++) != NULL)
while (*p)
(*f) (*p++);
}
void
trim(t)
Char **t;
{
Char *p;
while ((p = *t++) != NULL)
while (*p)
*p++ &= TRIM;
}
void
tglob(t)
Char **t;
{
Char *p, c;
while ((p = *t++) != NULL) {
if (*p == '~' || *p == '=')
gflag |= G_CSH;
else if (*p == '{' &&
(p[1] == '\0' || (p[1] == '}' && p[2] == '\0')))
continue;
while ((c = *p++) != '\0') {
/*
* eat everything inside the matching backquotes
*/
if (c == '`') {
gflag |= G_CSH;
while (*p && *p != '`')
if (*p++ == '\\') {
if (*p) /* Quoted chars */
p++;
else
break;
}
if (*p) /* The matching ` */
p++;
else
break;
}
else if (c == '{')
gflag |= G_CSH;
else if (isglob(c))
gflag |= G_GLOB;
}
}
}
/*
* Command substitute cp. If literal, then this is a substitution from a
* << redirection, and so we should not crunch blanks and tabs, separating
* words only at newlines.
*/
Char **
dobackp(cp, literal)
Char *cp;
bool literal;
{
Char *lp, *rp;
Char *ep, word[MAXPATHLEN];
if (pargv) {
#ifdef notdef
abort();
#endif
blkfree(pargv);
}
pargsiz = GLOBSPACE;
pargv = (Char **) xmalloc((size_t) sizeof(Char *) * pargsiz);
pargv[0] = NULL;
pargcp = pargs = word;
pargc = 0;
pnleft = MAXPATHLEN - 4;
for (;;) {
for (lp = cp; *lp != '`'; lp++) {
if (*lp == 0) {
if (pargcp != pargs)
pword();
return (pargv);
}
psave(*lp);
}
lp++;
for (rp = lp; *rp && *rp != '`'; rp++)
if (*rp == '\\') {
rp++;
if (!*rp)
goto oops;
}
if (!*rp)
oops: stderror(ERR_UNMATCHED, '`');
ep = Strsave(lp);
ep[rp - lp] = 0;
backeval(ep, literal);
cp = rp + 1;
}
}
static void
backeval(cp, literal)
Char *cp;
bool literal;
{
int icnt, c;
Char *ip;
struct command faket;
bool hadnl;
int pvec[2], quoted;
Char *fakecom[2], ibuf[BUFSIZ];
char tibuf[BUFSIZ];
hadnl = 0;
icnt = 0;
quoted = (literal || (cp[0] & QUOTE)) ? QUOTE : 0;
faket.t_dtyp = NODE_COMMAND;
faket.t_dflg = 0;
faket.t_dlef = 0;
faket.t_drit = 0;
faket.t_dspr = 0;
faket.t_dcom = fakecom;
fakecom[0] = STRfakecom1;
fakecom[1] = 0;
/*
* We do the psave job to temporarily change the current job so that the
* following fork is considered a separate job. This is so that when
* backquotes are used in a builtin function that calls glob the "current
* job" is not corrupted. We only need one level of pushed jobs as long as
* we are sure to fork here.
*/
psavejob();
/*
* It would be nicer if we could integrate this redirection more with the
* routines in sh.sem.c by doing a fake execute on a builtin function that
* was piped out.
*/
mypipe(pvec);
if (pfork(&faket, -1) == 0) {
struct wordent paraml;
struct command *t;
(void) close(pvec[0]);
(void) dmove(pvec[1], 1);
(void) dmove(SHERR, 2);
initdesc();
/*
* Bugfix for nested backquotes by Michael Greim <greim@sbsvax.UUCP>,
* posted to comp.bugs.4bsd 12 Sep. 1989.
*/
if (pargv) /* mg, 21.dec.88 */
blkfree(pargv), pargv = 0, pargsiz = 0;
/* mg, 21.dec.88 */
arginp = cp;
while (*cp)
*cp++ &= TRIM;
/*
* In the child ``forget'' everything about current aliases or
* eval vectors.
*/
alvec = NULL;
evalvec = NULL;
alvecp = NULL;
evalp = NULL;
(void) lex(&paraml);
if (seterr)
stderror(ERR_OLD);
alias(&paraml);
t = syntax(paraml.next, &paraml, 0);
if (seterr)
stderror(ERR_OLD);
if (t)
t->t_dflg |= F_NOFORK;
(void) signal(SIGTSTP, SIG_IGN);
(void) signal(SIGTTIN, SIG_IGN);
(void) signal(SIGTTOU, SIG_IGN);
execute(t, -1, NULL, NULL);
exitstat();
}
xfree((ptr_t) cp);
(void) close(pvec[1]);
c = 0;
ip = NULL;
do {
int cnt = 0;
for (;;) {
if (icnt == 0) {
int i;
ip = ibuf;
do
icnt = read(pvec[0], tibuf, BUFSIZ);
while (icnt == -1 && errno == EINTR);
if (icnt <= 0) {
c = -1;
break;
}
for (i = 0; i < icnt; i++)
ip[i] = (unsigned char) tibuf[i];
}
if (hadnl)
break;
--icnt;
c = (*ip++ & TRIM);
if (c == 0)
break;
if (c == '\n') {
/*
* Continue around the loop one more time, so that we can eat
* the last newline without terminating this word.
*/
hadnl = 1;
continue;
}
if (!quoted && (c == ' ' || c == '\t'))
break;
cnt++;
psave(c | quoted);
}
/*
* Unless at end-of-file, we will form a new word here if there were
* characters in the word, or in any case when we take text literally.
* If we didn't make empty words here when literal was set then we
* would lose blank lines.
*/
if (c != -1 && (cnt || literal))
pword();
hadnl = 0;
} while (c >= 0);
(void) close(pvec[0]);
pwait();
prestjob();
}
static void
psave(c)
int c;
{
if (--pnleft <= 0)
stderror(ERR_WTOOLONG);
*pargcp++ = c;
}
static void
pword()
{
psave(0);
if (pargc == pargsiz - 1) {
pargsiz += GLOBSPACE;
pargv = (Char **) xrealloc((ptr_t) pargv,
(size_t) pargsiz * sizeof(Char *));
}
pargv[pargc++] = Strsave(pargs);
pargv[pargc] = NULL;
pargcp = pargs;
pnleft = MAXPATHLEN - 4;
}
int
Gmatch(string, pattern)
Char *string, *pattern;
{
Char **blk, **p;
int gpol = 1, gres = 0;
if (*pattern == '^') {
gpol = 0;
pattern++;
}
blk = (Char **) xmalloc(GLOBSPACE * sizeof(Char *));
blk[0] = Strsave(pattern);
blk[1] = NULL;
expbrace(&blk, NULL, GLOBSPACE);
for (p = blk; *p; p++)
gres |= pmatch(string, *p);
blkfree(blk);
return(gres == gpol);
}
static int
pmatch(string, pattern)
Char *string, *pattern;
{
Char stringc, patternc;
int match, negate_range;
Char rangec;
for (;; ++string) {
stringc = *string & TRIM;
patternc = *pattern++;
switch (patternc) {
case 0:
return (stringc == 0);
case '?':
if (stringc == 0)
return (0);
break;
case '*':
if (!*pattern)
return (1);
while (*string)
if (Gmatch(string++, pattern))
return (1);
return (0);
case '[':
match = 0;
if ((negate_range = (*pattern == '^')) != 0)
pattern++;
while ((rangec = *pattern++) != '\0') {
if (rangec == ']')
break;
if (match)
continue;
if (rangec == '-' && *(pattern-2) != '[' && *pattern != ']') {
match = ( collate_range_cmp(stringc, *pattern & TRIM) <= 0
&& collate_range_cmp(*(pattern-2) & TRIM, stringc) <= 0
);
pattern++;
}
else
match = (stringc == (rangec & TRIM));
}
if (rangec == 0)
stderror(ERR_NAME | ERR_MISSING, ']');
if (match == negate_range)
return (0);
break;
default:
if ((patternc & TRIM) != stringc)
return (0);
break;
}
}
}
void
Gcat(s1, s2)
Char *s1, *s2;
{
Char *p, *q;
int n;
for (p = s1; *p++;)
continue;
for (q = s2; *q++;)
continue;
n = (p - s1) + (q - s2) - 1;
if (++gargc >= gargsiz) {
gargsiz += GLOBSPACE;
gargv = (Char **) xrealloc((ptr_t) gargv,
(size_t) gargsiz * sizeof(Char *));
}
gargv[gargc] = 0;
p = gargv[gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char));
for (q = s1; (*p++ = *q++) != '\0';)
continue;
for (p--, q = s2; (*p++ = *q++) != '\0';)
continue;
}
#ifdef FILEC
int
sortscmp(a, b)
const ptr_t a, b;
{
#if defined(NLS) && !defined(NOSTRCOLL)
char buf[2048];
#endif
if (!a) /* check for NULL */
return (b ? 1 : 0);
if (!b)
return (-1);
if (!*(Char **)a) /* check for NULL */
return (*(Char **)b ? 1 : 0);
if (!*(Char **)b)
return (-1);
#if defined(NLS) && !defined(NOSTRCOLL)
(void) strcpy(buf, short2str(*(Char **)a));
return ((int) strcoll(buf, short2str(*(Char **)b)));
#else
return ((int) Strcmp(*(Char **)a, *(Char **)b));
#endif
}
#endif /* FILEC */
-188
View File
@@ -1,188 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
static void hfree __P((struct Hist *));
static void dohist1 __P((struct Hist *, int *, int, int));
static void phist __P((struct Hist *, int));
void
savehist(sp)
struct wordent *sp;
{
struct Hist *hp, *np;
int histlen = 0;
Char *cp;
/* throw away null lines */
if (sp->next->word[0] == '\n')
return;
cp = value(STRhistory);
if (*cp) {
Char *p = cp;
while (*p) {
if (!Isdigit(*p)) {
histlen = 0;
break;
}
histlen = histlen * 10 + *p++ - '0';
}
}
for (hp = &Histlist; (np = hp->Hnext) != NULL;)
if (eventno - np->Href >= histlen || histlen == 0)
hp->Hnext = np->Hnext, hfree(np);
else
hp = np;
(void) enthist(++eventno, sp, 1);
}
struct Hist *
enthist(event, lp, docopy)
int event;
struct wordent *lp;
bool docopy;
{
struct Hist *np;
np = (struct Hist *) xmalloc((size_t) sizeof(*np));
np->Hnum = np->Href = event;
if (docopy) {
copylex(&np->Hlex, lp);
}
else {
np->Hlex.next = lp->next;
lp->next->prev = &np->Hlex;
np->Hlex.prev = lp->prev;
lp->prev->next = &np->Hlex;
}
np->Hnext = Histlist.Hnext;
Histlist.Hnext = np;
return (np);
}
static void
hfree(hp)
struct Hist *hp;
{
freelex(&hp->Hlex);
xfree((ptr_t) hp);
}
void
/*ARGSUSED*/
dohist(v, t)
Char **v;
struct command *t;
{
int n, rflg = 0, hflg = 0;
if (getn(value(STRhistory)) == 0)
return;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
while (*++v && **v == '-') {
Char *vp = *v;
while (*++vp)
switch (*vp) {
case 'h':
hflg++;
break;
case 'r':
rflg++;
break;
case '-': /* ignore multiple '-'s */
break;
default:
stderror(ERR_HISTUS);
break;
}
}
if (*v)
n = getn(*v);
else {
n = getn(value(STRhistory));
}
dohist1(Histlist.Hnext, &n, rflg, hflg);
}
static void
dohist1(hp, np, rflg, hflg)
struct Hist *hp;
int *np, rflg, hflg;
{
bool print = (*np) > 0;
for (; hp != 0; hp = hp->Hnext) {
(*np)--;
hp->Href++;
if (rflg == 0) {
dohist1(hp->Hnext, np, rflg, hflg);
if (print)
phist(hp, hflg);
return;
}
if (*np >= 0)
phist(hp, hflg);
}
}
static void
phist(hp, hflg)
struct Hist *hp;
int hflg;
{
if (hflg == 0)
(void) fprintf(cshout, "%6d\t", hp->Hnum);
prlex(cshout, &hp->Hlex);
}
-139
View File
@@ -1,139 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
#define INF 1000
struct biltins bfunc[] =
{
{ "@", dolet, 0, INF },
{ "alias", doalias, 0, INF },
{ "alloc", showall, 0, 1 },
{ "bg", dobg, 0, INF },
{ "break", dobreak, 0, 0 },
{ "breaksw", doswbrk, 0, 0 },
{ "case", dozip, 0, 1 },
{ "cd", dochngd, 0, INF },
{ "chdir", dochngd, 0, INF },
{ "continue", docontin, 0, 0 },
{ "default", dozip, 0, 0 },
{ "dirs", dodirs, 0, INF },
{ "echo", doecho, 0, INF },
{ "else", doelse, 0, INF },
{ "end", doend, 0, 0 },
{ "endif", dozip, 0, 0 },
{ "endsw", dozip, 0, 0 },
{ "eval", doeval, 0, INF },
{ "exec", execash, 1, INF },
{ "exit", doexit, 0, INF },
{ "fg", dofg, 0, INF },
{ "foreach", doforeach, 3, INF },
{ "glob", doglob, 0, INF },
{ "goto", dogoto, 1, 1 },
{ "hashstat", hashstat, 0, 0 },
{ "history", dohist, 0, 2 },
{ "if", doif, 1, INF },
{ "jobs", dojobs, 0, 1 },
{ "kill", dokill, 1, INF },
{ "limit", dolimit, 0, 3 },
{ "linedit", doecho, 0, INF },
{ "login", dologin, 0, 1 },
{ "logout", dologout, 0, 0 },
{ "nice", donice, 0, INF },
{ "nohup", donohup, 0, INF },
{ "notify", donotify, 0, INF },
{ "onintr", doonintr, 0, 2 },
{ "popd", dopopd, 0, INF },
{ "printf", doprintf, 1, INF },
{ "pushd", dopushd, 0, INF },
{ "rehash", dohash, 0, 0 },
{ "repeat", dorepeat, 2, INF },
{ "set", doset, 0, INF },
{ "setenv", dosetenv, 0, 2 },
{ "shift", shift, 0, 1 },
{ "source", dosource, 1, 2 },
{ "stop", dostop, 1, INF },
{ "suspend", dosuspend, 0, 0 },
{ "switch", doswitch, 1, INF },
{ "time", dotime, 0, INF },
{ "umask", doumask, 0, 1 },
{ "unalias", unalias, 1, INF },
{ "unhash", dounhash, 0, 0 },
{ "unlimit", dounlimit, 0, INF },
{ "unset", unset, 1, INF },
{ "unsetenv", dounsetenv, 1, INF },
{ "wait", dowait, 0, 0 },
{ "which", dowhich, 1, INF },
{ "while", dowhile, 1, INF }
};
int nbfunc = sizeof bfunc / sizeof *bfunc;
struct srch srchn[] =
{
{ "@", T_LET },
{ "break", T_BREAK },
{ "breaksw", T_BRKSW },
{ "case", T_CASE },
{ "default", T_DEFAULT },
{ "else", T_ELSE },
{ "end", T_END },
{ "endif", T_ENDIF },
{ "endsw", T_ENDSW },
{ "exit", T_EXIT },
{ "foreach", T_FOREACH },
{ "goto", T_GOTO },
{ "if", T_IF },
{ "label", T_LABEL },
{ "set", T_SET },
{ "switch", T_SWITCH },
{ "while", T_WHILE }
};
int nsrchn = sizeof srchn / sizeof *srchn;
-1643
View File
File diff suppressed because it is too large. Load diff
-424
View File
@@ -1,424 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/param.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
static int renum __P((int, int));
int
any(s, c)
char *s;
int c;
{
if (!s)
return (0); /* Check for nil pointer */
while (*s)
if (*s++ == c)
return (1);
return (0);
}
void
setzero(cp, i)
char *cp;
int i;
{
if (i != 0)
do
*cp++ = 0;
while (--i);
}
char *
strsave(s)
char *s;
{
char *n;
char *p;
if (s == NULL)
s = "";
for (p = s; *p++;)
continue;
n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char)));
while ((*p++ = *s++) != '\0')
continue;
return (n);
}
Char **
blkend(up)
Char **up;
{
while (*up)
up++;
return (up);
}
void
blkpr(fp, av)
FILE *fp;
Char **av;
{
for (; *av; av++) {
(void) fprintf(fp, "%s", vis_str(*av));
if (av[1])
(void) fprintf(fp, " ");
}
}
int
blklen(av)
Char **av;
{
int i = 0;
while (*av++)
i++;
return (i);
}
Char **
blkcpy(oav, bv)
Char **oav;
Char **bv;
{
Char **av = oav;
while ((*av++ = *bv++) != NULL)
continue;
return (oav);
}
Char **
blkcat(up, vp)
Char **up, **vp;
{
(void) blkcpy(blkend(up), vp);
return (up);
}
void
blkfree(av0)
Char **av0;
{
Char **av = av0;
if (!av0)
return;
for (; *av; av++)
xfree((ptr_t) * av);
xfree((ptr_t) av0);
}
Char **
saveblk(v)
Char **v;
{
Char **newv =
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
Char **onewv = newv;
while (*v)
*newv++ = Strsave(*v++);
return (onewv);
}
#ifdef NOTUSED
char *
strstr(s, t)
char *s, *t;
{
do {
char *ss = s;
char *tt = t;
do
if (*tt == '\0')
return (s);
while (*ss++ == *tt++);
} while (*s++ != '\0');
return (NULL);
}
#endif /* NOTUSED */
#ifndef SHORT_STRINGS
char *
strspl(cp, dp)
char *cp, *dp;
{
char *ep;
char *p, *q;
if (!cp)
cp = "";
if (!dp)
dp = "";
for (p = cp; *p++;)
continue;
for (q = dp; *q++;)
continue;
ep = (char *) xmalloc((size_t) (((p - cp) + (q - dp) - 1) * sizeof(char)));
for (p = ep, q = cp; *p++ = *q++;)
continue;
for (p--, q = dp; *p++ = *q++;)
continue;
return (ep);
}
#endif
Char **
blkspl(up, vp)
Char **up, **vp;
{
Char **wp =
(Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1),
sizeof(Char **));
(void) blkcpy(wp, up);
return (blkcat(wp, vp));
}
Char
lastchr(cp)
Char *cp;
{
if (!cp)
return (0);
if (!*cp)
return (0);
while (cp[1])
cp++;
return (*cp);
}
/*
* This routine is called after an error to close up
* any units which may have been left open accidentally.
*/
void
closem()
{
int f, flimit;
for (f = 0, flimit = getdtablesize(); f < flimit; f++)
if (f != SHIN && f != SHOUT && f != SHERR && f != OLDSTD &&
f != FSHTTY)
(void) close(f);
}
void
donefds()
{
(void) close(0);
(void) close(1);
(void) close(2);
didfds = 0;
}
/*
* Move descriptor i to j.
* If j is -1 then we just want to get i to a safe place,
* i.e. to a unit > 2. This also happens in dcopy.
*/
int
dmove(i, j)
int i, j;
{
if (i == j || i < 0)
return (i);
if (j >= 0) {
(void) dup2(i, j);
if (j != i)
(void) close(i);
return (j);
}
j = dcopy(i, j);
if (j != i)
(void) close(i);
return (j);
}
int
dcopy(i, j)
int i, j;
{
if (i == j || i < 0 || (j < 0 && i > 2))
return (i);
if (j >= 0) {
(void) dup2(i, j);
return (j);
}
(void) close(j);
return (renum(i, j));
}
static int
renum(i, j)
int i, j;
{
int k = dup(i);
if (k < 0)
return (-1);
if (j == -1 && k > 2)
return (k);
if (k != j) {
j = renum(k, j);
(void) close(k);
return (j);
}
return (k);
}
/*
* Left shift a command argument list, discarding
* the first c arguments. Used in "shift" commands
* as well as by commands like "repeat".
*/
void
lshift(v, c)
Char **v;
int c;
{
Char **u;
for (u = v; *u && --c >= 0; u++)
xfree((ptr_t) *u);
(void) blkcpy(v, u);
}
int
number(cp)
Char *cp;
{
if (!cp)
return(0);
if (*cp == '-') {
cp++;
if (!Isdigit(*cp))
return (0);
cp++;
}
while (*cp && Isdigit(*cp))
cp++;
return (*cp == 0);
}
Char **
copyblk(v)
Char **v;
{
Char **nv = (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
return (blkcpy(nv, v));
}
#ifndef SHORT_STRINGS
char *
strend(cp)
char *cp;
{
if (!cp)
return (cp);
while (*cp)
cp++;
return (cp);
}
#endif /* SHORT_STRINGS */
Char *
strip(cp)
Char *cp;
{
Char *dp = cp;
if (!cp)
return (cp);
while ((*dp++ &= TRIM) != '\0')
continue;
return (cp);
}
void
udvar(name)
Char *name;
{
setname(vis_str(name));
stderror(ERR_NAME | ERR_UNDVAR);
}
int
prefix(sub, str)
Char *sub, *str;
{
for (;;) {
if (*sub == 0)
return (1);
if (*str == 0)
return (0);
if (*sub++ != *str++)
return (0);
}
}
+8
View File
@@ -0,0 +1,8 @@
# $FreeBSD$
SUBDIR= finnish french ja german italian spanish
# We are not ready for greek yet
#SUBDIR+= greek
.include <bsd.subdir.mk>
+17
View File
@@ -0,0 +1,17 @@
# $FreeBSD$
GENCAT= gencat -new
BASESRC= ${.CURDIR}/../../../../contrib/tcsh/nls
.SUFFIXES: .msg .cat
.msg.cat:
${GENCAT} ${.TARGET} ${.IMPSRC}
CLEANFILES+= tcsh.cat tcsh.msg
all: tcsh.cat
tcsh.cat: tcsh.msg
distribute:
+20
View File
@@ -0,0 +1,20 @@
# $FreeBSD$
NL= finnish
DL= fi_FI.ISO_8859-1
LL= fi_FI.DIS_8859-15
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
.endfor
.include <bsd.prog.mk>
+22
View File
@@ -0,0 +1,22 @@
# $FreeBSD$
NL= french
DL= fr_FR.ISO_8859-1
LL= fr_BE.ISO_8859-1 fr_CA.ISO_8859-1 fr_CH.ISO_8859-1 \
fr_BE.DIS_8859-15 fr_CA.DIS_8859-15 fr_CH.DIS_8859-15 \
fr_FR.DIS_8859-15
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
.endfor
.include <bsd.prog.mk>
+21
View File
@@ -0,0 +1,21 @@
# $FreeBSD$
NL= german
DL= de_DE.ISO_8859-1
LL= de_AT.ISO_8859-1 de_CH.ISO_8859-1 de_AT.DIS_8859-15 \
de_CH.DIS_8859-15 de_DE.DIS_8859-15
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
.endfor
.include <bsd.prog.mk>
+16
View File
@@ -0,0 +1,16 @@
# $FreeBSD$
NL= greek
DL= el_GR.ISO_8859-7
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+20
View File
@@ -0,0 +1,20 @@
# $FreeBSD$
NL= italian
DL= it_IT.ISO_8859-1
LL= it_CH.ISO_8859-1 it_IT.DIS_8859-15 it_CH.DIS_8859-15
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
.endfor
.include <bsd.prog.mk>
+16
View File
@@ -0,0 +1,16 @@
# $FreeBSD$
NL= ja
DL= ja_JP.EUC
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.include <bsd.prog.mk>
+20
View File
@@ -0,0 +1,20 @@
# $FreeBSD$
NL= spanish
DL= es_ES.ISO_8859-1
LL= es_ES.DIS_8859-15
.PATH: ${BASESRC}/${NL}
tcsh.msg: set[0-9]*
cat ${BASESRC}/${NL}/set[0-9] \
${BASESRC}/${NL}/set[0-9][0-9] > ${.TARGET}
install:
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
tcsh.cat ${DESTDIR}${NLSDIR}/${DL}/tcsh.cat
.for i in ${LL}
ln -fs ../${DL}/tcsh.cat ${DESTDIR}${NLSDIR}/$i/tcsh.cat
.endfor
.include <bsd.prog.mk>
-702
View File
@@ -1,702 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <string.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
static void asyntax __P((struct wordent *, struct wordent *));
static void asyn0 __P((struct wordent *, struct wordent *));
static void asyn3 __P((struct wordent *, struct wordent *));
static struct wordent
*freenod __P((struct wordent *, struct wordent *));
static struct command
*syn0 __P((struct wordent *, struct wordent *, int));
static struct command
*syn1 __P((struct wordent *, struct wordent *, int));
static struct command
*syn1a __P((struct wordent *, struct wordent *, int));
static struct command
*syn1b __P((struct wordent *, struct wordent *, int));
static struct command
*syn2 __P((struct wordent *, struct wordent *, int));
static struct command
*syn3 __P((struct wordent *, struct wordent *, int));
#define ALEFT 21 /* max of 20 alias expansions */
#define HLEFT 11 /* max of 10 history expansions */
/*
* Perform aliasing on the word list lex
* Do a (very rudimentary) parse to separate into commands.
* If word 0 of a command has an alias, do it.
* Repeat a maximum of 20 times.
*/
static int aleft;
extern int hleft;
void
alias(lex)
struct wordent *lex;
{
jmp_buf osetexit;
aleft = ALEFT;
hleft = HLEFT;
getexit(osetexit);
(void) setexit();
if (haderr) {
resexit(osetexit);
reset();
}
if (--aleft == 0)
stderror(ERR_ALIASLOOP);
asyntax(lex->next, lex);
resexit(osetexit);
}
static void
asyntax(p1, p2)
struct wordent *p1, *p2;
{
while (p1 != p2)
if (any(";&\n", p1->word[0]))
p1 = p1->next;
else {
asyn0(p1, p2);
return;
}
}
static void
asyn0(p1, p2)
struct wordent *p1;
struct wordent *p2;
{
struct wordent *p;
int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
if (l < 0)
stderror(ERR_TOOMANYRP);
continue;
case '>':
if (p->next != p2 && eq(p->next->word, STRand))
p = p->next;
continue;
case '&':
case '|':
case ';':
case '\n':
if (l != 0)
continue;
asyn3(p1, p);
asyntax(p->next, p2);
return;
}
if (l == 0)
asyn3(p1, p2);
}
static void
asyn3(p1, p2)
struct wordent *p1;
struct wordent *p2;
{
struct varent *ap;
struct wordent alout;
bool redid;
if (p1 == p2)
return;
if (p1->word[0] == '(') {
for (p2 = p2->prev; p2->word[0] != ')'; p2 = p2->prev)
if (p2 == p1)
return;
if (p2 == p1->next)
return;
asyn0(p1->next, p2);
return;
}
ap = adrof1(p1->word, &aliases);
if (ap == 0)
return;
alhistp = p1->prev;
alhistt = p2;
alvec = ap->vec;
redid = lex(&alout);
alhistp = alhistt = 0;
alvec = 0;
if (seterr) {
freelex(&alout);
stderror(ERR_OLD);
}
if (p1->word[0] && eq(p1->word, alout.next->word)) {
Char *cp = alout.next->word;
alout.next->word = Strspl(STRQNULL, cp);
xfree((ptr_t) cp);
}
p1 = freenod(p1, redid ? p2 : p1->next);
if (alout.next != &alout) {
p1->next->prev = alout.prev->prev;
alout.prev->prev->next = p1->next;
alout.next->prev = p1;
p1->next = alout.next;
xfree((ptr_t) alout.prev->word);
xfree((ptr_t) (alout.prev));
}
reset(); /* throw! */
}
static struct wordent *
freenod(p1, p2)
struct wordent *p1, *p2;
{
struct wordent *retp = p1->prev;
while (p1 != p2) {
xfree((ptr_t) p1->word);
p1 = p1->next;
xfree((ptr_t) (p1->prev));
}
retp->next = p2;
p2->prev = retp;
return (retp);
}
#define PHERE 1
#define PIN 2
#define POUT 4
#define PERR 8
/*
* syntax
* empty
* syn0
*/
struct command *
syntax(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
while (p1 != p2)
if (any(";&\n", p1->word[0]))
p1 = p1->next;
else
return (syn0(p1, p2, flags));
return (0);
}
/*
* syn0
* syn1
* syn1 & syntax
*/
static struct command *
syn0(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p;
struct command *t, *t1;
int l;
l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
if (l < 0)
seterror(ERR_TOOMANYRP);
continue;
case '|':
if (p->word[1] == '|')
continue;
/* fall into ... */
case '>':
if (p->next != p2 && eq(p->next->word, STRand))
p = p->next;
continue;
case '&':
if (l != 0)
break;
if (p->word[1] == '&')
continue;
t1 = syn1(p1, p, flags);
if (t1->t_dtyp == NODE_LIST ||
t1->t_dtyp == NODE_AND ||
t1->t_dtyp == NODE_OR) {
t = (struct command *) xcalloc(1, sizeof(*t));
t->t_dtyp = NODE_PAREN;
t->t_dflg = F_AMPERSAND | F_NOINTERRUPT;
t->t_dspr = t1;
t1 = t;
}
else
t1->t_dflg |= F_AMPERSAND | F_NOINTERRUPT;
t = (struct command *) xcalloc(1, sizeof(*t));
t->t_dtyp = NODE_LIST;
t->t_dflg = 0;
t->t_dcar = t1;
t->t_dcdr = syntax(p, p2, flags);
return (t);
}
if (l == 0)
return (syn1(p1, p2, flags));
seterror(ERR_TOOMANYLP);
return (0);
}
/*
* syn1
* syn1a
* syn1a ; syntax
*/
static struct command *
syn1(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p;
struct command *t;
int l;
l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
continue;
case ';':
case '\n':
if (l != 0)
break;
t = (struct command *) xcalloc(1, sizeof(*t));
t->t_dtyp = NODE_LIST;
t->t_dcar = syn1a(p1, p, flags);
t->t_dcdr = syntax(p->next, p2, flags);
if (t->t_dcdr == 0)
t->t_dcdr = t->t_dcar, t->t_dcar = 0;
return (t);
}
return (syn1a(p1, p2, flags));
}
/*
* syn1a
* syn1b
* syn1b || syn1a
*/
static struct command *
syn1a(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p;
struct command *t;
int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
continue;
case '|':
if (p->word[1] != '|')
continue;
if (l == 0) {
t = (struct command *) xcalloc(1, sizeof(*t));
t->t_dtyp = NODE_OR;
t->t_dcar = syn1b(p1, p, flags);
t->t_dcdr = syn1a(p->next, p2, flags);
t->t_dflg = 0;
return (t);
}
continue;
}
return (syn1b(p1, p2, flags));
}
/*
* syn1b
* syn2
* syn2 && syn1b
*/
static struct command *
syn1b(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p;
struct command *t;
int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
continue;
case '&':
if (p->word[1] == '&' && l == 0) {
t = (struct command *) xcalloc(1, sizeof(*t));
t->t_dtyp = NODE_AND;
t->t_dcar = syn2(p1, p, flags);
t->t_dcdr = syn1b(p->next, p2, flags);
t->t_dflg = 0;
return (t);
}
continue;
}
return (syn2(p1, p2, flags));
}
/*
* syn2
* syn3
* syn3 | syn2
* syn3 |& syn2
*/
static struct command *
syn2(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p, *pn;
struct command *t;
int l = 0;
int f;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
l++;
continue;
case ')':
l--;
continue;
case '|':
if (l != 0)
continue;
t = (struct command *) xcalloc(1, sizeof(*t));
f = flags | POUT;
pn = p->next;
if (pn != p2 && pn->word[0] == '&') {
f |= PERR;
t->t_dflg |= F_STDERR;
}
t->t_dtyp = NODE_PIPE;
t->t_dcar = syn3(p1, p, f);
if (pn != p2 && pn->word[0] == '&')
p = pn;
t->t_dcdr = syn2(p->next, p2, flags | PIN);
return (t);
}
return (syn3(p1, p2, flags));
}
static char RELPAR[] = {'<', '>', '(', ')', '\0'};
/*
* syn3
* ( syn0 ) [ < in ] [ > out ]
* word word* [ < in ] [ > out ]
* KEYWORD ( word* ) word* [ < in ] [ > out ]
*
* KEYWORD = (@ exit foreach if set switch test while)
*/
static struct command *
syn3(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
struct wordent *p;
struct wordent *lp, *rp;
struct command *t;
int l;
Char **av;
int n, c;
bool specp = 0;
if (p1 != p2) {
p = p1;
again:
switch (srchx(p->word)) {
case T_ELSE:
p = p->next;
if (p != p2)
goto again;
break;
case T_EXIT:
case T_FOREACH:
case T_IF:
case T_LET:
case T_SET:
case T_SWITCH:
case T_WHILE:
specp = 1;
break;
}
}
n = 0;
l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
case '(':
if (specp)
n++;
l++;
continue;
case ')':
if (specp)
n++;
l--;
continue;
case '>':
case '<':
if (l != 0) {
if (specp)
n++;
continue;
}
if (p->next == p2)
continue;
if (any(RELPAR, p->next->word[0]))
continue;
n--;
continue;
default:
if (!specp && l != 0)
continue;
n++;
continue;
}
if (n < 0)
n = 0;
t = (struct command *) xcalloc(1, sizeof(*t));
av = (Char **) xcalloc((size_t) (n + 1), sizeof(Char **));
t->t_dcom = av;
n = 0;
if (p2->word[0] == ')')
t->t_dflg = F_NOFORK;
lp = 0;
rp = 0;
l = 0;
for (p = p1; p != p2; p = p->next) {
c = p->word[0];
switch (c) {
case '(':
if (l == 0) {
if (lp != 0 && !specp)
seterror(ERR_BADPLP);
lp = p->next;
}
l++;
goto savep;
case ')':
l--;
if (l == 0)
rp = p;
goto savep;
case '>':
if (l != 0)
goto savep;
if (p->word[1] == '>')
t->t_dflg |= F_APPEND;
if (p->next != p2 && eq(p->next->word, STRand)) {
t->t_dflg |= F_STDERR, p = p->next;
if (flags & (POUT | PERR)) {
seterror(ERR_OUTRED);
continue;
}
}
if (p->next != p2 && eq(p->next->word, STRbang))
t->t_dflg |= F_OVERWRITE, p = p->next;
if (p->next == p2) {
seterror(ERR_MISRED);
continue;
}
p = p->next;
if (any(RELPAR, p->word[0])) {
seterror(ERR_MISRED);
continue;
}
if ((flags & POUT) && ((flags & PERR) == 0 || t->t_drit))
seterror(ERR_OUTRED);
else
t->t_drit = Strsave(p->word);
continue;
case '<':
if (l != 0)
goto savep;
if (p->word[1] == '<')
t->t_dflg |= F_READ;
if (p->next == p2) {
seterror(ERR_MISRED);
continue;
}
p = p->next;
if (any(RELPAR, p->word[0])) {
seterror(ERR_MISRED);
continue;
}
if ((flags & PHERE) && (t->t_dflg & F_READ))
seterror(ERR_REDPAR);
else if ((flags & PIN) || t->t_dlef)
seterror(ERR_INRED);
else
t->t_dlef = Strsave(p->word);
continue;
savep:
if (!specp)
continue;
default:
if (l != 0 && !specp)
continue;
if (seterr == 0)
av[n] = Strsave(p->word);
n++;
continue;
}
}
if (lp != 0 && !specp) {
if (n != 0)
seterror(ERR_BADPLPS);
t->t_dtyp = NODE_PAREN;
t->t_dspr = syn0(lp, rp, PHERE);
}
else {
if (n == 0)
seterror(ERR_NULLCOM);
t->t_dtyp = NODE_COMMAND;
}
return (t);
}
void
freesyn(t)
struct command *t;
{
Char **v;
if (t == 0)
return;
switch (t->t_dtyp) {
case NODE_COMMAND:
for (v = t->t_dcom; *v; v++)
xfree((ptr_t) * v);
xfree((ptr_t) (t->t_dcom));
xfree((ptr_t) t->t_dlef);
xfree((ptr_t) t->t_drit);
break;
case NODE_PAREN:
freesyn(t->t_dspr);
xfree((ptr_t) t->t_dlef);
xfree((ptr_t) t->t_drit);
break;
case NODE_AND:
case NODE_OR:
case NODE_PIPE:
case NODE_LIST:
freesyn(t->t_dcar), freesyn(t->t_dcdr);
break;
}
xfree((ptr_t) t);
}
-42
View File
@@ -1,42 +0,0 @@
/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
#define _PATH_BIN "/bin"
#define _PATH_DOTCSHRC "/etc/csh.cshrc"
#define _PATH_DOTLOGIN "/etc/csh.login"
#define _PATH_DOTLOGOUT "/etc/csh.logout"
#define _PATH_LOGIN "/usr/bin/login"
#define _PATH_USRBIN "/usr/bin"
-1362
View File
File diff suppressed because it is too large. Load diff
-102
View File
@@ -1,102 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)proc.h 8.1 (Berkeley) 5/31/93
* $FreeBSD$
*/
/*
* Structure for each process the shell knows about:
* allocated and filled by pcreate.
* flushed by pflush; freeing always happens at top level
* so the interrupt level has less to worry about.
* processes are related to "friends" when in a pipeline;
* p_friends links makes a circular list of such jobs
*/
struct process {
struct process *p_next; /* next in global "proclist" */
struct process *p_friends; /* next in job list (or self) */
struct directory *p_cwd; /* cwd of the job (only in head) */
short unsigned p_flags; /* various job status flags */
char p_reason; /* reason for entering this state */
int p_index; /* shorthand job index */
int p_pid;
int p_jobid; /* pid of job leader */
/* if a job is stopped/background p_jobid gives its pgrp */
struct timeval p_btime; /* begin time */
struct timeval p_etime; /* end time */
struct rusage p_rusage;
Char *p_command; /* first PMAXLEN chars of command */
};
/* flag values for p_flags */
#define PRUNNING (1<<0) /* running */
#define PSTOPPED (1<<1) /* stopped */
#define PNEXITED (1<<2) /* normally exited */
#define PAEXITED (1<<3) /* abnormally exited */
#define PSIGNALED (1<<4) /* terminated by a signal != SIGINT */
#define PALLSTATES (PRUNNING|PSTOPPED|PNEXITED|PAEXITED|PSIGNALED|PINTERRUPTED)
#define PNOTIFY (1<<5) /* notify async when done */
#define PTIME (1<<6) /* job times should be printed */
#define PAWAITED (1<<7) /* top level is waiting for it */
#define PFOREGND (1<<8) /* started in shells pgrp */
#define PDUMPED (1<<9) /* process dumped core */
#define PERR (1<<10) /* diagnostic output also piped out */
#define PPOU (1<<11) /* piped output */
#define PREPORTED (1<<12) /* status has been reported */
#define PINTERRUPTED (1<<13) /* job stopped via interrupt signal */
#define PPTIME (1<<14) /* time individual process */
#define PNEEDNOTE (1<<15) /* notify as soon as practical */
#define PMAXLEN 80
/* defines for arguments to pprint */
#define NUMBER 01
#define NAME 02
#define REASON 04
#define AMPERSAND 010
#define FANCY 020
#define SHELLDIR 040 /* print shell's dir if not the same */
#define JOBDIR 0100 /* print job's dir if not the same */
#define AREASON 0200
struct process proclist; /* list head of all processes */
bool pnoprocesses; /* pchild found nothing to wait for */
struct process *pholdjob; /* one level stack of current jobs */
struct process *pcurrjob; /* current job */
struct process *pcurrent; /* current job in table */
struct process *pprevious; /* previous job in table */
int pmaxindex; /* current maximum job index */
-650
View File
@@ -1,650 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "proc.h"
#include "extern.h"
static void vffree __P((int));
static Char *splicepipe __P((struct command *t, Char *));
static void doio __P((struct command *t, int *, int *));
static void chkclob __P((char *));
void
execute(t, wanttty, pipein, pipeout)
struct command *t;
int wanttty, *pipein, *pipeout;
{
bool forked = 0;
struct biltins *bifunc;
int pid = 0;
int pv[2];
static int csigmask;
static int ocsigmask;
static int onosigchld = 0;
static int nosigchld = 0;
UNREGISTER(forked);
UNREGISTER(bifunc);
UNREGISTER(wanttty);
if (t == 0)
return;
if (t->t_dflg & F_AMPERSAND)
wanttty = 0;
switch (t->t_dtyp) {
case NODE_COMMAND:
if ((t->t_dcom[0][0] & (QUOTE | TRIM)) == QUOTE)
(void) Strcpy(t->t_dcom[0], t->t_dcom[0] + 1);
if ((t->t_dflg & F_REPEAT) == 0)
Dfix(t); /* $ " ' \ */
if (t->t_dcom[0] == 0)
return;
/* fall into... */
case NODE_PAREN:
if (t->t_dflg & F_PIPEOUT)
mypipe(pipeout);
/*
* Must do << early so parent will know where input pointer should be.
* If noexec then this is all we do.
*/
if (t->t_dflg & F_READ) {
(void) close(0);
heredoc(t->t_dlef);
if (noexec)
(void) close(0);
}
set(STRstatus, Strsave(STR0));
/*
* This mess is the necessary kludge to handle the prefix builtins:
* nice, nohup, time. These commands can also be used by themselves,
* and this is not handled here. This will also work when loops are
* parsed.
*/
while (t->t_dtyp == NODE_COMMAND)
if (eq(t->t_dcom[0], STRnice))
if (t->t_dcom[1])
if (strchr("+-", t->t_dcom[1][0]))
if (t->t_dcom[2]) {
setname("nice");
t->t_nice =
getn(t->t_dcom[1]);
lshift(t->t_dcom, 2);
t->t_dflg |= F_NICE;
}
else
break;
else {
t->t_nice = 4;
lshift(t->t_dcom, 1);
t->t_dflg |= F_NICE;
}
else
break;
else if (eq(t->t_dcom[0], STRnohup))
if (t->t_dcom[1]) {
t->t_dflg |= F_NOHUP;
lshift(t->t_dcom, 1);
}
else
break;
else if (eq(t->t_dcom[0], STRtime))
if (t->t_dcom[1]) {
t->t_dflg |= F_TIME;
lshift(t->t_dcom, 1);
}
else
break;
else
break;
/* is it a command */
if (t->t_dtyp == NODE_COMMAND) {
/*
* Check if we have a builtin function and remember which one.
*/
bifunc = isbfunc(t);
if (noexec) {
/*
* Continue for builtins that are part of the scripting language
*/
if (bifunc->bfunct != dobreak && bifunc->bfunct != docontin &&
bifunc->bfunct != doelse && bifunc->bfunct != doend &&
bifunc->bfunct != doforeach && bifunc->bfunct != dogoto &&
bifunc->bfunct != doif && bifunc->bfunct != dorepeat &&
bifunc->bfunct != doswbrk && bifunc->bfunct != doswitch &&
bifunc->bfunct != dowhile && bifunc->bfunct != dozip)
break;
}
}
else { /* not a command */
bifunc = NULL;
if (noexec)
break;
}
/*
* We fork only if we are timed, or are not the end of a parenthesized
* list and not a simple builtin function. Simple meaning one that is
* not pipedout, niced, nohupped, or &'d. It would be nice(?) to not
* fork in some of these cases.
*/
/*
* Prevent forking cd, pushd, popd, chdir cause this will cause the
* shell not to change dir!
*/
if (bifunc && (bifunc->bfunct == dochngd ||
bifunc->bfunct == dopushd ||
bifunc->bfunct == dopopd))
t->t_dflg &= ~(F_NICE);
if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
(!bifunc || t->t_dflg &
(F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP)))) ||
/*
* We have to fork for eval too.
*/
(bifunc && (t->t_dflg & (F_PIPEIN | F_PIPEOUT)) != 0 &&
bifunc->bfunct == doeval)) {
if (t->t_dtyp == NODE_PAREN ||
t->t_dflg & (F_REPEAT | F_AMPERSAND) || bifunc) {
forked++;
/*
* We need to block SIGCHLD here, so that if the process does
* not die before we can set the process group
*/
if (wanttty >= 0 && !nosigchld) {
csigmask = sigblock(sigmask(SIGCHLD));
nosigchld = 1;
}
pid = pfork(t, wanttty);
if (pid == 0 && nosigchld) {
(void) sigsetmask(csigmask);
nosigchld = 0;
}
else if (pid != 0 && (t->t_dflg & F_AMPERSAND))
backpid = pid;
}
else {
int ochild, osetintr, ohaderr, odidfds;
int oSHIN, oSHOUT, oSHERR, oOLDSTD, otpgrp;
int omask;
/*
* Prepare for the vfork by saving everything that the child
* corrupts before it exec's. Note that in some signal
* implementations which keep the signal info in user space
* (e.g. Sun's) it will also be necessary to save and restore
* the current sigvec's for the signals the child touches
* before it exec's.
*/
if (wanttty >= 0 && !nosigchld && !noexec) {
csigmask = sigblock(sigmask(SIGCHLD));
nosigchld = 1;
}
omask = sigblock(sigmask(SIGCHLD) | sigmask(SIGINT));
ochild = child;
osetintr = setintr;
ohaderr = haderr;
odidfds = didfds;
oSHIN = SHIN;
oSHOUT = SHOUT;
oSHERR = SHERR;
oOLDSTD = OLDSTD;
otpgrp = tpgrp;
ocsigmask = csigmask;
onosigchld = nosigchld;
Vsav = Vdp = 0;
Vexpath = 0;
Vt = 0;
pid = vfork();
if (pid < 0) {
(void) sigsetmask(omask);
stderror(ERR_NOPROC);
}
forked++;
if (pid) { /* parent */
child = ochild;
setintr = osetintr;
haderr = ohaderr;
didfds = odidfds;
SHIN = oSHIN;
SHOUT = oSHOUT;
SHERR = oSHERR;
OLDSTD = oOLDSTD;
tpgrp = otpgrp;
csigmask = ocsigmask;
nosigchld = onosigchld;
xfree((ptr_t) Vsav);
Vsav = 0;
xfree((ptr_t) Vdp);
Vdp = 0;
xfree((ptr_t) Vexpath);
Vexpath = 0;
blkfree((Char **) Vt);
Vt = 0;
/* this is from pfork() */
palloc(pid, t);
(void) sigsetmask(omask);
}
else { /* child */
/* this is from pfork() */
int pgrp;
bool ignint = 0;
if (nosigchld) {
(void) sigsetmask(csigmask);
nosigchld = 0;
}
if (setintr)
ignint =
(tpgrp == -1 &&
(t->t_dflg & F_NOINTERRUPT))
|| (gointr && eq(gointr, STRminus));
pgrp = pcurrjob ? pcurrjob->p_jobid : getpid();
child++;
if (setintr) {
setintr = 0;
if (ignint) {
(void) signal(SIGINT, SIG_IGN);
(void) signal(SIGQUIT, SIG_IGN);
}
else {
(void) signal(SIGINT, vffree);
(void) signal(SIGQUIT, SIG_DFL);
}
if (wanttty >= 0) {
(void) signal(SIGTSTP, SIG_DFL);
(void) signal(SIGTTIN, SIG_DFL);
(void) signal(SIGTTOU, SIG_DFL);
}
(void) signal(SIGTERM, parterm);
}
else if (tpgrp == -1 &&
(t->t_dflg & F_NOINTERRUPT)) {
(void) signal(SIGINT, SIG_IGN);
(void) signal(SIGQUIT, SIG_IGN);
}
pgetty(wanttty, pgrp);
if (t->t_dflg & F_NOHUP)
(void) signal(SIGHUP, SIG_IGN);
if (t->t_dflg & F_NICE)
(void) setpriority(PRIO_PROCESS, 0, t->t_nice);
}
}
}
if (pid != 0) {
/*
* It would be better if we could wait for the whole job when we
* knew the last process had been started. Pwait, in fact, does
* wait for the whole job anyway, but this test doesn't really
* express our intentions.
*/
if (didfds == 0 && t->t_dflg & F_PIPEIN) {
(void) close(pipein[0]);
(void) close(pipein[1]);
}
if ((t->t_dflg & F_PIPEOUT) == 0) {
if (nosigchld) {
(void) sigsetmask(csigmask);
nosigchld = 0;
}
if ((t->t_dflg & F_AMPERSAND) == 0)
pwait();
}
break;
}
doio(t, pipein, pipeout);
if (t->t_dflg & F_PIPEOUT) {
(void) close(pipeout[0]);
(void) close(pipeout[1]);
}
/*
* Perform a builtin function. If we are not forked, arrange for
* possible stopping
*/
if (bifunc) {
func(t, bifunc);
if (forked)
exitstat();
break;
}
if (t->t_dtyp != NODE_PAREN) {
doexec(NULL, t);
/* NOTREACHED */
}
/*
* For () commands must put new 0,1,2 in FSH* and recurse
*/
OLDSTD = dcopy(0, FOLDSTD);
SHOUT = dcopy(1, FSHOUT);
SHERR = dcopy(2, FSHERR);
(void) close(SHIN);
SHIN = -1;
didfds = 0;
wanttty = -1;
t->t_dspr->t_dflg |= t->t_dflg & F_NOINTERRUPT;
execute(t->t_dspr, wanttty, NULL, NULL);
exitstat();
case NODE_PIPE:
t->t_dcar->t_dflg |= F_PIPEOUT |
(t->t_dflg & (F_PIPEIN | F_AMPERSAND | F_STDERR | F_NOINTERRUPT));
execute(t->t_dcar, wanttty, pipein, pv);
t->t_dcdr->t_dflg |= F_PIPEIN | (t->t_dflg &
(F_PIPEOUT | F_AMPERSAND | F_NOFORK | F_NOINTERRUPT));
if (wanttty > 0)
wanttty = 0; /* got tty already */
execute(t->t_dcdr, wanttty, pv, pipeout);
break;
case NODE_LIST:
if (t->t_dcar) {
t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT;
execute(t->t_dcar, wanttty, NULL, NULL);
/*
* In strange case of A&B make a new job after A
*/
if (t->t_dcar->t_dflg & F_AMPERSAND && t->t_dcdr &&
(t->t_dcdr->t_dflg & F_AMPERSAND) == 0)
pendjob();
}
if (t->t_dcdr) {
t->t_dcdr->t_dflg |= t->t_dflg &
(F_NOFORK | F_NOINTERRUPT);
execute(t->t_dcdr, wanttty, NULL, NULL);
}
break;
case NODE_OR:
case NODE_AND:
if (t->t_dcar) {
t->t_dcar->t_dflg |= t->t_dflg & F_NOINTERRUPT;
execute(t->t_dcar, wanttty, NULL, NULL);
if ((getn(value(STRstatus)) == 0) !=
(t->t_dtyp == NODE_AND))
return;
}
if (t->t_dcdr) {
t->t_dcdr->t_dflg |= t->t_dflg &
(F_NOFORK | F_NOINTERRUPT);
execute(t->t_dcdr, wanttty, NULL, NULL);
}
break;
}
/*
* Fall through for all breaks from switch
*
* If there will be no more executions of this command, flush all file
* descriptors. Places that turn on the F_REPEAT bit are responsible for
* doing donefds after the last re-execution
*/
if (didfds && !(t->t_dflg & F_REPEAT))
donefds();
}
static void
vffree(i)
int i;
{
Char **v;
if ((v = gargv) != NULL) {
gargv = 0;
xfree((ptr_t) v);
}
if ((v = pargv) != NULL) {
pargv = 0;
xfree((ptr_t) v);
}
_exit(i);
}
/*
* Expand and glob the words after an i/o redirection.
* If more than one word is generated, then update the command vector.
*
* This is done differently in all the shells:
* 1. in the Bourne shell and ksh globbing is not performed
* 2. Bash/csh say ambiguous
* 3. zsh does i/o to/from all the files
* 4. itcsh concatenates the words.
*
* I don't know what is best to do. I think that Ambiguous is better
* than restructuring the command vector, because the user can get
* unexpected results. In any case, the command vector restructuring
* code is present and the user can choose it by setting noambiguous
*/
static Char *
splicepipe(t, cp)
struct command *t;
Char *cp; /* word after < or > */
{
Char *blk[2];
if (adrof(STRnoambiguous)) {
Char **pv;
blk[0] = Dfix1(cp); /* expand $ */
blk[1] = NULL;
gflag = 0, tglob(blk);
if (gflag) {
pv = globall(blk);
if (pv == NULL) {
setname(vis_str(blk[0]));
xfree((ptr_t) blk[0]);
stderror(ERR_NAME | ERR_NOMATCH);
}
gargv = NULL;
if (pv[1] != NULL) { /* we need to fix the command vector */
Char **av = blkspl(t->t_dcom, &pv[1]);
xfree((ptr_t) t->t_dcom);
t->t_dcom = av;
}
xfree((ptr_t) blk[0]);
blk[0] = pv[0];
xfree((ptr_t) pv);
}
}
else {
blk[0] = globone(blk[1] = Dfix1(cp), G_ERROR);
xfree((ptr_t) blk[1]);
}
return(blk[0]);
}
/*
* Perform io redirection.
* We may or maynot be forked here.
*/
static void
doio(t, pipein, pipeout)
struct command *t;
int *pipein, *pipeout;
{
int fd;
Char *cp;
int flags = t->t_dflg;
if (didfds || (flags & F_REPEAT))
return;
if ((flags & F_READ) == 0) {/* F_READ already done */
if (t->t_dlef) {
char tmp[MAXPATHLEN+1];
/*
* so < /dev/std{in,out,err} work
*/
(void) dcopy(SHIN, 0);
(void) dcopy(SHOUT, 1);
(void) dcopy(SHERR, 2);
cp = splicepipe(t, t->t_dlef);
(void) strncpy(tmp, short2str(cp), MAXPATHLEN);
tmp[MAXPATHLEN] = '\0';
xfree((ptr_t) cp);
if ((fd = open(tmp, O_RDONLY)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
(void) dmove(fd, 0);
}
else if (flags & F_PIPEIN) {
(void) close(0);
(void) dup(pipein[0]);
(void) close(pipein[0]);
(void) close(pipein[1]);
}
else if ((flags & F_NOINTERRUPT) && tpgrp == -1) {
(void) close(0);
(void) open(_PATH_DEVNULL, O_RDONLY);
}
else {
(void) close(0);
(void) dup(OLDSTD);
(void) ioctl(0, FIONCLEX, NULL);
}
}
if (t->t_drit) {
char tmp[MAXPATHLEN+1];
cp = splicepipe(t, t->t_drit);
(void) strncpy(tmp, short2str(cp), MAXPATHLEN);
tmp[MAXPATHLEN] = '\0';
xfree((ptr_t) cp);
/*
* so > /dev/std{out,err} work
*/
(void) dcopy(SHOUT, 1);
(void) dcopy(SHERR, 2);
if ((flags & F_APPEND) &&
#ifdef O_APPEND
(fd = open(tmp, O_WRONLY | O_APPEND)) >= 0);
#else
(fd = open(tmp, O_WRONLY)) >= 0)
(void) lseek(1, (off_t) 0, L_XTND);
#endif
else {
if (!(flags & F_OVERWRITE) && adrof(STRnoclobber)) {
if (flags & F_APPEND)
stderror(ERR_SYSTEM, tmp, strerror(errno));
chkclob(tmp);
}
if ((fd = creat(tmp, 0666)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
(void) dmove(fd, 1);
}
else if (flags & F_PIPEOUT) {
(void) close(1);
(void) dup(pipeout[1]);
}
else {
(void) close(1);
(void) dup(SHOUT);
(void) ioctl(1, FIONCLEX, NULL);
}
(void) close(2);
if (flags & F_STDERR) {
(void) dup(1);
}
else {
(void) dup(SHERR);
(void) ioctl(2, FIONCLEX, NULL);
}
didfds = 1;
}
void
mypipe(pv)
int *pv;
{
if (pipe(pv) < 0)
goto oops;
pv[0] = dmove(pv[0], -1);
pv[1] = dmove(pv[1], -1);
if (pv[0] >= 0 && pv[1] >= 0)
return;
oops:
stderror(ERR_PIPE);
}
static void
chkclob(cp)
char *cp;
{
struct stat stb;
if (stat(cp, &stb) < 0)
return;
if (S_ISCHR(stb.st_mode))
return;
stderror(ERR_EXISTS, cp);
}
-847
View File
@@ -1,847 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include <unistd.h>
#include "csh.h"
#include "extern.h"
static Char *getinx __P((Char *, int *));
static void asx __P((Char *, int, Char *));
static struct varent
*getvx __P((Char *, int));
static Char *xset __P((Char *, Char ***));
static Char *operate __P((int, Char *, Char *));
static void putn1 __P((int));
static struct varent
*madrof __P((Char *, struct varent *));
static void unsetv1 __P((struct varent *));
static void exportpath __P((Char **));
static void balance __P((struct varent *, int, int));
/*
* C Shell
*/
void
/*ARGSUSED*/
doset(v, t)
Char **v;
struct command *t;
{
Char *p;
Char *vp, op;
Char **vecp;
bool hadsub;
int subscr;
v++;
p = *v++;
if (p == 0) {
prvars();
return;
}
do {
hadsub = 0;
vp = p;
if (letter(*p))
for (; alnum(*p); p++)
continue;
if (vp == p || !letter(*vp))
stderror(ERR_NAME | ERR_VARBEGIN);
if ((p - vp) > MAXVARLEN) {
stderror(ERR_NAME | ERR_VARTOOLONG);
return;
}
if (*p == '[') {
hadsub++;
p = getinx(p, &subscr);
}
if ((op = *p) != '\0') {
*p++ = 0;
if (*p == 0 && *v && **v == '(')
p = *v++;
}
else if (*v && eq(*v, STRequal)) {
op = '=', v++;
if (*v)
p = *v++;
}
if (op && op != '=')
stderror(ERR_NAME | ERR_SYNTAX);
if (eq(p, STRLparen)) {
Char **e = v;
if (hadsub)
stderror(ERR_NAME | ERR_SYNTAX);
for (;;) {
if (!*e)
stderror(ERR_NAME | ERR_MISSING, ')');
if (**e == ')')
break;
e++;
}
p = *e;
*e = 0;
vecp = saveblk(v);
set1(vp, vecp, &shvhed);
*e = p;
v = e + 1;
}
else if (hadsub)
asx(vp, subscr, Strsave(p));
else
set(vp, Strsave(p));
if (eq(vp, STRpath)) {
exportpath(adrof(STRpath)->vec);
dohash(NULL, NULL);
}
else if (eq(vp, STRhistchars)) {
Char *pn = value(STRhistchars);
HIST = *pn++;
HISTSUB = *pn;
}
else if (eq(vp, STRuser)) {
Setenv(STRUSER, value(vp));
Setenv(STRLOGNAME, value(vp));
}
else if (eq(vp, STRwordchars)) {
word_chars = value(vp);
}
else if (eq(vp, STRterm))
Setenv(STRTERM, value(vp));
else if (eq(vp, STRhome)) {
Char *cp;
cp = Strsave(value(vp)); /* get the old value back */
/*
* convert to canonical pathname (possibly resolving symlinks)
*/
cp = dcanon(cp, cp);
set(vp, Strsave(cp)); /* have to save the new val */
/* and now mirror home with HOME */
Setenv(STRHOME, cp);
/* fix directory stack for new tilde home */
dtilde();
xfree((ptr_t) cp);
}
#ifdef FILEC
else if (eq(vp, STRfilec))
filec = 1;
#endif
} while ((p = *v++) != NULL);
}
static Char *
getinx(cp, ip)
Char *cp;
int *ip;
{
*ip = 0;
*cp++ = 0;
while (*cp && Isdigit(*cp))
*ip = *ip * 10 + *cp++ - '0';
if (*cp++ != ']')
stderror(ERR_NAME | ERR_SUBSCRIPT);
return (cp);
}
static void
asx(vp, subscr, p)
Char *vp;
int subscr;
Char *p;
{
struct varent *v = getvx(vp, subscr);
xfree((ptr_t) v->vec[subscr - 1]);
v->vec[subscr - 1] = globone(p, G_APPEND);
}
static struct varent *
getvx(vp, subscr)
Char *vp;
int subscr;
{
struct varent *v = adrof(vp);
if (v == 0)
udvar(vp);
if (subscr < 1 || subscr > blklen(v->vec))
stderror(ERR_NAME | ERR_RANGE);
return (v);
}
void
/*ARGSUSED*/
dolet(v, t)
Char **v;
struct command *t;
{
Char *p;
Char *vp, c, op;
bool hadsub;
int subscr;
v++;
p = *v++;
if (p == 0) {
prvars();
return;
}
do {
hadsub = 0;
vp = p;
if (letter(*p))
for (; alnum(*p); p++)
continue;
if (vp == p || !letter(*vp))
stderror(ERR_NAME | ERR_VARBEGIN);
if ((p - vp) > MAXVARLEN)
stderror(ERR_NAME | ERR_VARTOOLONG);
if (*p == '[') {
hadsub++;
p = getinx(p, &subscr);
}
if (*p == 0 && *v)
p = *v++;
if ((op = *p) != '\0')
*p++ = 0;
else
stderror(ERR_NAME | ERR_ASSIGN);
if (*p == '\0' && *v == NULL)
stderror(ERR_NAME | ERR_ASSIGN);
vp = Strsave(vp);
if (op == '=') {
c = '=';
p = xset(p, &v);
}
else {
c = *p++;
if (any("+-", c)) {
if (c != op || *p)
stderror(ERR_NAME | ERR_UNKNOWNOP);
p = Strsave(STR1);
}
else {
if (any("<>", op)) {
if (c != op)
stderror(ERR_NAME | ERR_UNKNOWNOP);
c = *p++;
stderror(ERR_NAME | ERR_SYNTAX);
}
if (c != '=')
stderror(ERR_NAME | ERR_UNKNOWNOP);
p = xset(p, &v);
}
}
if (op == '=')
if (hadsub)
asx(vp, subscr, p);
else
set(vp, p);
else if (hadsub) {
struct varent *gv = getvx(vp, subscr);
asx(vp, subscr, operate(op, gv->vec[subscr - 1], p));
}
else
set(vp, operate(op, value(vp), p));
if (eq(vp, STRpath)) {
exportpath(adrof(STRpath)->vec);
dohash(NULL, NULL);
}
xfree((ptr_t) vp);
if (c != '=')
xfree((ptr_t) p);
} while ((p = *v++) != NULL);
}
static Char *
xset(cp, vp)
Char *cp, ***vp;
{
Char *dp;
if (*cp) {
dp = Strsave(cp);
--(*vp);
xfree((ptr_t) ** vp);
**vp = dp;
}
return (putn(expr(vp)));
}
static Char *
operate(op, vp, p)
int op;
Char *vp, *p;
{
Char opr[2];
Char *vec[5];
Char **v = vec;
Char **vecp = v;
int i;
if (op != '=') {
if (*vp)
*v++ = vp;
opr[0] = op;
opr[1] = 0;
*v++ = opr;
if (op == '<' || op == '>')
*v++ = opr;
}
*v++ = p;
*v++ = 0;
i = expr(&vecp);
if (*vecp)
stderror(ERR_NAME | ERR_EXPRESSION);
return (putn(i));
}
static Char *putp;
Char *
putn(n)
int n;
{
int num;
static Char number[15];
putp = number;
if (n < 0) {
n = -n;
*putp++ = '-';
}
num = 2; /* confuse lint */
if (sizeof(int) == num && ((unsigned int) n) == 0x8000) {
*putp++ = '3';
n = 2768;
#ifdef pdp11
}
#else
}
else {
num = 4; /* confuse lint */
if (sizeof(int) == num && ((unsigned int) n) == 0x80000000) {
*putp++ = '2';
n = 147483648;
}
}
#endif
putn1(n);
*putp = 0;
return (Strsave(number));
}
static void
putn1(n)
int n;
{
if (n > 9)
putn1(n / 10);
*putp++ = n % 10 + '0';
}
int
getn(cp)
Char *cp;
{
int n;
int sign;
sign = 0;
if (cp[0] == '+' && cp[1])
cp++;
if (*cp == '-') {
sign++;
cp++;
if (!Isdigit(*cp))
stderror(ERR_NAME | ERR_BADNUM);
}
n = 0;
while (Isdigit(*cp))
n = n * 10 + *cp++ - '0';
if (*cp)
stderror(ERR_NAME | ERR_BADNUM);
return (sign ? -n : n);
}
Char *
value1(var, head)
Char *var;
struct varent *head;
{
struct varent *vp;
vp = adrof1(var, head);
return (vp == 0 || vp->vec[0] == 0 ? STRNULL : vp->vec[0]);
}
static struct varent *
madrof(pat, vp)
Char *pat;
struct varent *vp;
{
struct varent *vp1;
for (; vp; vp = vp->v_right) {
if (vp->v_left && (vp1 = madrof(pat, vp->v_left)))
return vp1;
if (Gmatch(vp->v_name, pat))
return vp;
}
return vp;
}
struct varent *
adrof1(name, v)
Char *name;
struct varent *v;
{
int cmp;
v = v->v_left;
while (v && ((cmp = *name - *v->v_name) ||
(cmp = Strcmp(name, v->v_name))))
if (cmp < 0)
v = v->v_left;
else
v = v->v_right;
return v;
}
/*
* The caller is responsible for putting value in a safe place
*/
void
set(var, val)
Char *var, *val;
{
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
vec[0] = val;
vec[1] = 0;
set1(var, vec, &shvhed);
}
void
set1(var, vec, head)
Char *var, **vec;
struct varent *head;
{
Char **oldv = vec;
gflag = 0;
tglob(oldv);
if (gflag) {
vec = globall(oldv);
if (vec == 0) {
blkfree(oldv);
stderror(ERR_NAME | ERR_NOMATCH);
return;
}
blkfree(oldv);
gargv = 0;
}
setq(var, vec, head);
}
void
setq(name, vec, p)
Char *name, **vec;
struct varent *p;
{
struct varent *c;
int f;
f = 0; /* tree hangs off the header's left link */
while ((c = p->v_link[f]) != NULL) {
if ((f = *name - *c->v_name) == 0 &&
(f = Strcmp(name, c->v_name)) == 0) {
blkfree(c->vec);
goto found;
}
p = c;
f = f > 0;
}
p->v_link[f] = c = (struct varent *) xmalloc((size_t) sizeof(struct varent));
c->v_name = Strsave(name);
c->v_bal = 0;
c->v_left = c->v_right = 0;
c->v_parent = p;
balance(p, f, 0);
found:
trim(c->vec = vec);
}
void
/*ARGSUSED*/
unset(v, t)
Char **v;
struct command *t;
{
unset1(v, &shvhed);
#ifdef FILEC
if (adrof(STRfilec) == 0)
filec = 0;
#endif
if (adrof(STRhistchars) == 0) {
HIST = '!';
HISTSUB = '^';
}
if (adrof(STRwordchars) == 0)
word_chars = STR_WORD_CHARS;
}
void
unset1(v, head)
Char *v[];
struct varent *head;
{
struct varent *vp;
int cnt;
while (*++v) {
cnt = 0;
while ((vp = madrof(*v, head->v_left)) != NULL)
unsetv1(vp), cnt++;
if (cnt == 0)
setname(vis_str(*v));
}
}
void
unsetv(var)
Char *var;
{
struct varent *vp;
if ((vp = adrof1(var, &shvhed)) == 0)
udvar(var);
unsetv1(vp);
}
static void
unsetv1(p)
struct varent *p;
{
struct varent *c, *pp;
int f;
/*
* Free associated memory first to avoid complications.
*/
blkfree(p->vec);
xfree((ptr_t) p->v_name);
/*
* If p is missing one child, then we can move the other into where p is.
* Otherwise, we find the predecessor of p, which is guaranteed to have no
* right child, copy it into p, and move it's left child into it.
*/
if (p->v_right == 0)
c = p->v_left;
else if (p->v_left == 0)
c = p->v_right;
else {
for (c = p->v_left; c->v_right; c = c->v_right)
continue;
p->v_name = c->v_name;
p->vec = c->vec;
p = c;
c = p->v_left;
}
/*
* Move c into where p is.
*/
pp = p->v_parent;
f = pp->v_right == p;
if ((pp->v_link[f] = c) != NULL)
c->v_parent = pp;
/*
* Free the deleted node, and rebalance.
*/
xfree((ptr_t) p);
balance(pp, f, 1);
}
void
setNS(cp)
Char *cp;
{
set(cp, Strsave(STRNULL));
}
void
/*ARGSUSED*/
shift(v, t)
Char **v;
struct command *t;
{
struct varent *argv;
Char *name;
v++;
name = *v;
if (name == 0)
name = STRargv;
else
(void) strip(name);
argv = adrof(name);
if (argv == 0)
udvar(name);
if (argv->vec[0] == 0)
stderror(ERR_NAME | ERR_NOMORE);
lshift(argv->vec, 1);
}
static void
exportpath(val)
Char **val;
{
Char exppath[BUFSIZ];
exppath[0] = 0;
if (val)
while (*val) {
if (Strlen(*val) + Strlen(exppath) + 2 > BUFSIZ) {
(void) fprintf(csherr,
"Warning: ridiculously long PATH truncated\n");
break;
}
if (**val != '/' && (euid == 0 || uid == 0) &&
(intact || (intty && isatty(SHOUT))))
(void) fprintf(csherr,
"Warning: exported path contains relative components.\n");
(void) Strcat(exppath, *val++);
if (*val == 0 || eq(*val, STRRparen))
break;
(void) Strcat(exppath, STRcolon);
}
Setenv(STRPATH, exppath);
}
#ifndef lint
/*
* Lint thinks these have null effect
*/
/* macros to do single rotations on node p */
#define rright(p) (\
t = (p)->v_left,\
(t)->v_parent = (p)->v_parent,\
((p)->v_left = t->v_right) ? (t->v_right->v_parent = (p)) : 0,\
(t->v_right = (p))->v_parent = t,\
(p) = t)
#define rleft(p) (\
t = (p)->v_right,\
(t)->v_parent = (p)->v_parent,\
((p)->v_right = t->v_left) ? (t->v_left->v_parent = (p)) : 0,\
(t->v_left = (p))->v_parent = t,\
(p) = t)
#else
struct varent *
rleft(p)
struct varent *p;
{
return (p);
}
struct varent *
rright(p)
struct varent *p;
{
return (p);
}
#endif /* ! lint */
/*
* Rebalance a tree, starting at p and up.
* F == 0 means we've come from p's left child.
* D == 1 means we've just done a delete, otherwise an insert.
*/
static void
balance(p, f, d)
struct varent *p;
int f, d;
{
struct varent *pp;
#ifndef lint
struct varent *t; /* used by the rotate macros */
#endif
int ff;
/*
* Ok, from here on, p is the node we're operating on; pp is it's parent; f
* is the branch of p from which we have come; ff is the branch of pp which
* is p.
*/
for (; (pp = p->v_parent) != NULL; p = pp, f = ff) {
ff = pp->v_right == p;
if (f ^ d) { /* right heavy */
switch (p->v_bal) {
case -1: /* was left heavy */
p->v_bal = 0;
break;
case 0: /* was balanced */
p->v_bal = 1;
break;
case 1: /* was already right heavy */
switch (p->v_right->v_bal) {
case 1: /* single rotate */
pp->v_link[ff] = rleft(p);
p->v_left->v_bal = 0;
p->v_bal = 0;
break;
case 0: /* single rotate */
pp->v_link[ff] = rleft(p);
p->v_left->v_bal = 1;
p->v_bal = -1;
break;
case -1: /* double rotate */
(void) rright(p->v_right);
pp->v_link[ff] = rleft(p);
p->v_left->v_bal =
p->v_bal < 1 ? 0 : -1;
p->v_right->v_bal =
p->v_bal > -1 ? 0 : 1;
p->v_bal = 0;
break;
}
break;
}
}
else { /* left heavy */
switch (p->v_bal) {
case 1: /* was right heavy */
p->v_bal = 0;
break;
case 0: /* was balanced */
p->v_bal = -1;
break;
case -1: /* was already left heavy */
switch (p->v_left->v_bal) {
case -1: /* single rotate */
pp->v_link[ff] = rright(p);
p->v_right->v_bal = 0;
p->v_bal = 0;
break;
case 0: /* single rotate */
pp->v_link[ff] = rright(p);
p->v_right->v_bal = -1;
p->v_bal = 1;
break;
case 1: /* double rotate */
(void) rleft(p->v_left);
pp->v_link[ff] = rright(p);
p->v_left->v_bal =
p->v_bal < 1 ? 0 : -1;
p->v_right->v_bal =
p->v_bal > -1 ? 0 : 1;
p->v_bal = 0;
break;
}
break;
}
}
/*
* If from insert, then we terminate when p is balanced. If from
* delete, then we terminate when p is unbalanced.
*/
if ((p->v_bal == 0) ^ d)
break;
}
}
void
plist(p)
struct varent *p;
{
struct varent *c;
int len;
if (setintr)
(void) sigsetmask(sigblock(0) & ~sigmask(SIGINT));
for (;;) {
while (p->v_left)
p = p->v_left;
x:
if (p->v_parent == 0) /* is it the header? */
return;
len = blklen(p->vec);
(void) fprintf(cshout, "%s\t", short2str(p->v_name));
if (len != 1)
(void) fputc('(', cshout);
blkpr(cshout, p->vec);
if (len != 1)
(void) fputc(')', cshout);
(void) fputc('\n', cshout);
if (p->v_right) {
p = p->v_right;
continue;
}
do {
c = p;
p = p->v_parent;
} while (p->v_right == c);
goto x;
}
}
-472
View File
@@ -1,472 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)str.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#define MALLOC_INCR 128
/*
* tc.str.c: Short string package
* This has been a lesson of how to write buggy code!
*/
#include <sys/types.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include <vis.h>
#include "csh.h"
#include "extern.h"
#ifdef SHORT_STRINGS
Char **
blk2short(src)
char **src;
{
size_t n;
Char **sdst, **dst;
/*
* Count
*/
for (n = 0; src[n] != NULL; n++)
continue;
sdst = dst = (Char **) xmalloc((size_t) ((n + 1) * sizeof(Char *)));
for (; *src != NULL; src++)
*dst++ = SAVE(*src);
*dst = NULL;
return (sdst);
}
char **
short2blk(src)
Char **src;
{
size_t n;
char **sdst, **dst;
/*
* Count
*/
for (n = 0; src[n] != NULL; n++)
continue;
sdst = dst = (char **) xmalloc((size_t) ((n + 1) * sizeof(char *)));
for (; *src != NULL; src++)
*dst++ = strsave(short2str(*src));
*dst = NULL;
return (sdst);
}
Char *
str2short(src)
char *src;
{
static Char *sdst;
static size_t dstsize = 0;
Char *dst, *edst;
if (src == NULL)
return (NULL);
if (sdst == (NULL)) {
dstsize = MALLOC_INCR;
sdst = (Char *) xmalloc((size_t) dstsize * sizeof(Char));
}
dst = sdst;
edst = &dst[dstsize];
while (*src) {
*dst++ = (Char) ((unsigned char) *src++);
if (dst == edst) {
dstsize += MALLOC_INCR;
sdst = (Char *) xrealloc((ptr_t) sdst,
(size_t) dstsize * sizeof(Char));
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
}
}
*dst = 0;
return (sdst);
}
char *
short2str(src)
Char *src;
{
static char *sdst = NULL;
static size_t dstsize = 0;
char *dst, *edst;
if (src == NULL)
return (NULL);
if (sdst == NULL) {
dstsize = MALLOC_INCR;
sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
}
dst = sdst;
edst = &dst[dstsize];
while (*src) {
*dst++ = (char) *src++;
if (dst == edst) {
dstsize += MALLOC_INCR;
sdst = (char *) xrealloc((ptr_t) sdst,
(size_t) dstsize * sizeof(char));
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
}
}
*dst = 0;
return (sdst);
}
Char *
s_strcpy(dst, src)
Char *dst, *src;
{
Char *sdst;
sdst = dst;
while ((*dst++ = *src++) != '\0')
continue;
return (sdst);
}
Char *
s_strncpy(dst, src, n)
Char *dst, *src;
size_t n;
{
Char *sdst;
if (n == 0)
return(dst);
sdst = dst;
do
if ((*dst++ = *src++) == '\0') {
while (--n != 0)
*dst++ = '\0';
return(sdst);
}
while (--n != 0);
return (sdst);
}
Char *
s_strcat(dst, src)
Char *dst, *src;
{
short *sdst;
sdst = dst;
while (*dst++)
continue;
--dst;
while ((*dst++ = *src++) != '\0')
continue;
return (sdst);
}
#ifdef NOTUSED
Char *
s_strncat(dst, src, n)
Char *dst, *src;
size_t n;
{
Char *sdst;
if (n == 0)
return (dst);
sdst = dst;
while (*dst++)
continue;
--dst;
do
if ((*dst++ = *src++) == '\0')
return(sdst);
while (--n != 0)
continue;
*dst = '\0';
return (sdst);
}
#endif
Char *
s_strchr(str, ch)
Char *str;
int ch;
{
do
if (*str == ch)
return (str);
while (*str++);
return (NULL);
}
Char *
s_strrchr(str, ch)
Char *str;
int ch;
{
Char *rstr;
rstr = NULL;
do
if (*str == ch)
rstr = str;
while (*str++);
return (rstr);
}
size_t
s_strlen(str)
Char *str;
{
size_t n;
for (n = 0; *str++; n++)
continue;
return (n);
}
int
s_strcmp(str1, str2)
Char *str1, *str2;
{
for (; *str1 && *str1 == *str2; str1++, str2++)
continue;
/*
* The following case analysis is necessary so that characters which look
* negative collate low against normal characters but high against the
* end-of-string NUL.
*/
if (*str1 == '\0' && *str2 == '\0')
return (0);
else if (*str1 == '\0')
return (-1);
else if (*str2 == '\0')
return (1);
else
return (*str1 - *str2);
}
int
s_strncmp(str1, str2, n)
Char *str1, *str2;
size_t n;
{
if (n == 0)
return (0);
do {
if (*str1 != *str2) {
/*
* The following case analysis is necessary so that characters
* which look negative collate low against normal characters
* but high against the end-of-string NUL.
*/
if (*str1 == '\0')
return (-1);
else if (*str2 == '\0')
return (1);
else
return (*str1 - *str2);
break;
}
if (*str1 == '\0')
return(0);
str1++, str2++;
} while (--n != 0);
return(0);
}
Char *
s_strsave(s)
Char *s;
{
Char *n;
Char *p;
if (s == 0)
s = STRNULL;
for (p = s; *p++;)
continue;
n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char)));
while ((*p++ = *s++) != '\0')
continue;
return (n);
}
Char *
s_strspl(cp, dp)
Char *cp, *dp;
{
Char *ep;
Char *p, *q;
if (!cp)
cp = STRNULL;
if (!dp)
dp = STRNULL;
for (p = cp; *p++;)
continue;
for (q = dp; *q++;)
continue;
ep = (Char *) xmalloc((size_t)
(((p - cp) + (q - dp) - 1) * sizeof(Char)));
for (p = ep, q = cp; (*p++ = *q++) != '\0';)
continue;
for (p--, q = dp; (*p++ = *q++) != '\0';)
continue;
return (ep);
}
Char *
s_strend(cp)
Char *cp;
{
if (!cp)
return (cp);
while (*cp)
cp++;
return (cp);
}
Char *
s_strstr(s, t)
Char *s, *t;
{
do {
Char *ss = s;
Char *tt = t;
do
if (*tt == '\0')
return (s);
while (*ss++ == *tt++);
} while (*s++ != '\0');
return (NULL);
}
#endif /* SHORT_STRINGS */
char *
short2qstr(src)
Char *src;
{
static char *sdst = NULL;
static size_t dstsize = 0;
char *dst, *edst;
if (src == NULL)
return (NULL);
if (sdst == NULL) {
dstsize = MALLOC_INCR;
sdst = (char *) xmalloc((size_t) dstsize * sizeof(char));
}
dst = sdst;
edst = &dst[dstsize];
while (*src) {
if (*src & QUOTE) {
*dst++ = '\\';
if (dst == edst) {
dstsize += MALLOC_INCR;
sdst = (char *) xrealloc((ptr_t) sdst,
(size_t) dstsize * sizeof(char));
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
}
}
*dst++ = (char) *src++;
if (dst == edst) {
dstsize += MALLOC_INCR;
sdst = (char *) xrealloc((ptr_t) sdst,
(size_t) dstsize * sizeof(char));
edst = &sdst[dstsize];
dst = &edst[-MALLOC_INCR];
}
}
*dst = 0;
return (sdst);
}
/*
* XXX: Should we worry about QUOTE'd chars?
*/
char *
vis_str(cp)
Char *cp;
{
static char *sdst = NULL;
static size_t dstsize = 0;
size_t n;
Char *dp;
if (cp == NULL)
return (NULL);
for (dp = cp; *dp++;)
continue;
n = ((dp - cp) << 2) + 1; /* 4 times + NULL */
if (dstsize < n) {
sdst = (char *) (dstsize ?
xrealloc(sdst, (size_t) n * sizeof(char)) :
xmalloc((size_t) n * sizeof(char)));
dstsize = n;
}
/*
* XXX: When we are in AsciiOnly we want all characters >= 0200 to
* be encoded, but currently there is no way in vis to do that.
*/
(void) strvis(sdst, short2str(cp), VIS_NOSLASH);
return (sdst);
}
+2709
View File
File diff suppressed because it is too large. Load diff
-321
View File
@@ -1,321 +0,0 @@
/*-
* Copyright (c) 1980, 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef lint
#if 0
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93";
#else
static const char rcsid[] =
"$FreeBSD$";
#endif
#endif /* not lint */
#include <sys/types.h>
#if __STDC__
# include <stdarg.h>
#else
# include <varargs.h>
#endif
#include "csh.h"
#include "extern.h"
/*
* C Shell - routines handling process timing and niceing
*/
static void pdeltat __P((struct timeval *, struct timeval *));
void
settimes()
{
struct rusage ruch;
(void) gettimeofday(&time0, NULL);
(void) getrusage(RUSAGE_SELF, &ru0);
(void) getrusage(RUSAGE_CHILDREN, &ruch);
ruadd(&ru0, &ruch);
}
/*
* dotime is only called if it is truly a builtin function and not a
* prefix to another command
*/
void
/*ARGSUSED*/
dotime(v, t)
Char **v;
struct command *t;
{
struct timeval timedol;
struct rusage ru1, ruch;
(void) getrusage(RUSAGE_SELF, &ru1);
(void) getrusage(RUSAGE_CHILDREN, &ruch);
ruadd(&ru1, &ruch);
(void) gettimeofday(&timedol, NULL);
prusage(&ru0, &ru1, &timedol, &time0);
}
/*
* donice is only called when it on the line by itself or with a +- value
*/
void
/*ARGSUSED*/
donice(v, t)
Char **v;
struct command *t;
{
Char *cp;
int nval = 0;
v++, cp = *v++;
if (cp == 0)
nval = 4;
else if (*v == 0 && any("+-", cp[0]))
nval = getn(cp);
(void) setpriority(PRIO_PROCESS, 0, nval);
}
void
ruadd(ru, ru2)
struct rusage *ru, *ru2;
{
tvadd(&ru->ru_utime, &ru2->ru_utime);
tvadd(&ru->ru_stime, &ru2->ru_stime);
if (ru2->ru_maxrss > ru->ru_maxrss)
ru->ru_maxrss = ru2->ru_maxrss;
ru->ru_ixrss += ru2->ru_ixrss;
ru->ru_idrss += ru2->ru_idrss;
ru->ru_isrss += ru2->ru_isrss;
ru->ru_minflt += ru2->ru_minflt;
ru->ru_majflt += ru2->ru_majflt;
ru->ru_nswap += ru2->ru_nswap;
ru->ru_inblock += ru2->ru_inblock;
ru->ru_oublock += ru2->ru_oublock;
ru->ru_msgsnd += ru2->ru_msgsnd;
ru->ru_msgrcv += ru2->ru_msgrcv;
ru->ru_nsignals += ru2->ru_nsignals;
ru->ru_nvcsw += ru2->ru_nvcsw;
ru->ru_nivcsw += ru2->ru_nivcsw;
}
void
prusage(r0, r1, e, b)
struct rusage *r0, *r1;
struct timeval *e, *b;
{
time_t t =
(r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 +
(r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 +
(r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 +
(r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000;
char *cp;
long i;
struct varent *vp = adrof(STRtime);
int ms =
(e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
cp = "%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww";
if (vp && vp->vec[0] && vp->vec[1])
cp = short2str(vp->vec[1]);
for (; *cp; cp++)
if (*cp != '%')
(void) fputc(*cp, cshout);
else if (cp[1])
switch (*++cp) {
case 'U': /* user CPU time used */
pdeltat(&r1->ru_utime, &r0->ru_utime);
break;
case 'S': /* system CPU time used */
pdeltat(&r1->ru_stime, &r0->ru_stime);
break;
case 'E': /* elapsed (wall-clock) time */
pcsecs((long) ms);
break;
case 'P': /* percent time spent running */
/* check if it did not run at all */
i = (ms == 0) ? 0 : (t * 1000 / ms);
/* nn.n% */
(void) fprintf(cshout, "%ld.%01ld%%", i / 10, i % 10);
break;
case 'W': /* number of swaps */
i = r1->ru_nswap - r0->ru_nswap;
(void) fprintf(cshout, "%ld", i);
break;
case 'X': /* (average) shared text size */
(void) fprintf(cshout, "%ld", t == 0 ? 0L :
(r1->ru_ixrss - r0->ru_ixrss) / t);
break;
case 'D': /* (average) unshared data size */
(void) fprintf(cshout, "%ld", t == 0 ? 0L :
(r1->ru_idrss + r1->ru_isrss -
(r0->ru_idrss + r0->ru_isrss)) / t);
break;
case 'K': /* (average) total data memory used */
(void) fprintf(cshout, "%ld", t == 0 ? 0L :
((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) -
(r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) / t);
break;
case 'M': /* max. Resident Set Size */
(void) fprintf(cshout, "%ld", r1->ru_maxrss / 2L);
break;
case 'F': /* page faults */
(void) fprintf(cshout, "%ld", r1->ru_majflt - r0->ru_majflt);
break;
case 'R': /* page reclaims */
(void) fprintf(cshout, "%ld", r1->ru_minflt - r0->ru_minflt);
break;
case 'I': /* FS blocks in */
(void) fprintf(cshout, "%ld", r1->ru_inblock - r0->ru_inblock);
break;
case 'O': /* FS blocks out */
(void) fprintf(cshout, "%ld", r1->ru_oublock - r0->ru_oublock);
break;
case 'r': /* socket messages received */
(void) fprintf(cshout, "%ld", r1->ru_msgrcv - r0->ru_msgrcv);
break;
case 's': /* socket messages sent */
(void) fprintf(cshout, "%ld", r1->ru_msgsnd - r0->ru_msgsnd);
break;
case 'k': /* number of signals received */
(void) fprintf(cshout, "%ld", r1->ru_nsignals-r0->ru_nsignals);
break;
case 'w': /* num. voluntary context switches (waits) */
(void) fprintf(cshout, "%ld", r1->ru_nvcsw - r0->ru_nvcsw);
break;
case 'c': /* num. involuntary context switches */
(void) fprintf(cshout, "%ld", r1->ru_nivcsw - r0->ru_nivcsw);
break;
}
(void) fputc('\n', cshout);
}
static void
pdeltat(t1, t0)
struct timeval *t1, *t0;
{
struct timeval td;
tvsub(&td, t1, t0);
(void) fprintf(cshout, "%ld.%01ld", td.tv_sec, td.tv_usec / 100000L);
}
void
tvadd(tsum, t0)
struct timeval *tsum, *t0;
{
tsum->tv_sec += t0->tv_sec;
tsum->tv_usec += t0->tv_usec;
if (tsum->tv_usec >= 1000000)
tsum->tv_sec++, tsum->tv_usec -= 1000000;
}
void
tvsub(tdiff, t1, t0)
struct timeval *tdiff, *t1, *t0;
{
tdiff->tv_sec = t1->tv_sec - t0->tv_sec;
tdiff->tv_usec = t1->tv_usec - t0->tv_usec;
if (tdiff->tv_usec < 0)
tdiff->tv_sec--, tdiff->tv_usec += 1000000;
}
#define P2DIG(i) (void) fprintf(cshout, "%d%d", (i) / 10, (i) % 10)
void
psecs(l)
long l;
{
int i;
i = l / 3600;
if (i) {
(void) fprintf(cshout, "%d:", i);
i = l % 3600;
P2DIG(i / 60);
goto minsec;
}
i = l;
(void) fprintf(cshout, "%d", i / 60);
minsec:
i %= 60;
(void) fputc(':', cshout);
P2DIG(i);
}
void
pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
long l;
{
int i;
i = l / 360000;
if (i) {
(void) fprintf(cshout, "%d:", i);
i = (l % 360000) / 100;
P2DIG(i / 60);
goto minsec;
}
i = l / 100;
(void) fprintf(cshout, "%d", i / 60);
minsec:
i %= 60;
(void) fputc(':', cshout);
P2DIG(i);
(void) fputc('.', cshout);
P2DIG((int) (l % 100));
}
+87 -57
View File
@@ -61,23 +61,26 @@
.Oc
.Op Cm + Ns Ar format
.Sh DESCRIPTION
.Nm Date
displays the current date and time when invoked without arguments.
Providing arguments will format the date and time in a user-defined
way or set the date.
When invoked without arguments, the
.Nm
utility displays the current date and time.
Otherwise, depending on the options specified,
.Nm
will set the date and time or print it in a user-defined way.
.Pp
Only the superuser may set the date.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Set the kernel's value for daylight savings time.
.It Fl d Ar dst
Set the kernel's value for daylight saving time.
If
.Ar dst
is non-zero, future calls
to
.Xr gettimeofday 2
will return a non-zero
.Ql tz_dsttime .
will return a non-zero for
.Fa tz_dsttime .
.It Fl f
Use
.Ar fmt
@@ -89,61 +92,64 @@ the default
.Oc "\&yy" Oc "\&mm" Oc "\&dd" Oc "\&HH" Ns
.Oc
.No "\&MM" Ns Op "\&.ss" Xc
format. Parsing is done using
format.
Parsing is done using
.Xr strptime 3 .
.It Fl j
Do not try to set the date. This allows you to use the
Do not try to set the date.
This allows you to use the
.Fl f
flag in addition to the
.Cm +
option to convert one date format to another.
.It Fl n
The utility
By default, if the
.Xr timed 8
is used to synchronize the clocks on groups of machines.
By default, if
.Xr timed
is running,
daemon is running,
.Nm
will set the time on all of the machines in the local group.
sets the time on all of the machines in the local group.
The
.Fl n
option stops
.Nm
from setting the time for other than the current machine.
.It Fl r
Print out the date and time that is
option suppresses this behavior and causes the time to be set only on the
current machine.
.It Fl r Ar seconds
Print the date and time represented by
.Ar seconds ,
where
.Ar seconds
from the Epoch
is the number of seconds since the Epoch
.Po
00:00:00 UTC, January 1, 1970;
see
.Xr time 3
.Pc .
.It Fl t
Set the kernel's value for minutes west of
.It Fl t Ar minutes_west
Set the system's value for minutes west of
.Tn GMT .
.Ar Minutes_west
.Ar minutes_west
specifies the number of minutes returned in
.Ql tz_minuteswest
.Fa tz_minuteswest
by future calls to
.Xr gettimeofday 2 .
.It Fl u
Display or set the date in
.Tn UCT
.Pq universal
time.
.Tn UTC
(Coordinated Universal) time.
.It Fl v
Adjust the second, minute, hour, month day, week day, month or year according to
Adjust the second, minute, hour, month day, week day,
month or year according to
.Ar val .
If
.Ar val
is preceded with a plus or minus sign, the date is adjusted forwards
or backwards according to the remaining string, otherwise the relevant
part of the date is set. The date can be adjusted as many times as
required using these flags. Flags are processed in the order given.
is preceded with a plus or minus sign,
the date is adjusted forwards or backwards according to the remaining string,
otherwise the relevant part of the date is set.
The date can be adjusted as many times as required using these flags.
Flags are processed in the order given.
.Pp
Seconds are in the range 0-59, minutes are in the range 0-59, hours are
When setting values
.Pq rather than adjusting them ,
seconds are in the range 0-59, minutes are in the range 0-59, hours are
in the range 1-12, month days are in the range 1-31, week days are in the
range 0-6
.Pq Sun-Sat ,
@@ -165,26 +171,52 @@ or
must be used to specify which part of the date is to be adjusted.
.Pp
The week day or month may be specified using a name rather than a
number. If a name is used with the plus
number.
If a name is used with the plus
.Pq or minus
sign, the date will be put forwards
.Pq or backwards
to the next
.Pq previous
date that matches the given week day or month. This will not adjust the date
date that matches the given week day or month.
This will not adjust the date,
if the given week day or month is the same as the current one.
.Pp
When a date is adjusted to a specific value or in units greater than hours,
daylight savings time considerations are ignored.
Adjustments in units of hours or less honor daylight saving time.
So, assuming the current date is March 26, 0:30 and that the DST adjustment
means that the clock goes forward at 01:00 to 02:00, using
.Fl v No +1H
will adjust the date to March 26, 2:30.
Likewise, if the date is October 29, 0:30 and the DST adjustment means that
the clock goes back at 02:00 to 01:00, using
.Fl v No +3H
will be necessary to reach October 29, 2:30.
.Pp
When the date is adjusted to a specific value that doesn't actually exist
.Pq for example March 26, 1:30 BST 2000 in the Europe/London timezone ,
the date will be silently adjusted forwards in units of one hour until it
reaches a valid time.
When the date is adjusted to a specific value that occurs twice
.Pq for example October 29, 1:30 2000 ,
the resulting timezone will be set so that the date matches the earlier of
the two times.
.Pp
Refer to the examples below for further details.
.El
.Pp
An operand with a leading plus
.Pq Dq \&+
sign signals a user-defined format string which specifies the format in
which to display the date and time. The format string may contain any of
the conversion specifications described in the
.Pq Sq +
sign signals a user-defined format string
which specifies the format in which to display the date and time.
The format string may contain any of the conversion specifications
described in the
.Xr strftime 3
manual page, as well as any arbitrary text.
A <newline> character is always output after the characters specified by
A newline
.Pq Ql \en
character is always output after the characters specified by
the format string.
The format string for the default display is
.Dq +%+ .
@@ -202,23 +234,22 @@ prepended to the abbreviated year.
Year in abbreviated form
.Pq e.g. 89 for 1989, 06 for 2006 .
.It Ar mm
Numeric month.
A number from 1 to 12.
Numeric month, a number from 1 to 12.
.It Ar dd
Day, a number from 1 to 31.
.It Ar HH
Hour, a number from 0 to 23.
.It Ar MM
Minutes, a number from 0 to 59.
.It Ar .ss
.It Ar ss
Seconds, a number from 0 to 61
.Pq 59 plus a maximum of two leap seconds .
.El
.Pp
Everything but the minutes is optional.
.Pp
Time changes for Daylight Saving and Standard time and leap seconds
and years are handled automatically.
Time changes for Daylight Saving Time, standard time, leap seconds,
and leap years are handled automatically.
.Sh EXAMPLES
The command:
.Bd -literal -offset indent
@@ -231,14 +262,14 @@ DATE: 1987-11-21
TIME: 13:36:16
.Ed
.Pp
The command:
In the Europe/London timezone, the command:
.Bd -literal -offset indent
date -v1m -v+1y
.Ed
.Pp
will display:
.Bd -literal -offset indent
Sun Jan 4 03:15:24 GMT 1998
Sun Jan 4 04:15:24 GMT 1998
.Ed
.Pp
where it is currently Mon Aug 4 04:15:24 BST 1997.
@@ -282,9 +313,8 @@ sets the time to
.Li "2:32 PM" ,
without modifying the date.
.Sh ENVIRONMENT
The execution of
.Nm
is affected by the following environment variables:
The following environment variables affect the execution of
.Nm Ns :
.Bl -tag -width Ds
.It Ev TZ
The timezone to use when displaying dates.
@@ -300,9 +330,9 @@ for more information.
.Sh FILES
.Bl -tag -width /var/log/messages -compact
.It Pa /var/log/wtmp
a record of date resets and time changes
record of date resets and time changes
.It Pa /var/log/messages
a record of the user setting the time
record of the user setting the time
.El
.Sh SEE ALSO
.Xr gettimeofday 2 ,
@@ -322,7 +352,7 @@ utility exits 0 on success, 1 if unable to set the date, and 2
if able to set the local date, but unable to set it globally.
.Pp
Occasionally, when
.Xr timed
.Xr timed 8
synchronizes the time on many hosts, the setting of a new time value may
require more than a few seconds.
On these occasions,
@@ -335,12 +365,12 @@ occurs when the communication
between
.Nm
and
.Xr timed
.Xr timed 8
fails.
.Sh STANDARDS
The
.Nm
command is expected to be compatible with
utility is expected to be compatible with
.St -p1003.2 .
.Sh HISTORY
A
+3 -3
View File
@@ -118,15 +118,15 @@ main(argc, argv)
rflag = 1;
tval = atol(optarg);
break;
case 't': /* minutes west of GMT */
case 't': /* minutes west of UTC */
/* error check; don't allow "PST" */
tz.tz_minuteswest = strtol(optarg, &endptr, 10);
if (endptr == optarg || *endptr != '\0')
usage();
set_timezone = 1;
break;
case 'u': /* do everything in GMT */
(void)setenv("TZ", "GMT0", 1);
case 'u': /* do everything in UTC */
(void)setenv("TZ", "UTC0", 1);
break;
case 'v':
v = vary_append(v, optarg);
+125 -84
View File
@@ -53,6 +53,19 @@ static struct trans trans_wday[] = {
};
static char digits[] = "0123456789";
static int adjhour(struct tm *, char, int, int);
static int
domktime(struct tm *t, char type)
{
time_t ret;
while ((ret = mktime(t)) == -1 && t->tm_year > 68 && t->tm_year < 138)
/* While mktime() fails, adjust by an hour */
adjhour(t, type == '-' ? type : '+', 1, 0);
return ret;
}
static int
trans(const struct trans t[], const char *arg)
@@ -112,7 +125,7 @@ daysinmonth(const struct tm *t)
static int
adjyear(struct tm *t, char type, int val)
adjyear(struct tm *t, char type, int val, int mk)
{
switch (type) {
case '+':
@@ -129,11 +142,11 @@ adjyear(struct tm *t, char type, int val)
t->tm_year -= 1900; /* struct tm holds years since 1900 */
break;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
static int
adjmon(struct tm *t, char type, int val, int istext)
adjmon(struct tm *t, char type, int val, int istext, int mk)
{
if (val < 0)
return 0;
@@ -146,12 +159,14 @@ adjmon(struct tm *t, char type, int val, int istext)
else
val -= t->tm_mon + 1; /* later this year */
}
if (!adjyear(t, '+', (t->tm_mon + val) / 12))
return 0;
val %= 12;
t->tm_mon += val;
if (t->tm_mon > 11)
t->tm_mon -= 12;
if (val) {
if (!adjyear(t, '+', (t->tm_mon + val) / 12, 0))
return 0;
val %= 12;
t->tm_mon += val;
if (t->tm_mon > 11)
t->tm_mon -= 12;
}
break;
case '-':
@@ -161,15 +176,17 @@ adjmon(struct tm *t, char type, int val, int istext)
else
val = t->tm_mon - val + 1; /* early this year */
}
if (!adjyear(t, '-', val / 12))
return 0;
val %= 12;
if (val > t->tm_mon) {
if (!adjyear(t, '-', 1))
if (val) {
if (!adjyear(t, '-', val / 12, 0))
return 0;
val -= 12;
val %= 12;
if (val > t->tm_mon) {
if (!adjyear(t, '-', 1, 0))
return 0;
val -= 12;
}
t->tm_mon -= val;
}
t->tm_mon -= val;
break;
default:
@@ -178,13 +195,14 @@ adjmon(struct tm *t, char type, int val, int istext)
t->tm_mon = --val;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
static int
adjday(struct tm *t, char type, int val)
adjday(struct tm *t, char type, int val, int mk)
{
int mdays;
switch (type) {
case '+':
while (val) {
@@ -192,7 +210,7 @@ adjday(struct tm *t, char type, int val)
if (val > mdays - t->tm_mday) {
val -= mdays - t->tm_mday + 1;
t->tm_mday = 1;
if (!adjmon(t, '+', 1, 0))
if (!adjmon(t, '+', 1, 0, 0))
return 0;
} else {
t->tm_mday += val;
@@ -205,7 +223,7 @@ adjday(struct tm *t, char type, int val)
if (val >= t->tm_mday) {
val -= t->tm_mday;
t->tm_mday = 1;
if (!adjmon(t, '-', 1, 0))
if (!adjmon(t, '-', 1, 0, 0))
return 0;
t->tm_mday = daysinmonth(t);
} else {
@@ -221,11 +239,11 @@ adjday(struct tm *t, char type, int val)
break;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
static int
adjwday(struct tm *t, char type, int val, int istext)
adjwday(struct tm *t, char type, int val, int istext, int mk)
{
if (val < 0)
return 0;
@@ -238,54 +256,62 @@ adjwday(struct tm *t, char type, int val, int istext)
else
val -= t->tm_wday; /* later this week */
else
val *= 7; /* "-W +5" == "5 weeks in the future" */
return adjday(t, '+', val);
val *= 7; /* "-v+5w" == "5 weeks in the future" */
return !val || adjday(t, '+', val, mk);
case '-':
if (istext)
if (istext) {
if (val > t->tm_wday)
val = 7 - val + t->tm_wday; /* later last week */
else
val = t->tm_wday - val; /* early this week */
else
val *= 7; /* "-W -5" == "5 weeks ago" */
return adjday(t, '-', val);
} else
val *= 7; /* "-v-5w" == "5 weeks ago" */
return !val || adjday(t, '-', val, mk);
default:
if (val < t->tm_wday)
return adjday(t, '-', t->tm_wday - val);
return adjday(t, '-', t->tm_wday - val, mk);
else if (val > 6)
return 0;
else if (val > t->tm_wday)
return adjday(t, '+', val - t->tm_wday);
return adjday(t, '+', val - t->tm_wday, mk);
}
return 1;
}
static int
adjhour(struct tm *t, char type, int val)
adjhour(struct tm *t, char type, int val, int mk)
{
if (val < 0)
return 0;
switch (type) {
case '+':
if (!adjday(t, '+', (t->tm_hour + val) / 24))
return 0;
val %= 24;
t->tm_hour += val;
if (t->tm_hour > 23)
t->tm_hour -= 24;
if (val) {
int days;
days = (t->tm_hour + val) / 24;
val %= 24;
t->tm_hour += val;
t->tm_hour %= 24;
if (!adjday(t, '+', days, 0))
return 0;
}
break;
case '-':
if (!adjday(t, '-', val / 24))
return 0;
val %= 24;
if (val > t->tm_hour) {
if (!adjday(t, '-', 1))
if (val) {
int days;
days = val / 24;
val %= 24;
if (val > t->tm_hour) {
days++;
val -= 24;
}
t->tm_hour -= val;
if (!adjday(t, '-', days, 0))
return 0;
val -= 24;
}
t->tm_hour -= val;
break;
default:
@@ -294,35 +320,39 @@ adjhour(struct tm *t, char type, int val)
t->tm_hour = val;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
static int
adjmin(struct tm *t, char type, int val)
adjmin(struct tm *t, char type, int val, int mk)
{
if (val < 0)
return 0;
switch (type) {
case '+':
if (!adjhour(t, '+', (t->tm_min + val) / 60))
return 0;
val %= 60;
t->tm_min += val;
if (t->tm_min > 59)
t->tm_min -= 60;
if (val) {
if (!adjhour(t, '+', (t->tm_min + val) / 60, 0))
return 0;
val %= 60;
t->tm_min += val;
if (t->tm_min > 59)
t->tm_min -= 60;
}
break;
case '-':
if (!adjhour(t, '-', val / 60))
return 0;
val %= 60;
if (val > t->tm_min) {
if (!adjhour(t, '-', 1))
if (val) {
if (!adjhour(t, '-', val / 60, 0))
return 0;
val -= 60;
val %= 60;
if (val > t->tm_min) {
if (!adjhour(t, '-', 1, 0))
return 0;
val -= 60;
}
t->tm_min -= val;
}
t->tm_min -= val;
break;
default:
@@ -331,35 +361,39 @@ adjmin(struct tm *t, char type, int val)
t->tm_min = val;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
static int
adjsec(struct tm *t, char type, int val)
adjsec(struct tm *t, char type, int val, int mk)
{
if (val < 0)
return 0;
switch (type) {
case '+':
if (!adjmin(t, '+', (t->tm_sec + val) / 60))
return 0;
val %= 60;
t->tm_sec += val;
if (t->tm_sec > 59)
t->tm_sec -= 60;
if (val) {
if (!adjmin(t, '+', (t->tm_sec + val) / 60, 0))
return 0;
val %= 60;
t->tm_sec += val;
if (t->tm_sec > 59)
t->tm_sec -= 60;
}
break;
case '-':
if (!adjmin(t, '-', val / 60))
return 0;
val %= 60;
if (val > t->tm_sec) {
if (!adjmin(t, '-', 1))
if (val) {
if (!adjmin(t, '-', val / 60, 0))
return 0;
val -= 60;
val %= 60;
if (val > t->tm_sec) {
if (!adjmin(t, '-', 1, 0))
return 0;
val -= 60;
}
t->tm_sec -= val;
}
t->tm_sec -= val;
break;
default:
@@ -368,7 +402,7 @@ adjsec(struct tm *t, char type, int val)
t->tm_sec = val;
}
return mktime(t) != -1;
return !mk || domktime(t, type) != -1;
}
const struct vary *
@@ -391,15 +425,18 @@ vary_apply(const struct vary *v, struct tm *t)
if (len < 2)
return v;
if (type == '\0')
t->tm_isdst = -1;
if (strspn(arg, digits) != len-1) {
val = trans(trans_wday, arg);
if (val != -1) {
if (!adjwday(t, type, val, 1))
if (!adjwday(t, type, val, 1, 1))
return v;
} else {
val = trans(trans_mon, arg);
if (val != -1) {
if (!adjmon(t, type, val, 1))
if (!adjmon(t, type, val, 1, 1))
return v;
} else
return v;
@@ -410,31 +447,35 @@ vary_apply(const struct vary *v, struct tm *t)
switch (which) {
case 'S':
if (!adjsec(t, type, val))
if (!adjsec(t, type, val, 1))
return v;
break;
case 'M':
if (!adjmin(t, type, val))
if (!adjmin(t, type, val, 1))
return v;
break;
case 'H':
if (!adjhour(t, type, val))
if (!adjhour(t, type, val, 1))
return v;
break;
case 'd':
if (!adjday(t, type, val))
t->tm_isdst = -1;
if (!adjday(t, type, val, 1))
return v;
break;
case 'w':
if (!adjwday(t, type, val, 0))
t->tm_isdst = -1;
if (!adjwday(t, type, val, 0, 1))
return v;
break;
case 'm':
if (!adjmon(t, type, val, 0))
t->tm_isdst = -1;
if (!adjmon(t, type, val, 0, 1))
return v;
break;
case 'y':
if (!adjyear(t, type, val))
t->tm_isdst = -1;
if (!adjyear(t, type, val, 1))
return v;
break;
default:
+4 -3
View File
@@ -1,5 +1,5 @@
# $FreeBSD$
# @(#)Makefile 8.3 (Berkeley) 5/8/95
# $FreeBSD$
PROG= df
SRCS= df.c vfslist.c
@@ -8,8 +8,9 @@ BINMODE=2555
MOUNT= ${.CURDIR}/../../sbin/mount
CFLAGS+= -I${MOUNT}
LDADD+= ${LIBM}
DPADD+= ${LIBM}
.PATH: ${MOUNT}
DPADD= ${LIBM}
LDADD= -lm
.include <bsd.prog.mk>
+9 -1
View File
@@ -40,7 +40,10 @@
.Nd display free disk space
.Sh SYNOPSIS
.Nm df
.Op Fl b | h | H | k | m | P
.Oo
.Fl b | h | H | k |
.Fl m | P
.Oc
.Op Fl ain
.Op Fl t Ar type
.Op Ar file | Ar filesystem ...
@@ -68,6 +71,11 @@ Use 512-byte blocks rather than the default. Note that
this overrides the
.Ev BLOCKSIZE
specification from the environment.
.It Fl g
Use 1073741824-byte (1-Gbyte) blocks rather than the default. Note that
this overrides the
.Ev BLOCKSIZE
specification from the environment.
.It Fl H
"Human-readable" output. Use unit suffixes: Byte, Kilobyte, Megabyte,
Gigabyte, Terabyte and Petabyte in order to reduce the number of
+5 -1
View File
@@ -122,7 +122,7 @@ main(argc, argv)
char *mntpt, *mntpath, **vfslist;
vfslist = NULL;
while ((ch = getopt(argc, argv, "abHhikmnPt:")) != -1)
while ((ch = getopt(argc, argv, "abgHhikmnPt:")) != -1)
switch (ch) {
case 'a':
aflag = 1;
@@ -133,6 +133,10 @@ main(argc, argv)
putenv("BLOCKSIZE=512");
hflag = 0;
break;
case 'g':
putenv("BLOCKSIZE=1g");
hflag = 0;
break;
case 'H':
hflag = UNITS_SI;
valp = vals_si;
+2 -4
View File
@@ -6,13 +6,11 @@ extensions and possible deviations from POSIX 1003.2.
OMISSIONS
---------
1) Locale(3) is not supported yet.
2) For backwards compatibility, the POSIX rule that says a range of
1) For backwards compatibility, the POSIX rule that says a range of
addresses cannot be used where only a single address is expected has
been relaxed.
3) To support the BSD `s' command (see extension [1] below),
2) To support the BSD `s' command (see extension [1] below),
substitution patterns cannot be delimited by numbers or the characters
`r', `g' and `p'. In contrast, POSIX specifies any character expect
space or newline can used as a delimiter.
+2 -1
View File
@@ -835,7 +835,8 @@ attempts to write the buffer if the terminal hangs up
USD:12-13
.Rs
.%A B. W. Kernighan and P. J. Plauger
.%A B. W. Kernighan
.%A P. J. Plauger
.%B Software Tools in Pascal
.%O Addison-Wesley
.%D 1981
+5 -3
View File
@@ -175,7 +175,9 @@ top:
if (read_file(*argv, 0) < 0 && !isatty(0))
quit(2);
else if (**argv != '!')
strcpy(old_filename, *argv);
if (strlcpy(old_filename, *argv, sizeof(old_filename))
>= sizeof(old_filename))
quit(2);
} else if (argc) {
fputs("?\n", stderr);
if (**argv == '\0')
@@ -1345,8 +1347,8 @@ strip_escapes(s)
int i = 0;
REALLOC(file, filesz, MAXPATHLEN + 1, NULL);
/* assert: no trailing escape */
while ((file[i++] = (*s == '\\') ? *++s : *s))
while (i < filesz - 1 /* Worry about a possible trailing escape */
&& (file[i++] = (*s == '\\') ? *++s : *s))
s++;
return file;
}
+29 -30
View File
@@ -7,12 +7,14 @@
* $FreeBSD$
*/
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <ctype.h>
#include <err.h>
#include <regex.h>
enum valtype {
integer, numeric_string, string
@@ -22,7 +24,7 @@ struct val {
enum valtype type;
union {
char *s;
int i;
quad_t i;
} u;
} ;
@@ -87,7 +89,7 @@ expr: TOKEN
struct val *
make_integer (i)
int i;
quad_t i;
{
struct val *vp;
@@ -139,11 +141,11 @@ struct val *vp;
}
int
quad_t
to_integer (vp)
struct val *vp;
{
int i;
quad_t i;
if (vp->type == integer)
return 1;
@@ -152,7 +154,7 @@ struct val *vp;
return 0;
/* vp->type == numeric_string, make it numeric */
i = atoi(vp->u.s);
i = strtoq(vp->u.s, (char**)NULL, 10);
free (vp->u.s);
vp->u.i = i;
vp->type = integer;
@@ -173,7 +175,7 @@ struct val *vp;
errx (2, "malloc() failed");
}
sprintf (tmp, "%d", vp->u.i);
sprintf (tmp, "%qd", vp->u.i);
vp->type = string;
vp->u.s = tmp;
}
@@ -239,7 +241,7 @@ char **argv;
yyparse ();
if (result->type == integer)
printf ("%d\n", result->u.i);
printf ("%qd\n", result->u.i);
else
printf ("%s\n", result->u.s);
@@ -274,7 +276,7 @@ struct val *a, *b;
if (is_zero_or_null (a) || is_zero_or_null (b)) {
free_value (a);
free_value (b);
return (make_integer (0));
return (make_integer ((quad_t)0));
} else {
free_value (b);
return (a);
@@ -290,11 +292,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) == 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) == 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r = make_integer (a->u.i == b->u.i);
r = make_integer ((quad_t)(a->u.i == b->u.i));
}
free_value (a);
@@ -311,11 +313,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) > 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) > 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r= make_integer (a->u.i > b->u.i);
r = make_integer ((quad_t)(a->u.i > b->u.i));
}
free_value (a);
@@ -332,11 +334,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) < 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) < 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r = make_integer (a->u.i < b->u.i);
r = make_integer ((quad_t)(a->u.i < b->u.i));
}
free_value (a);
@@ -353,11 +355,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) >= 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) >= 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r = make_integer (a->u.i >= b->u.i);
r = make_integer ((quad_t)(a->u.i >= b->u.i));
}
free_value (a);
@@ -374,11 +376,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) <= 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) <= 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r = make_integer (a->u.i <= b->u.i);
r = make_integer ((quad_t)(a->u.i <= b->u.i));
}
free_value (a);
@@ -395,11 +397,11 @@ struct val *a, *b;
if (isstring (a) || isstring (b)) {
to_string (a);
to_string (b);
r = make_integer (strcoll (a->u.s, b->u.s) != 0);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) != 0));
} else {
(void)to_integer(a);
(void)to_integer(b);
r = make_integer (a->u.i != b->u.i);
r = make_integer ((quad_t)(a->u.i != b->u.i));
}
free_value (a);
@@ -417,7 +419,7 @@ struct val *a, *b;
errx (2, "non-numeric argument");
}
r = make_integer (a->u.i + b->u.i);
r = make_integer (/*(quad_t)*/(a->u.i + b->u.i));
free_value (a);
free_value (b);
return r;
@@ -433,7 +435,7 @@ struct val *a, *b;
errx (2, "non-numeric argument");
}
r = make_integer (a->u.i - b->u.i);
r = make_integer (/*(quad_t)*/(a->u.i - b->u.i));
free_value (a);
free_value (b);
return r;
@@ -449,7 +451,7 @@ struct val *a, *b;
errx (2, "non-numeric argument");
}
r = make_integer (a->u.i * b->u.i);
r = make_integer (/*(quad_t)*/(a->u.i * b->u.i));
free_value (a);
free_value (b);
return (r);
@@ -469,7 +471,7 @@ struct val *a, *b;
errx (2, "division by zero");
}
r = make_integer (a->u.i / b->u.i);
r = make_integer (/*(quad_t)*/(a->u.i / b->u.i));
free_value (a);
free_value (b);
return r;
@@ -489,15 +491,12 @@ struct val *a, *b;
errx (2, "division by zero");
}
r = make_integer (a->u.i % b->u.i);
r = make_integer (/*(quad_t)*/(a->u.i % b->u.i));
free_value (a);
free_value (b);
return r;
}
#include <sys/types.h>
#include <regex.h>
struct val *
op_colon (a, b)
struct val *a, *b;
@@ -526,11 +525,11 @@ struct val *a, *b;
v = make_str (a->u.s + rm[1].rm_so);
} else {
v = make_integer (rm[0].rm_eo - rm[0].rm_so);
v = make_integer ((quad_t)(rm[0].rm_eo - rm[0].rm_so));
}
} else {
if (rp.re_nsub == 0) {
v = make_integer (0);
v = make_integer ((quad_t)0);
} else {
v = make_str ("");
}
+7 -2
View File
@@ -3,7 +3,12 @@
PROG= ls
SRCS= cmp.c setflags.c ls.c print.c util.c
.PATH: ${.CURDIR}/../../lib/libc/gen
SRCS= cmp.c ls.c print.c util.c
.if !defined(RELEASE_BUILD_FIXIT)
CFLAGS+= -DCOLORLS
LDADD+= -ltermcap
DPADD+= ${LIBTERMCAP}
.endif
.include <bsd.prog.mk>
+11 -4
View File
@@ -43,11 +43,18 @@ int revnamecmp __P((const FTSENT *, const FTSENT *));
int statcmp __P((const FTSENT *, const FTSENT *));
int revstatcmp __P((const FTSENT *, const FTSENT *));
char *flags_to_string __P((u_long, char *));
void prcopy __P((char *, char *, int));
void printcol __P((DISPLAY *));
void printlong __P((DISPLAY *));
void printscol __P((DISPLAY *));
void usage __P((void));
int len_octal __P((char *, int));
int prn_octal __P((char *));
int len_octal __P((const char *, int));
int prn_octal __P((const char *));
int prn_printable __P((const char *));
#ifdef COLORLS
void parsecolors __P((char *cs));
void colorquit __P((int));
extern char *ansi_fgcol;
extern char *ansi_bgcol;
extern char *ansi_coloff;
#endif
+112 -3
View File
@@ -43,7 +43,7 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm ls
.Op Fl ABCFHLPRTWabcdfgiklnoqrstu1
.Op Fl ABCFGHLPRTWabcdfgiklnoqrstu1
.Op Ar file ...
.Sh DESCRIPTION
For each operand that names a
@@ -90,6 +90,30 @@ an equals sign (=) after each socket,
a percent sign (%) after each whiteout,
and a vertical bar (|) after each that is a
.Tn FIFO .
.It Fl G
Use
.Tn ANSI
color sequences to distinguish file types.
See
.Ev LSCOLORS
below.
In addition to those mentioned above in
.Fl F ,
some extra attributes (setuid bit set, etc.) are also displayed.
The colorization is dependent on a terminal type with the proper
.Xr termcap 5
capabilities.
The default
.Dq cons25
console has the proper capabilities,
however if you want to display the colors in an
.Xr xterm 1
for example,
you need to set your
.Ev TERM
variable to
.Dq xterm-color .
Other terminal types may require similar adjustments.
.It Fl H
Symbolic links on the command line are followed. This option is assumed if
none of the
@@ -381,11 +405,85 @@ many pathname text columns to display
based on the width provided.
(See
.Fl C . )
.It Ev TZ
The timezone to use when displaying dates.
.It Ev LANG
The locale to use when determining the order of day and month in the long
.Fl l
format output.
See
.Xr environ 7
for more information.
.It LSCOLORS
The value of this variable describes what color to use for which
attribute when the color output
.Pq Fl G
is specified.
This string is a concatenation of pairs of the format
.Sy fb ,
where
.Sy f
is the foreground color and
.Sy b
is the background color.
.Pp
The color designators are as follows:
.Pp
.Bl -tag -width 4n -offset indent -compact
.It Sy 0
black
.It Sy 1
red
.It Sy 2
green
.It Sy 3
brown
.It Sy 4
blue
.It Sy 5
magenta
.It Sy 6
cyan
.It Sy 7
light grey
.It Sy x
default foreground or background
.El
.Pp
Note that the above are standard
.Tn ANSI
colors.
The actual display may differ
depending on the color capabilities of your terminal.
.Pp
The order of the attributes are as follows:
.Pp
.Bl -enum -offset indent -compact
.It
directory
.It
symbolic link
.It
socket
.It
pipe
.It
executable
.It
block special
.It
character special
.It
executable with setuid bit set
.It
executable with setgid bit set
.It
directory writable to others, with sticky bit
.It
directory writable to others, without sticky bit
.El
.Pp
The default is "4x5x2x3x1x464301060203", i.e. blue foreground and
default background for regular directories, black foreground and red
background for setuid executables, etc.
.It Ev LS_COLWIDTHS
If this variable is set, it is considered to be a
colon-delimited list of minimum column widths. Unreasonable
@@ -394,6 +492,15 @@ a dynamically sized column). Not all
columns have changeable widths. The fields are,
in order: inode, block count, number of links, user name,
group name, flags, file size, file name.
.It Ev TERM
The
.Fl G
option depends on a terminal type with color capabilities.
.It Ev TZ
The timezone to use when displaying dates.
See
.Xr environ 7
for more information.
.El
.Sh COMPATIBILITY
The group field is now automatically included in the long listing for
@@ -403,6 +510,8 @@ specification.
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr chmod 1 ,
.Xr xterm 1 ,
.Xr termcap 5 ,
.Xr symlink 7 ,
.Xr sticky 8
.Sh HISTORY
+72 -9
View File
@@ -63,6 +63,10 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef COLORLS
#include <termcap.h>
#include <signal.h>
#endif
#include "ls.h"
#include "extern.h"
@@ -74,8 +78,6 @@ static const char rcsid[] =
*/
#define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1)
char *getflags __P((u_long, char *));
static void display __P((FTSENT *, FTSENT *));
static u_quad_t makenines __P((u_long));
static int mastercmp __P((const FTSENT **, const FTSENT **));
@@ -111,6 +113,13 @@ int f_statustime; /* use time of last mode change */
int f_timesort; /* sort by time vice name */
int f_type; /* add type character for non-regular files */
int f_whiteout; /* show whiteout entries */
#ifdef COLORLS
int f_color; /* add type in color for non-regular files */
char *ansi_bgcol; /* ANSI sequence to set background colour */
char *ansi_fgcol; /* ANSI sequence to set foreground colour */
char *ansi_coloff; /* ANSI sequence to reset colours */
#endif
int rval;
@@ -124,6 +133,12 @@ main(argc, argv)
int ch, fts_options, notused;
char *p;
#ifdef COLORLS
char termcapbuf[1024]; /* termcap definition buffer */
char tcapbuf[512]; /* capability buffer */
char *bp = tcapbuf;
#endif
(void) setlocale(LC_ALL, "");
/* Terminal defaults to -Cq, non-terminal defaults to -1. */
@@ -148,7 +163,7 @@ main(argc, argv)
f_listdot = 1;
fts_options = FTS_PHYSICAL;
while ((ch = getopt(argc, argv, "1ABCFHLPRTWabcdfgiklnoqrstu")) != -1) {
while ((ch = getopt(argc, argv, "1ABCFGHLPRTWabcdfgiklnoqrstu")) != -1) {
switch (ch) {
/*
* The -1, -C and -l options all override each other so shell
@@ -186,6 +201,26 @@ main(argc, argv)
case 'H':
fts_options |= FTS_COMFOLLOW;
break;
case 'G':
if (isatty(STDOUT_FILENO))
#ifdef COLORLS
if (tgetent(termcapbuf, getenv("TERM")) == 1) {
ansi_fgcol = tgetstr("AF", &bp);
ansi_bgcol = tgetstr("AB", &bp);
/* To switch colours off use 'op' if
* available, otherwise use 'oc', or
* don't do colours at all. */
ansi_coloff = tgetstr("op", &bp);
if (!ansi_coloff)
ansi_coloff = tgetstr("oc", &bp);
if (ansi_fgcol && ansi_bgcol && ansi_coloff)
f_color = 1;
}
#else
(void)fprintf(stderr, "Color support not compiled in.\n");
#endif
break;
case 'L':
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
@@ -259,11 +294,30 @@ main(argc, argv)
argc -= optind;
argv += optind;
#ifdef COLORLS
if (f_color) {
/*
* We can't put tabs and color sequences together:
* column number will be incremented incorrectly
* for "stty oxtabs" mode.
*/
f_notabs = 1;
(void) signal(SIGINT, colorquit);
(void) signal(SIGQUIT, colorquit);
parsecolors(getenv("LSCOLORS"));
}
#endif
/*
* If not -F, -i, -l, -s or -t options, don't require stat
* information.
* information, unless in color mode in which case we do
* need this to determine which colors to display.
*/
if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type)
if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type
#ifdef COLORLS
&& !f_color
#endif
)
fts_options |= FTS_NOSTAT;
/*
@@ -471,7 +525,11 @@ display(p, list)
case 4: maxgroup = 0;
case 5: maxflags = 0;
case 6: maxsize = 0;
case 7: maxlen = 0, f_notabs = 0;
case 7: maxlen = 0;
#ifdef COLORLS
if (!f_color)
#endif
f_notabs = 0;
}
maxinode = makenines(maxinode);
maxblock = makenines(maxblock);
@@ -508,8 +566,6 @@ display(p, list)
continue;
}
}
if (f_nonprint)
prcopy(cur->fts_name, cur->fts_name, cur->fts_namelen);
if (cur->fts_namelen > maxlen)
maxlen = cur->fts_namelen;
if (f_octal || f_octal_escape) {
@@ -545,7 +601,13 @@ display(p, list)
if ((glen = strlen(group)) > maxgroup)
maxgroup = glen;
if (f_flags) {
flags = getflags(sp->st_flags, "-");
flags = fflagstostr(sp->st_flags);
if (flags != NULL && *flags == '\0') {
free(flags);
flags = strdup("-");
}
if (flags == NULL)
err(1, NULL);
if ((flen = strlen(flags)) > maxflags)
maxflags = flen;
} else
@@ -567,6 +629,7 @@ display(p, list)
if (f_flags) {
np->flags = &np->data[ulen + glen + 2];
(void)strcpy(np->flags, flags);
free(flags);
}
cur->fts_pointer = np;
}
+4
View File
@@ -48,11 +48,15 @@ extern int f_inode; /* print inode */
extern int f_longform; /* long listing format */
extern int f_octal; /* print unprintables in octal */
extern int f_octal_escape; /* like f_octal but use C escapes if possible */
extern int f_nonprint; /* show unprintables as ? */
extern int f_sectime; /* print the real time for all files */
extern int f_size; /* list size in short listing */
extern int f_statustime; /* use time of last mode change */
extern int f_notabs; /* don't use tab-separated multi-col output */
extern int f_type; /* add type character for non-regular files */
#ifdef COLORLS
extern int f_color; /* add type in color for non-regular files */
#endif
typedef struct {
FTSENT *list;
+217 -24
View File
@@ -56,6 +56,11 @@ static const char rcsid[] =
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifdef COLORLS
#include <ctype.h>
#include <termcap.h>
#include <signal.h>
#endif
#include "ls.h"
#include "extern.h"
@@ -64,9 +69,35 @@ static int printaname __P((FTSENT *, u_long, u_long));
static void printlink __P((FTSENT *));
static void printtime __P((time_t));
static int printtype __P((u_int));
#ifdef COLORLS
static void endcolor __P((int));
static int colortype __P((mode_t));
#endif
#define IS_NOPRINT(p) ((p)->fts_number == NO_PRINT)
#ifdef COLORLS
/* Most of these are taken from <sys/stat.h> */
typedef enum Colors {
C_DIR, /* directory */
C_LNK, /* symbolic link */
C_SOCK, /* socket */
C_FIFO, /* pipe */
C_EXEC, /* executable */
C_BLK, /* block special */
C_CHR, /* character special */
C_SUID, /* setuid executable */
C_SGID, /* setgid executable */
C_WSDIR, /* directory writeble to others, with sticky bit */
C_WDIR, /* directory writeble to others, without sticky bit */
C_NUMCOLORS /* just a place-holder */
} Colors ;
char *defcolors = "4x5x2x3x1x464301060203";
static int colors[C_NUMCOLORS][2];
#endif
void
printscol(dp)
DISPLAY *dp;
@@ -81,6 +112,21 @@ printscol(dp)
}
}
/*
* print name in current style
*/
static int
printname(name)
const char *name;
{
if (f_octal || f_octal_escape)
return prn_octal(name);
else if (f_nonprint)
return prn_printable(name);
else
return printf("%s", name);
}
void
printlong(dp)
DISPLAY *dp;
@@ -89,6 +135,9 @@ printlong(dp)
FTSENT *p;
NAMES *np;
char buf[20];
#ifdef COLORLS
int color_printed = 0;
#endif
if (dp->list->fts_level != FTS_ROOTLEVEL && (f_longform || f_size))
(void)printf("total %lu\n", howmany(dp->btotal, blocksize));
@@ -128,8 +177,15 @@ printlong(dp)
printtime(sp->st_ctime);
else
printtime(sp->st_mtime);
if (f_octal || f_octal_escape) (void)prn_octal(p->fts_name);
else (void)printf("%s", p->fts_name);
#ifdef COLORLS
if (f_color)
color_printed = colortype(sp->st_mode);
#endif
(void)printname(p->fts_name);
#ifdef COLORLS
if (f_color && color_printed)
endcolor(0);
#endif
if (f_type)
(void)printtype(sp->st_mode);
if (S_ISLNK(sp->st_mode))
@@ -221,6 +277,9 @@ printaname(p, inodefield, sizefield)
{
struct stat *sp;
int chcnt;
#ifdef COLORLS
int color_printed = 0;
#endif
sp = p->fts_statp;
chcnt = 0;
@@ -229,8 +288,15 @@ printaname(p, inodefield, sizefield)
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
chcnt += (f_octal || f_octal_escape) ? prn_octal(p->fts_name)
: printf("%s", p->fts_name);
#ifdef COLORLS
if (f_color)
color_printed = colortype(sp->st_mode);
#endif
chcnt += printname(p->fts_name);
#ifdef COLORLS
if (f_color && color_printed)
endcolor(0);
#endif
if (f_type)
chcnt += printtype(sp->st_mode);
return (chcnt);
@@ -240,30 +306,28 @@ static void
printtime(ftime)
time_t ftime;
{
int i;
char longstring[80];
static time_t now;
const char *format;
if (now == 0)
now = time(NULL);
strftime(longstring, sizeof(longstring), "%c", localtime(&ftime));
for (i = 4; i < 11; ++i)
(void)putchar(longstring[i]);
#define SIXMONTHS ((365 / 2) * 86400)
/* "%Ef" is a FreeBSD strftime definition for "%e %b" or "%b %e".
* Actually format is locale sensitive.
*/
if (f_sectime)
for (i = 11; i < 24; i++)
(void)putchar(longstring[i]);
/* mmm dd hh:mm:ss yyyy || dd mmm hh:mm:ss yyyy */
format = "%Ef %T %Y ";
else if (ftime + SIXMONTHS > now && ftime < now + SIXMONTHS)
for (i = 11; i < 16; ++i)
(void)putchar(longstring[i]);
else {
(void)putchar(' ');
for (i = 20; i < 24; ++i)
(void)putchar(longstring[i]);
}
(void)putchar(' ');
/* mmm dd hh:mm || dd mmm hh:mm */
format = "%Ef %R ";
else
/* mmm dd yyyy || dd mmm yyyy */
format = "%Ef %Y ";
strftime(longstring, sizeof(longstring), format, localtime(&ftime));
fputs(longstring, stdout);
}
static int
@@ -294,6 +358,138 @@ printtype(mode)
return (0);
}
#ifdef COLORLS
static int
putch(c)
int c;
{
(void) putchar(c);
return 0;
}
static int
writech(c)
int c;
{
char tmp = c;
(void) write(STDOUT_FILENO, &tmp, 1);
return 0;
}
static void
printcolor(c)
Colors c;
{
char *ansiseq;
if (colors[c][0] != -1) {
ansiseq = tgoto(ansi_fgcol, 0, colors[c][0]);
if (ansiseq)
tputs(ansiseq, 1, putch);
}
if (colors[c][1] != -1) {
ansiseq = tgoto(ansi_bgcol, 0, colors[c][1]);
if (ansiseq)
tputs(ansiseq, 1, putch);
}
}
static void
endcolor(sig)
int sig;
{
tputs(ansi_coloff, 1, sig ? writech : putch);
}
static int
colortype(mode)
mode_t mode;
{
switch(mode & S_IFMT) {
case S_IFDIR:
if (mode & S_IWOTH)
if (mode & S_ISTXT)
printcolor(C_WSDIR);
else
printcolor(C_WDIR);
else
printcolor(C_DIR);
return(1);
case S_IFLNK:
printcolor(C_LNK);
return(1);
case S_IFSOCK:
printcolor(C_SOCK);
return(1);
case S_IFIFO:
printcolor(C_FIFO);
return(1);
case S_IFBLK:
printcolor(C_BLK);
return(1);
case S_IFCHR:
printcolor(C_CHR);
return(1);
}
if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
if (mode & S_ISUID)
printcolor(C_SUID);
else if (mode & S_ISGID)
printcolor(C_SGID);
else
printcolor(C_EXEC);
return(1);
}
return(0);
}
void
parsecolors(cs)
char *cs;
{
int i, j, len;
char c[2];
if (cs == NULL) cs = ""; /* LSCOLORS not set */
len = strlen(cs);
for (i = 0 ; i < C_NUMCOLORS ; i++) {
if (len <= 2*i) {
c[0] = defcolors[2*i];
c[1] = defcolors[2*i+1];
}
else {
c[0] = cs[2*i];
c[1] = cs[2*i+1];
}
for (j = 0 ; j < 2 ; j++) {
if ((c[j] < '0' || c[j] > '7') &&
tolower((unsigned char)c[j]) != 'x') {
fprintf(stderr,
"error: invalid character '%c' in LSCOLORS env var\n",
c[j]);
c[j] = defcolors[2*i+j];
}
if (tolower((unsigned char)c[j]) == 'x')
colors[i][j] = -1;
else
colors[i][j] = c[j]-'0';
}
}
}
void
colorquit(sig)
int sig;
{
endcolor(sig);
(void) signal(sig, SIG_DFL);
(void) kill(getpid(), sig);
}
#endif /*COLORLS*/
static void
printlink(p)
FTSENT *p;
@@ -311,9 +507,6 @@ printlink(p)
return;
}
path[lnklen] = '\0';
if (f_octal || f_octal_escape) {
(void)printf(" -> ");
(void)prn_octal(path);
}
else (void)printf(" -> %s", path);
(void)printf(" -> ");
printname(path);
}
+19 -12
View File
@@ -56,17 +56,19 @@ static const char rcsid[] =
#include "ls.h"
#include "extern.h"
void
prcopy(src, dest, len)
char *src, *dest;
int len;
int
prn_printable(s)
const char *s;
{
unsigned char ch;
unsigned char c;
int n;
while (len--) {
ch = *src++;
*dest++ = isprint(ch) ? ch : '?';
}
for (n = 0; (c = *s) != '\0'; ++s, ++n)
if (isprint(c))
putchar(c);
else
putchar('?');
return n;
}
/*
@@ -84,7 +86,7 @@ prcopy(src, dest, len)
int
len_octal(s, len)
char *s;
const char *s;
int len;
{
int r = 0;
@@ -96,7 +98,7 @@ len_octal(s, len)
int
prn_octal(s)
char *s;
const char *s;
{
unsigned char ch;
int len = 0;
@@ -158,7 +160,12 @@ prn_octal(s)
void
usage()
{
(void)fprintf(stderr, "usage: ls [-ACFHLPRTWacdfgiklnoqrstu1]"
(void)fprintf(stderr,
#ifdef COLORLS
"usage: ls [-ACFGHLPRTWacdfgiklnoqrstu1]"
#else
"usage: ls [-ACFHLPRTWacdfgiklnoqrstu1]"
#endif
" [file ...]\n");
exit(1);
}
+1 -1
View File
@@ -221,7 +221,7 @@ do_move(from, to)
* it's a regular file, do the copy internally; otherwise, use
* cp and rm.
*/
if (stat(from, &sb)) {
if (lstat(from, &sb)) {
warn("%s", from);
return (1);
}
+2 -2
View File
@@ -64,8 +64,8 @@ static const char rcsid[] =
#define MODELEN 20
#define DATELEN 64
#define SIXMONTHS ((365 / 2) * 86400)
#define CURFRMT "%b %e %H:%M"
#define OLDFRMT "%b %e %Y"
#define CURFRMT "%Ef %H:%M"
#define OLDFRMT "%Ef %Y"
#ifndef UT_NAMESIZE
#define UT_NAMESIZE 8
#endif
+1 -1
View File
@@ -355,7 +355,7 @@ main(argc, argv)
*/
printheader();
if (nentries == 0)
exit(0);
exit(1);
/*
* sort proc list
*/
+1 -2
View File
@@ -2,10 +2,9 @@
# $FreeBSD$
PROG= rm
SRCS= rm.c setflags.c
SRCS= rm.c
LINKS= ${BINDIR}/rm ${BINDIR}/unlink
MLINKS= rm.1 unlink.1
.PATH: ${.CURDIR}/../../lib/libc/gen
.include <bsd.prog.mk>
+6 -9
View File
@@ -46,7 +46,6 @@ static const char rcsid[] =
#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -61,8 +60,6 @@ static const char rcsid[] =
#include <sysexits.h>
#include <unistd.h>
char *getflags __P((u_long, char *));
int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
uid_t uid;
@@ -424,7 +421,7 @@ check(path, name, sp)
struct stat *sp;
{
int ch, first;
char modep[15], flagsp[128];
char modep[15], *flagsp;
/* Check -i first. */
if (iflag)
@@ -442,15 +439,15 @@ check(path, name, sp)
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid)))
return (1);
strmode(sp->st_mode, modep);
strcpy(flagsp, getflags(sp->st_flags, NULL));
if (*flagsp)
strcat(flagsp, " ");
(void)fprintf(stderr, "override %s%s%s/%s %sfor %s? ",
if ((flagsp = fflagstostr(sp->st_flags)) == NULL)
err(1, NULL);
(void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ",
modep + 1, modep[9] == ' ' ? "" : " ",
user_from_uid(sp->st_uid, 0),
group_from_gid(sp->st_gid, 0),
*flagsp ? flagsp : "",
*flagsp ? flagsp : "", *flagsp ? " " : "",
path);
free(flagsp);
}
(void)fflush(stderr);
+4
View File
@@ -96,6 +96,10 @@ rm_path(path)
{
char *p;
p = path + strlen(path);
while (--p > path && *p == '/')
;
*++p = '\0';
while ((p = strrchr(path, '/')) != NULL) {
/* Delete trailing slashes. */
while (--p > path && *p == '/')
+1
View File
@@ -109,6 +109,7 @@ setalias(name, val)
ap->val[len+1] = '\0';
}
#endif
ap->flag = 0;
ap->next = *app;
*app = ap;
INTON;
-1
View File
@@ -45,7 +45,6 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
#include <unistd.h>
#include "y.tab.h"
#include "error.h"
+2
View File
@@ -79,8 +79,10 @@ main(argc, argv)
while ((c = *p++) != '\0') {
if (c == '\\' && eflag) {
switch (*p++) {
case 'a': c = '\a'; break;
case 'b': c = '\b'; break;
case 'c': return 0; /* exit */
case 'e': c = '\e'; break;
case 'f': c = '\f'; break;
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
-1
View File
@@ -82,7 +82,6 @@ extern volatile sig_atomic_t exception;
extern volatile sig_atomic_t suppressint;
extern volatile sig_atomic_t intpending;
extern char *commandname; /* name of command--printed on error */
#define INTOFF suppressint++
#define INTON { if (--suppressint == 0 && intpending) onint(); }
+1
View File
@@ -850,6 +850,7 @@ evalcommand(cmd, flags, backcmd)
exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv);
flushall();
cmddone:
cmdenviron = NULL;
out1 = &output;
out2 = &errout;
freestdout();
+1 -1
View File
@@ -667,7 +667,7 @@ again: /* jump here after setting a variable with ${var=text} */
set = varisset(var, varflags & VSNUL);
val = NULL;
} else {
val = lookupvar(var);
val = bltinlookup(var, 1);
if (val == NULL || ((varflags & VSNUL) && val[0] == '\0')) {
val = NULL;
set = 0;
+1 -3
View File
@@ -168,8 +168,6 @@ histcmd(argc, argv)
int argc;
char **argv;
{
extern char *optarg;
extern int optind, optopt, optreset;
int ch;
char *editor = NULL;
const HistEvent *he;
@@ -210,7 +208,7 @@ histcmd(argc, argv)
(ch = getopt(argc, argv, ":e:lnrs")) != -1)
switch ((char)ch) {
case 'e':
editor = optarg;
editor = shoptarg;
break;
case 'l':
lflg = 1;
-1
View File
@@ -971,7 +971,6 @@ stoppedjobs()
STATIC char *cmdnextc;
STATIC int cmdnleft;
STATIC void cmdtxt(), cmdputs();
#define MAXCMDTEXT 200
char *
+1 -2
View File
@@ -54,7 +54,7 @@ static const char rcsid[] =
#include <unistd.h>
#include <fcntl.h>
#include <locale.h>
#include <errno.h>
#include "shell.h"
#include "main.h"
@@ -81,7 +81,6 @@ static const char rcsid[] =
int rootpid;
int rootshell;
extern int errno;
#if PROFILE
short profile_buf[16384];
extern int etext();
+3 -6
View File
@@ -67,9 +67,6 @@ static const char rcsid[] =
#undef eflag
extern char **argptr; /* argument list for builtin command */
/*
* The read builtin. The -r option causes backslashes to be treated like
* ordinary characters.
@@ -105,7 +102,7 @@ readcmd(argc, argv)
while ((i = nextopt("erp:t:")) != '\0') {
switch(i) {
case 'p':
prompt = optarg;
prompt = shoptarg;
break;
case 'e':
break;
@@ -113,8 +110,8 @@ readcmd(argc, argv)
rflag = 1;
break;
case 't':
tv.tv_sec = strtol(optarg, &tvptr, 0);
if (tvptr == optarg)
tv.tv_sec = strtol(shoptarg, &tvptr, 0);
if (tvptr == shoptarg)
error("timeout value");
switch(*tvptr) {
case 0:
+2 -2
View File
@@ -67,7 +67,7 @@ static const char rcsid[] =
char *arg0; /* value of $0 */
struct shparam shellparam; /* current positional parameters */
char **argptr; /* argument list for builtin commands */
char *optarg; /* set by nextopt (like getopt) */
char *shoptarg; /* set by nextopt (like getopt) */
char *optptr; /* used by nextopt */
char *minusc; /* argument to -c option */
@@ -539,7 +539,7 @@ nextopt(optstring)
if (*++q == ':') {
if (*p == '\0' && (p = *argptr++) == NULL)
error("No arg for -%c option", c);
optarg = p;
shoptarg = p;
p = NULL;
}
optptr = p;
+1 -1
View File
@@ -103,7 +103,7 @@ extern char *minusc; /* argument to -c option */
extern char *arg0; /* $0 */
extern struct shparam shellparam; /* $@ */
extern char **argptr; /* argument list for builtin commands */
extern char *optarg; /* set by nextopt */
extern char *shoptarg; /* set by nextopt */
extern char *optptr; /* used by nextopt */
void procargs __P((int, char **));
+2 -2
View File
@@ -59,6 +59,7 @@ static const char rcsid[] =
#include "mystring.h"
#include "alias.h"
#include "show.h"
#include "eval.h"
#ifndef NO_HISTORY
#include "myhistedit.h"
#endif
@@ -136,6 +137,7 @@ parsecmd(interact)
{
int t;
tokpushback = 0;
doprompt = interact;
if (doprompt)
setprompt(1);
@@ -678,8 +680,6 @@ peektoken() {
return (t);
}
STATIC int xxreadtoken();
STATIC int
readtoken() {
int t;
+62 -6
View File
@@ -1269,11 +1269,9 @@ make it the first or last character listed.
This section lists the commands which
are builtin because they need to perform some operation
that can not be performed by a separate process. In addition to
these, builtin versions of the
these, a builtin version of the
.Xr printf 1
and
.Xr echo 1
commands are provided for efficiency.
command is provided for efficiency.
.Bl -tag -width Ds
.It Ic :
A null command that returns a 0 (true) exit value.
@@ -1349,6 +1347,64 @@ if this is different from the name that the user gave.
These may be different either because the
.Ev CDPATH
mechanism was used or because a symbolic link was crossed.
.It Xo
.Ic echo
.Op Fl en
.Ar string
.Xc
Print
.Ar string
to the standard output with a newline appended.
.Bl -tag -width Ds
.It Fl n
Suppress the output of the trailing newline.
.It Fl e
Process C-style backslash escape sequences.
.Ic echo
understands the following character escapes:
.Bl -tag -width Ds
.It \ea
Alert (ring the terminal bell)
.It \eb
Backspace
.It \ec
Suppress the trailing newline (this has the side-effect of truncating the
line if it is not the last character)
.It \ee
The ESC character (ASCII 0x1b)
.It \ef
Formfeed
.It \en
Newline
.It \er
Carriage return
.It \et
Horizontal tab
.It \ev
Vertical tab
.It \e\e
Literal backslash
.It \e0nnn
(Zero) The character whose octal value is nnn
.El
.Pp
If
.Ar string
is not enclosed in quotes then the backslash itself must be escaped
with a backslash to protect it from the shell. For example
.Bd -literal -offset indent
$ echo -e "a\evb"
a
b
$ echo -e a\e\evb
a
b
$ echo -e "a\e\eb"
a\eb
$ echo -e a\e\e\e\eb
a\eb
.Ed
.El
.It Ic eval Ar string ...
Concatenate all the arguments with spaces.
Then re-parse and execute the command.
@@ -1812,7 +1868,7 @@ The maximal number of simultaneous processes for this user ID.
Set the file creation mask (see
.Xr umask 2 )
to the octal value specified by
.Ar mask
.Ar mask .
If the argument is omitted, the current mask value is printed.
.It Xo
.Ic unalias
@@ -1823,7 +1879,7 @@ If
.Ar name
is specified, the shell removes that alias.
If
.Ar a
.Fl a
is specified, all aliases are removed.
.It Ic unset Ar name ...
The specified variables and functions are unset and unexported.
+1 -1
View File
@@ -77,7 +77,7 @@ extern char nullstr[1]; /* null string */
#ifdef DEBUG
#define TRACE(param) trace param
#define TRACE(param) sh_trace param
#else
#define TRACE(param)
#endif
+6 -2
View File
@@ -48,6 +48,10 @@ static const char rcsid[] =
#else
#include <varargs.h>
#endif
#if DEBUG == 2
#include <errno.h>
#endif
#include <errno.h>
#include "shell.h"
#include "parser.h"
@@ -301,9 +305,9 @@ trputc(c)
void
#ifdef __STDC__
trace(const char *fmt, ...)
sh_trace(const char *fmt, ...)
#else
trace(va_alist)
sh_trace(va_alist)
va_dcl
#endif
{
+1 -1
View File
@@ -36,7 +36,7 @@
void showtree __P((union node *));
#ifdef DEBUG
void trace __P((const char *, ...));
void sh_trace __P((const char *, ...));
void trargs __P((char **));
void trputc __P((int));
void trputs __P((char *));
+1 -1
View File
@@ -102,7 +102,7 @@ args: argc -= optind;
if (ioctl(i.fd, TIOCGETD, &i.ldisc) < 0)
err(1, "TIOCGETD");
if (ioctl(i.fd, TIOCGWINSZ, &i.win) < 0)
warn("TIOCGWINSZ: %s\n", strerror(errno));
warn("TIOCGWINSZ");
checkredirect(); /* conversion aid */
+1 -1
View File
@@ -64,7 +64,7 @@ function call.
.Sh SEE ALSO
.Xr fsync 2 ,
.Xr sync 2 ,
.Xr update 4 ,
.Xr syncer 4 ,
.Xr halt 8 ,
.Xr reboot 8
.Sh HISTORY
-1
View File
@@ -108,7 +108,6 @@ t 0 '-r /'
t 1 '-w /'
t 0 '-x /bin/sh'
t 0 '-c /dev/null'
t 0 '-b /dev/fd0a -o -b /dev/rfd0a -o true'
t 0 '-f /etc/passwd'
t 0 '-s /etc/passwd'
+50 -6
View File
@@ -153,6 +153,8 @@ static int binop __P((void));
static int filstat __P((char *, enum token));
static int isoperand __P((void));
static int getn __P((const char *));
static quad_t getq __P((const char *));
static int intcmp __P((const char *, const char *));
static int newerf __P((const char *, const char *));
static int olderf __P((const char *, const char *));
static int equalf __P((const char *, const char *));
@@ -298,17 +300,17 @@ binop()
case STRGT:
return strcmp(opnd1, opnd2) > 0;
case INTEQ:
return getn(opnd1) == getn(opnd2);
return intcmp(opnd1, opnd2) == 0;
case INTNE:
return getn(opnd1) != getn(opnd2);
return intcmp(opnd1, opnd2) != 0;
case INTGE:
return getn(opnd1) >= getn(opnd2);
return intcmp(opnd1, opnd2) >= 0;
case INTGT:
return getn(opnd1) > getn(opnd2);
return intcmp(opnd1, opnd2) > 0;
case INTLE:
return getn(opnd1) <= getn(opnd2);
return intcmp(opnd1, opnd2) <= 0;
case INTLT:
return getn(opnd1) < getn(opnd2);
return intcmp(opnd1, opnd2) < 0;
case FILNT:
return newerf (opnd1, opnd2);
case FILOT:
@@ -443,6 +445,48 @@ getn(s)
return (int) r;
}
/* atoi with error detection and 64 bit range */
static quad_t
getq(s)
const char *s;
{
char *p;
quad_t r;
errno = 0;
r = strtoq(s, &p, 10);
if (errno != 0)
errx(2, "%s: out of range", s);
while (isspace((unsigned char)*p))
p++;
if (*p)
errx(2, "%s: bad number", s);
return r;
}
static int
intcmp (s1, s2)
const char *s1, *s2;
{
quad_t q1, q2;
q1 = getq(s1);
q2 = getq(s2);
if (q1 > q2)
return 1;
if (q1 < q2)
return -1;
return 0;
}
static int
newerf (f1, f2)
const char *f1, *f2;
+4 -3
View File
@@ -48,6 +48,8 @@
.Nm amd
.Nd automatically mount file systems
.Sh SYNOPSIS
.Nm amd
.Fl H
.Nm amd
.Op Fl F Ar conf_file
.Nm amd
@@ -321,7 +323,6 @@ the features.
.Xr amd.conf 5 ,
.Xr mtab 5 ,
.Xr amq 8 ,
.Xr automount 8 ,
.Xr mount 8 ,
.Xr umount 8
.Rs
@@ -335,8 +336,8 @@ Department of Computing, Imperial College, London, UK.
Department of Computer Science, Columbia University,
New York, USA.
.Pp
.An Other authors and contributors to am-utils are listed in the
.Nm AUTHORS
Other authors and contributors to am-utils are listed in the
.Pa AUTHORS
file distributed with am-utils.
.Sh HISTORY
The
-1
View File
@@ -294,7 +294,6 @@ user's home directory is accessible.
.Xr mtab 5 ,
.Xr passwd 5 ,
.Xr amd 8 ,
.Xr automount 8 ,
.Xr cron 8 ,
.Xr mount 8 ,
.Xr sendmail 8 ,
+2 -2
View File
@@ -678,8 +678,8 @@ Department of Computer Science, Columbia University, New York, USA.
.An Jan-Simon Pendry Aq [email protected] ,
Department of Computing, Imperial College, London, UK.
.Pp
.An Other Authors and contributers to am-utils are listed in the
.Nm AUTHORS
Other authors and contributers to am-utils are listed in the
.Pa AUTHORS
file distributed with am-utils.
.Sh HISTORY
The
+280
View File
@@ -1,3 +1,283 @@
--- 8.2.3-T5B (RC3) released ---
1006. [port] Windows/NT does not have fchown().
1005. [bug] RD was sometimes left set, inappropriately.
1004. [bug] cached NXT's were corrupted.
1003. [bug] correction to #997.
1002. [bug] file descriptor leak in res_nclose().
1001. [port] some builds were too fast.
--- 8.2.3-T4B (RC2) released ---
1000. [bug] #996 was wrongly implemented; replacement fix.
--- 8.2.3-T3B released ---
999. [support] named now makes an effort to create its files with
ownership as specified by -u and -g command options.
998. [support] show version number in NOTIFY log messages.
997. [support] forwarders are now used in order by measured RTT.
996. [protocol] if answering ixfr with full zone, used qtype axfr.
995. [bug] "dig -b" was broken due to missing switch "break;"
994. [bug] named-xfer did not handle empty question sections.
993. [bug] TSIG AXFR was completely broken in DiG.
992. [bug] OPTION_USE_IXFR and OPTION_MAINTAIN_IXFR_BASE had
non-single-bit flag values in src/bin/named/ns_defs.h.
991. [protocol] send A6 glue records in xfr.
990. [bug] we could loose track of a bottom of zone cut is the
write buffer filled up at just the correct moment.
989. [bug] apply to "fetch-glue no;" to notify processing. need
to add A records that would be found this way w/
also-notify.
988. [support] report expired zones when detected in maintainence
pass.
987. [feature] "ndc reconfig -noexpired" skip attempts to load
expired zoned when reconfiguring.
986. [bug] pushlev only needs to be called for axfr/zxfr not ixfr.
--- 8.2.3-T2B released ---
985. [support] remove "view" command from nslookup (it used mktemp()).
984. [bug] always restart processing query from scratch if we
have chased a CNAME as we might still have the answer
in the cache once the CNAME has been resolved.
983. [support] "notify from non-master server" is now debug, not info.
982. [bug] rollback the compression pointers array when a
RRset/RR does not fit.
981. [port] decunix: typedef (u_)int#m_t
980. [bug] mishandled memget failure w/ TCP connections.
979. [bug] we were failing to call ns_stopxfrs() before calling
purge_zone() in some cases.
978. [port] sco50: setsockopt(SO_REUSEADDR) fails on unix domain
sockets
977. [bug] we should be returning notimpl for update forwarding
rather than refused. a client receiving refused
should terminate the update attempt. notimpl should
just cause the client to skip to the next server.
976. [bug] some stats weren't getting incremented, & added a few.
975. [support] SLAVE_FORWARD is now redundant and has been removed.
974. [port] ultrix with vendor's y2k patch explicitly desupported.
973. [bug] some field names added in #935 conflicted with macros.
972. [support] restore heartbeat notifies.
971. [bug] out of order updates in log.
970. [port] solaris: add ipv6 interface scanning support.
969. [bug] post process a zone load to remove any non-glue at
or below bottom of zone.
968. [bug] TSIGs failed to verify if the key name was compressed.
967. [bug] zones signed by the BIND 9 signer failed to load.
--- 8.2.3-T1A released ---
966. [bug] nslookup and dig misprinted root zone in $ORIGIN.
965. [feature] dig's command line input buffer was rather small.
964. [bug] make res_nsearch() behave like res_search() of olde.
963. [bug] res_debug::do_section() can no longer spin all VM.
962. [bug] another almost-complete rewrite of IXFR from kjd (462)
961. [bug] acl "none" now fails to match but doesn't end search.
960. [bug] more hesiod library fixes from danny.
959. [doc] christos fixed several man page typos and brainos.
958. [bug] getnameinfo() should accept experimental/multicast.
957. [port] ultrix again. "cd" now presumed to be silent again.
956. [bug] multiline was not being cleared correctly.
955. [bug] explicit TTL on SOA records were being replaced with
soa minimum.
954. [bug] cannot load a signed root zone.
953. [bug] memory overrun in set_zone_ixfr_file().
952. [bug] errs was not being correctly adjusted if the included
master file did not exist in db_load().
951. [bug] contrib/dns_signer/signer: write_trim_name
array bounds write error.
950. [bug] hesiod: ctx->res was not being initalised.
949. [port] aix32: add prand_conf.h and define WCOREDUMP
948. [bug] fixed logic error in a number of expressions causing
res_ninit() not to be called when it should be.
947. [bug] sanity check in dst_read_key() wasn't.
946. [port] freebsd: threaded library support.
945. [bug] wrong file name logged in ixfr_have_log().
944. [doc] add forwarders to zone types master/slave/stub in
named.conf man page.
943. [bug] raise CNAME and OTHER / multiple CNAME logging to
warning.
942. [bug] bad referrals logged for forwarders.
941. [bug] lame server detection wasn't checking for SOA record.
940. [clarity] unapproved -> denied in log messages.
939. [bug] reload_master and purgeandload should write the zone
if it has been updated.
938. [bug] update and ixfr logs could get corrupted. fseek()
before ftell() on fopen(, "a+") file.
937. [support] allow parallel makes to work.
936. [protocol] add preliminary A6 glue recognition in ns_req.
935. [cleanup] res_nsend() segmented into multiple functions for
readability. also fixed two file descriptor leaks.
CAN_RECONNECT is gone, keep one socket per nameserver.
934. [bug] Perror and Aerror where incorrect if DEBUG is not
defined.
933. [port] cygwin port added
932. [port] sco42 does not have unix domain sockets or gethostid.
931. [bug] eventlib was not handling unix domain sockets
correctly.
930. [bug] we wern't using all the potential compression pointers
in the question section.
929. [bug] we were accepting updates (adds) with illegal ttls.
928. [bug] if we manage to get a illegal ttl stored, print it
unsigened.
927. [port] hpux: (11.* 10.30) Makefile.set.gcc
926. [port] hpux10: gcc needs -D_HPUX_SOURCE and -fPIC
925. [protocol] when a slave loads it should notify others (RFC 1996).
924. [port] sunos solaris: #define NEED_SECURE_DIRECTORY to
secure the directory containing unix domain socket
rather than the socket itself.
923. [support] shutup "make clean" about missing threaded directories.
922. [bug] removing an cached zone file then performing a
"ndc reload zone" should force a zone transfer.
921. [bug] nsupdate: listuprec was not being initalised.
920. [port] aix4: Makefile.set.gcc
aix4: __P was being defined by <net/radix.h>
919 [port] linux: remove one level of symbolic linkage when
performing make links on port/linux/include
918. [bug] update prerequisite could match w/ wildcard.
917. [port] irix: make the current IRIX release (6.5) work by
not patching res_debug.c. see INSTALL if you have
problems with 6.3.
916. [bug] removing / changing a zone type could result in
Z_NOTIFY being cleared / tested against the wrong zone.
915. [bug] evNewWaitList() was not maintaining the prev chain.
914. [bug] signal EWOULDBLOCK if EV_POLL'ing with no timers.
913. [bug] input could get lost on the server side of a ctl sock.
912. [bug] nsupdate now allows explicit 0 TTL's on added RR's.
911. [bug] gethostbyname() should not return duplicate addresses.
910. [bug] address-sorting logic was exiting early.
909. [bug] dig wasn't respecting the +ti and +ret arguments.
908. [contrib] Tony Stoneley sent us an updated misc/makezones.
907. [port] winnt fixes from Larry at Nortel.
906. [bug] res_findzonecut() failed if the NS referred to a CNAME.
905. [doc] Minor fix to doc/man/Makefile for getnameinfo
904. [bug] bin/host wasn't looking up MX records if no
-t flags were passed to it.
--- 8.2.2-P6 released ---
903. [bug] divide by zero bug when querying for SIG records from
a secure zone.
902. [support] don't attempt to set q_fzone if we won't be using it.
901. [support] delay notify timer setting until all zones have been
loaded.
900. [port] hpux10 fix call to bison; sco call bison consistenly.
899. [bug] dynamically allocate buffer used to display RR rather
than uses a fixed sized one. grow as needed.
898. [bug] if truncation caused no RR's to appear in the answer we
mis-classified the answer on a NODATA.
897. [support] descriptors used by named should not be inherited by
named-xfer.
896. [contrib] add contrib/adm/adm-nxt, an exploit for the NXT bug
in 8.2 and 8.2.1. as before, we do not recommend its
use, and we do recommend that you run the latest BIND.
--- 8.2.2-P5 released ---
895. [port] minor NT build and documentation improvements.
+10 -2
View File
@@ -1,23 +1,25 @@
Systems it is known to compile and run on:
BSD/OS 3.1, 4.0.1
FreeBSD 3.1, 3.2, 3.3
FreeBSD 3.3, 3.4
RH Linux 5.2 (don't use "make links" when building, though)
Debian GNU/Linux 2.2.9 ("unreleased")
Digital UNIX 3.2C, 4.0, 5.0
NetBSD/i386 1.3.2, 1.4
SunOS 5.6 (Solaris 2.6), SunOS 5.7 (Solaris 7)
SCO UnixWare 7.0, 7.0.1, 7.1
IRIX 6.5
Systems it has been known in the past to compile and run on:
AIX 4.x
A/UX 3.1.1
Digital ULTRIX 4.5
Digital ULTRIX 4.5 (without Compaq's Y2K kit installed)
HP MPE
HP-UX 9.x, 10.20
IRIX 5.3, 6.2, 6.4
LynxOS
FreeBSD 3.1, 3.2
NetBSD 1.2, 1.3
OpenBSD 2.1
QNX
@@ -139,6 +141,12 @@ Operating System Notes
The kit should compile even if you have intalled the KAME
IPv6 kit.
IRIX
build problems have been reported w/ IRIX 6.3, res_debug.c
and #include <stdlib.h>. You may need to comment out
the #include <stdlib.h> and declare
"void *malloc(size_t size)" to get named to compile on 6.3.
Linux
"make links" and "make stdlinks" cause problems on
+5 -5
View File
@@ -1,5 +1,5 @@
This is the source portion of BIND version 8.2.2, Patchlevel 5. Its
companions are "doc" and "contrib" so you are probably not missing anything.
This is the source portion of BIND version 8.2.3-T2B. Its companions
are "doc" and "contrib" so you are probably not missing anything.
See the CHANGES file for a detailed listing of all changes. See the INSTALL
file for information on building and installing BIND.
@@ -208,6 +208,6 @@ To Support the Effort
The Internet Software Consortium has also commissioned a DHCP server
implementation, has taken over official support/release of the INN
system, and supports the Kerberos Version 5 effort at MIT. You can
learn more about the ISC's goals and accomplishments from the web page
at <URL:http://www.isc.org/>.
system, and has supported the Kerberos Version 5 effort at MIT. You
can learn more about the ISC's goals and accomplishments from the web
page at <URL:http://www.isc.org/>.
Loaded 100 of 6380 files, more files were not shown because too many files have changed in this diff. Show more