tools/helpers: Introduce cmp-fd-file-inode utility
Quoted 8 lines · Jason Andryuk
Quoted 8 lines
On Wed, Feb 26, 2020 at 10:48 AM Ian Jackson <[email protected]> wrote:
Jason Andryuk writes ("[PATCH 1/2]tools/helpers: Introduce cmp-fd-file-inode utility"):Quoted 5 lines
This is a C implementation of the perl code inside of
locking.shto check that the locked file descriptor and lock file share the same inode and therefore match. One change from the perl version is replacing printing "y" on success with exit values of 0 (shell True) and 1 (shell False).
Quoted 5 lines
Quoted 5 lines
Maybe it would be better to use stat(1) ? On Linux
stat -L -c%D.%i/dev/stdinblah.lock
or some such, and then compare the two numbers.
I'm reluctant to host a general-purpose shell utility in xen.git, no matter how useful...
We've used this downstream in OpenXT to avoid pulling in the general-purpose Perl runtime, which is..larger than this special-purpose utility. This shell utility was developed for this specific use case in Xen.
Rich
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel