annotate src/lib/file-set-size.h @ 23007:36e01285b5b8

lib: buffer - Improve header comment for buffer_insert() and buffer_delete().
author Stephan Bosch <stephan.bosch@dovecot.fi>
date Mon, 18 Mar 2019 00:52:37 +0100
parents 22c81f884032
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 222
diff changeset
1 #ifndef FILE_SET_SIZE_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 222
diff changeset
2 #define FILE_SET_SIZE_H
221
ed0d5b17c7a4 Added extra functions for easier printing of error messages. Moved
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
ed0d5b17c7a4 Added extra functions for easier printing of error messages. Moved
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 /* Shrink/grow file. If file is grown, the new data is guaranteed to
222
cf4d065f2f85 lots of cleanups. also index/datafile is now capable of staying in memory,
Timo Sirainen <tss@iki.fi>
parents: 221
diff changeset
5 be zeros. The file offset may be anywhere after this call.
cf4d065f2f85 lots of cleanups. also index/datafile is now capable of staying in memory,
Timo Sirainen <tss@iki.fi>
parents: 221
diff changeset
6 Returns -1 if failed, 0 if successful. */
221
ed0d5b17c7a4 Added extra functions for easier printing of error messages. Moved
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 int file_set_size(int fd, off_t size);
12319
22c81f884032 Added file_preallocate() to preallocate space to a file without changing its size.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
8 /* Preallocate file to given size, without actually changing the size
22c81f884032 Added file_preallocate() to preallocate space to a file without changing its size.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
9 reported by stat(). Returns 1 if ok, 0 if not supported by this filesystem,
22c81f884032 Added file_preallocate() to preallocate space to a file without changing its size.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
10 -1 if error. */
22c81f884032 Added file_preallocate() to preallocate space to a file without changing its size.
Timo Sirainen <tss@iki.fi>
parents: 6410
diff changeset
11 int file_preallocate(int fd, off_t size);
221
ed0d5b17c7a4 Added extra functions for easier printing of error messages. Moved
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12
ed0d5b17c7a4 Added extra functions for easier printing of error messages. Moved
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 #endif