#include "fsent.h" static FILE *f; static char *line; static struct fstab fstab; static size_t size; void endfsent() { if (f) __fclose_keep_errno(f); f = 0; } int setfsent() { endfsent(); return 1; } struct fstab *getfsent() { if (!f) f = fopen(_PATH_FSTAB, "rbe"); if (!f) return 0; return __getfsent_a(f, &fstab, &line, &size) ? &fstab : 0; } struct fstab *getfsspec(char const *spec) { return __getfs_a(spec, 0, &fstab, &line, &size) ? &fstab : 0; } struct fstab *getfsfile(char const *file) { return __getfs_a(0, file, &fstab, &line, &size) ? &fstab : 0; }