Nevermind-the malfunction was all mine.

On Fri, Aug 21, 2009 at 12:33 AM, Michael Kohout <mwkoh...@gmail.com> wrote:

> Hi all-
>
> 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.
>
> ;;I've modeled the call:
> (cffi:defcfun ("getaddrinfo" get-addr-info) :int (hostname :string)(port
> :string)(addrinfo :pointer) (results :pointer))
>
>
> ;;and set up the structs:
> (cffi:defcstruct addrinfo (ai-flags :int)
>          (ai-family :int) (ai-socktype :int) (ai-protocol
> :int)(ai-addresslength :int) (socket-address sockaddr)
>          (ai-canonname :string) (addrinfo-next :pointer))
>
> ;;and the enums
> (cffi:defcenum ai-family (:AF_UNSPEC 0) (:AF_INET 2) (:AF_INET6 30))
> (cffi:defcenum socktype (:SOCK_STREAM 1))
> (cffi:defcenum ai-flags (:AI_PASSIVE 1))
>
>
> 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.
>
> 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)?
> thanks for helping,
> Mike
>
_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to