#include <errno.h>
#include <sys/ioctl.h>
+#include "mount-api-utils.h"
+
typedef struct {
const char *name;
int (*fnc)(void);
return 0;
}
+static int hlp_fsopen_ok(void)
+{
+#ifdef FSOPEN_CLOEXEC
+ errno = 0;
+ fsopen(NULL, FSOPEN_CLOEXEC);
+#else
+ errno = ENOSYS;
+#endif
+ printf("%d\n", errno != ENOSYS);
+ return 0;
+}
+
static mntHlpfnc hlps[] =
{
{ "WORDSIZE", hlp_wordsize },
{ "byte-order", hlp_endianness },
{ "wcsspn-ok", hlp_wcsspn_ok },
{ "enotty-ok", hlp_enotty_ok },
+ { "fsopen-ok", hlp_fsopen_ok },
{ NULL, NULL }
};
ts_skip_nonroot
ts_check_losetup
+# unshared session is possible to support only on kernels with new mount API
+if [ "$("$TS_HELPER_SYSINFO" fsopen-ok)" = "0" ]; then
+ prop=$($TS_CMD_FINDMNT --task "$$" -n -o PROPAGATION "/")
+ [[ "$prop" == *"private"* ]] && ts_skip "unsupported session"
+fi
+
ts_device_init
DEVICE=$TS_LODEV