#include <unistd.h>
#include "busybox.h"
-/* Don't use lchown for libc5 or glibc older then 2.1.x */
+/* Don't use lchown glibc older then 2.1.x */
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown
#endif
#include <string.h>
#include "busybox.h"
-/* Don't use lchown for libc5 or glibc older then 2.1.x */
+/* Don't use lchown for glibc older then 2.1.x */
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown
#endif
#include <sys/stat.h>
#include <sys/types.h>
+#if __GNU_LIBRARY__ < 5
+#ifndef __dietlibc__
+#error "Sorry, libc5 is not supported"
+#endif
+#endif
+
#define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
#ifdef DMALLOC
#endif
-/* Bit map related macros -- libc5 doens't provide these... sigh. */
-#ifndef setbit
-#ifndef NBBY
-#define NBBY CHAR_BIT
-#endif
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-#endif
-
#ifndef RB_POWER_OFF
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
# define inline
#endif
-#if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
-/* libc5 doesn't define socklen_t */
-#ifndef _SOCKLEN_T
-#define _SOCKLEN_T
-typedef unsigned int socklen_t;
-#endif
-/* libc5 doesn't implement BSD 4.4 daemon() */
-extern int daemon (int nochdir, int noclose);
-/* libc5 doesn't implement strtok_r */
-char *strtok_r(char *s, const char *delim, char **ptrptr);
-#endif
-
/* Convenience macros to test the version of gcc. */
#if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/reboot.h>
#include "busybox.h"
#include "init_shared.h"
#ifdef CONFIG_SYSLOGD
# include <sys/syslog.h>
#endif
-#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
-#include <sys/reboot.h>
-#endif
#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__)
* linux/kernel/sys.c, which can cause the machine to panic when
* the init process is killed.... */
if ((pid = fork()) == 0) {
-#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
reboot(magic);
-#else
- reboot(0xfee1dead, 672274793, magic);
-#endif
_exit(0);
}
waitpid (pid, NULL, 0);
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
-
+#include <sys/reboot.h>
#include "busybox.h"
#include "init_shared.h"
-#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
- #include <sys/reboot.h>
- #define init_reboot(magic) reboot(magic)
-#else
- #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
-#endif
-
#ifndef RB_ENABLE_CAD
static const int RB_ENABLE_CAD = 0x89abcdef;
static const int RB_AUTOBOOT = 0x01234567;
setpgrp();
/* Allow Ctrl-Alt-Del to reboot system. */
- init_reboot(RB_ENABLE_CAD);
+ reboot(RB_ENABLE_CAD);
message(CONSOLE|LOG, "\n\rThe system is going down NOW !!\n");
sync();
sync();
- init_reboot(RB_AUTOBOOT);
+ reboot(RB_AUTOBOOT);
return 0; /* Shrug */
#else
return kill_init(SIGTERM);
arith.c bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
compare_string_array.c concat_path_file.c copy_file.c \
copyfd.c correct_password.c create_icmp_socket.c \
- create_icmp6_socket.c device_open.c dirname.c dump.c error_msg.c \
+ create_icmp6_socket.c device_open.c dump.c error_msg.c \
error_msg_and_die.c find_mount_point.c find_pid_by_name.c \
find_root_device.c fgets_str.c full_read.c full_write.c get_console.c \
get_last_path_component.c get_line_from_file.c herror_msg.c \
herror_msg_and_die.c human_readable.c inet_common.c inode_hash.c \
- interface.c isdirectory.c kernel_version.c last_char_is.c libc5.c \
+ interface.c isdirectory.c kernel_version.c last_char_is.c \
llist_add_to.c login.c loop.c make_directory.c mode_string.c \
module_syscalls.c mtab.c mtab_file.c my_getgrgid.c my_getgrnam.c \
my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-/*
- * dirname implementation for busybox (for libc's missing one)
- *
- * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-/* Note: The previous busybox implementation did not handle NULL path
- * and also moved a pointer before path, which is not portable in C.
- * So I replaced it with my uClibc version.
- */
-
-#include <string.h>
-#include "libbb.h"
-
-#if __GNU_LIBRARY__ < 5
-
-extern
-char *dirname(char *path)
-{
- static const char null_or_empty_or_noslash[] = ".";
- register char *s;
- register char *last;
- char *first;
-
- last = s = path;
-
- if (s != NULL) {
-
- LOOP:
- while (*s && (*s != '/')) ++s;
- first = s;
- while (*s == '/') ++s;
- if (*s) {
- last = first;
- goto LOOP;
- }
-
- if (last == path) {
- if (*last != '/') {
- goto DOT;
- }
- if ((*++last == '/') && (last[1] == 0)) {
- ++last;
- }
- }
- *last = 0;
- return path;
- }
- DOT:
- return (char *) null_or_empty_or_noslash;
-}
-
-#endif
* that either displays or sets the characteristics of
* one or more of the system's networking interfaces.
*
- * Version: $Id: interface.c,v 1.16 2003/07/14 21:20:55 andersen Exp $
+ * Version: $Id: interface.c,v 1.17 2003/07/22 08:56:46 andersen Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
#include <fcntl.h>
#include <ctype.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
#include <net/if.h>
#include <net/if_arp.h>
#include "libbb.h"
static int procnetdev_vsn = 1;
-/* Ugh. But libc5 doesn't provide POSIX types. */
-#include <asm/types.h>
-
-
#ifdef HAVE_HWSLIP
#include <net/if_slip.h>
#endif
+++ /dev/null
-/* vi: set sw=4 ts=4: */
-
-
-#include <features.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <paths.h>
-#include <unistd.h>
-
-
-#if ! defined __dietlibc__ && __GNU_LIBRARY__ < 5
-
-/*
- * Some systems already have updwtmp(). Some don't... This is
- * the updwtmp() implementation from uClibc, Copyright 2002 by
- * Erik Andersen <andersen@codepoet.org>
- */
-extern void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
-{
- int fd;
-
- fd = open(wtmp_file, O_APPEND | O_WRONLY, 0);
- if (fd >= 0) {
- if (lockf(fd, F_LOCK, 0)==0) {
- write(fd, (const char *) lutmp, sizeof(struct utmp));
- lockf(fd, F_ULOCK, 0);
- close(fd);
- }
- }
-}
-
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-/*
- * Modified by Manuel Novoa III Mar 1, 2001
- *
- * Converted original strtok.c code of strtok to __strtok_r.
- * Cleaned up logic and reduced code size.
- */
-
-
-char *strtok_r(char *s, const char *delim, char **save_ptr)
-{
- char *token;
-
- token = 0; /* Initialize to no token. */
-
- if (s == 0) { /* If not first time called... */
- s = *save_ptr; /* restart from where we left off. */
- }
-
- if (s != 0) { /* If not finished... */
- *save_ptr = 0;
-
- s += strspn(s, delim); /* Skip past any leading delimiters. */
- if (*s != '\0') { /* We have a token. */
- token = s;
- *save_ptr = strpbrk(token, delim); /* Find token's end. */
- if (*save_ptr != 0) {
- /* Terminate the token and make SAVE_PTR point past it. */
- *(*save_ptr)++ = '\0';
- }
- }
- }
-
- return token;
-}
-
-/* Basically getdelim() with the delimiter hard wired to '\n' */
-ssize_t getline(char **linebuf, size_t *n, FILE *file)
-{
- return (getdelim (linebuf, n, '\n', file));
-}
-
-
-/*
- * daemon implementation for uClibc
- *
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Modified for uClibc by Erik Andersen <andersen@codepoet.org>
- *
- * The uClibc Library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * The GNU C Library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with the GNU C Library; see the file COPYING.LIB. If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Original copyright notice is retained at the end of this file.
- */
-
-int daemon( int nochdir, int noclose )
-{
- int fd;
-
- switch (fork()) {
- case -1:
- return(-1);
- case 0:
- break;
- default:
- _exit(0);
- }
-
- if (setsid() == -1)
- return(-1);
-
- if (!nochdir)
- chdir("/");
-
- if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (fd > 2)
- close(fd);
- }
- return(0);
-}
-
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
- * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
- *
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#endif
-
_syscall* defined. */
#define __LIBRARY__
#include <sys/syscall.h>
-#if __GNU_LIBRARY__ < 5
-/* This is needed for libc5 */
-#include <asm/unistd.h>
-#endif
#include "libbb.h"
-#if __GNU_LIBRARY__ < 5 || ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
-/* These syscalls are not included as part of libc5 */
+/* These syscalls are not included in very old glibc versions */
+#if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
int delete_module(const char *name)
{
return(syscall(__NR_delete_module, name));
return ret;
}
-#endif /* __GNU_LIBRARY__ < 5 */
+#endif
/* END CODE */
_syscall* defined. */
#define __LIBRARY__
#include <sys/syscall.h>
-#if __GNU_LIBRARY__ < 5
-/* This is needed for libc5 */
-#include <asm/unistd.h>
-#endif
#include "libbb.h"
int sysfs( int option, unsigned int fs_index, char * buf)
-#if __GNU_LIBRARY__ < 5 || ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
+/* These syscalls are not included in ancient glibc versions */
+#if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
-/* These syscalls are not included as part of libc5 */
int bdflush(int func, int data)
{
return(syscall(__NR_bdflush, func, data));
}
-#endif /* __GNU_LIBRARY__ < 5 */
+#endif
/* END CODE */
_syscall* defined. */
#define __LIBRARY__
#include <sys/syscall.h>
-#if __GNU_LIBRARY__ < 5
-/* This is needed for libc5 */
-#include <asm/unistd.h>
-#endif
#include "grp_.h"
-//#define __NR_setgroups 81
-_syscall2(int, setgroups, size_t, size, const gid_t *, list);
+int setgroups(size_t size, const gid_t * list)
+{
+ return(syscall(__NR_setgroups, size, list));
+}
+
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
-
-#if __GNU_LIBRARY__ < 5
-#include <sys/timex.h>
-extern int adjtimex(struct timex *buf);
-#else
#include <sys/timex.h>
-#endif
-
#include "busybox.h"
static struct {int bit; char *name;} statlist[] = {
* Do what we can while still keeping this reasonably small.
* Note: We are assuming the ut_id[] size is fixed at 4. */
-#if __GNU_LIBRARY__ < 5
-#warning the format string needs to be changed
-#else
#if (UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256)
#error struct utmp member char[] size(s) have changed!
#endif
-#endif
extern int dutmp_main(int argc, char **argv)
{
bb_perror_msg_and_die("short read");
}
- /* Kludge around the fact that the binary format for utmp has changed. */
-#if __GNU_LIBRARY__ < 5
- /* Linux libc5 */
-
- bb_printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
- ut.ut_type, ut.ut_pid, ut.ut_line,
- ut.ut_id, ut.ut_user, ut.ut_host,
- ctime(&(ut.ut_time)),
- (long)ut.ut_addr);
-#else
- /* Glibc, uClibc, etc. */
-
bb_printf("%d|%d|%.32s|%.4s|%.32s|%.256s|%d|%d|%ld|%ld|%ld|%x\n",
ut.ut_type, ut.ut_pid, ut.ut_line,
ut.ut_id, ut.ut_user, ut.ut_host,
ut.ut_session,
ut.ut_tv.tv_sec, ut.ut_tv.tv_usec,
ut.ut_addr);
-#endif
}
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
#include <sys/syslog.h>
#include <unistd.h> /* for getopt() */
#include <stdlib.h>
-
-#if __GNU_LIBRARY__ > 5
- #include <sys/kdaemon.h>
-#else
- extern int bdflush (int func, long int data);
-#endif
+#include <sys/kdaemon.h>
#include "busybox.h"
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.98 2003/07/14 21:21:00 andersen Exp $"
+#ident "$Id: insmod.c,v 1.99 2003/07/22 08:56:50 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.98 2003/07/14 21:21:00 andersen Exp $"
+#ident "$Id: insmod.c,v 1.99 2003/07/22 08:56:50 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
# endif
#endif
-/* For some reason this is missing from libc5. */
+/* For some reason this is missing from some ancient C libraries.... */
#ifndef ELF32_ST_INFO
# define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
#endif
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.54 2003/03/19 09:12:38 mjn3 Exp $
+ * $Id: ping.c,v 1.55 2003/07/22 08:56:51 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
#include "busybox.h"
-/* It turns out that libc5 doesn't have proper icmp support
- * built into it header files, so we have to supplement it */
-#if __GNU_LIBRARY__ < 5
-static const int ICMP_MINLEN = 8; /* abs minimum */
-
-struct icmp_ra_addr
-{
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-
-struct icmp
-{
- u_int8_t icmp_type; /* type of message, see below */
- u_int8_t icmp_code; /* type sub code */
- u_int16_t icmp_cksum; /* ones complement checksum of struct */
- union
- {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* gateway address */
- struct ih_idseq /* echo datagram */
- {
- u_int16_t icd_id;
- u_int16_t icd_seq;
- } ih_idseq;
- u_int32_t ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu
- {
- u_int16_t ipm_void;
- u_int16_t ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv
- {
- u_int8_t irt_num_addrs;
- u_int8_t irt_wpa;
- u_int16_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
- {
- u_int32_t its_otime;
- u_int32_t its_rtime;
- u_int32_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;
- u_int32_t id_mask;
- u_int8_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
-
static const int DEFDATALEN = 56;
static const int MAXIPLEN = 60;
static const int MAXICMPLEN = 76;
#include <netinet/ip_icmp.h>
- /* It turns out that libc5 doesn't have proper icmp support
- * built into it header files, so we have to supplement it */
-#if __GNU_LIBRARY__ < 5
-static const int ICMP_MINLEN = 8; /* abs minimum */
-
-struct icmp_ra_addr
-{
- u_int32_t ira_addr;
- u_int32_t ira_preference;
-};
-
-
-struct icmp
-{
- u_int8_t icmp_type; /* type of message, see below */
- u_int8_t icmp_code; /* type sub code */
- u_int16_t icmp_cksum; /* ones complement checksum of struct */
- union
- {
- u_char ih_pptr; /* ICMP_PARAMPROB */
- struct in_addr ih_gwaddr; /* gateway address */
- struct ih_idseq /* echo datagram */
- {
- u_int16_t icd_id;
- u_int16_t icd_seq;
- } ih_idseq;
- u_int32_t ih_void;
-
- /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
- struct ih_pmtu
- {
- u_int16_t ipm_void;
- u_int16_t ipm_nextmtu;
- } ih_pmtu;
-
- struct ih_rtradv
- {
- u_int8_t irt_num_addrs;
- u_int8_t irt_wpa;
- u_int16_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
- {
- u_int32_t its_otime;
- u_int32_t its_rtime;
- u_int32_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;
- u_int32_t id_mask;
- u_int8_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
-};
-
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_UNREACH_NET 0 /* bad net */
-#define ICMP_UNREACH_HOST 1 /* bad host */
-#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
-#define ICMP_UNREACH_PORT 3 /* bad port */
-#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
-#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
-#endif
-
-
#define MAXPACKET 65535 /* max ip packet size */
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#include "busybox.h"
-/* Stupid libc5 doesn't define this... */
-#ifndef timersub
-#define timersub(a, b, result) \
- do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
- } while (0)
-#endif
-
struct host_info {
char *host;
int port;
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.53 2003/03/19 09:12:39 mjn3 Exp $
+ * $Id: wget.c,v 1.54 2003/07/22 08:56:51 andersen Exp $
*/
#endif /* CONFIG_FEATURE_COMMAND_TAB_COMPLETION */
-/* It seems that libc5 doesn't know what a sighandler_t is... */
-#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
-typedef void (*sighandler_t) (int);
-#endif
-
static void cmdedit_setwidth(int w, int redraw_flg);
static void win_changed(int nsig)
#include <unistd.h>
#include <ctype.h>
#include <sys/syslog.h>
-
-#if __GNU_LIBRARY__ < 5
-# ifdef __alpha__
-# define klogctl syslog
-# endif
-#else
-# include <sys/klog.h>
-#endif
+#include <sys/klog.h>
#include "busybox.h"
#include <setjmp.h>
#include "busybox.h"
-#if __GNU_LIBRARY__ < 5
-#error Sorry. Looks like you are using libc5.
-#error libc5 shm support isnt good enough.
-#error Please disable CONFIG_FEATURE_IPC_SYSLOG
-#endif
-
-
static const long KEY_ID = 0x414e4547; /*"GENA"*/
static struct shbuf_ds {
/* circular buffer variables/structures */
#ifdef CONFIG_FEATURE_IPC_SYSLOG
-#if __GNU_LIBRARY__ < 5
-#error Sorry. Looks like you are using libc5.
-#error libc5 shm support isnt good enough.
-#error Please disable CONFIG_FEATURE_IPC_SYSLOG
-#endif
-
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <stdlib.h>
#include <getopt.h>
#include <errno.h>
-
-#if __GNU_LIBRARY__ < 5
-# ifdef __alpha__
-# define klogctl syslog
-# endif
-#else
-# include <sys/klog.h>
-#endif
+#include <sys/klog.h>
#include "busybox.h"
#include <string.h>
#include <stdlib.h>
#include <sys/mount.h>
-
-#if __GNU_LIBRARY__ < 5
-/* libc5 doesn't have sys/swap.h, define these here. */
-extern int swapon (__const char *__path, int __flags);
-extern int swapoff (__const char *__path);
-#else
#include <sys/swap.h>
-#endif
#include "busybox.h"