--- include/avm_wrap.h	1970-01-01 01:00:00.000000000 +0100
+++ include/avm_wrap.h	2008-01-08 15:05:43.000000000 +0100
@@ -0,0 +1,17 @@
+/* avm_wrap.h
+ * Author: André Raupach
+ * Erstellt: November, 2007
+ * Beschreibung: Diese H-Datei enthält wrapper definitionen und funktionen welche alte 
+ *               obsolete Funktionsaufrufe auf neuere wrappen. Dadurch werden Fehler z.B. in den
+ *               WLAN-TOOLS vermieden.
+ */
+#ifndef __AVM_WRAP_H__
+#define __AVM_WRAP_H__
+static inline char *index(const char *string, int charactar) {
+    return strchr(string, charactar);
+}
+
+static inline void bzero( void *pointer, size_t counter) {
+    memset(pointer, '\0', counter);
+}
+#endif
--- include/string.h	2006-11-29 22:12:13.000000000 +0100
+++ include/string.h	2007-12-05 11:53:32.000000000 +0100
@@ -20,6 +20,7 @@
  *	ISO C99 Standard: 7.21 String handling	<string.h>
  */
 
+
 #ifndef	_STRING_H
 #define	_STRING_H	1
 
--- include/time.h	2006-01-29 16:08:58.000000000 +0100
+++ include/time.h	2007-09-18 14:47:06.000000000 +0200
@@ -181,9 +181,12 @@
 
 
 __BEGIN_NAMESPACE_STD
+
+#ifndef clock
 /* Time used by the program so far (user time + system time).
    The result / CLOCKS_PER_SECOND is program time in seconds.  */
 extern clock_t clock (void) __THROW;
+#endif
 
 /* Return the current time and put it in *TIMER if TIMER is not NULL.  */
 extern time_t time (time_t *__timer) __THROW;
--- libc/inet/resolv.c	2007-04-23 19:01:05.000000000 +0200
+++ libc/inet/resolv.c	2008-08-15 09:27:16.000000000 +0200
@@ -150,12 +150,15 @@
 #include <resolv.h>
 #include <netdb.h>
 #include <ctype.h>
-#include <stdbool.h>
 #include <arpa/nameser.h>
 #include <sys/utsname.h>
 #include <sys/un.h>
 #include <bits/uClibc_mutex.h>
 
+#ifndef bool
+#define bool unsigned
+#endif
+
 __UCLIBC_MUTEX_EXTERN(__resolv_lock);
 
 libc_hidden_proto(memcpy)
@@ -214,8 +217,10 @@
 
 
 #define MAX_RECURSE 5
-#define REPLY_TIMEOUT 10
-#define MAX_RETRIES 3
+/*--- #define MAX_RETRIES 3 ---*/
+#define MAX_RETRIES __attempts 
+/*--- #define REPLY_TIMEOUT 10 ---*/
+#define REPLY_TIMEOUT __timeout  
 #define MAX_SERVERS 3
 #define MAX_SEARCH 4
 
@@ -239,6 +244,8 @@
 extern char * __nameserver[MAX_SERVERS] attribute_hidden;
 extern int __searchdomains attribute_hidden;
 extern char * __searchdomain[MAX_SEARCH] attribute_hidden;
+extern int __attempts;
+extern int __timeout;
 
 
 
@@ -736,6 +743,8 @@
 	    goto fail;
 
 	DPRINTF("Looking up type %d answer for '%s'\n", type, name);
+    DPRINTF("max attempts: %d (macro %d)\n", __attempts, MAX_RETRIES);
+    DPRINTF("timeout: %d (macro %d)\n", __timeout, REPLY_TIMEOUT);
 
 	/* Mess with globals while under lock */
 	__UCLIBC_MUTEX_LOCK(mylock);
@@ -791,6 +800,8 @@
 
 		DPRINTF("On try %d, sending query to port %d of machine %s\n",
 				retries+1, NAMESERVER_PORT, dns);
+        DPRINTF("max attempts: %d (macro %d)\n", __attempts, MAX_RETRIES);
+        DPRINTF("timeout: %d (macro %d)\n", __timeout, REPLY_TIMEOUT);
 
 #ifdef __UCLIBC_HAS_IPV6__
 		__UCLIBC_MUTEX_LOCK(__resolv_lock);
@@ -1025,6 +1036,8 @@
 char * __nameserver[MAX_SERVERS];
 int __searchdomains;
 char * __searchdomain[MAX_SEARCH];
