doc: Fix section of functions age(xid) and mxid_age(xid)
[pgsql.git] / src / include / common / file_perm.h
blobd1f5616793e6a32e766608a9bf11d3863454c532
1 /*-------------------------------------------------------------------------
3 * File and directory permission definitions
6 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/common/file_perm.h
11 *-------------------------------------------------------------------------
13 #ifndef FILE_PERM_H
14 #define FILE_PERM_H
16 #include <sys/stat.h>
19 * Mode mask for data directory permissions that only allows the owner to
20 * read/write directories and files.
22 * This is the default.
24 #define PG_MODE_MASK_OWNER (S_IRWXG | S_IRWXO)
27 * Mode mask for data directory permissions that also allows group read/execute.
29 #define PG_MODE_MASK_GROUP (S_IWGRP | S_IRWXO)
31 /* Default mode for creating directories */
32 #define PG_DIR_MODE_OWNER S_IRWXU
34 /* Mode for creating directories that allows group read/execute */
35 #define PG_DIR_MODE_GROUP (S_IRWXU | S_IRGRP | S_IXGRP)
37 /* Default mode for creating files */
38 #define PG_FILE_MODE_OWNER (S_IRUSR | S_IWUSR)
40 /* Mode for creating files that allows group read */
41 #define PG_FILE_MODE_GROUP (S_IRUSR | S_IWUSR | S_IRGRP)
43 /* Modes for creating directories and files in the data directory */
44 extern PGDLLIMPORT int pg_dir_create_mode;
45 extern PGDLLIMPORT int pg_file_create_mode;
47 /* Mode mask to pass to umask() */
48 extern PGDLLIMPORT int pg_mode_mask;
50 /* Set permissions and mask based on the provided mode */
51 extern void SetDataDirectoryCreatePerm(int dataDirMode);
53 /* Set permissions and mask based on the mode of the data directory */
54 extern bool GetDataDirectoryCreatePerm(const char *dataDir);
56 #endif /* FILE_PERM_H */