in reply to Re^2: call_pv on CORE:: sub from XS
in thread call_pv on CORE:: sub from XS

Yes, also tried this. No success: "Undefined subroutine &main::socketpair called"

Well then, something you're leaving out :)

As http://perl5.git.perl.org/perl.git/blob/a35ef416833511da752c4b5b836b7a8915712aab:/XSUB.h#l609 defines socketpair, so try just calling socketpair() (or my_socketpair() ) instead of call_pv-ing it

Or try call-pv-ing notxs :)

sub notxs { my $Rdr; my $Wt; use Socket; socketpair($Rdr, $Wtr, AF_UNIX, SOCK_STREAM, PF_UNSPEC); return $Rdr, $Wtr; }

Replies are listed 'Best First'.
Re^4: call_pv on CORE:: sub from XS
by OlegG (Monk) on Sep 20, 2014 at 09:27 UTC
    Ok, then just calling socketpair() looks good for me.
    One problem is that after this my XS function should return perl handle to the user, so he can call syswrite() on it. What I can't understand now is how to turn fd returned by socketpair() into GLOB from XS code. Any suggestions?
      My suggestion is to do it in perl code cause xs code is ucky :)
        Thanks. This is a good alternative. So, I'll choose this way for now.