summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/fsmount/fsmount.h
blob: 18192df3efe5bd56ef195528f8ce5f03cf1368eb (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*===============================================================*\
| Project: RTEMS fsmount                                          |
+-----------------------------------------------------------------+
| File: fsmount.h                                                 |
+-----------------------------------------------------------------+
|                    Copyright (c) 2003 IMD                       |
|      Ingenieurbuero fuer Microcomputertechnik Th. Doerfler      |
|               <Thomas.Doerfler@imd-systems.de>                  |
|                       all rights reserved                       |
+-----------------------------------------------------------------+
| this file contains the fsmount functions. These functions       |
| are used to mount a list of filesystems (and create their mount |
| points before)                                                  |
|                                                                 |
|  The license and distribution terms for this file may be        |
|  found in the file LICENSE in this distribution or at           |
|  http://www.rtems.com/license/LICENSE.                     |
|                                                                 |
+-----------------------------------------------------------------+
|   date                      history                        ID   |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 02.07.03  creation                                         doe  |
\*===============================================================*/
#ifndef _FSMOUNT_H
#define _FSMOUNT_H
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/libcsupport.h>

/*
 * bits to define, what errors will cause reporting (via printf) and
 * abort of mount processing
 * Use a combination of these bits 
 * for the fields "report_reasons" and "abort_reasons"
 */ 
#define FSMOUNT_MNT_OK        0x0001 /* mounted ok                 */
#define FSMOUNT_MNTPNT_CRTERR 0x0002 /* cannot create mount point  */
#define FSMOUNT_MNT_FAILED    0x0004 /* mounting failed            */

typedef struct {
  char *dev;
  char *mount_point;
  rtems_filesystem_operations_table *fs_ops;
  rtems_filesystem_options_t mount_options;
  unsigned16 report_reasons;
  unsigned16 abort_reasons;
} fstab_t;


/*=========================================================================*\
| Function:                                                                 |
\*-------------------------------------------------------------------------*/
int rtems_fsmount
(
/*-------------------------------------------------------------------------*\
| Purpose:                                                                  |
|  This function will create the mount points listed and mount the file     |
|   systems listed in the calling parameters                                |
+---------------------------------------------------------------------------+
| Input Parameters:                                                         |
\*-------------------------------------------------------------------------*/
 const fstab_t *fstab_ptr,              /* Ptr to filesystem mount table   */
 int fstab_count,                       /* number of entries in mount table*/
 int *fail_idx                          /* return: index of failed entry   */
 );
/*-------------------------------------------------------------------------*\
| Return Value:                                                             |
|    0, if success, -1 and errno if failed                                  |
\*=========================================================================*/

#endif /* _FSMOUNT_H */