[BusyBox] dietlibc patch for pre5

Hannes Reinecke hare at suse.de
Fri Jan 30 07:06:19 MST 2004


Hi all,

I've whacked together a patch for dietlibc support for -pre5. It 
basically adds a new configuration option and includes some #defines 
around mempcpy() and strchrnul(), both of which do not exist within 
dietlibc.

btw, I've also fixed an 'interesting' use of strchrnul:

			(*vp->func)(strchrnul(s, '=') + 1);

I.e. if 's' does not contain the character '=', the argument to the 
function will be a pointer to 's + strlen(s) + 1'. Uh-oh.

Comments, suggestions etc. welcome.

Please keep me cc'ed since I'm not on the list.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare at suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
-------------- next part --------------
? busybox-dietlibc.diff
? loop.i
? loop.s
? networking/ping.c.new
Index: Rules.mak
===================================================================
RCS file: /var/cvs/busybox/Rules.mak,v
retrieving revision 1.25
diff -u -r1.25 Rules.mak
--- Rules.mak	21 Dec 2003 09:04:54 -0000	1.25
+++ Rules.mak	30 Jan 2004 12:53:33 -0000
@@ -140,6 +140,15 @@
 # prone to casual user adjustment.
 # 
 
+ifeq ($(strip $(CONFIG_DIETLIBC)),y)
+    # For dietlibc support
+    CC=diet gcc
+    # Dietlibc is roughly BSD
+    CFLAGS+=-D_BSD_SOURCE
+    LIBRARIES:=-lcompat -lrpc
+else
+    CFLAGS+=-D_GNU_SOURCE
+endif
 ifeq ($(strip $(CONFIG_LFS)),y)
     # For large file summit support
     CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
@@ -154,11 +163,11 @@
     endif
 endif
 ifeq ($(strip $(CONFIG_DEBUG)),y)
-    CFLAGS  +=$(WARNINGS) -g -D_GNU_SOURCE
+    CFLAGS  +=$(WARNINGS) -g
     LDFLAGS +=-Wl,-warn-common
     STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
 else
-    CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
+    CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -DNDEBUG
     LDFLAGS += -s -Wl,-warn-common
     STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
 endif
Index: coreutils/dd.c
===================================================================
RCS file: /var/cvs/busybox/coreutils/dd.c,v
retrieving revision 1.54
diff -u -r1.54 dd.c
--- coreutils/dd.c	20 Jun 2003 09:01:52 -0000	1.54
+++ coreutils/dd.c	30 Jan 2004 12:53:33 -0000
@@ -57,7 +57,7 @@
 	off_t skip = 0;
 	int sync_flag = FALSE;
 	int noerror = FALSE;
-	int trunc = TRUE;
+	int trunc_flag = TRUE;
 	int oflag;
 	int ifd;
 	int ofd;
