1GETFSENT(3) 386BSD Programmer's Manual GETFSENT(3) 2 3NNAAMMEE 4 ggeettffsseenntt, ggeettffssssppeecc, ggeettffssffiillee, sseettffsseenntt, eennddffsseenntt - get file system 5 descriptor file entry 6 7SSYYNNOOPPSSIISS 8 ##iinncclluuddee <<ffssttaabb..hh>> 9 10 _f_s_t_a_b * 11 ggeettffsseenntt(_v_o_i_d) 12 13 _s_t_r_u_c_t _f_s_t_a_b * 14 ggeettffssssppeecc(_c_o_n_s_t _c_h_a_r *_s_p_e_c) 15 16 _s_t_r_u_c_t _f_s_t_a_b * 17 ggeettffssffiillee(_c_o_n_s_t _c_h_a_r *_f_i_l_e) 18 19 _i_n_t 20 sseettffsseenntt(_v_o_i_d) 21 22 _v_o_i_d 23 eennddffsseenntt(_v_o_i_d) 24 25DDEESSCCRRIIPPTTIIOONN 26 The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions each return a 27 pointer to an object with the following structure containing the broken- 28 out fields of a line in the file system description file, <_f_s_t_a_b._h>. 29 30 struct fstab { 31 char *fs_spec; /* block special device name */ 32 char *fs_file; /* file system path prefix */ 33 char *fs_vfstype; /* type of file system */ 34 char *fs_mntops; /* comma separated mount options */ 35 char *fs_type; /* rw, ro, sw, or xx */ 36 int fs_freq; /* dump frequency, in days */ 37 int fs_passno; /* pass number on parallel dump */ 38 }; 39 40 The fields have meanings described in fstab(5). 41 42 The sseettffsseenntt() function opens the file (closing any previously opened 43 file) or rewinds it if it is already open. 44 45 The eennddffsseenntt() function closes the file. 46 47 The ggeettffssssppeecc() and ggeettffssffiillee() functions search the entire file (opening 48 it if necessary) for a matching special file name or file system file 49 name. 50 51 For programs wishing to read the entire database, ggeettffsseenntt() reads the 52 next entry (opening the file if necessary). 53 54 All entries in the file with a type field equivalent to FSTAB_XX are 55 ignored. 56 57RREETTUURRNN VVAALLUUEESS 58 The ggeettffsseenntt(), ggeettffssssppeecc(), and ggeettffssffiillee() functions return a null 59 pointer (0) on EOF or error. The sseettffsseenntt() function returns 0 on 60 failure, 1 on success. The eennddffsseenntt() function returns nothing. 61 62FFIILLEESS 63 /etc/fstab 64 65SSEEEE AALLSSOO 66 fstab(5) 67 68HHIISSTTOORRYY 69 The ggeettffsseenntt() function appeared in 4.0BSD; the eennddffsseenntt(), ggeettffssffiillee(), 70 ggeettffssssppeecc(), and sseettffsseenntt() functions appeared in 4.3BSD. 71 72BBUUGGSS 73 These functions use static data storage; if the data is needed for future 74 use, it should be copied before any subsequent calls overwrite it. 75 764th Berkeley Distribution April 19, 1991 2 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