summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2003-07-22 08:56:55 +0000
committerEric Andersen2003-07-22 08:56:55 +0000
commit85e5e72bc1acd9d58c11bde6e14c8270cd9f169f (patch)
tree9971c6951256dd0bba5ff2a7db08ed6f65ef218d
parent0a14c9f924eaf6a64e78959a190d187d646b3c0c (diff)
downloadbusybox-85e5e72bc1acd9d58c11bde6e14c8270cd9f169f.zip
busybox-85e5e72bc1acd9d58c11bde6e14c8270cd9f169f.tar.gz
Remove remaining libc5 support code
-rw-r--r--coreutils/chgrp.c2
-rw-r--r--coreutils/chown.c2
-rw-r--r--include/busybox.h17
-rw-r--r--include/libbb.h12
-rw-r--r--init/init.c8
-rw-r--r--init/reboot.c13
-rw-r--r--libbb/Makefile.in4
-rw-r--r--libbb/dirname.c69
-rw-r--r--libbb/interface.c7
-rw-r--r--libbb/libc5.c184
-rw-r--r--libbb/module_syscalls.c10
-rw-r--r--libbb/syscalls.c10
-rw-r--r--libpwdgrp/setgroups.c11
-rw-r--r--miscutils/adjtimex.c7
-rw-r--r--miscutils/dutmp.c17
-rw-r--r--miscutils/update.c7
-rw-r--r--modutils/insmod.c6
-rw-r--r--networking/ping.c81
-rw-r--r--networking/traceroute.c91
-rw-r--r--networking/wget.c15
-rw-r--r--shell/cmdedit.c5
-rw-r--r--sysklogd/klogd.c9
-rw-r--r--sysklogd/logread.c7
-rw-r--r--sysklogd/syslogd.c6
-rw-r--r--util-linux/dmesg.c9
-rw-r--r--util-linux/swaponoff.c7
26 files changed, 35 insertions, 581 deletions
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c
index 78593ae..2f3fa41 100644
--- a/coreutils/chgrp.c
+++ b/coreutils/chgrp.c
@@ -29,7 +29,7 @@
#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
diff --git a/coreutils/chown.c b/coreutils/chown.c
index 5b1b89e..7b9ea91 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -30,7 +30,7 @@
#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
diff --git a/include/busybox.h b/include/busybox.h
index 8285494..aaa844f 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -31,6 +31,12 @@
#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
@@ -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 6bd096c..a4d8c71 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 69ce4b2..1f0bd4a 100644
--- a/init/init.c
+++ b/init/init.c
@@ -42,6 +42,7 @@
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <sys/reboot.h>
#include "busybox.h"
#include "init_shared.h"
@@ -50,9 +51,6 @@
#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__)
@@ -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 e9f9ff8..5ca8b58 100644
--- a/init/reboot.c
+++ b/init/reboot.c
@@ -25,18 +25,11 @@
#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;
@@ -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 cde3fb2..c4886e3 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 8129873..0000000
--- 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 <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
diff --git a/libbb/interface.c b/libbb/interface.c
index fb3a42a..46c3ba9 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, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
@@ -76,6 +76,7 @@
#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"
@@ -88,10 +89,6 @@
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
diff --git a/libbb/libc5.c b/libbb/libc5.c
deleted file mode 100644
index ac79196..0000000
--- a/libbb/libc5.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* 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
-
diff --git a/libbb/module_syscalls.c b/libbb/module_syscalls.c
index 6b6ebed..cb9258a 100644
--- a/libbb/module_syscalls.c
+++ b/libbb/module_syscalls.c
@@ -27,15 +27,11 @@
_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));
@@ -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 ee58d36..8ceb356 100644
--- a/libbb/syscalls.c
+++ b/libbb/syscalls.c
@@ -27,10 +27,6 @@
_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)
@@ -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 c133849..449e811 100644
--- a/libpwdgrp/setgroups.c
+++ b/libpwdgrp/setgroups.c
@@ -30,12 +30,11 @@
_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));
+}
+
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index d541848..e941f6b 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -44,14 +44,7 @@
#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[] = {
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index 113f850..86d7ce4 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 48ea02d..c51f421 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -32,12 +32,7 @@
#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"
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 1f5965e..84617fa 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 28b38db..a38f356 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 <tausq@debian.org>
@@ -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 be9ea1d..5f8989f 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -76,97 +76,6 @@
#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
diff --git a/networking/wget.c b/networking/wget.c
index d68b165..a9ead7f 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 350c0fd..843f73f 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 d32882d..f537a4b 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -38,14 +38,7 @@
#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"
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index ae8dbae..2692efb 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -35,13 +35,6 @@
#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 {
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 06dfca6..89f8d60 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 <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 6e0d694..0c0d2d7 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -22,14 +22,7 @@
#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"
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 1f3e930..9da7075 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -28,14 +28,7 @@
#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"