From: Daniel Berger Date: 2009-08-09T12:19:26+09:00 Subject: FFI, getutxent question Hi According to the man page, the prototypes for getutxent(), setutxent() and endutxent() are as follows: void endutxent(void); struct utmpx * getutxent(void); void setutxent(void); So, I declared them like so: require 'ffi' class Info extend FFI::Library attach_function :setutxent, [], :void attach_function :getutxent, [], :pointer attach_function :endutxent, [], :void def self.getstuff begin setutxent() p getutxent() # NULL Pointer ??? ensure endutxent() end end end Info.getstuff # Null Pointer object However, the call to getutxent() returns a NULL pointer. I'm guessing I have to tell it what kind of pointer to return, but I wasn't sure how to do that. How do I do that? Regards, Dan