chiark / gitweb /
journalctl: use _COMM= match for scripts
[elogind.git] / src / shared / mkdir.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foomkdirhfoo
4 #define foomkdirhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10   Copyright 2013 Kay Sievers
11
12   systemd is free software; you can redistribute it and/or modify it
13   under the terms of the GNU Lesser General Public License as published by
14   the Free Software Foundation; either version 2.1 of the License, or
15   (at your option) any later version.
16
17   systemd is distributed in the hope that it will be useful, but
18   WITHOUT ANY WARRANTY; without even the implied warranty of
19   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20   Lesser General Public License for more details.
21
22   You should have received a copy of the GNU Lesser General Public License
23   along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 ***/
25
26 #include <sys/types.h>
27
28 int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
29 int mkdir_parents(const char *path, mode_t mode);
30 int mkdir_p(const char *path, mode_t mode);
31 int mkdir_p_prefix(const char *prefix, const char *path, mode_t mode);
32
33 /* selinux versions */
34 int mkdir_label(const char *path, mode_t mode);
35 int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
36 int mkdir_parents_label(const char *path, mode_t mode);
37 int mkdir_p_label(const char *path, mode_t mode);
38 int mkdir_parents_prefix_label(const char *prefix, const char *path, mode_t mode);
39
40 /* internally used */
41 typedef int (*mkdir_func_t)(const char *pathname, mode_t mode);
42 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir);
43 int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir);
44 int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir);
45 #endif