2 * <fstab.h> wrapper functions.
5 * Jonathan Pryor (jonpryor@vt.edu)
7 * Copyright (C) 2004 Jonathan Pryor
20 struct Mono_Posix_Syscall__Fstab {
21 char *fs_spec; /* block device name */
22 char *fs_file; /* mount point */
23 char *fs_vfstype; /* filesystem type */
24 char *fs_mntops; /* mount options */
25 char *fs_type; /* rw/rq/ro/sw/xx option */
26 int fs_freq; /* dump frequency, in days */
27 int fs_passno; /* pass number on parallel dump */
34 offsetof (struct fstab, fs_spec),
35 offsetof (struct fstab, fs_file),
36 offsetof (struct fstab, fs_vfstype),
37 offsetof (struct fstab, fs_mntops),
38 offsetof (struct fstab, fs_type)
42 mph_fstab_offsets[] = {
43 offsetof (struct Mono_Posix_Syscall__Fstab, fs_spec),
44 offsetof (struct Mono_Posix_Syscall__Fstab, fs_file),
45 offsetof (struct Mono_Posix_Syscall__Fstab, fs_vfstype),
46 offsetof (struct Mono_Posix_Syscall__Fstab, fs_mntops),
47 offsetof (struct Mono_Posix_Syscall__Fstab, fs_type)
51 * Copy the native `passwd' structure to it's managed representation.
53 * To minimize separate mallocs, all the strings are allocated within the same
54 * memory block (stored in _fs_buf_).
57 copy_fstab (struct Mono_Posix_Syscall__Fstab *to, struct fstab *from)
60 buf = _mph_copy_structure_strings (to, mph_fstab_offsets,
61 from, fstab_offsets, sizeof(fstab_offsets)/sizeof(fstab_offsets[0]));
63 to->fs_freq = from->fs_freq;
64 to->fs_passno = from->fs_passno;
75 Mono_Posix_Syscall_getfsent (struct Mono_Posix_Syscall__Fstab *fsbuf)
88 if (copy_fstab (fsbuf, fs) == -1) {
96 Mono_Posix_Syscall_getfsfile (const char *mount_point,
97 struct Mono_Posix_Syscall__Fstab *fsbuf)
106 fs = getfsfile (mount_point);
110 if (copy_fstab (fsbuf, fs) == -1) {
118 Mono_Posix_Syscall_getfsspec (const char *special_file,
119 struct Mono_Posix_Syscall__Fstab *fsbuf)
128 fs = getfsspec (special_file);
132 if (copy_fstab (fsbuf, fs) == -1) {