Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #493
Difficulty: Medium
When a program executes, each command executes one after the other, top-to-bottom. This is known as inconsequential control flow.
True or False?
Linux & Unix Commands - Search Man Pages

setfsent(3) [bsd man page]

GETFSENT(3)						     Library Functions Manual						       GETFSENT(3)

getfsent, getfsspec, getfsfile, getfstype, setfsent, endfsent - get file system descriptor file entry SYNOPSIS
#include <fstab.h> struct fstab *getfsent() struct fstab *getfsspec(spec) char *spec; struct fstab *getfsfile(file) char *file; struct fstab *getfstype(type) char *type; int setfsent() int endfsent() DESCRIPTION
Getfsent, getfsspec, getfstype, and getfsfile each return a pointer to an object with the following structure containing the broken-out fields of a line in the file system description file, <fstab.h>. struct fstab { char *fs_spec; char *fs_file; char *fs_type; int fs_freq; int fs_passno; }; The fields have meanings described in fstab(5). Getfsent reads the next line of the file, opening the file if necessary. Setfsent opens and rewinds the file. Endfsent closes the file. Getfsspec and getfsfile sequentially search from the beginning of the file until a matching special file name or file system file name is found, or until EOF is encountered. Getfstype does likewise, matching on the file system type field. FILES
/etc/fstab SEE ALSO
Null pointer (0) returned on EOF or error. BUGS
All information is contained in a static area so it must be copied if it is to be saved. 4th Berkeley Distribution May 12, 1986 GETFSENT(3)

Check Out this Related Man Page

GETFSENT(3)						   BSD Library Functions Manual 					       GETFSENT(3)

getfsent, getfsspec, getfsfile, setfsent, endfsent -- get file system descriptor file entry LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <fstab.h> struct fstab * getfsent(void); struct fstab * getfsspec(const char *spec); struct fstab * getfsfile(const char *file); int setfsent(void); void endfsent(void); DESCRIPTION
The getfsent(), getfsspec(), and getfsfile() functions each return a pointer to an object with the following structure containing the broken- out fields of a line in the file system description file, <fstab.h>. struct fstab { char *fs_spec; /* block special device name */ char *fs_file; /* file system path prefix */ char *fs_vfstype; /* type of file system */ char *fs_mntops; /* comma separated mount options */ char *fs_type; /* rw, ro, sw, or xx */ int fs_freq; /* dump frequency, in days */ int fs_passno; /* pass number on parallel dump */ }; The fields have meanings described in fstab(5). The setfsent() function opens the file (closing any previously opened file) or rewinds it if it is already open. The endfsent() function closes the file. The getfsspec() and getfsfile() functions search the entire file (opening it if necessary) for a matching special file name or file system file name. For programs wishing to read the entire database, getfsent() reads the next entry (opening the file if necessary). All entries in the file with a type field equivalent to FSTAB_XX are ignored. RETURN VALUES
The getfsent(), getfsspec(), and getfsfile() functions return a null pointer (0) on EOF or error. The setfsent() function returns 0 on fail- ure, 1 on success. The endfsent() function returns nothing. FILES
/etc/fstab SEE ALSO
fstab(5) HISTORY
The getfsent() function appeared in 4.0BSD; the endfsent(), getfsfile(), getfsspec(), and setfsent() functions appeared in 4.3BSD. BUGS
These functions use static data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. BSD
June 4, 1993 BSD

15 More Discussions You Might Find Interesting

1. Linux


I've created a new drive and i've added it to my fstab file but on startup it will not mount. here is how i put it into my fstab file, is that right? /dev/hdb2 /disk2a ext3 defaults 1 2 (6 Replies)
Discussion started by: byblyk
6 Replies

2. UNIX for Dummies Questions & Answers

A Big Problem in LINUX Booting

i have some problem in linux booting will u please help me the problem is i was using federo core 1 on my system everything was fine i made one entry in /etc/fstab file for accessing E drive of WINDOWS XP in that i had given file system as VFAT after rebooting system it was not... (1 Reply)
Discussion started by: great_indian
1 Replies

3. UNIX for Dummies Questions & Answers

fstab question

Folks; Please be patient with this issue when you read it. I know it's a little tricky. I have a new share created on my SUSE 10 box. I'm trying to edit the /etc/fstab file or find a way to make this share needs no authentication. The reason for that is we're using an outside application to... (3 Replies)
Discussion started by: Katkota
3 Replies

