[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: porting coreutils 5.2.1 to Interix

From: Jim Meyering
Subject: Re: porting coreutils 5.2.1 to Interix
Date: Sun, 04 Apr 2004 17:28:24 +0200

"Mark Funkenhauser" <address@hidden> wrote:
> I've ported the coreutils to Interix.

Thanks for the report and patches.
Please include unified diffs in the future.

> Here are some of the problems I encountered:
> configure:
>   - around line 27329 - you exit if not getmntent/getmntinfo api is
> found.
>     There's a "FIXME" comment here.
>     Interix doesn't provide any of these routines in their distribution
> libraries.
>     So configure exits.
>     All I did was comment out the exit statements.
>     I did not find any problems by doing this.
>     (although I didn't look too closely at the build output)

Without getmntent or similar support, df won't work at all.
Doesn't Interix have some sort of interface for determining
how much space is used on each file system?  If so, we can
extend the autoconf macro in m4/ls-mntd-fs.m4 so that it
works for Interix, too.

> src/stat.c:
>    [ see the attached  stat.c.diff file ]
>    You assume (in configure - see HAVE_STRUCT_STATVFS_F_BASETYPE)
>    that the struct statvfs contains the f_basetype member.
>    This would be incorrect.
>    You assume that all OS's have the statfs() function.

Actually, I wasn't quite so presumptuous :)
I merely noted that all systems that I knew about -- and that I
considered reasonable porting targets -- met those conditions.
This is the first I've heard that Interix is different in this respect.

>    This is incorrect. Interix only supports  statvfs().

I'll look into this later.

> src/mknod.c:
>   - Interix defines a mkdev() macro, not a makedev() macro.
>     The diff output is:
>       193a194,197
>       > #ifdef __INTERIX
>       > #define makedev mkdev
>       > #endif

Are you sure Interix has no makedev macro?
Could it be defined in some other system header file?
That seems like such a gratuitous (and easy to remedy)
Would you please look?

Assuming there really is no macro with the `makedev' spelling,
I'll need to know which file to include to get the mkdev definition.
The file to change will probably be src/system.h, near the code that
already handles a missing `major' macro/function.

> src/uname.c:
>   - Interix has the processor name as a member of the struct utsname
>     So I moved the declaration of 'name' into a more global scope
>     so that is is accessible around line 266.
>     The diff is:
>       $ diff uname.c.orig uname.c
>       > #ifdef __INTERIX
>       >       {
>       >       element = name.processor;
>       >       }

I'll add something like this to one of the autoconf source files

  AC_CHECK_MEMBERS([struct utsname.processor],,,[#include <sys/utsname.h>])

Then we can use


rather than a system-specific conditional like __INTERIX.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]