Remove remaining libc5 support code

This commit is contained in:
Eric Andersen 2003-07-22 08:56:55 +00:00
parent 0a14c9f924
commit 85e5e72bc1
26 changed files with 35 additions and 581 deletions

View File

@ -29,7 +29,7 @@
#include <unistd.h> #include <unistd.h>
#include "busybox.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) #if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown #define lchown chown
#endif #endif

View File

@ -30,7 +30,7 @@
#include <string.h> #include <string.h>
#include "busybox.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) #if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
#define lchown chown #define lchown chown
#endif #endif

View File

@ -31,6 +31,12 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.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 ")" #define BB_BANNER "BusyBox v" BB_VER " (" BB_BT ")"
#ifdef DMALLOC #ifdef DMALLOC
@ -93,17 +99,6 @@ extern const struct BB_applet applets[];
#endif #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 #ifndef RB_POWER_OFF
/* Stop system and switch power off if possible. */ /* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc #define RB_POWER_OFF 0x4321fedc

View File

@ -57,18 +57,6 @@
# define inline # define inline
#endif #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. */ /* Convenience macros to test the version of gcc. */
#if defined __GNUC__ && defined __GNUC_MINOR__ #if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \ # define __GNUC_PREREQ(maj, min) \

View File

@ -42,6 +42,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/reboot.h>
#include "busybox.h" #include "busybox.h"
#include "init_shared.h" #include "init_shared.h"
@ -50,9 +51,6 @@
#ifdef CONFIG_SYSLOGD #ifdef CONFIG_SYSLOGD
# include <sys/syslog.h> # include <sys/syslog.h>
#endif #endif
#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
#include <sys/reboot.h>
#endif
#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) #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 * linux/kernel/sys.c, which can cause the machine to panic when
* the init process is killed.... */ * the init process is killed.... */
if ((pid = fork()) == 0) { if ((pid = fork()) == 0) {
#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
reboot(magic); reboot(magic);
#else
reboot(0xfee1dead, 672274793, magic);
#endif
_exit(0); _exit(0);
} }
waitpid (pid, NULL, 0); waitpid (pid, NULL, 0);

View File

@ -25,18 +25,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
#include <sys/reboot.h>
#include "busybox.h" #include "busybox.h"
#include "init_shared.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 #ifndef RB_ENABLE_CAD
static const int RB_ENABLE_CAD = 0x89abcdef; static const int RB_ENABLE_CAD = 0x89abcdef;
static const int RB_AUTOBOOT = 0x01234567; static const int RB_AUTOBOOT = 0x01234567;
@ -57,7 +50,7 @@ extern int reboot_main(int argc, char **argv)
setpgrp(); setpgrp();
/* Allow Ctrl-Alt-Del to reboot system. */ /* 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"); message(CONSOLE|LOG, "\n\rThe system is going down NOW !!\n");
sync(); sync();
@ -74,7 +67,7 @@ extern int reboot_main(int argc, char **argv)
sync(); sync();
init_reboot(RB_AUTOBOOT); reboot(RB_AUTOBOOT);
return 0; /* Shrug */ return 0; /* Shrug */
#else #else
return kill_init(SIGTERM); return kill_init(SIGTERM);

View File

@ -27,12 +27,12 @@ LIBBB_SRC:= \
arith.c bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \ arith.c bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
compare_string_array.c concat_path_file.c copy_file.c \ compare_string_array.c concat_path_file.c copy_file.c \
copyfd.c correct_password.c create_icmp_socket.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 \ 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 \ 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 \ 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 \ 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 \ 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 \ 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 \ my_getpwnam.c my_getpwnamegid.c my_getpwuid.c obscure.c parse_mode.c \

View File

@ -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

View File

@ -15,7 +15,7 @@
* that either displays or sets the characteristics of * that either displays or sets the characteristics of
* one or more of the system's networking interfaces. * 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> * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation * and others. Copyright 1993 MicroWalt Corporation
@ -76,6 +76,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <ctype.h> #include <ctype.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h>
#include <net/if.h> #include <net/if.h>
#include <net/if_arp.h> #include <net/if_arp.h>
#include "libbb.h" #include "libbb.h"
@ -88,10 +89,6 @@
static int procnetdev_vsn = 1; static int procnetdev_vsn = 1;
/* Ugh. But libc5 doesn't provide POSIX types. */
#include <asm/types.h>
#ifdef HAVE_HWSLIP #ifdef HAVE_HWSLIP
#include <net/if_slip.h> #include <net/if_slip.h>
#endif #endif

View File

@ -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

View File

@ -27,15 +27,11 @@
_syscall* defined. */ _syscall* defined. */
#define __LIBRARY__ #define __LIBRARY__
#include <sys/syscall.h> #include <sys/syscall.h>
#if __GNU_LIBRARY__ < 5
/* This is needed for libc5 */
#include <asm/unistd.h>
#endif
#include "libbb.h" #include "libbb.h"
#if __GNU_LIBRARY__ < 5 || ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)) /* These syscalls are not included in very old glibc versions */
/* These syscalls are not included as part of libc5 */ #if ((__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1))
int delete_module(const char *name) int delete_module(const char *name)
{ {
return(syscall(__NR_delete_module, name)); return(syscall(__NR_delete_module, name));
@ -79,7 +75,7 @@ unsigned long create_module(const char *name, size_t size)
return ret; return ret;
} }
#endif /* __GNU_LIBRARY__ < 5 */ #endif
/* END CODE */ /* END CODE */

View File

