View Full Version : what is fdesc?
The output to the daily command always includes these lines:
disks:
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/disk0s9 18904080 11422932 7481148 60% /
fdesc 1 1 0 100% /dev
/dev/disk0s10 1099280 450928 648352 41% /Volumes/OS9
Can someone tell me what "fdesc" is?
Thanks.
mervTormel
01-26-2002, 02:30 PM
fdesc is the file-descriptor filesystem, ok?
% df -T
Filesystem Type 1k-blocks Used Available Use% Mounted on
/dev/disk2s9 hfs 7326256 2126252 5200004 30% /
devfs devfs 1 1 0 100% /dev
fdesc fdesc 1 1 0 100% /dev
<volfs> volfs 512 512 0 100% /.vol
The file-descriptor file system provides access to the per-process file descriptor namespace in the global filesystem namespace.
take a look at
% ls -l /dev
total 0
crw------- 1 root wheel 7, 0 Jan 26 09:09 bpf0
crw------- 1 root wheel 7, 1 Jan 26 09:04 bpf1
crw------- 1 root wheel 7, 2 Jan 26 09:04 bpf2
crw------- 1 root wheel 7, 3 Jan 26 09:04 bpf3
crw------- 1 merv staff 0, 0 Jan 26 15:33 console
brw-r----- 1 root operator 14, 0 Jan 26 09:04 disk0
br--r----- 1 root operator 14, 3 Jan 26 09:04 disk0s1
brw-r----- 1 root operator 14, 4 Jan 26 09:04 disk0s2
...
most everything in unix is a file of some type or another
in short, fdesc is a filesystem branch for the standard system devices like, pseudo-devices, stderr, stdout, stdin, tty, sockets, named pipes, etc.
it mounts to /dev which is the internal representation of a bucket of various devices that we refer to by more common names.
that there are disk slices in there too, is reflected by the devfs filesystem, i believe, which is mounted at the same mount point, /dev
if you're interested, see about named pipes, sockets, block devices, character devices
.e.g,
% apropos pipe
mkfifo(1) - make FIFOs (named pipes)
IO::Pipe(3), s-1IO:s0:Pipe(3) - supply object methods for pipes
perlipc(1) - Perl interprocess communication (signals, fifos, pipes, ...
pipe(2) - create descriptor pair for interprocess communication
tee(1) - pipe fitting
Craig R. Arko
01-26-2002, 02:48 PM
Merv: can you explain the terminology a bit more for the benefit of the newcomers to UNIX? For example, "mount points" and "file descriptor namespaces" are not part of the average Mac user's experience. :D
Aside: if I try to run 'df -T' I get an error saying '-T' isn't a valid argument. Do I need to specify a type with that?
Thanks!
mervTormel
01-26-2002, 03:53 PM
craig, et. al.,
i thought this was a "hints" site.
i greatly admired a college math/compSci professor of mine. he would never answer a question directly. he would, however, ask me questions that would allude to the area of the answer, thus teaching me to dig and think about it.
too often, we all want immediate answers and don't consider the consequences of not having any foundation. i don't apologize for sounding pedantic. But we must endeavor to acquire at least a passing familiarity with the foundation of unix if this is going to mean anything. Keep digging.
i didn't know exactly what fdesc was either, so what did i do to make the post i made?
1. examined the output of the df command. what are the headings? fdesc is under the heading 'filesystem'. i think i know a little bit about what a filesystem is. saw it is mounted at mount point /dev (devfs is also mounted here, which deals more with raw disk devices, i think)
2. examined the contents of /dev, recognized console, tty's, raw disk partitions, mem (physical memory map), kmem (kernel virtual memory map), null, stdin, stdout, stderr. there would also be objects in there for tape drives, pseudo-terminals (q.v.), virtual-terminals, etc. these are namespaces for the interfaces to the various kind of resources the kernel talks to and/or manages.
3. examined the man pages for the df command
mentions filesystem type
google search for 'fdesc'
http://new.omc.net/cgi-bin/man.cgi?section=5&topic=fdesc (q.v.)
found references to per-precess file descriptor namespace and global filesystem namespace and stdxxx and tty and etc.
It's kinda complex and you don't need to know _all_ about it, but when someone suddenly can't write to
/dev/null
you can examine it to see that the new junior admin discovered it was writable by all and thought it was a security problem and chmod'd it to go= (disabled all group and other access) *sigh*
a mount point is merely the user visible representation of where a filesystem object is placed in the filesystem, ususally a disk partition, mounted at some rooted namespace, that is, mount grafts a disk partition on to the filesystem tree at the position 'mount point'.
re: the -T switch, i run the fink implementation of df
% which df
/sw/bin/df
which supports the -T option
hope this helps, or at least, doesn't hurt too much
Craig R. Arko
01-26-2002, 04:17 PM
Originally posted by mervTormel
craig, et. al.,
i thought this was a "hints" site.
Point taken. :cool:
vertigo
02-23-2002, 02:36 PM
Originally posted by mervTormel
craig, et. al.,
i thought this was a "hints" site.
I think the only difference is that this was posted to the UNIX - Newcomers forum. I think giving too Socratic an answer can just lead to UNIX newbies passing on the information all together.
I would hesitate to guess that in this forum it would be best to give plain english answers and then clue the poster in to how he can find out similar answers themselves (teach a man to fish, and all that...). I would not expect the same kind of hand-holding in any of the other forums.
That's my $0.02 on the matter, feel free to tell me if you think I'm way off base on this.
rusto
02-23-2002, 03:49 PM
I would add that though many in the UNIX world may reflexively chime, "RTFM", this IS Mac OS X Hints, which would hopefully bring with it the Mac community's traditional leanings towards helping each other out.
Not everyone posting a query here has the time nor the inclination to ferret out solutions based on "hints", sometimes they really just need the answer so they can get on with whatever they were trying to do in the first place.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.