vfs: add FILE* stream support to the VFS abstraction layer

Add vfs_fopen callback in struct ul_vfs_ops for callers who want
full control over stream creation.

Add ul_vfs_fdopen() that wraps an existing fd into a FILE* using
fopencookie() with VFS callbacks, or falls back to fdopen().

Add ul_vfs_fopen() that tries vfs_fopen first, then opens via
vfs_open and wraps with fopencookie, then falls back to fopen().

The fopencookie path is gated on __GLIBC__. On non-glibc systems,
ul_vfs_fdopen() falls back to plain fdopen().

Addresses: https://github.com/util-linux/util-linux/issues/4308
Signed-off-by: Karel Zak <kzak@redhat.com>
2 files changed