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";
173 my @prereq = qw(Inlibc Protochk Hasproto i_systypes usethreads);
174 push @prereq, $prereqs;
175 my $hdrs = "\$i_systypes sys/types.h define stdio.h $prereqsh";
177 $hdrs .= " \$i_systime sys/time.h";
178 push @prereq, 'i_systime';
181 ?RCS: \$Id: d_${f}_r.U,v $
183 ?RCS: Copyright (c) 2002 Jarkko Hietaniemi
185 ?RCS: You may distribute under the terms of either the GNU General Public
186 ?RCS: License or the Artistic License, as specified in the README file.
188 ?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
190 ?MAKE:d_${f}_r ${f}_r_proto: @prereq
191 ?MAKE: -pick add \$@ %<
193 ?S: This variable conditionally defines the HAS_${F}_R symbol,
194 ?S: which indicates to the C program that the ${f}_r()
195 ?S: routine is available.
198 ?S: This variable encodes the prototype of ${f}_r.
201 ?C: This symbol, if defined, indicates that the ${f}_r routine
202 ?C: is available to ${f} re-entrantly.
205 ?C: This symbol encodes the prototype of ${f}_r.
207 ?H:#\$d_${f}_r HAS_${F}_R /**/
208 ?H:#define ${F}_R_PROTO \$${f}_r_proto /**/
210 ?T:try hdrs d_${f}_r_proto
212 ?LINT:set ${f}_r_proto
213 : see if ${f}_r exists
221 case "\$d_${f}_r_proto:\$usethreads" in
222 ":define") d_${f}_r_proto=define
223 set d_${f}_r_proto ${f}_r \$hdrs
227 case "\$d_${f}_r_proto" in
232 my ($r, $a) = ($p =~ /^(.)_(.+)/);
233 my $v = join(", ", map { $m{$_} } split '', $a);
236 case "\$${f}_r_proto" in
237 ''|0) try='$m{$r} ${f}_r($v);'
238 ./protochk "extern \$try" \$hdrs && ${f}_r_proto=$p ;;
243 push @{$seena{$f}}, $p;
251 case "\$${f}_r_proto" in
254 echo "Disabling ${f}_r, cannot determine prototype." >&4 ;;
255 * ) case "\$${f}_r_proto" in
257 *) ${f}_r_proto="REENTRANT_PROTO_\$${f}_r_proto" ;;
259 echo "Prototype: \$try" ;;
262 *) case "\$usethreads" in
263 define) echo "${f}_r has no prototype, not using it." >&4 ;;
285 for my $p (sort keys %seenp) {
286 print "#define REENTRANT_PROTO_${p} ${i}\n";
293 join " || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @_;
313 New(31338, PL_reentrant_buffer->_${f}_buffer, PL_reentrant_buffer->_${f}_size, char);
316 Safefree(PL_reentrant_buffer->_${f}_buffer);
321 my ($n, $p, @F) = @_;
325 /* The @F using \L$n? */
331 my $h = "${F}_R_HAS_$n";
333 my @h = grep { /$p/ } @{$seena{$f}};
334 unless (defined $G) {
339 push @define, "#if defined(HAS_${F}_R) && (" . join(" || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @h) . ")\n";
351 /* Any of the @F using \L$n? */
354 push @define, "#if (" . join(" || ", map { "defined($_)" } @H) . ")\n";
364 define('BUFFER', 'B',
365 qw(getgrent getgrgid getgrnam));
368 qw(getgrent getgrgid getgrnam));
370 qw(getpwent getpwnam getpwuid));
372 qw(getspent getspnam));
375 qw(getgrent getgrgid getgrnam setgrent endgrent));
377 qw(getpwent getpwnam getpwuid setpwent endpwent));
379 define('BUFFER', 'B',
380 qw(getpwent getpwgid getpwnam));
383 qw(gethostent gethostbyaddr gethostbyname));
385 qw(getnetent getnetbyaddr getnetbyname));
387 qw(getprotoent getprotobyname getprotobynumber));
389 qw(getservent getservbyname getservbyport));
391 define('BUFFER', 'B',
392 qw(gethostent gethostbyaddr gethostbyname));
393 define('BUFFER', 'B',
394 qw(getnetent getnetbyaddr getnetbyname));
395 define('BUFFER', 'B',
396 qw(getprotoent getprotobyname getprotobynumber));
397 define('BUFFER', 'B',
398 qw(getservent getservbyname getservbyport));
401 qw(gethostent gethostbyaddr gethostbyname));
403 qw(getnetent getnetbyaddr getnetbyname));
407 my $ifdef = "#ifdef HAS_${F}_R\n";
408 my $endif = "#endif /* HAS_${F}_R */\n";
409 if (exists $seena{$f}) {
410 my @p = @{$seena{$f}};
411 if ($f =~ /^(asctime|ctime|getlogin|setlocale|strerror|ttyname)$/) {
418 PL_reentrant_buffer->_${f}_size = REENTRANTSMALLSIZE;
423 elsif ($f =~ /^(crypt)$/) {
426 #if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
427 $seend{$f} _${f}_data;
429 $seent{$f} _${f}_struct;
434 PL_reentrant_buffer->_${f}_struct.initialized = 0;
439 elsif ($f =~ /^(drand48|gmtime|localtime|random)$/) {
442 $seent{$f} _${f}_struct;
444 if ($1 eq 'drand48') {
451 elsif ($f =~ /^(getgrnam|getpwnam|getspnam)$/) {
458 $seent{$f} _${g}_struct;
464 $seent{$f}* _${g}_ptr;
467 if ($g eq 'getspent') {
469 PL_reentrant_buffer->_${g}_size = 1024;
473 # ifdef USE_${G}_FPTR
478 # ifdef USE_${G}_FPTR
479 PL_reentrant_buffer->_${g}_fptr = NULL;
482 my $sc = $g eq 'getgrent' ?
483 '_SC_GETGR_R_SIZE_MAX' : '_SC_GETPW_R_SIZE_MAX';
484 my $sz = $g eq 'getgrent' ?
485 '_grent_size' : '_pwent_size';
487 # if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
488 PL_reentrant_buffer->_${g}_size = sysconf($sc);
489 if (PL_reentrant_buffer->$sz == -1)
490 PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
492 # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
493 PL_reentrant_buffer->_${g}_size = SIABUFSIZ;
496 PL_reentrant_buffer->_${g}_size = BUFSIZ;
498 PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
507 elsif ($f =~ /^(gethostbyname|getnetbyname|getservbyname|getprotobyname)$/) {
513 my $D = ifprotomatch($F, grep {/D/} @p);
515 $d =~ s/\*$//; # snip: we need need the base type.
517 $seent{$f} _${g}_struct;
525 $seent{$f}* _${g}_ptr;
529 # ifdef USE_${G}_ERRNO
535 PL_reentrant_buffer->_${g}_size = REENTRANTUSUALSIZE;
540 New(31338, PL_reentrant_buffer->_${g}_buffer, PL_reentrant_buffer->_${g}_size, char);
545 Safefree(PL_reentrant_buffer->_${g}_buffer);
550 elsif ($f =~ /^(readdir|readdir64)$/) {
552 my $R = ifprotomatch($F, grep {/R/} @p);
554 $seent{$f}* _${f}_struct;
557 $seent{$f}* _${f}_ptr;
561 /* This is the size Solaris recommends.
562 * (though we go static, should use pathconf() instead) */
563 PL_reentrant_buffer->_${f}_size = sizeof($seent{$f}) + MAXPATHLEN + 1;
566 PL_reentrant_buffer->_${f}_struct = ($seent{$f}*)safemalloc(PL_reentrant_buffer->_${f}_size);
569 Safefree(PL_reentrant_buffer->_${f}_struct);
580 my $v = join(", ", @v[0..$seenu{$f}-1]);
582 my ($r, $a) = split '_', $p;
583 my $test = $r eq 'I' ? ' == 0' : '';
586 if ($g =~ /^(?:get|set|end)(pw|gr|host|net|proto|serv|sp)/) {
588 } elsif ($g eq 'srand48') {
593 substr($b, 0, $seenu{$f}) = '';
595 $true = "PL_reentrant_buffer->_${g}_ptr";
596 } elsif ($b =~ /T/ && $f eq 'drand48') {
597 $true = "PL_reentrant_buffer->_${g}_double";
598 } elsif ($b =~ /S/) {
599 if ($f =~ /^readdir/) {
600 $true = "PL_reentrant_buffer->_${g}_struct";
602 $true = "&PL_reentrant_buffer->_${g}_struct";
604 } elsif ($b =~ /B/) {
605 $true = "PL_reentrant_buffer->_${g}_buffer";
611 "&PL_reentrant_buffer->_${g}_ptr" :
613 "&PL_reentrant_buffer->_${g}_errno" :
615 "PL_reentrant_buffer->_${g}_buffer" :
617 "PL_reentrant_buffer->_${g}_size" :
619 "&PL_reentrant_buffer->_${g}_fptr" :
621 "&PL_reentrant_buffer->_${g}_data" :
624 "PL_reentrant_buffer->_${g}_struct" :
625 "&PL_reentrant_buffer->_${g}_struct" ) :
626 $_ eq 'T' && $f eq 'drand48' ?
627 "&PL_reentrant_buffer->_${g}_double" :
630 $w = ", $w" if length $v;
632 my $call = "${f}_r($v$w)";
633 $call = "((errno = $call))" if $r eq 'I';
635 # if !defined($f) && ${F}_R_PROTO == REENTRANT_PROTO_$p
637 if ($r eq 'V' || $r eq 'B') {
639 # define $f($v) $call
643 my $rv = $v ? ", $v" : "";
645 # define $f($v) ($call$test ? $true : (errno == ERANGE ? Perl_reentrant_retry("$f"$rv) : 0))
649 # define $f($v) ($call$test ? $true : 0)
658 push @wrap, $endif, "\n";
666 /* Defines for indicating which special features are supported. */
676 #endif /* USE_REENTRANT_API */
684 die "reentr.c: $!" unless open(C, ">reentr.c");
690 * Copyright (c) 1997-2002, Larry Wall
692 * You may distribute under the terms of either the GNU General Public
693 * License or the Artistic License, as specified in the README file.
695 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
696 * This file is built by reentrl.pl from data in reentr.pl.
698 * "Saruman," I said, standing away from him, "only one hand at a time can
699 * wield the One, and you know that well, so do not trouble to say we!"
704 #define PERL_IN_REENTR_C
709 Perl_reentrant_size(pTHX) {
710 #ifdef USE_REENTRANT_API
711 #define REENTRANTSMALLSIZE 256 /* Make something up. */
712 #define REENTRANTUSUALSIZE 4096 /* Make something up. */
714 #endif /* USE_REENTRANT_API */
718 Perl_reentrant_init(pTHX) {
719 #ifdef USE_REENTRANT_API
720 New(31337, PL_reentrant_buffer, 1, REENTR);
721 Perl_reentrant_size(aTHX);
723 #endif /* USE_REENTRANT_API */
727 Perl_reentrant_free(pTHX) {
728 #ifdef USE_REENTRANT_API
730 Safefree(PL_reentrant_buffer);
731 #endif /* USE_REENTRANT_API */
735 Perl_reentrant_retry(const char *f, ...)
739 #ifdef USE_REENTRANT_API
740 # if defined(USE_HOSTENT_BUFFER) || defined(USE_GRENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PWENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SRVENT_BUFFER)
743 # if defined(USE_SERVENT_BUFFER)
746 # if defined(USE_HOSTENT_BUFFER)
749 # if defined(USE_HOSTENT_BUFFER) || defined(USE_NETENT_BUFFER) || defined(USE_PROTOENT_BUFFER) || defined(USE_SERVENT_BUFFER)
756 #define REENTRANTHALFMAXSIZE 32768 /* The maximum may end up twice this. */
758 switch (PL_op->op_type) {
759 #ifdef USE_HOSTENT_BUFFER
764 if (PL_reentrant_buffer->_hostent_size <= REENTRANTHALFMAXSIZE) {
765 PL_reentrant_buffer->_hostent_size *= 2;
766 Renew(PL_reentrant_buffer->_hostent_buffer,
767 PL_reentrant_buffer->_hostent_size, char);
768 switch (PL_op->op_type) {
770 p0 = va_arg(ap, void *);
771 asize = va_arg(ap, size_t);
772 anint = va_arg(ap, int);
773 retptr = gethostbyaddr(p0, asize, anint); break;
775 p0 = va_arg(ap, void *);
776 retptr = gethostbyname(p0); break;
778 retptr = gethostent(); break;
786 #ifdef USE_GRENT_BUFFER
791 if (PL_reentrant_buffer->_grent_size <= REENTRANTHALFMAXSIZE) {
793 PL_reentrant_buffer->_grent_size *= 2;
794 Renew(PL_reentrant_buffer->_grent_buffer,
795 PL_reentrant_buffer->_grent_size, char);
796 switch (PL_op->op_type) {
798 p0 = va_arg(ap, void *);
799 retptr = getgrnam(p0); break;
801 gid = va_arg(ap, Gid_t);
802 retptr = getgrgid(gid); break;
804 retptr = getgrent(); break;
812 #ifdef USE_NETENT_BUFFER
817 if (PL_reentrant_buffer->_netent_size <= REENTRANTHALFMAXSIZE) {
819 PL_reentrant_buffer->_netent_size *= 2;
820 Renew(PL_reentrant_buffer->_netent_buffer,
821 PL_reentrant_buffer->_netent_size, char);
822 switch (PL_op->op_type) {
824 net = va_arg(ap, Netdb_net_t);
825 anint = va_arg(ap, int);
826 retptr = getnetbyaddr(net, anint); break;
828 p0 = va_arg(ap, void *);
829 retptr = getnetbyname(p0); break;
831 retptr = getnetent(); break;
839 #ifdef USE_PWENT_BUFFER
844 if (PL_reentrant_buffer->_pwent_size <= REENTRANTHALFMAXSIZE) {
846 PL_reentrant_buffer->_pwent_size *= 2;
847 Renew(PL_reentrant_buffer->_pwent_buffer,
848 PL_reentrant_buffer->_pwent_size, char);
849 switch (PL_op->op_type) {
851 p0 = va_arg(ap, void *);
852 retptr = getpwnam(p0); break;
854 uid = va_arg(ap, Uid_t);
855 retptr = getpwuid(uid); break;
857 retptr = getpwent(); break;
865 #ifdef USE_PROTOENT_BUFFER
870 if (PL_reentrant_buffer->_protoent_size <= REENTRANTHALFMAXSIZE) {
871 PL_reentrant_buffer->_protoent_size *= 2;
872 Renew(PL_reentrant_buffer->_protoent_buffer,
873 PL_reentrant_buffer->_protoent_size, char);
874 switch (PL_op->op_type) {
876 p0 = va_arg(ap, void *);
877 retptr = getprotobyname(p0); break;
879 anint = va_arg(ap, int);
880 retptr = getprotobynumber(anint); break;
882 retptr = getprotoent(); break;
890 #ifdef USE_SERVENT_BUFFER
895 if (PL_reentrant_buffer->_servent_size <= REENTRANTHALFMAXSIZE) {
896 PL_reentrant_buffer->_servent_size *= 2;
897 Renew(PL_reentrant_buffer->_servent_buffer,
898 PL_reentrant_buffer->_servent_size, char);
899 switch (PL_op->op_type) {
901 p0 = va_arg(ap, void *);
902 p1 = va_arg(ap, void *);
903 retptr = getservbyname(p0, p1); break;
905 anint = va_arg(ap, int);
906 p0 = va_arg(ap, void *);
907 retptr = getservbyport(anint, p0); break;
909 retptr = getservent(); break;
918 /* Not known how to retry, so just fail. */
930 asctime S |time |const struct tm|B_SB|B_SBI|I_SB|I_SBI
931 crypt CC |crypt |struct crypt_data|B_CCS|B_CCD|D=CRYPTD*
932 ctermid B |stdio | |B_B
933 ctime S |time |const time_t |B_SB|B_SBI|I_SB|I_SBI
934 drand48 |stdlib |struct drand48_data |I_ST|T=double*
935 endgrent |grp | |I_H|V_H
936 endhostent |netdb | |I_D|V_D|D=struct hostent_data*
937 endnetent |netdb | |I_D|V_D|D=struct netent_data*
938 endprotoent |netdb | |I_D|V_D|D=struct protoent_data*
939 endpwent |pwd | |I_H|V_H
940 endservent |netdb | |I_D|V_D|D=struct servent_data*
941 getgrent |grp |struct group |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
942 getgrgid T |grp |struct group |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=gid_t
943 getgrnam C |grp |struct group |I_CSBWR|I_CSBIR|S_CBI|I_CSBI|S_CSBI
944 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*
945 gethostbyname C |netdb |struct hostent |I_CSBWRE|S_CSBIE|I_CSD|D=struct hostent_data*
946 gethostent |netdb |struct hostent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct hostent_data*
947 getlogin |unistd | |I_BW|I_BI|B_BW|B_BI
948 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
949 getnetbyname C |netdb |struct netent |I_CSBWRE|I_CSBI|S_CSBI|I_CSD|D=struct netent_data*
950 getnetent |netdb |struct netent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct netent_data*
951 getprotobyname C|netdb |struct protoent|I_CSBWR|S_CSBI|I_CSD|D=struct protoent_data*
952 getprotobynumber I |netdb |struct protoent|I_ISBWR|S_ISBI|I_ISD|D=struct protoent_data*
953 getprotoent |netdb |struct protoent|I_SBWR|I_SBI|S_SBI|I_SD|D=struct protoent_data*
954 getpwent |pwd |struct passwd |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
955 getpwnam C |pwd |struct passwd |I_CSBWR|I_CSBIR|S_CSBI|I_CSBI
956 getpwuid T |pwd |struct passwd |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=uid_t
957 getservbyname CC|netdb |struct servent |I_CCSBWR|S_CCSBI|I_CCSD|D=struct servent_data*
958 getservbyport IC|netdb |struct servent |I_ICSBWR|S_ICSBI|I_ICSD|D=struct servent_data*
959 getservent |netdb |struct servent |I_SBWR|I_SBI|S_SBI|I_SD|D=struct servent_data*
960 getspnam C |shadow |struct spwd |I_CSBWR|S_CSBI
961 gmtime T |time |struct tm |S_TS|I_TS|T=const time_t*
962 localtime T |time |struct tm |S_TS|I_TS|T=const time_t*
963 random |stdlib |struct random_data|I_TS|T=int*
964 readdir T |dirent |struct dirent |I_TSR|I_TS|T=DIR*
965 readdir64 T |dirent |struct dirent64|I_TSR|I_TS|T=DIR*
966 setgrent |grp | |I_H|V_H
967 sethostent I |netdb | |I_ID|V_ID|D=struct hostent_data*
968 setlocale IC |locale | |I_ICBI
969 setnetent I |netdb | |I_ID|V_ID|D=struct netent_data*
970 setprotoent I |netdb | |I_ID|V_ID|D=struct protoent_data*
971 setpwent |pwd | |I_H|V_H
972 setservent I |netdb | |I_ID|V_ID|D=struct servent_data*
973 srand48 L |stdlib |struct drand48_data |I_LS
974 srandom T |stdlib |struct random_data|I_TS|T=unsigned int
975 strerror I |string | |I_IBW|I_IBI|B_IBW
976 tmpnam B |stdio | |B_B
977 ttyname I |unistd | |I_IBW|I_IBI|B_IBI