Skip to content

Commit 42611bf

Browse files
committed
Add nqp::x_posixerrno
1 parent 39d7d37 commit 42611bf

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/QAST/Operations.nqp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,7 @@ QAST::Operations.add_core_pirop_mapping('tonum_I', 'nqp_bigint_to_num', 'NP', :i
17401740
QAST::Operations.add_core_pirop_mapping('buildnativecall', 'nqp_native_call_build', 'vPsssPP');
17411741
QAST::Operations.add_core_pirop_mapping('nativecall', 'nqp_native_call', 'PPPP');
17421742
QAST::Operations.add_core_pirop_mapping('nativecallrefresh', 'nqp_native_call_wb', 'vP');
1743+
QAST::Operations.add_core_pirop_mapping('x_posixerrno', 'nqp_posixerrno', 'I');
17431744

17441745
# boolean opcodes
17451746
QAST::Operations.add_core_pirop_mapping('not_i', 'not', 'Ii', :inlinable(1));

src/ops/nqp.ops

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
BEGIN_OPS_PREAMBLE
22

3+
#include <errno.h>
4+
35
/* Parroty includes. */
46
#include "parrot/parrot.h"
57
#include "parrot/extend.h"
@@ -2906,6 +2908,19 @@ inline op nqp_fresh_stub(out PMC, invar PMC) :base_core {
29062908

29072909
/*
29082910

2911+
=item nqp_posixerrno
2912+
2913+
Returns the value of errno.
2914+
2915+
=cut
2916+
2917+
*/
2918+
inline op nqp_posixerrno(out INT) :base_core {
2919+
$1 = errno;
2920+
}
2921+
2922+
/*
2923+
29092924
=item captureposprimspec
29102925

29112926
Takes a CallContext in $2 and an index in $3, and returns the primitive

0 commit comments

Comments
 (0)