On Fri, May 15, 2009 at 1:03 AM, Mohamed Lrhazi <[email protected]> wrote:
>
> I tried first with commented version, then the uncommented:
>
> cdef extern from "sys/uio.h":
>    # ctypedef struct iovec "struct iovec":
>      # void *iov_base
>      # size_t iov_len
>    cdef struct iovec:
>        void *iov_base
>        size_t iov_len
>
>
> With the first, it fails whenever iovecs are declared,  like this:
>
> uint32_t max_pending_trans
> char *traffic_class
> struct iovec *req_hdrs
>                    ^

But if you use the first, commented version, then do not use "struct
iovec *req_hdrs", just "iovec *req_hdrs" !!


>
> With the second, it compiles, but then my program sigfaults. I should
> add that it never sigfaults if I only have one value in the passed in
> array of structs, only if there are more.
>

In your original code, when you fill

hdr_names[ii].iov_base = <char*>hdr_n
hdr_names[ii].iov_len = len(hdr_n)

What exactly is "hdr_n"? A Python string? Where "hdr_n" comes from?
The iovec entries in hdr_names are supposed to be readonly? Or are you
trying to receive data on them?



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to