From 85e5e72bc1acd9d58c11bde6e14c8270cd9f169f Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 22 Jul 2003 08:56:55 +0000 Subject: [PATCH] Remove remaining libc5 support code --- coreutils/chgrp.c | 2 +- coreutils/chown.c | 2 +- include/busybox.h | 17 ++-- include/libbb.h | 12 --- init/init.c | 8 +- init/reboot.c | 13 +-- libbb/Makefile.in | 4 +- libbb/dirname.c | 69 --------------- libbb/interface.c | 7 +- libbb/libc5.c | 184 ---------------------------------------- libbb/module_syscalls.c | 10 +-- libbb/syscalls.c | 10 +-- libpwdgrp/setgroups.c | 11 ++- miscutils/adjtimex.c | 7 -- miscutils/dutmp.c | 17 ---- miscutils/update.c | 7 +- modutils/insmod.c | 6 +- networking/ping.c | 81 +----------------- networking/traceroute.c | 91 -------------------- networking/wget.c | 15 +--- shell/cmdedit.c | 5 -- sysklogd/klogd.c | 9 +- sysklogd/logread.c | 7 -- sysklogd/syslogd.c | 6 -- util-linux/dmesg.c | 9 +- util-linux/swaponoff.c | 7 -- 26 files changed, 35 insertions(+), 581 deletions(-) delete mode 100644 libbb/dirname.c delete mode 100644 libbb/libc5.c diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index 78593ae76..2f3fa4197 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c @@ -29,7 +29,7 @@ #include #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 diff --git a/coreutils/chown.c b/coreutils/chown.c index 5b1b89e79..7b9ea9175 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -30,7 +30,7 @@ #include #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 diff --git a/include/busybox.h b/include/busybox.h index 8285494ef..aaa844f43 100644 --- a/include/busybox.h +++ b/include/busybox.h @@ -31,6 +31,12 @@ #include #include +#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 @@ -93,17 +99,6 @@ extern const struct BB_applet applets[]; #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 diff --git a/include/libbb.h b/include/libbb.h index 6bd096c7f..a4d8c7196 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -57,18 +57,6 @@ # 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) \ diff --git a/init/init.c b/init/init.c index 69ce4b2c9..1f0bd4aec 100644 --- a/init/init.c +++ b/init/init.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "busybox.h" #include "init_shared.h" @@ -50,9 +51,6 @@ #ifdef CONFIG_SYSLOGD # include #endif -#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) -#include -#endif #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) @@ -665,11 +663,7 @@ static void init_reboot(unsigned long magic) * 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); diff --git a/init/reboot.c b/init/reboot.c index e9f9ff831..5ca8b588a 100644 --- a/init/reboot.c +++ b/init/reboot.c @@ -25,18 +25,11 @@ #include #include #include - +#include #include "busybox.h" #include "init_shared.h" -#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) - #include - #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; @@ -57,7 +50,7 @@ extern int reboot_main(int argc, char **argv) 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(); @@ -74,7 +67,7 @@ extern int reboot_main(int argc, char **argv) sync(); - init_reboot(RB_AUTOBOOT); + reboot(RB_AUTOBOOT); return 0; /* Shrug */ #else return kill_init(SIGTERM); diff --git a/libbb/Makefile.in b/libbb/Makefile.in index cde3fb2fa..c4886e3ff 100644 --- a/libbb/Makefile.in +++ b/libbb/Makefile.in @@ -27,12 +27,12 @@ LIBBB_SRC:= \ 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 \ diff --git a/libbb/dirname.c b/libbb/dirname.c deleted file mode 100644 index 81298730b..000000000 --- a/libbb/dirname.c +++ /dev/null @@ -1,69 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * dirname implementation for busybox (for libc's missing one) - * - * Copyright (C) 2003 Manuel Novoa III - * - * 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 -#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 diff --git a/libbb/interface.c b/libbb/interface.c index fb3a42a0c..46c3ba96c 100644 --- a/libbb/interface.c +++ b/libbb/interface.c @@ -15,7 +15,7 @@ * 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, * and others. Copyright 1993 MicroWalt Corporation @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include "libbb.h" @@ -88,10 +89,6 @@ static int procnetdev_vsn = 1; -/* Ugh. But libc5 doesn't provide POSIX types. */ -#include - - #ifdef HAVE_HWSLIP #include #endif diff --git a/libbb/libc5.c b/libbb/libc5.c deleted file mode 100644 index ac7919626..000000000 --- a/libbb/libc5.c +++ /dev/null @@ -1,184 +0,0 @@ -/* vi: set sw=4 ts=4: */ - - -#include -#include -#include -#include -#include -#include - - -#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 - */ -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 - * - * 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. - * - * 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 - diff --git a/libbb/module_syscalls.c b/libbb/module_syscalls.c index 6b6ebed06..cb9258af2 100644 --- a/libbb/module_syscalls.c +++ b/libbb/module_syscalls.c @@ -27,15 +27,11 @@ _syscall* defined. */ #define __LIBRARY__ #include -#if __GNU_LIBRARY__ < 5 -/* This is needed for libc5 */ -#include -#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)); @@ -79,7 +75,7 @@ unsigned long create_module(const char *name, size_t size) return ret; } -#endif /* __GNU_LIBRARY__ < 5 */ +#endif /* END CODE */ diff --git a/libbb/syscalls.c b/libbb/syscalls.c index ee58d3674..8ceb35695 100644 --- a/libbb/syscalls.c +++ b/libbb/syscalls.c @@ -27,10 +27,6 @@ _syscall* defined. */ #define __LIBRARY__ #include -#if __GNU_LIBRARY__ < 5 -/* This is needed for libc5 */ -#include -#endif #include "libbb.h" int sysfs( int option, unsigned int fs_index, char * buf) @@ -59,9 +55,9 @@ int pivot_root(const char * new_root,const char * put_old) -#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)); @@ -96,7 +92,7 @@ int umount2(const char * special_file, int flags) } -#endif /* __GNU_LIBRARY__ < 5 */ +#endif /* END CODE */ diff --git a/libpwdgrp/setgroups.c b/libpwdgrp/setgroups.c index c133849e8..449e811dc 100644 --- a/libpwdgrp/setgroups.c +++ b/libpwdgrp/setgroups.c @@ -30,12 +30,11 @@ _syscall* defined. */ #define __LIBRARY__ #include -#if __GNU_LIBRARY__ < 5 -/* This is needed for libc5 */ -#include -#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)); +} + diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index d541848f0..e941f6b4f 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c @@ -44,14 +44,7 @@ #include #include #include - -#if __GNU_LIBRARY__ < 5 -#include -extern int adjtimex(struct timex *buf); -#else #include -#endif - #include "busybox.h" static struct {int bit; char *name;} statlist[] = { diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c index 113f850fe..86d7ce4b3 100644 --- a/miscutils/dutmp.c +++ b/miscutils/dutmp.c @@ -28,13 +28,9 @@ * 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) { @@ -57,18 +53,6 @@ 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, @@ -76,7 +60,6 @@ extern int dutmp_main(int argc, char **argv) ut.ut_session, ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, ut.ut_addr); -#endif } bb_fflush_stdout_and_exit(EXIT_SUCCESS); diff --git a/miscutils/update.c b/miscutils/update.c index 48ea02deb..c51f42183 100644 --- a/miscutils/update.c +++ b/miscutils/update.c @@ -32,12 +32,7 @@ #include #include /* for getopt() */ #include - -#if __GNU_LIBRARY__ > 5 - #include -#else - extern int bdflush (int func, long int data); -#endif +#include #include "busybox.h" diff --git a/modutils/insmod.c b/modutils/insmod.c index 1f5965e0a..84617fa48 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c @@ -247,7 +247,7 @@ #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 @@ -468,7 +468,7 @@ int delete_module(const char *); #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. */ @@ -492,7 +492,7 @@ static const int MODUTILS_OBJ_H = 1; # 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 diff --git a/networking/ping.c b/networking/ping.c index 28b38db14..a38f356d6 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -1,6 +1,6 @@ /* 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 @@ -52,85 +52,6 @@ #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; diff --git a/networking/traceroute.c b/networking/traceroute.c index be9ea1d95..5f8989fd1 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -76,97 +76,6 @@ #include - /* 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 diff --git a/networking/wget.c b/networking/wget.c index d68b16524..a9ead7fc2 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -31,19 +31,6 @@ #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; @@ -824,7 +811,7 @@ progressmeter(int flag) * 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 $ */ diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 350c0fd86..843f73fef 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -163,11 +163,6 @@ static int my_gid; #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) diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index d32882d33..f537a4bb8 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -38,14 +38,7 @@ #include #include #include - -#if __GNU_LIBRARY__ < 5 -# ifdef __alpha__ -# define klogctl syslog -# endif -#else -# include -#endif +#include #include "busybox.h" diff --git a/sysklogd/logread.c b/sysklogd/logread.c index ae8dbae3a..2692efbee 100644 --- a/sysklogd/logread.c +++ b/sysklogd/logread.c @@ -35,13 +35,6 @@ #include #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 { diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 06dfca6d8..89f8d60ca 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -86,12 +86,6 @@ static int local_logging = FALSE; /* 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 #include #include diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 6e0d6947f..0c0d2d7c0 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c @@ -22,14 +22,7 @@ #include #include #include - -#if __GNU_LIBRARY__ < 5 -# ifdef __alpha__ -# define klogctl syslog -# endif -#else -# include -#endif +#include #include "busybox.h" diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 1f3e930a1..9da70756e 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -28,14 +28,7 @@ #include #include #include - -#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 -#endif #include "busybox.h" -- 2.25.1