2017.10.11 01:15 AM
K shmemex_mman_mmap__q(K _x1,K _x2,K _x3,K _x4,K _x5,K _x6){
K __st[1]; int __stc=0; K __v=(K)1;
void* _c_res; J _vc_j1; I _vc_i2; I _vc_i3; I _vc_i4; J _vc_j5; J _vc_j6; _Bool _vc_bool1; __v=__K2j_cast(&_vc_j1,r1(_x6)); if(0==__v) goto __return; r0(__v); // `c.j$<val>
__v=__K2i_cast(&_vc_i2,r1(_x5)); if(0==__v) goto __return; r0(__v); // `c.i$<val>
__v=__K2i_cast(&_vc_i3,r1(_x4)); if(0==__v) goto __return; r0(__v); // `c.i$<val>
__v=__K2i_cast(&_vc_i4,r1(_x3)); if(0==__v) goto __return; r0(__v); // `c.i$<val>
__v=__K2j_cast(&_vc_j5,r1(_x2)); if(0==__v) goto __return; r0(__v); // `c.j$<val>
__v=__K2j_cast(&_vc_j6,r1(_x1)); if(0==__v) goto __return; r0(__v); // `c.j$<val>
_c_res=mmap((void*)(shmemexc_ij)_vc_j6,(size_t)_vc_j5,_vc_i4,_vc_i3,_vc_i2,(off_t)_vc_j1); // mmap[<val>;<val>;_vc_i4;_vc_i3;_vc_i2;<val>]
// c.res[()]::<val> - no rval, global // end of statement
_vc_bool1=-1LL==(shmemexc_ij)_c_res; // =[-1LL;<val>]
if(0==_vc_bool1) goto __l2; // if/while check condition
__v=ki(errno); if(0==__v) goto __return; // C.toK[C.errno]
__v=shmemex_string_strerror__q(__v); if(0==__v) goto __return; // .string.strerror[<val>]
__v=kdot(r1(__consts[51]),knk(2,r1(__consts[127]),__v)); if(0==__v) goto __return; // ,["mmap: ";<val>]
__st[__stc++]=__v; if(__v->t==-KS) __v=krr(__v->s); else if(__v->t==KC) __v=krr(sn(kC(__v),__v->n)); else __v=krr("stype"); goto __return; // raise an exception
r0(__v);
// end of statement __l2:
__v=kj((shmemexc_ij)_c_res); if(0==__v) goto __return; // C.toK[<val>]
__v=__enlist(knk(2,__v,r1(_x2))); if(0==__v) goto __return; // enlist[<val>;x2]
goto __return; // return cmd __return:
r0(_x1); r0(_x2); r0(_x3); r0(_x4); r0(_x5); r0(_x6);
while(__stc>0) r0(__st[--__stc]);
return __v;
};
2017.10.11 07:52 AM
2017.10.11 10:28 AM
2017.10.11 01:06 PM
2017.10.11 02:34 PM
Bindings to llvm and translation to IR require a lot of work and as I couldn't find a useful usecase I didn't do anything yet.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.