aboutsummaryrefslogtreecommitdiff
path: root/lib/compat/mockups.c
blob: 4c396ec775322f5d805d56760c66756dda63efef (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* SPDX-License-Identifier: GPL-3.0-or-later */
/*
 * mockups.c
 *
 * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
 */
#include "config.h"
#include "compat.h"

#include <stdio.h>

#ifdef _WIN32
int fchownat(int dirfd, const char *path, int uid, int gid, int flags)
{
	if (dirfd != AT_FDCWD) {
		fputs("[FIXME] fchownat stub only supports AT_FDCWD!\n",
		      stderr);
		return -1;
	}

	if (flags != 0 && flags != AT_SYMLINK_NOFOLLOW) {
		fputs("[FIXME] fchownat stub used with an unknown flag!\n",
		      stderr);
		return -1;
	}

	(void)path;
	(void)uid;
	(void)gid;
	return 0;
}

int fchmodat(int dirfd, const char *path, int mode, int flags)
{
	if (dirfd != AT_FDCWD) {
		fputs("[FIXME] fchmodat stub only supports AT_FDCWD!\n",
		      stderr);
		return -1;
	}

	if (flags != 0 && flags != AT_SYMLINK_NOFOLLOW) {
		fputs("[FIXME] fchmodat stub used with an unknown flag!\n",
		      stderr);
		return -1;
	}

	(void)path;
	(void)mode;
	return 0;
}
#endif