From owner-freebsd-questions@FreeBSD.ORG Sat Dec 16 19:42:03 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 103FD16A416 for ; Sat, 16 Dec 2006 19:42:03 +0000 (UTC) (envelope-from af300wsm@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7013C43F36 for ; Sat, 16 Dec 2006 19:37:54 +0000 (GMT) (envelope-from af300wsm@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so1024788uge for ; Sat, 16 Dec 2006 11:37:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Gv1D9g5uf7mp5hvA+9mJ9YROj9p+Gkd3q+A7OgSF9txpPjZ1TJF7sMlHQt/E1fxFX+qQWGicfO7PLRUZxibc6hjl4kF0Fl92r6PZQZI+zcg4fxdOqivD+kA3UN5rxEQ8AO0cK1dLMgwmOViAjw15ey6P9UhbvWPUJgmsEDmOyj4= Received: by 10.78.171.13 with SMTP id t13mr685411hue.1166297860816; Sat, 16 Dec 2006 11:37:40 -0800 (PST) Received: by 10.78.149.18 with HTTP; Sat, 16 Dec 2006 11:37:40 -0800 (PST) Message-ID: <340a29540612161137j69850888t9dcffa9f7cd04e47@mail.gmail.com> Date: Sat, 16 Dec 2006 12:37:40 -0700 From: "Andrew Falanga" To: Lane , freebsd-questions In-Reply-To: <200612081205.10243.lane@joeandlane.com> MIME-Version: 1.0 References: <340a29540612080921i7d202e4dn7f8378c5341aeca2@mail.gmail.com> <200612081205.10243.lane@joeandlane.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: compilation problems with some code from Linux 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: Sat, 16 Dec 2006 19:42:03 -0000 On 12/8/06, Lane wrote: > > On Friday 08 December 2006 11:21, Andrew Falanga wrote: > > Hi, > > > > I'm trying to port some code from Linux to FreeBSD and I've got an issue > > that revolves around something I've never dealt with before. The code > > includes the following header: > > > > #include > > > > Apparently, program is attempting to make use of the xucred structure > > defined in there, because the rest of the stuff in the file seems to be > for > > the kernel. However, when I try to compile, gcc continually bails with > the > > following error (among others), "NGROUPS was not declared in this > scope." > > The NGROUPS appears to be a macro, but it's not defined earlier > on. Would > > anyone here know where it's defined so I can include that file too? > > > > Secondly, I'm also getting errors because gcc can't find > > either. True enough, there isn't any vfs.h file in /usr/include/sys. > > Since this file is in Linux, what should I include for FreeBSD? > > > > Thanks, > > Andy > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to > > "freebsd-questions-unsubscribe@freebsd.org" > Andy, > > I won't pretend to know exactly which header files correspond for your > port, > but in the past I've found some things that work for me: > > use > > locate vfs.h > > to find similar file names. On 6.x and 5.x I see that these are possible > candidates: > > /usr/X11R6/include/gnome-vfs-2.0/libgnomevfs/gnome-vfs.h > /usr/include/fs/devfs/devfs.h > /usr/include/sys/statvfs.h > /usr/local/include/af_vfs.h > /usr/src/sys/compat/svr4/svr4_statvfs.h > /usr/src/sys/fs/devfs/devfs.h > /usr/src/sys/nfs4client/nfs4_vfs.h > /usr/src/sys/sys/statvfs.h > > > But you'd have to compare the functions and structures defined in > sys/vfs.h on > linux to determine which is your best match up. > > There is /usr/ports/devel/mipsel-linux-kernel-headers/ which, according to > pkg-plist will install mipsel-linux/include/linux/vfs.h. That may be > exactly > what you need (although it may be overkill). Or it may be the LAST thing > you > need :) > > Sometimes a porter will simply create a patch file > in /usr/ports//files that will create a skeleton version of the > file which includes only the items you need. I've done this for > development > on my own system. > > As far as the NGROUP or other macros ... yikes! You may have to recreate > that > functionality entirely. > > I ran this: > > #!/bin/sh > for each in `locate .h | grep '\.h$'` > do > if [ -f $each ]; then > MYF=`cat $each | grep -i ngroups` > if [ "x$MYF" != "x" ]; then > echo $each : "$MYF" > fi > MYF="" > fi > done > > > It could probably be done more easily with sed and some elbow grease, but > it > does show NGROUPS defined here: > > /usr/X11R6/include/X11/Xos.h : #define NGROUPS 16 > > and > > /usr/include/sys/param.h > > among other places. > > Good luck! > > lane > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > Thank you everyone. I'm sorry that I didn't reply sooner. I did get this worked out, but unfortunately I don't remember the include file I had to use. I found in a different file than the one I was editing at the time I wrote this a nice comment explaining why the "#include " preprocessor directive was there. I found that function in a different include file for FreeBSD, changed the code and all was well. Thanks again. Andy