]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/mkdir.h
dhcp6-option: Add helper function for uncompressed domain names
[thirdparty/systemd.git] / src / basic / mkdir.h
CommitLineData
49e942b2
KS
1/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
f4ef809c 3#pragma once
49e942b2
KS
4
5/***
6 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
39bdfa31 9 Copyright 2013 Kay Sievers
49e942b2
KS
10
11 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
49e942b2
KS
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 19 Lesser General Public License for more details.
49e942b2 20
5430f7f2 21 You should have received a copy of the GNU Lesser General Public License
49e942b2
KS
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23***/
24
4ad49000
LP
25#include <sys/types.h>
26
c66e7f04 27int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
c66e7f04 28int mkdir_parents(const char *path, mode_t mode);
c66e7f04 29int mkdir_p(const char *path, mode_t mode);
4ad49000 30
66b6d9d5 31/* mandatory access control(MAC) versions */
39bdfa31
KS
32int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid);
33int mkdir_parents_label(const char *path, mode_t mode);
34int mkdir_p_label(const char *path, mode_t mode);
39bdfa31
KS
35
36/* internally used */
37typedef int (*mkdir_func_t)(const char *pathname, mode_t mode);
38int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir);
39int mkdir_parents_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir);
40int mkdir_p_internal(const char *prefix, const char *path, mode_t mode, mkdir_func_t _mkdir);