They are similar to our getfhat(2) and fhopen(2) syscalls.
Details
Details
Using the t_name_to_handle_at and t_open_by_handle_at helpers provided in the Linux manual page:
bash-4.2# echo "hello" > test.txt bash-4.2# /opt/name_to_handle/t_name_to_handle_at test.txt > fh bash-4.2# /opt/name_to_handle/t_open_by_handle_at /dev/null < fh Read 6 bytes bash-4.2# stat --printf="%i\n" test.txt 2731679 bash-4.2# rm test.txt bash-4.2# echo "hello" > test.txt bash-4.2# stat --printf="%i\n" test.txt 2731680 bash-4.2# /opt/name_to_handle/t_open_by_handle_at /dev/null < fh open_by_handle_at: Stale file handle
So, that basic functionality seems to work as expected.
Note that the explicit /dev/null is provided to prevent t_open_by_handle_at from grubbing around in /proc/self/mountinfo for a matching mount_id, which is not something we provide in linprocfs yet. And our open_by_handle_at does not care about the mountfd, so any old fd works. Linux programs obviously can't rely on that property, so at some point we would need to implement mountinfo to better support these syscalls.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable