This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
portability fix for IO::File and FileHandle
[perl5.git] / opcode.pl
CommitLineData
79072805
LW
1#!/usr/bin/perl
2
36477c24 3unlink "opcode.h";
79072805
LW
4open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
5select OC;
6
7# Read data.
8
9while (<DATA>) {
10 chop;
11 next unless $_;
12 next if /^#/;
c07a80fd
PP
13 ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5);
14
15 warn qq[Description "$desc" duplicates $seen{$desc}\n] if $seen{$desc};
16 die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key};
17 $seen{$desc} = qq[description of opcode "$key"];
18 $seen{$key} = qq[opcode "$key"];
19
79072805 20 push(@ops, $key);
c07a80fd 21 $desc{$key} = $desc;
79072805
LW
22 $check{$key} = $check;
23 $ckname{$check}++;
24 $flags{$key} = $flags;
25 $args{$key} = $args;
26}
27
28# Emit defines.
29
30$i = 0;
748a9306 31print <<"END";
864dbfa3
GS
32#define Perl_pp_i_preinc Perl_pp_preinc
33#define Perl_pp_i_predec Perl_pp_predec
34#define Perl_pp_i_postinc Perl_pp_postinc
35#define Perl_pp_i_postdec Perl_pp_postdec
748a9306
LW
36
37typedef enum {
38END
79072805
LW
39for (@ops) {
40 print "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
41}
85e6fe83 42print "\t", &tab(3,"OP_max"), "\n";
79072805
LW
43print "} opcode;\n";
44print "\n#define MAXO ", scalar @ops, "\n\n";
45
c07a80fd 46# Emit op names and descriptions.
79072805
LW
47
48print <<END;
73c4f7a1
GS
49
50START_EXTERN_C
51
79072805 52#ifndef DOINIT
22c35a8c 53EXT char *PL_op_name[];
79072805 54#else
22c35a8c 55EXT char *PL_op_name[] = {
79072805
LW
56END
57
58for (@ops) {
c07a80fd
PP
59 print qq(\t"$_",\n);
60}
61
62print <<END;
63};
64#endif
65
66END
67
68print <<END;
69#ifndef DOINIT
22c35a8c 70EXT char *PL_op_desc[];
c07a80fd 71#else
22c35a8c 72EXT char *PL_op_desc[] = {
c07a80fd
PP
73END
74
75for (@ops) {
76 print qq(\t"$desc{$_}",\n);
79072805
LW
77}
78
79print <<END;
80};
81#endif
82
73c4f7a1
GS
83END_EXTERN_C
84
22c35a8c 85END
79072805 86
22c35a8c 87# Emit function declarations.
79072805 88
22c35a8c 89#for (sort keys %ckname) {
cea2e8a9 90# print "OP *\t", &tab(3,$_),"(pTHX_ OP* o);\n";
22c35a8c
GS
91#}
92#
93#print "\n";
94#
95#for (@ops) {
cea2e8a9 96# print "OP *\t", &tab(3, "pp_$_"), "(pTHX);\n";
22c35a8c 97#}
79072805
LW
98
99# Emit ppcode switch array.
100
101print <<END;
102
73c4f7a1
GS
103START_EXTERN_C
104
79072805 105#ifndef DOINIT
cea2e8a9 106EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX);
79072805 107#else
cea2e8a9 108EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = {
79072805
LW
109END
110
111for (@ops) {
864dbfa3 112 print "\tPerl_pp_$_,\n";
79072805
LW
113}
114
115print <<END;
116};
117#endif
118
119END
120
121# Emit check routines.
122
123print <<END;
124#ifndef DOINIT
cea2e8a9 125EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op);
79072805 126#else
cea2e8a9 127EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
79072805
LW
128END
129
130for (@ops) {
864dbfa3 131 print "\t", &tab(3, "Perl_$check{$_},"), "/* $_ */\n";
79072805
LW
132}
133
134print <<END;
135};
136#endif
137
138END
139
140# Emit allowed argument types.
141
142print <<END;
143#ifndef DOINIT
22c35a8c 144EXT U32 PL_opargs[];
79072805 145#else
22c35a8c 146EXT U32 PL_opargs[] = {
79072805
LW
147END
148
149%argnum = (
150 S, 1, # scalar
151 L, 2, # list
152 A, 3, # array value
153 H, 4, # hash value
154 C, 5, # code value
155 F, 6, # file value
156 R, 7, # scalar reference
157);
158
db173bac
MB
159%opclass = (
160 '0', 0, # baseop
161 '1', 1, # unop
162 '2', 2, # binop
163 '|', 3, # logop
164 '?', 4, # condop
165 '@', 5, # listop
166 '/', 6, # pmop
167 '$', 7, # svop
168 '*', 8, # gvop
293d3ffa 169 '"', 9, # pvop_or_svop
db173bac
MB
170 '{', 10, # loop
171 ';', 11, # cop
172 '%', 12, # baseop_or_unop
173 '-', 13, # filestatop
174 '}', 14, # loopexop
175);
176
79072805
LW
177for (@ops) {
178 $argsum = 0;
179 $flags = $flags{$_};
180 $argsum |= 1 if $flags =~ /m/; # needs stack mark
181 $argsum |= 2 if $flags =~ /f/; # fold constants
182 $argsum |= 4 if $flags =~ /s/; # always produces scalar
183 $argsum |= 8 if $flags =~ /t/; # needs target scalar
184 $argsum |= 16 if $flags =~ /i/; # always produces integer
185 $argsum |= 32 if $flags =~ /I/; # has corresponding int op
186 $argsum |= 64 if $flags =~ /d/; # danger, unknown side effects
a0d0e21e 187 $argsum |= 128 if $flags =~ /u/; # defaults to $_
db173bac 188
8be7d673 189 $flags =~ /([\W\d_])/ or die qq[Opcode "$_" has no class indicator];
db173bac
MB
190 $argsum |= $opclass{$1} << 8;
191 $mul = 4096; # 2 ^ OASHIFT
79072805
LW
192 for $arg (split(' ',$args{$_})) {
193 $argnum = ($arg =~ s/\?//) ? 8 : 0;
194 $argnum += $argnum{$arg};
195 $argsum += $argnum * $mul;
196 $mul <<= 4;
197 }
198 $argsum = sprintf("0x%08x", $argsum);
db173bac 199 print "\t", &tab(3, "$argsum,"), "/* $_ */\n";
79072805
LW
200}
201
202print <<END;
203};
204#endif
73c4f7a1
GS
205
206END_EXTERN_C
79072805
LW
207END
208
735e0d5c
IZ
209close OC or die "Error closing opcode.h: $!";
210
2cd61cdb 211unlink "pp_proto.h";
22c35a8c 212unlink "pp.sym";
735e0d5c 213open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
22c35a8c
GS
214open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
215
216for (sort keys %ckname) {
864dbfa3
GS
217 print PP "PERL_CKDEF(Perl_$_)\n";
218 print PPSYM "Perl_$_\n";
20ce7b12 219#OP *\t", &tab(3,$_),"(OP* o);\n";
22c35a8c
GS
220}
221
222print PP "\n\n";
223
735e0d5c 224for (@ops) {
15e52e56 225 next if /^i_(pre|post)(inc|dec)$/;
864dbfa3
GS
226 print PP "PERL_PPDEF(Perl_pp_$_)\n";
227 print PPSYM "Perl_pp_$_\n";
735e0d5c
IZ
228}
229
230close PP or die "Error closing pp_proto.h: $!";
22c35a8c 231close PPSYM or die "Error closing pp.sym: $!";
735e0d5c 232
79072805
LW
233###########################################################################
234sub tab {
235 local($l, $t) = @_;
236 $t .= "\t" x ($l - (length($t) + 1) / 8);
237 $t;
238}
239###########################################################################
240__END__
241
242# Nothing.
243
244null null operation ck_null 0
93a17b20 245stub stub ck_null 0
db173bac 246scalar scalar ck_fun s% S
79072805
LW
247
248# Pushy stuff.
249
db173bac
MB
250pushmark pushmark ck_null s0
251wantarray wantarray ck_null is0
79072805 252
db173bac 253const constant item ck_svconst s$
79072805 254
db173bac
MB
255gvsv scalar variable ck_null ds*
256gv glob value ck_null ds*
257gelem glob elem ck_null d2 S S
258padsv private variable ck_null ds0
259padav private array ck_null d0
260padhv private hash ck_null d0
261padany private something ck_null d0
79072805 262
1167e5da 263pushre push regexp ck_null d/
79072805
LW
264
265# References and stuff.
266
db173bac
MB
267rv2gv ref-to-glob cast ck_rvconst ds1
268rv2sv scalar deref ck_rvconst ds1
269av2arylen array length ck_null is1
270rv2cv subroutine deref ck_rvconst d1
271anoncode anonymous subroutine ck_anoncode $
272prototype subroutine prototype ck_null s% S
5d11ae5e 273refgen reference constructor ck_spair m1 L
dfa0f641 274srefgen single ref constructor ck_null fs1 S
db173bac
MB
275ref reference-type operator ck_fun stu% S?
276bless bless ck_fun s@ S S?
79072805
LW
277
278# Pushy I/O.
279
db173bac 280backtick backticks ck_null t%
0a753a76 281# glob defaults its first arg to $_
db173bac
MB
282glob glob ck_glob t@ S? S?
283readline <HANDLE> ck_null t%
284rcatline append I/O operator ck_null t%
79072805
LW
285
286# Bindable operators.
287
db173bac 288regcmaybe regexp comp once ck_fun s1 S
2cd61cdb 289regcreset regexp reset interpolation flag ck_fun s1 S
db173bac
MB
290regcomp regexp compilation ck_null s| S
291match pattern match ck_match d/
90be192f 292qr pattern quote ck_match s/
db173bac
MB
293subst substitution ck_null dis/ S
294substcont substitution cont ck_null dis|
295trans character translation ck_null is" S
79072805
LW
296
297# Lvalue operators.
db173bac
MB
298# sassign is special-cased for op class
299
300sassign scalar assignment ck_null s0
301aassign list assignment ck_null t2 L L
302
303chop chop ck_spair mts% L
304schop scalar chop ck_null stu% S?
305chomp safe chop ck_spair mts% L
306schomp scalar safe chop ck_null stu% S?
69794302 307defined defined operator ck_defined isu% S?
db173bac
MB
308undef undef operator ck_lfun s% S?
309study study ck_fun su% S?
310pos match position ck_lfun stu% S?
311
312preinc preincrement ck_lfun dIs1 S
313i_preinc integer preincrement ck_lfun dis1 S
314predec predecrement ck_lfun dIs1 S
315i_predec integer predecrement ck_lfun dis1 S
316postinc postincrement ck_lfun dIst1 S
317i_postinc integer postincrement ck_lfun dist1 S
318postdec postdecrement ck_lfun dIst1 S
319i_postdec integer postdecrement ck_lfun dist1 S
79072805
LW
320
321# Ordinary operators.
322
db173bac
MB
323pow exponentiation ck_null fst2 S S
324
325multiply multiplication ck_null Ifst2 S S
326i_multiply integer multiplication ck_null ifst2 S S
327divide division ck_null Ifst2 S S
328i_divide integer division ck_null ifst2 S S
329modulo modulus ck_null Iifst2 S S
330i_modulo integer modulus ck_null ifst2 S S
331repeat repeat ck_repeat mt2 L S
332
333add addition ck_null Ifst2 S S
334i_add integer addition ck_null ifst2 S S
335subtract subtraction ck_null Ifst2 S S
336i_subtract integer subtraction ck_null ifst2 S S
337concat concatenation ck_concat fst2 S S
338stringify string ck_fun fst@ S
339
340left_shift left bitshift ck_bitop fst2 S S
341right_shift right bitshift ck_bitop fst2 S S
342
343lt numeric lt ck_null Iifs2 S S
344i_lt integer lt ck_null ifs2 S S
345gt numeric gt ck_null Iifs2 S S
346i_gt integer gt ck_null ifs2 S S
347le numeric le ck_null Iifs2 S S
348i_le integer le ck_null ifs2 S S
349ge numeric ge ck_null Iifs2 S S
350i_ge integer ge ck_null ifs2 S S
351eq numeric eq ck_null Iifs2 S S
352i_eq integer eq ck_null ifs2 S S
353ne numeric ne ck_null Iifs2 S S
354i_ne integer ne ck_null ifs2 S S
355ncmp spaceship operator ck_null Iifst2 S S
356i_ncmp integer spaceship ck_null ifst2 S S
357
358slt string lt ck_scmp ifs2 S S
359sgt string gt ck_scmp ifs2 S S
360sle string le ck_scmp ifs2 S S
361sge string ge ck_scmp ifs2 S S
362seq string eq ck_null ifs2 S S
363sne string ne ck_null ifs2 S S
364scmp string comparison ck_scmp ifst2 S S
365
366bit_and bitwise and ck_bitop fst2 S S
367bit_xor bitwise xor ck_bitop fst2 S S
368bit_or bitwise or ck_bitop fst2 S S
369
370negate negate ck_null Ifst1 S
371i_negate integer negate ck_null ifst1 S
372not not ck_null ifs1 S
373complement 1's complement ck_bitop fst1 S
79072805
LW
374
375# High falutin' math.
376
db173bac
MB
377atan2 atan2 ck_fun fst@ S S
378sin sin ck_fun fstu% S?
379cos cos ck_fun fstu% S?
380rand rand ck_fun st% S?
381srand srand ck_fun s% S?
382exp exp ck_fun fstu% S?
383log log ck_fun fstu% S?
384sqrt sqrt ck_fun fstu% S?
79072805 385
cf26c822
CS
386# Lowbrow math.
387
db173bac
MB
388int int ck_fun fstu% S?
389hex hex ck_fun fstu% S?
390oct oct ck_fun fstu% S?
391abs abs ck_fun fstu% S?
79072805
LW
392
393# String stuff.
394
db173bac 395length length ck_lengthconst istu% S?
7b8d334a 396substr substr ck_fun st@ S S S? S?
db173bac 397vec vec ck_fun ist@ S S S
79072805 398
db173bac
MB
399index index ck_index ist@ S S S?
400rindex rindex ck_index ist@ S S S?
79072805 401
db173bac
MB
402sprintf sprintf ck_fun_locale mfst@ S L
403formline formline ck_fun ms@ S L
404ord ord ck_fun ifstu% S?
405chr chr ck_fun fstu% S?
406crypt crypt ck_fun fst@ S S
407ucfirst upper case first ck_fun_locale fstu% S?
408lcfirst lower case first ck_fun_locale fstu% S?
409uc upper case ck_fun_locale fstu% S?
410lc lower case ck_fun_locale fstu% S?
411quotemeta quote metachars ck_fun fstu% S?
79072805
LW
412
413# Arrays.
414
db173bac
MB
415rv2av array deref ck_rvconst dt1
416aelemfast known array element ck_null s* A S
417aelem array element ck_null s2 A S
418aslice array slice ck_null m@ A L
79072805 419
aa689395 420# Hashes.
79072805 421
db173bac
MB
422each each ck_fun t% H
423values values ck_fun t% H
424keys keys ck_fun t% H
425delete delete ck_delete % S
426exists exists operator ck_exists is% S
427rv2hv hash deref ck_rvconst dt1
428helem hash elem ck_null s2@ H S
429hslice hash slice ck_null m@ H L
79072805
LW
430
431# Explosives and implosives.
432
db173bac
MB
433unpack unpack ck_fun @ S S
434pack pack ck_fun mst@ S L
435split split ck_split t@ S S S
436join join ck_fun mst@ S L
79072805
LW
437
438# List operators.
439
db173bac
MB
440list list ck_null m@ L
441lslice list slice ck_null 2 H L L
442anonlist anonymous list ck_fun ms@ L
443anonhash anonymous hash ck_fun ms@ L
79072805 444
db173bac
MB
445splice splice ck_fun m@ A S? S? L
446push push ck_fun imst@ A L
a9f58cad 447pop pop ck_shift s% A
db173bac
MB
448shift shift ck_shift s% A
449unshift unshift ck_fun imst@ A L
450sort sort ck_sort m@ C? L
451reverse reverse ck_fun mt@ L
79072805 452
db173bac
MB
453grepstart grep ck_grep dm@ C L
454grepwhile grep iterator ck_null dt|
79072805 455
db173bac
MB
456mapstart map ck_grep dm@ C L
457mapwhile map iterator ck_null dt|
a0d0e21e 458
79072805
LW
459# Range stuff.
460
db173bac
MB
461range flipflop ck_null ? S S
462flip range (or flip) ck_null 1 S S
463flop range (or flop) ck_null 1
79072805
LW
464
465# Control.
466
db173bac
MB
467and logical and ck_null |
468or logical or ck_null |
469xor logical xor ck_null fs| S S
470cond_expr conditional expression ck_null d?
471andassign logical and assignment ck_null s|
472orassign logical or assignment ck_null s|
473
474method method lookup ck_null d1
475entersub subroutine entry ck_subr dmt1 L
476leavesub subroutine exit ck_null 1
477caller caller ck_fun t% S?
478warn warn ck_fun imst@ L
479die die ck_fun dimst@ L
480reset reset ck_fun is% S?
481
482lineseq line sequence ck_null @
483nextstate next statement ck_null s;
484dbstate debug next statement ck_null s;
e9c54c90 485unstack iteration finalizer ck_null s0
79072805 486enter block entry ck_null 0
db173bac
MB
487leave block exit ck_null @
488scope block ck_null @
489enteriter foreach loop entry ck_null d{
79072805 490iter foreach loop iterator ck_null 0
db173bac
MB
491enterloop loop entry ck_null d{
492leaveloop loop exit ck_null 2
493return return ck_null dm@ L
494last last ck_null ds}
495next next ck_null ds}
496redo redo ck_null ds}
497dump dump ck_null ds}
498goto goto ck_null ds}
499exit exit ck_fun ds% S?
79072805 500
a0d0e21e
LW
501#nswitch numeric switch ck_null d
502#cswitch character switch ck_null d
79072805
LW
503
504# I/O.
505
db173bac
MB
506open open ck_fun ist@ F S?
507close close ck_fun is% F?
508pipe_op pipe ck_fun is@ F F
79072805 509
db173bac
MB
510fileno fileno ck_fun ist% F
511umask umask ck_fun ist% S?
512binmode binmode ck_fun s% F
79072805 513
db173bac
MB
514tie tie ck_fun idms@ R S L
515untie untie ck_fun is% R
516tied tied ck_fun s% R
517dbmopen dbmopen ck_fun is@ H S S
518dbmclose dbmclose ck_fun is% H
79072805 519
db173bac
MB
520sselect select system call ck_select t@ S S S S
521select select ck_select st@ F?
79072805 522
db173bac 523getc getc ck_eof st% F?
d1a002d4 524read read ck_fun imst@ F R S S?
db173bac
MB
525enterwrite write ck_fun dis% F?
526leavewrite write exit ck_null 1
79072805 527
db173bac
MB
528prtf printf ck_listiob ims@ F? L
529print print ck_listiob ims@ F? L
79072805 530
db173bac
MB
531sysopen sysopen ck_fun s@ F S S S?
532sysseek sysseek ck_fun s@ F S S
d1a002d4 533sysread sysread ck_fun imst@ F R S S?
145d37e2 534syswrite syswrite ck_fun imst@ F S S? S?
79072805 535
db173bac 536send send ck_fun imst@ F S S S?
d1a002d4 537recv recv ck_fun imst@ F R S S
79072805 538
db173bac
MB
539eof eof ck_eof is% F?
540tell tell ck_fun st% F?
541seek seek ck_fun s@ F S S
9b01e405 542# truncate really behaves as if it had both "S S" and "F S"
db173bac 543truncate truncate ck_trunc is@ S S
79072805 544
db173bac
MB
545fcntl fcntl ck_fun st@ F S S
546ioctl ioctl ck_fun st@ F S S
547flock flock ck_fun ist@ F S
79072805
LW
548
549# Sockets.
550
db173bac
MB
551socket socket ck_fun is@ F S S S
552sockpair socketpair ck_fun is@ F F S S S
79072805 553
db173bac
MB
554bind bind ck_fun is@ F S
555connect connect ck_fun is@ F S
556listen listen ck_fun is@ F S
557accept accept ck_fun ist@ F F
558shutdown shutdown ck_fun ist@ F S
79072805 559
db173bac
MB
560gsockopt getsockopt ck_fun is@ F S S
561ssockopt setsockopt ck_fun is@ F S S S
79072805 562
db173bac
MB
563getsockname getsockname ck_fun is% F
564getpeername getpeername ck_fun is% F
79072805
LW
565
566# Stat calls.
567
db173bac
MB
568lstat lstat ck_ftst u- F
569stat stat ck_ftst u- F
570ftrread -R ck_ftst isu- F
571ftrwrite -W ck_ftst isu- F
572ftrexec -X ck_ftst isu- F
573fteread -r ck_ftst isu- F
574ftewrite -w ck_ftst isu- F
575fteexec -x ck_ftst isu- F
576ftis -e ck_ftst isu- F
577fteowned -O ck_ftst isu- F
578ftrowned -o ck_ftst isu- F
579ftzero -z ck_ftst isu- F
580ftsize -s ck_ftst istu- F
581ftmtime -M ck_ftst stu- F
582ftatime -A ck_ftst stu- F
583ftctime -C ck_ftst stu- F
584ftsock -S ck_ftst isu- F
585ftchr -c ck_ftst isu- F
586ftblk -b ck_ftst isu- F
587ftfile -f ck_ftst isu- F
588ftdir -d ck_ftst isu- F
589ftpipe -p ck_ftst isu- F
590ftlink -l ck_ftst isu- F
591ftsuid -u ck_ftst isu- F
592ftsgid -g ck_ftst isu- F
593ftsvtx -k ck_ftst isu- F
594fttty -t ck_ftst is- F
595fttext -T ck_ftst isu- F
596ftbinary -B ck_ftst isu- F
79072805
LW
597
598# File calls.
599
db173bac
MB
600chdir chdir ck_fun ist% S?
601chown chown ck_fun imst@ L
602chroot chroot ck_fun istu% S?
603unlink unlink ck_fun imstu@ L
604chmod chmod ck_fun imst@ L
605utime utime ck_fun imst@ L
606rename rename ck_fun ist@ S S
607link link ck_fun ist@ S S
608symlink symlink ck_fun ist@ S S
609readlink readlink ck_fun stu% S?
610mkdir mkdir ck_fun ist@ S S
611rmdir rmdir ck_fun istu% S?
79072805
LW
612
613# Directory calls.
614
db173bac
MB
615open_dir opendir ck_fun is@ F S
616readdir readdir ck_fun % F
617telldir telldir ck_fun st% F
618seekdir seekdir ck_fun s@ F S
619rewinddir rewinddir ck_fun s% F
620closedir closedir ck_fun is% F
79072805
LW
621
622# Process control.
623
db173bac
MB
624fork fork ck_null ist0
625wait wait ck_null ist0
626waitpid waitpid ck_fun ist@ S S
627system system ck_exec imst@ S? L
628exec exec ck_exec dimst@ S? L
629kill kill ck_fun dimst@ L
630getppid getppid ck_null ist0
631getpgrp getpgrp ck_fun ist% S?
632setpgrp setpgrp ck_fun ist@ S? S?
633getpriority getpriority ck_fun ist@ S S
634setpriority setpriority ck_fun ist@ S S S
79072805
LW
635
636# Time calls.
637
db173bac 638time time ck_null ist0
79072805 639tms times ck_null 0
db173bac
MB
640localtime localtime ck_fun t% S?
641gmtime gmtime ck_fun t% S?
642alarm alarm ck_fun istu% S?
643sleep sleep ck_fun ist% S?
79072805
LW
644
645# Shared memory.
646
db173bac
MB
647shmget shmget ck_fun imst@ S S S
648shmctl shmctl ck_fun imst@ S S S
649shmread shmread ck_fun imst@ S S S S
650shmwrite shmwrite ck_fun imst@ S S S S
79072805
LW
651
652# Message passing.
653
db173bac
MB
654msgget msgget ck_fun imst@ S S
655msgctl msgctl ck_fun imst@ S S S
656msgsnd msgsnd ck_fun imst@ S S S
657msgrcv msgrcv ck_fun imst@ S S S S S
79072805
LW
658
659# Semaphores.
660
db173bac
MB
661semget semget ck_fun imst@ S S S
662semctl semctl ck_fun imst@ S S S S
663semop semop ck_fun imst@ S S
79072805
LW
664
665# Eval.
666
db173bac
MB
667require require ck_require du% S?
668dofile do 'file' ck_fun d1 S
669entereval eval string ck_eval d% S
670leaveeval eval exit ck_null 1 S
671#evalonce eval constant string ck_null d1 S
672entertry eval block ck_null |
673leavetry eval block exit ck_null @
79072805
LW
674
675# Get system info.
676
db173bac
MB
677ghbyname gethostbyname ck_fun % S
678ghbyaddr gethostbyaddr ck_fun @ S S
79072805 679ghostent gethostent ck_null 0
db173bac
MB
680gnbyname getnetbyname ck_fun % S
681gnbyaddr getnetbyaddr ck_fun @ S S
79072805 682gnetent getnetent ck_null 0
db173bac
MB
683gpbyname getprotobyname ck_fun % S
684gpbynumber getprotobynumber ck_fun @ S
79072805 685gprotoent getprotoent ck_null 0
db173bac
MB
686gsbyname getservbyname ck_fun @ S S
687gsbyport getservbyport ck_fun @ S S
79072805 688gservent getservent ck_null 0
db173bac
MB
689shostent sethostent ck_fun is% S
690snetent setnetent ck_fun is% S
691sprotoent setprotoent ck_fun is% S
692sservent setservent ck_fun is% S
693ehostent endhostent ck_null is0
694enetent endnetent ck_null is0
695eprotoent endprotoent ck_null is0
696eservent endservent ck_null is0
697gpwnam getpwnam ck_fun % S
698gpwuid getpwuid ck_fun % S
79072805 699gpwent getpwent ck_null 0
db173bac
MB
700spwent setpwent ck_null is0
701epwent endpwent ck_null is0
702ggrnam getgrnam ck_fun % S
703ggrgid getgrgid ck_fun % S
79072805 704ggrent getgrent ck_null 0
db173bac
MB
705sgrent setgrent ck_null is0
706egrent endgrent ck_null is0
707getlogin getlogin ck_null st0
79072805
LW
708
709# Miscellaneous.
710
db173bac 711syscall syscall ck_fun imst@ S L
c0329465
MB
712
713# For multi-threading
db173bac 714lock lock ck_rfun s% S
2faa37cc 715threadsv per-thread variable ck_null ds0