Method of Handling "Ftrunc" System Call for Mapped Files
Original Publication Date: 1986-Nov-01
Included in the Prior Art Database: 2005-Mar-09
By providing special handling of the "ftrunc" system call in a mapped file environment, efficient handling and relatively transparent implementation of the call are provided. Special handling is required for the UNIX* "ftrunc" system call when a file is currently mapped (Virtual Memory Manager (VMM) mapping of a virtual memory segment to disk blocks of a file which allows Virtual Resource Manager (VRM) to perform required disk I/O). The ftrunc system call is supposed to remove all data beyond a specified length. One restriction which is required when the ftrunc system call is used with a mapped file, is that no Copy-on-Write segments exist for the file, since truncation may cause the undesired release of modified Copy-on-Write pages. If Copy-on-Write segments exist, an error message is returned if ftrunc is invoked.