--- Coro/Coro/State.xs 2005/12/16 01:33:20 1.69 +++ Coro/Coro/State.xs 2005/12/26 19:26:52 1.70 @@ -29,6 +29,7 @@ # endif #endif +#include #include #ifdef HAVE_MMAP @@ -1148,3 +1149,42 @@ CODE: api_cede (); +# and these are hacks +SV * +_aio_get_state () + CODE: +{ + struct { + int errorno; + int laststype; + int laststatval; + Stat_t statcache; + } data; + + data.errorno = errno; + data.laststype = PL_laststype; + data.laststatval = PL_laststatval; + data.statcache = PL_statcache; + + RETVAL = newSVpvn ((char *)&data, sizeof data); +} + OUTPUT: + RETVAL + +void +_aio_set_state (char *data_) + PROTOTYPE: $ + CODE: +{ + struct { + int errorno; + int laststype; + int laststatval; + Stat_t statcache; + } *data = (void *)data_; + + errno = data->errorno; + PL_laststype = data->laststype; + PL_laststatval = data->laststatval; + PL_statcache = data->statcache; +}