[MPlayer-dev-eng] Re: [PATCH] GNU/kFreeBSD support
Robert Millan
rmh at aybabtu.com
Wed Aug 24 22:34:29 CEST 2005
On Tue, Aug 23, 2005 at 04:53:30PM -0400, Rich Felker wrote:
> On Tue, Aug 23, 2005 at 09:39:44AM +0200, Robert Millan wrote:
> > On Tue, Aug 23, 2005 at 01:10:47AM +0200, Diego Biurrun wrote:
> > > > > > -#ifdef __linux__
> > > > > > +#if defined(__linux__) || (defined(__GLIBC__) && (defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)))
> > > > >
> > > > > Are you sure about this NetBSD change?
> > > >
> > > > I'm the person who made the Debian GNU/kNetBSD port (the one based on Glibc).
> > > > Although currently stalled, this system follows closely the configuration of
> > > > its sister GNU/kFreeBSD, which provides Linux-style procfs.
> > > >
> > > > If you feel this is too sloppy, though, I'd remove the __NetBSD_kernel__ part.
> > >
> > > It looks as though just __GLIBC__ should be enough.
> >
> > The problem with that is that procfs is a kernel feature, and this code uses
> > Linux-style features (/proc/mounts). We cannot garantee that all Glibc systems
^^^^^^^^^^^^
Sorry, I meant to say /proc/cpuinfo here.
> > have these features (and in fact, I think GNU/Hurd doesn't).
>
> If it needs both, it should be linux && glibc, not ||
It doesn't really need Glibc. But on BSDish kernels it's common to use
BSD-style /proc, so if we just check for __FreeBSD_kernel__ we could be wrong.
However, the code that follows doesn't seem to do anything nasty if
/proc/cpuinfo doesn't exist, so I suggest to just enable it unconditionaly.
[...]
{
char buf[20];
char line[200];
FILE *f = fopen ("/proc/cpuinfo", "r");
if (!f)
return;
[...]
I can send a patch for that if you like.
--
Robert Millan
More information about the MPlayer-dev-eng
mailing list