Hi all-<br><br>I'm a bit of a ffi beginner, and I'm trying to set up a call to getaddrinfo, as defined by sys/types.h in C.<br><br>;;I've modeled the call:<br>(cffi:defcfun ("getaddrinfo" get-addr-info) :int (hostname :string)(port :string)(addrinfo :pointer) (results :pointer))<br>
<br><br>;;and set up the structs:<br>(cffi:defcstruct addrinfo (ai-flags :int) <br>         (ai-family :int) (ai-socktype :int) (ai-protocol :int)(ai-addresslength :int) (socket-address sockaddr) <br>         (ai-canonname :string) (addrinfo-next :pointer))<br>
<br>;;and the enums<br>(cffi:defcenum ai-family (:AF_UNSPEC 0) (:AF_INET 2) (:AF_INET6 30))<br>(cffi:defcenum socktype (:SOCK_STREAM 1))<br>(cffi:defcenum ai-flags (:AI_PASSIVE 1))<br><br><br>but when I do the call (getaddrinfo "localhost" "80" ai test-pointer) it isn't resolving.  One thing I haven't done is to call load-foreign-library(like I've done with non system calls) to set it up the framework. <br>
<br>Do I have to do this for system calls?  If so, what do I pass to load-foreign-library to get it to resolve the correct framework or shared lib(on os x or linux)? <br>thanks for helping,<br>Mike<br>