source: rtems/cpukit/libcsupport/src/__usrenv.c @ e19da87a

5
Last change on this file since e19da87a was 5b5d2fd4, checked in by Sebastian Huber <sebastian.huber@…>, on 03/05/15 at 08:37:36

Filesystem: Delete unused null_op_fsmount_me()

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS File System Location Support
5 *  @ingroup LibIOInternal
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2008.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  Modifications to support reference counting in the file system are
13 *  Copyright (c) 2012 embedded brains GmbH.
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#if HAVE_CONFIG_H
21  #include "config.h"
22#endif
23
24#include <sys/stat.h>
25
26#include <rtems/libio_.h>
27
28static int null_handler_open(
29  rtems_libio_t *iop,
30  const char *path,
31  int oflag,
32  mode_t mode
33)
34{
35  return -1;
36}
37
38static int null_handler_fstat(
39  const rtems_filesystem_location_info_t *pathloc,
40  struct stat *buf
41)
42{
43  return -1;
44}
45
46const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers = {
47  .open_h = null_handler_open,
48  .close_h = rtems_filesystem_default_close,
49  .read_h = rtems_filesystem_default_read,
50  .write_h = rtems_filesystem_default_write,
51  .ioctl_h = rtems_filesystem_default_ioctl,
52  .lseek_h = rtems_filesystem_default_lseek,
53  .fstat_h = null_handler_fstat,
54  .ftruncate_h = rtems_filesystem_default_ftruncate,
55  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
56  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
57  .fcntl_h = rtems_filesystem_default_fcntl,
58  .kqfilter_h = rtems_filesystem_default_kqfilter,
59  .poll_h = rtems_filesystem_default_poll,
60  .readv_h = rtems_filesystem_default_readv,
61  .writev_h = rtems_filesystem_default_writev
62};
63
64static void null_op_lock_or_unlock(
65  const rtems_filesystem_mount_table_entry_t *mt_entry
66)
67{
68  /* Do nothing */
69}
70
71static int null_op_mknod(
72  const rtems_filesystem_location_info_t *parentloc,
73  const char *name,
74  size_t namelen,
75  mode_t mode,
76  dev_t dev
77)
78{
79  return -1;
80}
81
82static int null_op_rmnod(
83  const rtems_filesystem_location_info_t *parentloc,
84  const rtems_filesystem_location_info_t *loc
85)
86{
87  return -1;
88}
89
90static int null_op_link(
91  const rtems_filesystem_location_info_t *parentloc,
92  const rtems_filesystem_location_info_t *targetloc,
93  const char *name,
94  size_t namelen
95)
96{
97  return -1;
98}
99
100static int null_op_fchmod(
101  const rtems_filesystem_location_info_t *pathloc,
102  mode_t mode
103)
104{
105  return -1;
106}
107
108static int null_op_chown(
109  const rtems_filesystem_location_info_t *loc,
110  uid_t owner,
111  gid_t group
112)
113{
114  return -1;
115}
116
117static int null_op_clonenode(
118  rtems_filesystem_location_info_t *loc
119)
120{
121  return -1;
122}
123
124static int null_op_mount(
125  rtems_filesystem_mount_table_entry_t *mt_entry
126)
127{
128  return -1;
129}
130
131static int null_op_unmount(
132  rtems_filesystem_mount_table_entry_t *mt_entry
133)
134{
135  return -1;
136}
137
138static void null_op_fsunmount_me(
139  rtems_filesystem_mount_table_entry_t *mt_entry
140)
141{
142  /* Do nothing */
143}
144
145static int null_op_utime(
146  const rtems_filesystem_location_info_t *loc,
147  time_t actime,
148  time_t modtime
149)
150{
151  return -1;
152}
153
154static int null_op_symlink(
155  const rtems_filesystem_location_info_t *parentloc,
156  const char *name,
157  size_t namelen,
158  const char *target
159)
160{
161  return -1;
162}
163
164static ssize_t null_op_readlink(
165  const rtems_filesystem_location_info_t *loc,
166  char *buf,
167  size_t bufsize
168)
169{
170  return -1;
171}
172
173static int null_op_rename(
174  const rtems_filesystem_location_info_t *oldparentloc,
175  const rtems_filesystem_location_info_t *oldloc,
176  const rtems_filesystem_location_info_t *newparentloc,
177  const char *name,
178  size_t namelen
179)
180{
181  return -1;
182}
183
184static int null_op_statvfs(
185  const rtems_filesystem_location_info_t *__restrict loc,
186  struct statvfs *__restrict buf
187)
188{
189  return -1;
190}
191
192static const rtems_filesystem_operations_table null_ops = {
193  .lock_h = null_op_lock_or_unlock,
194  .unlock_h = null_op_lock_or_unlock,
195  .eval_path_h = rtems_filesystem_default_eval_path,
196  .link_h = null_op_link,
197  .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal,
198  .mknod_h = null_op_mknod,
199  .rmnod_h = null_op_rmnod,
200  .fchmod_h = null_op_fchmod,
201  .chown_h = null_op_chown,
202  .clonenod_h = null_op_clonenode,
203  .freenod_h = rtems_filesystem_default_freenode,
204  .mount_h = null_op_mount,
205  .unmount_h = null_op_unmount,
206  .fsunmount_me_h = null_op_fsunmount_me,
207  .utime_h = null_op_utime,
208  .symlink_h = null_op_symlink,
209  .readlink_h = null_op_readlink,
210  .rename_h = null_op_rename,
211  .statvfs_h = null_op_statvfs
212};
213
214rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry = {
215  .location_chain = RTEMS_CHAIN_INITIALIZER_ONE_NODE(
216    &rtems_filesystem_global_location_null.location.mt_entry_node
217  ),
218  .ops = &null_ops,
219  .mt_point_node = &rtems_filesystem_global_location_null,
220  .mt_fs_root = &rtems_filesystem_global_location_null,
221  .mounted = false,
222  .writeable = false,
223  .type = ""
224};
225
226rtems_filesystem_global_location_t rtems_filesystem_global_location_null = {
227  .location = {
228    .mt_entry_node = RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(
229      &rtems_filesystem_null_mt_entry.location_chain
230    ),
231    .handlers = &rtems_filesystem_null_handlers,
232    .mt_entry = &rtems_filesystem_null_mt_entry
233  },
234
235  /*
236   * The initial reference count accounts for the following references
237   *  o the root directory of the user environment,
238   *  o the current directory of the user environment,
239   *  o the root node of the null file system instance, and
240   *  o the mount point node of the null file system instance.
241   */
242  .reference_count = 4
243};
244
245rtems_user_env_t rtems_global_user_env = {
246  .current_directory = &rtems_filesystem_global_location_null,
247  .root_directory = &rtems_filesystem_global_location_null,
248  .umask = S_IWGRP | S_IWOTH
249};
250
251pthread_key_t rtems_current_user_env_key;
Note: See TracBrowser for help on using the repository browser.