This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 2
[perl5.git] / do / bind
1 int
2 do_bind(stab, arglast)
3 STAB *stab;
4 int *arglast;
5 {
6     register STR **st = stack->ary_array;
7     register int sp = arglast[1];
8     register STIO *stio;
9     char *addr;
10
11     if (!stab)
12         goto nuts;
13
14     stio = stab_io(stab);
15     if (!stio || !stio->ifp)
16         goto nuts;
17
18     addr = str_get(st[++sp]);
19 #ifdef TAINT
20     taintproper("Insecure dependency in bind");
21 #endif
22     return bind(fileno(stio->ifp), addr, st[sp]->str_cur) >= 0;
23
24 nuts:
25     if (dowarn)
26         warn("bind() on closed fd");
27     errno = EBADF;
28     return FALSE;
29
30 }
31