History log of /freebsd-10-stable/usr.bin/locate/locate/locate.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 244063 10-Dec-2012 eadler

Give users a hint when their locate database is too small.

Reviewed by: wblock, gcooper
Reviewed by: "Lowell Gilbert" <lgfbsd@be-well.ilk.org>
Approved by: cperciva (implicit)
MFC after: 3 weeks


# 228992 30-Dec-2011 uqs

Spelling fixes for usr.bin/


# 195839 24-Jul-2009 jhb

Move the check to ensure the locate database has the minimum required size
when using mmap() before invoking mmap(). This avoids a confusing error
message when locate is invoked against a zero-size database after the
recent change to make mmap() fail requests to map 0 bytes.

Submitted by: Jaakko Heinonen jh of saunalahti dot fi
Approved by: re (kensmith)
MFC after: 1 week


# 182673 02-Sep-2008 kevlo

Use RUSAGE_SELF for the current process instead of hardcoded value


# 159519 11-Jun-2006 maxim

o Sync usage() with reality.


# 153197 07-Dec-2005 des

Add a -0 option for interoperability with xargs -0.

PR: bin/56558
Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>
MFC after: 2 weeks


# 92920 21-Mar-2002 imp

remove __P


# 88787 01-Jan-2002 wosch

A global is used even though the value is
passed through the function call.

Submitted by: "Crist J . Clark" <cjc@freebsd.org>


# 65428 04-Sep-2000 imp

getopt and friends are declared in <unistd.h>
getopt returns -1 not EOF.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 27574 21-Jul-1997 charnier

Use err(3). Use .Pa macro for filenames in man page.


# 24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 23012 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21786 16-Jan-1997 alex

Sweep through the tree fixing mmap() usage:

- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.

Discussed with: bde


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 18905 12-Oct-1996 wosch

8-Bit character support.

Old locate(1) programs still works with the new database format, print
some garbage for 8 bit characters, but don't core (maybe except char 30).

7-Bit Puritan should not notice any difference. Same speed,
Same database size if the database contain only ASCII characters.

Reviewed by: ache


# 18311 15-Sep-1996 wosch

#include <fastfind.c> -> #include "fastfind.c"


# 17980 31-Aug-1996 wosch

optimized search algorithm
faster IO due mmap(2) [-m | -s]
better error check for damaged databases
support for databases in network byte order (SunOS/sparc)
optional case insensitve search [-i]
optional multiple databases
optional multiple pattern
new enviroment variable LOCATE_PATH for database(s)
[-S] print some statistic about the database
[-l number] limit output to number file names
[-c] suppress normal output; instead print a count of matching file names


# 17943 30-Aug-1996 peter

fix prototypes/forward declarations/return type
kill obsolete updatedb.csh, it's been rewritten in sh now.


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources