No subject


Mon Jul 5 14:03:39 CEST 2010


static struct devfs_entry *_devfs_get_root_entry (void)
{
[...]
    if ( ( new = _devfs_alloc_entry (".devfsd", 0, S_IFCHR |S_IRUSR
|S_IWUSR) )
	 == NULL ) return NULL;
[...]
}

static struct super_block *devfs_read_super (struct super_block *sb,
					     void *data, int silent)
{
    struct inode *root_inode = NULL;

    if (_devfs_get_root_entry () == NULL) goto out_no_root;
[...]
}

static DECLARE_FSTYPE (devfs_fs_type, DEVFS_NAME, devfs_read_super,
FS_SINGLE);

Also, devfsd opens it and keeps it open:
# lsof /dev/.devfsd
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
devfsd  3704 root    3r   CHR    8,0         2 /dev/.devfsd

The only problem in my code is that it only works if devfs is mounted on
/dev (or /dev is a symlink to the mountpoint).
Furthermore, all programs hardcore /dev so it's not very useful to mount
devfs elsewhere (the only reason to do that is to test it before
switching to it, and in this case it's better to not detect it).
Also checking /proc/mounts requires a process creation (grep) while test
is as shell builtin. And what if /proc isn't mounted?

In other words, I don't see any advantages in checking /proc/mounts
rather that /dev/.devfsd .


--=-EFarlloCQnYJz5Tj+EwB
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9Bezndjkty3ft5+cRAuxTAJ9gmbAUbYmOoUverh8sG4gh+UofYgCffsqf
NeaBLJttdrqmB3RMiJefiFw=
=a33D
-----END PGP SIGNATURE-----

--=-EFarlloCQnYJz5Tj+EwB--



More information about the MPlayer-dev-eng mailing list