// Path: core/src/main/java/se/tfiskgul/mux2fs/Constants.java
// public static final int BUG = -ErrorCodes.ENOSYS();


import jnr.ffi.Pointer;
import jnr.ffi.types.off_t;
import jnr.ffi.types.size_t;
import ru.serce.jnrfuse.FuseFillDir;
import ru.serce.jnrfuse.FuseStubFS;
import ru.serce.jnrfuse.struct.FileStat;
import ru.serce.jnrfuse.struct.FuseFileInfo;
import static se.tfiskgul.mux2fs.Constants.BUG;
import java.nio.file.Path;
import java.util.function.Supplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
	@Override
	public int open(String path, FuseFileInfo fi) {
		return wrap(() -> delegate.open(path, fi));
	}

	@Override
	public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
		return wrap(() -> delegate.read(path, buf, size, offset, fi));
	}

	@Override
	public int release(String path, FuseFileInfo fi) {
		return wrap(() -> delegate.release(path, fi));
	}

	@Override
	public void umount() {
		super.umount();
	}

	@Override
	public void destroy(Pointer initResult) {
		wrap(() -> delegate.destroy(initResult));
	}

	private int wrap(Supplier<Integer> supplier) {
		try {
			return supplier.get();
		} catch (Throwable e) {
			logger.error("BUG: Uncaught exception!", e);
// Path: core/src/main/java/se/tfiskgul/mux2fs/Constants.java
// public static final int BUG = -ErrorCodes.ENOSYS();


// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/jnrfuse/FileSystemSafetyWrapper.java
import jnr.ffi.Pointer;
import jnr.ffi.types.off_t;
import jnr.ffi.types.size_t;
import ru.serce.jnrfuse.FuseFillDir;
import ru.serce.jnrfuse.FuseStubFS;
import ru.serce.jnrfuse.struct.FileStat;
import ru.serce.jnrfuse.struct.FuseFileInfo;
import static se.tfiskgul.mux2fs.Constants.BUG;
import java.nio.file.Path;
import java.util.function.Supplier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

	@Override
	public int open(String path, FuseFileInfo fi) {
		return wrap(() -> delegate.open(path, fi));
	}

	@Override
	public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
		return wrap(() -> delegate.read(path, buf, size, offset, fi));
	}

	@Override
	public int release(String path, FuseFileInfo fi) {
		return wrap(() -> delegate.release(path, fi));
	}

	@Override
	public void umount() {
		super.umount();
	}

	@Override
	public void destroy(Pointer initResult) {
		wrap(() -> delegate.destroy(initResult));
	}

	private int wrap(Supplier<Integer> supplier) {
		try {
			return supplier.get();
		} catch (Throwable e) {
			logger.error("BUG: Uncaught exception!", e);
			return BUG;