- if (index == -1)
- index = 0; /* historical behaviour; XXX broken */
- else
- index = -index; /* start at least this far up in the table */
- devsw = &cdevsw[index];
- for(; index < nchrdev; index++, devsw++) {
- if(memcmp((char *)devsw,
- (char *)&nocdev,
- sizeof(struct cdevsw)) == 0)
- break;
- }
- }
- devsw = &cdevsw[index];
- if ((index < 0) || (index >= nchrdev) ||
- (memcmp((char *)devsw,
- (char *)&nocdev,
- sizeof(struct cdevsw)) != 0)) {
- return(-1);