4 # Generate the reentr.c and reentr.h,
5 # and optionally also the relevant metaconfig units (-U option).
15 A => "char*", # as an input argument
16 B => "char*", # as an output argument
17 C => "const char*", # as a read-only input argument
25 # (See the definitions after __DATA__.)
26 # In func|inc|type|... a "S" means "type*", and a "R" means "type**".
27 # (The "types" are often structs, such as "struct passwd".)
29 # After the prototypes one can have |X=...|Y=... to define more types.
30 # A commonly used extra type is to define D to be equal to "type_data",
31 # for example "struct_hostent_data to" go with "struct hostent".
33 # Example #1: I_XSBWR means int func_r(X, type, char*, size_t, type**)
34 # Example #2: S_SBIE means type func_r(type, char*, int, int*)
35 # Example #3: S_CBI means type func_r(const char*, char*, int)
38 die "reentr.h: $!" unless open(H, ">reentr.h");
44 * Copyright (c) 1997-2002, Larry Wall
46 * You may distribute under the terms of either the GNU General Public
47 * License or the Artistic License, as specified in the README file.
49 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
50 * This file is built by reentrl.pl from data in reentr.pl.
56 #ifdef USE_REENTRANT_API
58 /* Deprecations: some platforms have the said reentrant interfaces
59 * but they are declared obsolete and are not to be used. Often this
60 * means that the platform has threadsafed the interfaces (hopefully).
61 * All this is OS version dependent, so we are of course fooling ourselves.
62 * If you know of more deprecations on some platforms, please add your own. */
67 # undef HAS_ENDGRENT_R
68 # undef HAS_ENDPWENT_R
69 # undef HAS_GETGRENT_R
70 # undef HAS_GETPWENT_R
71 # undef HAS_SETLOCALE_R
73 # undef HAS_STRERROR_R
74 # define NETDB_R_OBSOLETE
77 #if defined(__osf__) && defined(__alpha) /* Tru64 aka Digital UNIX */
79 # undef HAS_STRERROR_R
80 # define NETDB_R_OBSOLETE
83 #ifdef NETDB_R_OBSOLETE
84 # undef HAS_ENDHOSTENT_R
85 # undef HAS_ENDNETENT_R
86 # undef HAS_ENDPROTOENT_R
87 # undef HAS_ENDSERVENT_R
88 # undef HAS_GETHOSTBYADDR_R
89 # undef HAS_GETHOSTBYNAME_R
90 # undef HAS_GETHOSTENT_R
91 # undef HAS_GETNETBYADDR_R
92 # undef HAS_GETNETBYNAME_R
93 # undef HAS_GETNETENT_R
94 # undef HAS_GETPROTOBYNAME_R
95 # undef HAS_GETPROTOBYNUMBER_R
96 # undef HAS_GETPROTOENT_R
97 # undef HAS_GETSERVBYNAME_R
98 # undef HAS_GETSERVBYPORT_R
99 # undef HAS_GETSERVENT_R
100 # undef HAS_SETHOSTENT_R
101 # undef HAS_SETNETENT_R
102 # undef HAS_SETPROTOENT_R
103 # undef HAS_SETSERVENT_R
116 # include <stdlib.h> /* drand48_data */
123 #ifdef HAS_GETSPNAM_R
143 my ($f, $h, $t, @p) = split(/\s*\|\s*/, $_, -1);
145 ($f, $u) = split(' ', $f);
146 $seenu{$f} = defined $u ? length $u : 0;
155 while ($p[-1] =~ /=/) {
156 my ($k, $v) = ($p[-1] =~ /^([A-Za-z])\s*=\s*(.*)/);
161 if ($opts{U} && open(U, ">d_${f}_r.U")) {
167 if ($h ne 'stdio') { # There's no i_stdio.
170 $prereqsh = "\$$prereqs $prereqh";
172 print <<EOF if $opts{U};
173 ?RCS: \$Id: d_${f}_r.U,v $
175 ?RCS: Copyright (c) 2002 Jarkko Hietaniemi
177 ?RCS: You may distribute under the terms of either the GNU General Public
178 ?RCS: License or the Artistic License, as specified in the README file.
180 ?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
182 ?MAKE:d_${f}_r ${f}_r_proto: Inlibc Protochk Hasproto i_systypes i_systime $prereqs usethreads
183 ?MAKE: -pick add \$@ %<
185 ?S: This variable conditionally defines the HAS_${F}_R symbol,
186 ?S: which indicates to the C program that the ${f}_r()
187 ?S: routine is available.
190 ?S: This variable encodes the prototype of ${f}_r.
193 ?C: This symbol, if defined, indicates that the ${f}_r routine
194 ?C: is available to ${f} re-entrantly.
197 ?C: This symbol encodes the prototype of ${f}_r.
199 ?H:#\$d_${f}_r HAS_${F}_R /**/
200 ?H:#define ${F}_R_PROTO \$${f}_r_proto /**/
202 ?T:try hdrs d_${f}_r_proto
204 ?LINT:set ${f}_r_proto
205 : see if ${f}_r exists
210 hdrs="\$i_systypes sys/types.h define stdio.h $prereqsh"
213 hdrs="\$hdrs \$i_systime sys/time.h"
216 case "\$d_${f}_r_proto:\$usethreads" in
217 ":define") d_${f}_r_proto=define
218 set d_${f}_r_proto ${f}_r \$hdrs
222 case "\$d_${f}_r_proto" in
226 my ($r, $a) = ($p =~ /^(.)_(.+)/);
227 my $v = join(", ", map { $m{$_} } split '', $a);
230 case "\$${f}_r_proto" in
231 ''|0) try='$m{$r} ${f}_r($v);'
232 ./protochk "extern \$try" \$hdrs && ${f}_r_proto=$p ;;
237 push @{$seena{$f}}, $p;
245 case "\$${f}_r_proto" in
248 echo "Disabling ${f}_r, cannot determine prototype." >&4 ;;
249 * ) case "\$${f}_r_proto" in
251 *) ${f}_r_proto="REENTRANT_PROTO_\$${f}_r_proto" ;;
253 echo "Prototype: \$try" ;;
256 *) case "\$usethreads" in
257 define) echo "${f}_r has no prototype, not using it." >&4 ;;
279 for my $p (sort keys %seenp) {
280 print "#define REENTRANT_PROTO_${p} ${i}\n";
287 join " || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @_;
307 New(31338, PL_reentrant_buffer->_${f}_buffer, PL_reentrant_buffer->_${f}_size, char);
310 Safefree(PL_reentrant_buffer->_${f}_buffer);
315 my ($n, $p, @F) = @_;
319 /* The @F using \L$n? */
324 my $h = "${F}_R_HAS_$n";
326 my @h = grep { /$p/ } @{$seena{$f}};
328 push @define, "#if defined(HAS_${F}_R) && (" . join(" || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @h) . ")\n";
340 /* Any of the @F using \L$n? */
343 push @define, "#if (" . join(" || ", map { "defined($_)" } @H) . ")\n";
353 define('BUFFER', 'B',
354 qw(getgrent getgrgid getgrnam));
357 qw(getgrent getgrgid getgrnam));
359 qw(getpwent getpwnam getpwuid));
361 qw(getspent getspnam));
364 qw(getgrent getgrgid getgrnam));
366 qw(getpwent getpwnam getpwuid));
368 define('BUFFER', 'B',
369 qw(getpwent getpwgid getpwnam));
372 qw(gethostent gethostbyaddr gethostbyname));
374 qw(getnetent getnetbyaddr getnetbyname));
376 qw(getprotoent getprotobyname getprotobynumber));
378 qw(getservent getservbyname getservbyport));
380 define('BUFFER', 'B',
381 qw(gethostent gethostbyaddr gethostbyname));
382 define('BUFFER', 'B',
383 qw(getnetent getnetbyaddr getnetbyname));
384 define('BUFFER', 'B',
385 qw(getprotoent getprotobyname getprotobynumber));
386 define('BUFFER', 'B',
387 qw(getservent getservbyname getservbyport));
390 qw(gethostent gethostbyaddr gethostbyname));
392 qw(getnetent getnetbyaddr getnetbyname));
396 my $ifdef = "#ifdef HAS_${F}_R\n";
397 my $endif = "#endif /* HAS_${F}_R */\n";
398 if (exists $seena{$f}) {
399 my @p = @{$seena{$f}};
400 if ($f =~ /^(asctime|ctime|getlogin|setlocale|strerror|ttyname)$/) {
407 PL_reentrant_buffer->_${f}_size = REENTRANTSMALLSIZE;
412 elsif ($f =~ /^(crypt)$/) {
415 #if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
416 $seend{$f} _${f}_data;
418 $seent{$f} _${f}_struct;
423 PL_reentrant_buffer->_${f}_struct.initialized = 0;
428 elsif ($f =~ /^(drand48|gmtime|localtime|random)$/) {
431 $seent{$f} _${f}_struct;
433 if ($1 eq 'drand48') {
440 elsif ($f =~ /^(getgrnam|getpwnam|getspnam)$/) {
446 $seent{$f} _${g}_struct;
452 $seent{$f}* _${g}_ptr;
455 if ($g eq 'getspent') {
457 PL_reentrant_buffer->_${g}_size = 1024;
461 # ifdef USE_${G}_FPTR
466 # ifdef USE_${G}_FPTR
467 PL_reentrant_buffer->_${g}_fptr = NULL;
470 my $sc = $g eq 'getgrent' ?
471 '_SC_GETGR_R_SIZE_MAX' : '_SC_GETPW_R_SIZE_MAX';
472 my $sz = $g eq 'getgrent' ?
473 '_getgrent_size' : '_getpwent_size';
475 # if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
476 PL_reentrant_buffer->_${g}_size = sysconf($sc);
477 if (PL_reentrant_buffer->$sz == -1)
478 PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
480 # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
481 PL_reentrant_buffer->_${g}_size = SIABUFSIZ;
484 PL_reentrant_buffer->_${g}_size = BUFSIZ;
486 PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
495 elsif ($f =~ /^(gethostbyname|getnetbyname|getservbyname|getprotobyname)$/) {
500 my $D = ifprotomatch($F, grep {/D/} @p);
502 $d =~ s/\*$//; # snip: we need need the base type.
504 $seent{$f} _${g}_struct;
512 $seent{$f}* _${g}_ptr;
516 # ifdef USE_${G}_ERRNO
522 PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
527 New(31338, PL_reentrant_buffer->_${g}_buffer, PL_reentrant_buffer->_${g}_size, char);
532 Safefree(PL_reentrant_buffer->_${g}_buffer);
537 elsif ($f =~ /^(readdir|readdir64)$/) {
539 my $R = ifprotomatch($F, grep {/R/} @p);
541 $seent{$f}* _${f}_struct;
544 $seent{$f}* _${f}_ptr;
548 /* This is the size Solaris recommends.
549 * (though we go static, should use pathconf() instead) */
550 PL_reentrant_buffer->_${f}_size = sizeof($seent{$f}) + MAXPATHLEN + 1;
553 PL_reentrant_buffer->_${f}_struct = ($seent{$f}*)safemalloc(PL_reentrant_buffer->_${f}_size);
556 Safefree(PL_reentrant_buffer->_${f}_struct);
567 my $v = join(", ", @v[0..$seenu{$f}-1]);
569 my ($r, $a) = split '_', $p;
570 my $test = $r eq 'I' ? ' == 0' : '';
573 if ($g =~ /^(?:get|set|end)(pw|gr|host|net|proto|serv|sp)/) {
575 } elsif ($g eq 'srand48') {
580 substr($b, 0, $seenu{$f}) = '';
582 $true = "PL_reentrant_buffer->_${g}_ptr";
583 } elsif ($b =~ /T/ && $f eq 'drand48') {
584 $true = "PL_reentrant_buffer->_${g}_double";
585 } elsif ($b =~ /S/) {
586 if ($f =~ /^readdir/) {
587 $true = "PL_reentrant_buffer->_${g}_struct";
589 $true = "&PL_reentrant_buffer->_${g}_struct";
591 } elsif ($b =~ /B/) {
592 $true = "PL_reentrant_buffer->_${g}_buffer";
598 "&PL_reentrant_buffer->_${g}_ptr" :
600 "&PL_reentrant_buffer->_${g}_errno" :
602 "PL_reentrant_buffer->_${g}_buffer" :
604 "PL_reentrant_buffer->_${g}_size" :
606 "&PL_reentrant_buffer->_${g}_fptr" :
608 "&PL_reentrant_buffer->_${g}_data" :
611 "PL_reentrant_buffer->_${g}_struct" :
612 "&PL_reentrant_buffer->_${g}_struct" ) :
613 $_ eq 'T' && $f eq 'drand48' ?
614 "&PL_reentrant_buffer->_${g}_double" :
617 $w = ", $w" if length $v;
619 my $call = "${f}_r($v$w)";
620 $call = "((errno = $call))" if $r eq 'I';
622 # if !defined($f) && ${F}_R_PROTO == REENTRANT_PROTO_$p
624 if ($r eq 'V' || $r eq 'B') {
626 # define $f($v) $call
630 my $rv = $v ? ", $v" : "";
632 # define $f($v) ($call$test ? $true : (errno == ERANGE ? Perl_reentrant_retry("$f"$rv) : 0))
636 # define $f($v) ($call$test ? $true : 0)
645 push @wrap, $endif, "\n";
653 /* Defines for indicating which special features are supported. */
663 #endif /* USE_REENTRANT_API */
671 die "reentr.c: $!" unless open(C, ">reentr.c");
677 * Copyright (c) 1997-2002, Larry Wall
679 * You may distribute under the terms of either the GNU General Public
680 * License or the Artistic License, as specified in the README file.
682 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
683 * This file is built by reentrl.pl from data in reentr.pl.
685 * "Saruman," I said, standing away from him, "only one hand at a time can
686 * wield the One, and you know that well, so do not trouble to say we!"
691 #define PERL_IN_REENTR_C
696 Perl_reentrant_size(pTHX) {
697 #ifdef USE_REENTRANT_API
698 #define REENTRANTSMALLSIZE 256 /* Make something up. */
699 #define REENTRANTUSUALSIZE 4096 /* Make something up. */
701 #endif /* USE_REENTRANT_API */
705 Perl_reentrant_init(pTHX) {
706 #ifdef USE_REENTRANT_API
707 New(31337, PL_reentrant_buffer, 1, REENTR);
708 Perl_reentrant_size(aTHX);
710 #endif /* USE_REENTRANT_API */
714 Perl_reentrant_free(pTHX) {
715 #ifdef USE_REENTRANT_API
717 Safefree(PL_reentrant_buffer);
718 #endif /* USE_REENTRANT_API */
722 Perl_reentrant_retry(const char *f, ...)
726 #ifdef USE_REENTRANT_API
727 # if defined(USE_GETHOSTENT_BUFFER) || defined(USE_GETGRENT_BUFFER) || defined(USE_GETNETENT_BUFFER) || defined(USE_GETPWENT_BUFFER) || defined(USE_GETPROTOENT_BUFFER) || defined(USE_GETSERVENT_BUFFER)
730 # if defined(USE_GETSERVENT_BUFFER)
733 # if defined(USE_GETHOSTENT_BUFFER)
736 # if defined(USE_GETHOSTENT_BUFFER) || defined(USE_GETNETENT_BUFFER) || defined(USE_GETPROTOENT_BUFFER) || defined(USE_GETSERVENT_BUFFER)
743 #define REENTRANTHALFMAXSIZE 32768 /* The maximum may end up twice this. */
745 switch (PL_op->op_type) {
746 #ifdef USE_GETHOSTENT_BUFFER
751 if (PL_reentrant_buffer->_gethostent_size <= REENTRANTHALFMAXSIZE) {
752 PL_reentrant_buffer->_gethostent_size *= 2;
753 Renew(PL_reentrant_buffer->_gethostent_buffer,
754 PL_reentrant_buffer->_gethostent_size, char);
755 switch (PL_op->op_type) {
757 p0 = va_arg(ap, void *);
758 asize = va_arg(ap, size_t);
759 anint = va_arg(ap, int);
760 retptr = gethostbyaddr(p0, asize, anint); break;
762 p0 = va_arg(ap, void *);
763 retptr = gethostbyname(p0); break;
765 retptr = gethostent(); break;
773 #ifdef USE_GETGRENT_BUFFER
778 if (PL_reentrant_buffer->_getgrent_size <= REENTRANTHALFMAXSIZE) {
780 PL_reentrant_buffer->_getgrent_size *= 2;
781 Renew(PL_reentrant_buffer->_getgrent_buffer,
782 PL_reentrant_buffer->_getgrent_size, char);
783 switch (PL_op->op_type) {
785 p0 = va_arg(ap, void *);
786 retptr = getgrnam(p0); break;
788 gid = va_arg(ap, Gid_t);
789 retptr = getgrgid(gid); break;
791 retptr = getgrent(); break;
799 #ifdef USE_GETNETENT_BUFFER
804 if (PL_reentrant_buffer->_getnetent_size <= REENTRANTHALFMAXSIZE) {
806 PL_reentrant_buffer->_getnetent_size *= 2;
807 Renew(PL_reentrant_buffer->_getnetent_buffer,
808 PL_reentrant_buffer->_getnetent_size, char);
809 switch (PL_op->op_type) {
811 net = va_arg(ap, Netdb_net_t);
812 anint = va_arg(ap, int);
813 retptr = getnetbyaddr(net, anint); break;
815 p0 = va_arg(ap, void *);
816 retptr = getnetbyname(p0); break;
818 retptr = getnetent(); break;
826 #ifdef USE_GETPWENT_BUFFER
831 if (PL_reentrant_buffer->_getpwent_size <= REENTRANTHALFMAXSIZE) {
833 PL_reentrant_buffer->_getpwent_size *= 2;
834 Renew(PL_reentrant_buffer->_getpwent_buffer,
835 PL_reentrant_buffer->_getpwent_size, char);
836 switch (PL_op->op_type) {
838 p0 = va_arg(ap, void *);
839 retptr = getpwnam(p0); break;
841 uid = va_arg(ap, Uid_t);
842 retptr = getpwuid(uid); break;
844 retptr = getpwent(); break;
852 #ifdef USE_GETPROTOENT_BUFFER
857 if (PL_reentrant_buffer->_getprotoent_size <= REENTRANTHALFMAXSIZE) {
858 PL_reentrant_buffer->_getprotoent_size *= 2;
859 Renew(PL_reentrant_buffer->_getprotoent_buffer,
860 PL_reentrant_buffer->_getprotoent_size, char);
861 switch (PL_op->op_type) {
863 p0 = va_arg(ap, void *);
864 retptr = getprotobyname(p0); break;
866 anint = va_arg(ap, int);
867 retptr = getprotobynumber(anint); break;
869 retptr = getprotoent(); break;
877 #ifdef USE_GETSERVENT_BUFFER
882 if (PL_reentrant_buffer->_getservent_size <= REENTRANTHALFMAXSIZE) {
883 PL_reentrant_buffer->_getservent_size *= 2;
884 Renew(PL_reentrant_buffer->_getservent_buffer,
885 PL_reentrant_buffer->_getservent_size, char);
886 switch (PL_op->op_type) {
888 p0 = va_arg(ap, void *);
889 p1 = va_arg(ap, void *);
890 retptr = getservbyname(p0, p1); break;
892 anint = va_arg(ap, int);
893 p0 = va_arg(ap, void *);
894 retptr = getservbyport(anint, p0); break;
896 retptr = getservent(); break;
905 /* Not known how to retry, so just fail. */
917 asctime S |time |const struct tm|B_SB|B_SBI|I_SB|I_SBI
918 crypt CC |crypt |struct crypt_data|B_CCS|B_CCD|D=CRYPTD*
919 ctermid B |stdio | |B_B
920 ctime S |time |const time_t |B_SB|B_SBI|I_SB|I_SBI
921 drand48 |stdlib |struct drand48_data |I_ST|T=double*
922 endgrent |grp | |I_H|V_H
923 endhostent |netdb | |I_D|V_D|D=struct hostent_data*
924 endnetent |netdb | |I_D|V_D|D=struct netent_data*
925 endprotoent |netdb | |I_D|V_D|D=struct protoent_data*
926 endpwent |pwd | |I_H|V_H
927 endservent |netdb | |I_D|V_D|D=struct servent_data*
928 getgrent |grp |struct group |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
929 getgrgid T |grp |struct group |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=gid_t
930 getgrnam C |grp |struct group |I_CSBWR|I_CSBIR|S_CBI|I_CSBI|S_CSBI
931 gethostbyaddr CWI |netdb |struct hostent |I_CWISBWRE|S_CWISBWIE|S_CWISBIE|S_TWISBIE|S_CIISBIE|S_CSBIE|S_TSBIE|I_CWISD|I_CIISD|I_CII|D=struct hostent_data*|T=const void*
932 gethostbyname C |netdb |struct hostent |I_CSBWRE|S_CSBIE|I_CSD|D=struct hostent_data*
933 gethostent |netdb |struct hostent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct hostent_data*
934 getlogin |unistd | |I_BW|I_BI|B_BW|B_BI
935 getnetbyaddr LI |netdb |struct netent |I_UISBWRE|I_LISBI|S_TISBI|S_LISBI|I_TISD|I_LISD|I_IISD|D=struct netent_data*|T=in_addr_t|U=unsigned long
936 getnetbyname C |netdb |struct netent |I_CSBWRE|I_CSBI|S_CSBI|I_CSD|D=struct netent_data*
937 getnetent |netdb |struct netent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct netent_data*
938 getprotobyname C|netdb |struct protoent|I_CSBWR|S_CSBI|I_CSD|D=struct protoent_data*
939 getprotobynumber I |netdb |struct protoent|I_ISBWR|S_ISBI|I_ISD|D=struct protoent_data*
940 getprotoent |netdb |struct protoent|I_SBWR|I_SBI|S_SBI|I_SD|D=struct protoent_data*
941 getpwent |pwd |struct passwd |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
942 getpwnam C |pwd |struct passwd |I_CSBWR|I_CSBIR|S_CSBI|I_CSBI
943 getpwuid T |pwd |struct passwd |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=uid_t
944 getservbyname CC|netdb |struct servent |I_CCSBWR|S_CCSBI|I_CCSD|D=struct servent_data*
945 getservbyport IC|netdb |struct servent |I_ICSBWR|S_ICSBI|I_ICSD|D=struct servent_data*
946 getservent |netdb |struct servent |I_SBWR|I_SBI|S_SBI|I_SD|D=struct servent_data*
947 getspnam C |shadow |struct spwd |I_CSBWR|S_CSBI
948 gmtime T |time |struct tm |S_TS|I_TS|T=const time_t*
949 localtime T |time |struct tm |S_TS|I_TS|T=const time_t*
950 random |stdlib |struct random_data|I_TS|T=int*
951 readdir T |dirent |struct dirent |I_TSR|I_TS|T=DIR*
952 readdir64 T |dirent |struct dirent64|I_TSR|I_TS|T=DIR*
953 setgrent |grp | |I_H|V_H
954 sethostent I |netdb | |I_ID|V_ID|D=struct hostent_data*
955 setlocale IC |locale | |I_ICBI
956 setnetent I |netdb | |I_ID|V_ID|D=struct netent_data*
957 setprotoent I |netdb | |I_ID|V_ID|D=struct protoent_data*
958 setpwent |pwd | |I_H|V_H
959 setservent I |netdb | |I_ID|V_ID|D=struct servent_data*
960 srand48 L |stdlib |struct drand48_data |I_LS
961 srandom T |stdlib |struct random_data|I_TS|T=unsigned int
962 strerror I |string | |I_IBW|I_IBI|B_IBW
963 tmpnam B |stdio | |B_B
964 ttyname I |unistd | |I_IBW|I_IBI|B_IBI