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

Re: busybox under the Hurd



Roland McGrath wrote:
> 
> > The ones that didnt compile either made system calls, or included
> > libraries that wernt found under the hurd <linux/*>.
> 
> We would really like you to be specific about these things.  If you give
> too much information the first time, we can always ignore it.  It takes
> time to send snippets back and forth and ask a lot of questions.
> 

busybox: ping.c fails due to undeclared MAXHOSTNAMELEN, it is defined in
rpc/types.h, it is also defined in asm/param.h. ping.c gets its value
via sys/param.h which calls linux/param.h which calls asm/param.h.
I can get around this easily enough by calling rpc/types.h under both
linux and hurd.

ping.c also fails with a dereferencing pointer to incomplete type, the
type in question is struct iphdr, under linux it is defined in
netinet/ip.h however the version of netinet/ip.h under the Hurd doesnt
have struct iphdr defined.

which.c fails due to undeclared PATH_MAX, which is declared under
linux/limits.h at value 4095, path max doesnt seem to be declared
anywhere under hurd, i guess i can do an #ifndef PATH_MAX  #define
PATH_MAX 4095

gzip.c fails because it depends on gunzip.c

gunzip.c fails due to a redefinition of basename due to the following
code in gunzip.c

#ifndef __linux__
static char *basename(char *fname);
#endif

I commented out that section and it worked, so i think i need to do
something like
#ifndef __linux__ || ifndef __hurd__
static char *basename(char *fname);
#endif

Is __hurd__ a valid name to check if compiling under hurd, thats just a
guess/assumption on my part.


free.c, init.c, uname.c and uptime.c all depend on struct sysinfo which
is defined in linux/kernel.h, it has the following structure.

struct sysinfo {
	long uptime;
	unsigned long loads[3]
	unsigned long totalram
	unsigned long freeram
	unsigned long sharedram
	unsigned long bufferedram
	unsigned long totalswap
	unsigned long freeswap
	unsigned short procs
	char _f[22]
}

init.c uses sysinfo to check available memory before starting.
uname.c uses sysinfo to get cpu name (i think) 
uptime.c uses it to get uptime (obviously)
free.c uses it to get memory info.

I guess there are similar things for sysinfo in hurd somwhere.


Thanks

Glenn



Reply to: