3 * _allocufb.c - get a free ufb (SAS/C)
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
15 * Allocate new ufb, which is returned as return value. The corresponding fd
16 * is returned via fdp.
21 struct UFB
*ufb
, *last_ufb
;
27 last_ufb
= ufb
= __ufbs
;
28 while (ufb
!= NULL
&& ufb
->ufbflg
!= 0) {
31 ufb
= last_ufb
->ufbnxt
;
34 * Check if need to create one
37 if ((ufb
= malloc(sizeof(*ufb
))) == NULL
) {
42 ufb
->ufbflg
= 0; /* => unused ufb */
47 last_ufb
->ufbnxt
= ufb
;