aboutsummaryrefslogtreecommitdiff
blob: 98da36983dfaa7ceb9714b99fc9bb7e148df4e4a (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
/*
 * __xmknod.c
 *
 * __xmknod() wrapper.
 *
 * Copyright 1999-2008 Gentoo Foundation
 * Licensed under the GPL-2
 *
 *  Partly Copyright (C) 1998-9 Pancrazio `Ezio' de Mauro <p@demauro.net>,
 *  as some of the InstallWatch code was used.
 */

extern int EXTERN_NAME(int, const char *, __mode_t, __dev_t *);
static int (*WRAPPER_TRUE_NAME) (int, const char *, __mode_t, __dev_t *) = NULL;

int WRAPPER_NAME(int ver, const char *pathname, __mode_t mode, __dev_t *dev)
{
	int result = -1;

	if FUNCTION_SANDBOX_SAFE("mknod", pathname) {
		check_dlsym(WRAPPER_TRUE_NAME, WRAPPER_SYMNAME,
			    WRAPPER_SYMVER);
		result = WRAPPER_TRUE_NAME(ver, pathname, mode, dev);
	}

	return result;
}