off_t fclear (FileDescriptor, NumberOfBytes) int FileDescriptor; off_t NumberOfBytes;
Note: The fclear64 subroutine applies to Version 4.2 and later releases.
off64_t fclear64 (FileDescriptor, NumberOfBytes) int FileDescriptor; off64_t NumberOfBytes;
Note: The fclear64 subroutine applies to Version 4.2 and later releases.
The fclear and fclear64 subroutines zero the number of bytes specified by the NumberOfBytes parameter starting at the current file pointer for the file specified in the FileDescriptor parameter. If Network File System (NFS) is installed on your system, this file can reside on another node.
The fclear subroutine can only clear up to OFF_MAX bytes of the file while fclear64 can clear up to the maximum file size.
The fclear and fclear64 subroutines cannot be applied to a file that a process has opened with the O_DEFER mode.
Successful completion of the fclear and fclear64 subroutines clear the SetUserID bit (S_ISUID) of the file if any of the following are true:
This subroutine also clears the SetGroupID bit (S_ISGID) if:
OR
Note: Clearing of the SetUserID and SetGroupID bits can occur even if the subroutine fails because the data in the file was modified before the error was detected.
In the large file enabled programming environment, fclear is redefined to be fclear64.
Upon successful completion, a value of NumberOfBytes is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The fclear and fclear64 subroutines fail if one or more of the following are true:
EFBIG | The current offset plus NumberOfBytes is exceeds the offset maximum established in the open file description associated with FileDescriptor. |
If NFS is installed on the system the fclear and fclear64 subroutines can also fail if the following is true:
ETIMEDOUT | The connection timed out. |
This subroutine is part of Base Operating System (BOS) Runtime.
The open, openx, or creat subroutine, truncate or ftruncate subroutines.
Files, Directories, and File Systems for Programmers in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.