This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More paranoid _r protochecking. At least Tru64 and
[perl5.git] / reentr.pl
CommitLineData
10bc17b6
JH
1#!/usr/bin/perl -w
2
3#
4# Generate the reentr.c and reentr.h,
5# and optionally also the relevant metaconfig units (-U option).
6#
7
8use strict;
9use Getopt::Std;
10my %opts;
11getopts('U', \%opts);
12
13my %map = (
14 V => "void",
15 A => "char*", # as an input argument
16 B => "char*", # as an output argument
17 C => "const char*", # as a read-only input argument
18 I => "int",
19 L => "long",
20 W => "size_t",
21 H => "FILE**",
22 E => "int*",
23 );
24
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".)
28#
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".
32#
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)
36
37
38die "reentr.h: $!" unless open(H, ">reentr.h");
39select H;
40print <<EOF;
41/*
42 * reentr.h
43 *
44 * Copyright (c) 1997-2002, Larry Wall
45 *
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.
48 *
49 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
50 * This file is built by reentrl.pl from data in reentr.pl.
51 */
52
53#ifndef REENTR_H
54#define REENTR_H
55
56#ifdef USE_REENTRANT_API
57
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. */
63
64#ifdef __hpux
65# undef HAS_CRYPT_R
66# undef HAS_DRAND48_R
efa45b01
JH
67# undef HAS_ENDGRENT_R
68# undef HAS_ENDPWENT_R
10bc17b6
JH
69# undef HAS_GETGRENT_R
70# undef HAS_GETPWENT_R
71# undef HAS_SETLOCALE_R
72# undef HAS_SRAND48_R
73# undef HAS_STRERROR_R
74# define NETDB_R_OBSOLETE
75#endif
76
77#if defined(__osf__) && defined(__alpha) /* Tru64 aka Digital UNIX */
78# undef HAS_CRYPT_R
79# undef HAS_STRERROR_R
80# define NETDB_R_OBSOLETE
81#endif
82
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
104#endif
105
106#ifdef I_PWD
107# include <pwd.h>
108#endif
109#ifdef I_GRP
110# include <grp.h>
111#endif
112#ifdef I_NETDB
113# include <netdb.h>
114#endif
115#ifdef I_STDLIB
116# include <stdlib.h> /* drand48_data */
117#endif
118#ifdef I_CRYPT
119# ifdef I_CRYPT
120# include <crypt.h>
121# endif
122#endif
123#ifdef HAS_GETSPNAM_R
124# ifdef I_SHADOW
125# include <shadow.h>
126# endif
127#endif
128
129EOF
130
131my %seenh;
132my %seena;
133my @seenf;
134my %seenp;
135my %seent;
136my %seens;
137my %seend;
138my %seenu;
139
140while (<DATA>) {
141 next if /^\s+$/;
142 chomp;
143 my ($f, $h, $t, @p) = split(/\s*\|\s*/, $_, -1);
144 my $u;
145 ($f, $u) = split(' ', $f);
146 $seenu{$f} = defined $u ? length $u : 0;
147 my $F = uc $f;
148 push @seenf, $f;
149 my %m = %map;
150 if ($t) {
151 $m{S} = "$t*";
152 $m{R} = "$t**";
153 }
154 if (@p) {
155 while ($p[-1] =~ /=/) {
156 my ($k, $v) = ($p[-1] =~ /^([A-Za-z])\s*=\s*(.*)/);
157 $m{$k} = $v;
158 pop @p;
159 }
160 }
161 if ($opts{U} && open(U, ">d_${f}_r.U")) {
162 select U;
163 }
164 my $prereqh = $h eq 'stdio' ? '' : "i_$h"; # There's no i_stdio.
165 print <<EOF if $opts{U};
166?RCS: \$Id: d_${f}_r.U,v $
167?RCS:
168?RCS: Copyright (c) 2002 Jarkko Hietaniemi
169?RCS:
170?RCS: You may distribute under the terms of either the GNU General Public
171?RCS: License or the Artistic License, as specified in the README file.
172?RCS:
173?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
174?RCS:
a48ec845 175?MAKE:d_${f}_r ${f}_r_proto: Inlibc Protochk Hasproto i_systypes $prereqh
10bc17b6
JH
176?MAKE: -pick add \$@ %<
177?S:d_${f}_r:
178?S: This variable conditionally defines the HAS_${F}_R symbol,
179?S: which indicates to the C program that the ${f}_r()
180?S: routine is available.
181?S:.
182?S:${f}_r_proto:
183?S: This variable encodes the prototype of ${f}_r.
184?S:.
185?C:HAS_${F}_R:
186?C: This symbol, if defined, indicates that the ${f}_r routine
187?C: is available to ${f} re-entrantly.
188?C:.
189?C:${F}_R_PROTO:
190?C: This symbol encodes the prototype of ${f}_r.
191?C:.
192?H:#\$d_${f}_r HAS_${F}_R /**/
193?H:#define ${F}_R_PROTO \$${f}_r_proto /**/
194?H:.
a48ec845 195?T:try hdrs d_${f}_r_proto
10bc17b6
JH
196?LINT:set d_${f}_r
197?LINT:set ${f}_r_proto
198: see if ${f}_r exists
199set ${f}_r d_${f}_r
200eval \$inlibc
201case "\$d_${f}_r" in
202"\$define")
203 hdrs="\$i_systypes sys/types.h define stdio.h \$i_${h} $h.h"
a48ec845
JH
204 case "\$d_${f}_r_proto" in
205 '') d_${f}_r_proto=define
206 set d_${f}_r_proto ${f}_r \$hdrs
207 eval \$hasproto ;;
208 *) ;;
209 esac
210 case "\$d_${f}_r_proto" in
211 define)
10bc17b6
JH
212EOF
213 for my $p (@p) {
214 my ($r, $a) = ($p =~ /^(.)_(.+)/);
215 my $v = join(", ", map { $m{$_} } split '', $a);
216 if ($opts{U}) {
217 print <<EOF ;
218 case "\$${f}_r_proto" in
219 ''|0) try='$m{$r} ${f}_r($v);'
220 ./protochk "extern \$try" \$hdrs && ${f}_r_proto=$p ;;
221 esac
222EOF
223 }
224 $seenh{$f}->{$p}++;
225 push @{$seena{$f}}, $p;
226 $seenp{$p}++;
227 $seent{$f} = $t;
228 $seens{$f} = $m{S};
229 $seend{$f} = $m{D};
230 }
231 if ($opts{U}) {
232 print <<EOF;
233 case "\$${f}_r_proto" in
234 '') d_${f}_r=undef
235 ${f}_r_proto=0
a48ec845 236 echo "Disabling ${f}_r, cannot determine prototype." >&4 ;;
10bc17b6
JH
237 * ) case "\$${f}_r_proto" in
238 REENTRANT_PROTO*) ;;
239 *) ${f}_r_proto="REENTRANT_PROTO_\$${f}_r_proto" ;;
240 esac
241 echo "Prototype: \$try" ;;
242 esac
243 ;;
a48ec845
JH
244 *) echo "You have ${f}_r but no prototype, not using it." >&4 ;;
245 esac
246 ;;
10bc17b6
JH
247*) ${f}_r_proto=0
248 ;;
249esac
250
251EOF
252 close(U);
253 }
254}
255
256close DATA;
257
258select H;
259
260{
261 my $i = 1;
262 for my $p (sort keys %seenp) {
263 print "#define REENTRANT_PROTO_${p} ${i}\n";
264 $i++;
265 }
266}
267
268sub ifprotomatch {
269 my $F = shift;
270 join " || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @_;
271}
272
273my @struct;
274my @size;
275my @init;
276my @free;
277my @wrap;
278my @define;
279
280sub pushssif {
281 push @struct, @_;
282 push @size, @_;
283 push @init, @_;
284 push @free, @_;
285}
286
287sub pushinitfree {
288 my $f = shift;
289 push @init, <<EOF;
290 New(31338, PL_reentrant_buffer->_${f}_buffer, PL_reentrant_buffer->_${f}_size, char);
291EOF
292 push @free, <<EOF;
293 Safefree(PL_reentrant_buffer->_${f}_buffer);
294EOF
295}
296
297sub define {
298 my ($n, $p, @F) = @_;
299 my @H;
300 my $H = uc $F[0];
301 push @define, <<EOF;
302/* The @F using \L$n? */
303
304EOF
305 for my $f (@F) {
306 my $F = uc $f;
307 my $h = "${F}_R_HAS_$n";
308 push @H, $h;
309 my @h = grep { /$p/ } @{$seena{$f}};
310 if (@h) {
09310450 311 push @define, "#if defined(HAS_${F}_R) && (" . join(" || ", map { "${F}_R_PROTO == REENTRANT_PROTO_$_" } @h) . ")\n";
10bc17b6
JH
312
313 push @define, <<EOF;
314# define $h
315#else
316# undef $h
317#endif
318EOF
319 }
320 }
321 push @define, <<EOF;
322
323/* Any of the @F using \L$n? */
324
325EOF
326 push @define, "#if (" . join(" || ", map { "defined($_)" } @H) . ")\n";
327 push @define, <<EOF;
328# define USE_${H}_$n
329#else
330# undef USE_${H}_$n
331#endif
332
333EOF
334}
335
336define('PTR', 'R',
337 qw(getgrent getgrgid getgrnam));
338define('PTR', 'R',
339 qw(getpwent getpwnam getpwuid));
340define('PTR', 'R',
341 qw(getspent getspnam));
342
343define('FPTR', 'H',
344 qw(getgrent getgrgid getgrnam));
345define('FPTR', 'H',
346 qw(getpwent getpwnam getpwuid));
347
348define('PTR', 'R',
349 qw(gethostent gethostbyaddr gethostbyname));
350define('PTR', 'R',
351 qw(getnetent getnetbyaddr getnetbyname));
352define('PTR', 'R',
353 qw(getprotoent getprotobyname getprotobynumber));
354define('PTR', 'R',
355 qw(getservent getservbyname getservbyport));
356
357define('ERRNO', 'E',
358 qw(gethostent gethostbyaddr gethostbyname));
359define('ERRNO', 'E',
360 qw(getnetent getnetbyaddr getnetbyname));
361
362for my $f (@seenf) {
363 my $F = uc $f;
364 my $ifdef = "#ifdef HAS_${F}_R\n";
365 my $endif = "#endif /* HAS_${F}_R */\n";
366 if (exists $seena{$f}) {
367 my @p = @{$seena{$f}};
368 if ($f =~ /^(asctime|ctime|getlogin|setlocale|strerror|ttyname)$/) {
369 pushssif $ifdef;
370 push @struct, <<EOF;
371 char* _${f}_buffer;
372 size_t _${f}_size;
373EOF
374 push @size, <<EOF;
375 PL_reentrant_buffer->_${f}_size = 256; /* Make something up. */
376EOF
377 pushinitfree $f;
378 pushssif $endif;
379 }
380 elsif ($f =~ /^(crypt|drand48|gmtime|localtime|random)$/) {
381 pushssif $ifdef;
382 push @struct, <<EOF;
383 $seent{$f} _${f}_struct;
384EOF
385 if ($f eq 'crypt') {
386 push @init, <<EOF;
387#ifdef __GLIBC__
388 PL_reentrant_buffer->_${f}_struct.initialized = 0;
389#endif
390EOF
391 }
392 if ($1 eq 'drand48') {
393 push @struct, <<EOF;
394 double _${f}_double;
395EOF
396 }
397 pushssif $endif;
398 }
399 elsif ($f =~ /^(getgrnam|getpwnam|getspnam)$/) {
400 pushssif $ifdef;
401 my $g = $f;
402 $g =~ s/nam/ent/g;
403 my $G = uc $g;
404 push @struct, <<EOF;
405 $seent{$f} _${g}_struct;
406 char* _${g}_buffer;
407 size_t _${g}_size;
408EOF
409 push @struct, <<EOF;
410# ifdef USE_${G}_PTR
411 $seent{$f}* _${g}_ptr;
412# endif
413EOF
414 if ($g eq 'getspent') {
415 push @size, <<EOF;
416 PL_reentrant_buffer->_${g}_size = 1024;
417EOF
418 } else {
419 push @struct, <<EOF;
420# ifdef USE_${G}_FPTR
421 FILE* _${g}_fptr;
422# endif
423EOF
424 push @init, <<EOF;
425# ifdef USE_${G}_FPTR
426 PL_reentrant_buffer->_${g}_fptr = NULL;
427# endif
428EOF
429 my $sc = $g eq 'getgrent' ?
430 '_SC_GETGR_R_SIZE_MAX' : '_SC_GETPW_R_SIZE_MAX';
431 push @size, <<EOF;
432# if defined(HAS_SYSCONF) && defined($sc) && !defined(__GLIBC__)
433 PL_reentrant_buffer->_${g}_size = sysconf($sc);
434# else
435# if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
436 PL_reentrant_buffer->_${g}_size = SIABUFSIZ;
437# else
438# ifdef __sgi
439 PL_reentrant_buffer->_${g}_size = BUFSIZ;
440# else
441 PL_reentrant_buffer->_${g}_size = 2048;
442# endif
443# endif
444# endif
445EOF
446 }
447 pushinitfree $g;
448 pushssif $endif;
449 }
450 elsif ($f =~ /^(gethostbyname|getnetbyname|getservbyname|getprotobyname)$/) {
451 pushssif $ifdef;
452 my $g = $f;
453 $g =~ s/byname/ent/;
454 my $G = uc $g;
455 my $D = ifprotomatch($F, grep {/D/} @p);
456 my $d = $seend{$f};
457 push @struct, <<EOF;
458 $seent{$f} _${g}_struct;
459# if $D
460 $d _${g}_data;
461# else
462 char* _${g}_buffer;
463 size_t _${g}_size;
464# endif
465# ifdef USE_${G}_PTR
466 $seent{$f}* _${g}_ptr;
467# endif
468EOF
469 push @struct, <<EOF;
470# ifdef USE_${G}_ERRNO
471 int _${g}_errno;
472# endif
473EOF
474 push @size, <<EOF;
475#if !($D)
476 PL_reentrant_buffer->_${g}_size = 2048; /* Any better ideas? */
477#endif
478EOF
479 push @init, <<EOF;
480#if !($D)
481 New(31338, PL_reentrant_buffer->_${g}_buffer, PL_reentrant_buffer->_${g}_size, char);
482#endif
483EOF
484 push @free, <<EOF;
485#if !($D)
486 Safefree(PL_reentrant_buffer->_${g}_buffer);
487#endif
488EOF
489 pushssif $endif;
490 }
491 elsif ($f =~ /^(readdir|readdir64)$/) {
492 pushssif $ifdef;
493 my $R = ifprotomatch($F, grep {/R/} @p);
494 push @struct, <<EOF;
495 $seent{$f}* _${f}_struct;
496 size_t _${f}_size;
497# if $R
498 $seent{$f}* _${f}_ptr;
499# endif
500EOF
501 push @size, <<EOF;
502 /* This is the size Solaris recommends.
503 * (though we go static, should use pathconf() instead) */
504 PL_reentrant_buffer->_${f}_size = sizeof($seent{$f}) + MAXPATHLEN + 1;
505EOF
506 push @init, <<EOF;
507 PL_reentrant_buffer->_${f}_struct = ($seent{$f}*)safemalloc(PL_reentrant_buffer->_${f}_size);
508EOF
509 push @free, <<EOF;
510 Safefree(PL_reentrant_buffer->_${f}_struct);
511EOF
512 pushssif $endif;
513 }
514
515 push @wrap, $ifdef;
516
517# Doesn't implement the buffer growth loop for glibc gethostby*().
518 push @wrap, <<EOF;
519# undef $f
520EOF
521 my @v = 'a'..'z';
522 my $v = join(", ", @v[0..$seenu{$f}-1]);
523 for my $p (@p) {
524 my ($r, $a) = split '_', $p;
525 my $test = $r eq 'I' ? ' == 0' : '';
526 my $true = 1;
527 my $false = 0;
528 my $g = $f;
529 if ($g =~ /^(?:get|set|end)(pw|gr|host|net|proto|serv|sp)/) {
530 $g = "get$1ent";
531 } elsif ($g eq 'srand48') {
532 $g = "drand48";
533 }
534 my $b = $a;
535 my $w = '';
536 substr($b, 0, $seenu{$f}) = '';
537 if ($b =~ /R/) {
538 $true = "PL_reentrant_buffer->_${g}_ptr";
539 } elsif ($b =~ /T/ && $f eq 'drand48') {
540 $true = "PL_reentrant_buffer->_${g}_double";
541 } elsif ($b =~ /S/) {
542 if ($f =~ /^readdir/) {
543 $true = "PL_reentrant_buffer->_${g}_struct";
544 } else {
545 $true = "&PL_reentrant_buffer->_${g}_struct";
546 }
547 } elsif ($b =~ /B/) {
548 $true = "PL_reentrant_buffer->_${g}_buffer";
549 }
550 if (length $b) {
551 $w = join ", ",
552 map {
553 $_ eq 'R' ?
554 "&PL_reentrant_buffer->_${g}_ptr" :
555 $_ eq 'E' ?
556 "&PL_reentrant_buffer->_${g}_errno" :
557 $_ eq 'B' ?
558 "PL_reentrant_buffer->_${g}_buffer" :
559 $_ =~ /^[WI]$/ ?
560 "PL_reentrant_buffer->_${g}_size" :
561 $_ eq 'H' ?
562 "&PL_reentrant_buffer->_${g}_fptr" :
563 $_ eq 'D' ?
564 "&PL_reentrant_buffer->_${g}_data" :
565 $_ eq 'S' ?
566 ($f =~ /^readdir/ ?
567 "PL_reentrant_buffer->_${g}_struct" :
568 "&PL_reentrant_buffer->_${g}_struct" ) :
569 $_ eq 'T' && $f eq 'drand48' ?
570 "&PL_reentrant_buffer->_${g}_double" :
571 $_
572 } split '', $b;
573 $w = ", $w" if length $v;
574 }
575 my $call = "${f}_r($v$w)";
576 $call = "((errno = $call))" if $r eq 'I';
577 push @wrap, <<EOF;
578# if !defined($f) && ${F}_R_PROTO == REENTRANT_PROTO_$p
579EOF
580 if ($r eq 'V' || $r eq 'B') {
581 push @wrap, <<EOF;
582# define $f($v) $call
583EOF
584 } else {
585 push @wrap, <<EOF;
586# define $f($v) ($call$test ? $true : $false)
587EOF
588 }
589 push @wrap, <<EOF;
590# endif
591EOF
592 }
593
594 push @wrap, $endif, "\n";
595 }
596}
597
598local $" = '';
599
600print <<EOF;
601
602/* Defines for indicating which special features are supported. */
603
604@define
605typedef struct {
606@struct
607} REENTR;
608
609/* The wrappers. */
610
611@wrap
612#endif /* USE_REENTRANT_API */
613
614#endif
615
616EOF
617
618close(H);
619
620die "reentr.c: $!" unless open(C, ">reentr.c");
621select C;
622print <<EOF;
623/*
624 * reentr.c
625 *
626 * Copyright (c) 1997-2002, Larry Wall
627 *
628 * You may distribute under the terms of either the GNU General Public
629 * License or the Artistic License, as specified in the README file.
630 *
631 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
632 * This file is built by reentrl.pl from data in reentr.pl.
633 *
634 * "Saruman," I said, standing away from him, "only one hand at a time can
635 * wield the One, and you know that well, so do not trouble to say we!"
636 *
637 */
638
639#include "EXTERN.h"
640#define PERL_IN_REENTR_C
641#include "perl.h"
642#include "reentr.h"
643
644void
645Perl_reentrant_size(pTHX) {
646#ifdef USE_REENTRANT_API
647@size
648#endif /* USE_REENTRANT_API */
649}
650
651void
652Perl_reentrant_init(pTHX) {
653#ifdef USE_REENTRANT_API
654 New(31337, PL_reentrant_buffer, 1, REENTR);
655 Perl_reentrant_size(aTHX);
656@init
657#endif /* USE_REENTRANT_API */
658}
659
660void
661Perl_reentrant_free(pTHX) {
662#ifdef USE_REENTRANT_API
663@free
664 Safefree(PL_reentrant_buffer);
665#endif /* USE_REENTRANT_API */
666}
667
668EOF
669
670__DATA__
671asctime S |time |const struct tm|B_SB|B_SBI|I_SB|I_SBI
672crypt CC |crypt |struct crypt_data|B_CCS
673ctermid B |stdio | |B_B
674ctime S |time |const time_t |B_SB|B_SBI|I_SB|I_SBI
675drand48 |stdlib |struct drand48_data |I_ST|T=double*
676endgrent |grp | |I_H|V_H
677endhostent |netdb |struct hostent_data |I_S|V_S
678endnetent |netdb |struct netent_data |I_S|V_S
679endprotoent |netdb |struct protoent_data |I_S|V_S
680endpwent |pwd | |I_H|V_H
681endservent |netdb |struct servent_data |I_S|V_S
682getgrent |grp |struct group |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
683getgrgid T |grp |struct group |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=gid_t
684getgrnam C |grp |struct group |I_CSBWR|I_CSBIR|S_CBI|I_CSBI|S_CSBI
685gethostbyaddr 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*
686gethostbyname C |netdb |struct hostent |I_CSBWRE|S_CSBIE|I_CSD|D=struct hostent_data*
687gethostent |netdb |struct hostent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct hostent_data*
688getlogin |unistd | |I_BW|I_BI|B_BW|B_BI
689getnetbyaddr 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
690getnetbyname C |netdb |struct netent |I_CSBWRE|I_CSBI|S_CSBI|I_CSD|D=struct netent_data*
691getnetent |netdb |struct netent |I_SBWRE|I_SBIE|S_SBIE|S_SBI|I_SBI|I_SD|D=struct netent_data*
692getprotobyname C|netdb |struct protoent|I_CSBWR|S_CSBI|I_CSD|D=struct protoent_data*
693getprotobynumber I |netdb |struct protoent|I_ISBWR|S_ISBI|I_ISD|D=struct protoent_data*
694getprotoent |netdb |struct protoent|I_SBWR|I_SBI|S_SBI|I_SD|D=struct protoent_data*
695getpwent |pwd |struct passwd |I_SBWR|I_SBIR|S_SBW|S_SBI|I_SBI|I_SBIH
696getpwnam C |pwd |struct passwd |I_CSBWR|I_CSBIR|S_CSBI|I_CSBI
697getpwuid T |pwd |struct passwd |I_TSBWR|I_TSBIR|I_TSBI|S_TSBI|T=uid_t
698getservbyname CC|netdb |struct servent |I_CCSBWR|S_CCSBI|I_CCSD|D=struct servent_data*
699getservbyport IC|netdb |struct servent |I_ICSBWR|S_ICSBI|I_ICSD|D=struct servent_data*
700getservent |netdb |struct servent |I_SBWR|I_SBI|S_SBI|I_SD|D=struct servent_data*
701getspnam C |shadow |struct spwd |I_CSBWR|S_CSBI
702gmtime T |time |struct tm |S_TS|I_TS|T=const time_t*
703localtime T |time |struct tm |S_TS|I_TS|T=const time_t*
704random |stdlib |struct random_data|I_TS|T=int*
705readdir T |dirent |struct dirent |I_TSR|I_TS|T=DIR*
706readdir64 T |dirent |struct dirent64|I_TSR|I_TS|T=DIR*
707setgrent |grp | |I_H|V_H
708sethostent I |netdb | |I_ID|V_ID|D=struct hostent_data*
709setlocale IC |locale | |I_ICBI
710setnetent I |netdb | |I_ID|V_ID|D=struct netent_data*
711setprotoent I |netdb | |I_ID|V_ID|D=struct protoent_data*
712setpwent |pwd | |I_H|V_H
713setservent I |netdb | |I_ID|V_ID|D=struct servent_data*
714srand48 L |stdlib |struct drand48_data |I_LS
715srandom T |stdlib |struct random_data|I_TS|T=unsigned int
716strerror I |string | |I_IBW|I_IBI|B_IBW
717tmpnam B |stdio | |B_B
718ttyname I |unistd | |I_IBW|I_IBI|B_IBI