Lines Matching full:ni
144 struct sem_nameinfo *ni; in _sem_open() local
148 ni = NULL; in _sem_open()
177 LIST_FOREACH(ni, &sem_list, next) { in _sem_open()
178 if (ni->name != NULL && strcmp(name, ni->name) == 0) { in _sem_open()
182 ni = NULL; in _sem_open()
186 O_EXCL) || ni->dev != sb.st_dev || in _sem_open()
187 ni->ino != sb.st_ino) { in _sem_open()
188 ni->name = NULL; in _sem_open()
189 ni = NULL; in _sem_open()
192 ni->open_count++; in _sem_open()
193 sem = ni->sem; in _sem_open()
200 len = sizeof(*ni) + strlen(name) + 1; in _sem_open()
201 ni = (struct sem_nameinfo *)malloc(len); in _sem_open()
202 if (ni == NULL) { in _sem_open()
207 ni->name = (char *)(ni+1); in _sem_open()
208 strcpy(ni->name, name); in _sem_open()
235 ni->open_count = 1; in _sem_open()
236 ni->sem = sem; in _sem_open()
237 ni->dev = sb.st_dev; in _sem_open()
238 ni->ino = sb.st_ino; in _sem_open()
239 LIST_INSERT_HEAD(&sem_list, ni, next); in _sem_open()
250 free(ni); in _sem_open()
259 struct sem_nameinfo *ni; in _sem_close() local
273 LIST_FOREACH(ni, &sem_list, next) { in _sem_close()
274 if (sem == ni->sem) { in _sem_close()
275 last = --ni->open_count == 0; in _sem_close()
277 LIST_REMOVE(ni, next); in _sem_close()
281 free(ni); in _sem_close()