Permalink
Browse files

Add nqp::x_posixerrno

  • Loading branch information...
1 parent 39d7d37 commit 42611bf0d18e5b1b39851a42dd760accdba9c68a @hoelzro hoelzro committed Mar 17, 2013
Showing with 16 additions and 0 deletions.
  1. +1 −0 src/QAST/Operations.nqp
  2. +15 −0 src/ops/nqp.ops
View
1 src/QAST/Operations.nqp
@@ -1740,6 +1740,7 @@ QAST::Operations.add_core_pirop_mapping('tonum_I', 'nqp_bigint_to_num', 'NP', :i
QAST::Operations.add_core_pirop_mapping('buildnativecall', 'nqp_native_call_build', 'vPsssPP');
QAST::Operations.add_core_pirop_mapping('nativecall', 'nqp_native_call', 'PPPP');
QAST::Operations.add_core_pirop_mapping('nativecallrefresh', 'nqp_native_call_wb', 'vP');
+QAST::Operations.add_core_pirop_mapping('x_posixerrno', 'nqp_posixerrno', 'I');
# boolean opcodes
QAST::Operations.add_core_pirop_mapping('not_i', 'not', 'Ii', :inlinable(1));
View
15 src/ops/nqp.ops
@@ -1,5 +1,7 @@
BEGIN_OPS_PREAMBLE
+#include <errno.h>
+
/* Parroty includes. */
#include "parrot/parrot.h"
#include "parrot/extend.h"
@@ -2906,6 +2908,19 @@ inline op nqp_fresh_stub(out PMC, invar PMC) :base_core {
/*
+=item nqp_posixerrno
+
+Returns the value of errno.
+
+=cut
+
+*/
+inline op nqp_posixerrno(out INT) :base_core {
+ $1 = errno;
+}
+
+/*
+
=item captureposprimspec
Takes a CallContext in $2 and an index in $3, and returns the primitive

0 comments on commit 42611bf

Please sign in to comment.