From owner-freebsd-questions@FreeBSD.ORG Fri Dec 24 10:21:53 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E3F106564A for ; Fri, 24 Dec 2010 10:21:53 +0000 (UTC) (envelope-from hedayati.mo@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 63EFF8FC08 for ; Fri, 24 Dec 2010 10:21:52 +0000 (UTC) Received: by wwf26 with SMTP id 26so6631421wwf.31 for ; Fri, 24 Dec 2010 02:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=iE2g3F6DVCoKadaGtwV95oHtKKBs2PTy4/okv9M4CMY=; b=nReroBeLDksBlIUgCY+gcdm7p9oDEhu/h0lzPnVPGyxUaLBxH0ajtlAgIH3rdV9aDp /ko2cVX6dVSfK0a8ToNO1R+TZzMcl6mx36xOn1Ab9YUjAcmYaTcAytcmzJFt/VObemZM H7Y4kCl8qXNGAJ6W5uK/YW53KkWA5DRPLJn9c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=azNCKVXzCUPSBfHa072OO1ngQFv+Y59qmoZQ5BPW89+q+qVpw8i3vr9sw+3iAPy9yx KLWqp7w60TLwTCoqEVCf1KLOUCQ0bwdDMv/4SFJ27sutV+IVufMmhGnhFTcjPsz441cB QJQdSsUkZHe0vhMG3AIieYn+5dmRSO0/xcSuQ= Received: by 10.227.176.134 with SMTP id be6mr5604062wbb.147.1293186112240; Fri, 24 Dec 2010 02:21:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.143.202 with HTTP; Fri, 24 Dec 2010 02:21:12 -0800 (PST) From: Mohammad Hedayati Date: Fri, 24 Dec 2010 13:51:12 +0330 Message-ID: To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Inappropriate ioctl for device X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2010 10:21:53 -0000 I'm writing a simple char device. So far everything went so good (read/write), but here I'm going to add support for ioctl. int ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int error = 0; uprintf("Here...\n"); return(error); } and I'm calling it here: len = ioctl(cd, 0); perror("ioctl"); but when runnig it says: ioctl: Inappropriate ioctl for device where's the problem?