Fix the cdev kld example.

PR:		52954
Submitted by:	Priit Piipuu <priit.piipuu@mail.ee>
Reviewed by:	phk
This commit is contained in:
Martin Blapp 2003-08-03 10:39:29 +00:00
parent 745f330503
commit fffc6e58d9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118385
4 changed files with 14 additions and 23 deletions

View File

@ -4,13 +4,4 @@
KMOD= cdev
SRCS= cdev.c cdevmod.c
/dev/cdev:
mknod ${.TARGET} c 32 0
un/dev/cdev: .PHONY
rm -f /dev/cdev
.include <bsd.kmod.mk>
load: /dev/cdev
unload: un/dev/cdev

View File

@ -75,23 +75,20 @@
#include "cdev.h"
#if __FreeBSD_version < 500000
#define CDEV_MAJOR 32
#else
#define CDEV_MAJOR MAJOR_AUTO
#endif
static struct cdevsw my_devsw = {
/* open */ mydev_open,
/* close */ mydev_close,
/* read */ mydev_read,
/* write */ mydev_write,
/* ioctl */ mydev_ioctl,
/* poll */ nopoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "cdev",
/* maj */ CDEV_MAJOR,
/* dump */ nodump,
/* psize */ nopsize,
/* flags */ D_TTY,
/* bmaj */ -1
/* open */ .d_open = mydev_open,
/* close */ .d_close = mydev_close,
/* read */ .d_read = mydev_read,
/* write */ .d_write = mydev_write,
/* ioctl */ .d_ioctl = mydev_ioctl,
/* name */ .d_name = "cdev",
/* maj */ .d_maj = CDEV_MAJOR
};
/*

View File

@ -89,4 +89,6 @@ unload:
@echo
${MODSTAT} -n cdev
install:
.include <bsd.prog.mk>

View File

@ -75,6 +75,7 @@
#include <fcntl.h>
#include <paths.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ioccom.h>
#define CDEV_IOCTL1 _IOR('C', 1, u_int)