>So I'm wondering, is there a way, kind of like "relink" system call which
>coule take existing file descriptor (they are still so the fd is there,
>just unlinked) and link it back to file name?
POSIX' fattach(int fd, const char *path) library call does that,
although it's often limited to STREAMS fd:s. It's usually
implemented as mounting "namefs" at the path (SVR4) or setting
a magic mount option (OSF1), with the fd passed in as mount-point
specific data. Regular users are allowed to do this special mount().
Linux currently doesn't have this functionality, but it could
probably be implemented as a pseudo-fs in 2.4, assuming the 2.4
VFS properly supports stacking of file systems. (There's some
gotchas concerning chown/chmod changes and restoring the original
object after the fd is unmounted.)
Not that I think Linux really needs this creeping featurism ...
/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/