MCPcopy Create free account
hub / github.com/F-Stack/f-stack / devioctl

Function devioctl

freebsd/kern/subr_bus.c:523–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523static int
524devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
525{
526 switch (cmd) {
527 case FIONBIO:
528 if (*(int*)data)
529 devsoftc.nonblock = 1;
530 else
531 devsoftc.nonblock = 0;
532 return (0);
533 case FIOASYNC:
534 if (*(int*)data)
535 devsoftc.async = 1;
536 else
537 devsoftc.async = 0;
538 return (0);
539 case FIOSETOWN:
540 return fsetown(*(int *)data, &devsoftc.sigio);
541 case FIOGETOWN:
542 *(int *)data = fgetown(&devsoftc.sigio);
543 return (0);
544
545 /* (un)Support for other fcntl() calls. */
546 case FIOCLEX:
547 case FIONCLEX:
548 case FIONREAD:
549 default:
550 break;
551 }
552 return (ENOTTY);
553}
554
555static int
556devpoll(struct cdev *dev, int events, struct thread *td)

Callers

nothing calls this directly

Calls 2

fsetownFunction · 0.85
fgetownFunction · 0.85

Tested by

no test coverage detected