Subject: bin/6863: more/less cannot handle files larger than 2GB
To: None <>
From: Tero Kivinen <>
List: netbsd-bugs
Date: 01/22/1999 15:42:22
>Number:         6863
>Category:       bin
>Synopsis:       Less cannot handle files larger than 2GB
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 22 05:50:01 1999
>Originator:     Tero Kivinen
SSH Communications Security
>Release:        NetBSD 1.3.2
System: NetBSD 1.3.2 NetBSD 1.3.2 (TAULU) #4: Mon Nov 16 22:07:42 EET 1998 i386


	If you try to less file that is more than 2GB in size the
	less will print error message

	Cannot seek to that file position  (press RETURN)

	and exit. 


	Create 2GB file and try to less it:

	dd if=/dev/zero bs=1024k count=1 seek=2048 of=/tmp/foo
	less /tmp/foo

	I assume that changing line 143 in the less.h from

	typedef long		POSITION;


	typedef off_t		POSITION;

	will fix the actual problem, but it will propably create
	new ones with the printf format characters (at least the
	comment below says so).

	Perhaps less needs also

	#define POSITION_FMT_CHAR	"%ld"

	that needs to be changed to match the format string of the
	off_t, and then all printfs must be changed to use that.