2 do_getsockname(optype, stab, arglast)
7 register STR **st = stack->ary_array;
8 register int sp = arglast[1];
16 if (!stio || !stio->ifp)
19 st[sp] = str_2mortal(Str_new(22,257));
20 st[sp]->str_cur = 256;
22 fd = fileno(stio->ifp);
25 if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
29 if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
38 warn("get{sock,peer}name() on closed fd");