@ -27,10 +27,6 @@
_syscall* defined. */ _syscall* defined. */
#define __LIBRARY__ #define __LIBRARY__
#include <sys/syscall.h> #include <sys/syscall.h>
#if __GNU_LIBRARY__ < 5
/* This is needed for libc5 */
#include <asm/unistd.h>
#endif
#include "libbb.h" #include "libbb.h"
int sysfs( int option, unsigned int fs_index, char * buf) 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) int bdflush(int func, int data)
{ {
return(syscall(__NR_bdflush, func, 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 */ /* END CODE */

View File

@ -30,12 +30,11 @@
_syscall* defined. */ _syscall* defined. */
#define __LIBRARY__ #define __LIBRARY__
#include <sys/syscall.h> #include <sys/syscall.h>
#if __GNU_LIBRARY__ < 5
/* This is needed for libc5 */
#include <asm/unistd.h>
#endif
#include "grp_.h" #include "grp_.h"
//#define __NR_setgroups 81 int setgroups(size_t size, const gid_t * list)
_syscall2(int, setgroups, size_t, size, const gid_t *, list); {
return(syscall(__NR_setgroups, size, list));
}

View File

@ -44,14 +44,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#if __GNU_LIBRARY__ < 5
#include <sys/timex.h> #include <sys/timex.h>
extern int adjtimex(struct timex *buf);
#else
#include <sys/timex.h>
#endif
#include "busybox.h" #include "busybox.h"
static struct {int bit; char *name;} statlist[] = { static struct {int bit; char *name;} statlist[] = {

View File

@ -28,13 +28,9 @@
* Do what we can while still keeping this reasonably small. * Do what we can while still keeping this reasonably small.
* Note: We are assuming the ut_id[] size is fixed at 4. */ * 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) #if (UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256)
#error struct utmp member char[] size(s) have changed! #error struct utmp member char[] size(s) have changed!
#endif #endif
#endif
extern int dutmp_main(int argc, char **argv) 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"); 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", 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_type, ut.ut_pid, ut.ut_line,
ut.ut_id, ut.ut_user, ut.ut_host, 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_session,
ut.ut_tv.tv_sec, ut.ut_tv.tv_usec, ut.ut_tv.tv_sec, ut.ut_tv.tv_usec,
ut.ut_addr); ut.ut_addr);
#endif
} }
bb_fflush_stdout_and_exit(EXIT_SUCCESS); bb_fflush_stdout_and_exit(EXIT_SUCCESS);

View File

@ -32,12 +32,7 @@
#include <sys/syslog.h> #include <sys/syslog.h>
#include <unistd.h> /* for getopt() */ #include <unistd.h> /* for getopt() */
#include <stdlib.h> #include <stdlib.h>
#include <sys/kdaemon.h>
#if __GNU_LIBRARY__ > 5
#include <sys/kdaemon.h>
#else
extern int bdflush (int func, long int data);
#endif
#include "busybox.h" #include "busybox.h"

View File

@ -247,7 +247,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; 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. /* 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 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 #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; 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. */ /* The relocatable object is manipulated using elfin types. */
@ -492,7 +492,7 @@ static const int MODUTILS_OBJ_H = 1;
# endif # endif
#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 #ifndef ELF32_ST_INFO
# define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) # define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
#endif #endif

View File

@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */ /* 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 * Mini ping implementation for busybox
* *
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org> * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@ -52,85 +52,6 @@
#include "busybox.h" #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 DEFDATALEN = 56;
static const int MAXIPLEN = 60; static const int MAXIPLEN = 60;
static const int MAXICMPLEN = 76; static const int MAXICMPLEN = 76;

View File

@ -76,97 +76,6 @@
#include <netinet/ip_icmp.h> #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 */ #define MAXPACKET 65535 /* max ip packet size */
#ifndef MAXHOSTNAMELEN #ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64 #define MAXHOSTNAMELEN 64

View File

@ -31,19 +31,6 @@
#include "busybox.h" #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 { struct host_info {
char *host; char *host;
int port; int port;
@ -824,7 +811,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * 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 $
*/ */

View File

@ -163,11 +163,6 @@ static int my_gid;
#endif /* CONFIG_FEATURE_COMMAND_TAB_COMPLETION */ #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 cmdedit_setwidth(int w, int redraw_flg);
static void win_changed(int nsig) static void win_changed(int nsig)

View File

@ -38,14 +38,7 @@
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <sys/syslog.h> #include <sys/syslog.h>
#include <sys/klog.h>
#if __GNU_LIBRARY__ < 5
# ifdef __alpha__
# define klogctl syslog
# endif
#else
# include <sys/klog.h>
#endif
#include "busybox.h" #include "busybox.h"

View File

@ -35,13 +35,6 @@
#include <setjmp.h> #include <setjmp.h>
#include "busybox.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 const long KEY_ID = 0x414e4547; /*"GENA"*/
static struct shbuf_ds { static struct shbuf_ds {

View File

@ -86,12 +86,6 @@ static int local_logging = FALSE;
/* circular buffer variables/structures */ /* circular buffer variables/structures */
#ifdef CONFIG_FEATURE_IPC_SYSLOG #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/ipc.h>
#include <sys/sem.h> #include <sys/sem.h>
#include <sys/shm.h> #include <sys/shm.h>

View File

@ -22,14 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <getopt.h> #include <getopt.h>
#include <errno.h> #include <errno.h>
#include <sys/klog.h>
#if __GNU_LIBRARY__ < 5
# ifdef __alpha__
# define klogctl syslog
# endif
#else
# include <sys/klog.h>
#endif
#include "busybox.h" #include "busybox.h"

View File

@ -28,14 +28,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/mount.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> #include <sys/swap.h>
#endif
#include "busybox.h" #include "busybox.h"