| Main index | Section 2 | Options |
#include <fcntl.h>
For a successful completion without an unprocessed part in the requested operation range, rmsr->r_len is updated to be the value 0, and rmsr->r_offset is updated to be rqsr->r_offset plus the number of bytes zeroed before the end-of-file. The file descriptor's file offset is not used or modified by the system call. Both rqsr and rmsr arguments can point to the same structure.
The spacectl_range structure is defined as:
struct spacectl_range {
off_t r_offset;
off_t r_len;
};
The operation specified by the cmd argument may be one of:
| SPACECTL_DEALLOC | |
|
Zero a region in the file specified by the
rqsr
argument.
The
rqsr->r_offset
has to be a value greater than or equal to 0, and the
rqsr->r_len
has to be a value greater than 0.
If the file system supports hole-punching, file system space deallocation may be performed in the given region. | |
The flags argument needs to be the value 0 currently.
| [EBADF] | |
| The fd argument is not a valid file descriptor. | |
| [EBADF] | |
| The fd argument references a file that was opened without write permission. | |
| [EINTR] | |
| A signal was caught during execution. | |
| [EINVAL] | |
| The cmd argument is not valid. | |
| [EINVAL] | |
| If the cmd argument is SPACECTL_DEALLOC, either the rqsr->r_offset argument was less than zero, or the rqsr->r_len argument was less than or equal to zero. | |
| [EINVAL] | |
| The value of rqsr->r_offset, + rqsr->r_len is greater than OFF_MAX. | |
| [EINVAL] | |
| An invalid or unsupported flag is included in flags. | |
| [EINVAL] | |
| A flag included in flags is not supported by the operation specified by the cmd argument. | |
| [EFAULT] | |
| The rqsr or a non-NULL rmsr argument point outside the process' allocated address space. | |
| [EIO] | An I/O error occurred while reading from or writing to a file system. |
| [EINTEGRITY] | |
| Corrupted data was detected while reading from the file system. | |
| [ENODEV] | |
| The fd argument does not refer to a file that supports fspacectl. | |
| [ENOSPC] | |
| There is insufficient free space remaining on the file system storage media. | |
| [ENOTCAPABLE] | |
| The file descriptor fd has insufficient rights. | |
| [ESPIPE] | |
| The fd argument is associated with a pipe or FIFO. | |
| FSPACECTL (2) | August 25, 2021 |
| Main index | Section 2 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology. | ” |
| — The Unix Haters' handbook | ||