FreeBSD Bugzilla – Attachment 8451 Details for
Bug 17703
/usr/share/examples/kld/cdev won't compile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.95 KB, created by
bryan
on 2000-03-31 06:50:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
bryan
Created:
2000-03-31 06:50:00 UTC
Size:
1.95 KB
patch
obsolete
>diff -rc cdev-old/module/cdevmod.c cdev/module/cdevmod.c >*** cdev-old/module/cdevmod.c Thu Mar 30 21:19:48 2000 >--- cdev/module/cdevmod.c Thu Mar 30 21:17:15 2000 >*************** >*** 81,99 **** > /* read */ noread, > /* write */ nowrite, > /* ioctl */ mydev_ioctl, >- /* stop */ nostop, >- /* reset */ noreset, >- /* devtotty */ nodevtotty, > /* poll */ nopoll, > /* mmap */ nommap, > /* strategy */ nostrategy, > /* name */ "cdev", >- /* parms */ noparms, > /* maj */ CDEV_MAJOR, > /* dump */ nodump, > /* psize */ nopsize, > /* flags */ D_TTY, >- /* maxio */ 0, > /* bmaj */ -1 > }; > >--- 81,94 ---- >*************** >*** 109,115 **** > */ > > static int >! cdev_load(module_t mod, int cmd, void *arg) > { > int err = 0; > >--- 104,110 ---- > */ > > static int >! cdev_modevent(module_t mod, int cmd, void *arg) > { > int err = 0; > >*************** >*** 117,122 **** >--- 112,119 ---- > case MOD_LOAD: > > /* Do any initialization that you should do with the kernel */ >+ cdevsw_add(&my_devsw); >+ make_dev(&my_devsw, 0, UID_ROOT, GID_OPERATOR, 0644, "%s", "cdev"); > > /* if we make it to here, print copyright on console*/ > printf("\nSample Loaded kld character device driver\n"); >*************** >*** 126,135 **** > break; /* Success*/ > > case MOD_UNLOAD: > printf("Unloaded kld character device driver\n"); > break; /* Success*/ > >! default: /* we only understand load/unload*/ > err = EINVAL; > break; > } >--- 123,136 ---- > break; /* Success*/ > > case MOD_UNLOAD: >+ /* fall through */ >+ case MOD_SHUTDOWN: >+ cdevsw_remove(&my_devsw); >+ > printf("Unloaded kld character device driver\n"); > break; /* Success*/ > >! default: > err = EINVAL; > break; > } >*************** >*** 139,142 **** > > /* Now declare the module to the system */ > >! DEV_MODULE(cdev, CDEV_MAJOR, -1, my_devsw, cdev_load, 0); >--- 140,143 ---- > > /* Now declare the module to the system */ > >! DEV_MODULE(cdev, cdev_modevent, NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 17703
: 8451