This source file includes following definitions.
- pcmk__open_devnull
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_IO_INTERNAL__H
11 #define PCMK__CRM_COMMON_IO_INTERNAL__H
12
13 #include <fcntl.h>
14 #include <stdbool.h>
15 #include <unistd.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 int pcmk__real_path(const char *path, char **resolved_path);
22
23 char *pcmk__series_filename(const char *directory, const char *series,
24 unsigned int sequence, bool bzip);
25 int pcmk__read_series_sequence(const char *directory, const char *series,
26 unsigned int *seq);
27 void pcmk__write_series_sequence(const char *directory, const char *series,
28 unsigned int sequence, int max);
29 int pcmk__chown_series_sequence(const char *directory, const char *series,
30 uid_t uid, gid_t gid);
31
32 int pcmk__build_path(const char *path_c, mode_t mode);
33 char *pcmk__full_path(const char *filename, const char *dirname);
34 bool pcmk__daemon_can_write(const char *dir, const char *file);
35 void pcmk__sync_directory(const char *name);
36
37 int pcmk__file_contents(const char *filename, char **contents);
38 int pcmk__write_sync(int fd, const char *contents);
39 int pcmk__set_nonblocking(int fd);
40 const char *pcmk__get_tmpdir(void);
41
42 void pcmk__close_fds_in_child(bool);
43
44
45
46
47
48
49
50
51
52
53 static inline void
54 pcmk__open_devnull(int flags)
55 {
56
57
58 (void) open("/dev/null", flags);
59 }
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif