aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/head
Commit message (Collapse)AuthorAgeFilesLines
* head: use getline() instead of fgetln()Martin Tournoij2024-04-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | This replaces fgetln() with getline(). The main reason for this is portability, making things easier for people who want to compile these tools on non-FreeBSD systems. I appreciate that's probably not the top concern for FreeBSD base tools, but fgetln() is impossible to port to most platforms, as concurrent access is essentially impossible to implement fully correct without the line buffer on the FILE struct. Other than this, many generic FreeBSD tools compile fairly cleanly on Linux with a few small changes. Most uses of fgetln() pre-date getline() support (added in 2009 with 69099ba2ec8b), and there's been some previous patches (ee3ca711a898 8c98e6b1a7f3 1a2a4fc8ce1b) for other tools. Obtained from: https://github.com/dcantrell/bsdutils and https://github.com/chimera-linux/chimerautils Signed-off-by: Martin Tournoij <martin@arp242.net> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/893
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-273-6/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* Improve usability of head(1) and tail(1):Xin LI2022-07-134-13/+90
| | | | | | | | | | | - Consistently support -q (quiet) and -v (verbose) - Allow specifying numbers with SI prefixes supported by expand_number(3) - Remove 2^31 limit on lines for head(1) MFC after: 2 weeks Reviewed by: lwhsu, pauamma, gbe Relnotes: yes Differential Revision: https://reviews.freebsd.org/D35720
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+2
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+8
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* fileargs_init() sets errno on failure.Mark Johnston2019-11-061-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=354368
* cap_fileargs: chase r346315, update fileargs_init in consumersEd Maste2019-04-171-1/+1
| | | | | | | | | | Reported by: ci.freebsd.org (8 times so far) MFC after: 3 weeks MFC with: r346315 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=346316
* head: sandbox using capsicumMariusz Zaborski2018-11-122-1/+25
| | | | | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D14409 Notes: svn path=/head/; revision=340376
* head: fix style nitsMariusz Zaborski2018-11-121-8/+13
| | | | | | | | | | | No functional change intended. Reviewed by: emaste MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14498 Notes: svn path=/head/; revision=340370
* head(1): Provide long optionsKyle Evans2018-04-102-2/+22
| | | | | | | | | | | | | Provide long options --bytes and --lines to match -c and -n respectively. This improves head(1)'s compatibility with its GNU counterpart in a sensible way. Reviewed by: eadler (previous version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14139 Notes: svn path=/head/; revision=332374
* Add ATF tests for head(1)Alan Somers2017-11-203-0/+144
| | | | | | | | | | Submitted by: Fred Schlecter <https://github.com/fjs-github> Reviewed by: asomers, jilles MFC after: 3 weeks Differential Revision: https://github.com/freebsd/freebsd/pull/127 Notes: svn path=/head/; revision=326039
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * sync from headSimon J. Gerraty2013-04-121-1/+14
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=249429
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Remove EOL whitespace accidentally introduced in r248393.Joel Dahl2013-03-171-1/+1
| | | | | | | | Notes: svn path=/head/; revision=248414
* | Add a couple of examples.Joel Dahl2013-03-161-1/+14
|/ | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=248393
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-1/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Fix build on architectures where off_t is signed by casting to uintmax_tBrooks Davis2007-01-111-1/+1
| | | | | | | before comparing with a size_t. Notes: svn path=/head/; revision=165955
* Fix head -c ### where ### is greater than 2^31. Unlike the submittedBrooks Davis2007-01-112-4/+8
| | | | | | | | | | | | | patch this uses off_t. WARNSify and add $FreeBSD$ to Makefile. PR: bin/107824 Submitted by: Brian Cornell <briancornell at earthlink dot net> MFC after: 3 days Notes: svn path=/head/; revision=165940
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-1/+1
| | | | Notes: svn path=/head/; revision=140368
* Remove duplicate __FBSDID() - spotted by trying to build with a non-GNUJuli Mallett2002-07-231-3/+0
| | | | | | | compiler. Notes: svn path=/head/; revision=100575
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-0/+2
| | | | Notes: svn path=/head/; revision=99112
* Note that this appeared at least as early as PWB UNIX.Juli Mallett2002-06-101-2/+1
| | | | | | | Use the literal string 'PWB UNIX', as we still have no .At macro for it. Notes: svn path=/head/; revision=98107
* Fix VCS tags; ANSIfy functionsMark Murray2002-04-281-14/+8
| | | | Notes: svn path=/head/; revision=95652
* 1) Staticise.David Malone2002-03-301-13/+13
| | | | | | | | 2) Remove registers. 3) Change some ints to size_t which are used with fread/fwrite. Notes: svn path=/head/; revision=93441
* remove __PWarner Losh2002-03-221-4/+4
| | | | Notes: svn path=/head/; revision=92920
* mdoc(7) police: pedantry.Ruslan Ermilov2002-03-151-4/+1
| | | | Notes: svn path=/head/; revision=92341
* Make usage message and man page synopsis reflect the fact that -nDavid Malone2002-01-242-3/+5
| | | | | | | | | | | and -c are mutually exclusive. PR: 34233 Submitted by: Gary W. Swearingen <swear@blarg.net> MFC after: 3 days Notes: svn path=/head/; revision=89767
* In order to perform faster when doing "head -n", use a pair ofAlfred Perlstein2001-11-021-7/+8
| | | | | | | | fgetln/fwrite instead of getc/putchar, this seems about five times faster. Notes: svn path=/head/; revision=85861
* change a global into a local, misc style fixesAlfred Perlstein2001-11-021-7/+5
| | | | Notes: svn path=/head/; revision=85859
* mdoc(7) police: utilize the new .Ex macro.Ruslan Ermilov2001-08-151-4/+2
| | | | Notes: svn path=/head/; revision=81687
* Remove whitespace at EOL.Dima Dorfman2001-07-151-1/+1
| | | | Notes: svn path=/head/; revision=79755
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79535
* mdoc(7) police: use the default ``file ...'' feature of the .Ar macro.Ruslan Ermilov2001-02-131-1/+1
| | | | Notes: svn path=/head/; revision=72432
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-3/+3
| | | | Notes: svn path=/head/; revision=68963