From owner-freebsd-questions Mon Sep 13 19:21:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 7980A14F15 for ; Mon, 13 Sep 1999 19:21:45 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id LAA17863; Tue, 14 Sep 1999 11:51:46 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id LAA26050; Tue, 14 Sep 1999 11:51:42 +0930 (CST) Date: Tue, 14 Sep 1999 11:51:42 +0930 From: Greg Lehey To: Mark Ovens , Ben Smithurst Cc: "Michael W. Akers" , questions@FreeBSD.ORG Subject: Re: Where's the source Luke? Message-ID: <19990914115142.Z10106@freebie.lemis.com> References: <19990913200752.A2529@marder-1> <19990913222616.A48265@lithium.scientia.demon.co.uk> <01BEFDE7.E679FEA0@c67050-a.plstn1.sfba.home.com> <19990913235609.A276@marder-1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <19990913235609.A276@marder-1>; from Mark Ovens on Mon, Sep 13, 1999 at 11:56:09PM +0100 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Monday, 13 September 1999 at 23:56:09 +0100, Mark Ovens wrote: > On Mon, Sep 13, 1999 at 01:00:04PM -0700, Michael W. Akers wrote: >> On Monday, September 13, 1999 12:08 PM, Mark Ovens wrote: >>> To: questions@FreeBSD.ORG >>> Subject: Where's the source Luke? >>> >>> Can someone tell me where to find the source code for ioctl()? I've >>> searched all the .c files under /usr/src/sys and have found plenty >>> of functions called xxxx_ioctl, e.g. kbd_ioctl(), but not a plain >>> ``ioctl()''. >>> >>> I'm beginning to think that a call to ioctl() gets mapped to some >>> function specific to the device. >>> >>> The particular instance I'm interested in is in video_mode() in >>> vidcontrol.c: >>> >>> if (*index < argc) { >>> for (i = 0; modes[i].name != NULL; ++i) { >>> if (!strcmp(argv[*index], modes[i].name)) { >>> mode = modes[i].mode; >>> break; >>> } >>> } >>> >>> if (modes[i].name == NULL) >>> return; >>> =====>> if (ioctl(0, mode, NULL) < 0) <<=============== >>> warn("cannot set videomode"); >>> >>> Thanks. >> >> Found it in /usr/src/lib/libstand > > Thanks:) > > Since it's part of the kernel I figured it would be under /usr/src/sys. > Guess I should have started one level higher. No, that's for the standalone utilities. On Monday, 13 September 1999 at 22:26:16 +0100, Ben Smithurst wrote: > Mark Ovens wrote: > >> Can someone tell me where to find the source code for ioctl()? I've >> searched all the .c files under /usr/src/sys and have found plenty >> of functions called xxxx_ioctl, e.g. kbd_ioctl(), but not a plain >> ``ioctl()''. > > It seems to be in /sys/kern/sys_generic.c. Just grep for ^ioctl This is the correct answer. Use ctags or etags to find function definitions. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message