Closed jmckaskill closed 12 years ago
lua: unable to convert argument 2 from cdata<int> to cdata<int64_t>
stack traceback:
[C]: in function 'open'
./io/syscall.lua:2388: in function 'open'
Minimal test case (I wrote ljsyscall, happy to get it to work with luaffi)
local ffi = require "ffi"
local C = ffi.C
ffi.cdef[[
typedef uint32_t mode_t;
int open(const char *pathname, int flags, mode_t mode);
]]
local int_t = ffi.typeof("int")
assert(ffi.C.open("/tmp/file/does/not/exist", int_t(1), 0))
note I fixed this issue in ljsyscall, although it seems to be a bug. Working on other issues.
Ah I see what's happening. I was wondering how he had managed to create a cdata
lua: unable to convert argument 2 from cdata to cdata