AbstractFuseFS.this.fusePointer = libFuse.fuse_get_context().fuse.get(); if (isImplemented("init")) { return fuse.init(conn);
AbstractFuseFS.this.fusePointer = libFuse.fuse_get_context().fuse.get(); if (isImplemented("init")) { return fuse.init(conn);
@Override @NotImplemented public int read_buf(String path, Pointer bufp, @size_t long size, @off_t long off, FuseFileInfo fi) { // should be implemented or null long vecmem = MemoryIO.getInstance().allocateMemory(Struct.size(new FuseBufvec(Runtime.getSystemRuntime())), false); if (vecmem == 0) { return -ErrorCodes.ENOMEM(); } Pointer src = Pointer.wrap(Runtime.getSystemRuntime(), vecmem); long memAdr = MemoryIO.getInstance().allocateMemory(size, false); if (memAdr == 0) { MemoryIO.getInstance().freeMemory(vecmem); return -ErrorCodes.ENOMEM(); } Pointer mem = Pointer.wrap(Runtime.getSystemRuntime(), memAdr); FuseBufvec buf = FuseBufvec.of(src); FuseBufvec.init(buf, size); buf.buf.mem.set(mem); bufp.putAddress(0, src.address()); int res = read(path, mem, size, off, fi); if (res >= 0) buf.buf.size.set(res); return res; }
/** * Return information about this environment. * * @return an immutable information object. */ public EnvInfo info() { if (closed) { throw new AlreadyClosedException(); } final MDB_envinfo info = new MDB_envinfo(RUNTIME); checkRc(LIB.mdb_env_info(ptr, info)); final long mapAddress; if (info.f0_me_mapaddr.get() == null) { mapAddress = 0; } else { mapAddress = info.f0_me_mapaddr.get().address(); } return new EnvInfo( mapAddress, info.f1_me_mapsize.longValue(), info.f2_me_last_pgno.longValue(), info.f3_me_last_txnid.longValue(), info.f4_me_maxreaders.intValue(), info.f5_me_numreaders.intValue()); }
@Override @NotImplemented public int read_buf(String path, Pointer bufp, @size_t long size, @off_t long off, FuseFileInfo fi) { // should be implemented or null long vecmem = MemoryIO.getInstance().allocateMemory(Struct.size(new FuseBufvec(Runtime.getSystemRuntime())), false); if (vecmem == 0) { return -ErrorCodes.ENOMEM(); } Pointer src = Pointer.wrap(Runtime.getSystemRuntime(), vecmem); long memAdr = MemoryIO.getInstance().allocateMemory(size, false); if (memAdr == 0) { MemoryIO.getInstance().freeMemory(vecmem); return -ErrorCodes.ENOMEM(); } Pointer mem = Pointer.wrap(Runtime.getSystemRuntime(), memAdr); FuseBufvec buf = FuseBufvec.of(src); FuseBufvec.init(buf, size); buf.buf.mem.set(mem); bufp.putAddress(0, src.address()); int res = read(path, mem, size, off, fi); if (res >= 0) buf.buf.size.set(res); return res; }
/** * Return information about this environment. * * @return an immutable information object. */ public EnvInfo info() { if (closed) { throw new AlreadyClosedException(); } final MDB_envinfo info = new MDB_envinfo(RUNTIME); checkRc(LIB.mdb_env_info(ptr, info)); final long mapAddress; if (info.f0_me_mapaddr.get() == null) { mapAddress = 0; } else { mapAddress = info.f0_me_mapaddr.get().address(); } return new EnvInfo( mapAddress, info.f1_me_mapsize.longValue(), info.f2_me_last_pgno.longValue(), info.f3_me_last_txnid.longValue(), info.f4_me_maxreaders.intValue(), info.f5_me_numreaders.intValue()); }
public void setStandardInput(HANDLE standardInput) { this.standardInput.set(standardInput.toPointer()); }
public void setStandardOutput(HANDLE standardOutput) { this.standardOutput.set(standardOutput.toPointer()); }
public void setStandardInput(HANDLE standardInput) { this.standardInput.set(standardInput.toPointer()); }
public HANDLE getProcess() { return new HANDLE(hProcess.get()); }
public HANDLE getThread() { return new HANDLE(hThread.get()); }
/** * Similar to FUSE_BUFVEC_INIT macros */ public static void init(FuseBufvec buf, long size) { buf.count.set(1); buf.idx.set(0); buf.off.set(0); buf.buf.size.set(size); buf.buf.flags.set(0); buf.buf.mem.set(0); buf.buf.fd.set(-1); buf.buf.pos.set(0); } }
public void setStandardOutput(HANDLE standardOutput) { this.standardOutput.set(standardOutput.toPointer()); }
public void setStandardInput(HANDLE standardInput) { this.standardInput.set(standardInput.toPointer()); }
/** * Creates an array of <tt>Pointer</tt> instances. * * @param array the array to store the instances in * @return the array that was passed in */ protected final Pointer[] array(Pointer[] array) { arrayBegin(); for (int i = 0; i < array.length; ++i) { array[i] = new Pointer(); } arrayEnd(); return array; }
public HANDLE getThread() { return new HANDLE(hThread.get()); }
public void setStandardOutput(HANDLE standardOutput) { this.standardOutput.set(standardOutput.toPointer()); }