source: rtems/cpukit/libcsupport/src/mount-mktgt.c @ 255fe43

Last change on this file since 255fe43 was 255fe43, checked in by Joel Sherrill <joel@…>, on 03/01/22 at 20:40:44

cpukit/: Scripted embedded brains header file clean up

Updates #4625.

  • Property mode set to 100644
File size: 880 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup LibIO
5 *
6 * @brief mount_and_make_target_path() implementation.
7 */
8
9/*
10 * Copyright (c) 2010 embedded brains GmbH.  All rights reserved.
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <errno.h>
22
23#include <rtems/libio.h>
24
25int mount_and_make_target_path(
26  const char *source,
27  const char *target,
28  const char *filesystemtype,
29  rtems_filesystem_options_t options,
30  const void *data
31)
32{
33  int rv = -1;
34
35  if (target != NULL) {
36    rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
37    if (rv == 0) {
38      rv = mount(
39        source,
40        target,
41        filesystemtype,
42        options,
43        data
44      );
45    }
46  } else {
47    errno = EINVAL;
48  }
49
50  return rv;
51}
Note: See TracBrowser for help on using the repository browser.