blob: a72984e0708b9980825a1d24c5475f2e27068fb5 (
plain) (
blame)
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
|
/**
* @file
*
* @ingroup LibIO
*
* @brief mount_and_make_target_path() implementation.
*/
/*
* Copyright (c) 2010 embedded brains GmbH. All rights reserved.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <rtems/libio.h>
int mount_and_make_target_path(
const char *source,
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
int rv = -1;
if (target != NULL) {
rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
if (rv == 0) {
rv = mount(
source,
target,
filesystemtype,
options,
data
);
}
} else {
errno = EINVAL;
}
return rv;
}
|