+int __attempts = 3;
+int __timeout = 10;
 
 __UCLIBC_MUTEX_INIT(__resolv_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP);
 
@@ -1084,6 +1097,20 @@
 						DPRINTF("adding search %s\n", argv[i]);
 					}
 				}
+
+				if (strcmp(argv[0], "options") == 0) {
+                    DPRINTF("hit options keyword\n");
+                    for (i = 1; i < argc; i++) {
+                        if (strncmp(argv[i], "timeout:", 8) == 0) {
+                            __timeout = atoi(&argv[i][8]);
+                            DPRINTF("set timeout value %d\n", __timeout);
+                        }
+                        if (strncmp(argv[i], "attempts:", 9) == 0) {
+                            __attempts = atoi(&argv[i][9]);
+                            DPRINTF("set attempts value %d\n", __attempts);
+                        }
+                    }
+                }
 			}
 			fclose(fp);
 			DPRINTF("nameservers = %d\n", __nameservers);
@@ -1700,7 +1727,7 @@
 int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
 	struct hostent **result, int *h_errnop)
 {
-    int ret;
+    int ret = HOST_NOT_FOUND;
 
     __UCLIBC_MUTEX_LOCK(mylock);
     if (__gethostent_fp == NULL) {
--- libc/string/mips/memcpy.S	2006-11-04 20:48:12.000000000 +0100
+++ libc/string/mips/memcpy.S	2007-09-03 14:16:52.000000000 +0200
@@ -153,7 +153,10 @@
 #  define SWLO	swl		/* low part is left in little-endian	*/
 #endif
 
-ENTRY (memcpy)
+  .globl memcpy;
+  .align 2;
+  .ent memcpy,0;
+memcpy:
 	.set	noreorder
 
 	slti	t0, a2, 8		# Less than 8?
--- libc/string/mips/memset.S	2006-11-04 20:48:12.000000000 +0100
+++ libc/string/mips/memset.S	2007-09-03 14:16:52.000000000 +0200
@@ -99,7 +99,10 @@
 # define SWHI	swr		/* high part is right in little-endian	*/
 #endif
 
-ENTRY (memset)
+  .globl memset;
+  .align 2;
+  .ent memset,0;
+memset:
 	.set	noreorder
 
 	slti	t1, a2, 8		# Less than 8?
--- libc/sysdeps/linux/mips/bits/socket.h	2006-12-06 22:46:56.000000000 +0100
+++ libc/sysdeps/linux/mips/bits/socket.h	2007-11-30 15:46:32.000000000 +0100
@@ -267,9 +267,12 @@
 #define CMSG_SPACE(len) (CMSG_ALIGN (len) \
 			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
 #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
-
-extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr,
-				      struct cmsghdr *__cmsg)) __THROW;
+//ARA
+//extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr,
+//				      struct cmsghdr *__cmsg)) __THROW;
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+//END ARA
 #ifdef __USE_EXTERN_INLINES
 # ifndef _EXTERN_INLINE
 #  define _EXTERN_INLINE extern __inline
--- libc/sysdeps/linux/mips/crt1.S	2006-11-04 20:53:15.000000000 +0100
+++ libc/sysdeps/linux/mips/crt1.S	2007-09-03 14:16:52.000000000 +0200
@@ -132,6 +132,7 @@
 	move $10, $29		/* stack_end */
 #endif
 	jal __uClibc_main
+    nop
 hlt:
 	/* Crash if somehow `__uClibc_main' returns anyway.  */
 	b   hlt
--- libc/sysdeps/linux/mips/crti.S	2006-11-04 20:53:15.000000000 +0100
+++ libc/sysdeps/linux/mips/crti.S	2007-09-03 14:16:52.000000000 +0200
@@ -4,10 +4,10 @@
 	.section .mdebug.abi32
 	.previous
 	.abicalls
-#APP
+## APP
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_init
 	.ent	_init
@@ -23,13 +23,13 @@
 	.cprestore 16
 	sw	$31,28($sp)
 	sw	$28,24($sp)
-#APP
+## APP
 	
 	.align 2
 	.end _init
 	
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_fini
 	.ent	_fini
@@ -45,7 +45,7 @@
 	.cprestore 16
 	sw	$31,28($sp)
 	sw	$28,24($sp)
-#APP
+## APP
 	.align 2
 	.end _fini
 	
@@ -55,10 +55,10 @@
 	.section .mdebug.abiN32
 	.previous
 	.abicalls
-#APP
+## APP
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.align	3
 	.globl	_init
