Lines Matching refs:idx
241 int idx; in fd_slot_alloc() local
244 for (idx = startfd; idx < (int)fdt->maxfd; idx++) in fd_slot_alloc()
246 if (fdt->fds[idx] == RT_NULL) in fd_slot_alloc()
248 return idx; in fd_slot_alloc()
252 idx = fdt->maxfd; in fd_slot_alloc()
253 if (idx < startfd) in fd_slot_alloc()
255 idx = startfd; in fd_slot_alloc()
257 if (fd_slot_expand(fdt, idx) < 0) in fd_slot_alloc()
261 return idx; in fd_slot_alloc()
276 int idx; in fd_alloc() local
279 idx = fd_slot_alloc(fdt, startfd); in fd_alloc()
282 if (idx < 0) in fd_alloc()
294 fdt->fds[idx] = fd; in fd_alloc()
296 return idx; in fd_alloc()
307 int idx; in fdt_fd_new() local
313 idx = fd_alloc(fdt, DFS_STDIO_OFFSET); in fdt_fd_new()
316 if (idx < 0) in fdt_fd_new()
322 return idx; in fdt_fd_new()