Gamin
Encyclopedia
Gamin is a monitoring system for file
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

s and directories
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 that independently implements a subset of FAM, the File Alteration Monitor
File alteration monitor
In computing, the File Alteration Monitor, also known as FAM and sgi_fam, provides a subsystem developed by Silicon Graphics for Unix-like operating systems. The FAM subsystem allows applications to watch certain files and be notified when they are modified...

. Running as a service, it allows for the detection of modifications to a file or directory. gam_server functions as a daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 for Gamin.

Origins

The word gamin in French (where it also has a female form gamine
Gamine
Gamine is a French word, the feminine form of gamin, originally meaning urchin, waif or playful, naughty child.The word was used in English from about the mid-19th century , but, in the 20th century, came to be applied in its more modern sense of a slim, often boyish, wide-eyed young woman who...

) refers to a boy, especially an abandoned and homeless boy who roams the streets; an urchin. The Gamin project built on an earlier project called Marmot
(which in French means "child" or "brat").

How it works

Under Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, Gamin uses inotify
Inotify
inotify is a Linux kernel subsystem that acts to extend filesystems to notice changes to the filesystem, and report those changes to applications. It replaces an earlier facility, dnotify, which had similar goals....

 or dnotify
Dnotify
dnotify is a file system event monitor for the Linux kernel, one of the subfeatures of the fcntl call. It was introduced in the 2.4 kernel series...

 to monitor filesystem activity. Under FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

, Gamin uses kqueue
Kqueue
Kqueue is a scalable event notification interface introduced in FreeBSD 4.1, also supported in NetBSD, OpenBSD, DragonflyBSD, and Mac OS X. It's the foundation of Apple's Grand Central Dispatch....

/kevent as the native FreeBSD kernel event notification mechanism, but in this case kqueue has one major drawback as compared to inotify: inotify is the filename-based monitoring facility and kqueue uses file descriptor
File descriptor
In computer programming, a file descriptor is an abstract indicator for accessing a file. The term is generally used in POSIX operating systems...

s for identification of monitored files, so, under FreeBSD, gam_server has to open each file in the monitored directory. This can be an issue when monitoring directories with many files stored, because system could easily reach its kernel limits on maximum file descriptor count (kern.maxfiles and kern.maxfilesperproc).
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK