aboutsummaryrefslogtreecommitdiff
path: root/bin/cat
Commit message (Collapse)AuthorAgeFilesLines
* cat(1) compiles fine at WARNS level 6.Dag-Erling Smørgrav2009-03-161-0/+1
| | | | Notes: svn path=/head/; revision=189875
* Teach cat(1) and cp(1) to use a larger buffer if enough memory is presentIvan Voras2008-10-301-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | in the system. A simple heuristics is used to detect what is "enough" memory: if number of physmem pages is greater than 32k (equalling 128 MB on machines with 4 kB pages). Typical immediate result of these changes is reduction in context switches and the goal is to increase efficiency by using large buffers: before: /usr/bin/time -hlp cat file1 > file2 ... 163 voluntary context switches 11194 involuntary context switches after: /usr/bin/time -hlp ./cat file1 > file2 ... 417 voluntary context switches 272 involuntary context switches Reviewed by: hackers@ (no objections to earlier version of cat patch) Approved by: gnn (mentor) MFC after: 4 months Notes: svn path=/head/; revision=184471
* One more nit.Ruslan Ermilov2006-12-231-1/+1
| | | | Notes: svn path=/head/; revision=165486
* Fix markup.Ruslan Ermilov2006-12-231-10/+12
| | | | Notes: svn path=/head/; revision=165485
* Add the new standard EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-161-1/+1
| | | | | | | Sort standard sections in the (documented) preferred order. Notes: svn path=/head/; revision=140353
* Eliminate macro calls inside literal displays.Ruslan Ermilov2005-01-151-9/+6
| | | | Notes: svn path=/head/; revision=140295
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-102-1/+2
| | | | Notes: svn path=/head/; revision=139969
* Use warn() instead of perror().Tim J. Robbins2004-07-201-2/+2
| | | | Notes: svn path=/head/; revision=132433
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-062-8/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Reduce redundancy in the description of the -u option.Tim J. Robbins2004-03-211-3/+1
| | | | Notes: svn path=/head/; revision=127268
* Document incorrect handling of multibyte characters when -t and -v optionsTim J. Robbins2004-03-211-1/+9
| | | | | | | are used. Notes: svn path=/head/; revision=127267
* We have to hide copyright[] for gcc33. :-(David E. O'Brien2003-04-301-0/+2
| | | | Notes: svn path=/head/; revision=114301
* Be consistent about declaring a function "static", and consistentMark Murray2002-10-231-3/+3
| | | | | | | about the type of argv. Notes: svn path=/head/; revision=105781
* Give lint a small bit of help.Mark Murray2002-07-311-0/+2
| | | | Notes: svn path=/head/; revision=101092
* Consistently use __FBSDIDDavid E. O'Brien2002-06-301-2/+2
| | | | Notes: svn path=/head/; revision=99109
* Avoid truncating the pathname to UNIX Domain Sockets with snprintf(),Tim J. Robbins2002-06-291-2/+5
| | | | | | | | giving a more sensible warning when the (relatively meagre) sun_path limit is exceeded. Notes: svn path=/head/; revision=99022
* Use an usage() rather than doing the fprintf inside option parsing.Juli Mallett2002-06-141-3/+9
| | | | Notes: svn path=/head/; revision=98216
* Print the "$" symbol on blank lines when the -s and -e options are usedTim J. Robbins2002-06-131-17/+11
| | | | | | | | | together. Obtained from: OpenBSD (millert, Denis Afonin) Notes: svn path=/head/; revision=98169
* Remove bogus "-" operand from usage message. There is no restriction onTim J. Robbins2002-06-131-1/+1
| | | | | | | where it may be placed, it is treated the same as the file arguments. Notes: svn path=/head/; revision=98168
* Fix warnings inspired by lint, a commercial lint and WARNS=4.Mark Murray2002-02-221-9/+11
| | | | Notes: svn path=/head/; revision=91079
* Drag cat(1) kicking and screaming into the late 1980's:Warner Losh2002-02-021-21/+11
| | | | | | | | | | | | | | | o __P has been reoved o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Approved by: arch@, new style(9) Notes: svn path=/head/; revision=90106
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyDavid E. O'Brien2001-12-041-1/+0
| | | | | | | | | set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87323
* WARNSify.Ruslan Ermilov2001-09-262-4/+4
| | | | Notes: svn path=/head/; revision=83962
* The "cat - -" feature was broken by the last commit.Ruslan Ermilov2001-09-261-5/+15
| | | | | | | | | | Restore the code that avoided closing and reopening stdin. This is also required by POSIX. As a bonus, enable multiple stdin reads with the -benstv flags, by resetting the EOF condition on stdin. Notes: svn path=/head/; revision=83961
* mdoc(7) police: fixed markup.Ruslan Ermilov2001-09-251-5/+12
| | | | Notes: svn path=/head/; revision=83933
* Give /bin/cat the ability to connect to and read unix-domain socketsMatthew Dillon2001-09-152-56/+108
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=83482
* mdoc(7) police: utilize the new .Ex macro.Ruslan Ermilov2001-08-151-3/+1
| | | | Notes: svn path=/head/; revision=81687
* Include missing header files which define functions for which gcc hasDima Dorfman2001-06-241-0/+1
| | | | | | | builtins (e.g., exit, strcmp). Notes: svn path=/head/; revision=78732
* Xref zcat(1).Dima Dorfman2001-06-181-0/+1
| | | | Notes: svn path=/head/; revision=78430
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-151-1/+1
| | | | Notes: svn path=/head/; revision=70056
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-1/+1
| | | | Notes: svn path=/head/; revision=68935
* Use Dq Li (double-quoted literal) instead of Ic (internal command) toSheldon Hearn2000-06-271-4/+2
| | | | | | | | | | | mark up a sample invocation, since it is not a command internal to the described utility. Do not use Ar (argument) to mark up something which is not an argument to the utility or one of its internal commands. Notes: svn path=/head/; revision=62167
* Sync us up to OpenBSD's cat.1 v1.18 and cat.c v1.9.Jeroen Ruigrok van der Werven2000-04-142-14/+84
| | | | | | | | | | | This gets rid of a bogus cast of NULL in setbuf(). Lets us know the buffer malloc failed. Reworks the manpage a bit to make it more mdoc(7) compliant, adds examples. Notes: svn path=/head/; revision=59239
* Remove unnecessary empty line.Jeroen Ruigrok van der Werven2000-04-131-3/+2
| | | | | | | Remove trailing whitespace. Notes: svn path=/head/; revision=59211
* $Id$ -> $FreeBSD$Peter Wemm1999-08-273-3/+3
| | | | Notes: svn path=/head/; revision=50471
* Various spelling/formatting changes.Kris Kennaway1999-05-081-2/+2
| | | | | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org> Notes: svn path=/head/; revision=46684
* Fix minor style bugs noticed by the Bruce Filter.[tm]Warner Losh1998-09-131-4/+7
| | | | | | | Bruce-Filter-By: bde Notes: svn path=/head/; revision=39138
* Silence -Wall -W -Wkitchen-sink. Use ssize_t in preference to int,Warner Losh1998-09-111-9/+7
| | | | | | | | make a char * const that should have been. Use new style function declaration for main. Mostly a Bruce Filter[tm] test commit. Notes: svn path=/head/; revision=39065
* Restore Lite2 sccsids by removing `const'. Improve documentation a little.Philippe Charnier1998-05-132-15/+11
| | | | | | | Suggested by: Bruce Notes: svn path=/head/; revision=36000
* Correct use of .Nm, .An and other cosmetics. Add rcsid. Remove unused #inc.Philippe Charnier1998-05-062-13/+15
| | | | Notes: svn path=/head/; revision=35772
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-281-2/+2
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24348
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-223-3/+3
| | | | Notes: svn path=/head/; revision=22988
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-143-3/+3
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Merge Lite2 mods and -Wall cleaning.Steve Price1996-12-142-11/+10
| | | | Notes: svn path=/head/; revision=20412
* Activate LC_CTYPE locale and additionly use !isprint() for 8bit charactersAndrey A. Chernov1996-09-301-2/+5
| | | | Notes: svn path=/head/; revision=18578
* Merge in the NetBSD changes to cat.c. These appear to have come fromWarner Losh1996-09-281-4/+4
| | | | | | | | | | the 4.4 lite 2 tape as well. There are now only two diffs between NetBSD's cat and FreeBSD's cat: getopt return value is -1 on NetBSD and EOF on FreeBSD. NetBSD has added setlocale calls before anything else. Notes: svn path=/head/; revision=18546
* [HISTORY]Wolfram Schneider1996-08-221-3/+7
| | | | | | | | | | | | cat command appeared in Version 1 AT&T UNIX, not Version 6 Apparently the cat man page was the first written man page Obtained from: A Quarter Century of UNIX, Peter H. Salus [BUGS] fix a typo Notes: svn path=/head/; revision=17772
* Fix exit status. `cat no-such-file >/dev/null' exited with status 0.Bruce Evans1995-10-031-2/+7
| | | | | | | | This has been broken since cat's own err() function was sloppily replaced by the library functions warn() and err(). Notes: svn path=/head/; revision=11145
* Added $Id$David Greenman1994-09-243-0/+4
| | | | Notes: svn path=/head/; revision=3044
* BSD 4.4 Lite bin SourcesRodney W. Grimes1994-05-263-0/+377
Notes: svn path=/head/; revision=1556