Deleted Added
full compact
testcdev.c (118385) testcdev.c (202603)
1/* 08 Nov 1998*/
2/*
3 * testmisc.c
4 *
5 * Test program to call the sample loaded kld device driver.
6 *
7 * 05 Jun 93 Rajesh Vaidheeswarran Original
8 *

--- 54 unchanged lines hidden (view full) ---

63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 *
70 *
1/* 08 Nov 1998*/
2/*
3 * testmisc.c
4 *
5 * Test program to call the sample loaded kld device driver.
6 *
7 * 05 Jun 93 Rajesh Vaidheeswarran Original
8 *

--- 54 unchanged lines hidden (view full) ---

63 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 *
70 *
71 * $FreeBSD: head/share/examples/kld/cdev/test/testcdev.c 118385 2003-08-03 10:39:29Z mbr $
71 * $FreeBSD: head/share/examples/kld/cdev/test/testcdev.c 202603 2010-01-18 23:13:22Z wkoszek $
72 */
72 */
73#include <sys/types.h>
74#include <sys/ioccom.h>
73
74#include <stdio.h>
75
76#include <stdio.h>
77#include <stdlib.h>
75#include <fcntl.h>
76#include <paths.h>
77#include <string.h>
78#include <fcntl.h>
79#include <paths.h>
80#include <string.h>
78#include <sys/types.h>
79#include <sys/ioccom.h>
81#include <unistd.h>
80
81#define CDEV_IOCTL1 _IOR('C', 1, u_int)
82#define CDEV_DEVICE "cdev"
83
84static char writestr[] = "Hello kernel!";
85static char buf[512+1];
86
87int
82
83#define CDEV_IOCTL1 _IOR('C', 1, u_int)
84#define CDEV_DEVICE "cdev"
85
86static char writestr[] = "Hello kernel!";
87static char buf[512+1];
88
89int
88main(int argc, char *argv[])
90main(int argc __unused, char *argv[] __unused)
89{
90 int kernel_fd;
91 int one;
92 int len;
93
94 if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDWR)) == -1) {
95 perror("/dev/" CDEV_DEVICE);
96 exit(1);

--- 27 unchanged lines hidden ---
91{
92 int kernel_fd;
93 int one;
94 int len;
95
96 if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDWR)) == -1) {
97 perror("/dev/" CDEV_DEVICE);
98 exit(1);

--- 27 unchanged lines hidden ---