4. UNIX for Dummies Questions & Answers

odd entry in /etc/fstab

I was making text file copies of some system utility output (e.g. ioscan) and happened to look at /etc/fstab and found this: /dev/vg02/lvol1 /prodbkup vxfs ioerror=mwdisable,log,nodatainlog,dev=40 020001 0 0 my other entries look like this: /dev/vg04/lvol1 /trainbkup vxfs... (4 Replies)
Discussion started by: LisaS
4 Replies

5. Red Hat

edit/write the /etc/fstab file

Hi, I comment out some vol group in fstab accidentally. I also comment the swap space in /etc/fstab But I cannot edit /remove it back by using vi /etc/fstab again in init 1 and init 6 . The file system /etc/fstab is read -only . I cannot chmod ..... What can I do in order to recover it ... (2 Replies)
Discussion started by: chuikingman
2 Replies

6. UNIX for Dummies Questions & Answers

copy of /etc/fstab on server

hi does any one know how i can: the directory wood should contain a copy of the file /etc/fstab on the server, renamed as saw i have tried cp /etc/fstab wood but not sure how to rename it at the same time any help would be greatly appreciated (3 Replies)
Discussion started by: bashSmash
3 Replies

7. Red Hat

Using a variable in fstab

We have a load of servers which require cloning in VMWare, each of which have their own area on netapp for storage. I was trying to be a bit clever and use a variable within /etc/fstab so I dont need to edit it every time like so; netapp:/vol/vol_nfs_server/servers/`hostname | sed 's/\./ /g' |... (1 Reply)
Discussion started by: JayC89
1 Replies

8. UNIX for Dummies Questions & Answers


hi , i'm creating a shell script using fstab for my project of last year, i wonder you can help me to know what is the command allow me to get the list of unmounted partitions. thanks (4 Replies)
Discussion started by: Linux001
4 Replies

9. Shell Programming and Scripting

Add option to fstab

I need as script (awk/sed?) to add noatime option to fstab. It should append ,noatime to whatever is in column 4 if noatime isn't already there, leaving comments alone. input: # /etc/fstab # Created by anaconda on Mon Oct 31 20:44:41 2011 # # Accessible filesystems, by reference, are... (5 Replies)
Discussion started by: pblumenthal
5 Replies

10. Shell Programming and Scripting

Help to resolve unexpected EOF while looking for matching `"' error

Hi, can someone kindly look into my copy script and figure out why am i getting a "unexpected EOF while looking for matching `"' error message #!/bin/ksh -x cd /home/goldenga/test/flag37 if ; then rm copied.ok cd /home/goldenga/test Upper=`ls -t|grep 'qw*'|cut -d "w" -f 2|head... (4 Replies)
Discussion started by: NDalal007
4 Replies

11. Red Hat

Effects of /etc/fstab file!

Hi Folks! I accidentally overwrote in /etc/fstab file. Can you guys please tell me, what impact it would have created, when I restarted the machine(RHEL6). I executed this command : # blkid /dev/vda5 > /etc/fstab (17 Replies)
Discussion started by: nixhead
17 Replies

12. Shell Programming and Scripting

Mount/fstab Question . . .

Greetings! Got another basic question for the community :) After wiping a drive with dd, and calling mkfs.ext4 to set things up again, fstab seems to need to be refreshed somehow to allow a call to mount for the volume. What might the "secret handshake" be to pull this off without first... (6 Replies)
Discussion started by: LinQ
6 Replies

13. Fedora

Fstab for 2nd hdd, how to?

once again, mounting another volume or hdd the fstab-file is giving me a headache. May someone could give me a hint how to configure the fstab-file properly to use the hdd. The following ls -l /dev/disk/by-uuidis giving me this Thats the UUID for /dev/sdb1 with the name "save"... (6 Replies)
Discussion started by: 1in10
6 Replies

14. Linux

/etc/fstab entries

Hi, Can anyone explain why we use defaults 0 0 in fstab and what does 0 inidicate /home/u nfs defaults 0 0 Thanks in advance Muzaffar (3 Replies)
Discussion started by: muzaffar.k
3 Replies

15. Shell Programming and Scripting

How to replace value in fstab file?

Hi, I am looking to replace value (fifth and sixth ) column to "0 0" in /etc/fstab file by scripting. can any one please help me. /dev/VolGroup00/tmp /tmp ext3 defaults 1 1 (2 Replies)
Discussion started by: yash_message
2 Replies

Featured Tech Videos