@@ -83,7 +83,7 @@
 			buf = argv[i]+5;
 			while (1) {
 				if (strncmp("notrunc", buf, 7) == 0) {
-					trunc = FALSE;
+					trunc_flag = FALSE;
 					buf += 7;
 				} else if (strncmp("sync", buf, 4) == 0) {
 					sync_flag = TRUE;
@@ -115,7 +115,7 @@
 	if (outfile != NULL) {
 		oflag = O_WRONLY | O_CREAT;
 
-		if (!seek && trunc) {
+		if (!seek && trunc_flag) {
 			oflag |= O_TRUNC;
 		}
 
@@ -123,7 +123,7 @@
 			bb_perror_msg_and_die("%s", outfile);
 		}
 
-		if (seek && trunc) {
+		if (seek && trunc_flag) {
 			if (ftruncate(ofd, seek * bs) < 0) {
 				struct stat st;
 
Index: coreutils/tail.c
===================================================================
RCS file: /var/cvs/busybox/coreutils/tail.c,v
retrieving revision 1.46
diff -u -r1.46 tail.c
--- coreutils/tail.c	31 Oct 2003 00:35:58 -0000	1.46
+++ coreutils/tail.c	30 Jan 2004 12:53:34 -0000
@@ -62,7 +62,13 @@
 static void tail_xprint_header(const char *fmt, const char *filename)
 {
 	/* If we get an output error, there is really no sense in continuing. */
-	if (dprintf(STDOUT_FILENO, fmt, filename) < 0) {
+	if (bb_full_write(STDOUT_FILENO, "\n===> ", 6) < 0) {
+		bb_perror_nomsg_and_die();
+	}
+	if (bb_full_write(STDOUT_FILENO, filename, strlen(filename)) < 0) {
+		bb_perror_nomsg_and_die();
+	}
+	if (bb_full_write(STDOUT_FILENO, " <===\n", 6) < 0) {
 		bb_perror_nomsg_and_die();
 	}
 }
Index: include/libbb.h
===================================================================
RCS file: /var/cvs/busybox/include/libbb.h,v
retrieving revision 1.125
diff -u -r1.125 libbb.h
--- include/libbb.h	17 Jan 2004 05:03:30 -0000	1.125
+++ include/libbb.h	30 Jan 2004 12:53:34 -0000
@@ -33,6 +33,9 @@
 #include <stdint.h>
 
 #include <netdb.h>
+#ifdef __dietlibc__
+#include <netinet/in.h>
+#endif
 
 #ifdef DMALLOC
 #include <dmalloc.h>
Index: libbb/hash_fd.c
===================================================================
RCS file: /var/cvs/busybox/libbb/hash_fd.c,v
retrieving revision 1.4
diff -u -r1.4 hash_fd.c
--- libbb/hash_fd.c	29 Jan 2004 22:33:28 -0000	1.4
+++ libbb/hash_fd.c	30 Jan 2004 12:53:35 -0000
@@ -288,7 +288,7 @@
 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */  };
 # endif	/* MD5SUM_SIZE_VS_SPEED == 0 */
 
-typedef u_int32_t md5_uint32;
+typedef uint32_t md5_uint32;
 
 /* Structure to save state of computation between the single steps.  */
 typedef struct md5_ctx_s {
Index: libbb/mk_loop_h.sh
===================================================================
RCS file: /var/cvs/busybox/libbb/mk_loop_h.sh,v
retrieving revision 1.2
diff -u -r1.2 mk_loop_h.sh
--- libbb/mk_loop_h.sh	17 Feb 2001 00:42:47 -0000	1.2
+++ libbb/mk_loop_h.sh	30 Jan 2004 12:53:35 -0000
@@ -19,6 +19,10 @@
    echo '#include <linux/posix_types.h>'
    echo '#undef dev_t'
    echo '#define dev_t __kernel_dev_t'
+   echo '#include <linux/version.h>'
+   echo '#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)'
+   echo 'typedef uint32_t __kernel_dev_t;'
+   echo '#endif'
 else
    echo '#undef dev_t'
    echo '#define dev_t unsigned short'
Index: libbb/printf.c
===================================================================
RCS file: /var/cvs/busybox/libbb/printf.c,v
retrieving revision 1.2
diff -u -r1.2 printf.c
--- libbb/printf.c	16 Apr 2003 23:02:35 -0000	1.2
+++ libbb/printf.c	30 Jan 2004 12:53:35 -0000
@@ -116,7 +116,23 @@
  * you can extract the information you need from dietstdio.h.  See the
  * other library implementations for examples.
  */
-#error dietlibc is currently not supported.  Please see the commented source.
+
+struct __stdio_file {
+  int fd;
+  int flags;
+  unsigned int bs;	/* read: bytes in buffer */
+  unsigned int bm;	/* position in buffer */
+  unsigned int buflen;	/* length of buf */
+  char *buf;
+  struct __stdio_file *next;	/* for fflush */
+  pid_t popen_kludge;
+  unsigned char ungetbuf;
+  char ungotten;
+};
+
+#define ERRORINDICATOR 1
+
+#define SET_FERROR_UNLOCKED(S)    (((struct __stdio_file *)S)->flags |= ERRORINDICATOR)
 
 #else /* some other lib */
 /* Please see the comments for the above supported libaries for examples
Index: networking/nslookup.c
===================================================================
RCS file: /var/cvs/busybox/networking/nslookup.c,v
retrieving revision 1.30
diff -u -r1.30 nslookup.c
--- networking/nslookup.c	19 Mar 2003 09:12:38 -0000	1.30
+++ networking/nslookup.c	30 Jan 2004 12:53:35 -0000
@@ -46,9 +46,9 @@
 /* only works for IPv4 */
 static int addr_fprint(char *addr)
 {
-	u_int8_t split[4];
-	u_int32_t ip;
-	u_int32_t *x = (u_int32_t *) addr;
+	uint8_t split[4];
+	uint32_t ip;
+	uint32_t *x = (uint32_t *) addr;
 
 	ip = ntohl(*x);
 	split[0] = (ip & 0xff000000) >> 24;
@@ -102,12 +102,12 @@
 }
 
 /* changes a c-string matching the perl regex \d+\.\d+\.\d+\.\d+
- * into a u_int32_t
+ * into a uint32_t
  */
-static u_int32_t str_to_addr(const char *addr)
+static uint32_t str_to_addr(const char *addr)
 {
-	u_int32_t split[4];
-	u_int32_t ip;
+	uint32_t split[4];
+	uint32_t ip;
 
 	sscanf(addr, "%d.%d.%d.%d",
 		   &split[0], &split[1], &split[2], &split[3]);
@@ -131,7 +131,7 @@
 /* lookup the default nameserver and display it */
 static inline void server_print(void)
 {
-	struct sockaddr_in def = _res.nsaddr_list[0];
+	struct sockaddr_in def = *(struct sockaddr_in *)_res.nsaddr_list;
 	char *ip = inet_ntoa(def.sin_addr);
 
 	hostent_fprint(gethostbyaddr_wrapper(ip), "Server:");
Index: networking/ping.c
===================================================================
RCS file: /var/cvs/busybox/networking/ping.c,v
retrieving revision 1.55
diff -u -r1.55 ping.c
--- networking/ping.c	22 Jul 2003 08:56:51 -0000	1.55
+++ networking/ping.c	30 Jan 2004 12:53:35 -0000
@@ -51,6 +51,83 @@
 #include <stdlib.h>
 #include "busybox.h"
 
+#ifdef __dietlibc__
+/* Dietlibc is missing the BSD definition 'struct icmp' */
+/*
+ * Internal of an ICMP Router Advertisement
+ */
+struct icmp_ra_addr
+{
+    uint32_t ira_addr;
+    uint32_t ira_preference;
+};
+
+struct icmp
+{
+    uint8_t  icmp_type;  /* type of message, see below */
+    uint8_t  icmp_code;  /* type sub code */
+    uint16_t icmp_cksum; /* ones complement checksum of struct */
+    union
+    {
+	uint8_t ih_pptr;             /* ICMP_PARAMPROB */
+	struct in_addr ih_gwaddr;   /* gateway address */
+	struct ih_idseq             /* echo datagram */
+	{
+	    uint16_t icd_id;
+	    uint16_t icd_seq;
+	} ih_idseq;
+	uint32_t ih_void;
+
+	/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+	struct ih_pmtu
+	{
+	    uint16_t ipm_void;
+	    uint16_t ipm_nextmtu;
+	} ih_pmtu;
+
+	struct ih_rtradv
+	{
+	    uint8_t irt_num_addrs;
+	    uint8_t irt_wpa;
+	    uint16_t irt_lifetime;
+	} ih_rtradv;
+    } icmp_hun;
+#define icmp_pptr       icmp_hun.ih_pptr
+#define icmp_gwaddr     icmp_hun.ih_gwaddr
+#define icmp_id         icmp_hun.ih_idseq.icd_id
+#define icmp_seq        icmp_hun.ih_idseq.icd_seq
+#define icmp_void       icmp_hun.ih_void
+#define icmp_pmvoid     icmp_hun.ih_pmtu.ipm_void
+#define icmp_nextmtu    icmp_hun.ih_pmtu.ipm_nextmtu
+#define icmp_num_addrs  icmp_hun.ih_rtradv.irt_num_addrs
+#define icmp_wpa        icmp_hun.ih_rtradv.irt_wpa
+#define icmp_lifetime   icmp_hun.ih_rtradv.irt_lifetime
+    union
+    {
+	struct
+	{
+	    uint32_t its_otime;
+	    uint32_t its_rtime;
+	    uint32_t its_ttime;
+	} id_ts;
+	struct
+	{
+	    struct ip idi_ip;
+	    /* options and then 64 bits of data */
+	} id_ip;
+	struct icmp_ra_addr id_radv;
+	uint32_t   id_mask;
+	uint8_t    id_data[1];
+    } icmp_dun;
+#define icmp_otime      icmp_dun.id_ts.its_otime
+#define icmp_rtime      icmp_dun.id_ts.its_rtime
+#define icmp_ttime      icmp_dun.id_ts.its_ttime
+#define icmp_ip         icmp_dun.id_ip.idi_ip
+#define icmp_radv       icmp_dun.id_radv
+#define icmp_mask       icmp_dun.id_mask
+#define icmp_data       icmp_dun.id_data
+};
+#endif /* __dietlibc__ */
 
 static const int DEFDATALEN = 56;
 static const int MAXIPLEN = 60;
Index: networking/libiproute/utils.h
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/utils.h,v
retrieving revision 1.1
diff -u -r1.1 utils.h
--- networking/libiproute/utils.h	10 Nov 2002 01:33:52 -0000	1.1
+++ networking/libiproute/utils.h	30 Jan 2004 12:53:35 -0000
@@ -52,8 +52,8 @@
 #define IPX_NODE_LEN 6
 
 struct ipx_addr {
-	u_int32_t ipx_net;
-	u_int8_t  ipx_node[IPX_NODE_LEN];
+	uint32_t ipx_net;
+	uint8_t  ipx_node[IPX_NODE_LEN];
 };
 
 extern __u32 get_addr32(char *name);
Index: shell/ash.c
===================================================================
RCS file: /var/cvs/busybox/shell/ash.c,v
retrieving revision 1.87
diff -u -r1.87 ash.c
--- shell/ash.c	25 Jan 2004 08:46:10 -0000	1.87
+++ shell/ash.c	30 Jan 2004 12:53:37 -0000
@@ -57,9 +57,11 @@
 
 #define PROFILE 0
 
+#ifndef __dietlibc__
 #ifdef DEBUG
 #define _GNU_SOURCE
 #endif
+#endif
 
 #include <sys/types.h>
 #include <sys/cdefs.h>
@@ -2531,9 +2533,17 @@
 static void
 onint(void) {
 	int i;
+#ifdef __dietlibc__
+	sigset_t signals;
+#endif
 
 	intpending = 0;
+#ifndef __dietlibc__
 	sigsetmask(0);
+#else
+	sigemptyset(&signals);
+	sigprocmask(SIG_SETMASK,&signals,NULL);
+#endif
 	i = EXSIG;
 	if (gotsig[SIGINT - 1] && !trap[SIGINT]) {
 		if (!(rootshell && iflag)) {
@@ -3263,16 +3273,14 @@
 		const char *p = " %s";
 
 		p++;
-		dprintf(preverrout_fd, p, ps4val());
+		xwrite(preverrout_fd,ps4val(),strlen(ps4val()));
 
 		sp = varlist.list;
 		for(n = 0; n < 2; n++) {
 			while (sp) {
-				dprintf(preverrout_fd, p, sp->text);
+				xwrite(preverrout_fd, sp->text,strlen(sp->text));
+				xwrite(preverrout_fd, " ",1);
 				sp = sp->next;
-				if(*p == '%') {
-					p--;
-				}
 			}
 			sp = arglist.list;
 		}
@@ -5817,7 +5825,12 @@
 		}
 		q = r;
 		if (len > 0) {
+#ifdef _GNU_SOURCE
 			q = mempcpy(q, str, len);
+#else
+			memcpy(q, str, len);
+			q += len;
+#endif
 		}
 	}
 	inquotes = (flag & RMESCAPE_QUOTED) ^ RMESCAPE_QUOTED;
@@ -6354,6 +6367,10 @@
 /* pgrp of shell on invocation */
 static int initialpgrp;
 static int ttyfd = -1;
+#ifndef _PATH_TTY
+/* dietlibc has no _PATH_TTY defined */
+#define _PATH_TTY "/dev/tty"
+#endif
 #endif
 /* current job */
 static struct job *curjob;
@@ -6674,7 +6691,15 @@
 #endif
 		}
 		st &= 0x7f;
+#ifdef _GNU_SOURCE		
 		col = fmtstr(s, 32, strsignal(st));
+#else
+		if (st < NSIG && sys_siglist[st]) {
+			col += fmtstr(s, 32, sys_siglist[st]);
+		} else {
+			col += fmtstr(s, 64, "Signal %d", st );
+		}
+#endif
 		if (WCOREDUMP(status)) {
 			col += fmtstr(s + col, 16, " (core dumped)");
 		}
@@ -8373,7 +8398,12 @@
 stnputs(const char *s, size_t n, char *p)
 {
 	p = makestrspace(n, p);
+#ifdef __GNU_SOURCE
 	p = mempcpy(p, s, n);
+#else
+	memcpy(p, s, n);
+	p += n;
+#endif
 	return p;
 }
 
@@ -8452,12 +8482,25 @@
 		char *q;
 		size_t len;
 
+#ifdef __GNU_SOURCE
 		len = strchrnul(s, '\'') - s;
+#else
+		if ((q = strchr(s,'\'')) == NULL) {
+		    len = strlen(s);
+		} else {
+		    len = q - s;
+		}
+#endif
 
 		q = p = makestrspace(len + 3, p);
 
 		*q++ = '\'';
+#ifdef __GNU_SOURCE
 		q = mempcpy(q, s, len);
+#else
+		memcpy(q, s, len);
+		q += len;
+#endif
 		*q++ = '\'';
 		s += len;
 
@@ -8470,7 +8513,12 @@
 		q = p = makestrspace(len + 3, p);
 
 		*q++ = '"';
+#ifdef __GNU_SOURCE
 		q = mempcpy(q, s, len);
+#else
+		memcpy(q, s, len);
+		q += len;
+#endif
 		*q++ = '"';
 		s += len;
 
@@ -11921,7 +11969,13 @@
 	size_t vallen;
 
 	q = endofname(name);
+#ifdef _GNU_SOURCE
 	p = strchrnul(q, '=');
+#else
+	if ((p = strchr(q,'\'')) == NULL) {
+	    p = q + strlen(q);
+	}
+#endif
 	namelen = p - name;
 	if (!namelen || p != q)
 		error("%.*s: bad variable name", namelen, name);
@@ -11932,11 +11986,21 @@
 		vallen = strlen(val);
 	}
 	INTOFF;
+#ifdef _GNU_SOURCE
 	p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
+#else
+	memcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
+	p = nameeq + namelen;
+#endif
 	*p++ = '\0';
 	if (vallen) {
 		p[-1] = '=';
+#ifdef _GNU_SOURCE
 		p = mempcpy(p, val, vallen);
+#else
+		memcpy(p, val, vallen);
+		p += vallen;
+#endif
 	}
 	*p = '\0';
 	setvareq(nameeq, flags | VNOSAVE);
@@ -11964,14 +12028,27 @@
 		if (vp->flags & VREADONLY) {
 			if (flags & VNOSAVE)
 				free(s);
+#ifdef _GNU_SOURCE
 			error("%.*s: is read only", strchrnul(s, '=') - s, s);
+#else
+			if (strchr(s,'=') == NULL) {
+				error("%.*s: is read only", strlen(s), s);
+			} else {
+				error("%.*s: is read only", strchr(s, '=') - s, s);
+			}
+#endif
 		}
 
 		if (flags & VNOSET)
 			return;
 
-		if (vp->func && (flags & VNOFUNC) == 0)
-			(*vp->func)(strchrnul(s, '=') + 1);
+		if (vp->func && (flags & VNOFUNC) == 0) {
+			if (strchr(s, '=')) {
+				(*vp->func)(strchr(s, '=') + 1);
+			} else {
+				(*vp->func)(s);
+			}
+		}
 
 		if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0)
 			ckfree(vp->text);
@@ -12022,7 +12099,9 @@
 	struct var *v;
 
 	if ((v = *findvar(hashvar(name), name)) && !(v->flags & VUNSET)) {
-		return strchrnul(v->text, '=') + 1;
+		if (strchr(v->text, '=')) {
+			return strchr(v->text, '=') + 1;
+		}
 	}
 	return NULL;
 }
@@ -12039,7 +12118,7 @@
 
 	for (sp = cmdenviron ; sp ; sp = sp->next) {
 		if (varequal(sp->text, name))
-			return strchrnul(sp->text, '=') + 1;
+			return strchr(sp->text, '=')?strchr(sp->text, '=') + 1:sp->text;
 	}
 	return lookupvar(name);
 }
@@ -12100,7 +12179,14 @@
 		const char *p;
 		const char *q;
 
+#ifdef _GNU_SOURCE
 		p = strchrnul(*ep, '=');
+#else
+		p = strchr(*ep, '=');
+		if (!p) {
+			p = *ep + strlen(*ep);
+		}
+#endif
 		q = nullstr;
 		if (*p)
 			q = single_quote(++p);
@@ -12235,7 +12321,7 @@
 			unsetvar(vp->text);
 		} else {
 			if (vp->func)
-				(*vp->func)(strchrnul(lvp->text, '=') + 1);
+				(*vp->func)(strchr(lvp->text, '=')?strchr(lvp->text, '=') + 1:lvp->text + strlen(lvp->text));
 			if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0)
 				ckfree(vp->text);
 			vp->flags = lvp->flags;
Index: sysdeps/linux/Config.in
===================================================================
RCS file: /var/cvs/busybox/sysdeps/linux/Config.in,v
retrieving revision 1.12
diff -u -r1.12 Config.in
--- sysdeps/linux/Config.in	22 Oct 2003 09:58:50 -0000	1.12
+++ sysdeps/linux/Config.in	30 Jan 2004 12:53:38 -0000
@@ -135,9 +135,19 @@
 
 menu 'Build Options'
 
+config CONFIG_DIETLIBC
+	bool "Build BusyBox as a static binary against DietLibc"
+	default n
+	help
+	  If you want to build a static BusyBox binary linked against
+	  dietlibc (e.g. for initrd or initramfs), then enable this option.  
+
+	  Most people will leave this set to 'N'.
+
 config CONFIG_STATIC
 	bool "Build BusyBox as a static binary (no shared libs)"
 	default n
+	depends on CONFIG_DIETLIBC = 'n'
 	help
 	  If you want to build a static BusyBox binary, which does not 
 	  use or require any shared libraries, then enable this option.  
Index: util-linux/mkfs_minix.c
===================================================================
RCS file: /var/cvs/busybox/util-linux/mkfs_minix.c,v
retrieving revision 1.39
diff -u -r1.39 mkfs_minix.c
--- util-linux/mkfs_minix.c	6 Aug 2003 07:34:19 -0000	1.39
+++ util-linux/mkfs_minix.c	30 Jan 2004 12:53:39 -0000
@@ -102,13 +102,13 @@
  * Note the 8-bit gid and atime and ctime.
  */
 struct minix_inode {
-	u_int16_t i_mode;
-	u_int16_t i_uid;
-	u_int32_t i_size;
-	u_int32_t i_time;
-	u_int8_t  i_gid;
-	u_int8_t  i_nlinks;
-	u_int16_t i_zone[9];
+	uint16_t i_mode;
+	uint16_t i_uid;
+	uint32_t i_size;
+	uint32_t i_time;
+	uint8_t  i_gid;
+	uint8_t  i_nlinks;
+	uint16_t i_zone[9];
 };
 
 /*
@@ -118,35 +118,35 @@
  * now 16-bit. The inode is now 64 bytes instead of 32.
  */
 struct minix2_inode {
-	u_int16_t i_mode;
-	u_int16_t i_nlinks;
-	u_int16_t i_uid;
-	u_int16_t i_gid;
-	u_int32_t i_size;
-	u_int32_t i_atime;
-	u_int32_t i_mtime;
-	u_int32_t i_ctime;
-	u_int32_t i_zone[10];
+	uint16_t i_mode;
+	uint16_t i_nlinks;
+	uint16_t i_uid;
+	uint16_t i_gid;
+	uint32_t i_size;
+	uint32_t i_atime;
+	uint32_t i_mtime;
+	uint32_t i_ctime;
+	uint32_t i_zone[10];
 };
 
 /*
  * minix super-block data on disk
  */
 struct minix_super_block {
-	u_int16_t s_ninodes;
-	u_int16_t s_nzones;
-	u_int16_t s_imap_blocks;
-	u_int16_t s_zmap_blocks;
-	u_int16_t s_firstdatazone;
-	u_int16_t s_log_zone_size;
-	u_int32_t s_max_size;
-	u_int16_t s_magic;
-	u_int16_t s_state;
-	u_int32_t s_zones;
+	uint16_t s_ninodes;
+	uint16_t s_nzones;
+	uint16_t s_imap_blocks;
+	uint16_t s_zmap_blocks;
+	uint16_t s_firstdatazone;
+	uint16_t s_log_zone_size;
+	uint32_t s_max_size;
+	uint16_t s_magic;
+	uint16_t s_state;
+	uint32_t s_zones;
 };
 
 struct minix_dir_entry {
-	u_int16_t inode;
+	uint16_t inode;
 	char name[0];
 };
 
Index: util-linux/nfsmount.h
===================================================================
RCS file: /var/cvs/busybox/util-linux/nfsmount.h,v
retrieving revision 1.5
diff -u -r1.5 nfsmount.h
--- util-linux/nfsmount.h	9 Mar 2001 22:17:59 -0000	1.5
+++ util-linux/nfsmount.h	30 Jan 2004 12:53:39 -0000
@@ -61,7 +61,7 @@
 typedef char fhandle[FHSIZE];
 
 typedef struct {
-	u_int fhandle3_len;
+	uint32_t fhandle3_len;
 	char *fhandle3_val;
 } fhandle3;
 
@@ -80,7 +80,7 @@
 typedef enum mountstat3 mountstat3;
 
 struct fhstatus {
-	u_int fhs_status;
+	uint32_t fhs_status;
 	union {
 		fhandle fhs_fhandle;
 	} fhstatus_u;
@@ -90,8 +90,8 @@
 struct mountres3_ok {
 	fhandle3 fhandle;
 	struct {
-		u_int auth_flavours_len;
-		int *auth_flavours_val;
+		uint32_t auth_flavours_len;
+		int32_t *auth_flavours_val;
 	} auth_flavours;
 };
 typedef struct mountres3_ok mountres3_ok;


More information about the busybox mailing list