@@ -74,13 +74,13 @@
 	addu	$28,$28,$25
 	addiu	$28,$28,%lo(%neg(%gp_rel(_init)))
 	sd	$31,8($sp)
-#APP
+## APP
 	
 	.align 3
 	.end _init
 
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.align	3
 	.globl	_fini
@@ -96,7 +96,7 @@
 	addu	$28,$28,$25
 	addiu	$28,$28,%lo(%neg(%gp_rel(_fini)))
 	sd	$31,8($sp)
-#APP
+## APP
 	.align 3
 	.end _fini
 	
@@ -110,7 +110,7 @@
 	
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_init
 	.ent	_init
@@ -127,13 +127,13 @@
 	addiu	$1,$1,%lo(%neg(%gp_rel(_init)))
 	daddu	$gp,$1,$25
 	.set	at
-#APP
+## APP
 	
 	.align 2
 	.end _init
 	
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_fini
 	.ent	_fini
--- libc/sysdeps/linux/mips/crtn.S	2006-11-04 20:53:15.000000000 +0100
+++ libc/sysdeps/linux/mips/crtn.S	2007-09-03 14:16:52.000000000 +0200
@@ -4,17 +4,17 @@
 	.section .mdebug.abi32
 	.previous
 	.abicalls
-#APP
+## APP
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_init
 	.ent	_init
 	.type	_init, @function
-#NO_APP
+## NO_APP
 	lw	$31,28($sp)
-	#nop
+##   nop
 	.set	noreorder
 	.set	nomacro
 	j	$31
@@ -23,17 +23,17 @@
 	.set	reorder
 
 	.end	_init
-#APP
+## APP
 	
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_fini
 	.ent	_fini
 	.type	_fini, @function
-#NO_APP
+## NO_APP
 	lw	$31,28($sp)
-	#nop
+##  nop
 	.set	noreorder
 	.set	nomacro
 	j	$31
@@ -42,7 +42,7 @@
 	.set	reorder
 
 	.end	_fini
-#APP
+## APP
 	
 	.ident	"GCC: (GNU) 3.3.2"
 #elif _MIPS_SIM == _MIPS_SIM_NABI32
@@ -50,16 +50,16 @@
 	.section .mdebug.abiN32
 	.previous
 	.abicalls
-#APP
+## APP
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.align	3
 	.globl	_init
 	.ent	_init
 	.type	_init, @function
-#NO_APP
+## NO_APP
 	ld	$31,8($sp)
 	ld	$28,0($sp)
 	.set	noreorder
@@ -70,16 +70,16 @@
 	.set	reorder
 
 	.end	_init
-#APP
+## APP
 	
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.align	3
 	.globl	_fini
 	.ent	_fini
 	.type	_fini, @function
-#NO_APP
+## NO_APP
 	ld	$31,8($sp)
 	ld	$28,0($sp)
 	.set	noreorder
@@ -90,7 +90,7 @@
 	.set	reorder
 
 	.end	_fini
-#APP
+## APP
 	
 	.ident	"GCC: (GNU) 3.4.3"
 #else /* N64 */
@@ -98,16 +98,16 @@
 	.section .mdebug.abi64
 	.previous
 	.abicalls
-#APP
+## APP
 	
 	
 	.section .init
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_init
 	.ent	_init
 	.type	_init, @function
-#NO_APP
+## NO_APP
 	ld	$31,24($sp)
 	ld	$28,16($sp)
 	#nop
@@ -119,15 +119,15 @@
 	.set	reorder
 
 	.end	_init
-#APP
+## APP
 	
 	.section .fini
-#NO_APP
+## NO_APP
 	.align	2
 	.globl	_fini
 	.ent	_fini
 	.type	_fini, @function
-#NO_APP
+## NO_APP
 	ld	$31,24($sp)
 	ld	$28,16($sp)
 	#nop
@@ -139,7 +139,7 @@
 	.set	reorder
 
 	.end	_fini
-#APP
+## APP
 	
 	.ident	"GCC: (GNU) 3.3.2"
 #endif	/* N64 */
--- libpthread/linuxthreads.old/ptfork.c	2006-02-18 08:03:24.000000000 +0100
+++ libpthread/linuxthreads.old/ptfork.c	2007-09-18 17:16:26.000000000 +0200
@@ -80,7 +80,7 @@
 
 extern __typeof(fork) __libc_fork;
 
-pid_t __fork(void) attribute_hidden;
+pid_t __fork(void); //attribute_hidden; //raus am 18.09.2007 by AR
 pid_t __fork(void)
 {
   pid_t pid;
