#1493 closed defect (duplicate)

IMFS lseek extends file on seek past end

Reported by: Chris Johns Owned by: Joel Sherrill
Priority: normal Milestone: 4.10
Component: fs Version: 4.10
Severity: normal Keywords:
Cc: nbkolchin@… Blocked By:


The IMFS extends a file on a seek past the end of a file. The SUS states in the lseek page:

"The lseek() function shall not, by itself, extend the size of a file."

The file shall only be extended when a write occurs with the file at this position. An lseek past the end of a file should return EOF.

There is also another bug. If a file is opened as read only then lseek is called past the end of the file the file will be extended.

Change History (3)

comment:1 Changed on Feb 11, 2010 at 5:17:24 AM by Chris Johns

Summary: IMFS lseek extends file of seek past endIMFS lseek extends file on seek past end

comment:2 Changed on Apr 20, 2010 at 1:33:58 PM by Nickolay Semyonov-Kolchin

Cc: Nickolay Semyonov-Kolchin added

comment:3 Changed on Apr 20, 2010 at 10:57:33 PM by Chris Johns

Resolution: duplicate
Status: newclosed

The existing bug has code.

Note: See TracTickets for help on using tickets.