summaryrefslogtreecommitdiff
path: root/libs/fs-wrapper.c
blob: eec2f5403de142cc5981564f00418812a86dbc68 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774

/* fs.defs wrapper code.

   Copyright (C) 2008 Free Software Foundation, Inc.

   Written by FlĂvio Cruz <flaviocruz@gmail.com>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2, or (at
   your option) any later version.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

#include <mach/boolean.h>
#include <mach/kern_return.h>
#include <mach/message.h>
#include <mach/mig_errors.h>
#include <mach/mig_support.h>

#include <mach/std_types.h>
#include <mach/mach_types.h>
#include <device/device_types.h>
#include <device/net_status.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#include <sys/resource.h>
#include <sys/utsname.h>
#include <hurd/hurd_types.h>

#include <stdio.h>
#include <assert.h>

#include "fs-wrapper.h"

/* this is NULL initialized */
static void *routines[_NUMBER_OF_ROUTINES];

/* function wrappers follows... */

/* file exec */

typedef kern_return_t (*file_exec_type) (file_t,
					 mach_port_t, int,
					 data_t, mach_msg_type_number_t,
					 data_t, mach_msg_type_number_t,
					 portarray_t, mach_msg_type_number_t,
					 portarray_t, mach_msg_type_number_t,
					 intarray_t, mach_msg_type_number_t,
					 mach_port_array_t,
					 mach_msg_type_number_t,
					 mach_port_array_t,
					 mach_msg_type_number_t);

