Lines Matching refs:state
33 if (nfd >= 0 && ofd >= 0 && ofd < elementsof(state.file))
35 if (state.cache)
37 if (!(state.file[ofd].flags & FILE_OPEN))
39 state.file[nfd] = state.file[ofd];
40 state.file[nfd].flags &= ~FILE_CLOEXEC;
41 state.file[nfd].reserved = 0;
42 if (nfd > state.cache)
43 state.cache = nfd;
44 if (nfd > state.open)
45 state.open = nfd;
46 if (mp = state.file[nfd].mount)
48 for (mp = state.global; mp; mp = mp->global)
53 if (state.file[nfd].dir)
55 free(state.file[nfd].dir);
56 state.file[nfd].dir = 0;
58 if (state.file[ofd].dir && (state.file[nfd].dir = newof(0, Dir_t, 1, strlen(state.file[ofd].dir->path))))
60 strcpy(state.file[nfd].dir->path, state.file[ofd].dir->path);
61 state.file[nfd].dir->dev = state.file[ofd].dir->dev;
62 state.file[nfd].dir->ino = state.file[ofd].dir->ino;
81 if (r >= 0 && r < elementsof(state.file))