/usr/include/dovecot/file-create-locked.h is in dovecot-dev 1:2.2.22-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #ifndef FILE_CREATE_LOCKED_H
#define FILE_CREATE_LOCKED_H
#include "file-lock.h"
struct file_create_settings {
/* 0 = try locking without waiting */
unsigned int lock_timeout_secs;
enum file_lock_method lock_method;
/* 0 = 0600 */
int mode;
/* 0 = default */
uid_t uid;
/* 0 = default */
gid_t gid;
const char *gid_origin;
};
/* Either open an existing file and lock it, or create the file locked.
The creation is done by creating a temp file and link()ing it to path.
If link() fails, opening is retried again. Returns fd on success,
-1 on error. errno is preserved for the last failed syscall, so most
importantly ENOENT could mean that the directory doesn't exist and EAGAIN
means locking timed out. */
int file_create_locked(const char *path, const struct file_create_settings *set,
struct file_lock **lock_r, bool *created_r,
const char **error_r);
#endif
|