make Runtime._syscall() protected so it can be overridden from outside the package
[nestedvm.git] / upstream / patches / busybox.patch
1 Only in .: .config
2 Only in .: .config.cmd
3 Only in .: .depend
4 diff -ur ../busybox-1.00-pre9.orig/Rules.mak ./Rules.mak
5 --- ../busybox-1.00-pre9.orig/Rules.mak 2004-04-06 13:58:37.000000000 -0400
6 +++ ./Rules.mak 2004-05-08 03:22:49.000000000 -0400
7 @@ -79,7 +79,8 @@
8  #CROSS_CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
9  #GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
10  
11 -WARNINGS=-Wall -Wstrict-prototypes -Wshadow
12 +WARNINGS=-Wall -Wstrict-prototypes -Wshadow -Wno-unused
13 +LIBRARIES=-lglob -lregex
14  CFLAGS=-I$(TOPDIR)include
15  ARFLAGS=-r
16  
17 @@ -158,8 +159,8 @@
18      STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
19  else
20      CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
21 -    LDFLAGS += -s -Wl,-warn-common
22 -    STRIPCMD:=$(STRIP) --remove-section=.note --remove-section=.comment
23 +    LDFLAGS += -Wl,-warn-common
24 +    STRIPCMD:= true
25  endif
26  ifeq ($(strip $(CONFIG_STATIC)),y)
27      LDFLAGS += --static
28 diff -ur ../busybox-1.00-pre9.orig/archival/libunarchive/decompress_bunzip2.c ./archival/libunarchive/decompress_bunzip2.c
29 --- ../busybox-1.00-pre9.orig/archival/libunarchive/decompress_bunzip2.c        2004-03-15 03:28:17.000000000 -0500
30 +++ ./archival/libunarchive/decompress_bunzip2.c        2004-05-20 00:27:06.000000000 -0400
31 @@ -134,8 +134,8 @@
32  
33  static int get_next_block(bunzip_data *bd)
34  {
35 -       struct group_data *hufGroup;
36 -       int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
37 +       struct group_data *hufGroup=NULL;
38 +       int dbufCount,nextSym,dbufSize,groupCount,*base=NULL,*limit=NULL,selector,
39                 i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
40         unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
41         unsigned int *dbuf,origPtr;
42 diff -ur ../busybox-1.00-pre9.orig/archival/tar.c ./archival/tar.c
43 --- ../busybox-1.00-pre9.orig/archival/tar.c    2004-03-27 05:02:41.000000000 -0500
44 +++ ./archival/tar.c    2004-05-08 03:22:49.000000000 -0400
45 @@ -48,7 +48,9 @@
46  #include <errno.h>
47  #include <signal.h>
48  #include <sys/wait.h>
49 +#ifndef NESTEDVM
50  #include <sys/socket.h>
51 +#endif
52  #include "unarchive.h"
53  #include "busybox.h"
54  
55 diff -ur ../busybox-1.00-pre9.orig/coreutils/cal.c ./coreutils/cal.c
56 --- ../busybox-1.00-pre9.orig/coreutils/cal.c   2004-03-15 03:28:19.000000000 -0500
57 +++ ./coreutils/cal.c   2004-05-08 03:22:49.000000000 -0400
58 @@ -31,7 +31,9 @@
59  
60  #include <sys/types.h>
61  #include <ctype.h>
62 +#ifndef NESTEDVM
63  #include <err.h>
64 +#endif
65  #include <stdio.h>
66  #include <stdlib.h>
67  #include <string.h>
68 diff -ur ../busybox-1.00-pre9.orig/coreutils/date.c ./coreutils/date.c
69 --- ../busybox-1.00-pre9.orig/coreutils/date.c  2004-04-06 05:38:18.000000000 -0400
70 +++ ./coreutils/date.c  2004-05-08 03:22:49.000000000 -0400
71 @@ -227,7 +227,11 @@
72                 }
73  
74                 /* if setting time, set it */
75 +#ifndef NESTEDVM
76                 if (set_time && (stime(&tm) < 0)) {
77 +#else
78 +        if(0) {
79 +#endif
80                         bb_perror_msg("cannot set date");
81                 }
82         }
83 diff -ur ../busybox-1.00-pre9.orig/coreutils/dos2unix.c ./coreutils/dos2unix.c
84 --- ../busybox-1.00-pre9.orig/coreutils/dos2unix.c      2004-03-15 03:28:20.000000000 -0500
85 +++ ./coreutils/dos2unix.c      2004-05-08 03:22:49.000000000 -0400
86 @@ -30,7 +30,9 @@
87  #include <string.h>
88  #include <getopt.h>
89  #include <unistd.h>
90 +#ifndef NESTEDVM
91  #include <stdint.h>
92 +#endif
93  #include <fcntl.h>
94  #include <sys/time.h>
95  #include "busybox.h"
96 diff -ur ../busybox-1.00-pre9.orig/coreutils/env.c ./coreutils/env.c
97 --- ../busybox-1.00-pre9.orig/coreutils/env.c   2003-11-07 06:20:21.000000000 -0500
98 +++ ./coreutils/env.c   2004-05-08 03:22:49.000000000 -0400
99 @@ -50,12 +50,13 @@
100  #include <getopt.h>
101  #include "busybox.h"
102  
103 -
104 +#ifdef NESTEDVM
105  static const struct option env_long_options[] = {
106         { "ignore-environment", 0, NULL, 'i' },
107         { "unset", 1, NULL, 'u' },
108         { 0, 0, 0, 0 }
109  };
110 +#endif
111  
112  extern int env_main(int argc, char** argv)
113  {
114 diff -ur ../busybox-1.00-pre9.orig/coreutils/ls.c ./coreutils/ls.c
115 --- ../busybox-1.00-pre9.orig/coreutils/ls.c    2004-03-27 05:02:42.000000000 -0500
116 +++ ./coreutils/ls.c    2004-05-08 03:22:49.000000000 -0400
117 @@ -59,8 +59,10 @@
118  #include <stdlib.h>
119  #include <fcntl.h>
120  #include <signal.h>
121 +#ifndef NESTEDVM
122  #include <termios.h>
123  #include <sys/ioctl.h>
124 +#endif
125  #include "busybox.h"
126  #ifdef CONFIG_SELINUX
127  #include <fs_secure.h>
128 @@ -988,8 +990,11 @@
129  #endif
130  
131  #ifdef CONFIG_FEATURE_LS_COLOR
132 -       if (isatty(STDOUT_FILENO))
133 -               show_color = 1;
134 +    {
135 +        char *term = getenv("TERM");
136 +        if (isatty(STDOUT_FILENO) && term && *term)
137 +            show_color = 1;
138 +    }
139  #endif
140  
141         /* process options */
142 diff -ur ../busybox-1.00-pre9.orig/coreutils/md5_sha1_sum.c ./coreutils/md5_sha1_sum.c
143 --- ../busybox-1.00-pre9.orig/coreutils/md5_sha1_sum.c  2004-03-27 05:02:42.000000000 -0500
144 +++ ./coreutils/md5_sha1_sum.c  2004-05-08 03:22:49.000000000 -0400
145 @@ -20,7 +20,9 @@
146  #include <fcntl.h>
147  #include <limits.h>
148  #include <stdio.h>
149 +#ifndef NESTEDVM
150  #include <stdint.h>
151 +#endif
152  #include <stdlib.h>
153  #include <string.h>
154  #include <unistd.h>
155 diff -ur ../busybox-1.00-pre9.orig/coreutils/rmdir.c ./coreutils/rmdir.c
156 --- ../busybox-1.00-pre9.orig/coreutils/rmdir.c 2004-03-15 03:28:21.000000000 -0500
157 +++ ./coreutils/rmdir.c 2004-05-08 03:22:49.000000000 -0400
158 @@ -25,7 +25,9 @@
159  
160  #include <stdlib.h>
161  #include <unistd.h>
162 +#ifndef NESTEDVM
163  #include <libgen.h>
164 +#endif
165  #include "busybox.h"
166  
167  extern int rmdir_main(int argc, char **argv)
168 diff -ur ../busybox-1.00-pre9.orig/include/busybox.h ./include/busybox.h
169 --- ../busybox-1.00-pre9.orig/include/busybox.h 2004-03-15 03:28:38.000000000 -0500
170 +++ ./include/busybox.h 2004-05-08 03:22:49.000000000 -0400
171 @@ -33,7 +33,7 @@
172  #include <sys/types.h>
173  
174  #if __GNU_LIBRARY__ < 5
175 -#ifndef __dietlibc__
176 +#if !defined(__dietlibc__) && !defined(NESTEDVM)
177  #error "Sorry, libc5 is not supported"
178  #endif
179  #endif
180 @@ -48,7 +48,9 @@
181  #include <dmalloc.h>
182  #endif
183  
184 +#ifndef NESTEDVM
185  #include <features.h>
186 +#endif
187  
188  /* Pull in the utility routines from libbb */
189  #include "libbb.h"
190 Only in ./include: config
191 Only in ./include: config.h
192 diff -ur ../busybox-1.00-pre9.orig/include/grp_.h ./include/grp_.h
193 --- ../busybox-1.00-pre9.orig/include/grp_.h    2003-12-18 17:40:58.000000000 -0500
194 +++ ./include/grp_.h    2004-05-08 03:22:49.000000000 -0400
195 @@ -7,7 +7,9 @@
196  #else
197  
198  #include <sys/types.h>
199 +#ifndef NESTEDVM
200  #include <features.h>
201 +#endif
202  #include <stdio.h>
203  
204  
205 diff -ur ../busybox-1.00-pre9.orig/include/libbb.h ./include/libbb.h
206 --- ../busybox-1.00-pre9.orig/include/libbb.h   2004-03-15 03:28:38.000000000 -0500
207 +++ ./include/libbb.h   2004-05-20 00:26:12.000000000 -0400
208 @@ -24,22 +24,68 @@
209  #ifndef        __LIBCONFIG_H__
210  #define        __LIBCONFIG_H__    1
211  
212 +
213 +#ifdef NESTEDVM
214 +#include <sys/cdefs.h>
215 +#include <sys/fcntl.h>
216 +#include <stdio.h>
217 +#include <string.h>
218 +#include <unistd.h>
219 +
220 +#define WCOREDUMP(x) 0
221 +
222 +typedef char int8_t;
223 +typedef unsigned char uint8_t;
224 +typedef short int16_t;
225 +typedef unsigned short uint16_t;
226 +typedef int int32_t;
227 +typedef unsigned int uint32_t;
228 +typedef long long int64_t;
229 +typedef unsigned long long uint64_t;
230 +
231 +struct option {
232 +       const char *name;
233 +       int has_arg;
234 +       int *flag;
235 +       int val;
236 +};
237 +
238 +#include <stdarg.h>
239 +
240 +static char *strchrnul(const char *s, int c) {
241 +    char *ret;
242 +    ret = strchr(s,c);
243 +    return ret ? ret : (char*)s + strlen(s);
244 +}
245 +
246 +static char *stpcpy(char *dest, const char *src) {
247 +    while((*dest = *src) != '\0') { dest++; src++; }
248 +    return dest;
249 +}
250 +
251 +#endif
252 +
253  #include <stdio.h>
254  #include <stdlib.h>
255  #include <stdarg.h>
256  #include <sys/stat.h>
257  #include <sys/types.h>
258  #include <regex.h>
259 +#ifndef NESTEDVM
260  #include <termios.h>
261  #include <stdint.h>
262 +#endif
263  
264  #include <netdb.h>
265 +#include <netinet/in.h>
266  
267  #ifdef DMALLOC
268  #include <dmalloc.h>
269  #endif
270  
271 +#ifndef NESTEDVM
272  #include <features.h>
273 +#endif
274  
275  #include "config.h"
276  #ifdef CONFIG_SELINUX
277 @@ -123,8 +169,10 @@
278  extern int bb_parse_mode( const char* s, mode_t* theMode);
279  extern long bb_xgetlarg(const char *arg, int base, long lower, long upper);
280  
281 +#ifndef NESTEDVM
282  extern unsigned long bb_baud_to_value(speed_t speed);
283  extern speed_t bb_value_to_baud(unsigned long value);
284 +#endif
285  
286  extern int get_kernel_revision(void);
287  
288 diff -ur ../busybox-1.00-pre9.orig/include/pwd_.h ./include/pwd_.h
289 --- ../busybox-1.00-pre9.orig/include/pwd_.h    2002-07-03 19:19:10.000000000 -0400
290 +++ ./include/pwd_.h    2004-05-08 03:22:49.000000000 -0400
291 @@ -7,7 +7,9 @@
292  #else
293  
294  #include <sys/types.h>
295 +#ifndef NESTEDVM
296  #include <features.h>
297 +#endif
298  #include <stdio.h>
299  
300  /* The passwd structure.  */
301 diff -ur ../busybox-1.00-pre9.orig/libbb/Makefile.in ./libbb/Makefile.in
302 --- ../busybox-1.00-pre9.orig/libbb/Makefile.in 2004-03-06 17:11:45.000000000 -0500
303 +++ ./libbb/Makefile.in 2004-05-20 01:05:15.000000000 -0400
304 @@ -24,28 +24,27 @@
305  endif
306  
307  LIBBB_SRC:= \
308 -       bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
309 +       bb_asprintf.c ask_confirmation.c chomp.c \
310         compare_string_array.c concat_path_file.c copy_file.c copyfd.c \
311 -       correct_password.c create_icmp_socket.c create_icmp6_socket.c \
312 -       device_open.c dump.c error_msg.c error_msg_and_die.c find_mount_point.c \
313 +       device_open.c dump.c error_msg.c error_msg_and_die.c \
314         find_pid_by_name.c find_root_device.c fgets_str.c full_read.c \
315         full_write.c get_last_path_component.c get_line_from_file.c get_ug_id.c \
316         get_terminal_width_height.c hash_fd.c herror_msg.c herror_msg_and_die.c \
317 -       human_readable.c inet_common.c inode_hash.c interface.c isdirectory.c \
318 -       kernel_version.c last_char_is.c llist_add_to.c login.c loop.c \
319 -       make_directory.c mode_string.c module_syscalls.c mtab.c mtab_file.c \
320 +       human_readable.c inode_hash.c isdirectory.c \
321 +       last_char_is.c llist_add_to.c \
322 +       make_directory.c mode_string.c \
323         my_getgrgid.c my_getgrnam.c my_getpwnam.c my_getpwnamegid.c \
324         my_getpwuid.c obscure.c parse_mode.c parse_number.c perror_msg.c \
325 -       perror_msg_and_die.c print_file.c get_console.c \
326 -       process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c qmodule.c \
327 +       perror_msg_and_die.c print_file.c \
328 +       process_escape_sequence.c procps.c pwd2spwd.c qmodule.c \
329         read_package_field.c recursive_action.c remove_file.c \
330 -       restricted_shell.c run_parts.c run_shell.c safe_read.c safe_write.c \
331 -       safe_strncpy.c setup_environment.c simplify_path.c syscalls.c \
332 -       syslog_msg_with_name.c trim.c u_signal_names.c vdprintf.c verror_msg.c \
333 +       run_shell.c safe_read.c safe_write.c \
334 +       safe_strncpy.c simplify_path.c \
335 +       trim.c u_signal_names.c vdprintf.c verror_msg.c \
336         vherror_msg.c vperror_msg.c wfopen.c xconnect.c xgetcwd.c \
337 -       xgethostbyname.c xgethostbyname2.c xreadlink.c xregcomp.c xgetlarg.c \
338 +       xgethostbyname.c xreadlink.c xregcomp.c xgetlarg.c \
339         get_terminal_width_height.c fclose_nonstdin.c fflush_stdout_and_exit.c \
340 -       getopt_ulflags.c default_error_retval.c wfopen_input.c speed_table.c \
341 +       getopt_ulflags.c default_error_retval.c wfopen_input.c \
342         perror_nomsg_and_die.c perror_nomsg.c skip_whitespace.c \
343         warn_ignoring_args.c concat_subpath_file.c vfork_daemon_rexec.c
344  
345 Only in ./libbb: Makefile.in~
346 diff -ur ../busybox-1.00-pre9.orig/libbb/get_terminal_width_height.c ./libbb/get_terminal_width_height.c
347 --- ../busybox-1.00-pre9.orig/libbb/get_terminal_width_height.c 2004-03-23 18:15:35.000000000 -0500
348 +++ ./libbb/get_terminal_width_height.c 2004-05-08 03:22:49.000000000 -0400
349 @@ -24,8 +24,10 @@
350  #include <fcntl.h>
351  #include <unistd.h>
352  #include <unistd.h>
353 +#ifndef NESTEDVM
354  #include <termios.h>
355  #include <sys/ioctl.h>
356 +#endif
357  #include "busybox.h"
358  
359  /* It is perfectly ok to pass in a NULL for either width or for
360 @@ -34,7 +36,11 @@
361   * which case you will always get 80x24 */
362  void get_terminal_width_height(int fd, int *width, int *height)
363  {
364 +#ifdef NESTEDVM
365 +    struct { int ws_row; int ws_col; } win = { 0, 0};
366 +#else
367         struct winsize win = { 0, 0, 0, 0 };
368 +#endif
369  #ifdef CONFIG_FEATURE_AUTOWIDTH
370         if (ioctl(fd, TIOCGWINSZ, &win) != 0) {
371                 win.ws_row = 24;
372 diff -ur ../busybox-1.00-pre9.orig/libbb/getopt_ulflags.c ./libbb/getopt_ulflags.c
373 --- ../busybox-1.00-pre9.orig/libbb/getopt_ulflags.c    2004-02-05 08:49:29.000000000 -0500
374 +++ ./libbb/getopt_ulflags.c    2004-05-08 03:22:49.000000000 -0400
375 @@ -150,8 +150,14 @@
376      s--;
377    }
378  
379 -  while ((c = getopt_long (argc, argv, applet_opts,
380 -                           bb_applet_long_options, NULL)) > 0) {
381 +    
382 +  while ((c = 
383 +#ifdef NESTEDVM
384 +          getopt(argc,argv,applet_opts)
385 +#else
386 +          getopt_long (argc, argv, applet_opts,bb_applet_long_options, NULL) 
387 +#endif
388 +  ) > 0) {
389         for (on_off = complementaly; on_off->opt != c; on_off++) {
390             if(!on_off->opt)
391                         bb_show_usage ();
392 diff -ur ../busybox-1.00-pre9.orig/libbb/hash_fd.c ./libbb/hash_fd.c
393 --- ../busybox-1.00-pre9.orig/libbb/hash_fd.c   2004-03-15 03:28:42.000000000 -0500
394 +++ ./libbb/hash_fd.c   2004-05-08 03:22:49.000000000 -0400
395 @@ -20,18 +20,27 @@
396   *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
397   */
398  
399 +#ifndef NESTEDVM
400  #include <byteswap.h>
401  #include <endian.h>
402 +#endif
403  #include <fcntl.h>
404  #include <limits.h>
405  #include <stdio.h>
406 +#ifndef NESTEDVM
407  #include <stdint.h>
408 +#endif
409  #include <stdlib.h>
410  #include <string.h>
411  #include <unistd.h>
412  
413  #include "busybox.h"
414  
415 +#ifdef NESTEDVM
416 +#define __BYTE_ORDER BYTE_ORDER
417 +#define __LITTLE_ENDIAN LITTLE_ENDIAN
418 +#define __BIG_ENDIAN BIG_ENDIAN
419 +#endif
420  
421  #ifdef CONFIG_SHA1SUM
422  /*
423 diff -ur ../busybox-1.00-pre9.orig/libbb/procps.c ./libbb/procps.c
424 --- ../busybox-1.00-pre9.orig/libbb/procps.c    2004-01-27 15:17:39.000000000 -0500
425 +++ ./libbb/procps.c    2004-05-08 03:22:49.000000000 -0400
426 @@ -12,7 +12,9 @@
427  #include <string.h>
428  #include <stdlib.h>
429  #include <unistd.h>
430 +#ifndef NESTEDVM
431  #include <asm/page.h>
432 +#endif
433  
434  #include "libbb.h"
435  
436 diff -ur ../busybox-1.00-pre9.orig/libbb/run_shell.c ./libbb/run_shell.c
437 --- ../busybox-1.00-pre9.orig/libbb/run_shell.c 2004-03-15 03:28:43.000000000 -0500
438 +++ ./libbb/run_shell.c 2004-05-08 03:22:49.000000000 -0400
439 @@ -33,7 +33,9 @@
440  #include <unistd.h>
441  #include <string.h>
442  #include <stdlib.h>
443 +#ifndef NESTEDVM
444  #include <syslog.h>
445 +#endif
446  #include <ctype.h>
447  #include "libbb.h"
448  #ifdef CONFIG_SELINUX
449 diff -ur ../busybox-1.00-pre9.orig/libbb/u_signal_names.c ./libbb/u_signal_names.c
450 --- ../busybox-1.00-pre9.orig/libbb/u_signal_names.c    2004-03-15 03:28:43.000000000 -0500
451 +++ ./libbb/u_signal_names.c    2004-05-08 03:22:49.000000000 -0400
452 @@ -21,6 +21,7 @@
453   * USA
454   */
455  
456 +#include <sys/types.h>
457  #include <signal.h>
458  #include <ctype.h>
459  #include <string.h>
460 diff -ur ../busybox-1.00-pre9.orig/libbb/vdprintf.c ./libbb/vdprintf.c
461 --- ../busybox-1.00-pre9.orig/libbb/vdprintf.c  2004-03-15 03:28:43.000000000 -0500
462 +++ ./libbb/vdprintf.c  2004-05-08 03:22:49.000000000 -0400
463 @@ -26,7 +26,17 @@
464  
465  
466  #if (__GLIBC__ < 2)
467 -extern int vdprintf(int d, const char *format, va_list ap)
468 +int dprintf(int d, const char *fmt, ...) {
469 +    int ret;
470 +    va_list ap;
471 +    
472 +    va_start (ap, fmt);
473 +    ret = vdprintf (d, fmt, ap);
474 +    va_end (ap);
475 +    return ret;
476 +}
477 +
478 +int vdprintf(int d, const char *format, va_list ap)
479  {
480         char buf[BUF_SIZE];
481         int len;
482 diff -ur ../busybox-1.00-pre9.orig/libbb/xconnect.c ./libbb/xconnect.c
483 --- ../busybox-1.00-pre9.orig/libbb/xconnect.c  2004-03-15 03:28:44.000000000 -0500
484 +++ ./libbb/xconnect.c  2004-05-20 00:45:33.000000000 -0400
485 @@ -62,7 +62,7 @@
486  int xconnect(struct sockaddr_in *s_addr)
487  {
488         int s = socket(AF_INET, SOCK_STREAM, 0);
489 -       if (connect(s, (struct sockaddr_in *)s_addr, sizeof(struct sockaddr_in)) < 0)
490 +       if (connect(s, (struct sockaddr *)s_addr, sizeof(struct sockaddr_in)) < 0)
491         {
492                 bb_perror_msg_and_die("Unable to connect to remote host (%s)",
493                                 inet_ntoa(s_addr->sin_addr));
494 diff -ur ../busybox-1.00-pre9.orig/libbb/xgetcwd.c ./libbb/xgetcwd.c
495 --- ../busybox-1.00-pre9.orig/libbb/xgetcwd.c   2003-05-26 10:06:00.000000000 -0400
496 +++ ./libbb/xgetcwd.c   2004-05-08 03:22:49.000000000 -0400
497 @@ -11,6 +11,7 @@
498  #include <unistd.h>
499  #include <limits.h>
500  #include <sys/param.h>
501 +#include <sys/syslimits.h>
502  #include "libbb.h"
503  
504  /* Amount to increase buffer size by in each try. */
505 diff -ur ../busybox-1.00-pre9.orig/libpwdgrp/setgroups.c ./libpwdgrp/setgroups.c
506 --- ../busybox-1.00-pre9.orig/libpwdgrp/setgroups.c     2004-03-15 03:28:45.000000000 -0500
507 +++ ./libpwdgrp/setgroups.c     2004-05-08 03:22:49.000000000 -0400
508 @@ -24,17 +24,25 @@
509  
510  #include <errno.h>
511  #include <unistd.h>
512 +#ifndef NESTEDVM
513  #include <features.h>
514 +#endif
515  #include <sys/types.h>
516  /* Kernel headers before 2.1.mumble need this on the Alpha to get
517     _syscall* defined.  */
518  #define __LIBRARY__
519 +#ifndef NESTEDVM
520  #include <sys/syscall.h>
521 +#endif
522  #include "grp_.h"
523  
524  int setgroups(size_t size, const gid_t * list)
525  {
526 +#ifndef NESTEDVM
527         return(syscall(__NR_setgroups, size, list));
528 +#else
529 +    return 0;
530 +#endif
531  }
532  
533  
534 diff -ur ../busybox-1.00-pre9.orig/networking/httpd.c ./networking/httpd.c
535 --- ../busybox-1.00-pre9.orig/networking/httpd.c        2004-03-15 03:28:48.000000000 -0500
536 +++ ./networking/httpd.c        2004-05-20 07:30:45.000000000 -0400
537 @@ -1727,11 +1727,15 @@
538    FD_ZERO (&s_fd) ;
539    FD_SET (a_c_w, &s_fd) ;
540  
541 +#ifdef NESTEDVM
542 +  //while(read(a_c_w, buf, sizeof(config->buf) > 0));
543 +#else
544    do {
545      tv.tv_sec = 2 ;
546      tv.tv_usec = 0 ;
547      retval = select (a_c_w + 1, &s_fd, NULL, NULL, &tv);
548    } while (retval > 0 && (read (a_c_w, buf, sizeof (config->buf)) > 0));
549 +#endif
550  
551    shutdown(a_c_r, SHUT_RD);
552    close(config->accepted_socket);
553 @@ -1756,18 +1760,22 @@
554  #ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
555  static int miniHttpd(int server)
556  {
557 +#ifndef NESTEDVM
558    fd_set readfd, portfd;
559  
560    FD_ZERO(&portfd);
561    FD_SET(server, &portfd);
562 -
563 +#endif
564 +  
565    /* copy the ports we are watching to the readfd set */
566    while (1) {
567 +#ifndef NESTEDVM
568      readfd = portfd;
569  
570      /* Now wait INDEFINATELY on the set of sockets! */
571      if (select(server + 1, &readfd, 0, 0, 0) > 0) {
572        if (FD_ISSET(server, &readfd)) {
573 +#endif
574         int on;
575         struct sockaddr_in fromAddr;
576  
577 @@ -1776,7 +1784,7 @@
578                        (struct sockaddr *)&fromAddr, &fromAddrLen);
579  
580         if (s < 0) {
581 -           continue;
582 +           break;
583         }
584         config->accepted_socket = s;
585         config->rmt_ip = ntohl(fromAddr.sin_addr.s_addr);
586 @@ -1810,8 +1818,10 @@
587                 exit(0);
588         }
589         close(s);
590 +#ifndef NESTEDVM
591        }
592      }
593 +#endif
594    } // while (1)
595    return 0;
596  }
597 diff -ur ../busybox-1.00-pre9.orig/procps/ps.c ./procps/ps.c
598 --- ../busybox-1.00-pre9.orig/procps/ps.c       2004-03-15 03:29:03.000000000 -0500
599 +++ ./procps/ps.c       2004-05-08 03:22:49.000000000 -0400
600 @@ -27,8 +27,10 @@
601  #include <fcntl.h>
602  #include <ctype.h>
603  #include <string.h>
604 +#ifndef NESTEDVM
605  #include <termios.h>
606  #include <sys/ioctl.h>
607 +#endif
608  #include "busybox.h"
609  #ifdef CONFIG_SELINUX
610  #include <fs_secure.h>
611 Only in ./scripts/config: conf
612 Only in ./scripts/config: lex.zconf.c
613 Only in ./scripts/config: lkc_defs.h
614 Only in ./scripts/config: mconf
615 Only in ./scripts/config: zconf.tab.c
616 Only in ./scripts/config: zconf.tab.h
617 Only in ./scripts: mkdep
618 diff -ur ../busybox-1.00-pre9.orig/shell/ash.c ./shell/ash.c
619 --- ../busybox-1.00-pre9.orig/shell/ash.c       2004-04-07 05:34:26.000000000 -0400
620 +++ ./shell/ash.c       2004-05-08 03:22:49.000000000 -0400
621 @@ -67,7 +67,9 @@
622  
623  #include <sys/types.h>
624  #include <sys/cdefs.h>
625 +#ifndef NESTEDVM
626  #include <sys/ioctl.h>
627 +#endif
628  #include <sys/param.h>
629  #include <sys/resource.h>
630  #include <sys/stat.h>
631 @@ -90,8 +92,10 @@
632  #include <paths.h>
633  #include <setjmp.h>
634  #include <signal.h>
635 +#ifndef NESTEDVM
636  #include <stdint.h>
637  #include <sysexits.h>
638 +#endif
639  #include <time.h>
640  #include <fnmatch.h>
641  
642 @@ -1403,7 +1407,9 @@
643         { BUILTIN_SPEC_REG      "trap", trapcmd },
644         { BUILTIN_REGULAR       "true", truecmd },
645         { BUILTIN_NOSPEC        "type", typecmd },
646 +#ifndef NESTEDVM
647         { BUILTIN_NOSPEC        "ulimit", ulimitcmd },
648 +#endif
649         { BUILTIN_REGULAR       "umask", umaskcmd },
650  #ifdef CONFIG_ASH_ALIAS
651         { BUILTIN_REGULAR       "unalias", unaliascmd },
652 @@ -2555,7 +2561,9 @@
653         int i;
654  
655         intpending = 0;
656 +#ifndef NESTEDVM
657         sigsetmask(0);
658 +#endif
659         i = EXSIG;
660         if (gotsig[SIGINT - 1] && !trap[SIGINT]) {
661                 if (!(rootshell && iflag)) {
662 @@ -6702,7 +6710,11 @@
663  #endif
664                 }
665                 st &= 0x7f;
666 +#ifdef NESTEDVM
667 +               col = fmtstr(s, 32, "signal %d",st);
668 +#else
669                 col = fmtstr(s, 32, strsignal(st));
670 +#endif
671                 if (WCOREDUMP(status)) {
672                         col += fmtstr(s + col, 16, " (core dumped)");
673                 }
674 @@ -7309,7 +7321,7 @@
675  #endif
676         if (block == 0)
677                 flags |= WNOHANG;
678 -       return wait3(status, flags, (struct rusage *)NULL);
679 +    return waitpid((pid_t)-1,status,flags);
680  }
681  
682  /*
683 @@ -12683,6 +12695,8 @@
684         return 0;
685  }
686  
687 +#ifndef NESTEDVM
688 +
689  /*
690   * ulimit builtin
691   *
692 @@ -12864,7 +12878,7 @@
693         }
694         return 0;
695  }
696 -
697 +#endif /* NESTEDVM */
698  
699  #ifdef CONFIG_ASH_MATH_SUPPORT
700  
701 diff -ur ../busybox-1.00-pre9.orig/util-linux/more.c ./util-linux/more.c
702 --- ../busybox-1.00-pre9.orig/util-linux/more.c 2004-03-27 05:02:48.000000000 -0500
703 +++ ./util-linux/more.c 2004-05-08 03:22:49.000000000 -0400
704 @@ -32,7 +32,9 @@
705  #include <signal.h>
706  #include <stdlib.h>
707  #include <unistd.h>
708 +#ifndef NESTEDVM
709  #include <sys/ioctl.h>
710 +#endif
711  #include "busybox.h"
712  
713  
714 --- ../busybox-1.00-pre9/.config        1969-12-31 19:00:00.000000000 -0500
715 +++ .config     2004-05-20 05:34:44.000000000 -0400
716 @@ -0,0 +1,404 @@
717 +#
718 +# Automatically generated make config: don't edit
719 +#
720 +HAVE_DOT_CONFIG=y
721 +
722 +#
723 +# General Configuration
724 +#
725 +# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
726 +CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
727 +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
728 +CONFIG_FEATURE_VERBOSE_USAGE=y
729 +# CONFIG_FEATURE_INSTALLER is not set
730 +# CONFIG_LOCALE_SUPPORT is not set
731 +# CONFIG_FEATURE_DEVFS is not set
732 +# CONFIG_FEATURE_DEVPTS is not set
733 +# CONFIG_FEATURE_CLEAN_UP is not set
734 +# CONFIG_FEATURE_SUID is not set
735 +# CONFIG_SELINUX is not set
736 +
737 +#
738 +# Build Options
739 +#
740 +CONFIG_STATIC=y
741 +# CONFIG_LFS is not set
742 +USING_CROSS_COMPILER=y
743 +CROSS_COMPILER_PREFIX="mips-unknown-elf-"
744 +EXTRA_CFLAGS_OPTIONS="-DNESTEDVM"
745 +
746 +#
747 +# Installation Options
748 +#
749 +# CONFIG_INSTALL_NO_USR is not set
750 +PREFIX="./_install"
751 +
752 +#
753 +# Archival Utilities
754 +#
755 +# CONFIG_AR is not set
756 +CONFIG_BUNZIP2=y
757 +CONFIG_CPIO=y
758 +# CONFIG_DPKG is not set
759 +# CONFIG_DPKG_DEB is not set
760 +CONFIG_GUNZIP=y
761 +CONFIG_FEATURE_GUNZIP_UNCOMPRESS=y
762 +CONFIG_GZIP=y
763 +# CONFIG_RPM2CPIO is not set
764 +# CONFIG_RPM is not set
765 +CONFIG_TAR=y
766 +CONFIG_FEATURE_TAR_CREATE=y
767 +CONFIG_FEATURE_TAR_BZIP2=y
768 +CONFIG_FEATURE_TAR_FROM=y
769 +CONFIG_FEATURE_TAR_GZIP=y
770 +CONFIG_FEATURE_TAR_COMPRESS=y
771 +CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
772 +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
773 +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
774 +CONFIG_UNCOMPRESS=y
775 +CONFIG_UNZIP=y
776 +
777 +#
778 +# Common options for cpio and tar
779 +#
780 +# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
781 +
782 +#
783 +# Coreutils
784 +#
785 +CONFIG_BASENAME=y
786 +CONFIG_CAL=y
787 +CONFIG_CAT=y
788 +CONFIG_CHGRP=y
789 +CONFIG_CHMOD=y
790 +CONFIG_CHOWN=y
791 +CONFIG_CHROOT=y
792 +CONFIG_CMP=y
793 +CONFIG_CP=y
794 +CONFIG_CUT=y
795 +CONFIG_DATE=y
796 +
797 +#
798 +# date (forced enabled for use with watch)
799 +#
800 +CONFIG_FEATURE_DATE_ISOFMT=y
801 +CONFIG_DD=y
802 +# CONFIG_DF is not set
803 +CONFIG_DIRNAME=y
804 +CONFIG_DOS2UNIX=y
805 +CONFIG_UNIX2DOS=y
806 +CONFIG_DU=y
807 +CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K=y
808 +CONFIG_ECHO=y
809 +CONFIG_FEATURE_FANCY_ECHO=y
810 +CONFIG_ENV=y
811 +# CONFIG_EXPR is not set
812 +CONFIG_FALSE=y
813 +CONFIG_FOLD=y
814 +CONFIG_HEAD=y
815 +# CONFIG_FEATURE_FANCY_HEAD is not set
816 +# CONFIG_HOSTID is not set
817 +CONFIG_ID=y
818 +CONFIG_INSTALL=y
819 +CONFIG_LENGTH=y
820 +CONFIG_LN=y
821 +# CONFIG_LOGNAME is not set
822 +CONFIG_LS=y
823 +CONFIG_FEATURE_LS_FILETYPES=y
824 +CONFIG_FEATURE_LS_FOLLOWLINKS=y
825 +CONFIG_FEATURE_LS_RECURSIVE=y
826 +CONFIG_FEATURE_LS_SORTFILES=y
827 +CONFIG_FEATURE_LS_TIMESTAMPS=y
828 +CONFIG_FEATURE_LS_USERNAME=y
829 +CONFIG_FEATURE_LS_COLOR=y
830 +CONFIG_MD5SUM=y
831 +CONFIG_MKDIR=y
832 +CONFIG_MKFIFO=y
833 +CONFIG_MKNOD=y
834 +CONFIG_MV=y
835 +CONFIG_OD=y
836 +CONFIG_PRINTF=y
837 +CONFIG_PWD=y
838 +CONFIG_REALPATH=y
839 +CONFIG_RM=y
840 +CONFIG_RMDIR=y
841 +# CONFIG_SEQ is not set
842 +CONFIG_SHA1SUM=y
843 +CONFIG_SLEEP=y
844 +CONFIG_FEATURE_FANCY_SLEEP=y
845 +CONFIG_SORT=y
846 +# CONFIG_STTY is not set
847 +CONFIG_SYNC=y
848 +CONFIG_TAIL=y
849 +CONFIG_FEATURE_FANCY_TAIL=y
850 +CONFIG_TEE=y
851 +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
852 +CONFIG_TEST=y
853 +
854 +#
855 +# test (forced enabled for use with shell)
856 +#
857 +CONFIG_TOUCH=y
858 +CONFIG_TR=y
859 +CONFIG_TRUE=y
860 +CONFIG_TTY=y
861 +CONFIG_UNAME=y
862 +CONFIG_UNIQ=y
863 +CONFIG_USLEEP=y
864 +CONFIG_UUDECODE=y
865 +CONFIG_UUENCODE=y
866 +CONFIG_WATCH=y
867 +CONFIG_WC=y
868 +# CONFIG_WHO is not set
869 +CONFIG_WHOAMI=y
870 +CONFIG_YES=y
871 +
872 +#
873 +# Common options for cp and mv
874 +#
875 +CONFIG_FEATURE_PRESERVE_HARDLINKS=y
876 +
877 +#
878 +# Common options for ls and more
879 +#
880 +# CONFIG_FEATURE_AUTOWIDTH is not set
881 +
882 +#
883 +# Common options for df, du, ls
884 +#
885 +CONFIG_FEATURE_HUMAN_READABLE=y
886 +
887 +#
888 +# Common options for md5sum, sha1sum
889 +#
890 +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
891 +
892 +#
893 +# Console Utilities
894 +#
895 +# CONFIG_CHVT is not set
896 +CONFIG_CLEAR=y
897 +# CONFIG_DEALLOCVT is not set
898 +# CONFIG_DUMPKMAP is not set
899 +# CONFIG_LOADFONT is not set
900 +# CONFIG_LOADKMAP is not set
901 +# CONFIG_OPENVT is not set
902 +CONFIG_RESET=y
903 +# CONFIG_SETKEYCODES is not set
904 +
905 +#
906 +# Debian Utilities
907 +#
908 +# CONFIG_MKTEMP is not set
909 +CONFIG_PIPE_PROGRESS=y
910 +CONFIG_READLINK=y
911 +# CONFIG_RUN_PARTS is not set
912 +# CONFIG_START_STOP_DAEMON is not set
913 +CONFIG_WHICH=y
914 +
915 +#
916 +# Editors
917 +#
918 +CONFIG_AWK=y
919 +CONFIG_FEATURE_AWK_MATH=y
920 +CONFIG_PATCH=y
921 +CONFIG_SED=y
922 +# CONFIG_VI is not set
923 +
924 +#
925 +# Finding Utilities
926 +#
927 +CONFIG_FIND=y
928 +CONFIG_FEATURE_FIND_MTIME=y
929 +CONFIG_FEATURE_FIND_PERM=y
930 +CONFIG_FEATURE_FIND_TYPE=y
931 +CONFIG_FEATURE_FIND_XDEV=y
932 +CONFIG_FEATURE_FIND_NEWER=y
933 +CONFIG_FEATURE_FIND_INUM=y
934 +CONFIG_GREP=y
935 +CONFIG_FEATURE_GREP_EGREP_ALIAS=y
936 +CONFIG_FEATURE_GREP_FGREP_ALIAS=y
937 +CONFIG_FEATURE_GREP_CONTEXT=y
938 +CONFIG_XARGS=y
939 +CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
940 +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
941 +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
942 +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
943 +
944 +#
945 +# Init Utilities
946 +#
947 +# CONFIG_INIT is not set
948 +# CONFIG_HALT is not set
949 +# CONFIG_POWEROFF is not set
950 +# CONFIG_REBOOT is not set
951 +# CONFIG_MINIT is not set
952 +# CONFIG_MESG is not set
953 +
954 +#
955 +# Login/Password Management Utilities
956 +#
957 +# CONFIG_USE_BB_PWD_GRP=y
958 +# CONFIG_ADDGROUP is not set
959 +# CONFIG_DELGROUP is not set
960 +# CONFIG_ADDUSER is not set
961 +# CONFIG_DELUSER is not set
962 +# CONFIG_GETTY is not set
963 +# CONFIG_LOGIN is not set
964 +# CONFIG_PASSWD is not set
965 +# CONFIG_SU is not set
966 +# CONFIG_SULOGIN is not set
967 +# CONFIG_VLOCK is not set
968 +
969 +#
970 +# Miscellaneous Utilities
971 +#
972 +# CONFIG_ADJTIMEX is not set
973 +# CONFIG_CROND is not set
974 +# CONFIG_CRONTAB is not set
975 +CONFIG_DC=y
976 +# CONFIG_DEVFSD is not set
977 +# CONFIG_LAST is not set
978 +# CONFIG_HDPARM is not set
979 +# CONFIG_MAKEDEVS is not set
980 +# CONFIG_MT is not set
981 +# CONFIG_RX is not set
982 +CONFIG_STRINGS=y
983 +# CONFIG_TIME is not set
984 +# CONFIG_WATCHDOG is not set
985 +
986 +#
987 +# Linux Module Utilities
988 +#
989 +# CONFIG_INSMOD is not set
990 +# CONFIG_LSMOD is not set
991 +# CONFIG_MODPROBE is not set
992 +# CONFIG_RMMOD is not set
993 +
994 +#
995 +# Networking Utilities
996 +#
997 +# CONFIG_FEATURE_IPV6 is not set
998 +# CONFIG_ARPING is not set
999 +CONFIG_FTPGET=y
1000 +CONFIG_FTPPUT=y
1001 +# CONFIG_HOSTNAME is not set
1002 +CONFIG_HTTPD=y
1003 +# CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY is not set
1004 +CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
1005 +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
1006 +# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
1007 +# CONFIG_FEATURE_HTTPD_SETUID is not set
1008 +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
1009 +# CONFIG_FEATURE_HTTPD_CGI is not set
1010 +CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
1011 +# CONFIG_IFCONFIG is not set
1012 +# CONFIG_IFUPDOWN is not set
1013 +# CONFIG_INETD is not set
1014 +# CONFIG_IP is not set
1015 +# CONFIG_IPCALC is not set
1016 +# CONFIG_IPADDR is not set
1017 +# CONFIG_IPLINK is not set
1018 +# CONFIG_IPROUTE is not set
1019 +# CONFIG_IPTUNNEL is not set
1020 +# CONFIG_NAMEIF is not set
1021 +# CONFIG_NC is not set
1022 +# CONFIG_NETSTAT is not set
1023 +# CONFIG_NSLOOKUP is not set
1024 +# CONFIG_PING is not set
1025 +# CONFIG_ROUTE is not set
1026 +# CONFIG_TELNET is not set
1027 +# CONFIG_TELNETD is not set
1028 +# CONFIG_TFTP is not set
1029 +# CONFIG_TRACEROUTE is not set
1030 +# CONFIG_VCONFIG is not set
1031 +CONFIG_WGET=y
1032 +# CONFIG_FEATURE_WGET_STATUSBAR is not set
1033 +CONFIG_FEATURE_WGET_AUTHENTICATION=y
1034 +# CONFIG_FEATURE_WGET_IP6_LITERAL is not set
1035 +
1036 +#
1037 +# udhcp Server/Client
1038 +#
1039 +# CONFIG_UDHCPD is not set
1040 +# CONFIG_UDHCPC is not set
1041 +
1042 +#
1043 +# Process Utilities
1044 +#
1045 +# CONFIG_FREE is not set
1046 +CONFIG_KILL=y
1047 +CONFIG_KILLALL=y
1048 +CONFIG_PIDOF=y
1049 +CONFIG_PS=y
1050 +CONFIG_RENICE=y
1051 +# CONFIG_TOP is not set
1052 +# CONFIG_UPTIME is not set
1053 +CONFIG_SYSCTL=y
1054 +
1055 +#
1056 +# Another Bourne-like Shell
1057 +#
1058 +CONFIG_FEATURE_SH_IS_ASH=y
1059 +# CONFIG_FEATURE_SH_IS_HUSH is not set
1060 +# CONFIG_FEATURE_SH_IS_LASH is not set
1061 +# CONFIG_FEATURE_SH_IS_MSH is not set
1062 +# CONFIG_FEATURE_SH_IS_NONE is not set
1063 +CONFIG_ASH=y
1064 +
1065 +#
1066 +# Ash Shell Options
1067 +#
1068 +# CONFIG_ASH_JOB_CONTROL is not set
1069 +CONFIG_ASH_ALIAS=y
1070 +CONFIG_ASH_MATH_SUPPORT=y
1071 +# CONFIG_ASH_GETOPTS is not set
1072 +# CONFIG_ASH_CMDCMD is not set
1073 +# CONFIG_ASH_MAIL is not set
1074 +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
1075 +CONFIG_ASH_RANDOM_SUPPORT=y
1076 +# CONFIG_HUSH is not set
1077 +# CONFIG_LASH is not set
1078 +# CONFIG_MSH is not set
1079 +
1080 +#
1081 +# Bourne Shell Options
1082 +#
1083 +# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
1084 +CONFIG_FEATURE_SH_STANDALONE_SHELL=y
1085 +# CONFIG_FEATURE_COMMAND_EDITING is not set
1086 +
1087 +#
1088 +# System Logging Utilities
1089 +#
1090 +# CONFIG_SYSLOGD is not set
1091 +# CONFIG_LOGGER is not set
1092 +
1093 +#
1094 +# Linux System Utilities
1095 +#
1096 +CONFIG_DMESG=y
1097 +# CONFIG_FBSET is not set
1098 +# CONFIG_FDFLUSH is not set
1099 +# CONFIG_FDFORMAT is not set
1100 +# CONFIG_FDISK is not set
1101 +# CONFIG_FREERAMDISK is not set
1102 +# CONFIG_FSCK_MINIX is not set
1103 +# CONFIG_MKFS_MINIX is not set
1104 +# CONFIG_GETOPT is not set
1105 +CONFIG_HEXDUMP=y
1106 +# CONFIG_HWCLOCK is not set
1107 +# CONFIG_LOSETUP is not set
1108 +# CONFIG_MKSWAP is not set
1109 +CONFIG_MORE=y
1110 +# CONFIG_FEATURE_USE_TERMIOS is not set
1111 +# CONFIG_PIVOT_ROOT is not set
1112 +# CONFIG_RDATE is not set
1113 +# CONFIG_SWAPONOFF is not set
1114 +# CONFIG_MOUNT is not set
1115 +# CONFIG_UMOUNT is not set
1116 +
1117 +#
1118 +# Debugging Options
1119 +#
1120 +# CONFIG_DEBUG is not set
1121 --- .config.old 2004-06-08 16:02:45.000000000 -0400
1122 +++ .config     2004-06-08 16:05:23.000000000 -0400
1123 @@ -309,7 +309,11 @@
1124  # CONFIG_ROUTE is not set
1125  # CONFIG_TELNET is not set
1126  # CONFIG_TELNETD is not set
1127 -# CONFIG_TFTP is not set
1128 +CONFIG_TFTP=y
1129 +CONFIG_FEATURE_TFTP_GET=y
1130 +CONFIG_FEATURE_TFTP_PUT=y
1131 +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
1132 +# CONFIG_FEATURE_TFTP_DEBUG is not set
1133  # CONFIG_TRACEROUTE is not set
1134  # CONFIG_VCONFIG is not set
1135  CONFIG_WGET=y
1136 --- networking/tftp.c~  2004-06-08 16:50:30.000000000 -0400
1137 +++ networking/tftp.c   2004-06-08 16:50:30.000000000 -0400
1138 @@ -320,7 +320,11 @@
1139                         FD_ZERO(&rfds);
1140                         FD_SET(socketfd, &rfds);
1141  
1142 +#ifdef NESTEDVM
1143 +                       switch(1) {
1144 +#else
1145                         switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
1146 +#endif
1147                         case 1:
1148                                 len = recvfrom(socketfd, buf, tftp_bufsize, 0,
1149                                                 (struct sockaddr *) &from, &fromlen);