kern_return_t
lisp_S_file_exec (file_t exec_file,
		mach_port_t exec_task,
		int flags,
		data_t argv,
		mach_msg_type_number_t argvCnt,
		data_t envp,
		mach_msg_type_number_t envpCnt,
		portarray_t fdarray,
		mach_msg_type_number_t fdarrayCnt,
		portarray_t portarray,
		mach_msg_type_number_t portarrayCnt,
		intarray_t intarray,
		mach_msg_type_number_t intarrayCnt,
		mach_port_array_t deallocnames,
		mach_msg_type_number_t deallocnamesCnt,
		mach_port_array_t destroynames,
		mach_msg_type_number_t destroynamesCnt)
{
  if (routines[FILE_EXEC] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_exec_type exec_routine = routines[FILE_EXEC];

  return exec_routine (exec_file, exec_task, flags,
		       argv, argvCnt, envp,
		       envpCnt, fdarray, fdarrayCnt,
		       portarray, portarrayCnt,
		       intarray, intarrayCnt,
		       deallocnames, deallocnamesCnt,
		       destroynames, destroynamesCnt);
}

/* file chown */

typedef kern_return_t (*file_chown_type) (file_t chown_file,
					  uid_t new_owner, gid_t new_group);

kern_return_t
lisp_S_file_chown (file_t chown_file, uid_t new_owner, gid_t new_group)
{
  if (routines[FILE_CHOWN] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_chown_type chown_routine = routines[FILE_CHOWN];

  return chown_routine (chown_file, new_owner, new_group);
}

/* file chauthor */

typedef kern_return_t (*file_chauthor_type) (file_t, uid_t);

kern_return_t
lisp_S_file_chauthor (file_t chauth_file, uid_t new_author)
{
  if (routines[FILE_CHAUTHOR] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_chauthor_type chauthor_routine = routines[FILE_CHAUTHOR];

  return chauthor_routine (chauth_file, new_author);
}

/* file chmod */

typedef kern_return_t (*file_chmod_type) (file_t, mode_t);

kern_return_t
lisp_S_file_chmod (file_t chmod_file, mode_t new_mode)
{
  if (routines[FILE_CHMOD] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_chmod_type chmod_routine = routines[FILE_CHMOD];

  return chmod_routine (chmod_file, new_mode);
}

/* file chflags */

typedef kern_return_t (*file_chflags_type) (file_t, int);

kern_return_t
lisp_S_file_chflags (file_t chflags_file, int new_flags)
{
  if (routines[FILE_CHFLAGS] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_chflags_type chflags_routine = routines[FILE_CHFLAGS];

  return chflags_routine (chflags_file, new_flags);
}

/* file utimes */

typedef kern_return_t (*file_utimes_type) (file_t,
					   time_value_t *, time_value_t *);

kern_return_t
lisp_S_file_utimes (file_t utimes_file,
		  time_value_t new_atime, time_value_t new_mtime)
{
  if (routines[FILE_UTIMES] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_utimes_type utimes_routine = routines[FILE_UTIMES];

  // easier in lisp to just pass pointers
  return utimes_routine (utimes_file, &new_atime, &new_mtime);
}

/* file set size */
typedef kern_return_t (*file_set_size_type) (file_t, off_t);

kern_return_t
lisp_S_file_set_size (file_t trunc_file, loff_t new_size)
{
  if (routines[FILE_SET_SIZE] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_set_size_type set_size_routine = routines[FILE_SET_SIZE];

  return set_size_routine (trunc_file, new_size);
}

/* file lock */

typedef kern_return_t (*file_lock_type) (file_t, int);

kern_return_t
lisp_S_file_lock (file_t lock_file, int flags)
{
  if (routines[FILE_LOCK] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_lock_type lock_routine = routines[FILE_LOCK];

  return lock_routine (lock_file, flags);
}

/* file lock stat */

typedef kern_return_t (*file_lock_stat_type) (file_t, int *, int *);

kern_return_t
lisp_S_file_lock_stat (file_t lock_file, int *mystatus, int *otherstatus)
{
  if (routines[FILE_LOCK_STAT] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_lock_stat_type lock_stat_routine = routines[FILE_LOCK_STAT];

  return lock_stat_routine (lock_file, mystatus, otherstatus);
}

/* file check access */

typedef kern_return_t (*file_check_access_type) (file_t, int *);

kern_return_t
lisp_S_file_check_access (file_t file, int *allowed)
{
  if (routines[FILE_CHECK_ACCESS] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_check_access_type check_access_routine = routines[FILE_CHECK_ACCESS];

  return check_access_routine (file, allowed);
}

/* file notice changes */

typedef kern_return_t (*file_notice_changes_type) (file_t, mach_port_t);

kern_return_t
lisp_S_file_notice_changes (file_t file, mach_port_t port)
{
  if (routines[FILE_NOTICE_CHANGES] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_notice_changes_type notice_changes_routine =
    routines[FILE_NOTICE_CHANGES];

  return notice_changes_routine (file, port);
}

/* file getcontrol */

typedef kern_return_t (*file_getcontrol_type) (file_t,
					       mach_port_t *,
					       mach_msg_type_name_t *);

kern_return_t
lisp_S_file_getcontrol (file_t file,
		      mach_port_t * control,
		      mach_msg_type_name_t * controlPoly)
{
  if (routines[FILE_GETCONTROL] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_getcontrol_type getcontrol_routine = routines[FILE_GETCONTROL];

  return getcontrol_routine (file, control, controlPoly);
}

/* file statfs */

typedef kern_return_t (*file_statfs_type) (file_t, fsys_statfsbuf_t *);

kern_return_t
lisp_S_file_statfs (file_t file, fsys_statfsbuf_t * info)
{
  printf ("STATING\n");
  if (routines[FILE_STATFS] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_statfs_type statfs_routine = routines[FILE_STATFS];

  return statfs_routine (file, info);
}

/* file sync */

typedef kern_return_t (*file_sync_type) (file_t, int, int);

kern_return_t
lisp_S_file_sync (file_t file, int wait, int omit_metadata)
{
  if (routines[FILE_SYNC] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_sync_type sync_routine = routines[FILE_SYNC];

  return sync_routine (file, wait, omit_metadata);
}

/* file syncfs */

typedef kern_return_t (*file_syncfs_type) (file_t, int, int);

kern_return_t
lisp_S_file_syncfs (file_t file, int wait, int do_children)
{
  if (routines[FILE_SYNCFS] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_syncfs_type syncfs_routine = routines[FILE_SYNCFS];

  return syncfs_routine (file, wait, do_children);
}

/* file get storage info */

typedef kern_return_t (*file_get_storage_info_type) (file_t,
						     portarray_t *,
						     mach_msg_type_name_t *,
						     mach_msg_type_number_t *,
						     intarray_t *,
						     mach_msg_type_number_t *,
						     off_array_t *,
						     mach_msg_type_number_t *,
						     data_t *,
						     mach_msg_type_number_t
						     *);

kern_return_t
lisp_S_file_get_storage_info (file_t file,
			    portarray_t * ports,
			    mach_msg_type_name_t * portsPoly,
			    mach_msg_type_number_t * portsCnt,
			    intarray_t * ints,
			    mach_msg_type_number_t * intsCnt,
			    off_array_t * offsets,
			    mach_msg_type_number_t * offsetsCnt,
			    data_t * data, mach_msg_type_number_t * dataCnt)
{
  if (routines[FILE_GET_STORAGE_INFO] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_get_storage_info_type get_storage_info_routine =
    routines[FILE_GET_STORAGE_INFO];

  return get_storage_info_routine (file, ports,
				   portsPoly, portsCnt, ints, intsCnt,
				   offsets, offsetsCnt, data, dataCnt);
}

/* file getlinknode */

typedef kern_return_t (*file_getlinknode_type) (file_t,
						mach_port_t *,
						mach_msg_type_name_t *);

kern_return_t
lisp_S_file_getlinknode (file_t file,
		       mach_port_t * linknode,
		       mach_msg_type_name_t * linknodePoly)
{
  if (routines[FILE_GETLINKNODE] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_getlinknode_type getlinknode_routine = routines[FILE_GETLINKNODE];

  return getlinknode_routine (file, linknode, linknodePoly);
}

/* file getfh */

typedef kern_return_t (*file_getfh_type) (file_t,
					  data_t *, mach_msg_type_number_t *);

kern_return_t
lisp_S_file_getfh (file_t file,
		 data_t * filehandle, mach_msg_type_number_t * filehandleCnt)
{
  if (routines[FILE_GETFH] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_getfh_type getfh_routine = routines[FILE_GETFH];

  return getfh_routine (file, filehandle, filehandleCnt);
}

/* dir lookup */

typedef kern_return_t (*dir_lookup_type) (file_t,
					  string_t, int,
					  mode_t, retry_type *,
					  string_t, mach_port_t *,
					  mach_msg_type_name_t *);

kern_return_t
lisp_S_dir_lookup (file_t startdir,
		 string_t filename,
		 int flags,
		 mode_t mode,
		 retry_type * do_retry,
		 string_t retry_name,
		 mach_port_t * result, mach_msg_type_name_t * resultPoly)
{
  printf ("DIR LOOKUP %s\n", filename);
  if (routines[DIR_LOOKUP] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_lookup_type lookup_routine = routines[DIR_LOOKUP];

  return lookup_routine (startdir, filename,
			 flags, mode, do_retry, retry_name,
			 result, resultPoly);
}

/* dir readdir */

typedef kern_return_t (*dir_readdir_type) (file_t,
					   data_t *, mach_msg_type_number_t *,
					   boolean_t *, int,
					   int, vm_size_t, int *);

kern_return_t
lisp_S_dir_readdir (file_t dir,
		  data_t * data,
		  mach_msg_type_number_t * dataCnt,
		  boolean_t * dataDealloc,
		  int entry, int nentries, vm_size_t bufsiz, int *amount)
{
  if (routines[DIR_READDIR] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_readdir_type readdir_routine = routines[DIR_READDIR];

  return readdir_routine (dir, data, dataCnt,
			  dataDealloc, entry, nentries, bufsiz, amount);
}

/* dir mkdir */

typedef kern_return_t (*dir_mkdir_type) (file_t, string_t, mode_t);

kern_return_t
lisp_S_dir_mkdir (file_t directory, string_t name, mode_t mode)
{
  if (routines[DIR_MKDIR] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_mkdir_type mkdir_routine = routines[DIR_MKDIR];

  return mkdir_routine (directory, name, mode);
}

/* dir rmdir */

typedef kern_return_t (*dir_rmdir_type) (file_t, string_t);

kern_return_t
lisp_S_dir_rmdir (file_t directory, string_t name)
{
  if (routines[DIR_RMDIR] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_rmdir_type rmdir_routine = routines[DIR_RMDIR];

  return rmdir_routine (directory, name);
}

/* dir unlink */

typedef kern_return_t (*dir_unlink_type) (file_t, string_t);

kern_return_t
lisp_S_dir_unlink (file_t directory, string_t name)
{
  if (routines[DIR_UNLINK] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_unlink_type unlink_routine = routines[DIR_UNLINK];

  return unlink_routine (directory, name);
}

/* dir link */

typedef kern_return_t (*dir_link_type) (file_t, file_t, string_t, int);

kern_return_t
lisp_S_dir_link (file_t dir, file_t file, string_t name, int excl)
{
  if (routines[DIR_LINK] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_link_type link_routine = routines[DIR_LINK];

  return link_routine (dir, file, name, excl);
}

/* dir rename */

typedef kern_return_t (*dir_rename_type) (file_t,
					  string_t, file_t, string_t, int);

kern_return_t
lisp_S_dir_rename (file_t olddirectory,
		 string_t oldname,
		 file_t newdirectory, string_t newname, int excl)
{
  if (routines[DIR_RENAME] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_rename_type rename_routine = routines[DIR_RENAME];

  return rename_routine (olddirectory, oldname, newdirectory, newname, excl);
}

/* dir mkfile */

typedef kern_return_t (*dir_mkfile_type) (file_t,
					  int, mode_t, mach_port_t *,
					  mach_msg_type_name_t *);

kern_return_t
lisp_S_dir_mkfile (file_t directory,
		 int flags,
		 mode_t mode,
		 mach_port_t * newnode, mach_msg_type_name_t * newnodePoly)
{
  if (routines[DIR_MKFILE] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_mkfile_type mkfile_routine = routines[DIR_MKFILE];

  return mkfile_routine (directory, flags, mode, newnode, newnodePoly);
}

/* dir notice changes */

typedef kern_return_t (*dir_notice_changes_type) (file_t, mach_port_t);

kern_return_t
lisp_S_dir_notice_changes (file_t directory, mach_port_t port)
{
  if (routines[DIR_NOTICE_CHANGES] == NULL)
    {
      return EOPNOTSUPP;
    }

  dir_notice_changes_type notice_changes_routine =
    routines[DIR_NOTICE_CHANGES];

  return notice_changes_routine (directory, port);
}

/* file set translator */

typedef kern_return_t (*file_set_translator_type) (file_t,
						   int, int, int,
						   data_t,
						   mach_msg_type_number_t,
						   mach_port_t);

kern_return_t
lisp_S_file_set_translator (file_t file,
			  int passive_flags,
			  int active_flags,
			  int oldtrans_flags,
			  data_t passive,
			  mach_msg_type_number_t passiveCnt,
			  mach_port_t active)
{
  if (routines[FILE_SET_TRANSLATOR] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_set_translator_type set_translator_routine =
    routines[FILE_SET_TRANSLATOR];

  return set_translator_routine (file, passive_flags,
				 active_flags, oldtrans_flags,
				 passive, passiveCnt, active);
}

/* file get translator */

typedef kern_return_t (*file_get_translator_type) (file_t,
						   data_t *,
						   mach_msg_type_number_t *);

kern_return_t
lisp_S_file_get_translator (file_t file,
			  data_t * translator,
			  mach_msg_type_number_t * translatorCnt)
{
  if (routines[FILE_GET_TRANSLATOR] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_get_translator_type get_translator_routine =
    routines[FILE_GET_TRANSLATOR];

  return get_translator_routine (file, translator, translatorCnt);
}

/* file get translator cntl */

typedef kern_return_t (*file_get_translator_cntl_type) (file_t,
							mach_port_t *,
							mach_msg_type_name_t
							*);

kern_return_t
lisp_S_file_get_translator_cntl (file_t file,
			       mach_port_t * translator_cntl,
			       mach_msg_type_name_t * translator_cntlPoly)
{
  if (routines[FILE_GET_TRANSLATOR_CNTL] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_get_translator_cntl_type get_translator_cntl_routine =
    routines[FILE_GET_TRANSLATOR_CNTL];

  return get_translator_cntl_routine (file, translator_cntl,
				      translator_cntlPoly);
}

/* file get fs options */

typedef kern_return_t (*file_get_fs_options_type) (file_t,
						   data_t *,
						   mach_msg_type_number_t *);

kern_return_t
lisp_S_file_get_fs_options (file_t file,
			  data_t * options,
			  mach_msg_type_number_t * optionsCnt)
{
  if (routines[FILE_GET_FS_OPTIONS] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_get_fs_options_type get_fs_options_routine =
    routines[FILE_GET_FS_OPTIONS];

  return get_fs_options_routine (file, options, optionsCnt);
}

/* file reparent */

typedef kern_return_t (*file_reparent_type) (file_t,
					     mach_port_t, mach_port_t *,
					     mach_msg_type_name_t *);

kern_return_t
lisp_S_file_reparent (file_t file,
		    mach_port_t parent,
		    mach_port_t * newfile,
		    mach_msg_type_name_t * new_filePoly)
{
  if (routines[FILE_REPARENT] == NULL)
    {
      return EOPNOTSUPP;
    }

  file_reparent_type reparent_routine = routines[FILE_REPARENT];

  return reparent_routine (file, parent, newfile, new_filePoly);
}

static const char *
routine_to_str (const FsRoutine rot)
{
#define RET(val) case val: return #val ;
  switch (rot)
    {
    RET (FILE_EXEC)
    RET (FILE_CHOWN)
    RET (FILE_CHAUTHOR)
    RET (FILE_CHMOD)
    RET (FILE_CHFLAGS)
    RET (FILE_UTIMES)
    RET (FILE_SET_SIZE)
    RET (FILE_LOCK)
    RET (FILE_LOCK_STAT)
    RET (FILE_CHECK_ACCESS)
    RET (FILE_NOTICE_CHANGES)
    RET (FILE_GETCONTROL)
    RET (FILE_STATFS)
    RET (FILE_SYNC)
    RET (FILE_SYNCFS)
    RET (FILE_GET_STORAGE_INFO)
    RET (FILE_GETLINKNODE)
    RET (FILE_GETFH)
    RET (DIR_LOOKUP)
    RET (DIR_READDIR)
    RET (DIR_MKDIR)
    RET (DIR_RMDIR)
    RET (DIR_UNLINK)
    RET (DIR_LINK)
    RET (DIR_RENAME)
    RET (DIR_MKFILE)
    RET (DIR_NOTICE_CHANGES)
    RET (FILE_SET_TRANSLATOR)
    RET (FILE_GET_TRANSLATOR)
    RET (FILE_GET_TRANSLATOR_CNTL)
    RET (FILE_GET_FS_OPTIONS)
    RET (FILE_REPARENT)
    case _NUMBER_OF_ROUTINES:
    default:
      return "";
    }

#undef RET
}

#include "common.c"

COMMON_FUNCTIONS (fs);