From owner-freebsd-net@FreeBSD.ORG Thu Dec 23 18:30:38 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0CE9106566B for ; Thu, 23 Dec 2010 18:30:38 +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 4CF3E8FC17 for ; Thu, 23 Dec 2010 18:30:37 +0000 (UTC) Received: by wwf26 with SMTP id 26so6122010wwf.31 for ; Thu, 23 Dec 2010 10:30:37 -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=UR9rJu8LyhE+C46DmZESqcJR7rzyZVn37oM6rKkJv0A=; b=tqsBJb5nvDY9qkPnhdpCjaXruSsXAhGnzpGwQYCPAKOKytAojHHDKMPYu6bYitE2nO qnspXOB46er2gK0/bwkatV5C8kU0IQaU6il2JT8h/yx1tDys84owbBrN7eFzVs4ftFXD 0OVfzIuy9fSH1BCa7nnaiKZfgKa8fnNfWSmuw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=JUcIhJfC2wLV+1/I6JuSMzCoL0/ipE6mg1dIEeOfoqzovs3i+Fgh0yeaidzP2mxMYG NxtRz2ioHnKe+neDuQfkymh74jEfYFKOLNbthwQhc9qQULaOpNTeSfxAbzlP8DN1UQxF NwlTi7FSXTs9+8EKmHVh9R/qc5aJYXxvUZB8w= Received: by 10.227.176.134 with SMTP id be6mr5175896wbb.147.1293129037114; Thu, 23 Dec 2010 10:30:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.143.202 with HTTP; Thu, 23 Dec 2010 10:29:57 -0800 (PST) From: Mohammad Hedayati Date: Thu, 23 Dec 2010 21:59:57 +0330 Message-ID: To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Inappropriate ioctl for device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2010 18:30:38 -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?