source: rtems/cpukit/libcsupport/src/mount-mktgt.c @ 3d3a18e6

4.10
Last change on this file since 3d3a18e6 was 3d3a18e6, checked in by Sebastian Huber <sebastian.huber@…>, on Jul 1, 2010 at 2:39:39 PM

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/unmount.c: Removed obsolete declarations. Fixed invalid memory free.

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed rtems_ftpfs_mount().

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/mount-mktgt.c: New file.
  • libcsupport/Makefile.am: Reflect change above.
  • libcsupport/include/rtems/libio.h: Declare mount_and_make_target_path().

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added rtems_ftpfs_mount() again. Documentation.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added and use defines for file system types.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/mount.c: Fixed NULL pointer access.
  • Property mode set to 100644
File size: 940 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
11 * embedded brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * <rtems@embedded-brains.de>
16 *
17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
19 * http://www.rtems.com/license/LICENSE.
20 */
21
22#if HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <errno.h>
27
28#include <rtems/libio.h>
29
30int mount_and_make_target_path(
31  const char *source,
32  const char *target,
33  const char *filesystemtype,
34  rtems_filesystem_options_t options,
35  const void *data
36)
37{
38  int rv = -1;
39
40  if (target != NULL) {
41    rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
42    if (rv == 0) {
43      rv = mount(
44        source,
45        target,
46        filesystemtype,
47        options,
48        data
49      );
50    }
51  } else {
52    errno = EINVAL;
53  }
54
55  return rv;
56}
Note: See TracBrowser for help on using the repository browser.