summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image-lib.sh
blob: 3451f7be57bcf0db727f920a2000a29c4943440e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash

TITLE="%s Installer"
BACKTITLE="%s"
MIN_DISKSIZE=5000000

debug="/dev/null"

function _msgbox()
{
	dialog --timeout 60 --backtitle "$BACKTITLE" --title "$TITLE" --msgbox \
		"$1" 0 0

	return $?
}

function _infobox()
{
	dialog --backtitle "$BACKTITLE" --title "$TITLE" --sleep 2 \
		--infobox "$1" 0 0

	return $?
}

function _yesno()
{
	dialog --backtitle "$BACKTITLE" --title "$TITLE" \
		--yes-label "Yes" --no-label "No" --yesno "$1" 0 0

	return $?
}

function _mount()
{
	mount $1 $2 > $debug 2>&1

	return $?
}

function _umount()
{
	umount $1 > $debug 2>&1

	return $?
}

function _bind()
{
	mount --bind $1 $2 > $debug 2>&1

	return $?
}

function _eject()
{
	eject $1 > $debug 2>&1

	return $?
}

function _shutdown()
{
	[ -e /tmp/no-shutdown ] && exit
	clear
	sync
	echo s > /proc/sysrq-trigger
	echo o > /proc/sysrq-trigger
	exit
}

function _reboot()
{
	[ -e /tmp/no-shutdown ] && exit
	clear
	sync
	echo s > /proc/sysrq-trigger
	echo b > /proc/sysrq-trigger
	exit
}

le='width: 99.8%;'/> -rw-r--r--docs/TODO515
-rw-r--r--docs/advocacy87
-rw-r--r--docs/advocacy-interactive60
-rw-r--r--docs/comparisons288
-rw-r--r--docs/diskdrake.TODO23
-rw-r--r--docs/drakfont/Makefile57
-rw-r--r--docs/drakfont/dia_srcs/drakfont.diabin4599 -> 0 bytes-rw-r--r--docs/drakfont/dia_srcs/drakfont_install.diabin3662 -> 0 bytes-rw-r--r--docs/drakfont/dia_srcs/drakfont_uninstall.diabin1908 -> 0 bytes-rw-r--r--docs/drakfont/drakfont.jpgbin134044 -> 0 bytes-rw-r--r--docs/drakfont/drakfont.tex152
-rw-r--r--docs/drakfont/drakfont_install.jpgbin86455 -> 0 bytes-rw-r--r--docs/drakfont/drakfont_uninstall.jpgbin42291 -> 0 bytes-rw-r--r--docs/drakfont/mandrake.ps534
-rw-r--r--docs/draknet_advanced_doc.txt165
-rwxr-xr-xdocs/interactive/ask_from29
-rwxr-xr-xdocs/interactive/ask_from_list27
-rwxr-xr-xdocs/interactive/ask_from_listf27
-rwxr-xr-xdocs/interactive/ask_from_treelist27
-rwxr-xr-xdocs/interactive/wait_message13
-rw-r--r--docs/mdk-9.2129
-rw-r--r--docs/mdk-vs-redhat43
-rw-r--r--docs/net_object_class.fig73
-rw-r--r--docs/object_class.fig32
-rwxr-xr-xdocs/porting-ugtk48
-rw-r--r--docs/spec-DrakX-8.0.html405
-rw-r--r--docs/wizard.doc31
-rw-r--r--help.msg.xml22
-rw-r--r--isolinux-graphic-simple.bmpbin480566 -> 0 bytes-rw-r--r--isolinux-graphic.bmpbin480566 -> 0 bytes-rw-r--r--kernel/.cvsignore3
-rw-r--r--kernel/Makefile13
-rwxr-xr-xkernel/check_mar.pl30
-rw-r--r--kernel/dependencies.pl13
-rw-r--r--kernel/list_modules.pm227
-rw-r--r--kernel/modules.pl201
-rwxr-xr-xkernel/strip_modules124
-rwxr-xr-xkernel/update_kernel184
-rwxr-xr-xmake_boot_img811
-rw-r--r--mdk-stage1/.cvsignore14
-rw-r--r--mdk-stage1/Makefile274
-rw-r--r--mdk-stage1/Makefile.common64
-rw-r--r--mdk-stage1/Makefile.mkinitrd_helper30
-rw-r--r--mdk-stage1/adsl.c172
-rw-r--r--mdk-stage1/adsl.h34
-rw-r--r--mdk-stage1/automatic.c162
-rw-r--r--mdk-stage1/automatic.h33
-rw-r--r--mdk-stage1/bzlib/Makefile42
-rw-r--r--mdk-stage1/bzlib/blocksort.c1138
-rw-r--r--mdk-stage1/bzlib/bzlib.c1567
-rw-r--r--mdk-stage1/bzlib/bzlib.h319
-rw-r--r--mdk-stage1/bzlib/bzlib_private.h530
-rw-r--r--mdk-stage1/bzlib/compress.c720
-rw-r--r--mdk-stage1/bzlib/crctable.c148
-rw-r--r--mdk-stage1/bzlib/decompress.c664
-rw-r--r--mdk-stage1/bzlib/huffman.c232
-rw-r--r--mdk-stage1/bzlib/randtable.c128
-rw-r--r--mdk-stage1/cdrom.c219
-rw-r--r--mdk-stage1/cdrom.h29
-rw-r--r--mdk-stage1/config-stage1.h64
-rw-r--r--mdk-stage1/dhcp.c676
-rw-r--r--mdk-stage1/dhcp.h36
-rw-r--r--mdk-stage1/dietlibc/.cvsignore28
-rw-r--r--mdk-stage1/dietlibc/AUTHOR3
-rw-r--r--mdk-stage1/dietlibc/Makefile413
-rw-r--r--mdk-stage1/dietlibc/README49
-rw-r--r--mdk-stage1/dietlibc/alpha/Makefile.add5
-rw-r--r--mdk-stage1/dietlibc/alpha/__alarm.c13
-rw-r--r--mdk-stage1/dietlibc/alpha/__longjmp.S33
-rw-r--r--mdk-stage1/dietlibc/alpha/__testandset.S11
-rw-r--r--mdk-stage1/dietlibc/alpha/__time.c11
-rw-r--r--mdk-stage1/dietlibc/alpha/accept.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/bind.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/clone.S42
-rw-r--r--mdk-stage1/dietlibc/alpha/connect.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/divl.S101
-rw-r--r--mdk-stage1/dietlibc/alpha/divq.S102
-rw-r--r--mdk-stage1/dietlibc/alpha/errlist.S288
-rw-r--r--mdk-stage1/dietlibc/alpha/getegid.S11
-rw-r--r--mdk-stage1/dietlibc/alpha/geteuid.S11
-rw-r--r--mdk-stage1/dietlibc/alpha/getgid.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/getpeername.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/getpid.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/getppid.S11
-rw-r--r--mdk-stage1/dietlibc/alpha/getsockname.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/getsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/getuid.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/listen.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/lseek64.S5
-rw-r--r--mdk-stage1/dietlibc/alpha/mmap.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/msgctl.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/msgget.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/msgrcv.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/msgsnd.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/n_sigprocmask.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/pipe.S17
-rw-r--r--mdk-stage1/dietlibc/alpha/recv.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/recvfrom.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/recvmsg.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/reml.S101
-rw-r--r--mdk-stage1/dietlibc/alpha/remq.S97
-rw-r--r--mdk-stage1/dietlibc/alpha/semctl.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/semget.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/semop.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/send.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/sendmsg.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/sendto.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/seteuid.c7
-rw-r--r--mdk-stage1/dietlibc/alpha/setjmp.S35
-rw-r--r--mdk-stage1/dietlibc/alpha/setsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/shmat.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/shmctl.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/shmdt.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/shmget.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/shutdown.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/sigaction.c7
-rw-r--r--mdk-stage1/dietlibc/alpha/socket.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/socketcall.S5
-rw-r--r--mdk-stage1/dietlibc/alpha/socketpair.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/start.S33
-rw-r--r--mdk-stage1/dietlibc/alpha/strlen.c32
-rw-r--r--mdk-stage1/dietlibc/alpha/syscalls.h371
-rw-r--r--mdk-stage1/dietlibc/alpha/time.S0
-rw-r--r--mdk-stage1/dietlibc/alpha/unified.S39
-rw-r--r--mdk-stage1/dietlibc/alpha/utime.S3
-rw-r--r--mdk-stage1/dietlibc/alpha/waitpid.S10
-rw-r--r--mdk-stage1/dietlibc/binshstr.h6
-rw-r--r--mdk-stage1/dietlibc/diet.c367
-rw-r--r--mdk-stage1/dietlibc/dietdirent.h8
-rw-r--r--mdk-stage1/dietlibc/dietdns.h4
-rw-r--r--mdk-stage1/dietlibc/dietfeatures.h108
-rw-r--r--mdk-stage1/dietlibc/dieticonv.h12
-rw-r--r--mdk-stage1/dietlibc/dietlibm.h5
-rw-r--r--mdk-stage1/dietlibc/dietstdio.h77
-rw-r--r--mdk-stage1/dietlibc/dietuglyweaks.h24
-rw-r--r--mdk-stage1/dietlibc/dietwarning.h23
-rw-r--r--mdk-stage1/dietlibc/dyn_start.c40
-rw-r--r--mdk-stage1/dietlibc/dyn_stop.c23
-rwxr-xr-xmdk-stage1/dietlibc/findcflags.sh8
-rw-r--r--mdk-stage1/dietlibc/i386/Makefile.add8
-rw-r--r--mdk-stage1/dietlibc/i386/PIC.h82
-rw-r--r--mdk-stage1/dietlibc/i386/__half.S10
-rw-r--r--mdk-stage1/dietlibc/i386/__longjmp.S19
-rw-r--r--mdk-stage1/dietlibc/i386/__ten.S9
-rw-r--r--mdk-stage1/dietlibc/i386/__testandset.S9
-rw-r--r--mdk-stage1/dietlibc/i386/accept.S4
-rw-r--r--mdk-stage1/dietlibc/i386/acos.S30
-rw-r--r--mdk-stage1/dietlibc/i386/acosh.S18
-rw-r--r--mdk-stage1/dietlibc/i386/asin.S29
-rw-r--r--mdk-stage1/dietlibc/i386/asinh.S18
-rw-r--r--mdk-stage1/dietlibc/i386/atan.S27
-rw-r--r--mdk-stage1/dietlibc/i386/atan2.S12
-rw-r--r--mdk-stage1/dietlibc/i386/atanh.S19
-rw-r--r--mdk-stage1/dietlibc/i386/atol.S55
-rw-r--r--mdk-stage1/dietlibc/i386/atoll.S64
-rw-r--r--mdk-stage1/dietlibc/i386/bind.S4
-rw-r--r--mdk-stage1/dietlibc/i386/cbrt.S46
-rw-r--r--mdk-stage1/dietlibc/i386/ceil.S44
-rw-r--r--mdk-stage1/dietlibc/i386/clone.S60
-rw-r--r--mdk-stage1/dietlibc/i386/connect.S4
-rw-r--r--mdk-stage1/dietlibc/i386/copysign.S18
-rw-r--r--mdk-stage1/dietlibc/i386/cos.S35
-rw-r--r--mdk-stage1/dietlibc/i386/cosh.S29
-rw-r--r--mdk-stage1/dietlibc/i386/dyn_syscalls.S282
-rw-r--r--mdk-stage1/dietlibc/i386/exp.S35
-rw-r--r--mdk-stage1/dietlibc/i386/exp10.S27
-rw-r--r--mdk-stage1/dietlibc/i386/exp2.S18
-rw-r--r--mdk-stage1/dietlibc/i386/expm1.S23
-rw-r--r--mdk-stage1/dietlibc/i386/fabs.S11
-rw-r--r--mdk-stage1/dietlibc/i386/floor.S26
-rw-r--r--mdk-stage1/dietlibc/i386/fmod.S37
-rw-r--r--mdk-stage1/dietlibc/i386/getenv.S48
-rw-r--r--mdk-stage1/dietlibc/i386/getpeername.S4
-rw-r--r--mdk-stage1/dietlibc/i386/getsockname.S4
-rw-r--r--mdk-stage1/dietlibc/i386/getsockopt.S4
-rw-r--r--mdk-stage1/dietlibc/i386/htonl.S13
-rw-r--r--mdk-stage1/dietlibc/i386/htons.S11
-rw-r--r--mdk-stage1/dietlibc/i386/hypot.S15
-rw-r--r--mdk-stage1/dietlibc/i386/ilogb.S23
-rw-r--r--mdk-stage1/dietlibc/i386/ipow.S27
-rw-r--r--mdk-stage1/dietlibc/i386/isleap.S28
-rw-r--r--mdk-stage1/dietlibc/i386/ldexp.S28
-rw-r--r--mdk-stage1/dietlibc/i386/libm2.S643
-rw-r--r--mdk-stage1/dietlibc/i386/listen.S4
-rw-r--r--mdk-stage1/dietlibc/i386/log.S26
-rw-r--r--mdk-stage1/dietlibc/i386/log10.S11
-rw-r--r--mdk-stage1/dietlibc/i386/log1p.S12
-rw-r--r--mdk-stage1/dietlibc/i386/log2.S11
-rw-r--r--mdk-stage1/dietlibc/i386/ltostr.S62
-rw-r--r--mdk-stage1/dietlibc/i386/mcount.S44
-rw-r--r--mdk-stage1/dietlibc/i386/md5asm.S300
-rw-r--r--mdk-stage1/dietlibc/i386/memccpy.S39
-rw-r--r--mdk-stage1/dietlibc/i386/memchr.S24
-rw-r--r--mdk-stage1/dietlibc/i386/memcmp.S26
-rw-r--r--mdk-stage1/dietlibc/i386/memcpy.S16
-rw-r--r--mdk-stage1/dietlibc/i386/memset.S15
-rw-r--r--mdk-stage1/dietlibc/i386/mmap.S14
-rw-r--r--mdk-stage1/dietlibc/i386/mmap.c16
-rw-r--r--mdk-stage1/dietlibc/i386/mmap64.S63
-rw-r--r--mdk-stage1/dietlibc/i386/poly.S24
-rw-r--r--mdk-stage1/dietlibc/i386/pow.S67
-rw-r--r--mdk-stage1/dietlibc/i386/recv.S4
-rw-r--r--mdk-stage1/dietlibc/i386/recvfrom.S4
-rw-r--r--mdk-stage1/dietlibc/i386/recvmsg.S4
-rw-r--r--mdk-stage1/dietlibc/i386/rint.S23
-rw-r--r--mdk-stage1/dietlibc/i386/select.S3
-rw-r--r--mdk-stage1/dietlibc/i386/send.S4
-rw-r--r--mdk-stage1/dietlibc/i386/sendmsg.S4
-rw-r--r--mdk-stage1/dietlibc/i386/sendto.S4
-rw-r--r--mdk-stage1/dietlibc/i386/setjmp.S41
-rw-r--r--mdk-stage1/dietlibc/i386/setsockopt.S4
-rw-r--r--mdk-stage1/dietlibc/i386/shutdown.S4
-rw-r--r--mdk-stage1/dietlibc/i386/sin.S34
-rw-r--r--mdk-stage1/dietlibc/i386/sincos.S18
-rw-r--r--mdk-stage1/dietlibc/i386/sinh.S29
-rw-r--r--mdk-stage1/dietlibc/i386/sleep.S25
-rw-r--r--mdk-stage1/dietlibc/i386/socket.S4
-rw-r--r--mdk-stage1/dietlibc/i386/socketcall.S17
-rw-r--r--mdk-stage1/dietlibc/i386/socketpair.S4
-rw-r--r--mdk-stage1/dietlibc/i386/sqrt.S23
-rw-r--r--mdk-stage1/dietlibc/i386/sqrtl.S11
-rw-r--r--mdk-stage1/dietlibc/i386/start.S51
-rw-r--r--mdk-stage1/dietlibc/i386/stpcpy.S22
-rw-r--r--mdk-stage1/dietlibc/i386/strcasecmp.S31
-rw-r--r--mdk-stage1/dietlibc/i386/strcat.S29
-rw-r--r--mdk-stage1/dietlibc/i386/strchr.S22
-rw-r--r--mdk-stage1/dietlibc/i386/strcmp.S31
-rw-r--r--mdk-stage1/dietlibc/i386/strcpy.S24
-rw-r--r--mdk-stage1/dietlibc/i386/strlen.S18
-rw-r--r--mdk-stage1/dietlibc/i386/strncmp.S28
-rw-r--r--mdk-stage1/dietlibc/i386/strncpy.S42
-rw-r--r--mdk-stage1/dietlibc/i386/strrchr.S19
-rw-r--r--mdk-stage1/dietlibc/i386/syscalls.h303
-rw-r--r--mdk-stage1/dietlibc/i386/tan.S12
-rw-r--r--mdk-stage1/dietlibc/i386/tanh.S32
-rw-r--r--mdk-stage1/dietlibc/i386/unified.S59
-rw-r--r--mdk-stage1/dietlibc/i386/usleep.S31
-rw-r--r--mdk-stage1/dietlibc/i386/vfork.S9
-rw-r--r--mdk-stage1/dietlibc/i386/write12.S37
-rw-r--r--mdk-stage1/dietlibc/ia64/Makefile.add2
-rw-r--r--mdk-stage1/dietlibc/ia64/README4
-rw-r--r--mdk-stage1/dietlibc/ia64/__alarm.c1
-rw-r--r--mdk-stage1/dietlibc/ia64/__longjmp.S1
-rw-r--r--mdk-stage1/dietlibc/ia64/__nice.c6
-rw-r--r--mdk-stage1/dietlibc/ia64/__testandset.S11
-rw-r--r--mdk-stage1/dietlibc/ia64/__time.c14
-rw-r--r--mdk-stage1/dietlibc/ia64/__waitpid.c5
-rw-r--r--mdk-stage1/dietlibc/ia64/accept.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/bind.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/clone.S41
-rw-r--r--mdk-stage1/dietlibc/ia64/connect.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/fork.S8
-rw-r--r--mdk-stage1/dietlibc/ia64/getpeername.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/getsockname.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/getsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/listen.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/mmap.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/msgctl.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/msgget.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/msgrcv.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/msgsnd.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/pipe.S20
-rw-r--r--mdk-stage1/dietlibc/ia64/recv.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/recvfrom.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/recvmsg.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/semctl.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/semget.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/semop.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/send.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/sendmsg.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/sendto.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/setjmp.S1
-rw-r--r--mdk-stage1/dietlibc/ia64/setsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/shmat.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/shmctl.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/shmdt.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/shmget.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/shutdown.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/socket.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/socketpair.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/start.S45
-rw-r--r--mdk-stage1/dietlibc/ia64/syscalls.h242
-rw-r--r--mdk-stage1/dietlibc/ia64/unified.S46
-rw-r--r--mdk-stage1/dietlibc/ia64/utime.S3
-rw-r--r--mdk-stage1/dietlibc/ia64/vfork.S8
-rw-r--r--mdk-stage1/dietlibc/include/alloca.h13
-rw-r--r--mdk-stage1/dietlibc/include/arpa/inet.h20
-rw-r--r--mdk-stage1/dietlibc/include/arpa/nameser.h253
-rw-r--r--mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h29
-rw-r--r--mdk-stage1/dietlibc/include/asm/arm-sigcontext.h32
-rw-r--r--mdk-stage1/dietlibc/include/asm/i386-sigcontext.h66
-rw-r--r--mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h25
-rw-r--r--mdk-stage1/dietlibc/include/asm/mips-sigcontext.h23
-rw-r--r--mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h16
-rw-r--r--mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h76
-rw-r--r--mdk-stage1/dietlibc/include/asm/sigcontext.h36
-rw-r--r--mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h50
-rw-r--r--mdk-stage1/dietlibc/include/asm/statfs.h1
-rw-r--r--mdk-stage1/dietlibc/include/asm/types.h32
-rw-r--r--mdk-stage1/dietlibc/include/assert.h38
-rw-r--r--mdk-stage1/dietlibc/include/cpio.h27
-rw-r--r--mdk-stage1/dietlibc/include/ctype.h28
-rw-r--r--mdk-stage1/dietlibc/include/daemon.h6
-rw-r--r--mdk-stage1/dietlibc/include/dietref.h22
-rw-r--r--mdk-stage1/dietlibc/include/dirent.h64
-rw-r--r--mdk-stage1/dietlibc/include/dlfcn.h18
-rw-r--r--mdk-stage1/dietlibc/include/elf.h780
-rw-r--r--mdk-stage1/dietlibc/include/endian.h62
-rw-r--r--mdk-stage1/dietlibc/include/errno.h546
-rw-r--r--mdk-stage1/dietlibc/include/fcntl.h564
-rw-r--r--mdk-stage1/dietlibc/include/features.h8
-rw-r--r--mdk-stage1/dietlibc/include/float.h96
-rw-r--r--mdk-stage1/dietlibc/include/fnmatch.h17
-rw-r--r--mdk-stage1/dietlibc/include/ftw.h51
-rw-r--r--mdk-stage1/dietlibc/include/getopt.h28
-rw-r--r--mdk-stage1/dietlibc/include/glob.h57
-rw-r--r--mdk-stage1/dietlibc/include/grp.h35
-rw-r--r--mdk-stage1/dietlibc/include/iconv.h25
-rw-r--r--mdk-stage1/dietlibc/include/inttypes.h247
-rw-r--r--mdk-stage1/dietlibc/include/libgen.h9
-rw-r--r--mdk-stage1/dietlibc/include/libintl.h23
-rw-r--r--mdk-stage1/dietlibc/include/limits.h73
-rw-r--r--mdk-stage1/dietlibc/include/linux/eventpoll.h17
-rw-r--r--mdk-stage1/dietlibc/include/linux/if_ether.h101
-rw-r--r--mdk-stage1/dietlibc/include/linux/loop.h47
-rw-r--r--mdk-stage1/dietlibc/include/linux/nfs.h88
-rw-r--r--mdk-stage1/dietlibc/include/linux/posix_types.h115
-rw-r--r--mdk-stage1/dietlibc/include/linux/types.h6
-rw-r--r--mdk-stage1/dietlibc/include/locale.h84
-rw-r--r--mdk-stage1/dietlibc/include/malloc.h1
-rw-r--r--mdk-stage1/dietlibc/include/math.h96
-rw-r--r--mdk-stage1/dietlibc/include/md5.h48
-rw-r--r--mdk-stage1/dietlibc/include/memory.h6
-rw-r--r--mdk-stage1/dietlibc/include/mntent.h72
-rw-r--r--mdk-stage1/dietlibc/include/net/ethernet.h76
-rw-r--r--mdk-stage1/dietlibc/include/net/if.h102
-rw-r--r--mdk-stage1/dietlibc/include/net/if_arp.h113
-rw-r--r--mdk-stage1/dietlibc/include/net/if_ether.h74
-rw-r--r--mdk-stage1/dietlibc/include/net/route.h52
-rw-r--r--mdk-stage1/dietlibc/include/netdb.h124
-rw-r--r--mdk-stage1/dietlibc/include/netinet/in.h404
-rw-r--r--mdk-stage1/dietlibc/include/netinet/in_systm.h0
-rw-r--r--mdk-stage1/dietlibc/include/netinet/ip.h121
-rw-r--r--mdk-stage1/dietlibc/include/netinet/ip_icmp.h145
-rw-r--r--mdk-stage1/dietlibc/include/netinet/tcp.h164
-rw-r--r--mdk-stage1/dietlibc/include/netinet/udp.h16
-rw-r--r--mdk-stage1/dietlibc/include/netpacket/packet.h41
-rw-r--r--mdk-stage1/dietlibc/include/paths.h23
-rw-r--r--mdk-stage1/dietlibc/include/pthread.h244
-rw-r--r--mdk-stage1/dietlibc/include/pty.h13
-rw-r--r--mdk-stage1/dietlibc/include/pwd.h35
-rw-r--r--mdk-stage1/dietlibc/include/regex.h71
-rw-r--r--mdk-stage1/dietlibc/include/resolv.h124
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth.h214
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth_des.h112
-rw-r--r--mdk-stage1/dietlibc/include/rpc/auth_unix.h90
-rw-r--r--mdk-stage1/dietlibc/include/rpc/clnt.h421
-rw-r--r--mdk-stage1/dietlibc/include/rpc/des_crypt.h97
-rw-r--r--mdk-stage1/dietlibc/include/rpc/key_prot.h346
-rw-r--r--mdk-stage1/dietlibc/include/rpc/netdb.h74
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_clnt.h98
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_prot.h108
-rw-r--r--mdk-stage1/dietlibc/include/rpc/pmap_rmt.h68
-rw-r--r--mdk-stage1/dietlibc/include/rpc/rpc.h70
-rw-r--r--mdk-stage1/dietlibc/include/rpc/rpc_des.h72
-rw-r--r--mdk-stage1/dietlibc/include/rpc/rpc_msg.h202
-rw-r--r--mdk-stage1/dietlibc/include/rpc/svc.h316
-rw-r--r--mdk-stage1/dietlibc/include/rpc/svc_auth.h54
-rw-r--r--mdk-stage1/dietlibc/include/rpc/types.h84
-rw-r--r--mdk-stage1/dietlibc/include/rpc/xdr.h379
-rw-r--r--mdk-stage1/dietlibc/include/sched.h69
-rw-r--r--mdk-stage1/dietlibc/include/scsi/scsi.h224
-rw-r--r--mdk-stage1/dietlibc/include/scsi/scsi_ioctl.h34
-rw-r--r--mdk-stage1/dietlibc/include/scsi/sg.h274
-rw-r--r--mdk-stage1/dietlibc/include/setjmp.h231
-rw-r--r--mdk-stage1/dietlibc/include/shadow.h30
-rw-r--r--mdk-stage1/dietlibc/include/signal.h500
-rw-r--r--mdk-stage1/dietlibc/include/stdarg-cruft.h299
-rw-r--r--mdk-stage1/dietlibc/include/stdarg.h24
-rw-r--r--mdk-stage1/dietlibc/include/stddef.h23
-rw-r--r--mdk-stage1/dietlibc/include/stdint.h30
-rw-r--r--mdk-stage1/dietlibc/include/stdio.h147
-rw-r--r--mdk-stage1/dietlibc/include/stdlib.h100
-rw-r--r--mdk-stage1/dietlibc/include/string.h74
-rw-r--r--mdk-stage1/dietlibc/include/strings.h23
-rw-r--r--mdk-stage1/dietlibc/include/sys/alpha-ioctl.h168
-rw-r--r--mdk-stage1/dietlibc/include/sys/arm-ioctl.h149
-rw-r--r--mdk-stage1/dietlibc/include/sys/cdefs.h61
-rw-r--r--mdk-stage1/dietlibc/include/sys/epoll.h60
-rw-r--r--mdk-stage1/dietlibc/include/sys/file.h10
-rw-r--r--mdk-stage1/dietlibc/include/sys/fsuid.h12
-rw-r--r--mdk-stage1/dietlibc/include/sys/gmon.h99
-rw-r--r--mdk-stage1/dietlibc/include/sys/gmon_out.h1
-rw-r--r--mdk-stage1/dietlibc/include/sys/hppa-ioctl.h133
-rw-r--r--mdk-stage1/dietlibc/include/sys/i386-ioctl.h141
-rw-r--r--mdk-stage1/dietlibc/include/sys/io.h44
-rw-r--r--mdk-stage1/dietlibc/include/sys/ioctl.h32
-rw-r--r--mdk-stage1/dietlibc/include/sys/ipc.h49
-rw-r--r--mdk-stage1/dietlibc/include/sys/kd.h183
-rw-r--r--mdk-stage1/dietlibc/include/sys/klog.h8
-rw-r--r--mdk-stage1/dietlibc/include/sys/mips-ioctl.h177
-rw-r--r--mdk-stage1/dietlibc/include/sys/mman.h184
-rw-r--r--mdk-stage1/dietlibc/include/sys/mount.h80
-rw-r--r--mdk-stage1/dietlibc/include/sys/msg.h57
-rw-r--r--mdk-stage1/dietlibc/include/sys/mtio.h340
-rw-r--r--mdk-stage1/dietlibc/include/sys/param.h28
-rw-r--r--mdk-stage1/dietlibc/include/sys/poll.h47
-rw-r--r--mdk-stage1/dietlibc/include/sys/ppc-ioctl.h164
-rw-r--r--mdk-stage1/dietlibc/include/sys/prctl.h8
-rw-r--r--mdk-stage1/dietlibc/include/sys/ptrace.h846
-rw-r--r--mdk-stage1/dietlibc/include/sys/reboot.h26
-rw-r--r--mdk-stage1/dietlibc/include/sys/resource.h67
-rw-r--r--mdk-stage1/dietlibc/include/sys/s390-ioctl.h141
-rw-r--r--mdk-stage1/dietlibc/include/sys/select.h22
-rw-r--r--mdk-stage1/dietlibc/include/sys/sem.h81
-rw-r--r--mdk-stage1/dietlibc/include/sys/sendfile.h13
-rw-r--r--mdk-stage1/dietlibc/include/sys/shm.h75
-rw-r--r--mdk-stage1/dietlibc/include/sys/signal.h1
-rw-r--r--mdk-stage1/dietlibc/include/sys/socket.h526
-rw-r--r--mdk-stage1/dietlibc/include/sys/soundcard.h1300
-rw-r--r--mdk-stage1/dietlibc/include/sys/sparc-ioctl.h172
-rw-r--r--mdk-stage1/dietlibc/include/sys/stat.h516
-rw-r--r--mdk-stage1/dietlibc/include/sys/syscall.h6
-rw-r--r--mdk-stage1/dietlibc/include/sys/sysinfo.h27
-rw-r--r--mdk-stage1/dietlibc/include/sys/syslog.h102
-rw-r--r--mdk-stage1/dietlibc/include/sys/sysmacros.h6
-rw-r--r--mdk-stage1/dietlibc/include/sys/time.h68
-rw-r--r--mdk-stage1/dietlibc/include/sys/timeb.h13
-rw-r--r--mdk-stage1/dietlibc/include/sys/times.h16
-rw-r--r--mdk-stage1/dietlibc/include/sys/timex.h50
-rw-r--r--mdk-stage1/dietlibc/include/sys/types.h133
-rw-r--r--mdk-stage1/dietlibc/include/sys/ucontext.h110
-rw-r--r--mdk-stage1/dietlibc/include/sys/uio.h9
-rw-r--r--mdk-stage1/dietlibc/include/sys/un.h13
-rw-r--r--mdk-stage1/dietlibc/include/sys/utsname.h35
-rw-r--r--mdk-stage1/dietlibc/include/sys/vfs.h35
-rw-r--r--mdk-stage1/dietlibc/include/sys/wait.h45
-rw-r--r--mdk-stage1/dietlibc/include/sysexits.h26
-rw-r--r--mdk-stage1/dietlibc/include/syslog.h1
-rw-r--r--mdk-stage1/dietlibc/include/tar.h36
-rw-r--r--mdk-stage1/dietlibc/include/termio.h4
-rw-r--r--mdk-stage1/dietlibc/include/termios.h383
-rw-r--r--mdk-stage1/dietlibc/include/time.h40
-rw-r--r--mdk-stage1/dietlibc/include/unistd.h233
-rw-r--r--mdk-stage1/dietlibc/include/utime.h16
-rw-r--r--mdk-stage1/dietlibc/include/utmp.h94
-rw-r--r--mdk-stage1/dietlibc/include/write12.h4
-rw-r--r--mdk-stage1/dietlibc/lib/__dtostr.c140
-rw-r--r--mdk-stage1/dietlibc/lib/__fstat64.c20
-rw-r--r--mdk-stage1/dietlibc/lib/__ftruncate64.c23
-rw-r--r--mdk-stage1/dietlibc/lib/__getcwd.c11
-rw-r--r--mdk-stage1/dietlibc/lib/__isinf.c15
-rw-r--r--mdk-stage1/dietlibc/lib/__isnan.c15
-rw-r--r--mdk-stage1/dietlibc/lib/__lltostr.c33
-rw-r--r--mdk-stage1/dietlibc/lib/__lstat64.c20
-rw-r--r--mdk-stage1/dietlibc/lib/__ltostr.c32
-rw-r--r--mdk-stage1/dietlibc/lib/__ptrace.c27
-rw-r--r--mdk-stage1/dietlibc/lib/__stat64.c20
-rw-r--r--mdk-stage1/dietlibc/lib/__stat64_cvt.c20
-rw-r--r--mdk-stage1/dietlibc/lib/__stime.c14
-rw-r--r--mdk-stage1/dietlibc/lib/__truncate64.c23
-rw-r--r--mdk-stage1/dietlibc/lib/__v_printf.c301
-rw-r--r--mdk-stage1/dietlibc/lib/__v_scanf.c391
-rw-r--r--mdk-stage1/dietlibc/lib/_brk.c13
-rw-r--r--mdk-stage1/dietlibc/lib/abort.c19
-rw-r--r--mdk-stage1/dietlibc/lib/abs.c6
-rw-r--r--mdk-stage1/dietlibc/lib/accept.c12
-rw-r--r--mdk-stage1/dietlibc/lib/adjtime.c18
-rw-r--r--mdk-stage1/dietlibc/lib/alloc.c237
-rw-r--r--mdk-stage1/dietlibc/lib/assert_fail.c31
-rw-r--r--mdk-stage1/dietlibc/lib/atexit.c31
-rw-r--r--mdk-stage1/dietlibc/lib/atof.c10
-rw-r--r--mdk-stage1/dietlibc/lib/atoi.c19
-rw-r--r--mdk-stage1/dietlibc/lib/atol.c23
-rw-r--r--mdk-stage1/dietlibc/lib/atoll.c19
-rw-r--r--mdk-stage1/dietlibc/lib/bcd.c185
-rw-r--r--mdk-stage1/dietlibc/lib/bind.c11
-rw-r--r--mdk-stage1/dietlibc/lib/binshstr.c5
-rw-r--r--mdk-stage1/dietlibc/lib/bsearch.c20
-rw-r--r--mdk-stage1/dietlibc/lib/cfgetospeed.c8
-rw-r--r--mdk-stage1/dietlibc/lib/cfmakeraw.c13
-rw-r--r--mdk-stage1/dietlibc/lib/cfsetispeed.c22
-rw-r--r--mdk-stage1/dietlibc/lib/cfsetospeed.c14
-rw-r--r--mdk-stage1/dietlibc/lib/closedir.c11
-rw-r--r--mdk-stage1/dietlibc/lib/connect.c11
-rw-r--r--mdk-stage1/dietlibc/lib/creat.c7
-rw-r--r--mdk-stage1/dietlibc/lib/creat64.c9
-rw-r--r--mdk-stage1/dietlibc/lib/errlistu.c6
-rw-r--r--mdk-stage1/dietlibc/lib/errno_location.c5
-rw-r--r--mdk-stage1/dietlibc/lib/exec_lib.c21
-rw-r--r--mdk-stage1/dietlibc/lib/exec_lib.h9
-rw-r--r--mdk-stage1/dietlibc/lib/execl.c25
-rw-r--r--mdk-stage1/dietlibc/lib/execle.c26
-rw-r--r--mdk-stage1/dietlibc/lib/execlp.c26
-rw-r--r--mdk-stage1/dietlibc/lib/execv.c15
-rw-r--r--mdk-stage1/dietlibc/lib/execvp.c47
-rw-r--r--mdk-stage1/dietlibc/lib/ftw.c47
-rw-r--r--mdk-stage1/dietlibc/lib/getdomainname.c18
-rw-r--r--mdk-stage1/dietlibc/lib/getenv.c16
-rw-r--r--mdk-stage1/dietlibc/lib/gethostname.c19
-rw-r--r--mdk-stage1/dietlibc/lib/getopt.c63
-rw-r--r--mdk-stage1/dietlibc/lib/getpeername.c12
-rw-r--r--mdk-stage1/dietlibc/lib/getpgrp.c6
-rw-r--r--mdk-stage1/dietlibc/lib/getsockname.c12
-rw-r--r--mdk-stage1/dietlibc/lib/getsockopt.c12
-rw-r--r--mdk-stage1/dietlibc/lib/htonl.c13
-rw-r--r--mdk-stage1/dietlibc/lib/htons.c12
-rw-r--r--mdk-stage1/dietlibc/lib/if_indextoname.c28
-rw-r--r--mdk-stage1/dietlibc/lib/if_nameindex.c40
-rw-r--r--mdk-stage1/dietlibc/lib/if_nametoindex.c26
-rw-r--r--mdk-stage1/dietlibc/lib/ipv6constants.c4
-rw-r--r--mdk-stage1/dietlibc/lib/isalnum.c9
-rw-r--r--mdk-stage1/dietlibc/lib/isalpha.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isascii.c6
-rw-r--r--mdk-stage1/dietlibc/lib/isatty.c20
-rw-r--r--mdk-stage1/dietlibc/lib/isblank.c6
-rw-r--r--mdk-stage1/dietlibc/lib/iscntrl.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isdigit.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isgraph.c6
-rw-r--r--mdk-stage1/dietlibc/lib/islower.c8
-rw-r--r--mdk-stage1/dietlibc/lib/isprint.c7
-rw-r--r--mdk-stage1/dietlibc/lib/ispunct.c9
-rw-r--r--mdk-stage1/dietlibc/lib/isspace.c9
-rw-r--r--mdk-stage1/dietlibc/lib/isupper.c9
-rw-r--r--mdk-stage1/dietlibc/lib/isxdigit.c8
-rw-r--r--mdk-stage1/dietlibc/lib/labs.c6
-rw-r--r--mdk-stage1/dietlibc/lib/listen.c12
-rw-r--r--mdk-stage1/dietlibc/lib/llabs.c6
-rw-r--r--mdk-stage1/dietlibc/lib/lockf.c38
-rw-r--r--mdk-stage1/dietlibc/lib/longjmp.c16
-rw-r--r--mdk-stage1/dietlibc/lib/lseek64.c16
-rw-r--r--mdk-stage1/dietlibc/lib/memccpy.c20
-rw-r--r--mdk-stage1/dietlibc/lib/memchr.c13
-rw-r--r--mdk-stage1/dietlibc/lib/memcmp.c18
-rw-r--r--mdk-stage1/dietlibc/lib/memcpy.c14
-rw-r--r--mdk-stage1/dietlibc/lib/memmem.c14
-rw-r--r--mdk-stage1/dietlibc/lib/memmove.c24
-rw-r--r--mdk-stage1/dietlibc/lib/memrchr.c15
-rw-r--r--mdk-stage1/dietlibc/lib/memset.c11
-rw-r--r--mdk-stage1/dietlibc/lib/mkfifo.c6
-rw-r--r--mdk-stage1/dietlibc/lib/msgctl.c9
-rw-r--r--mdk-stage1/dietlibc/lib/msgget.c9
-rw-r--r--mdk-stage1/dietlibc/lib/msgrcv.c17
-rw-r--r--mdk-stage1/dietlibc/lib/msgsnd.c9
-rw-r--r--mdk-stage1/dietlibc/lib/open64.c13
-rw-r--r--mdk-stage1/dietlibc/lib/opendir.c26
-rw-r--r--mdk-stage1/dietlibc/lib/perror.c24
-rw-r--r--mdk-stage1/dietlibc/lib/pread.c11
-rw-r--r--mdk-stage1/dietlibc/lib/pread64.c14
-rw-r--r--mdk-stage1/dietlibc/lib/putenv.c40
-rw-r--r--mdk-stage1/dietlibc/lib/pwrite.c11
-rw-r--r--mdk-stage1/dietlibc/lib/pwrite64.c14
-rw-r--r--mdk-stage1/dietlibc/lib/qsort.c127
-rw-r--r--mdk-stage1/dietlibc/lib/raise.c7
-rw-r--r--mdk-stage1/dietlibc/lib/rand.c12
-rw-r--r--mdk-stage1/dietlibc/lib/rand48.c89
-rw-r--r--mdk-stage1/dietlibc/lib/rand_r.c30
-rw-r--r--mdk-stage1/dietlibc/lib/readdir.c13
-rw-r--r--mdk-stage1/dietlibc/lib/readdir64.c62
-rw-r--r--mdk-stage1/dietlibc/lib/reboot.c8
-rw-r--r--mdk-stage1/dietlibc/lib/recv.c13
-rw-r--r--mdk-stage1/dietlibc/lib/recvfrom.c13
-rw-r--r--mdk-stage1/dietlibc/lib/recvmsg.c13
-rw-r--r--mdk-stage1/dietlibc/lib/remove.c13
-rw-r--r--mdk-stage1/dietlibc/lib/rewind.c6
-rw-r--r--mdk-stage1/dietlibc/lib/rewinddir.c8
-rw-r--r--mdk-stage1/dietlibc/lib/sbrk.c21
-rw-r--r--mdk-stage1/dietlibc/lib/seekdir.c8
-rw-r--r--mdk-stage1/dietlibc/lib/semctl.c17
-rw-r--r--mdk-stage1/dietlibc/lib/semget.c9
-rw-r--r--mdk-stage1/dietlibc/lib/semop.c9
-rw-r--r--mdk-stage1/dietlibc/lib/send.c13
-rw-r--r--mdk-stage1/dietlibc/lib/sendmsg.c13
-rw-r--r--mdk-stage1/dietlibc/lib/sendto.c13
-rw-r--r--mdk-stage1/dietlibc/lib/setlinebuf.c12
-rw-r--r--mdk-stage1/dietlibc/lib/setpgrp.c6
-rw-r--r--mdk-stage1/dietlibc/lib/setsockopt.c12
-rw-r--r--mdk-stage1/dietlibc/lib/shmat.c14
-rw-r--r--mdk-stage1/dietlibc/lib/shmctl.c9
-rw-r--r--mdk-stage1/dietlibc/lib/shmdt.c9
-rw-r--r--mdk-stage1/dietlibc/lib/shmget.c9
-rw-r--r--mdk-stage1/dietlibc/lib/shutdown.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sigaction.c11
-rw-r--r--mdk-stage1/dietlibc/lib/sigaddset.c17
-rw-r--r--mdk-stage1/dietlibc/lib/sigdelset.c17
-rw-r--r--mdk-stage1/dietlibc/lib/sigemptyset.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sigfillset.c11
-rw-r--r--mdk-stage1/dietlibc/lib/siginterrupt.c17
-rw-r--r--mdk-stage1/dietlibc/lib/sigismember.c16
-rw-r--r--mdk-stage1/dietlibc/lib/sigjmp.c10
-rw-r--r--mdk-stage1/dietlibc/lib/signal.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sigpending.c7
-rw-r--r--mdk-stage1/dietlibc/lib/sigprocmask.c7
-rw-r--r--mdk-stage1/dietlibc/lib/sigqueueinfo.c7
-rw-r--r--mdk-stage1/dietlibc/lib/sigsuspend.c10
-rw-r--r--mdk-stage1/dietlibc/lib/sigtimedwait.c7
-rw-r--r--mdk-stage1/dietlibc/lib/sleep.c11
-rw-r--r--mdk-stage1/dietlibc/lib/snprintf.c13
-rw-r--r--mdk-stage1/dietlibc/lib/socket.c11
-rw-r--r--mdk-stage1/dietlibc/lib/socketpair.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sprintf.c14
-rw-r--r--mdk-stage1/dietlibc/lib/sscanf.c12
-rw-r--r--mdk-stage1/dietlibc/lib/strcasecmp.c18
-rw-r--r--mdk-stage1/dietlibc/lib/strcat.c18
-rw-r--r--mdk-stage1/dietlibc/lib/strchr.c19
-rw-r--r--mdk-stage1/dietlibc/lib/strcmp.c18
-rw-r--r--mdk-stage1/dietlibc/lib/strcpy.c18
-rw-r--r--mdk-stage1/dietlibc/lib/strcspn.c17
-rw-r--r--mdk-stage1/dietlibc/lib/strdup.c9
-rw-r--r--mdk-stage1/dietlibc/lib/strerror.c20
-rw-r--r--mdk-stage1/dietlibc/lib/strlcat.c72
-rw-r--r--mdk-stage1/dietlibc/lib/strlcpy.3169
-rw-r--r--mdk-stage1/dietlibc/lib/strlcpy.c68
-rw-r--r--mdk-stage1/dietlibc/lib/strlen.c47
-rw-r--r--mdk-stage1/dietlibc/lib/strncasecmp.c22
-rw-r--r--mdk-stage1/dietlibc/lib/strncat.c34
-rw-r--r--mdk-stage1/dietlibc/lib/strncmp.c17
-rw-r--r--mdk-stage1/dietlibc/lib/strncpy.c15
-rw-r--r--mdk-stage1/dietlibc/lib/strpbrk.c11
-rw-r--r--mdk-stage1/dietlibc/lib/strrchr.c20
-rw-r--r--mdk-stage1/dietlibc/lib/strsep.c18
-rw-r--r--mdk-stage1/dietlibc/lib/strspn.c17
-rw-r--r--mdk-stage1/dietlibc/lib/strstr.c17
-rw-r--r--mdk-stage1/dietlibc/lib/strtod.c66
-rw-r--r--mdk-stage1/dietlibc/lib/strtof.c66
-rw-r--r--mdk-stage1/dietlibc/lib/strtok.c8
-rw-r--r--mdk-stage1/dietlibc/lib/strtok_r.c21
-rw-r--r--mdk-stage1/dietlibc/lib/strtol.c26
-rw-r--r--mdk-stage1/dietlibc/lib/strtold.c66
-rw-r--r--mdk-stage1/dietlibc/lib/strtoll.c14
-rw-r--r--mdk-stage1/dietlibc/lib/strtoul.c44
-rw-r--r--mdk-stage1/dietlibc/lib/strtoull.c31
-rw-r--r--mdk-stage1/dietlibc/lib/strxfrm.c12
-rw-r--r--mdk-stage1/dietlibc/lib/sys_siglist.c174
-rw-r--r--mdk-stage1/dietlibc/lib/tcdrain.c9
-rw-r--r--mdk-stage1/dietlibc/lib/tcflow.c35
-rw-r--r--mdk-stage1/dietlibc/lib/tcflush.c9
-rw-r--r--mdk-stage1/dietlibc/lib/tcgetattr.c7
-rw-r--r--mdk-stage1/dietlibc/lib/tcgetpgrp.c12
-rw-r--r--mdk-stage1/dietlibc/lib/tcsendbreak.c11
-rw-r--r--mdk-stage1/dietlibc/lib/tcsetattr.c37
-rw-r--r--mdk-stage1/dietlibc/lib/tcsetpgrp.c8
-rw-r--r--mdk-stage1/dietlibc/lib/telldir.c7
-rw-r--r--mdk-stage1/dietlibc/lib/tolower.c8
-rw-r--r--mdk-stage1/dietlibc/lib/toupper.c8
-rw-r--r--mdk-stage1/dietlibc/lib/ttyname.c66
-rw-r--r--mdk-stage1/dietlibc/lib/usleep.c12
-rw-r--r--mdk-stage1/dietlibc/lib/vfork.c4
-rw-r--r--mdk-stage1/dietlibc/lib/vsnprintf.c33
-rw-r--r--mdk-stage1/dietlibc/lib/vsprintf.c12
-rw-r--r--mdk-stage1/dietlibc/lib/vsscanf.c25
-rw-r--r--mdk-stage1/dietlibc/lib/wait.c6
-rw-r--r--mdk-stage1/dietlibc/lib/wait3.c5
-rw-r--r--mdk-stage1/dietlibc/lib/write12.c11
-rw-r--r--mdk-stage1/dietlibc/libcompat/daemon.c29
-rw-r--r--mdk-stage1/dietlibc/libcompat/getdelim.c32
-rw-r--r--mdk-stage1/dietlibc/libcompat/getline.c9
-rw-r--r--mdk-stage1/dietlibc/libcompat/re_bsd.c34
-rw-r--r--mdk-stage1/dietlibc/libcompat/stpcpy.c6
-rw-r--r--mdk-stage1/dietlibc/libcompat/syscall.S70
-rw-r--r--mdk-stage1/dietlibc/libcruft/___div.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/__end_parse.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/__parse.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/__parse_1.c9
-rw-r--r--mdk-stage1/dietlibc/libcruft/__parse_nws.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/__parse_ws.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/__prepare_parse.c19
-rw-r--r--mdk-stage1/dietlibc/libcruft/alphasort.c6
-rw-r--r--mdk-stage1/dietlibc/libcruft/alphasort64.c6
-rw-r--r--mdk-stage1/dietlibc/libcruft/bcopy.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/bzero.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/clock.c21
-rw-r--r--mdk-stage1/dietlibc/libcruft/dn_expand.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft.c181
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft2.c173
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft3.c3
-rw-r--r--mdk-stage1/dietlibc/libcruft/dnscruft4.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/getdtablesize.c6
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrent.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrent_r.c78
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrgid.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrgid_r.c14
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrnam.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/getgrnam_r.c14
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyaddr.c35
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyaddr2_r.c2
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyaddr_r.c84
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname.c34
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname2.c36
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname2_r.c55
-rw-r--r--mdk-stage1/dietlibc/libcruft/gethostbyname_r.c68
-rw-r--r--mdk-stage1/dietlibc/libcruft/getlogin.c6
-rw-r--r--mdk-stage1/dietlibc/libcruft/getopt_data.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/getopt_long.c103
-rw-r--r--mdk-stage1/dietlibc/libcruft/getopt_long_only.c108
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpagesize.c15
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpass.c52
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwent.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwent_r.c65
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwnam.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwnam_r.c14
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwuid.c12
-rw-r--r--mdk-stage1/dietlibc/libcruft/getpwuid_r.c13
-rw-r--r--mdk-stage1/dietlibc/libcruft/getspent.c10
-rw-r--r--mdk-stage1/dietlibc/libcruft/getspent_r.c68
-rw-r--r--mdk-stage1/dietlibc/libcruft/getspnam.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/getspnam_r.c14
-rw-r--r--mdk-stage1/dietlibc/libcruft/getusershell.c33
-rw-r--r--mdk-stage1/dietlibc/libcruft/grbuf.c5
-rw-r--r--mdk-stage1/dietlibc/libcruft/h_errno.c1
-rw-r--r--mdk-stage1/dietlibc/libcruft/herrno_location.c8
-rw-r--r--mdk-stage1/dietlibc/libcruft/herror.c8
-rw-r--r--mdk-stage1/dietlibc/libcruft/hstrerror.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_addr.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_aton.c43
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_ntoa.c8
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_ntoa_r.c22
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_ntop.c77
-rw-r--r--mdk-stage1/dietlibc/libcruft/inet_pton.c102
-rw-r--r--mdk-stage1/dietlibc/libcruft/initgroups.c24
-rw-r--r--mdk-stage1/dietlibc/libcruft/killpg.c5
-rw-r--r--mdk-stage1/dietlibc/libcruft/localeconv.c15
-rw-r--r--mdk-stage1/dietlibc/libcruft/mkdtemp.c28
-rw-r--r--mdk-stage1/dietlibc/libcruft/mkstemp.c31
-rw-r--r--mdk-stage1/dietlibc/libcruft/mktemp.c17
-rw-r--r--mdk-stage1/dietlibc/libcruft/pwbuf.c5
-rw-r--r--mdk-stage1/dietlibc/libcruft/res_init.c9
-rw-r--r--mdk-stage1/dietlibc/libcruft/res_mkquery.c75
-rw-r--r--mdk-stage1/dietlibc/libcruft/res_query.c95
-rw-r--r--mdk-stage1/dietlibc/libcruft/res_search.c35
-rw-r--r--mdk-stage1/dietlibc/libcruft/scan_ulong.c13
-rw-r--r--mdk-stage1/dietlibc/libcruft/scandir.c47
-rw-r--r--mdk-stage1/dietlibc/libcruft/scandir64.c47
-rw-r--r--mdk-stage1/dietlibc/libcruft/setegid.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/seteuid.c11
-rw-r--r--mdk-stage1/dietlibc/libcruft/setlocale.c7
-rw-r--r--mdk-stage1/dietlibc/libcruft/spbuf.c5
-rw-r--r--mdk-stage1/dietlibc/libcruft/sysconf.c43
-rw-r--r--mdk-stage1/dietlibc/libcruft/sysconf_cpus.c64
-rw-r--r--mdk-stage1/dietlibc/libcruft/tempnam.c32
-rw-r--r--mdk-stage1/dietlibc/libcruft/tmpnam.c31
-rw-r--r--mdk-stage1/dietlibc/libcrypt/crypt.c314
-rw-r--r--mdk-stage1/dietlibc/libcrypt/md5.c243
-rw-r--r--mdk-stage1/dietlibc/libcrypt/md5crypt.c157
-rw-r--r--mdk-stage1/dietlibc/libdl/Makefile38
-rw-r--r--mdk-stage1/dietlibc/libdl/README82
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_alloc.c81
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_int.h151
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_jump.S55
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_load.c401
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_main.c1059
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_open.c35
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_queue.c39
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_rel.c42
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_rel.h25
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_relocate.c96
-rw-r--r--mdk-stage1/dietlibc/libdl/_dl_search.c111
-rw-r--r--mdk-stage1/dietlibc/libdl/dlclose.c38
-rw-r--r--mdk-stage1/dietlibc/libdl/dlerror.c55
-rw-r--r--mdk-stage1/dietlibc/libdl/dlopen.c26
-rw-r--r--mdk-stage1/dietlibc/libdl/dlsym.c92
-rw-r--r--mdk-stage1/dietlibc/libdl/elf_hash.h10
-rw-r--r--mdk-stage1/dietlibc/libdl/test/test.c20
-rw-r--r--mdk-stage1/dietlibc/libdl/test/test_so.c11
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-iscntrl.c6
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isgraph.c7
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-islower.c6
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isprint.c6
-rw-r--r--mdk-stage1/dietlibc/liblatin1/latin1-isupper.c6
-rw-r--r--mdk-stage1/dietlibc/libm/acosh.c6
-rw-r--r--mdk-stage1/dietlibc/libm/asinh.c6
-rw-r--r--mdk-stage1/dietlibc/libm/atanh.c8
-rw-r--r--mdk-stage1/dietlibc/libm/bessel.c171
-rw-r--r--mdk-stage1/dietlibc/libm/cosh.c9
-rw-r--r--mdk-stage1/dietlibc/libm/erf.c95
-rw-r--r--mdk-stage1/dietlibc/libm/gamma.c98
-rw-r--r--mdk-stage1/dietlibc/libm/ipow.c29
-rw-r--r--mdk-stage1/dietlibc/libm/poly.c41
-rw-r--r--mdk-stage1/dietlibc/libm/pow.c42
-rw-r--r--mdk-stage1/dietlibc/libm/rint.c5
-rw-r--r--mdk-stage1/dietlibc/libm/sinh.c9
-rw-r--r--mdk-stage1/dietlibc/libm/tanh.c7
-rw-r--r--mdk-stage1/dietlibc/libpthread/CHANGES51
-rw-r--r--mdk-stage1/dietlibc/libpthread/Makefile140
-rw-r--r--mdk-stage1/dietlibc/libpthread/README36
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_atfork.c77
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getdetachstate.c14
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getinheritsched.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getschedparam.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getschedpolicy.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getscope.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getstackaddr.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_getstacksize.c14
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_init.c18
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setdetachstate.c17
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setinheritsched.c17
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setschedparam.c22
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c24
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setscope.c17
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setstackaddr.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_attr_setstacksize.c16
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cancel.c33
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cleanup_pop.c27
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cleanup_push.c23
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_broadcast.c26
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_destroy.c19
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_init.c15
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c26
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_timedwait.c74
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_cond_wait.c59
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_condattr.c15
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_create.c81
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_detach.c29
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_equal.c3
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_errno.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_exit.c17
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_fdglue2.c16
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_fgetc.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_flockfile.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_fputc.c9
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_funlockfile.c5
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_getschedparam.c22
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_getspecific.c20
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_internal.c359
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_join.c39
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_key.c48
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_key_create.c36
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_key_delete.c20
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_destroy.c15
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_init.c18
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_lock.c32
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_trylock.c33
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutex_unlock.c31
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutexattr_getkind_np.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutexattr_init.c15
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_mutexattr_setkind_np.c17
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_once.c9
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_self.c4
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setcancelstate.c24
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c24
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c21
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_setspecific.c20
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sigmask.c8
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_spinlock.c34
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_alloc.c36
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_close.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_create.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_fcntl.c11
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_fdatasync.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_fsync.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_logging.c33
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_nanosleep.c11
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_open.c13
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_pause.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_read.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_sigsuspend.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_tcdrain.c12
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_waitpid.c12
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_sys_write.c10
-rw-r--r--mdk-stage1/dietlibc/libpthread/pthread_testcancel.c16
-rw-r--r--mdk-stage1/dietlibc/libpthread/test.c72
-rw-r--r--mdk-stage1/dietlibc/libpthread/thread_internal.h134
-rw-r--r--mdk-stage1/dietlibc/libregex/rx.c494
-rw-r--r--mdk-stage1/dietlibc/librpc/auth_none.c126
-rw-r--r--mdk-stage1/dietlibc/librpc/auth_unix.c314
-rw-r--r--mdk-stage1/dietlibc/librpc/authunix_prot.c69
-rw-r--r--mdk-stage1/dietlibc/librpc/bindresvport.c79
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_generic.c112
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_perror.c302
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_raw.c229
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_simple.c116
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_tcp.c464
-rw-r--r--mdk-stage1/dietlibc/librpc/clnt_udp.c438
-rw-r--r--mdk-stage1/dietlibc/librpc/get_myaddress.c69
-rw-r--r--mdk-stage1/dietlibc/librpc/getrpcent.c273
-rw-r--r--mdk-stage1/dietlibc/librpc/getrpcport.c57
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_clnt.c115
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_getmaps.c84
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_getport.c94
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_prot.c58
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_prot2.c116
-rw-r--r--mdk-stage1/dietlibc/librpc/pmap_rmt.c402
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_callmsg.c189
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_commondata.c42
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_dtablesize.c50
-rw-r--r--mdk-stage1/dietlibc/librpc/rpc_prot.c281
-rw-r--r--mdk-stage1/dietlibc/librpc/svc.c478
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_auth.c115
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_auth_unix.c136
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_raw.c161
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_run.c71
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_simple.c144
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_tcp.c410
-rw-r--r--mdk-stage1/dietlibc/librpc/svc_udp.c467
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr.c576
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_array.c162
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_float.c284
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_mem.c166
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_rec.c572
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_reference.c130
-rw-r--r--mdk-stage1/dietlibc/librpc/xdr_stdio.c187
-rw-r--r--mdk-stage1/dietlibc/libshell/basename.c27
-rw-r--r--mdk-stage1/dietlibc/libshell/dirname.c25
-rw-r--r--mdk-stage1/dietlibc/libshell/fnmatch.c78
-rw-r--r--mdk-stage1/dietlibc/libshell/glob.c356
-rw-r--r--mdk-stage1/dietlibc/libshell/realpath.c31
-rw-r--r--mdk-stage1/dietlibc/libstdio/clearerr.c5
-rw-r--r--mdk-stage1/dietlibc/libstdio/fclose.c22
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdglue.c22
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdglue2.c43
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdopen.c13
-rw-r--r--mdk-stage1/dietlibc/libstdio/fdprintf.c13
-rw-r--r--mdk-stage1/dietlibc/libstdio/feof.c7
-rw-r--r--mdk-stage1/dietlibc/libstdio/ferror.c5
-rw-r--r--mdk-stage1/dietlibc/libstdio/fflush.c64
-rw-r--r--mdk-stage1/dietlibc/libstdio/fgetc_unlocked.c30
-rw-r--r--mdk-stage1/dietlibc/libstdio/fgetpos.c8
-rw-r--r--mdk-stage1/dietlibc/libstdio/fgets.c18
-rw-r--r--mdk-stage1/dietlibc/libstdio/fileno.c5
-rw-r--r--mdk-stage1/dietlibc/libstdio/fopen.c15
-rw-r--r--mdk-stage1/dietlibc/libstdio/fprintf.c13
-rw-r--r--mdk-stage1/dietlibc/libstdio/fputc_unlocked.c20
-rw-r--r--mdk-stage1/dietlibc/libstdio/fputs.c6
-rw-r--r--mdk-stage1/dietlibc/libstdio/fread.c46
-rw-r--r--mdk-stage1/dietlibc/libstdio/freopen.c9
-rw-r--r--mdk-stage1/dietlibc/libstdio/fscanf.c14
-rw-r--r--mdk-stage1/dietlibc/libstdio/fseek.c10
-rw-r--r--mdk-stage1/dietlibc/libstdio/fseeko.c10
-rw-r--r--mdk-stage1/dietlibc/libstdio/fseeko64.c12
-rw-r--r--mdk-stage1/dietlibc/libstdio/fsetpos.c7
-rw-r--r--mdk-stage1/dietlibc/libstdio/ftell.c7
-rw-r--r--mdk-stage1/dietlibc/libstdio/ftello.c7
-rw-r--r--mdk-stage1/dietlibc/libstdio/ftello64.c9
-rw-r--r--mdk-stage1/dietlibc/libstdio/fwrite.c28
-rw-r--r--mdk-stage1/dietlibc/libstdio/printf.c15
-rw-r--r--mdk-stage1/dietlibc/libstdio/putchar.c6
-rw-r--r--mdk-stage1/dietlibc/libstdio/puts.c16
-rw-r--r--mdk-stage1/dietlibc/libstdio/scanf.c14
-rw-r--r--mdk-stage1/dietlibc/libstdio/setvbuf.c34
-rw-r--r--mdk-stage1/dietlibc/libstdio/stderr.c22
-rw-r--r--mdk-stage1/dietlibc/libstdio/stdin.c23
-rw-r--r--mdk-stage1/dietlibc/libstdio/stdout.c23
-rw-r--r--mdk-stage1/dietlibc/libstdio/tmpfile.c12
-rw-r--r--mdk-stage1/dietlibc/libstdio/ungetc.c10
-rw-r--r--mdk-stage1/dietlibc/libstdio/vfdprintf.c15
-rw-r--r--mdk-stage1/dietlibc/libstdio/vfprintf.c15
-rw-r--r--mdk-stage1/dietlibc/libstdio/vfscanf.c11
-rw-r--r--mdk-stage1/dietlibc/libstdio/vprintf.c15
-rw-r--r--mdk-stage1/dietlibc/libstdio/vscanf.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/asctime.c7
-rw-r--r--mdk-stage1/dietlibc/libugly/asctime_r.c29
-rw-r--r--mdk-stage1/dietlibc/libugly/asprintf.c19
-rw-r--r--mdk-stage1/dietlibc/libugly/ctime.c5
-rw-r--r--mdk-stage1/dietlibc/libugly/difftime.c8
-rw-r--r--mdk-stage1/dietlibc/libugly/dirfd.c8
-rw-r--r--mdk-stage1/dietlibc/libugly/endmntent.c7
-rw-r--r--mdk-stage1/dietlibc/libugly/facilitynames.c32
-rw-r--r--mdk-stage1/dietlibc/libugly/freeaddrinfo.c11
-rw-r--r--mdk-stage1/dietlibc/libugly/ftime.c15
-rw-r--r--mdk-stage1/dietlibc/libugly/gai_strerror.c13
-rw-r--r--mdk-stage1/dietlibc/libugly/getaddrinfo.c140
-rw-r--r--mdk-stage1/dietlibc/libugly/gethostent.c116
-rw-r--r--mdk-stage1/dietlibc/libugly/getmntent.c31
-rw-r--r--mdk-stage1/dietlibc/libugly/getnameinfo.c46
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotobyname.c12
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotobyname_r.c17
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotobynumber.c12
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotobynumber_r.c13
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotoent.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/getprotoent_r.c78
-rw-r--r--mdk-stage1/dietlibc/libugly/getservbyname.c12
-rw-r--r--mdk-stage1/dietlibc/libugly/getservbyname_r.c18
-rw-r--r--mdk-stage1/dietlibc/libugly/getservbyport.c12
-rw-r--r--mdk-stage1/dietlibc/libugly/getservbyport_r.c13
-rw-r--r--mdk-stage1/dietlibc/libugly/getservent.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/getservent_r.c91
-rw-r--r--mdk-stage1/dietlibc/libugly/gmtime.c6
-rw-r--r--mdk-stage1/dietlibc/libugly/gmtime_r.c35
-rw-r--r--mdk-stage1/dietlibc/libugly/grantpt.c13
-rw-r--r--mdk-stage1/dietlibc/libugly/hasmntopt.c18
-rw-r--r--mdk-stage1/dietlibc/libugly/iconv.c71
-rw-r--r--mdk-stage1/dietlibc/libugly/iconv_close.c7
-rw-r--r--mdk-stage1/dietlibc/libugly/iconv_open.c28
-rw-r--r--mdk-stage1/dietlibc/libugly/isleap.c8
-rw-r--r--mdk-stage1/dietlibc/libugly/localtime.c6
-rw-r--r--mdk-stage1/dietlibc/libugly/localtime_r.c25
-rw-r--r--mdk-stage1/dietlibc/libugly/logging.c197
-rw-r--r--mdk-stage1/dietlibc/libugly/mktime.c53
-rw-r--r--mdk-stage1/dietlibc/libugly/netent.c130
-rw-r--r--mdk-stage1/dietlibc/libugly/openpty.c54
-rw-r--r--mdk-stage1/dietlibc/libugly/pclose.c11
-rw-r--r--mdk-stage1/dietlibc/libugly/popen.c38
-rw-r--r--mdk-stage1/dietlibc/libugly/prioritynames.c22
-rw-r--r--mdk-stage1/dietlibc/libugly/protoent_buf.c5
-rw-r--r--mdk-stage1/dietlibc/libugly/ptsname.c17
-rw-r--r--mdk-stage1/dietlibc/libugly/putpwent.c19
-rw-r--r--mdk-stage1/dietlibc/libugly/servent_buf.c5
-rw-r--r--mdk-stage1/dietlibc/libugly/setenv.c19
-rw-r--r--mdk-stage1/dietlibc/libugly/setmntent.c7
-rw-r--r--mdk-stage1/dietlibc/libugly/strftime.c118
-rw-r--r--mdk-stage1/dietlibc/libugly/strndup.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/strsignal.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/system.c75
-rw-r--r--mdk-stage1/dietlibc/libugly/time_table_spd.c18
-rw-r--r--mdk-stage1/dietlibc/libugly/timezone.c3
-rw-r--r--mdk-stage1/dietlibc/libugly/tzfile.c107
-rw-r--r--mdk-stage1/dietlibc/libugly/unlockpt.c10
-rw-r--r--mdk-stage1/dietlibc/libugly/unsetenv.c6
-rw-r--r--mdk-stage1/dietlibc/libugly/utent.c103
-rw-r--r--mdk-stage1/dietlibc/libugly/wtent.c30
-rw-r--r--mdk-stage1/dietlibc/linuxnet.h19
-rw-r--r--mdk-stage1/dietlibc/parselib.h23
-rw-r--r--mdk-stage1/dietlibc/ppc/Makefile.add3
-rw-r--r--mdk-stage1/dietlibc/ppc/__longjmp.S59
-rw-r--r--mdk-stage1/dietlibc/ppc/__testandset.S12
-rw-r--r--mdk-stage1/dietlibc/ppc/clone.S48
-rw-r--r--mdk-stage1/dietlibc/ppc/mmap.c40
-rw-r--r--mdk-stage1/dietlibc/ppc/setjmp.S56
-rw-r--r--mdk-stage1/dietlibc/ppc/start.S42
-rw-r--r--mdk-stage1/dietlibc/ppc/syscalls.h259
-rw-r--r--mdk-stage1/dietlibc/ppc/unified.S40
-rw-r--r--mdk-stage1/dietlibc/profiling/PORTING25
-rw-r--r--mdk-stage1/dietlibc/profiling/README37
-rw-r--r--mdk-stage1/dietlibc/profiling/__mcount.c24
-rw-r--r--mdk-stage1/dietlibc/profiling/monitor.c93
-rw-r--r--mdk-stage1/dietlibc/profiling/profil.c75
-rw-r--r--mdk-stage1/dietlibc/sparc/Makefile.add4
-rw-r--r--mdk-stage1/dietlibc/sparc/__longjmp.S68
-rw-r--r--mdk-stage1/dietlibc/sparc/__testandset.S6
-rw-r--r--mdk-stage1/dietlibc/sparc/clone.S46
-rw-r--r--mdk-stage1/dietlibc/sparc/errlist.S280
-rw-r--r--mdk-stage1/dietlibc/sparc/fork.S25
-rw-r--r--mdk-stage1/dietlibc/sparc/mmap.c43
-rw-r--r--mdk-stage1/dietlibc/sparc/pipe.S26
-rw-r--r--mdk-stage1/dietlibc/sparc/setjmp.S39
-rw-r--r--mdk-stage1/dietlibc/sparc/shmat.c19
-rw-r--r--mdk-stage1/dietlibc/sparc/sigaction.c7
-rw-r--r--mdk-stage1/dietlibc/sparc/start.S50
-rw-r--r--mdk-stage1/dietlibc/sparc/strlen.S11
-rw-r--r--mdk-stage1/dietlibc/sparc/syscalls.h276
-rw-r--r--mdk-stage1/dietlibc/sparc/udiv.S361
-rw-r--r--mdk-stage1/dietlibc/sparc/umul.S168
-rw-r--r--mdk-stage1/dietlibc/sparc/unified.S36
-rw-r--r--mdk-stage1/dietlibc/sparc/urem.S360
-rw-r--r--mdk-stage1/dietlibc/syscalls.h35
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/__getpagesize.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/__pread.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/__pwrite.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/__reboot.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/_llseek.S7
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/access.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/adjtimex.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/alarm.S4
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/bdflush.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/brk.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/chdir.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/chmod.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/chown.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/chown32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/chroot.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/close.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/create_module.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/delete_module.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/dup.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/dup2.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/environ.S16
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/epoll_create.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/epoll_ctl.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/epoll_wait.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/errlist.S293
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/errno.S8
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/execve.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fchdir.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fchmod.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fchown.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fchown32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fcntl.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fdatasync.S6
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/flock.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fork.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fstat.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fstat64.S10
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fstatfs.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/fsync.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ftruncate.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ftruncate64.S10
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getcwd.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getdents.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getdents64.S6
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getegid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getegid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/geteuid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/geteuid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getgid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getgid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getgroups.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getgroups32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getitimer.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getpgid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getpid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getppid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getpriority.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getresgid.S7
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getresgid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getresuid.S7
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getrlimit.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getrusage.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getsid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/gettimeofday.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getuid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/getuid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/init_module.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ioctl.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ioperm.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/iopl.S6
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ipc.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/kill.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lchown.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lchown32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/link.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lseek.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lstat.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/lstat64.S10
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/madvise.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mkdir.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mknod.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mlock.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mlockall.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mmap2.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mount.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mprotect.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/mremap.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/msync.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/munlock.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/munlockall.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/munmap.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/n_sigaction.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/n_sigpending.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/n_sigprocmask.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/n_sigsuspend.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/nanosleep.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/nice.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/open.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/pause.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/personality.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/pipe.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/pivot_root.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/poll.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/prctl.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ptrace.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/query_module.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/read.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/readlink.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/readv.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rename.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rmdir.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigaction.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigpending.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigprocmask.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigqueueinfo.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigsuspend.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/rt_sigtimedwait.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_get_priority_max.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_get_priority_min.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_getparam.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_getscheduler.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_rr_get_interval.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_setparam.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_setscheduler.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sched_yield.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/select.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sendfile.S6
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sendfile64.S8
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setdomainname.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setfsgid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setfsgid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setfsuid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setfsuid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setgid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setgid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setgroups.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sethostname.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setitimer.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setpgid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setpriority.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setregid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setregid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setresgid.S7
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setresgid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setresuid.S7
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setreuid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setreuid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setrlimit.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setsid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/settimeofday.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setuid.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/setuid32.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sigaltstack.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/socketcall.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/stat.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/stat64.S10
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/statfs.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/stime.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/swapoff.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/swapon.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/symlink.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sync.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sysctl.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/sysinfo.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/syslog.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/time.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/times.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/truncate.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/truncate64.S10
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/umask.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/umount.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/umount2.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/uname.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/unlink.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/utime.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/vhangup.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/wait4.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/waitpid.S5
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/write.S3
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/writev.S3
-rwxr-xr-xmdk-stage1/dietlibc/threadsafe.sh5
-rw-r--r--mdk-stage1/dietlibc/x86_64/Makefile.add2
-rw-r--r--mdk-stage1/dietlibc/x86_64/__longjmp.S26
-rw-r--r--mdk-stage1/dietlibc/x86_64/__testandset.S12
-rw-r--r--mdk-stage1/dietlibc/x86_64/accept.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/bind.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/clone.S64
-rw-r--r--mdk-stage1/dietlibc/x86_64/connect.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/getpeername.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/getsockname.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/getsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/listen.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/mmap.S8
-rw-r--r--mdk-stage1/dietlibc/x86_64/msgctl.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/msgget.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/msgrcv.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/msgsnd.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/recv.c13
-rw-r--r--mdk-stage1/dietlibc/x86_64/recvfrom.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/recvmsg.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/semctl.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/semget.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/semop.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/send.c13
-rw-r--r--mdk-stage1/dietlibc/x86_64/sendmsg.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/sendto.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/setjmp.S37
-rw-r--r--mdk-stage1/dietlibc/x86_64/setsockopt.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/shmat.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/shmctl.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/shmdt.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/shmget.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/shutdown.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/sigaction.c26
-rw-r--r--mdk-stage1/dietlibc/x86_64/socket.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/socketpair.S3
-rw-r--r--mdk-stage1/dietlibc/x86_64/start.S55
-rw-r--r--mdk-stage1/dietlibc/x86_64/syscalls.h282
-rw-r--r--mdk-stage1/dietlibc/x86_64/umount.S9
-rw-r--r--mdk-stage1/dietlibc/x86_64/unified.S32
-rw-r--r--mdk-stage1/dietlibc/x86_64/waitpid.S12
-rw-r--r--mdk-stage1/disk.c462
-rw-r--r--mdk-stage1/disk.h28
-rw-r--r--mdk-stage1/dns.c227
-rw-r--r--mdk-stage1/dns.h30
-rw-r--r--mdk-stage1/doc/HACKING31
-rw-r--r--mdk-stage1/doc/README185
-rw-r--r--mdk-stage1/doc/TECH-INFOS101
-rw-r--r--mdk-stage1/doc/UPDATEMODULES74
-rw-r--r--mdk-stage1/doc/WHY-DIETLIBC50
-rw-r--r--mdk-stage1/doc/documented..frontend.h69
-rw-r--r--mdk-stage1/frontend-common.c45
-rw-r--r--mdk-stage1/frontend.h57
-rw-r--r--mdk-stage1/init-libc-headers.h45
-rw-r--r--mdk-stage1/init.c586
-rw-r--r--mdk-stage1/insmod-busybox/.cvsignore2
-rw-r--r--mdk-stage1/insmod-busybox/Config.h133
-rw-r--r--mdk-stage1/insmod-busybox/Makefile43
-rw-r--r--mdk-stage1/insmod-busybox/README8
-rw-r--r--mdk-stage1/insmod-busybox/busybox.h477
-rw-r--r--mdk-stage1/insmod-busybox/insmod-frontend.c24
-rw-r--r--mdk-stage1/insmod-busybox/insmod.c3758
-rw-r--r--mdk-stage1/insmod-busybox/loop.h5
-rw-r--r--mdk-stage1/insmod-busybox/messages.c90
-rw-r--r--mdk-stage1/insmod-busybox/utility.c1759
-rw-r--r--mdk-stage1/insmod-modutils/Makefile59
-rw-r--r--mdk-stage1/insmod-modutils/include/config.h108
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_alpha.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_arm.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_hppa.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_hppa64.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_i386.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_ia64.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_m68k.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_mips.h23
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_ppc.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_s390.h11
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_sparc.h9
-rw-r--r--mdk-stage1/insmod-modutils/include/elf_sparc64.h26
-rw-r--r--mdk-stage1/insmod-modutils/include/kallsyms.h129
-rw-r--r--mdk-stage1/insmod-modutils/include/kerneld.h44
-rw-r--r--mdk-stage1/insmod-modutils/include/modstat.h55
-rw-r--r--mdk-stage1/insmod-modutils/include/module.h217
-rw-r--r--mdk-stage1/insmod-modutils/include/obj.h298
-rw-r--r--mdk-stage1/insmod-modutils/include/util.h99
-rw-r--r--mdk-stage1/insmod-modutils/include/version.h1
-rw-r--r--mdk-stage1/insmod-modutils/insmod-frontend.c24
-rw-r--r--mdk-stage1/insmod-modutils/insmod.c2141
-rw-r--r--mdk-stage1/insmod-modutils/obj/Makefile38
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_alpha.c328
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_arm.c310
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_common.c416
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_hppa.c638
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_hppa64.c682
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_i386.c237
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_ia64.c1022
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_kallsyms.c290
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_load.c343
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_m68k.c145
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_mips.c254
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_ppc.c266
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_reloc.c413
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_s390.c332
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_sparc.c224
-rw-r--r--mdk-stage1/insmod-modutils/obj/obj_sparc64.c350
-rw-r--r--mdk-stage1/insmod-modutils/util/Makefile42
-rw-r--r--mdk-stage1/insmod-modutils/util/alias.h310
-rw-r--r--mdk-stage1/insmod-modutils/util/arch64.c43
-rw-r--r--mdk-stage1/insmod-modutils/util/config.c1614
-rw-r--r--mdk-stage1/insmod-modutils/util/gzfiles.c74
-rw-r--r--mdk-stage1/insmod-modutils/util/logger.c160
-rw-r--r--mdk-stage1/insmod-modutils/util/meta_expand.c339
-rw-r--r--mdk-stage1/insmod-modutils/util/modstat.c419
-rw-r--r--mdk-stage1/insmod-modutils/util/snap_shot.c154
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_cm.c86
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_dm.c35
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_gks.c35
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_nim.c51
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_oim.c38
-rw-r--r--mdk-stage1/insmod-modutils/util/sys_qm.c54
-rw-r--r--mdk-stage1/insmod-modutils/util/xftw.c422
-rw-r--r--mdk-stage1/insmod-modutils/util/xmalloc.c37
-rw-r--r--mdk-stage1/insmod-modutils/util/xrealloc.c37
-rw-r--r--mdk-stage1/insmod-modutils/util/xstrcat.c38
-rw-r--r--mdk-stage1/insmod-modutils/util/xstrdup.c39
-rw-r--r--mdk-stage1/insmod-modutils/util/xsystem.c49
-rw-r--r--mdk-stage1/insmod.h20
-rw-r--r--mdk-stage1/linux-2.2/nfs.h226
-rw-r--r--mdk-stage1/linux-2.2/nfs_mount.h53
-rw-r--r--mdk-stage1/log.c94
-rw-r--r--mdk-stage1/log.h34
-rw-r--r--mdk-stage1/lomount.c197
-rw-r--r--mdk-stage1/lomount.h21
-rw-r--r--mdk-stage1/mar/.cvsignore1
-rw-r--r--mdk-stage1/mar/Makefile52
-rw-r--r--mdk-stage1/mar/mar-extract-only.c214
-rw-r--r--mdk-stage1/mar/mar-extract-only.h32
-rw-r--r--mdk-stage1/mar/mar-frontend.c199
-rw-r--r--mdk-stage1/mar/mar.h70
-rw-r--r--mdk-stage1/minilibc.c317
-rw-r--r--mdk-stage1/minilibc.h159
-rw-r--r--mdk-stage1/mkinitrd_helper/Makefile46
-rw-r--r--mdk-stage1/mkinitrd_helper/mkinitrd_helper.c308
-rw-r--r--mdk-stage1/modules.c602
-rw-r--r--mdk-stage1/modules.h38
-rw-r--r--mdk-stage1/modules_descr.h66
-rw-r--r--mdk-stage1/mount.c223
-rw-r--r--mdk-stage1/mount.h32
-rw-r--r--mdk-stage1/mount_rpcgen.h208
-rw-r--r--mdk-stage1/network.c890
-rw-r--r--mdk-stage1/network.h61
-rw-r--r--mdk-stage1/newt-frontend.c398
-rw-r--r--mdk-stage1/newt/Makefile42
-rw-r--r--mdk-stage1/newt/button.c190
-rw-r--r--mdk-stage1/newt/buttonbar.c46
-rw-r--r--mdk-stage1/newt/checkbox.c290
-rw-r--r--mdk-stage1/newt/checkboxtree.c714
-rw-r--r--mdk-stage1/newt/entry.c376
-rw-r--r--mdk-stage1/newt/form.c713
-rw-r--r--mdk-stage1/newt/grid.c389
-rw-r--r--mdk-stage1/newt/label.c81
-rw-r--r--mdk-stage1/newt/listbox.c752
-rw-r--r--mdk-stage1/newt/newt.c672
-rw-r--r--mdk-stage1/newt/newt.h362
-rw-r--r--mdk-stage1/newt/newt_pr.h82
-rw-r--r--mdk-stage1/newt/scale.c72
-rw-r--r--mdk-stage1/newt/scrollbar.c124
-rw-r--r--mdk-stage1/newt/textbox.c409
-rw-r--r--mdk-stage1/newt/windows.c275
-rw-r--r--mdk-stage1/nfs_mount4.h54
-rw-r--r--mdk-stage1/nfsmount.c740
-rw-r--r--mdk-stage1/nfsmount.h331
-rw-r--r--mdk-stage1/pci-resource/.cvsignore1
-rw-r--r--mdk-stage1/pci-resource/Makefile25
-rwxr-xr-xmdk-stage1/pci-resource/update-pci-ids.pl72
-rw-r--r--mdk-stage1/pcmcia_/Makefile37
-rw-r--r--mdk-stage1/pcmcia_/bulkmem.h195
-rw-r--r--mdk-stage1/pcmcia_/cardmgr.c1652
-rw-r--r--mdk-stage1/pcmcia_/cardmgr.h112
-rw-r--r--mdk-stage1/pcmcia_/cirrus.h182
-rw-r--r--mdk-stage1/pcmcia_/cistpl.h604
-rw-r--r--mdk-stage1/pcmcia_/cs.h465
-rw-r--r--mdk-stage1/pcmcia_/cs_types.h65
-rw-r--r--mdk-stage1/pcmcia_/driver_ops.h82
-rw-r--r--mdk-stage1/pcmcia_/ds.h163
-rw-r--r--mdk-stage1/pcmcia_/i82365.h154
-rw-r--r--mdk-stage1/pcmcia_/lex_config.c2053
-rwxr-xr-xmdk-stage1/pcmcia_/merge_from_pcitable51
-rw-r--r--mdk-stage1/pcmcia_/pcmcia.h21
-rw-r--r--mdk-stage1/pcmcia_/probe.c522
-rw-r--r--mdk-stage1/pcmcia_/tcic.h266
-rw-r--r--mdk-stage1/pcmcia_/version.h4
-rw-r--r--mdk-stage1/pcmcia_/vg468.h112
-rw-r--r--mdk-stage1/pcmcia_/yacc_config.c1015
-rw-r--r--mdk-stage1/pcmcia_/yacc_config.h37
-rw-r--r--mdk-stage1/ppp/.cvsignore1
-rw-r--r--mdk-stage1/ppp/Changes-2.3441
-rw-r--r--mdk-stage1/ppp/FAQ634
-rw-r--r--mdk-stage1/ppp/PLUGINS131
-rw-r--r--mdk-stage1/ppp/README168
-rw-r--r--mdk-stage1/ppp/README.MSCHAP80284
-rw-r--r--mdk-stage1/ppp/README.cbcp97
-rw-r--r--mdk-stage1/ppp/README.linux297
-rw-r--r--mdk-stage1/ppp/README.sol2220
-rw-r--r--mdk-stage1/ppp/README.sunos462
-rw-r--r--mdk-stage1/ppp/SETUP111
-rw-r--r--mdk-stage1/ppp/chat/Makefile.linux27
-rw-r--r--mdk-stage1/ppp/chat/Makefile.linux.makeopt27
-rw-r--r--mdk-stage1/ppp/chat/Makefile.sol219
-rw-r--r--mdk-stage1/ppp/chat/Makefile.sunos419
-rw-r--r--mdk-stage1/ppp/chat/chat.8515
-rw-r--r--mdk-stage1/ppp/chat/chat.c1756
-rw-r--r--mdk-stage1/ppp/common/zlib.c5376
-rw-r--r--mdk-stage1/ppp/common/zlib.h1010
-rwxr-xr-xmdk-stage1/ppp/configure141
-rw-r--r--mdk-stage1/ppp/contrib/pppgetpass/Makefile.linux16
-rw-r--r--mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.818
-rw-r--r--mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.gtk.c92
-rw-r--r--mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.sh7
-rw-r--r--mdk-stage1/ppp/contrib/pppgetpass/pppgetpass.vt.c218
-rw-r--r--mdk-stage1/ppp/etc.ppp/chap-secrets2
-rw-r--r--mdk-stage1/ppp/etc.ppp/options5
-rw-r--r--mdk-stage1/ppp/etc.ppp/options.options1
-rw-r--r--mdk-stage1/ppp/etc.ppp/pap-secrets2
-rw-r--r--mdk-stage1/ppp/include/linux/if_ppp.h155
-rw-r--r--mdk-stage1/ppp/include/linux/if_pppvar.h138
-rw-r--r--mdk-stage1/ppp/include/linux/ppp-comp.h203
-rw-r--r--mdk-stage1/ppp/include/linux/ppp_defs.h185
-rw-r--r--mdk-stage1/ppp/include/net/if_ppp.h133
-rw-r--r--mdk-stage1/ppp/include/net/ppp-comp.h165
-rw-r--r--mdk-stage1/ppp/include/net/ppp_defs.h184
-rw-r--r--mdk-stage1/ppp/include/net/pppio.h99
-rw-r--r--mdk-stage1/ppp/include/net/slcompress.h148
-rw-r--r--mdk-stage1/ppp/include/net/vjcompress.h144
-rw-r--r--mdk-stage1/ppp/include/pcap-int.h117
-rw-r--r--mdk-stage1/ppp/linux/Makefile.top55
-rw-r--r--mdk-stage1/ppp/modules/bsd-comp.c1116
-rw-r--r--mdk-stage1/ppp/modules/deflate.c760
-rw-r--r--mdk-stage1/ppp/modules/if_ppp.c865
-rw-r--r--mdk-stage1/ppp/modules/ppp.c2486
-rw-r--r--mdk-stage1/ppp/modules/ppp_ahdlc.c878
-rw-r--r--mdk-stage1/ppp/modules/ppp_comp.c1126
-rw-r--r--mdk-stage1/ppp/modules/ppp_mod.h190
-rw-r--r--mdk-stage1/ppp/modules/vjcompress.c587
-rw-r--r--mdk-stage1/ppp/pppd/.cvsignore2
-rw-r--r--mdk-stage1/ppp/pppd/Makefile49
-rw-r--r--mdk-stage1/ppp/pppd/Makefile.linux129
-rw-r--r--mdk-stage1/ppp/pppd/Makefile.linux.make131
-rw-r--r--mdk-stage1/ppp/pppd/Makefile.linux.makeopt129
-rw-r--r--mdk-stage1/ppp/pppd/Makefile.sol248
-rw-r--r--mdk-stage1/ppp/pppd/Makefile.sunos426
-rw-r--r--mdk-stage1/ppp/pppd/auth.c1939
-rw-r--r--mdk-stage1/ppp/pppd/cbcp.c456
-rw-r--r--mdk-stage1/ppp/pppd/cbcp.h26
-rw-r--r--mdk-stage1/ppp/pppd/ccp.c1257
-rw-r--r--mdk-stage1/ppp/pppd/ccp.h48
-rw-r--r--mdk-stage1/ppp/pppd/chap.c860
-rw-r--r--mdk-stage1/ppp/pppd/chap.h124
-rw-r--r--mdk-stage1/ppp/pppd/chap_ms.c338
-rw-r--r--mdk-stage1/ppp/pppd/chap_ms.h33
-rw-r--r--mdk-stage1/ppp/pppd/demand.c351
-rw-r--r--mdk-stage1/ppp/pppd/eui64.c40
-rw-r--r--mdk-stage1/ppp/pppd/eui64.h97
-rw-r--r--mdk-stage1/ppp/pppd/fsm.c762
-rw-r--r--mdk-stage1/ppp/pppd/fsm.h144
-rw-r--r--mdk-stage1/ppp/pppd/ipcp.c2054
-rw-r--r--mdk-stage1/ppp/pppd/ipcp.h73
-rw-r--r--mdk-stage1/ppp/pppd/ipv6cp.c1512
-rw-r--r--mdk-stage1/ppp/pppd/ipv6cp.h126
-rw-r--r--mdk-stage1/ppp/pppd/ipxcp.c1570
-rw-r--r--mdk-stage1/ppp/pppd/ipxcp.h71
-rw-r--r--mdk-stage1/ppp/pppd/lcp.c2224
-rw-r--r--mdk-stage1/ppp/pppd/lcp.h95
-rw-r--r--mdk-stage1/ppp/pppd/magic.c88
-rw-r--r--mdk-stage1/ppp/pppd/magic.h23
-rw-r--r--mdk-stage1/ppp/pppd/main.c1846
-rw-r--r--mdk-stage1/ppp/pppd/md4.c298
-rw-r--r--mdk-stage1/ppp/pppd/md4.h64
-rw-r--r--mdk-stage1/ppp/pppd/md5.c309
-rw-r--r--mdk-stage1/ppp/pppd/md5.h58
-rw-r--r--mdk-stage1/ppp/pppd/multilink.c397
-rw-r--r--mdk-stage1/ppp/pppd/options.c1513
-rw-r--r--mdk-stage1/ppp/pppd/patchlevel.h4
-rw-r--r--mdk-stage1/ppp/pppd/pathnames.h25
-rw-r--r--mdk-stage1/ppp/pppd/plugins/Makefile.linux19
-rw-r--r--mdk-stage1/ppp/pppd/plugins/Makefile.sol227
-rw-r--r--mdk-stage1/ppp/pppd/plugins/minconn.c46
-rw-r--r--mdk-stage1/ppp/pppd/plugins/passprompt.c108
-rw-r--r--mdk-stage1/ppp/pppd/ppp.pam6
-rw-r--r--mdk-stage1/ppp/pppd/pppd.81591
-rw-r--r--mdk-stage1/ppp/pppd/pppd.h787
-rw-r--r--mdk-stage1/ppp/pppd/pppd.h.wtmp789
-rw-r--r--mdk-stage1/ppp/pppd/sys-linux.c2672
-rw-r--r--mdk-stage1/ppp/pppd/sys-linux.c.wtmp2750
-rw-r--r--mdk-stage1/ppp/pppd/sys-solaris.c2737
-rw-r--r--mdk-stage1/ppp/pppd/sys-sunos4.c1559
-rw-r--r--mdk-stage1/ppp/pppd/tdb.c1282
-rw-r--r--mdk-stage1/ppp/pppd/tdb.h77
-rw-r--r--mdk-stage1/ppp/pppd/tty.c1164
-rw-r--r--mdk-stage1/ppp/pppd/upap.c640
-rw-r--r--mdk-stage1/ppp/pppd/upap.h87
-rw-r--r--mdk-stage1/ppp/pppd/utils.c949
-rw-r--r--mdk-stage1/ppp/pppdump/Makefile.linux17
-rw-r--r--mdk-stage1/ppp/pppdump/Makefile.linux.makeopt17
-rw-r--r--mdk-stage1/ppp/pppdump/Makefile.linux.pppdump-Makefile17
-rw-r--r--mdk-stage1/ppp/pppdump/Makefile.sol221
-rw-r--r--mdk-stage1/ppp/pppdump/Makefile.sunos421
-rw-r--r--mdk-stage1/ppp/pppdump/bsd-comp.c750
-rw-r--r--mdk-stage1/ppp/pppdump/deflate.c344
-rw-r--r--mdk-stage1/ppp/pppdump/ppp-comp.h150
-rw-r--r--mdk-stage1/ppp/pppdump/pppdump.862
-rw-r--r--mdk-stage1/ppp/pppdump/pppdump.c502
-rw-r--r--mdk-stage1/ppp/pppdump/zlib.c4614
-rw-r--r--mdk-stage1/ppp/pppdump/zlib.h631
-rw-r--r--mdk-stage1/ppp/pppstats/Makefile.linux32
-rw-r--r--mdk-stage1/ppp/pppstats/Makefile.sol220
-rw-r--r--mdk-stage1/ppp/pppstats/Makefile.sunos430
-rw-r--r--mdk-stage1/ppp/pppstats/pppstats.8217
-rw-r--r--mdk-stage1/ppp/pppstats/pppstats.c557
-rw-r--r--mdk-stage1/ppp/sample/auth-down17
-rw-r--r--mdk-stage1/ppp/sample/auth-up17
-rw-r--r--mdk-stage1/ppp/sample/ip-down22
-rw-r--r--mdk-stage1/ppp/sample/ip-up23
-rw-r--r--mdk-stage1/ppp/sample/options153
-rw-r--r--mdk-stage1/ppp/sample/options.ttyXX14
-rw-r--r--mdk-stage1/ppp/sample/pap-secrets28
-rw-r--r--mdk-stage1/ppp/scripts/README143
-rwxr-xr-xmdk-stage1/ppp/scripts/callback77
-rw-r--r--mdk-stage1/ppp/scripts/chat-callback98
-rw-r--r--mdk-stage1/ppp/scripts/chatchat/README134
-rw-r--r--mdk-stage1/ppp/scripts/chatchat/chatchat.c409
-rw-r--r--mdk-stage1/ppp/scripts/ip-down.local.add20
-rw-r--r--mdk-stage1/ppp/scripts/ip-up.local.add24
-rw-r--r--mdk-stage1/ppp/scripts/options-rsh-loc1
-rw-r--r--mdk-stage1/ppp/scripts/options-rsh-rem1
-rw-r--r--mdk-stage1/ppp/scripts/options-ssh-loc1
-rw-r--r--mdk-stage1/ppp/scripts/options-ssh-rem1
-rwxr-xr-xmdk-stage1/ppp/scripts/ppp-off34
-rwxr-xr-xmdk-stage1/ppp/scripts/ppp-on36
-rwxr-xr-xmdk-stage1/ppp/scripts/ppp-on-dialer17
-rwxr-xr-xmdk-stage1/ppp/scripts/ppp-on-rsh72
-rwxr-xr-xmdk-stage1/ppp/scripts/ppp-on-ssh76
-rwxr-xr-xmdk-stage1/ppp/scripts/redialer96
-rw-r--r--mdk-stage1/ppp/scripts/secure-card111
-rw-r--r--mdk-stage1/ppp/solaris/Makedefs16
-rw-r--r--mdk-stage1/ppp/solaris/Makedefs.sol259
-rw-r--r--mdk-stage1/ppp/solaris/Makefile.sol266
-rw-r--r--mdk-stage1/ppp/solaris/Makefile.sol2-6485
-rw-r--r--mdk-stage1/ppp/solaris/Makefile.top50
-rw-r--r--mdk-stage1/ppp/solaris/ppp.c2486
-rw-r--r--mdk-stage1/ppp/solaris/ppp.conf1
-rw-r--r--mdk-stage1/ppp/solaris/ppp_ahdlc.c878
-rw-r--r--mdk-stage1/ppp/solaris/ppp_ahdlc_mod.c49
-rw-r--r--mdk-stage1/ppp/solaris/ppp_comp.c1126
-rw-r--r--mdk-stage1/ppp/solaris/ppp_comp_mod.c81
-rw-r--r--mdk-stage1/ppp/solaris/ppp_mod.c174
-rw-r--r--mdk-stage1/ppp/solaris/ppp_mod.h190
-rw-r--r--mdk-stage1/ppp/sunos4/Makedefs13
-rw-r--r--mdk-stage1/ppp/sunos4/Makefile57
-rw-r--r--mdk-stage1/ppp/sunos4/Makefile.top46
-rw-r--r--mdk-stage1/ppp/sunos4/if_ppp_vdcmd.c57
-rwxr-xr-xmdk-stage1/ppp/sunos4/ppp.INSTALL104
-rw-r--r--mdk-stage1/ppp/sunos4/ppp_ahdlc_vdcmd.c57
-rw-r--r--mdk-stage1/ppp/sunos4/ppp_comp_vdcmd.c57
-rw-r--r--mdk-stage1/ppp/sunos4/ppp_vdcmd.c81
-rw-r--r--mdk-stage1/ppp/svr4/Makedefs16
-rw-r--r--mdk-stage1/ppp/svr4/Makedefs.sol259
-rw-r--r--mdk-stage1/ppp/svr4/Makefile.sol266
-rw-r--r--mdk-stage1/ppp/svr4/Makefile.sol2-6485
-rw-r--r--mdk-stage1/ppp/svr4/Makefile.svr460
-rw-r--r--mdk-stage1/ppp/svr4/Makefile.top50
-rw-r--r--mdk-stage1/ppp/svr4/ppp.Master1
-rw-r--r--mdk-stage1/ppp/svr4/ppp.Node1
-rw-r--r--mdk-stage1/ppp/svr4/ppp.System1
-rw-r--r--mdk-stage1/ppp/svr4/ppp.conf1
-rw-r--r--mdk-stage1/ppp/svr4/ppp_ahdl.Master1
-rw-r--r--mdk-stage1/ppp/svr4/ppp_ahdl.System1
-rw-r--r--mdk-stage1/ppp/svr4/ppp_ahdlc_mod.c49
-rw-r--r--mdk-stage1/ppp/svr4/ppp_comp.Master1
-rw-r--r--mdk-stage1/ppp/svr4/ppp_comp.System1
-rw-r--r--mdk-stage1/ppp/svr4/ppp_comp_mod.c81
-rw-r--r--mdk-stage1/ppp/svr4/ppp_mod.c174
-rw-r--r--mdk-stage1/probing.c743
-rw-r--r--mdk-stage1/probing.h38
-rw-r--r--mdk-stage1/rescue-gui.c239
-rw-r--r--mdk-stage1/rp-pppoe/.cvsignore1
-rw-r--r--mdk-stage1/rp-pppoe/README87
-rw-r--r--mdk-stage1/rp-pppoe/configs/firewall-masq35
-rw-r--r--mdk-stage1/rp-pppoe/configs/firewall-standalone32
-rw-r--r--mdk-stage1/rp-pppoe/configs/pap-secrets9
-rw-r--r--mdk-stage1/rp-pppoe/configs/pppoe-server-options5
-rw-r--r--mdk-stage1/rp-pppoe/configs/pppoe.conf126
-rw-r--r--mdk-stage1/rp-pppoe/doc/CHANGES177
-rw-r--r--mdk-stage1/rp-pppoe/doc/HOW-TO-CONNECT295
-rw-r--r--mdk-stage1/rp-pppoe/doc/KERNEL-MODE-PPPOE39
-rw-r--r--mdk-stage1/rp-pppoe/doc/LICENSE339
-rw-r--r--mdk-stage1/rp-pppoe/doc/PROBLEMS3
-rwxr-xr-xmdk-stage1/rp-pppoe/go43
-rwxr-xr-xmdk-stage1/rp-pppoe/go-gui92
-rw-r--r--mdk-stage1/rp-pppoe/gui/Makefile.in64
-rw-r--r--mdk-stage1/rp-pppoe/gui/html/tkpppoe.html181
-rw-r--r--mdk-stage1/rp-pppoe/gui/pppoe-wrapper.145
-rw-r--r--mdk-stage1/rp-pppoe/gui/tkpppoe.136
-rwxr-xr-xmdk-stage1/rp-pppoe/gui/tkpppoe.in2891
-rw-r--r--mdk-stage1/rp-pppoe/gui/wrapper.c234
-rw-r--r--mdk-stage1/rp-pppoe/man/adsl-connect.866
-rw-r--r--mdk-stage1/rp-pppoe/man/adsl-setup.823
-rw-r--r--mdk-stage1/rp-pppoe/man/adsl-start.827
-rw-r--r--mdk-stage1/rp-pppoe/man/adsl-status.825
-rw-r--r--mdk-stage1/rp-pppoe/man/adsl-stop.821
-rw-r--r--mdk-stage1/rp-pppoe/man/pppoe-relay.8124
-rw-r--r--mdk-stage1/rp-pppoe/man/pppoe-server.8123
-rw-r--r--mdk-stage1/rp-pppoe/man/pppoe-sniff.877
-rw-r--r--mdk-stage1/rp-pppoe/man/pppoe.8236
-rw-r--r--mdk-stage1/rp-pppoe/man/pppoe.conf.5168
-rw-r--r--mdk-stage1/rp-pppoe/rp-pppoe-gui.spec98
-rw-r--r--mdk-stage1/rp-pppoe/rp-pppoe.spec71
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-connect.in278
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-init-suse.in62
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-init-turbolinux.in62
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-init.in64
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-setup.in346
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-start.in186
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-status82
-rwxr-xr-xmdk-stage1/rp-pppoe/scripts/adsl-stop.in84
-rw-r--r--mdk-stage1/rp-pppoe/src/.cvsignore2
-rw-r--r--mdk-stage1/rp-pppoe/src/Makefile45
-rw-r--r--mdk-stage1/rp-pppoe/src/Makefile.in257
-rw-r--r--mdk-stage1/rp-pppoe/src/common.c485
-rw-r--r--mdk-stage1/rp-pppoe/src/config.h135
-rw-r--r--mdk-stage1/rp-pppoe/src/config.h.in134
-rwxr-xr-xmdk-stage1/rp-pppoe/src/configure2356
-rw-r--r--mdk-stage1/rp-pppoe/src/configure.in231
-rw-r--r--mdk-stage1/rp-pppoe/src/debug.c143
-rw-r--r--mdk-stage1/rp-pppoe/src/discovery.c629
-rw-r--r--mdk-stage1/rp-pppoe/src/if.c1092
-rwxr-xr-xmdk-stage1/rp-pppoe/src/install-sh238
-rw-r--r--mdk-stage1/rp-pppoe/src/md5.c246
-rw-r--r--mdk-stage1/rp-pppoe/src/md5.h27
-rw-r--r--mdk-stage1/rp-pppoe/src/plugin.c397
-rw-r--r--mdk-stage1/rp-pppoe/src/ppp.c258
-rw-r--r--mdk-stage1/rp-pppoe/src/pppoe-server.c1247
-rw-r--r--mdk-stage1/rp-pppoe/src/pppoe-sniff.c258
-rw-r--r--mdk-stage1/rp-pppoe/src/pppoe.c834
-rw-r--r--mdk-stage1/rp-pppoe/src/pppoe.h331
-rw-r--r--mdk-stage1/rp-pppoe/src/relay.c1541
-rw-r--r--mdk-stage1/rp-pppoe/src/relay.h97
-rw-r--r--mdk-stage1/slang/Makefile42
-rw-r--r--mdk-stage1/slang/_slang.h743
-rw-r--r--mdk-stage1/slang/config.h163
-rw-r--r--mdk-stage1/slang/jdmacros.h53
-rw-r--r--mdk-stage1/slang/keywhash.c190
-rw-r--r--mdk-stage1/slang/sl-feat.h60
-rw-r--r--mdk-stage1/slang/slang.c5547
-rw-r--r--mdk-stage1/slang/slang.h1930
-rw-r--r--mdk-stage1/slang/slarith.c1656
-rw-r--r--mdk-stage1/slang/slarith.inc783
-rw-r--r--mdk-stage1/slang/slarray.c3139
-rw-r--r--mdk-stage1/slang/slarrfun.c464
-rw-r--r--mdk-stage1/slang/slarrfun.inc257
-rw-r--r--mdk-stage1/slang/slarrmis.c38
-rw-r--r--mdk-stage1/slang/slassoc.c713
-rw-r--r--mdk-stage1/slang/slbstr.c615
-rw-r--r--mdk-stage1/slang/slclass.c1391
-rw-r--r--mdk-stage1/slang/slcmd.c351
-rw-r--r--mdk-stage1/slang/slcmplex.c1142
-rw-r--r--mdk-stage1/slang/slcompat.c34
-rw-r--r--mdk-stage1/slang/slcurses.c972
-rw-r--r--mdk-stage1/slang/slcurses.h353
-rw-r--r--mdk-stage1/slang/sldisply.c2596
-rw-r--r--mdk-stage1/slang/slerr.c181
-rw-r--r--mdk-stage1/slang/slerrno.c219
-rw-r--r--mdk-stage1/slang/slgetkey.c306
-rw-r--r--mdk-stage1/slang/slimport.c281
-rw-r--r--mdk-stage1/slang/slinclud.h26
-rw-r--r--mdk-stage1/slang/slintall.c27
-rw-r--r--mdk-stage1/slang/slistruc.c218
-rw-r--r--mdk-stage1/slang/slkeymap.c596
-rw-r--r--mdk-stage1/slang/slkeypad.c163
-rw-r--r--mdk-stage1/slang/sllimits.h64
-rw-r--r--mdk-stage1/slang/slmalloc.c165
-rw-r--r--mdk-stage1/slang/slmath.c565
-rw-r--r--mdk-stage1/slang/slmemchr.c47
-rw-r--r--mdk-stage1/slang/slmemcmp.c76
-rw-r--r--mdk-stage1/slang/slmemcpy.c49
-rw-r--r--mdk-stage1/slang/slmemset.c39
-rw-r--r--mdk-stage1/slang/slmisc.c330
-rw-r--r--mdk-stage1/slang/slnspace.c242
-rw-r--r--mdk-stage1/slang/slospath.c73
-rw-r--r--mdk-stage1/slang/slpack.c785
-rw-r--r--mdk-stage1/slang/slparse.c1970
-rw-r--r--mdk-stage1/slang/slpath.c344
-rw-r--r--mdk-stage1/slang/slposdir.c1057
-rw-r--r--mdk-stage1/slang/slposio.c568
-rw-r--r--mdk-stage1/slang/slprepr.c427
-rw-r--r--mdk-stage1/slang/slproc.c155
-rw-r--r--mdk-stage1/slang/slregexp.c935
-rw-r--r--mdk-stage1/slang/slrline.c836
-rw-r--r--mdk-stage1/slang/slscanf.c718
-rw-r--r--mdk-stage1/slang/slscroll.c450
-rw-r--r--mdk-stage1/slang/slsearch.c239
-rw-r--r--mdk-stage1/slang/slsignal.c336
-rw-r--r--mdk-stage1/slang/slsmg.c1584
-rw-r--r--mdk-stage1/slang/slstd.c724
-rw-r--r--mdk-stage1/slang/slstdio.c1050
-rw-r--r--mdk-stage1/slang/slstring.c546
-rw-r--r--mdk-stage1/slang/slstrops.c1686
-rw-r--r--mdk-stage1/slang/slstruct.c932
-rw-r--r--mdk-stage1/slang/sltermin.c1155
-rw-r--r--mdk-stage1/slang/sltime.c310
-rw-r--r--mdk-stage1/slang/sltoken.c1702
-rw-r--r--mdk-stage1/slang/sltypes.c966
-rw-r--r--mdk-stage1/slang/slutty.c596
-rw-r--r--mdk-stage1/slang/slxstrng.c43
-rw-r--r--mdk-stage1/stage1-data/stage1-with-busybox.tar.bz2bin92142 -> 0 bytes-rw-r--r--mdk-stage1/stage1-data/stage1-with-sash.tar.bz2bin345030 -> 0 bytes-rw-r--r--mdk-stage1/stage1-data/stage1.tar.bz2bin1957 -> 0 bytes-rw-r--r--mdk-stage1/stage1.c671
-rw-r--r--mdk-stage1/stage1.h67
-rw-r--r--mdk-stage1/stdio-frontend.c369
-rw-r--r--mdk-stage1/tools.c537
-rw-r--r--mdk-stage1/tools.h60
-rw-r--r--mdk-stage1/url.c514
-rw-r--r--mdk-stage1/url.h44
-rw-r--r--mdk-stage1/usb-resource/.cvsignore1
-rw-r--r--mdk-stage1/usb-resource/Makefile25
-rwxr-xr-xmdk-stage1/usb-resource/update-usb-ids.pl53
-rw-r--r--move/.cvsignore4
-rw-r--r--move/Makefile141
-rwxr-xr-xmove/collect-directories-to-create.pl15
-rw-r--r--move/data/.cvsignore2
-rw-r--r--move/data/BOOT-1024-MOVE.jpgbin103853 -> 0 bytes-rw-r--r--move/data/BOOT-1280-MOVE.jpgbin152287 -> 0 bytes-rw-r--r--move/data/BOOT-1600-MOVE.jpgbin212207 -> 0 bytes-rw-r--r--move/data/BOOT-800-MOVE.jpgbin78190 -> 0 bytes-rw-r--r--move/data/always.dirs0
-rw-r--r--move/data/always.list142
-rw-r--r--move/data/always_i18n.list30
-rw-r--r--move/data/boot.dirs40
-rw-r--r--move/data/boot.list883
-rw-r--r--move/data/devices4
-rw-r--r--move/data/etcfiles33
-rw-r--r--move/data/etcfiles-report151
-rw-r--r--move/data/isolinux-graphic.bmpbin480566 -> 0 bytes-rw-r--r--move/data/keyfiles25
-rw-r--r--move/data/nvidia.list3
-rw-r--r--move/data/symlinks4
-rw-r--r--move/data/totem.dirs2
-rw-r--r--move/data/totem.list68
-rw-r--r--move/doc/README95
-rw-r--r--move/doc/errata.144
-rwxr-xr-xmove/etc-monitorer.pl31
-rwxr-xr-xmove/hack5
-rw-r--r--move/img/FE92-1024-MOVE1.jpgbin134082 -> 0 bytes-rw-r--r--move/img/FE92-1024-MOVE2.jpgbin110160 -> 0 bytes-rw-r--r--move/img/FE92-1024-MOVE3.jpgbin114463 -> 0 bytes-rw-r--r--move/img/FE92-1024-MOVE4.jpgbin42557 -> 0 bytes-rw-r--r--move/img/FE92-1024-MOVE5.jpgbin38483 -> 0 bytes-rw-r--r--move/img/FE92-1280-MOVE1.jpgbin195812 -> 0 bytes-rw-r--r--move/img/FE92-1280-MOVE2.jpgbin167724 -> 0 bytes-rw-r--r--move/img/FE92-1280-MOVE3.jpgbin165527 -> 0 bytes-rw-r--r--move/img/FE92-1280-MOVE4.jpgbin64707 -> 0 bytes-rw-r--r--move/img/FE92-1280-MOVE5.jpgbin58419 -> 0 bytes-rw-r--r--move/img/Mandrake.pngbin283935 -> 0 bytes-rw-r--r--move/isolinux/.cvsignore4
-rw-r--r--move/isolinux/help.msgbin1307 -> 0 bytes-rw-r--r--move/isolinux/isolinux.cfg14
-rw-r--r--move/isolinux/make.pl28
-rwxr-xr-xmove/make_live251
-rwxr-xr-xmove/make_live_tree_boot166
-rw-r--r--move/move.pm711
-rw-r--r--move/pkgs.pm32
-rw-r--r--move/runlevel_set.c25
-rwxr-xr-xmove/runstage225
-rw-r--r--move/todo39
-rwxr-xr-xmove/tools/busy-files25
-rw-r--r--move/tools/busy-files-accesses34
-rw-r--r--move/tools/check-fc-cache.pl27
-rwxr-xr-xmove/tools/fix-fc-cache.pl21
-rw-r--r--move/tools/kernel-nfsd.patch61
-rwxr-xr-xmove/tools/nfs-accesses67
-rwxr-xr-xmove/tools/scan-etc.pl41
-rwxr-xr-xmove/tree/X_move16
-rwxr-xr-xmove/tree/alsa_default.pl19
-rwxr-xr-xmove/tree/halt5
-rw-r--r--move/tree/kdedrc7
-rw-r--r--move/tree/konsolerc19
-rwxr-xr-xmove/tree/mdk_behind_totem80
-rw-r--r--move/tree/mdk_move_boot_loop.desktop8
-rwxr-xr-xmove/tree/mdk_move_loop56
-rwxr-xr-xmove/tree/mdk_totem119
-rw-r--r--move/tree/mdk_totem.desktop12
-rwxr-xr-xmove/tree/netscape3
-rwxr-xr-xmove/tree/reboot5
-rwxr-xr-xmove/tree/sound.initscript116
-rwxr-xr-xmove/tree/startkde_move17
-rw-r--r--move/tree/sudoers1
-rwxr-xr-xmove/tree/wait4x21
-rw-r--r--move/xwait.c19
-rw-r--r--perl-install/Makefile42
-rw-r--r--perl-install/Makefile.config1
-rw-r--r--perl-install/Xconfig/FILES14
-rw-r--r--perl-install/Xconfig/card.pm224
-rw-r--r--perl-install/Xconfig/default.pm2
-rw-r--r--perl-install/Xconfig/main.pm61
-rw-r--r--perl-install/Xconfig/monitor.pm138
-rw-r--r--perl-install/Xconfig/resolution_and_depth.pm39
-rw-r--r--perl-install/Xconfig/screen.pm25
-rw-r--r--perl-install/Xconfig/test.pm32
-rw-r--r--perl-install/Xconfig/various.pm40
-rw-r--r--perl-install/Xconfig/xfree.pm523
-rw-r--r--perl-install/Xconfig/xfree3.pm281
-rw-r--r--perl-install/Xconfig/xfree4.pm165
-rw-r--r--perl-install/Xconfig/xfreeX.pm357
-rw-r--r--perl-install/any.pm36
-rw-r--r--perl-install/authentication.pm487
-rw-r--r--perl-install/bootloader.pm42
-rw-r--r--perl-install/c/smp.c201
-rw-r--r--perl-install/c/stuff.xs.pl61
-rw-r--r--perl-install/common.pm40
-rw-r--r--perl-install/crypto.pm17
-rw-r--r--perl-install/detect_devices.pm68
-rw-r--r--perl-install/devices.pm2
-rw-r--r--perl-install/do_pkgs.pm80
-rw-r--r--perl-install/drakxtools.spec105
-rw-r--r--perl-install/fsedit.pm75
-rw-r--r--perl-install/harddrake/autoconf.pm27
-rw-r--r--perl-install/harddrake/data.pm23
-rw-r--r--perl-install/harddrake/v4l.pm12
-rw-r--r--perl-install/install2.pm6
-rw-r--r--perl-install/install_any.pm236
-rw-r--r--perl-install/install_gtk.pm8
-rw-r--r--perl-install/install_messages.pm2
-rw-r--r--perl-install/install_steps.pm24
-rw-r--r--perl-install/install_steps_gtk.pm69
-rw-r--r--perl-install/install_steps_interactive.pm41
-rw-r--r--perl-install/keyboard.pm37
-rw-r--r--perl-install/lang.pm5
-rw-r--r--perl-install/lvm.pm1
-rw-r--r--perl-install/modules.pm23
-rw-r--r--perl-install/network/adsl.pm35
-rw-r--r--perl-install/network/drakfirewall.pm8
-rw-r--r--perl-install/network/ethernet.pm16
-rw-r--r--perl-install/network/netconnect.pm33
-rw-r--r--perl-install/network/smb.pm32
-rw-r--r--perl-install/partition_table.pm3
-rw-r--r--perl-install/partition_table/empty.pm2
-rw-r--r--perl-install/pkgs.pm161
-rw-r--r--perl-install/printer/cups.pm23
-rw-r--r--perl-install/printer/data.pm114
-rw-r--r--perl-install/printer/default.pm23
-rw-r--r--perl-install/printer/detect.pm249
-rw-r--r--perl-install/printer/gimp.pm361
-rw-r--r--perl-install/printer/main.pm1674
-rw-r--r--perl-install/printer/office.pm375
-rw-r--r--perl-install/printer/printerdrake.pm2535
-rw-r--r--perl-install/printer/services.pm4
-rw-r--r--perl-install/share/advertising/README2
-rw-r--r--perl-install/share/advertising/corpo-desk-01.pl14
-rw-r--r--perl-install/share/advertising/corpo-desk-01.pngbin0 -> 14358 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-02.pl19
-rw-r--r--perl-install/share/advertising/corpo-desk-02.pngbin0 -> 13633 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-03.pl22
-rw-r--r--perl-install/share/advertising/corpo-desk-03.pngbin0 -> 14043 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-04.pl16
-rw-r--r--perl-install/share/advertising/corpo-desk-04.pngbin0 -> 14337 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-05-a.pl15
-rw-r--r--perl-install/share/advertising/corpo-desk-05-a.pngbin0 -> 13826 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-05-b.pl15
-rw-r--r--perl-install/share/advertising/corpo-desk-05-b.pngbin0 -> 13826 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-05.pl21
-rw-r--r--perl-install/share/advertising/corpo-desk-05.pngbin0 -> 13826 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-06-a.pl15
-rw-r--r--perl-install/share/advertising/corpo-desk-06-a.pngbin0 -> 12683 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-06-b.pl15
-rw-r--r--perl-install/share/advertising/corpo-desk-06-b.pngbin0 -> 13404 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-06.pl19
-rw-r--r--perl-install/share/advertising/corpo-desk-06.pngbin0 -> 12683 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-07.pl15
-rw-r--r--perl-install/share/advertising/corpo-desk-07.pngbin0 -> 13146 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-08.pl13
-rw-r--r--perl-install/share/advertising/corpo-desk-08.pngbin0 -> 14196 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-09.pl16
-rw-r--r--perl-install/share/advertising/corpo-desk-09.pngbin0 -> 14196 bytes-rw-r--r--perl-install/share/advertising/corpo-desk-10.pl19
-rw-r--r--perl-install/share/advertising/corpo-desk-10.pngbin0 -> 7262 bytes-rw-r--r--perl-install/share/advertising/corpo-server-01.pl15
-rw-r--r--perl-install/share/advertising/corpo-server-01.pngbin0 -> 14358 bytes-rw-r--r--perl-install/share/advertising/corpo-server-02.pl22
-rw-r--r--perl-install/share/advertising/corpo-server-02.pngbin0 -> 14043 bytes-rw-r--r--perl-install/share/advertising/corpo-server-03.pl20
-rw-r--r--perl-install/share/advertising/corpo-server-03.pngbin0 -> 13633 bytes-rw-r--r--perl-install/share/advertising/corpo-server-04.pl17
-rw-r--r--perl-install/share/advertising/corpo-server-04.pngbin0 -> 14337 bytes-rw-r--r--perl-install/share/advertising/corpo-server-05.pl21
-rw-r--r--perl-install/share/advertising/corpo-server-05.pngbin0 -> 13826 bytes-rw-r--r--perl-install/share/advertising/corpo-server-06.pl20
-rw-r--r--perl-install/share/advertising/corpo-server-06.pngbin0 -> 12683 bytes-rw-r--r--perl-install/share/advertising/corpo-server-07.pl15
-rw-r--r--perl-install/share/advertising/corpo-server-07.pngbin0 -> 13404 bytes-rw-r--r--perl-install/share/advertising/corpo-server-08.pl14
-rw-r--r--perl-install/share/advertising/corpo-server-08.pngbin0 -> 13146 bytes-rw-r--r--perl-install/share/advertising/corpo-server-09.pl17
-rw-r--r--perl-install/share/advertising/corpo-server-09.pngbin0 -> 14196 bytes-rw-r--r--perl-install/share/advertising/corpo-server-10.pl19
-rw-r--r--perl-install/share/advertising/corpo-server-10.pngbin0 -> 14358 bytes-rw-r--r--perl-install/share/advertising/dwd-01.pl12
-rw-r--r--perl-install/share/advertising/list-cpd12
-rw-r--r--perl-install/share/advertising/list-cps12
-rw-r--r--perl-install/share/compssUsers.corpo-server88
-rw-r--r--perl-install/share/compssUsers.desktop4
-rwxr-xr-xperl-install/share/compssUsers.suppl-desktop43
-rwxr-xr-xperl-install/share/compssUsers.suppl-server94
-rw-r--r--perl-install/share/list8
-rw-r--r--perl-install/share/list.x86_646
-rw-r--r--perl-install/share/po/DrakX.pot3652
-rw-r--r--perl-install/share/po/fr.po24701
-rw-r--r--perl-install/share/rpmsrate39
-rw-r--r--perl-install/share/rpmsrate.corpo-desktop718
-rw-r--r--perl-install/share/rpmsrate.corpo-server721
-rw-r--r--perl-install/share/themes-corporate.rc112
-rw-r--r--perl-install/standalone.pm2
-rwxr-xr-xperl-install/standalone/drakTermServ157
-rwxr-xr-xperl-install/standalone/drakauth4
-rwxr-xr-xperl-install/standalone/drakbackup137
-rwxr-xr-xperl-install/standalone/drakfont2
-rwxr-xr-xperl-install/standalone/draksplash52
-rwxr-xr-xperl-install/standalone/drakupdate_fstab6
-rwxr-xr-xperl-install/standalone/drakups99
-rwxr-xr-xperl-install/standalone/harddrake214
-rwxr-xr-xperl-install/standalone/net_monitor10
-rwxr-xr-xperl-install/standalone/printerdrake288
-rwxr-xr-xperl-install/standalone/service_harddrake29
-rw-r--r--perl-install/steps.pm2
-rw-r--r--perl-install/ugtk2.pm6
-rw-r--r--perl-install/wizards.pm2
-rw-r--r--rescue/.cvsignore2
-rw-r--r--rescue/Makefile16
-rw-r--r--rescue/aliases4
-rw-r--r--rescue/devices.pl53
-rw-r--r--rescue/dirs8
-rwxr-xr-xrescue/drvinst87
-rwxr-xr-xrescue/guessmounts107
-rwxr-xr-xrescue/install_bootloader47
-rw-r--r--rescue/kernel_read_part.c26
-rw-r--r--rescue/list142
-rw-r--r--rescue/list.alpha1
-rw-r--r--rescue/list.i38614
-rw-r--r--rescue/list.ia648
-rw-r--r--rescue/list.ppc9
-rw-r--r--rescue/list.sparc2
-rw-r--r--rescue/list.x86_6410
-rwxr-xr-xrescue/lsparts127
-rwxr-xr-xrescue/make_rescue_img133
-rwxr-xr-xrescue/rescue-doc61
-rwxr-xr-xrescue/restore_ms_boot108
-rwxr-xr-xrescue/tree/bin/insmod2
-rwxr-xr-xrescue/tree/bin/login2
-rw-r--r--rescue/tree/boot/grub/menu.lst5
-rw-r--r--rescue/tree/etc/fstab4
-rw-r--r--rescue/tree/etc/group1
-rw-r--r--rescue/tree/etc/host.conf2
-rw-r--r--rescue/tree/etc/hosts1
-rw-r--r--rescue/tree/etc/inittab14
-rw-r--r--rescue/tree/etc/issue27
-rwxr-xr-xrescue/tree/etc/oem674
-rwxr-xr-xrescue/tree/etc/oem-all676
-rw-r--r--rescue/tree/etc/passwd3
-rw-r--r--rescue/tree/etc/profile24
-rwxr-xr-xrescue/tree/etc/rc.reboot8
-rwxr-xr-xrescue/tree/etc/rc.sysinit48
-rw-r--r--rescue/tree/etc/resolv.conf2
-rwxr-xr-xrescue/tree/sbin/fakeshutdown39
-rwxr-xr-xrescue/tree/sbin/modprobe56
-rw-r--r--rescue/tree/usr/lib/CVS.0
-rw-r--r--tools/.cvsignore4
-rw-r--r--tools/2adsldb.pm17
-rw-r--r--tools/2isdndb.pm25
-rw-r--r--tools/Makefile40
-rwxr-xr-xtools/addchangelog.pl18
-rw-r--r--tools/aewm-drakx/.cvsignore1
-rw-r--r--tools/alpha/cd/Makefile8
-rw-r--r--tools/alpha/cd/README40
-rw-r--r--tools/alpha/cd/README.milo13
-rw-r--r--tools/alpha/cd/aboot.cnf3
-rw-r--r--tools/alpha/cd/up1000/5100440A.txt25
-rw-r--r--tools/alpha/cd/up1000/README.txt16
-rwxr-xr-xtools/alpha/cd/up1000/apb.cfg2
-rwxr-xr-xtools/alpha/cd/up1000/apb.exebin120832 -> 0 bytes-rw-r--r--tools/alpha/cd/up1000/install.txt356
-rw-r--r--tools/alpha/cd/up1000/up1000.palbin30464 -> 0 bytes-rwxr-xr-xtools/alpha/e2fsck.sharedbin111080 -> 0 bytes-rwxr-xr-xtools/closurepkgs108
-rwxr-xr-xtools/cvslog2changelog.pl81
-rw-r--r--tools/ddcprobe/Makefile63
-rw-r--r--tools/ddcprobe/ddcxinfos.c68
-rw-r--r--tools/ddcprobe/int10/AsmMacros.h458
-rw-r--r--tools/ddcprobe/int10/Makefile19
-rw-r--r--tools/ddcprobe/int10/README35
-rw-r--r--tools/ddcprobe/int10/emu_vm86.c154
-rw-r--r--tools/ddcprobe/int10/i10_int.c195
-rw-r--r--tools/ddcprobe/int10/i10_io.c108
-rw-r--r--tools/ddcprobe/int10/i10_pci.c866
-rw-r--r--tools/ddcprobe/int10/i10_v86.c516
-rw-r--r--tools/ddcprobe/int10/i10_vbios.c571
-rw-r--r--tools/ddcprobe/int10/pci.h127
-rw-r--r--tools/ddcprobe/int10/v86bios.h215
-rw-r--r--tools/ddcprobe/int10/vbios.h4
-rw-r--r--tools/ddcprobe/int10/vm86_struct.h135
-rw-r--r--tools/ddcprobe/minifind.c77
-rw-r--r--tools/ddcprobe/minifind.h42
-rw-r--r--tools/ddcprobe/of.c148
-rw-r--r--tools/ddcprobe/vbe.c604
-rw-r--r--tools/ddcprobe/vbe.h163
-rw-r--r--tools/ddcprobe/x86emu/LICENSE17
-rw-r--r--tools/ddcprobe/x86emu/Makefile62
-rw-r--r--tools/ddcprobe/x86emu/debug.c431
-rw-r--r--tools/ddcprobe/x86emu/decode.c1093
-rw-r--r--tools/ddcprobe/x86emu/fpu.c966
-rw-r--r--tools/ddcprobe/x86emu/include/x86emu.h199
-rw-r--r--tools/ddcprobe/x86emu/include/x86emu/fpu_regs.h120
-rw-r--r--tools/ddcprobe/x86emu/include/x86emu/regs.h338
-rw-r--r--tools/ddcprobe/x86emu/include/x86emu/types.h107
-rw-r--r--tools/ddcprobe/x86emu/ops.c11699
-rw-r--r--tools/ddcprobe/x86emu/ops2.c2805
-rw-r--r--tools/ddcprobe/x86emu/prim_ops.c2654
-rw-r--r--tools/ddcprobe/x86emu/sys.c666
-rw-r--r--tools/ddcprobe/x86emu/validate.c765
-rw-r--r--tools/ddcprobe/x86emu/x86emu/debug.h211
-rw-r--r--tools/ddcprobe/x86emu/x86emu/decode.h89
-rw-r--r--tools/ddcprobe/x86emu/x86emu/fpu.h61
-rw-r--r--tools/ddcprobe/x86emu/x86emu/ops.h45
-rw-r--r--tools/ddcprobe/x86emu/x86emu/prim_asm.h971
-rw-r--r--tools/ddcprobe/x86emu/x86emu/prim_ops.h143
-rw-r--r--tools/ddcprobe/x86emu/x86emu/x86emui.h105
-rw-r--r--tools/dmidecode/.cvsignore1
-rw-r--r--tools/dmidecode/Makefile17
-rw-r--r--tools/dmidecode/dmidecode.c856
-rw-r--r--tools/extractchangelog2
-rwxr-xr-xtools/gencompss14
-rwxr-xr-xtools/gencryptofiles115
-rwxr-xr-xtools/genmodparm145
-rwxr-xr-xtools/hd_grub.cgi102
-rwxr-xr-xtools/i386/busyboxbin55508 -> 0 bytes-rwxr-xr-xtools/i386/e2fsck.sharedbin80308 -> 0 bytes-rwxr-xr-xtools/i386/mkreiserfsbin15868 -> 0 bytes-rw-r--r--tools/i386/netboot/.cvsignore4
-rw-r--r--tools/i386/netboot/3c503/nbgrubbin106660 -> 0 bytes-rw-r--r--tools/i386/netboot/3c503/pxegrubbin107684 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c503/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c503/stage2bin106660 -> 0 bytes-rw-r--r--tools/i386/netboot/3c507/nbgrubbin106208 -> 0 bytes-rw-r--r--tools/i386/netboot/3c507/pxegrubbin107232 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c507/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c507/stage2bin106272 -> 0 bytes-rw-r--r--tools/i386/netboot/3c509/nbgrubbin106712 -> 0 bytes-rw-r--r--tools/i386/netboot/3c509/pxegrubbin107736 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c509/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c509/stage2bin106744 -> 0 bytes-rw-r--r--tools/i386/netboot/3c529/nbgrubbin107592 -> 0 bytes-rw-r--r--tools/i386/netboot/3c529/pxegrubbin108616 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c529/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c529/stage2bin107624 -> 0 bytes-rw-r--r--tools/i386/netboot/3c595/nbgrubbin109440 -> 0 bytes-rw-r--r--tools/i386/netboot/3c595/pxegrubbin110464 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c595/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c595/stage2bin109440 -> 0 bytes-rw-r--r--tools/i386/netboot/3c90x/nbgrubbin111360 -> 0 bytes-rw-r--r--tools/i386/netboot/3c90x/pxegrubbin112384 -> 0 bytes-rwxr-xr-xtools/i386/netboot/3c90x/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/3c90x/stage2bin111360 -> 0 bytes-rw-r--r--tools/i386/netboot/depca/nbgrubbin106376 -> 0 bytes-rw-r--r--tools/i386/netboot/depca/pxegrubbin107400 -> 0 bytes-rwxr-xr-xtools/i386/netboot/depca/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/depca/stage2bin106440 -> 0 bytes-rw-r--r--tools/i386/netboot/device.map1
-rw-r--r--tools/i386/netboot/eepro/nbgrubbin106472 -> 0 bytes-rw-r--r--tools/i386/netboot/eepro/pxegrubbin107496 -> 0 bytes-rwxr-xr-xtools/i386/netboot/eepro/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/eepro/stage2bin106504 -> 0 bytes-rw-r--r--tools/i386/netboot/eepro100/nbgrubbin109408 -> 0 bytes-rw-r--r--tools/i386/netboot/eepro100/pxegrubbin110432 -> 0 bytes-rwxr-xr-xtools/i386/netboot/eepro100/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/eepro100/stage2bin109472 -> 0 bytes-rw-r--r--tools/i386/netboot/epic100/nbgrubbin108160 -> 0 bytes-rw-r--r--tools/i386/netboot/epic100/pxegrubbin109184 -> 0 bytes-rwxr-xr-xtools/i386/netboot/epic100/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/epic100/stage2bin108192 -> 0 bytes-rw-r--r--tools/i386/netboot/exos205/nbgrubbin106560 -> 0 bytes-rw-r--r--tools/i386/netboot/exos205/pxegrubbin107584 -> 0 bytes-rwxr-xr-xtools/i386/netboot/exos205/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/exos205/stage2bin106592 -> 0 bytes-rwxr-xr-xtools/i386/netboot/grubbin355291 -> 0 bytes-rw-r--r--tools/i386/netboot/lance/nbgrubbin108512 -> 0 bytes-rw-r--r--tools/i386/netboot/lance/pxegrubbin109536 -> 0 bytes-rwxr-xr-xtools/i386/netboot/lance/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/lance/stage2bin108512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/makeImages31
-rwxr-xr-xtools/i386/netboot/make_boot_network17
-rw-r--r--tools/i386/netboot/menu.lst.example21
-rw-r--r--tools/i386/netboot/ne/nbgrubbin106280 -> 0 bytes-rw-r--r--tools/i386/netboot/ne/pxegrubbin107304 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ne/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ne/stage2bin106344 -> 0 bytes-rw-r--r--tools/i386/netboot/ne2100/nbgrubbin106620 -> 0 bytes-rw-r--r--tools/i386/netboot/ne2100/pxegrubbin107644 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ne2100/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ne2100/stage2bin106652 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5010/nbgrubbin105608 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5010/pxegrubbin106632 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ni5010/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5010/stage2bin105640 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5210/nbgrubbin106336 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5210/pxegrubbin107360 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ni5210/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ni5210/stage2bin106368 -> 0 bytes-rw-r--r--tools/i386/netboot/ni6510/nbgrubbin106588 -> 0 bytes-rw-r--r--tools/i386/netboot/ni6510/pxegrubbin107612 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ni6510/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ni6510/stage2bin106620 -> 0 bytes-rw-r--r--tools/i386/netboot/ns8390/nbgrubbin108664 -> 0 bytes-rw-r--r--tools/i386/netboot/ns8390/pxegrubbin109688 -> 0 bytes-rwxr-xr-xtools/i386/netboot/ns8390/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/ns8390/stage2bin108696 -> 0 bytes-rw-r--r--tools/i386/netboot/otulip/nbgrubbin108484 -> 0 bytes-rw-r--r--tools/i386/netboot/otulip/pxegrubbin109508 -> 0 bytes-rwxr-xr-xtools/i386/netboot/otulip/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/otulip/stage2bin108516 -> 0 bytes-rw-r--r--tools/i386/netboot/rtl8139/nbgrubbin108000 -> 0 bytes-rw-r--r--tools/i386/netboot/rtl8139/pxegrubbin109024 -> 0 bytes-rwxr-xr-xtools/i386/netboot/rtl8139/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/rtl8139/stage2bin108000 -> 0 bytes-rw-r--r--tools/i386/netboot/sis900/nbgrubbin112392 -> 0 bytes-rw-r--r--tools/i386/netboot/sis900/pxegrubbin113416 -> 0 bytes-rwxr-xr-xtools/i386/netboot/sis900/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/sis900/stage2bin112392 -> 0 bytes-rw-r--r--tools/i386/netboot/sk_g16/nbgrubbin106500 -> 0 bytes-rw-r--r--tools/i386/netboot/sk_g16/pxegrubbin107524 -> 0 bytes-rwxr-xr-xtools/i386/netboot/sk_g16/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/sk_g16/stage2bin106532 -> 0 bytes-rw-r--r--tools/i386/netboot/smc9000/nbgrubbin106976 -> 0 bytes-rw-r--r--tools/i386/netboot/smc9000/pxegrubbin108000 -> 0 bytes-rwxr-xr-xtools/i386/netboot/smc9000/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/smc9000/stage2bin106976 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.3c59xbin512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.3c90xbin512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.eepro100bin512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.rtl8139bin512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.tulipbin512 -> 0 bytes-rwxr-xr-xtools/i386/netboot/stage1.via-rhinebin512 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.3c59xbin80564 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.3c90xbin111100 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.eepro100bin107584 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.rtl8139bin108028 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.tulipbin94396 -> 0 bytes-rw-r--r--tools/i386/netboot/stage2.via-rhinebin88208 -> 0 bytes-rw-r--r--tools/i386/netboot/tiara/nbgrubbin105188 -> 0 bytes-rw-r--r--tools/i386/netboot/tiara/pxegrubbin106212 -> 0 bytes-rwxr-xr-xtools/i386/netboot/tiara/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/tiara/stage2bin105252 -> 0 bytes-rw-r--r--tools/i386/netboot/tulip/nbgrubbin119404 -> 0 bytes-rw-r--r--tools/i386/netboot/tulip/pxegrubbin120428 -> 0 bytes-rwxr-xr-xtools/i386/netboot/tulip/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/tulip/stage2bin119404 -> 0 bytes-rw-r--r--tools/i386/netboot/w89c840/nbgrubbin109356 -> 0 bytes-rw-r--r--tools/i386/netboot/w89c840/pxegrubbin110380 -> 0 bytes-rwxr-xr-xtools/i386/netboot/w89c840/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/w89c840/stage2bin109388 -> 0 bytes-rw-r--r--tools/i386/netboot/wd/nbgrubbin106760 -> 0 bytes-rw-r--r--tools/i386/netboot/wd/pxegrubbin107784 -> 0 bytes-rwxr-xr-xtools/i386/netboot/wd/stage1bin512 -> 0 bytes-rw-r--r--tools/i386/netboot/wd/stage2bin106792 -> 0 bytes-rwxr-xr-xtools/i386/shbin153752 -> 0 bytes-rwxr-xr-xtools/ia64/e2fsck.sharedbin1060504 -> 0 bytes-rwxr-xr-xtools/ia64/elilo.efibin315800 -> 0 bytes-rwxr-xr-xtools/mailchangelog.pl14
-rw-r--r--tools/make_lang_png_transparent.c167
-rwxr-xr-xtools/make_mdkinst_stage285
-rwxr-xr-xtools/mkhdlist16
-rw-r--r--tools/ntp_servers.pl303
-rwxr-xr-xtools/oem-prepare477
-rwxr-xr-xtools/patch_pcmcia_config.pl28
-rw-r--r--tools/ppc/README39
-rwxr-xr-xtools/ppc/Xpmacbin3762427 -> 0 bytes-rwxr-xr-xtools/ppc/convert5
-rw-r--r--tools/ppc/e2fsck.sharedbin101469 -> 0 bytes-rwxr-xr-xtools/ppc/magic89
-rwxr-xr-xtools/ppc/mapping29
-rwxr-xr-xtools/ppc/mkINSTALLCD80
-rwxr-xr-xtools/ppc/mkhybrid-1.12b5.4bin488623 -> 0 bytes-rwxr-xr-xtools/ppc/mkhybrid-1.12b5.4-x86bin194471 -> 0 bytes-rw-r--r--tools/ppc/yabootbin58556 -> 0 bytes-rw-r--r--tools/shift_all.pl113
-rw-r--r--tools/shift_img.c165
-rwxr-xr-xtools/sparc/e2fsck.sharedbin125624 -> 0 bytes-rwxr-xr-xtools/specific_arch9
-rwxr-xr-xtools/syncrpms267
-rwxr-xr-xtools/update_images52
-rwxr-xr-xtools/updatehdlist10
-rwxr-xr-xtools/x86_64/busyboxbin74064 -> 0 bytes-rw-r--r--tools/xhost+.c11
2240 files changed, 38190 insertions, 293865 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 2a8035f11..000000000
--- a/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-docs
-images
-unused
-drakxtools.tar.bz2
-isolinux
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 434a5a0eb..000000000
--- a/Makefile
+++ /dev/null
@@ -1,91 +0,0 @@
-ROOTDEST = /export
-
-DIRS = tools kernel mdk-stage1 perl-install rescue
-
-
-ARCH := $(patsubst i%86,i386,$(shell uname -m))
-ARCH := $(patsubst sparc%,sparc,$(ARCH))
-
-.PHONY: dirs install
-
-install: dirs images rescue install_only
-
-dirs:
- @for n in $(DIRS); do $(MAKE) -C $$n all || exit 1 ; done
-
-images:
- ./make_boot_img
-
-tar: clean
- rpm -qa > needed_rpms.lst
- cd .. ; tar cfj gi.tar.bz2 gi
- rm needed_rpms.lst
-
-install_only:
- for i in images misc Mandrake Mandrake/base Mandrake/share; do install -d $(ROOTDEST)/$$i ; done
- ifneq (ppc,$(ARCH))
- cp -f images/* $(ROOTDEST)/images
- endif
- ifeq (alpha,$(ARCH))
- cp -f images/* $(ROOTDEST)/boot
- cp -f vmlinux.gz $(ROOTDEST)/boot/instboot.gz
- make -C tools/$(ARCH)/cd install ROOTDEST=$(ROOTDEST)
- endif
- cd $(ROOTDEST)/images; rm -rf alternatives
- if [ `ls $(ROOTDEST)/images/*.img-* 2>/dev/null | wc -l` -gt 0 ]; then \
- cd $(ROOTDEST)/images; mkdir alternatives; cd alternatives; mv ../*.img-* .; md5sum *.img-* > MD5SUM; \
- fi
- cd $(ROOTDEST)/images; md5sum *.{img,iso}* > MD5SUM
-
- ifeq (i386,$(ARCH))
- rm -rf $(ROOTDEST)/isolinux
- cp -af isolinux $(ROOTDEST)
- endif
-
- ifeq (x86_64,$(ARCH))
- rm -rf $(ROOTDEST)/isolinux
- cp -af isolinux $(ROOTDEST)
- endif
-
- make -C perl-install full_stage2
- make -C perl-install/share/advertising install
- make -C rescue install
-
-clean:
- rm -rf images all.modules all.modules64
- for i in $(DIRS); do make -C $$i clean; done
- find . -name "*~" -o -name ".#*" | xargs rm -f
-
-check:
- @badrights=`find $(ROOTDEST)/Mandrake/mdkinst | perl -lne 'print if !((stat)[2] & 4)'`; [ -z "$$badrights" ] || { echo "bad rights for files vvvvvvvvvvvvvvvvvvvvvvvvvv" ; echo "$$badrights" ; echo "bad rights for files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" ; exit 1; }
- @missing_kb=`find -name "Entries" | xargs perl -F/ -alne 'print $$ARGV =~ m|(.*)/CVS|, "/$$F[1]" if $$F[1] =~ /\.(png|gif|bmp|xcf|gz|bz2|tar|rdz|so|a|o|mar|img|exe)$$/ && $$F[4] ne "-kb"'` ; [ -z "$$missing_kb" ] || { echo "missing -kb in CVS for files vvvvvvvvvvvvvvvvvvvvvvvvvv" ; echo "$$missing_kb" ; echo "missing -kb in CVS for files ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" ; exit 1; }
- $(MAKE) -C perl-install check
-
-upload:
- $(MAKE) clean
-
-# # done before make install to increment ChangeLog version
- tools/addchangelog.pl tools/cvslog2changelog.pl | tools/mailchangelog.pl &
-
- $(MAKE) install
- $(MAKE) check
- $(MAKE) upload_only
-
-upload_only:
- function upload() { rsync -qSavz --verbose --exclude '*~' -e ssh --delete $(ROOTDEST)/$$1/$$2 mandrake@ken:/c/cooker/$$1; } ;\
- upload Mandrake/mdkinst '' ;\
- upload Mandrake/base compssUsers* ;\
- upload Mandrake/base rpmsrate ;\
- upload Mandrake/base *_stage2.bz2 ;\
- upload Mandrake/share/advertising '' ;\
- upload misc gendistrib ;\
- upload misc make_mdkinst_stage2 ;\
- upload misc packdrake ;\
- upload misc packdrake.pm ;\
- upload misc auto ;\
- upload images MD5SUM ;\
- upload images *.img* ;\
- upload images *.iso* ;\
- upload images/alternatives '' ;\
- upload isolinux '' ;\
- echo
diff --git a/advanced.msg.xml b/advanced.msg.xml
deleted file mode 100644
index f49bb7fe8..000000000
--- a/advanced.msg.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<document>
-The following install types may be used instead of previously notified :
- o <white>vgahi</white> for high resolution graphical installation.
- o <white>vga16</white> for 640x480 in 16 colors graphical installation.
-
-The following options may be added on the command line :
- o <white>readonly=1</white> to disable editing disk partitions.
- o <white>display=ackbar:0</white> to export display to <blue>ackbar</blue> machine screen 0 during
- installation.
- o <white>noauto</white> to disable automatic detection (generally used with <white>expert</white>).
- o <white>security=n</white> to set security level to value <blue>n</blue>.
- o <white>updatemodules</white> to use the special update floppy containing modules updates.
- o <white>patch</white> to use a patch from the floppy (file named <blue>patch.pl</blue>).
- o <white>auto_install=floppy</white> to enable auto_install using <blue>auto_inst.cfg</blue> file on the
- floppy.
- o <white>memtest</white> to test your computer RAM for faulty memory modules.
-</document>
diff --git a/docs/.cvsignore b/docs/.cvsignore
deleted file mode 100644
index a0593a470..000000000
--- a/docs/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-pictures
diff --git a/docs/9.0_errata.txt b/docs/9.0_errata.txt
deleted file mode 100644
index 4fec8885c..000000000
--- a/docs/9.0_errata.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-# This file contains all the bugs/glitches/inconsistencies shipped in
-# 9.0 (Dolphin) Mandrake Linux Release.
-
-# Feel free to add your entry and if possible the fixes and status of
-# the errata.
-
- o Drakxtools:
- ==========
-
- widget libraries:
-
- In both XFdrake and printerdrake pop up small, empty, gray windows when
- clicking in the main menu. STATUS: Not fixed.
-
- Scroll bars and widget sizes often not correct (visible primarily in the
- printer options step of the "Add printer" wizard of printerdrake. STATUS:
- Not fixed.
-
- harddrake:
-
- logdrake:
- IS: Send the alert mail when service is stopped but the mail
- is empty.
- SHOULD BE: incorporate a text on which service is stopped.
- Status: not fixed.
-
- o Drakconf:
- =========
- IS: locale nl_NL, sl and zh_CN prevent drakconf from starting with
- a "cannot call set_active on undefined values" error.
-
- SHOULD BE: work well in all locales.
-
- a workaround has been comitted
-
- o Drakfont:
- =========
-
- drakfont get stopped in stat64("/mnt/nt/winnt/fonts/8514oem.fon",
- ...) on ntfs partitions.
- there's a bug in ntfs.o fs module of the kernel
-
- o Install:
- ========
-
- o urpmi:
- ======
-
- "urpmi mplayer" shows a list of libraries it needs and asks whether
- to install all this, after saying "y", it says that all these
- packages are missing and fails (I have shown it to François and he
- says that is a bug with the "contribs". He had to regenerate the
- hdlists somehow. STATUS: Not fixed.
-
- o XFree 4.2.x:
- ============
-
- Touchpad mouse on my Asus S8600 notebook. Worked out-of-the-box
- with Mandrake 8.2, but in 9.0 I cannot do any dragging operation
- with the PS/2-"Standard" mouse setting. I switched to "Glidepoint"
- with mousedrake and then dragging works, but the emulation of the
- third button by pressing both buttons not. Adding the lines
-
- Option "Emulate3Buttons"
- Option "Emulate3Timeout" "50"
-
- to the mouse section of /etc/X11/XF86Config-4 manually fixes the
- middle-button problem. STATUS: Not fixed.
-
-
-
- Sometimes, XFree86 can cause sound glitches because of intensive
- pci bus usage.
- Adding the line
-
- Option "PciRetry" "true"
-
- to the "Device" section /etc/X11/XF86Config-4 fixes these boxes.
-
-
- I810 driver is bogus: when Xrender extension is in use (antialiased
- fonts), X11 may crash upon vt switch.
- is fixed in devel branch of cvs
-
-
- o Printer drivers:
- ================
-
- "Best Grayscale" mode of HP DeskJet 6xx and Apollo printers does
- not work. STATUS: Fixed on linuxprinting.org, needs to be packaged
- in "printer-drivers".
-
-o kernel:
- =======
-
- Sometimes reboot stops on "illegal seek" message (having /usr on /
- fs fix it)
-
- Sometimes process get blocked in D-state on ntfs partitions (see
- drakfont)
-
- i810_audio mistakely say to modules.pm through modules.*map it
- handles nforces whereas it lacks some workaround nvidia and alsa
- uses.
- workaround: perl-install/patch/patch-nforce.pl
-
- snd-via686 is said to produce background noise since alsa-0.9.0rc3
- workaround: switch to via82cxxx_audio (oss driver) through draksound
diff --git a/docs/9.1_errata.txt b/docs/9.1_errata.txt
deleted file mode 100644
index fa73c200e..000000000
--- a/docs/9.1_errata.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-# This file contains all the bugs/glitches/inconsistencies shipped in
-# 9.1 (Bamboo) Mandrake Linux Release.
-
-# Feel free to add your entry and if possible the fixes and status of
-# the errata.
-
-
- o DrakConf:
- =========
-
- - #2439: menudrake failled to run for users other than root and
- xserver owner
-
- - #3415: do not kill "explicitely non embeddable" processes when
- killing embedded tools
-
- both fixed in 9.1-12mdk
-
-
-
- o DrakxTools:
- ===========
- - drakconnect:
- o ltmodem support is missing from mdk9.1 [added in hp release]
- o various other fixes came into mdk4hp release
-
- - explanations: most common ones are not logged because of a
- standalone.pm vs common.pm methods overloading bug [not yet
- fixed]
-
- - harddrake-ui:
- o menu entry starts logdrake instead of harddrake's gui [fixed in
- cvs]
- o status bar is not cleared on config tool exit [fixed in cvs]
- o title bar miss some spaces in french locale [fixed in cvs]
-
- - harddrake service: 5 second timeout was too short so it was
- increased up to 25 seconds [in hp release]
-
- - localedrake/drakx: legal problem with rpc vs hong-kong||taiwan
- [fixed in hp release]
-
-
-
- o Kernel:
- =======
-
- - ntfs driver has a hang, additionally also causing 100% cpu usage
- if either the size of the ntfs filesystem or the number of MFT
- entries fell to a certain range and statfs() system call was
- invoked by an application (e.g. df, gnome system monitor, etc).
- see #3353
-
- it got fixed quickly but unfortunately too late for us
-
- the probability one hits this bug is 0.2% or every 512th users.
-
- updated ntfs driver (2.1.2a) is at the usual place,
-
- http://linux-ntfs.sourceforge.net/
-
- or more precisely,
-
- http://sourceforge.net/project/showfiles.php?group_id=13956
-
diff --git a/docs/BUGS b/docs/BUGS
deleted file mode 100644
index 1d154fcf1..000000000
--- a/docs/BUGS
+++ /dev/null
@@ -1,10 +0,0 @@
-doInstallStep: if there's not enough room, error, but packages are marked installed :(
-
-when you click directly on setupFilesystems and you have scsi, you're fucked.
-Even if you go to setupSCSI, you won't be able to have partitions again.
-
-bug non reproductible:
-- /etc/passwd is empty after `root passwd' stage :(
-- reboot at the end of package installation with a lot of error messages from
-gtk about the progressbar
-
diff --git a/docs/COPYING b/docs/COPYING
deleted file mode 100644
index 60549be51..000000000
--- a/docs/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/docs/HACKING b/docs/HACKING
deleted file mode 100644
index ca3704d4a..000000000
--- a/docs/HACKING
+++ /dev/null
@@ -1,143 +0,0 @@
--=-=--
-DrakX is a very big project, and it needs special setups to work.
-The purpose of this file is to explain how you can setup your box to make it
-compile and run.
--=-=--
-
-Beware, don't try this on a production machine with important data.
-
-
---------------------------------------------------------------------------
-Sources installation:
-
-First grab the gi.tar.bz2 archive and untar it in your home directory, for
-example from DrakX-*.src.rpm on your Mandrake Linux distribution.
-
-Fix a few things:
-% find gi -name "*/CVS/root/*" | xargs perl -pi -e 's/prigaux/anoncvs/'
-
-Then, log yourself into the cvs:
-% export CVS_RSH=ssh
-% export CVSROOT=:ext:anoncvs@cvs.mandrakesoft.com:/cooker
-% cvs checkout gi
-        (the passwd is: 'cvs')
-
-And update the gi package:
-% cvs update -P -d gi
-
-
---------------------------------------------------------------------------
-Preparing the compilation process:
-
-(1) target directory
-
-Create a top level directory called /export and give write permissions to
-the user/group that will be compiling DrakX.  It is also suggested that you
-copy a recent Mandrake Linux CD in there. (You don't have to put have all
-the RPMS...) ; you'll need roughly 1.5 Gbytes for a full install. (It is
-possible to not have a copy of Mandrake Linux there, if all you desire is to
-compile gi)
-
-
-(2) support directories
-
-You will need to create a top level /RPMS directory.  This directory needs
-to be populated with the following RPMS:
-locales-ja locales-ko locales-zh
-
-GI needs to be informed about which kernel(s) is/are to be used.
-Most of the time, no manual install is needed. Just be sure to
-have the BOOT kernel(s) in /RPMS, and typing make later on will
-extract the package(s) and build stuff from it.
-
-FYI, for each kernel, directories will be populated as follows:
-
-gi/kernel/all.kernels/2.6.0
- containing all files from the said kernel RPM package
-
-gi/kernel/all.modules/2.6.0
- containing all modules, and special files containing
- modules for stage1 (*.mar)
-
-gi/kernel/all.modules/
- containing a special file containing modules for stage1
- (*.cz*)
-
-Note: the modules must not be in compressed form (*.gz *.bz2 etc)
-
-
-(3) required rpm packages
-
-You need quite a number of rpm packages installed on your system
-to build gi properly. Roughly:
-
-emacs gcc make glibc-devel glibc-static-devel perl-devel XFree86
-XFree86-FBDev XFree86-VGA16 XFree86-devel libglib-devel
-libgtk+-devel perl-GTK ldetect ldetect-devel ldetect-lst
-ldetect-lst-devel libslang-devel libnewt-devel e2fsprogs
-libext2fs2-devel dosfstools rpm-devel rpmtools libbzip2_1
-libbzip2_1-devel libncurses5 libncurses5-devel setserial telnet
-parted raidtools pciutils mt-st gpart reiserfsprogs jfsprogs
-xfsprogs extipl pcmcia-cs gettext perl-Gtk2 perl-Glib ash imlib
-fb2png ntfsprogs lm_sensors galaxy-gnome perl-PerlIO-gzip brltty
-lvm2 mkcd perl-URPM glibc-i18ndata
-
-You may need a few others I forgot to mention. If the compilation fails, try
-to understand the message and install any necessary remaining package.
-
-
-(4)
-
-NEVER build or run Drakx as root.  Install sudo and setup the following
-permissions in /etc/sudoers:
-
-user ALL=(root)
-NOPASSWD:/usr/bin/patch,NOPASSWD:/bin/rpm,NOPASSWD:/bin/mount,NOPASSWD:/bin/cp,NOPASSWD:/bin/umount,NOPASSWD:/usr/bin/install,NOPASSWD:/bin/rm,NOPASSWD:/bin/mv,NOPASSWD:/bin/tar,NOPASSWD:/bin/cpio,NOPASSWD:/bin/chown,NOPASSWD:/bin/mkdir,NOPASSWD:/usr/bin/strip,NOPASSWD:/bin/mknod
-
-
-(5)
-
-pray
-
-[gc@obiwan ~/cvs/gi] make
-
-
----------------------------------------------------------------------------
-The comments written with #- are automatically stripped out at install.
-
-
----------------------------------------------------------------------------
-testing all:
-
-  go to the perl-install directory and execute ./install2 --test
-
-  NEVER execute DrakX as root! You might need to allow all users
-  to read the block devices of your hard-disks, though (chmod a+w
-  /dev/hda* for example).
-
-
-
-Here is how I (dams) made it work on my computer.
--------------------------------------------------
-
-- get the sources
-- install the librairies needed included newt-devel gtk+-devel popt-devel popt gtk-engines
-- cd path/to/gi
-- make
-- mkdir /usr/share/gtk
-- ln -s path/to/gi/perl-install/share/themes /usr/share/gtk
-- ln -s path/to/gi/perl-install/share/step-* /usr/share
-- ln -s path/to/gi/perl-install/share/help.xpm /usr/share
-- ln -s path/to/gi/perl-install/share/isdn* /etc/sysconfdir/network-scripts
-- have a cd architecture linked on /export
-- ln -s /export /tmp/rhimage
-- export PERL_INSTALL_TEST=1
-- cd path/to/gi/perl-install
-- gendistrib --noclean --distrib /export
-- ./install2 in root (dangerous) or chmod a+r /dev/hd* and ./install2 in user
-
-
-
-address all bugreports to dave@null.com
-
-info has been added by sunny@opencurve.org
diff --git a/docs/Partition-ends-after-end-of-disk.txt b/docs/Partition-ends-after-end-of-disk.txt
deleted file mode 100644
index 3da57d561..000000000
--- a/docs/Partition-ends-after-end-of-disk.txt
+++ /dev/null
@@ -1,66 +0,0 @@
- Cylinder/Head/Size Hell Is Not Over
-
- pixel@mandrakesoft.com
- $Date$
-
-
-Nowadays, you can boot Linux without ever relying on CHS
-(Cylinder/Head/Size):
-
-- CHS information on partition table is obsolete and not used anymore.
-It was causing the 1024th cylinder limitation:
- - disallowing partitions above 8GiG. Problem overcome using 28bits Linear
- Block Addressing (LBA) in partition table.
- - disallowing to boot on partition above 8GiG (due to int13 limitation used
- in bootloaders). Problem overcome using int13 extensions (EDD)
-
-Logical CHS (Cylinder/Head/Size) and physical CHS are not related anymore.
-Especially the size of a hard drive is not a multiple of the number of
-Cylinders.
-
-
-The problem is that many tools still rely somewhat heavily on CHS information.
-- most tools adjust partitions on cylinder boundary
-- some tools compute the size of the disk based on CHS (eg: fdisk)
-
-
-Resulting problems in various tools:
-
-- last partition not cylinder boundary adjusted, and overrun CHS computed size
- - fdisk
- > Total allocated sectors %d greater than the maximum %d
- - cfdisk (need confirmation)
- > FATAL ERROR: Bad primary partition %d: Partition ends after end-of-disk
- or
- > FATAL ERROR: Bad logical partition %d: Partition ends after end-of-disk
- - Partition Magic (version?)
- > Error #109: Partition ends after end of disk
- - Windows <= 98se, Windows Me
- (doesn't like it, what error message?)
-
- Tools handling it correctly:
- - parted and so diskdruid in RedHat >= 7.2 (or is it 7.x?)
- - diskdrake >= Mandrake 8.2
- - Windows XP (need confirmation)
-
- Tools using the full size of the disk, and so causing pbs with fdisk/cfdisk/...:
- - diskdrake == Mandrake 8.2
-
-- disagreement between CHS and linear address
- - parted
- > "Warning: Unable to align partition properly. This probably means that
- > another partitioning tool generated an
- > incorrect partition table, because it didn't have the correct BIOS
- > geometry. It is safe to ignore,but
- > ignoring may cause (fixable) problems with some boot loaders.
- > Ignore Cancel ? C
- - lilo
- > Warning: Kernel & BIOS return differing head/sector geometries for device 0x80
- > Kernel: 38792 cylinders, 16 heads, 63 sectors
- > BIOS: 1023 cylinders, 255 heads, 63 sectors
- > Device 0x2100: Inconsistent partition table, 2nd entry
- > CHS address in PT: 48:0:1 --> LBA (771120)
- > LBA address in PT: 48384 --> CHS (3:3:1)
- > The partition table is *NOT* being adjusted.
-
-
diff --git a/docs/README b/docs/README
deleted file mode 100644
index b298f3603..000000000
--- a/docs/README
+++ /dev/null
@@ -1,396 +0,0 @@
-Well here is a little description of what DrakX needs to work in comparison
-to the RH newt install.
-
-********************************************************************************
-* CVS **************************************************************************
-********************************************************************************
-Like all good free software, DrakX is in CVS :)
-
-You can access it at http://www.mandrakelinux.com/cgi-bin/cvsweb.cgi/gi
-
-or via
-
-export CVS_RSH=ssh
-export CVSROOT=:ext:anoncvs@cvs.mandrakesoft.com:/cooker
-cvs checkout gi
- (enter password 'cvs')
-
-
-This is only read-only access. If you want more, tell me (pixel@mandrakesoft.com)
-
-Alas, all is not in CVS, a lot of things come from rpm packages which you must
-install.
-
-Please note that redoing *all* the stuff is not for the faint of heart. I myself
-sometimes wonder what the whole make does :-%
-Instead, changing some .pm files is quite easy (nice interpreted language)
-
-********************************************************************************
-* Making your custom install ***************************************************
-********************************************************************************
-If you have your own rpms you want to add, or make your own updated cdrom, you
-just have to issue:
-
-% gendistrib --noclean --distrib <DIRS>
-
-Where <DIRS> is the root of all the media that the install will see, this first
-one is the main one :
-
-(1) network or 1-cdrom installs
- DIRS == the root directory of the Distribution
-
-(2) multi-cdrom install
- DIRS == the root directories of all the media that the install will see
-
-``gendistrib'' will scan the file Mandrake/base/hdlists in the main root
-directory (the first one in DIRS) to search for all media used. Typically you
-use Mandrake/RPMS* for RPM packages repository.
-For multi-cd, please use Mandrake/RPMS or Mandrake/RPMS1, Mandrake/RPMS2, etc.
-For one CD or a network/hd volume, please use Mandrake/RPMS.
-
-Optionnally, you can modify ``Mandrake/base/rpmsrate''; this file manages
-the relative importance of the files, and thus their installation or not.
-
-Also, mdkinst_stage2.gz must be remade if you modify files in Mandrake/mdkinst.
-See below for information about these files.
-
-********************************************************************************
-* FILES ************************************************************************
-********************************************************************************
-First here are the different things needed :
-
-Mandrake/base/hdlists
- description of the available install media.
- format is one line for one medium as
- <hdlist_name> <rpms_directory> <description>
- <hdlist_name> should be match regexp /hdlist\S*.cz2?/
- for example (two cd install) you get
- hdlist1.cz Mandrake/RPMS1 Boot CD
- hdlist2.cz Mandrake/RPMS2 Extension CD
-
-Mandrake/base/hdlist*.cz
- table of rpm's headers, referred by ``hdlists''
- their contents can be listed using ``packdrake -l <hdlist_file>'' or
- or ``parsehdlist <hdlist_file>''.
- ! Need to be remade when Mandrake/RPMS* changes (with ``gendistrib'') !
-
-Mandrake/base/depslist.ordered
- for each packages, tell which package it depends on. Also contains the
- size for some (obscure) bloody reasons.
- ! Need to be remade when Mandrake/RPMS* changes !
- (with ``gendistrib --noclean --distrib .'')
-
-Mandrake/base/compssUsers
-
-Mandrake/base/rpmsrate
- ranks and classify packages, so that the installer will know which
- ones to install. format is :
- <intern_group>
- <level> <packages>
- where <intern_group> is a symbolic name used in Mandrake/base/compssUsers* files,
- and <level> defines importance level as described below :
- 5 must have
- 4 important
- 3 very nice
- 2 nice
- 1 maybe
- by default (for non expert), group selects packages for level 4 (important)
- and 5 (must have). export mode add 3 (very nice) level. other level (below 2)
- can only be selected using individual package selection.
-
-Mandrake/mdkinst
- live system used on certain installs. See ``Ramdisk or not'' below for
- more.
-
-Mandrake/base/mdkinst_stage2.bz2
- for the ramdisk. live sytem in ext2 filesystem bzipped2.
- generated from Mandrake/mdkinst tree using misc/make_mdkinst_stage2
- See ``Ramdisk or not'' below for more.
-
-Mandrake/base/rescue_stage2.bz2
- rescue ramdisk. live sytem in ext2 filesystem bzipped2.
- this is the ramdisk loaded when typing rescue on boot prompt.
- there is no live system available, only the ramdisk is used.
-
-images/*.img
- floppy boot images to use with DrakX. Use:
- - cdrom.img for cdrom install
- - network.img + network_drivers.img for ftp/nfs install (non-pcmcia devices)
- - hd_grub.img for hard-disk install (see http://qa.mandrakesoft.com/hd_grub.cgi)
- - pcmcia.img for pcmcia install (see ``PCMCIA install'' below for more)
-
-images/boot.iso
- iso image to burn enabling any install (cdrom/hd/nfs/ftp)
-
-********************************************************************************
-* logs *************************************************************************
-********************************************************************************
-During install, a lot of interesting stuff can be found in different places:
-in consoles and in files. To switch to console 2 for example, do Ctrl-Alt-F2
-from the X install.
-- alt-F1: the stdout of the install. Not very interesting stuff
-- alt-F2: simple shell. Quite a lot of commands are available but as they are
-written in perl (for space), they do not handle the very same options as normal.
-After install, you can do ``chroot /mnt'' to see your system just like after
-rebooting. ``rpm -qa'' works for example.
-- alt-F3: a lot of interesting things. Be carefull, some ``ERROR'' messages are
-not interesting.
-- alt-F4: kernel's place. aka the output of dmesg.
-- alt-F7: the graphical install lives there
-
-- command "bug" puts on floppy lots of interesting stuff.
-- /tmp/stage1.log: same as alt-F3 part when stage1 run (e.g. actions
- before graphical install really begins)
-- /tmp/ddebug.log: (nearly the) same as latter alt-F3 part
-- /tmp/syslog: same as alt-F4
-- /mnt/root/drakx/ddebug.log: at the end of each step, DrakX tries to backup
- /tmp/ddebug.log to /mnt/root/drakx. Available only after mounting of /.
-- /mnt/root/drakx/install.log: the log of the installation (or upgrade) of the rpms
-(just like rpm's /mnt/tmp/(install|upgrade).log)
-- /mnt/root/drakx/auto_inst.cfg.pl: a kickstart file generated at the end of each
-step. Can be used in 2 ways: kickstart install or ``defcfg'' install. Hopefully
-you know about kickstart. ``defcfg'' is a way to customize the default values in
-install. For example, French can be the default language with a qwerty keyboard,
-the auto-partitionning partitions can be changed, the default user class can be
-set to developer (!)...
-
-********************************************************************************
-* po translation files *********************************************************
-********************************************************************************
-DrakX uses .po files for its translation. A script takes the different
-strings out of the .pm files. It generates the DrakX.pot file which contains
-all the english strings to translate.
-To add a new language, you just have to add it to lang.pm (if it's not there
-already) and put the .po in the perl-install/po directory (see ``Ramdisk or
-not'' to know if you have to regenerate the mdkinst_stage2.gz)
-
-********************************************************************************
-* PCMCIA install ***************************************************************
-********************************************************************************
-If the media you use to install is a pcmcia device, use the pcmcia boot disk.
-
-********************************************************************************
-* Ramdisk or not ***************************************************************
-********************************************************************************
-The DrakX install is much bigger than the newt one. So the ramdisk which was
-used is getting big, and costs a lot in memory
-(eg: the mdkinst_stage2 is 14MB - 23/09/99)
-(update! now size is 21MB - 24/01/01)
-(update! now size is 19MB - 26/04/01)
-
-| | newt | DrakX
-|-------+---------+----------------------------------------------------------
-| nfs | live | live
-| ftp | ramdisk | ramdisk
-| http | ramdisk | ramdisk
-| hd | ramdisk | live if Mandrake/mdkinst/usr/bin/runinstall2 is a link,
-| | | ramdisk otherwise
-| cdrom | ramdisk | live if memory < 52MB, ramdisk otherwise
-
-Where ramdisk is needed, if detected memory is below the limit allowed for
-ramdisk (maintained in file gi/mdk-stage1/config-stage1.h; currently 52 Mb),
-a failure dialog will be printed explaining that there is not enough memory
-to perform the installation.
-
-When i say live, it means that the stage1 will *mount* the
-Mandrake/mdkinst and use it that way.
-
-The ramdisk is used in place of the live in some cases. This ramdisk is filled
-with mdkinst_stage2.gz
-
-For cdrom install, the ramdisk is used to speed up things (access time is quite
-high on cdrom drives)
-
-For pcmcia, it depends on the type of install.
-
-
-********************************************************************************
-* modules **********************************************************************
-********************************************************************************
-Modules can be found in at least 2 places:
-- in /modules/modules.mar
-- in /lib/modules.cz<KERNEL_VERSION_RELEASE>
-
-/modules/modules.mar is used in mdk-stage1. It contains only modules
-interesting for one kind of install. For example in an hd install, it
-contains scsi modules. For a network install, it contains network card
-modules. (To create, extract or view files in a ``mar'' archive, please
-use gi/mdk-stage1/mar/mar; this is basically an archive format meant to
-be minimalistic)
-
-/lib/modules.cz<KERNEL_VERSION_RELEASE> contains all modules, it is used
-in stage2.
-
-
-To manually install a module during install, switch to console #2
-and type "modprobe <modulename>". The modprobe program is a perl
-wrapper around /usr/bin/insmod. It uses the dependencies found in
-/modules/modules.dep (stage1).
-
-/usr/bin/insmod is a wrapper around /usr/bin/insmod_. It just extracts the
-module out of /lib/modules.cz in /tmp. Then it calls insmod_.
-
-/usr/bin/insmod_ is the real prog (which you usually find in /sbin/). You need
-to give it the complete path.
-
-********************************************************************************
-* Making screenshots ***********************************************************
-********************************************************************************
-1. easy solution: press "F2"!
-
-2. On a test machine, make a network install, switch to console (ctrl-alt-F2), enter:
-% xhost+
-then, on another computer:
-% DISPLAY=test_machine:0 xwd -root | convert - screenshot.png
-
-********************************************************************************
-* Auto install *****************************************************************
-********************************************************************************
-A powerful auto-install system is available. It allows performing
-an install without any human interaction.
-
-To feed automatic parameters to the stage1 part (the textmode
-part - might not be necessary for you if you plan to do
-cdrom-based auto-installs, but mostly highly needed when doing
-network installs), please refer to ../mdk-stage1/doc/TECH-INFOS.
-
-About the stage2 part (the actual installer, at the time you're
-(usually) running in graphical mode), please refer to the nice
-documentation written by David Eastcott. Either install the
-package "drakx-autoinstall-doc" from contrib, or browse:
-
-http://members.shaw.ca/mandrake/drakx/9.0/HTML/
-
-The previous document will explain you how to setup the contents
-of the auto_inst.cfg file. Note that you have 3 alternatives for
-providing this file:
-- from a floppy disk; use "kickstart=floppy" as kernel parameter,
- as explained in the document
-- from the installation volume itself; put the file in the
- "Mandrake/base" directory of the installation volume; use
- "kickstart" only, or "kickstart=filename" to specify another
- filename than auto_inst.cfg
-- specified by the network; setup your DHCP server to provide the
- "bootfile" parameter, this file will be used as the
- "auto_inst.cfg" file; in this case you also need to provide the
- "netauto" boot parameter
-
-In any case, if the specified file ends with -IP or -IP.pl, IP
-will be substituted by the IP address of the machine, when doing
-a network install. Might be useful so that you can control all
-your auto installs from your server.
-
-********************************************************************************
-* Miscellaneous ****************************************************************
-********************************************************************************
-> o Media access methods: nfs, ftp, http, hd, cdrom
-> o Stages: init, stage1, stage2
-> - What exactly each stage does
-
-init loads stage1
-stage1 loads stage2, from various medium type
-
-stage2 is too big to fit on a floppy, that's why stage1 exists
-
-> - How each stage relates to the various media access methods
-
-stage1 knows only how to access to the media is compiled for. It
-contains only the kernel modules needed for that media. For eg,
-the nfs/ftp/http stage1 (network.img floppy) doesn't contain scsi
-modules nor ide.
-
-> - How one stage terminates and another begins. i.e., How does
-> stage1 find, mount, and launch stage2?
-
- /sbin/init just starts /sbin/stage1, and monitors its
-execution; it's here to cleanly umount the partitions when stage1
-or stage2 dies/finished
-
- /sbin/stage1 takes care of mounting stage2 (in ramdisk if
-necessary) then it execs /usr/bin/runinstall2 (thus, stage2
-replaces stage1, and init then monitors stage2)
-
-> o Text and Graphic mode installers
-> - Architectural overview of each
-
-have a look at gi/docs/object_class.fig
-
-
-********************************************************************************
-* OEM **************************************************************************
-********************************************************************************
-> I am a system OEM in Bangalore,India selling systems bundled with
-> Mandrake Linux. The problem is that with every system I sell, I need to
-> install & configure the system which takes HOURS!. Can I do a diskcopy
-> instead?
->
-> Please Help. This is a major bottleneck for me.
-
-many solutions:
-
-- make an install on drive hdb, then :
- dd if=/dev/hdb of=/dev/hdc
- but you should make sure the hardware is *REALLY* identical.
-
-- try the oem feature
- 3. - burn a cd out of *latest* cooker or 8.0 and above.
- - boot on it telling "oem" to syslinux
- !! it will destroy every data on the harddrive or
- resize (or use free space) if *ONLY* one fat partition is defined !!
- - you now have a very automated install matrix
- (duplicate it with "dd if=/dev/hdb of=/dev/hdc bs=1M count=730")
-
- put the harddrive in the oem box, the user will now have an *very* automated
- install, just asking the root password and user password, and some other
- question according its hardware.
-
- 4. just like 3. but you may have to mount /cdrom after typing rescue on
- syslinux prompt (oem script do it automatically if a automatic boot nfs
- network has been done as server is known). under /cdrom may be anything
- as long as it provides an installation tree of Mandrake Linux.
- after that run oem script by typing "/etc/oem -f" for normal installation
- or "/etc/oem -f server" for server installation (normal with server installed).
-
- 5. (just like 3. without burning a cd, doing the first part by hand)
- have a look at the /etc/oem script on the rescue and do it by hand...
-
-
-cu Pixel, fpons.
-
-
-comments:
-1. maybe copy unnecessary things -> take too long
- solution -> use bs=8k count=xxxx
-2. kernel_reread can be found on the new rescue, source is also at end of this
-mail. This solution works with one partition. Can be easily enhanced to many
-primary partitions... For extended partitions, more complicated, but not much :)
-3. has just been added in latest cooker. It may still have some pb. The main
-current limitation is IDE only, though it can be fixed easily for special cases.
-
---------------------------------------------------------------------------------
-#include <stdio.h>
-#include <sys/mount.h>
-#include <fcntl.h>
-
-void die(char *msg)
-{
- perror(msg);
- exit(1);
-}
-
-void kernel_read(char *dev)
-{
- int fd;
- if ((fd = open(dev, O_RDONLY)) == -1) die("can't open device");
- ioctl(fd, BLKRRPART, 0);
- close(fd);
-}
-
-int main(int argc, char **argv)
-{
- if (argc != 2) {
- fprintf(stderr, "usage: kernel_read_part <hard drive device>\n");
- exit(1);
- }
- kernel_read(argv[1]);
-}
diff --git a/docs/README.devel b/docs/README.devel
deleted file mode 100644
index 989946de9..000000000
--- a/docs/README.devel
+++ /dev/null
@@ -1,252 +0,0 @@
-Well here is a little description of how DrakX can be modified or extended.
-Please refer to README file for getting DrakX code source and to known more
-exactly how it works and what it can do.
-
-
-********************************************************************************
-* Execution of DrakX ***********************************************************
-********************************************************************************
-DrakX has originally be written by pixel in perl and C.
-entry point for stage2 is /usr/bin/runinstall2 which is typically a link to
-/usr/bin/install2 which simply load module install2.pm and execute
-install2::main with @ARGV.
-
-install2::main parse command line arguments, prepare installation, find the right
-install_interactive class (take a look at gi/docs/object_class.fig) according to
-command line, memory available and if the interactive chosen is initializing
-correctly, else it will try a less-demanding interactive object.
-Once done, $::o is set to this install & interactive object and main runs the
-various step of install2 defined in $o->{steps}, starting with $o->{steps}{first}
-and iterating with method install_any::getNextStep().
-while running step, it trap any errors that may arise and use perl exception to
-change step.
-
-********************************************************************************
-* DrakX modules descriptions ***************************************************
-********************************************************************************
-Here is a brief description of what each modules of DrakX is doing.
-
-install2: main module of DrakX as described above, main loop execution of DrakX.
-
-install_steps: generic installation module containing steps definition, all steps
- should always be defined here as some methods may be used on automatic mode.
- there is no interactivity available. typically are defined base operation for
- configuring each step according to $o.
-
-install_steps_interactive: generic installation module with generic interative
- methods. typically are found all interactive code of DrakX for each steps.
-
-install_steps_auto_install: implementation installation module without interactive
- methods to match auto_install mode. this is the simplest as almost no method are
- redefined (inherit module install_steps only, compared to other implementation
- modules described below).
-
-install_steps_stdio: implementation installation module with interactive stdio
- methods to match stdio mode. inherit modules install_steps_interactive and
- interactive_stdio.
-
-install_steps_newt: implementation installation module with interactive newt
- methods to match newt mode. inherit modules install_steps_interactive and
- interactive_newt.
-
-install_steps_gtk: implementation installation module with interactive gtk
- methods to match gtk mode. inherit modules install_steps_interactive and
- interactive_gtk.
-
-install_any: contains various methods using generic interactive interface but
- not used by standalone tools.
-
-install_gtk: contains various methods using gtk interface but not used by
- standalone tools.
-
-interactive_stdio: implementation methods for interactivity in stdio mode.
- inherit module interactive.
-
-interactive_newt: implementation methods for interactivity in newt mode.
- inherit module interactive.
-
-interactive_gtk: implementation methods for interactivity in gtk mode.
- inherit module interactive.
-
-my_gtk: basic gtk access methods.
-
-any: contains various methods using generic interactive interface. to compare
- against install_any module as this one is available for standalone tools.
-
-class_discard: simple module that implement every methods undefined to return
- nothing. this trick is used to ensure no undefined method can arise when using
- code that reference interactive method which are not defined.
-
-common: contains very simple and very usefull (common) methods to do various task.
- some methods inspired by functionnal language.
-
-c: contains wrapper to C definition of methods used by DrakX, use of C is necessary
- for C extern libraries interface (rpmlib, ldetect), kernel interface, XFree
- interface.
-
-commands: implement some un*x commands, conflicting name with perl contains
- trailing underscore (_). this module is used by commands perl script that
- determine which command to run according to $0 (this is used this way when DrakX
- is running).
-
-run_program: allow running a program with redirection but without using a shell.
- allow rooted execution.
-
-help: contains all help message displayed by DrakX.
-
-log: log facility methods.
-
-lang: language manipulation methods, get and set sysconfig file, load po.
-
-keyboard: keyboard manipulation methods, get and set sysconfig file, set console
- keyboard mapping.
-
-mouse: mouse manipulation methods, get and set sysconfig file, change mouse.
-
-timezone: time zone manipulation methods, get and set timezone.
-
-services: services manipulation methods, activate or delete services (see
- /etc/rc.d/init.d directories).
-
-detect_devices: manage detection of various class of hardware.
-
-devices: manage device file, create device special according device name.
-
-partition_table: base partition table management methods, it manages
- appriopriate partition_table_XXX object according to what has been read
- as XXX partition table type.
-
-partition_table::bsd: matches a BSD partition table.
-
-partition_table::dos: matches a DOS partition table.
-
-partition_table::emtpy: matches an empty partition table.
-
-partition_table::mac: matches an Apple partition table.
-
-partition_table::raw: generic class for the following partition_table::XXX.
-
-partition_table::sun: matches a Sun Label partition table.
-
-fs: read and write /etc/fstab file, mount and umount, format.
-
-fsedit: manage (modyfy, edit) mount point associated to partition (like editing
- /etc/fstab).
-
-swap: swap management methods, format and mount (activation).
-
-raid: raid (software only) management methods.
-
-lvm: lvm (Logical Volume Manager) management methods.
-
-loopback: loopback management methods, used for lnx4win type installation or using
- a file as a partition.
-
-diskdrake: diskdrake itself, disk graphical (using gtk) manipulation tools.
-
-ftp: ftp mangement methods, used when using ftp install.
-
-http: http management methods, used when using http install.
-
-modparm: kernel modules options management, allow building nice dialog with each
- module parameter available.
-
-modules: kernel modules management, allow loading or unloading (ala modprobe or
- insmod).
-
-printer: printer management methods, read and write both LPR or CUPS configuration.
-
-printerdrake: interactive printer management methods.
-
-network: network management methods, get and set sysconfig file.
-
-netconnect: network configuration wizard.
-
-netconnect_const: network configuration wirard data.
-
-Xconfig: X configuration (monitor + already existing config file) management.
-
-Xconfigurator: X configuration wizard.
-
-Xconfigurator_const: X configuration wizard data.
-
-booloader: bootloader (LILO, GRUB, LOADLIN, SILO) configuration management methods.
-
-pkgs: rpm package and hdlist, depslist management methods, allow selecting or
- unselecting packages, manage rpmsrate file and select group, installation and
- removal methods of rpm file.
-
-crypto: *obsoleted* module to manage crypto site and rpm file.
-
-standalone: standalone only, allow defining a standalone tools.
-
-bootlook: standalone only, interface with DrakConf to configure bootloader options.
-
-drakfirewall: standalone only, interface with DrakConf to configure a tiny firewall.
-
-********************************************************************************
-* DrakX FAT resizer module description *****************************************
-********************************************************************************
-here is a fat resizer written in perl and C used by DrakX (diskdrake) to resize
-FAT16/FAT32 partition. it moves clusters to make sure a shrink can be done on the
-limit of the partition itself, if no cluster need to be moved, only boot sector
-partition limit are modified.
-
-any: various methods to flag cluster, compute min size.
-
-boot_sector: boot sector management methods.
-
-c_rewritten: originally resize_fat was only perl, this contains code section that
- are the most sensible to speed or memory contraints and have been rewritten to C
- using perl extension.
-
-dir_entry: manage directory structure.
-
-directory: traverse directory recursively, needed to move correctly cluster.
-
-fat: manage fat structure.
-
-info_sector: manage info sector.
-
-io: manage I/O on disk (need to take care of big file as partition size may be
- larger than 2GB).
-
-main: main resizer algortihm. if needed allocate new clusters, copy files, copy
- directories. update boot sector info.
-
-********************************************************************************
-* Adding a new step to DrakX ***************************************************
-********************************************************************************
-Say we want to add a question for setting "alawindows" option.
-We put it pretty early in the install, let's say after "Select Installation
-Class".
-
-1. in install2.pm
-
-add
-
- selectAlawindows => [ __("A la windows or not"), 0, 1, '' ],
-
-after
-
- selectInstallClass => [ __("Select installation class"), 1, 1, '' ],
-
-the 0, 1, '' means not "redoable", "skip on error", "don't hide"
-
-2. add your function selectAlawindows in install2.pm
-
-sub selectAlawindows { $o->selectAlawindows }
-
-3. add your function selectAlawindows in install_steps_interactive.pm
-
-sub selectAlawindows {
- my ($o) = @_;
- $o->{alawindows} = $o->ask_yesorno('', _("Throw everything away as windobe does?"), 1);
-}
-
-4. add your function selectAlawindows in install_steps.pm (not needed in that
-case, except for auto_install)
-
-sub selectAlawindows {}
-
-
diff --git a/docs/README.pxe b/docs/README.pxe
deleted file mode 100644
index 2ddd205fe..000000000
--- a/docs/README.pxe
+++ /dev/null
@@ -1,133 +0,0 @@
-Here is a short description to configure a PXE server using dhcpd and tftpd.
-This allows a network boot for your ethernet card conforming to the Interl
-PXE specification.
-
-********************************************************************************
-********** General overview ************
-********************************************************************************
-
-You need a dhcp server and a tftp server on one or two machines to allow the
-network boot. We are not using a PXE server to achieve this as it is not
-mandatory.
-You can install tftp-server and dhcp-server package from the Mandrake
-distribution for example.
-
-On the server machine at 192.168.2.1, you will find a "/etc/dhcpd.conf" sample
-file written by Florin Grad <florin@mandrakesoft.com>, where "mydomain.com" is
-assumed to be your domain name, and 192.168.1.1 a name server. All install are
-done on subnet 192.168.2.0.
-
-All the files that will be downloaded by the tftp daemon are located under
-"/tftpboot" :
- "/tftpboot/pxelinux.0" is a program that is loaded directly by the machine
- where a network boot will be done, this program comes
- from the SYSLINUX package by H. Peter Anvin. (look at
- http://syslinux.zytor.com/pxe.php for more information)
- "/tftpboot/pxelinux.cfg/" is a directory where all configuration file for
- pxelinux.0 will be found, pxelinux.0 will download
- these file by itself. It searches first for a file
- named accordind to the machine IP address in
- hexadecimal, for example for 192.168.2.20, it
- looks for "C0A80214" first, then "C0A8021" and so
- on down to "C0", "C" and "default".
- "/tftpboot/network.rdz" is the standard network initrd for Mandrake installation.
- "/tftpboot/vmlinuz" is the boot kernel for installation.
- "/tftpboot/help.msg" is the message displayed by pxelinux.0, note that currently
- graphical message (as for install using SYSLINUX 1.48 with
- graphic patch by Mandrake) is not supported.
-
-All file "network.rdz", "vmlinuz", "help.msg" can be found by mounting "network.img",
-or the network floppy disk used for install, "pxelinux.cfg" is just an adaptation
-of the file found on the "network.img" called "syslinux.cfg" but without the reference
-to boot.msg (as it is not currently supported).
-
-Update network configuration for your needs and start dhcp server on the machine and
-tftp server and this should work.
-
-********************************************************************************
-* /etc/dhcpd.conf **************************************************************
-********************************************************************************
-ddns-update-style ad-hoc;
-
-authoritative;
-
-option space PXE;
-option PXE.mtftp-ip code 1 = ip-address;
-option PXE.mtftp-cport code 2 = unsigned integer 16;
-option PXE.mtftp-sport code 3 = unsigned integer 16;
-option PXE.mtftp-tmout code 4 = unsigned integer 8;
-option PXE.mtftp-delay code 5 = unsigned integer 8;
-option PXE.discovery-control code 6 = unsigned integer 8;
-option PXE.discovery-mcast-addr code 7 = ip-address;
-
-default-lease-time 28800;
-max-lease-time 86400;
-
-option domain-name "mydomain.com";
-option domain-name-servers 192.168.1.1;
-
-class "PXE" {
- match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
- option vendor-class-identifier "PXEClient";
-
- vendor-option-space PXE;
- option PXE.mtftp-ip 0.0.0.0;
- next-server 192.168.2.1; #tftp server location
-
- filename "pxelinux.0"; # standard TFTP
-
-}
-
-shared-network "mynetwork" {
- subnet 192.168.2.0 netmask 255.255.255.0 {
- option subnet-mask 255.255.255.0;
- option routers 192.168.2.1;
-
- ddns-domainname = "mydomain.com";
-
- pool {
- range 192.168.2.10 192.168.2.20;
- allow members of "PXE";
- }
- }
-}
-********************************************************************************
-* /tftpboot/pxelinux.cfg/default ***********************************************
-********************************************************************************
-default linux
-prompt 1
-timeout 72
-display help.msg
-label linux
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 vga=788
-label vgalo
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 vga=785
-label vgahi
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 vga=791
-label vga16
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 vga16
-label text
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 text
-label patch
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 patch vga=788
-label expert
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 expert vga=788
-label rescue
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz root=/dev/ram3 rescue rw
-label oem
- kernel vmlinuz
- append ramdisk_size=32000 initrd=network.rdz automatic=method:cdrom root=/dev/ram3 rescue oem rw
-********************************************************************************
-* Usefull linkst ***************************************************************
-********************************************************************************
-
-http://syslinux.zytor.com/pxe.php
-http://www.kano.org.uk/projects/pxe/
diff --git a/docs/SHORTCUTS b/docs/SHORTCUTS
deleted file mode 100644
index 93a7133db..000000000
--- a/docs/SHORTCUTS
+++ /dev/null
@@ -1,51 +0,0 @@
-********************************************************************************
-main shortcuts
-
-F1 -> help
-F2 -> take a screenshot
-F11 -> previous step
-F12 -> next (reachable) step
-
-********************************************************************************
-diskdrake
-
-taken directly from diskdrake.pm:
-
- "a" => \&Active,
- "b" => \&Move,
- "c" => \&Create,
- "d" => \&Delete,
- "f" => \&Format,
- "m" => \&Mount_point,
- "M" => \&Mount,
- "n" => \&Create,
- "o" => \&ReadFromFile,
- "s" => \&SaveInFile,
- "q" => \&Exit,
- "r" => \&Resize,
- "t" => \&Type,
- "u" => \&Unmount,
- "w" => \&WritePartitions,
- "W" => \&WriteFstab,
-
-hopefully it is explicit enough :)
-
-********************************************************************************
-list choice
-
-- acceleration a la windows (default): enter a letter and the selection will move to the
-first entry beginning with that letter. If you enter another letter it will try
-to find the entry beginning with the 2 letters you have given. In case it fails
-the starting_word is reset.
-- incremental search a la emacs: searches trough the list
-
-Use control-s to use incremental search and then to search next occurence
-
-********************************************************************************
-in case of complete mouse sh**t
-
-XFree86 provides a way of moving the mouse pointer:
-- first, press Ctrl-Shift-NumLock
-- then move the pointer with the keypad arrows
-- press button is ``0'' (aka Inser)
-- release button is ``.'' (aka Suppr)
diff --git a/docs/TODO b/docs/TODO
deleted file mode 100644
index cb9399f82..000000000
--- a/docs/TODO
+++ /dev/null
@@ -1,515 +0,0 @@
--URGENT---------------------------------------------------------------------------------
-check for fpons/pixel BOTH that resize_fat is clean for current version
-relative to 7.0-2.
-
-heavy testing of diskdrake to avoid corrupting partition table, current version
-should be available to fix bogus partition table, writing enabled only when
-partition is Ok (fixme? allow primary partition inside extended one, but with
-warning on diskdrake startup, made them as warning ?).
-
--features-------------------------------------------------------------------------------
-add rpmdrake in menu
-
-(7.1 or later) clean SCSI CDROM autoboot.
-(done,gc,8.0) stage1 & cdrom: add ability in expert to choose the scsi cdrom drive to use
-
-(7.1)better help for partitioning in newbie
-
-(7.1)Improved network configuration (PPP and/or Ethernet)
-PPPoE install and configuration (SuSE includes it, DHCP-like)
-(7.1)standalone applications for configuration (netdrake, timetool, authentificationconf, soundcard)
-
-----
-(7.2) replace normal with standard (in the installClass's)
-
-(7.2 or later)horizontal sub-steps
-
-(7.2 or later)diskdrake in text mode
-
-ask "do you have SCSI?" before asking "probe PCI or not"
-
-(?) paride in stage1
-(done,gc,8.0) stage1 & network: add ability to choose the network interface to use
-
-(?) msec custom
-
-(?)firewall configuration (instant firewalling?)
-
-(?)widget for displaying fdisk (dindinx)
-add fdisk using the zvt widget (taken in gnome-libs)
-
-(?)help in some configuration files.
-
-ability to add nfs/weird_fs entries in fstab
-
-size of packages in crypto
-
--to test--------------------------------------------------------------------------------
-what's lseek64?
-
-ensure installClass is set to something in auto install.
-
-for axp, swriteboot -f1 if swriteboot failed.
-axp with swap part sigsegv
-
-tree for choosing monitors (buggy?)
-
-what happens if a module fails to insmod (scsi step), in beginner/normal/expert
-
-fstab must be sorted (/usr/local after /usr)
-
-RAID upgrades
-
-add choice clean /tmp or not in expert
-
-kernel chosen by default must be the one according to supermount/secure
-
-bug if ide-scsi, no more hdX, but scd0 (aka sr0)
- (and add alias block-major-11 ide-scsi ?)
-
-check on update for conf.modules and modules.conf !
-
-with /usr, /usr/local and /usr/local/e mount points i get an error at step mounting local filesystems
-
--easy fixes-----------------------------------------------------------------------------
-rpmdrake proposition for cdrom labels
-
-use option nocheck to mount for upgrades
-
--fixes needing thinking-----------------------------------------------------------------
-bug: changing mem= in miscellaneous doesn't modify lilo conf if you backtrack
-
-ask network configuration only if NIC found?
-
-configure DHCP for newbies if ethernet & DHCP card available
-
-xvidtune like screen configuration (see SuSE's yast)
-
-live cdrom for alpha (sparc?)
-
-network boot
-
-get the error when getting/reading .rpm files fail
-better timeout handling for network installs
-
-handle not enough room for update
-(fpons)verify the free space is big enough.
-
-the XFdrake test does not handle the fontset
-
-> Here I go into the printer configuration select 'HP Deskjet 722C Colour',
-> print a test ASCII page, pressing 'No' when prompted to indicate the page did
-> not print OK and then hitting cancel when prompted to choose a printer type
-> again.
-> ask_from_list cancel at /usr/lib/libDrakX/my_gtk.pm line 504.
-
-diskdrake: take from parted mklabel, hide(?)
-
-bug in kde desktop if keeps home but not an upgrade
-
-bug in users: mandrake user is added twice in strange installs
-(mixed of security 0 + ???)
-
-bugs rpmdrake:
-- just after installing a package, switch to `Installed', the package has wrong name
-- refresh the kde desktop after package installation in rpmdrake
-(restart kpanel)
-- rpmdrake and same name packages
-
-urpmi: pb if XXX-devel requires XXX = 1.2.3 and we updgrade XXX-1.2.3
-
-bug in defcfg in with lang=fr_FR, display is buggy
-
-bug keyboard focus: after switch in console at Xconfig step
-
-
-
--to look at--------------------------------------------------------------------------
-adduserdrake to remove/update users
-
-(???)free provider auto configuration facility (to be discussed).
-auto ppp-configure with free provider
-
-(?)on laptop, configure the MMU to use swap not very often
-
-(?)checkboxes in groups based on compssList (and availableSpace?)
-
-(?)see what can be done with nvram (50 bytes to save information)
-
-better wacom support
-
-(fpons)bug: CANON BJC 4X00 do not work with current rhs-printfilters
- (work with magicfilters (debian))
- (should be handled by ghostscript BJC600's driver)
-
-(pix)install text on mem=8M, mem=16M?
-
-(pix)kickstart
-partitioning? raid?
-X configuration and bootloader in kickstart
-
-XFdrake chooseResolutions with ask_from_list do not permit ``Show all''
-
-(?) options in mkfs, progress bar when formatting
-
-(?) when some error occurs, partition must be unset isFormatted
-
--hardware-------------------------------------------------------------------------------
-- with no floppy drive, mkbootdisk step fails badly
-- with bad floppy or write protected, mkbootdisk doesn't say anything
-- try detect_devices::floppies (and how are scsi floppies handled?)
-maybe: do a iotcl FDGETPRM to detect fd1, fd0.
-
-need a simple solution to precise mouse type (syslinux option?)
-
-ELSA Gloria has bad ddc info
-
-token ring is tr0 not eth0
-
-I have Mandrake 6.1 installed and working on a ThinkPad 770.
-To enable the PCMCIA Token ring I have to append the following line to
-/etc/pcmcia/config.opts
-module "ibmtr_cs" opts "mmiobase=0xd2000 srambase=0xd4000"
-
-smp not detected (mhoward@memphisonline.com on cooker, bios=BP6PW)
-
-UDMA66 (ultra66.o for promise)
-
-aha152x needs "insmod aha152x.o aha152x=0x140,11,7"
-
-(obsolete) usb module not removed if no mouse found
-
-(fpons)handle dat drives
-
-hibernation on laptop -> clock not restored
-
-# in 2.3.15 "Silicon Integrated Systems [SiS]|SiS900 10/100 Ethernet" is handled
-
-(?)enable the testing of the mouse type (under X) (wheel)
-possibility to specify the mouse
-
--(?)---------------------------------------------------------------------------------
-(?) handle NT (add entry for it in lilo, put it in fstab)
-
-(?) lilo-0.22-19mdk is buggy with boot=/dev/hde & root=/dev/sda13, it needs
-disk=/dev/hde bios=0x80 & disk=/dev/sda bios=0x81
-
-(?)using setxkb, enable the testing of the keyboard
-
-(?)XFdrake does not handle fbdev
-
-(?) Je viens de faire une installation sur une machine où seul Be était
-installé. Je l'ai supprimé et installé (mode recommandé) Oxygen. Au
-redémarrage, le boot manager de Be apparaît et il est impossible de
-démarrer Linux.
-Pourquoi ne pas installer LILO si on supprime toutes les partitions ?
-
-(?)initrd in bzip2
-
-(?)smaller zsh (or ash in initrd)
-
-(?)is configureNetworkNet needed with dhcp/bootp?
-
-(?)bug in upgrade: install from hda1:/usr/local/blah with hda1:/
-
-(?)mandrake_desk was not installed while kdebase it there on upgrade
-
-(?)when clicking on X configuration, installation of packages is not displayed
-
-(?)maybe remove commented lines in /usr/lib/perl5/... files
-
-(?)timezone using a picture (pb: how to delimit zones)
-when asking GMT or not, display the time for each possibility
-the list is too big for USA
-
-(?)ability to select the type of install when booting of cdrom
-(?)use the ability of el torito to handle 2.88MB or more
-
-(obsolete)lilo-deinstallation in case of lilo auto-installation for beginners
-
-(?)loadFont sucks
-
-(obsolete)trash on the screen when X first starts
-
-(?)remove the gray line surrounding the logo
-
-(?)cleanup /etc/services & /etc/protocols
-
-(?)strange: no scsi of type 'fd', only 'tape'
-
-(?)remount ro before X test.
-
-(?)remove every << and >> (doesn't handle > 32bits)
-
-
--done---------------------------------------------------------------------------------
-(7.1,done,fpons) improve printerdrake to at least have the same functionalities as printtool.
-
-(done,fpons)diskdrake can olverlap partitions (resize lower, resize original typically
-after clear all and auto allocate, try maximal size available).
-
-(done,fpons)rewrite mouseconfig in perl?
-
-(done,pix)kudzu or not in miscellaneous
-
-(done,pix)warn the user if not enough ram to fulfill install
-
-(done,fpons)test after printer config
-
-(done,pix)ask for more than the memory size detected
-
-(done,fpons)modem config
-
-(done,pix)call kudzu in batch to initialize its list
-
-(done,pix)standalone generator of mdkinst_stage2.gz
-
-(done,pix)text install
-
-(done,pix) if u choose mouse usb != found mouse, it fails at X config
-
-(done,pix) diskdrake bug: saved information on floppy contains isMounted.
-
-(done,pix) update devices.c from modules.pm
-
-(done,pix) in lilo.conf, put
-disk=/dev/hdb
- bios=0x80
-
-(done,pix) diskdrake
-auto_partitions
-suggested partition tables must be better foreach installClass
-
-(done,pix) update the list of modules (in update_kernel)
-
-(done,pix) language support: only choose the right locales and upmark the packages requiring it
-
-(done,pix) move security question before isntallation of packages
-
-(done,pix) install ssh
-
-(done,fpons,pix) change the boot message of syslinux (have something different from RedHat)
-
-(done,pix) install_steps.pm: 569 (128M + 3)
-
-(done,pix) bug: mouse freeze just before network configuration (mouse primax)
- (was kudzu)
-
-(done,pix) signal 11 in stage1 nfs kickstart mount failed
-
-(done,pix) ask supermount or not, no supermount with kernel-secure
-
-(done,pix) fix bug in g_auto_install (can't go through all)
-
-(done,pix) bug: install from ciril.fr fails
-
-(done,pix)wizard for partitioning in case of one full vfat
-
-(done,dindinx)app for choosing drakxtools (drakxconf)
-(done,pix)verify being root
-(done,pix)log::l -> initlog
-
-(done,pix)install apmd for laptops (maybe not start apmd though)
-(done,pix)icewm apm (sh icewm_apm)
-(done,pix)kde apm (put Kapm.kdelnk in ~/Desktop/Autostart)
-
-(done,pix)bug in adduserdrake: missing pwconv in md5
-(done,pix)correct the default value of draksec (cp draksec)
-(done,pix)in draksec, (and maybe others) have --expert as default if /etc/sysconfig/system has TYPE=expert
-
-(done,pix)bug in XFdrake in install, cancel in choose Card do not close the window
-
-(done,pix)in XFdrake, testing should not overwrite /etc/X11/XF86Config
-
-(done,pix) hwiz and supermount and eject :(
-
-(done(replaced by msec's),pix) bug: usermod -G urpmi a not done (full install)
-
-(done,pix)perl and .ph's
-
-(done,pix) BUG bootp in network install sigsegv
-
-(done,pix) move the last done stuff before Xconfiguration if possible
-
-(done,pix)draksec is buggy, don't try security >= 4
-
-(done,pix)install apmd on laptops?? (maybe ask emcweb@btinernet.com (see alix))
-
-(done,pix)missing alias ll for root
-
-(done,pix)urpmi.addmedia: |gzip instead of doing it afterwards
-
-(done,pix)locale (and fonts?) buggy in case ramdisk is used
-
-(done,pix)rpmdrake: Installed packages not in hdlist should be there
-
-(done)in ftp install, locale not installed properly
-
-(done,pix)pcmcia.img does not handle hd/cdrom
-
-(done,pix)cyrillic font buggy in DrakX
-
-(done,fred)remove xfs user from kdm
-
-(done,pix)bug with 2 cdrom drives (.kdelnk to there for 1st drive)
-
-(done,pix(works))test ramdisk stage2 and romanian
-
-(done,pix)kfmrc
-
-(done,pix)on laptop, default to 1024x768
-
-(done,pix)mkinitrd and deps
-
-(done,fred(removed the call))XFdrake and mousedrake freeze if lothar launches them
-
-(done,pix)crypto message
-
-(done,pix)test bug with lilo and windows (if not on mbr)
-
-(done,pix)removed icons come back later (kde desktop)
-
-(done,pix(was bug in upgrade reading old config))
- segfault in linuxconf (adapter 1 empty)
- (test with the sysconfig sent)
-
-(done,fpons)bug: Lrosqu'on effectue une mise à jour et que /etc/lilo.conf
-contient la variable « default » positionnée sur autre chose que
-« linux » ou « windows », DrakX est incapable de générer LILO.
-
-(done,fpons)bug: GeForce and hd.img?
-
-(done,fpons)for upgrade in expert, give choice of packages to install
- choosing packages available in upgrade?
-
-(done,pix)rpmdrake: pb uninstalling package with dependencies (rpmdrake is killed?!) (as root too)
-
-(done,pix)noatime option for ext2 fs on laptops (do not wake up the hd)
- Do not update inode access times on this
- file system (e.g, for faster access on the
- news spool to speed up news servers).
-
-(done,pix)kde's icons: 28 horiz and 25 vert grid for big icons
-
-(done,pix)bug: DrakConf don't follow the charset -> add setlocale(LC_ALL, "")
-(done,pix)for ko|ja|zh, gnome-terminal should point to rxvt (-CLE)
-(done,pix)group cdrom in /etc/group (gid=22)
-(done,pix)drakxtools should require urpmi
-(done,pix)bug: gdm unset LANG
-(done,pix) zip with automount -> ppa not autoloaded
-(done,pix)when you set the kde icons to Large, maybe it'd be good to chown the .kderc
-(done,pix)lilo in russian/japaneese is horrible
-(ok,pix)test ide burners
-(ok)test check bad blocks optional for mke2fs
-(done,pix)hd install: no umount is done at the end of install :(
-
-just before release:
-(done,pix)- mandrake_doc-xx, the symlink is no good in /usr/doc/mandrake as
-(done,pix)- crypto dependencies to update
-(done,pix)- update kudzu's pcitable
-(done,pix)- update pcitable for 86C368 if 3.3.6 (and other S3 3D's)
- ("ATI|3D Rage P/M Mobility AGP 2x" -> changed to Server:Mach64)
-
-(done,pix)with 2MB of video ram, chooses 8bpp instead of 16bpp
-
-(done,pix) replace
- { device => "loop7", type => 0x83, size => ((cat_('/dos/lnx4win/size.txt'))[0]*2048), mntpoint => "/", isFormatted => 1, isMounted => 1 },
-by
- { device => "loop7", type => 0x83, size => cat_('/dos/lnx4win/size.txt') * 2048, mntpoint => "/", isFormatted => 1, isMounted => 1 },
-
-(done,fpons)in ftp install, bug with X server install with wu-ftpd 2.6 (see http://www.wu-ftpd.org/broken-clients.html)
-
-(done,pix)ask package installation languages (must be put in RPM_INSTALL_LANG)
-
-(done,pix)bug (by dadou): Si la partition racine est trop petite pour installer le système, un
-message d'erreur apparaît pour signaler le problème (bien) mais on ne
-peut en sortir. La seule solution est de redémarrer.
-
-(obsolete)bug when selecting compssUsers, do not deselect after (if u deselect)
-
-(done,pix)detect ide burners and then add hdX=ide-scsi to kernel cmdline
-
-(done,pix)urpmi: handle many args on cmd-line
-
-(done,pix)fix any // in path to ftp server otherwise windobe server bug :(
-
-(done,pix)diskdrake and auto partitioning, may have the last creation of partition rejected,
-try to figure why?
-
-(done,pix)in chooseResolutions: display the graphic card found
-
-(done,pix)with pcmcia, need ONBOOT=no
-
-(fpons,done) XFree: handle by card options
-eg: SIS6326 needs "no_bitblt" "no_bltimage" and 24bpp instead of 32bpp
-
-(done,pix) Xconfiguration: if "can't open fixed font", relaunch xfs.
-
-(obsolete) pb with dependencies ``missing'': icewm do not require XFree86 and so you can have icewm but no X server
-
-(obsolete) bug in ext2resizing (no sparse superbloc, don't finish properly)
-
-(done,pix,7.1)manage a lot of language (ergonomic issue as it already exists)
-
-(done,pix,7.1)tree for choosing things like timezone, monitors, graphic cards, modules, mice, keyboard? ...
-
-(done,pix,7.1)sound config, although very simple, no dedicated steps and only PCI (or maybe ISA-PNP if time left ?)
-
-(done,pix,7.1)partitioning, keyboard shortcut.
-
-(done,fpons,7.1)index/compress hdlist? (for multi-cd)
-! for multi-cd live is mandatory, small transaction are mandatory too.
-
-(done,pix,7.1?)loopback partitions (even root one)
-
-(done,pix)in ok_cancel, focus has 3 states, should be 2 (ask dindinx)
-
-(done,pix,7.1)Generally improved package selection /ergonmic issue.
-Tree -> CTree, ``all'' branch with all packages
-show the value associated (100->a must, 90->great, 80->nice, ... 10->useless, 0->do not install)
-
-(done,pix)let diskdrake have dos/win partition automatically set up with mount point,
-this will help loopback too.
-
-(done,pix,7.1)grub
-
-(done,pix,7.1)feature missing: cancel installation
-
-(obsolete) bug in diskdrake: can in strange cases create a primary partition at sector #0
-
-(done,pix(partly, protection against bugging))bug in diskdrake:
-in expert: blank, create hda5 at beginning, create hda6 at the end, create hda7
-in the middle, remove the first one. Result hda5 at the end and bug.
-
-(obsolete) have a better time estimation of the remaining time in install packages
-
-(done,dindinx+pix)ask_many_from_list can't keyboard scroll
-
-(done,pix,7.1)individual package selection: double click is tiring...
-
-(done,fpons,7.1) sparc ehancement, avoid V7+ machine target (div and mul not in v7 standard)
-
-(done,fpons,7.1)syslinux in graphical mode to be improved for heavily bogus BIOSes.
-
-(done,pix)missing feature in lilo configuration: can't give hda2 with /boot/vmlinuz if
-already hda1 with /boot/vmlinuz
-
-(done,pix)in 640x480 install box is to small (cuz of 'Cancel' button beeing added)
-
-(done,pix)chooseGroup with individual alone
-
-(done)(7.1) rewrite crypto stuff
-(done)crypto: add a cancel & progress bar while downloading
-(done)error handling (like reading hdlist)
-(done)(7.1)progression bar on crypto.
-
-(done, daouda&pix,7.1, other persons)rescue:
-- small modification for stage1 to get the rescue stage2
-- create a stage2 with many tools (fdisk, bash...)
-the rescue could be on another cd (if multi-cd)
-! care must be taken about modules (if ide is in module...)
-
-(done,7.1)install in 800x600
-- need handling of both 640x480 (mostly for VGA16) and 800x600
-
-(done,NEED 7.1) auto-install for corporate, very important (need consolidation).
diff --git a/docs/advocacy b/docs/advocacy
deleted file mode 100644
index 9e7f00b6b..000000000
--- a/docs/advocacy
+++ /dev/null
@@ -1,87 +0,0 @@
-a little DrakX history:
-
-june 1999:
- i start rewriting redhat's install in perl, partly for the fun of it. I'm
- still working for the army
-
-5 july 1999:
- i start full time job at mandrakesoft. But we don't have many computers and i
- must share the accounting computer with Merieme who is working half-time. No
- test machine (i test on others box, and destroyed Jacques partitions once),
- guess how it slows things down?
-
-august 1999:
- at last computers, even test one
- first DrakX version which can install things, very very rough
-
-september 1999:
- a friend of mine help me 2 weeks on DrakX relayed by Francois
-
-november 1999:
- first released version of DrakX (goldpack). Not really stable yet.
-
-january 2000:
- 7.0 is out, with a DrakX quite stable
-
-july 2000:
- dams starts working on draknet
-
-mid-october -> mid-january 2000:
- gc rewrites the stage1 to win every kb we can
- -> size divided by 7 (!) for cdrom
-
-
-The DrakX team is also doing a lot of other things:
-- drakxtools
-- urpmi, early MandrakeUpdate, early rpmdrake...
-- Mandrake Control Center (new DrakConf)
-- packages maintenance/enhancing (esp. ghostscript, 3D-wrappers, lilo)
-- fixing core packages to make them installable
-- scoring packages, sorting them, flagging them... (compssList, rpmsrate)
-- reading/answering cooker and other MLs
-- helping non-perl gurus :)
-
-That doesn't give much. Me being the one more working on plain DrakX. It gives 2
-people working for 1.5 years. IMO it isn't ``spending an enormous amount of
-resources''.
-And what do you mean by ``compared to the code base size''??? DrakX is currently
-around 28K lines, which is big IMO. You can compare it with linuxconf which is
-170K lines. I think the achievement of DrakX is comparable (a 6 times code size
-win from dumb C++ to expressive perl is normal imo).
-
-
-Also it seems like we don't have the same understanding of the word
-"maintenance".
-DrakX functionalities have evolved *a lot* since the beginning:
-
-- hardware detection, configuration, debugging, work-arounding (multi-kernel installs...)
-- making things prettier
- - more bitmaps
- - "advanced" button
- - syslinux graphical boot
-- making it work with latest versions of software (eg: switching to rpm4)
-- finding out the best way to use rpmlib
-- multi-cd
-- draknet: configuring every piece of stupid protocols
-- diskdrake: raid, loopback, LVM, resizing, checking stupid users entry
-- XFdrake: multi-mice, multi-heads, 3D-accel
-- porting to axp/sparc/ppc (with Stew's help)
-- always more i18n
-- keeping things small
- - .cz format
- - moving to .png
- - getFile on demand from mdkinst for ramdisk installs
-
-[...]
-
-> You don't believe the books ? Count yourself; see the man/months spent
-> in 'pure' developoment in drakX, and the resources put in mantainance
-> of the code base; as far as i know, your count should confirm what the
-> books says; more probabily, you will discover that our numbers are
-> even worse.
-
-if you count enhancements, adding features... in maintenance, i confirm the
-numbers, and find them quite normal.
-
-if you only count bug fixing, the time would be much shorter (around 30%).
-
diff --git a/docs/advocacy-interactive b/docs/advocacy-interactive
deleted file mode 100644
index 99036008e..000000000
--- a/docs/advocacy-interactive
+++ /dev/null
@@ -1,60 +0,0 @@
-
-> > We already have some functional backends, frontends, that works great, and has
-> > not been thrown away since 1 year. We use it during install, post install, mcc
-> > and so.
->
-> But aren't generic enough.
-
-DrakX handles:
-- buttons
-- bool values (checkboxes)
-- ranges
-- entries
-- combo boxes (editable or not)
-- lists / radio boxes
-- tree lists
-- iconlist
-- wait messages
-
-Features:
-- all the entries above can be mixed
-- nice separation between data and displayed data (eg: choose in list of
-objects representing hda/hdb/... but displayed nicely with size...)
-- keyboard handled nicely in GTK frontend
-- callback on events:
- ok pressed => check before the dialog is hidden
- focus changed =>
- * enables pre-setting things based on other entries
- * value checking on the fly
-- simple/advance toggle
-- shadowing of entries
-- tooltips
-- size of windows computed the best possible
-- perl-based
-
-Misfeatures:
-- display not flexible (though i don't know any of the tools we're talking
-about that is flexible => nice)
-- quite a few features are gtk only (simple/advance toggle, shadowing of
-entries, certain events, tooltips).
-- a stdio front-end exist but handle only certain entries. It would need a
-week-work to finish it
-- a http front-end could be done (mod-perl needed)
-- perl-based
-
-The DrakX frontend (called "interactive") could be moved out of DrakX.
-
-eg of use:
-
-<#part type="text/plain" filename="~/bin/perl/imessage" disposition=attachment>
-<#/part>
-
-[...]
-
-> > -provides a lot of frontends
->
-> And you ideally have to provide a frontend by widget set.
-
-nope. The interface is completly standardised, even if it include some
-gtk-like niceties. The *complete* newt (and not just entries and radioboxes
-like bus) binding takes 241 lines.
diff --git a/docs/comparisons b/docs/comparisons
deleted file mode 100644
index f399a9e84..000000000
--- a/docs/comparisons
+++ /dev/null
@@ -1,288 +0,0 @@
-redhat 6.1 (fr?), install 766MB, df 900MB, 35min (asked for all groups except "everything")
-
-upgrade to redhat 6.2, sum 757MB, df 936MB, 20min
-
-mandrake 7.1, install 755MB, df 1091MB, 17min (asked install size 910MB), 515 packages
-
-upgrade to cooker, sum 1000MB, df 1404MB, 35min
-
-
-redhat 7.0b, install 815MB, df 960MB, 18min
-redhat 7.0, install 995MB, df MB, 26min
-
-7.2b, 3.3GB 2h26
-
-
-7.2b: (lang fr)
-compssLevel df rpm time fs df/time
-
-100 64 59 0:59 ext2 500M 1.08
- 90 132 127 1:50 ext2 500M 1.20
- 80 226 218 3:26 ext2 500M 1.10
- 70 449 387 5:52 ext2 1G 1.28
- 60 614 541 8:36 ext2 1G 1.19
- 50 1113 943 17:40 ext2 2G 1.05
- 40 1193 1013 20:39 ext2 2G 0.96
- 30 1262 1072 22:28 ext2 2G 0.94
- 20 1445 1219 27:34 ext2 2G 0.87
- 10 1649 1394 36:58 ext2 2G 0.74
- 0 1943 1638 48:02 ext2 2G 0.67
--10 2957 2519 101:49 ext2 4G 0.48
-
-7.2b: (lang all)
-compssLevel df rpm time fs df/time
-
-100 70 59 1:04 ext2 500M 1.09
- 90 289 281 4:20 ext2 500M 1.11
- 80 373 361 5:41 ext2 500M 1.09
- 70 890 794 13:28 ext2 1G 1.10
-
-
-mem used 7.2cooker
-gtk: runinstall2 13608(data 9572) + FBDev 2984(data 1544)
-newt: runinstall2 9516(data 7528)
-stdio: runinstall2 9160(data 7372)
-
-8.0rc1: (lang fr)
-
-rpmsrate
-
-4 () 175 139 3:25 reiserfs 2G 0.85
-4 all 831 786 18:08 reiserfs 2G 0.76
-
-8.1b
-
-5 () 77 66 1:24 ext2 300M
-
-8.1pre_rc1 rpm df time/rpm rpm/df
-
-6 () 82 66 1:26 ext2 500M 1.05 1.24
-5 () 89 71 1:38 ext2 500M 1.10 1.25
-3 () 94 77 1:46 ext2 500M 1.13 1.22
-5 X 145 127 2:09 ext2 500M 0.89 1.14
-3 X 231 217 3:26 ext2 500M 0.89 1.06
-4 kde 393 316 4:31 ext2 2G 0.69 1.24
-4 kde 393 316 4:41 ext2 2G 0.72 1.24
-4 kde 393 316 4:43 ext2 4G 0.72 1.24
-5 all 367 337 5:02 ext2 500M 0.82 1.09
-4 kde+gnome 454 370 5:50 ext2 4G 0.77 1.23
-4 kde+gnome 454 370 6:10 ext2 4G 0.81 1.23
-4 kde+gnome 454 370 6:24 ext2 4G 0.85 1.23
-5 all 489 406 5:55 ext2 4G 0.73 1.20
-5 all 490 406 5:18 ext2 1G 0.65 1.21
-4 kd+gn+dsk 594 494 7:31 ext2 4G 0.76 1.20
-4 prev+dev 827 696 10:27 ext2 4G 0.76 1.19
-4 all 1100 988 19:34 ext2 1G 1.07 1.11
-3 all 1640 1331 31:33 ext2 2G 1.15 1.23
-3 all 1740 1434 39:38 ext2 4G 1.37 1.21
-2 all 2252 1843 54:40 ext2 4G 1.46 1.22
--1 all 2490 2048 61:02 ext2 4G 1.47 1.22
-
-# perl -alpe '$F[4] =~ /(.*):(.*)/; $r = ($1 * 60 + $2) / $F[2]; s|\S+(\s+\S+)\s*$|sprintf("%.2f", $r) . "$1"|e;'
-# perl -ape '$r = $F[2] / $F[3]; s|\S+\s*$|sprintf "%.2f\n", $r|e;'
-
-9.0beta1
-
-5 () 89 71 1:35 ext2 500M
-3 X 240 231 3:41 ext2 500M
-5 all 306 293 3:36 ext2 500M
-4 all 808 731 6:48 ext2 1G
-4 all 1433 1331 21:44 ext2 2G
-4 X+kde 822 749 6:05 ext2 2G
-4 X+gnome 369 319 5:58 ext2 2G
-
-
-redhat 7.3:
-- do not halt the box when "halt" is used
-- no sysreq
-- kdm has gnome entry whereas gnome is not installed
- => choosing gnome gives a flashing black screen and kdm reruns
-
-- repartition of packages on various CDs is crap
-
-- bootloader: handling of multiple disks is more powerful in redhat, but more
-dangerous (proposed to everyone, but not proposed especially to people having
-a dangerous combinaison)
-- why still asking about lba32!!
-
-* anaconda 7.3 vs 7.3.92
- - skipddc option (locks some machines) ??
- maybe because it's done at the beginning of their install?
-
- - LVM
- - lvm_dialog_gui.py
- - Physical Extent 1MB 2MB 4MB ... 16GB
- (vgcreate -s ${PhysicalExtentSize}k)
- - see lvm_sanity_checks.txt, take them
- - lvm on / (mkinitrd)
- - handle upgrade when lvm on /
- - vgcreate -An (ie --autobackup no) ??
- (also for lvcreate vgchange lvremove
- - see clampPVSize in lvm.py
-
- - RAID
- - Number of spares ??
- - mkraid --dangerous-no-resync ??
-
- - progress bar in ext2 formatting
-
- - ctrl-alt-suppr during install => reboots
-
- - user names: the regexp is [a-zA-Z][^\0-\x20:,\n]* or [A-Za-z][A-Za-z0-9]{0,7} (depending on wether you're in text mode or graphic mode :)
- - check the user name created is not a system one (see systemUsers)
-
- - SMB authentification
- - cloneDrive ?
-
- - edd dropped (was to detect lba32 capability, which was dumb)
-
- - reconfig type of installed removed (was something between install & upgrade)
-
- - ddcprobe code removed -> moved to kudzu
- changes: sigprocmask and movl added around lrmi_vm86
-
- - $ENV{GDK_USE_XFT} = 0
-
-* kudzu 0.99.52 vs 0.99.55
- - blacklisting modules.pcimap e100 and bcm5700
-
-* hwdata 0.14 vs 0.32
- - dropped XFree86 3.3.6 support
-
- - upgradelist: list of (old_module => new_module) for upgrades
- (a simpler way would be to drop entries in modules.conf that concern
- obsolete (and not available anymore) modules, relying on auto-detection to
- add the new one)
-
- - CardMonitorCombos (for laptops)
-
-redhat 8.0:
-
- (legend: + pros - cons / notice)
-
- Install steps difference
- + firewall wizard
- + md5sum check when booting install
- - no upgrade packages installation during install
- - no services configuration (chkconfig)
- - no printer configuration
- - no autologin
- - no real small installation
- - no small packages (groff-for-man, perl-base...)
- / still propose non-MD5 or non-shadow passwords
- / post install tool (firstconfig)
-
- General install behaviour, eye-candiness
- + package selection a la Windows
- + in language selection languages displayed in native language
- + candy timezone selection
- + help uses bold/italic/big-font
- - no one CD install
- / not using fb at install
- / python + gtk2 vs perl + gtk
- / ask many things before doing anything (esp. delayed partitioning, swap not available when selecting packages!(?))
- - more width-hard-coded dialog boxes (harder for translations)
- / use a loopback file from the CD then copied on system
-
- Partitioning
- - no diskdruid after install
- - no partitioning wizard
- - no devfs
- - no xfs (but now has reiserfs/jfs)
- - no loopback crypted fs
- - no file swap (?)
- - no supermount
- + LABELed entries in fstab
- + progress bar while formatting
-
- Bootloader
- + bootloader configuration less awkward
- - no automatic handling of bios ordering with many harddrives
- - propose to manually change bios ordering even with one harddrive
- - LBA32 checkbox
- / defaults to grub
-
- Network
- - awkward question apropos hostname when using DHCP
- - no default choice for netmask/gateway/DNS based on IP
-
- XFree
- - no wacom configuration
- - no graphic card multi-head configuration
- - no ATI tvout configuration
- - no prompt for logout after changing X config
- - VideoRam prompted for everybody
- / no XFree3
- / no Utah GLX
- / load module "fbdevhw" "record", but not "v4l"
- / always load module "glx" and "dri"
-
- Keyboard
- - many non useful keyboard entries (eg: latin0)
- - no way to choose the toggle key to choose between latin/non-latin keyboard
- - no loadkeys done during install for console
-
- Mouse
- - no way to test mouse choice
- - mouse choices include many non-useful choices, badly sorted
- (Intellimouse must be sought in Microsoft whereas it's used by many others)
-
- Multimedia
- - no bttv configuration (including webcams)
- - missing audio modules (alsa, audigy...)
-
-* anaconda 8.0 (rel. 4) vs 8.0.92
- - use vte instead of gnome.zvt
- - add alpha (axp) partitioning code
- - remove label "nofb" and options "devfs=nomount ramdisk_size=9216" from syslinux.cfg
- - edd (ddc probe) moved to kudzu
- - add "-Odir_index" option to ext3 tunefs
- - screenshoting in directory /root/anaconda-screenshots/ instead of using exported display
- - assembler code change in cpuid, smp.c
- - there is some code to read the "raid superblock" (see doGetRaidSuperblock in isys/isys.c)
- - new code for choosing to upgrade or not
- - hack to remove /var/lib/rpm/__db.00[123] (with comment "make sure that the rpmdb doesn't have stale locks :/")
-
-* anaconda 8.0.92 vs 8.0.93 (rel. 0.20030108205243)
- - drop xmode (bring up text mode in a remote xterm)
- - code available to check the ability to do a mkbootdisk
- (check size of vmlinuz + initrd, check size of floppy)
- - drop "-Odir_index" option to ext3 tunefs
- (with comment "add back -Odir_index when htree is safe")
- - waitForLink added to loader2/net.c using added ethtool thingy (get_ethtool_link_status, get_link_status)
- - OS390 fdasd & z/IPL changes
- - for kickstart, new option "--ignoremissing", (there were --ignoredeps and --resolvedeps)
- - /usr/kerberos/lib in LD_LIBRARY_PATH
- - these are symlinks so you cant make them mount points
- otherexcept = ['/var/mail', '/usr/bin/X11', '/usr/lib/X11', '/usr/tmp']
-
- elif self.mountpoint in otherexcept:
- return _("The mount point %s cannot be used. It must "
- "be a symbolic link for proper system "
- "operation. Please select a different "
- "mount point.") % (self.mountpoint,)
-
-
-* hwdata 0.47 (redhat 8.0) vs 0.62 (redhat 8.1 beta1 phoebe)
- - pcitable & upgradelist
- - replace eepro100 with e100
- - switch 0x1106 0x3059 "via82cxxx_audio" to "unknown"
- - Cards
- - remove most swcursor with comment:
- # mharris - Nov 23, 2002 - Commented out the swcursor option, if it is still
- # needed, then lets disable it right in the driver completely, or possibly
- # fix it.
- - using driver "nv" for GeForce4 and Quadro4 with comment:
- # mharris - Nov 23, 2002 - enabling "nv" driver for GeForce 4 and Quadro 4 as
- # CVS XFree86 support them now in 4.2.99.2
- - special options "externDisp" and "internDisp" for NeoMagic cards
- together with CHIPSET
-
-* kudzu 0.99.69 (redhat 8.0) vs 0.99.83 (redhat 8.1 beta1 phoebe)
- - don't read eepro100 entries from the pcitable
- - handle compressed modules
- - many changes in PS/2 mouse detection, and handle "intellips/2" mouse
- - changes in PnP serial modem detection
- - use "udf,iso9660" option for cdrom entry in fstab
- (note that comma separated choice of filesystems *is* allowed, though not
- documented in fstab(5))
diff --git a/docs/diskdrake.TODO b/docs/diskdrake.TODO
deleted file mode 100644
index e6f2da038..000000000
--- a/docs/diskdrake.TODO
+++ /dev/null
@@ -1,23 +0,0 @@
-- test what windows can handle (the number of partitions)
-- better keyboard focus handling
-- end sector in Create
-- add warnings for scsi drives if you create more than sdx15
-- the information put in save/restore partitions must be cleaned
-(remove mounted/formatted/..., also remove the Data::Dumper dependency)
-- test, test, test
-- do not allow swap partitions above 2Gigs
-- wanting the first partition to be extended is not used
-- maybe warn if a mounted partition change of dev number
-- text version
-- better error handling (what to do if we find a bad partition table?)
-- display the information about the correspondance color2type
-- handle the partition labels (missing information here)
-- add comments in the code
-- add documentation
-- handle the `luke' case (main extended partition must be extended)
-- ability to batch actions (like chained moves)
-- add a verification after fdiskReadPartitionTable that the start_cyl,
-end_cyl... do correspond to start and start+size. For the moment, this
-information is just discarded :(
-This verif can't be done in fdiskReadPartitionTable as start is relative in
-extended partitions
diff --git a/docs/drakfont/Makefile b/docs/drakfont/Makefile
deleted file mode 100644
index b70b4a0c8..000000000
--- a/docs/drakfont/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-#
-# Project : Projet Libre
-# file : pki.tex
-# Date : Thu Jun 21 19:26:19 CEST 2001
-# (o- Id : DUPONT Sebastien
-# /\ mail : <dupont_s@epita.fr>
-# Y_/___________________________________________
-#
-
-RM = @rm -f
-
-CD = @cd
-
-ECHO = @echo
-
-PRINTF = @echo -n
-
-FILE = drakfont
-
-DVI = @dvips -j0 -Pcmz -Pamz -o
-
-PS = @ps2pdf
-
-LATEX = @latex
-
-normal :
- $(ECHO) '/*--LATEX--*/'
- $(LATEX) $(FILE).tex
-
-all :
- $(ECHO) '/*----------latex -> dvi -> ps -> pdf------------'
- $(ECHO) '/*--LATEX--*/'
- $(LATEX) $(FILE).tex
- $(ECHO) '/*--DVI -> PS--*/'
- $(DVI) $(FILE).ps $(FILE).dvi
- $(ECHO) '/*--PS -> PDF--*/'
- $(PS) $(FILE).ps
- $(ECHO) '/*--That s all--*/'
-
-
-ps : normal
- $(ECHO) '/*--DVI -> PS--*/'
- $(DVI) $(FILE).ps $(FILE).dvi
- $(ECHO) '/*--That s all--*/'
-
-pdf : ps
- $(ECHO) '/*--PS -> PDF--*/'
- $(PS) $(FILE).ps
- $(ECHO) '/*--That s all--*/'
-
-clean :
- $(RM) $(FILE).toc $(FILE).log $(FILE).aux *~
-
-fclean :
- make clean
- $(RM) $(FILE).ps $(FILE).pdf $(FILE).dvi
diff --git a/docs/drakfont/dia_srcs/drakfont.dia b/docs/drakfont/dia_srcs/drakfont.dia
deleted file mode 100644
index c4502a12e..000000000
--- a/docs/drakfont/dia_srcs/drakfont.dia
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/dia_srcs/drakfont_install.dia b/docs/drakfont/dia_srcs/drakfont_install.dia
deleted file mode 100644
index 737c19b9f..000000000
--- a/docs/drakfont/dia_srcs/drakfont_install.dia
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/dia_srcs/drakfont_uninstall.dia b/docs/drakfont/dia_srcs/drakfont_uninstall.dia
deleted file mode 100644
index c06f92dd6..000000000
--- a/docs/drakfont/dia_srcs/drakfont_uninstall.dia
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/drakfont.jpg b/docs/drakfont/drakfont.jpg
deleted file mode 100644
index 898dfe440..000000000
--- a/docs/drakfont/drakfont.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/drakfont.tex b/docs/drakfont/drakfont.tex
deleted file mode 100644
index bbc936e5b..000000000
--- a/docs/drakfont/drakfont.tex
+++ /dev/null
@@ -1,152 +0,0 @@
-%\documentclass[pdftex]{article} \usepackage{hyperref} .
-%\documentclass[pdftex,onecolumn,11pt,oneside]{article}
-\documentclass[onecolumn,11pt,oneside]{article}%seminar}
-%\usepackage[pdftex]{hyperref}
-\usepackage{isolatin1}
-%\ifx\pdfoutput\undefined
-
-\usepackage[dvips]{graphicx}
-%\else
-%\usepackage[pdftex]{graphicx}
-%\usepackage[pdftex]{hyperref}
-%\usepackage{type1cm}
-%\fi
-%\pdfoutput=1
-\usepackage{color,graphicx,shortvrb,epsfig,verbatim,tabularx}
-\usepackage{url}
-\usepackage{hyperref}
-\urlstyle{sf}
-\usepackage{fancyheadings}
-\usepackage{program}
-\usepackage{ulem}
-\usepackage{amsfonts}
-\usepackage{xspace}
-\usepackage[english,francais]{babel}
-\pagestyle{fancy}
-\newcommand{\trtitle}{Drakfont\\ fonts importation for mandrake linux}
-\DeclareGraphicsRule{.ps}{eps}{.ps}{}
-\DeclareGraphicsExtensions{.ps}
-\renewcommand\star{{\ttfamily*}}
-\let\package\textsf
-\newlength{\gxlen}
-\settowidth{\gxlen}{\package{graphicx}: }
-\newcommand\gs{\makebox[\gxlen][l]{\package{graphics}:}}
-\newcommand\gx{\makebox[\gxlen][l]{\package{graphicx}:}}
-\MakeShortVerb{\|}
-\begin{document}
-\title{$Drakfont$ fonts importation for mandrake linux}
-
-\begin{figure}%[ht]
-\begin{center}
-%\caption{Exemple d'image}
-\mbox{\epsfig{file=mandrake.ps}}\\ %,height=1in,width=2in}}\\
-%\mbox{\epsfig{file=carte_.ps,height=1in,width=2in}}
-\end{center}
-\end{figure}
-%\begin{figure}
-%\begin{center}
-
-%\end{center}
-%\end{figure}
-\author{Dupont Sebastien \\ sdupont@mandrakesoft.com}
-\date{05/10/2001}
-\pagestyle{myheadings}
-\markright{\scriptsize \trtitle}
-\title{\bf \trtitle}
-\maketitle
-\section{drakfont Future Overview}
-
-\paragraph{Fonts import :\\}
-\begin{itemize}
-\item pfb ( Adobe Type 1 binary )
-\item pfa ( Adobe Type 1 ASCII )
-\item ttf ( True-Type )
-\item pcf.gz
-\item Speedo
-\item pfa ( Adobe Type 1 ASCII )
-\item ttf ( True-Type )
-\item and Bitmap (PCF, BDF, and SNF)
-\end{itemize}
-
-
-\paragraph{Features}
-\begin{itemize}
-\item Install fonts from any directory
-\item Get windows fonts on any vfat partitions
-\item UN-installation of any fonts (even if not installed through drakfont)
-\end{itemize}
-
-
-\paragraph{Support}
-\begin{itemize}
-\item Xfs
-\item ghostscript \& printer
-\item Staroffice \& printer
-\item abiword
-\item Koffice, Gnumeric, ... studying
-\item all fonts supported by printer
-\item ( aliases by RENDER in Xfree86 .... -> later )
-\end{itemize}
-
-
-\section{Window interface:}
-\begin{itemize}
-\item
-\item Fontselectiondialog widget
-\item Command buttons under Fontselectiondialog (like the actual frontend).
-\item Commands buttons:
-\item import from windows partition.
-\item import from all fat32 partitions and look for winnt/windows/font
-\item and import all (delete doublon) but don't import if already exist.
-\item import from directory
-\item look for if it exist before for each font and not delete the original.
-\item (replace all, no, none)
-\item expert options:
-\item ask the directory, and look for if it exist before
-\item if it exist ask: (replace all, no, none)
-\item uninstall with list per font type
-\item Expert additional switch
-\item option support: ghostscript, Staroffice, etc...
-\item check-button. (by default all check)
-\item Printer Application Fonts Support...
-\item check-button. (by default all check)
-\end{itemize}
-
-\section{Command line}
-\paragraph{Font Importation and monitoring application\\}
-\-\-windows\_import : import from all available windows partitions. \\
-\-\-strong : strong verification of font.\\
-\-\-install : accept any font file and any directory.\\
-\-\-uninstall : uninstall any font or any directory of font.\\
-\-\-replace : replace all font if already exist\\
-\-\-application : 0 none application.\\
- : 1 all application available supported.\\
- : name\_of\_application" like staroffice for only this one.\\
-
-\section{Graphics}
-
-to visualize the conceptual graphics please see:\\
-drakfont.jpg\\
-drakfont\_install\.jpg\\
-\& drakfont\_uninstall.jpg\\
-
-
-
-%\begin{figure}%[ht]
-%\begin{center}
-%\caption{Exemple d'image}
-%\mbox{\epsfig{file=drakfont_install.ps}}\\ %,height=1in,width=2in}}\\
-%\mbox{\epsfig{file=carte_.ps,height=1in,width=2in}}
-%\end{center}
-%\end{figure}
-
-
-%\begin{figure}%[ht]
-%\begin{center}
-%\caption{Exemple d'image}
-%\mbox{\epsfig{file=drakfont_uninstall.eps}}\\ %,height=1in,width=2in}}\\
-%\mbox{\epsfig{file=carte_.ps,height=1in,width=2in}}
-%\end{center}
-%\end{figure}
-
-\end{document}
diff --git a/docs/drakfont/drakfont_install.jpg b/docs/drakfont/drakfont_install.jpg
deleted file mode 100644
index 795a5a711..000000000
--- a/docs/drakfont/drakfont_install.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/drakfont_uninstall.jpg b/docs/drakfont/drakfont_uninstall.jpg
deleted file mode 100644
index 711f28e77..000000000
--- a/docs/drakfont/drakfont_uninstall.jpg
+++ /dev/null
Binary files differ
diff --git a/docs/drakfont/mandrake.ps b/docs/drakfont/mandrake.ps
deleted file mode 100644
index 1af9d5bb4..000000000
--- a/docs/drakfont/mandrake.ps
+++ /dev/null
@@ -1,534 +0,0 @@
-%!PS-Adobe-3.0
-%%Creator: GIMP PostScript file plugin V 1.12 by Peter Kirchgessner
-%%Title: /home/seb/drakfont/mandrake.ps
-%%CreationDate: Fri Oct 5 18:28:29 2001
-%%DocumentData: Clean7Bit
-%%LanguageLevel: 2
-%%Pages: 1
-%%BoundingBox: 14 14 424 84
-%%EndComments
-%%BeginProlog
-% Use own dictionary to avoid conflicts
-10 dict begin
-%%EndProlog
-%%Page: 1 1
-% Translate for offset
-14.173228 14.173228 translate
-% Translate to begin of first scanline
-0.000000 69.000000 translate
-409.000000 -69.000000 scale
-% Image geometry
-409 69 8
-% Transformation matrix
-[ 409 0 0 69 0 0 ]
-% Strings to hold RGB-samples per scanline
-/rstr 409 string def
-/gstr 409 string def
-/bstr 409 string def
-{currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop}
-{currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop}
-{currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop}
-true 3
-%%BeginData: 29637 ASCII Bytes
-colorimage
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-bl7e@q"4E6s+13Ds*t~>
-bl7e@m,@els+13Ds*t~>
-bl7e@T5=@Ts+13Ds*t~>
-c2RqDnG2D<JcC<$U&TW~>
-c2RqDl/9_PJcC<$U&TW~>
-c2RqD]71%QJcC<$U&TW~>
-cMn+JnG;n/i;S<-JcDJEJ,~>
-cMn+JmbuTmh#;m)JcDJEJ,~>
-cMn+Jie^A<a8UYiJcDJEJ,~>
-cMn+DnbMk)f)($uJcDJEJ,~>
-cMn+DjkIhQchi:nJcDJEJ,~>
-cMn+DST5n_V>GiDJcDJEJ,~>
-ci47Jn+l_KeBdl?s+13Es*t~>
-ci47Jkhjh)WP\C\s+13Es*t~>
-ci47J^4K&h%!hSus+13Es*t~>
-d/OCNnbW%Rn_2+VJcC<$UAo`~>
-d/OCNn);p@^TP0>JcC<$UAo`~>
-d/OCNj+q1n%LcV6JcC<$UAo`~>
-d/OCHnG2eMo&%LUJcC<$UAo`~>
-d/OCHjkS+u^p135JcC<$UAo`~>
-d/OCHTl`:/%Lk8_JcC<$UAo`~>
-lMgqbp\sLY$2s;fp\"1NjN$P:s+13Es*t~>
-lMgqbp\sLY$2s,He&K8A[BAeGs+13Es*t~>
-lMgqbq>T^[$2r)%;B-/V%3+S`s+13Es*t~>
-li.(dk/mMerri>mqY9a_oE+4!k(3P`s.]OD~>
-li.(dk/mMersJbqin;Gk_SWgdk(3P`s.]OD~>
-li.(dmFhC'rsJbkMeO[R%M'!Pk(3P`s.]OD~>
-m/I4fjeV8=m/I1an+l\UoE4C(gAQU&JcDMFJ,~>
-m/I4fje_>>m/I4bjk\5#rk\cKUso9ns+13Fs*t~>
-m/I4flbMl_m/IIiWH^N?%Ls!Y%&s2Vs+13Fs*t~>
-mJd@ggl^4WrU'UfrU9RVp&4Lbm*a;WJcC<$U]5i~>
-mJd@gglg:XrU'UfrTiCk`r3aV];N^FJcC<$U]5i~>
-mJd@gjg<_0rU'UfrR6L%+8lZO%1J$fJcC<$U]5i~>
-mf*Iik)["5qX+:crq-'^p&+Famb#_TJcC<$U]5i~>
-mf*Iik)d(6qX+:drq#.'b/=1p"21eLoR[$ns.fUE~>
-mf*IilEnChqX+:drp>Y\/e\'l!Xrf8JcC<$U]5i~>
-n,F"!nYD2sp&>!hp%nOYp@\.TrV6BpqX41Qqt(!\hT52;s+13Fs*t~>
-n,F"!nYM8tp&>!hm-F!$l0Rm2rV6BqqW?VZ`;IIS^p(69JcC<$U]5i~>
-n,F"!o>7BVp&>!h[uQH0T!cSkrV6BqqQkK3(&JIB%70K7s+13Fs*t~>
-n,FI)^NR3SrVuomhY$U:q"X[\qY0^VpA+[ds82B`p\"CT!oq>fJcC<$U]5i~>
-n,FI)^j!BUrVuomg;hIdf%Jg6kNM-qn+?PWs82-AeAqF&!jo2uJcC<$U]5i~>
-n,FI)d@e5>rVuom_BM'9>A8)$G_hZm`nC%as80]m<Zq5K!Y$ODJcC<$U]5i~>
-nG`[jf8YC8q>UBuqVJd?m.L&NpAajeq#1!kp%eIZp%e4]kKW1@s+13Fs*t~>
-nG`[jf8YC8q>UC0qVJQ`]>_n8c-Xnhg"Y?>kiqElf#bi+_?.6OkCNYas.fUE~>
-nG`[jhm8^'q>UC0qVI;C%2gQM4%)eE@rZaAKVFlk?7QZc%Kd4N"m:I:JcDMFJ,~>
-nc&gmm]UN9m/I"a#6+8C]\r,HrUg-_rq??c!VZ3]oE4O8iVnE.JcDPGJ,~>
-nc&gmm]UQ:m/I"a(&mjRYd1mV_SX4/`lQ?JcdC7lcH*p!_?7KSh>W!*JcDPGJ,~>
-nc&gmnApp+m/I"a(&mjRCCL^_%M'-d*@NX&6:t6X5:%$?%Km:P%*&9ts+13Gs*t~>
-nc&dibD(8oq>C6srp\(Nj6cI(oE4^PjnOE,JcDPGJ,~>
-nc&dibD(;pq>C6srp\(:[(O6N_?7]o`5D>d"2VXrpjrHrs.o[F~>
-nc&dif<14fq>C6qrp\&r%J^M6%g3L](D78P%KT)pJcC<$V#Pr~>
-o)Apnm'1H"lMg\\#6!f&dH0iglLY2OnG*"XrsA\uq"XjgqtB^[JcC<$\c70~>
-o)ApnmBLT$lMg\\#6!f&\@0,fm(rqD`5^X+rqQL"rpo1Err;l[jSON.JcE:\J,~>
-o)Apnm`LrrlMg\\"T@T$+q<fI"VDOmC#f3frsA\WEU3W(qji66JcC<$\c70~>
-o)Amjb*?Map%eUlqr>9CjmVg,oEY'_p\"4Rr;QWo$2s&VmeZnNp>>Uqs+13\s*t~>
-o)Amjb*?Pbp%eUlqr>2i[_BTE_?e'"cIM%Anb`=`rsAYegtV](lHe5ZJcC<$\c70~>
-o)Amjf"$U`p%eUjqr=df%I4K1%hp3M>Ci]roD\[f$2s$mBDVSN(rc6#s+13\s*t~>
-o)Am`[;pHKrV6BrptE13kO@d/(%q:pq"X[Yp%\Lcs8M65p?qSEe(skOs+13\s*t~>
-o)Am`[W6TMrV6BrptE!V\A.@H(;n2:dFR%+k3DR:s8W)^b0fDEf>-5=JcC<$\c70~>
-o)Am`bFssSrV6BqptC`;%I4K?%hp-C8mQ7RKs0)+s8W)^Q8?5H>YX&NJcC<$\c70~>
-oD]!me>?o:lhCD`rq+[OhWjXqo`+Uap(-omq"aUUq=E"uo]5Yem/DS9JcE:\J,~>
-oD]!meYd,>lhCD`rq+[DZ+@a9_A'o,aNMlWf%T6KmIg(uccXqbaR&nWs+13\s*t~>
-oD]!mgr,DGlhCD_rq+ZT%1VS4'b:op,r7b[?>XPE\DZu+?7Vct]^5WKs+13\s*t~>
-oD]!f^6W?3nb2terp\+KipH=!o`+Uap($ilq"O+(guI)Go(DbUrdk*#s1JA^~>
-oD]!f^6`H5nb2terp\+:Zb4-;_@si+aNVuZf\>QHa2#=.eDfTZqu20HJcEC_J,~>
-oD]!fcFJk?nb2tcrp\*'%H\-7%h]a,2F:;PDg@Us1*L+oT;9Krrdk*#s1JA^~>
-oD]!]YCC#np\"OjrThAHk3qp%o_nFnp@?/4i8NJDeEQYKc-"5QrlP;YVY^&e!rCEmrQ58a`3ciI
-d/OCNp#k&U\;/o>h#@ZZp#k&V\rFr4iVs>cn`8KObf\)MdFe!gir92]puU2Tbl5cb^&\&$s*t~>
-oD]!]YCC#np\"OjrThA1\%]]>_A'o-aN2ZXdCHg.]=keag\&b7bKS30b6#MWqY1!kqUNslb6?&0
-`3ciId/OCNp#k&U\VT)@h#@ZZp#k&V]8k/7iVs>cn`8KObfe/NdFn'hir9DcpuU2Tbfe2P^V9T9
-s*t~>
-oD]!]aJt!3p\"OhrTh?P%H@p+%hp!3-mB]:J%7BArWNL]p"S9UgY;_]!n>*`p\t<kinaRe"PMAM
-b59Qc#laScjPJ7fjo4'8#laScjPS@lgAU"1%0#nbjk\\Fg=b?Co`!kM"oe>aj5&JhgAfS$qjmb;~>
-o`#-pfr/arg&(FA"oIDohWO@goFpf^hTE^[d+I+3\@B)hioYiBMk'a<!fM0fq#:d$hS6+`T:M*e
-C1Mkcdf0[Qg;:S9ZD;SVjSds8$N8Ym]Xb>FH>(\%jSoMbptsB7]<eK2rgs@hW2mGdrT4%`rTDG@
-ZDXGrT)saenX]]1~>
-o`#-pfr/asg&(FA"oIDmZ+.O/_@s_sYb@bpYJAE'\@B)hioYlDMk'a<!fM3gq#:d$hS?1aT:M*e
-C1Mnddf0[Qg;:V:ZD;SWjSds8$N8Ym]XkDGH>1b&jSoMbptsE9]<eK2rgs@hW3!MerT4%`rTDG@
-ZDXGrT)safnX]]1~>
-o`#-phSl(>g&(FA"T.;a%1V;,rs]MI#nAC@F#gb?\]3XkXJrM=rP&E>SaH4P%/o8;a1oC'[\K.H
-S+>#-$N9&:eC)RXUQ4F6hZ!r]j3uH'bep?>eGA8+#laY_hUg0!`PMPg"iA7"cKP5grs&Ggh:9`f
-_>_1NY+"mOs*t~>
-o`#-k`1LULi;W?J"o6r`jR)O$oH!MhhT2q%V6%_Zamms?io]goWKMCCDf9T7A7i^Wq>Uls_PM^#
-EG/W[H],6!df0[K[s3%5GACN#iVq^6$MV#aF)?#9>[lFajo6"lim#-6Ob7puCMe$3G'nq%P-t2M
-rseqc_lA`EF(f,p@pNR+qYpZso@s5Bs*t~>
-o`#-k`1U[Ni;W?J"o6r[[Cj?=_B$G(Yb-l2RA-dea2uK^io]goWfhOEDf9T7A7i^Wq>Uls_PM^#
-EG/W[H]5<"df0[K[s<.7GACN$iVq^6$MV&bFDc2;>[uLbjo6"lim#-6Ob7puCMe$3G'nq%PICAO
-rseqd_lA`EF(f,p@pNU,qYpZso@s5Bs*t~>
-o`#-kd(bp"i;W?J"8U`5%HJ$!%2'$U$Vu+1*4lc6i8Wnik-LYHT`1PdTU(S\rV?I%p=$pYT:h[3
-H]"0#n'_4CpW&ntT;8$8L>i-grsJMAUn"!NSr/*QqrRhkr9<%c`3ueET:MRGTqnTfZa\-TkPl"i
-kL[_[W1f]IQ'I8]k5,)[rq>LQW;hA~>
-o`#*d[?tH4iq!*Orq+U^kO]kem,#gfX.uc3c/-+Vg@4Y3s8V`JaII`jBOk^aA?5P&rseqYZA*4-
-An"tc][5[4df0XJgUa)+DIZpqkM?.FpYNZaKQL^.E9$r[rtYF__PW-/@pN2?>?b?@A7fLoF`b+j
-kl1kZ]qg0nA7#49!`N1[rVm*#m+]aaPkD!TJ,~>
-o`#*d[?tH5iq!*Qrq+UM_o(`U+2GLmT8\SmWkcK^ZHL,*n,E@eo\RZZIq35'An#;Pq>1+#rR\?0
-D.R<g>][R)iqLn$$2<2cTmU`f>^5GfrsJMW^Sup0@p<p4roX4qqq/c_LiHp1=B\p5>[_/TBQ/*:
-\,>Ii%J7B1J8/V$='/O*;cr&Xrs&Gggrugaor.n@~>
-o`#*daL[Uhiq!*Qrq+T=&eX=;rs]qU$49S'^m5IRb>Su4rr<#jhT2duQC+#+P`30KqYq$'hor9p
-R$j.jL:kmmpX9'JpY39ST:_@%Np#6u$MWDlWLorNKS\[fk5Q1nimu&PTTkChKS>2>Od;B(T;/.&
-r94.io[1OUS<f1eIXHKcG2iK##6"&QgW-\oW;hA~>
-o`#*_Y**4%ipm$Orp7u)p$;5no'G5SYcFP#`80S<da$mpg!]Zqs8DcYY`!(2BkCmdRIp@U%J7;r
-C2Rg"@9\fPp%n[9rsAYqkKfKE@U+lYh>[f[o]t&"L1=JFlK8*_qpN'DH"C;]<*!I??<^cDA7fIh
-AT[29lMhb#f;aXCARA><Dg6PQL$&F8rp%YE[[qAdm&9r7~>
-o`#*_Y**4&ipm$Orp7_N`p:Jb^q6hCN/3h#`80S%YKl1M]Wh22s8DcYY`!(3BkCmdRIp@U%J7;r
-C2Rg"@9eoRp%n[9rsAYqkKfNF@U+lYh>[f[o]t&#L1=JFlK8*_qpW-EH"C;]<**RB?X-rFA7fIh
-AT[29lMh1hf;aXCARA><DuP"jL?AO9rp%YE[[qAem&9r7~>
-o`#*__mY_]ipm$Orp619+6j@9%3>la$;[D7h<&&XcK!"r-M[W@rV>`pZBLK>R$E]4o_SRso[(%8
-R%0S,JXtfnqYnqC$2sJYcaTp<K:M;arsAYrld`SMP_,=gk5Q7phU/s3R#QQ;FaJO^I"dTHR$jJ2
-Rd9t<rsAY\`iu#$O*Z#%reLuJk5YJ\mb?C>^7Lk]W;hA~>
-o`#*ZUkW8cipcsMp"fB8mIV+`m,#gfX.uc7h=(70ftQD>j2T+,rVm5nY_6SBEG/onK^em=$iSSQ
-AoDX/BO>#Io$.1>roKu.@9o]!gA_B@WJ4hdV"!RI)#`C(R!*(K;HJLGZF-p8L1t./AnPUc]DUso
-)>M+?H=pbn?DG-N`Pp?ss8VuHXd"9O@X..9s*t~>
-o`#*ZV1rAeipcsMp"%[8mD9RQ]<IodLmP-[h=(70^o$&bj1r.lrVm5nZ%Q\DEG/onK^em=$iSSQ
-AoDX/BO>&Jo$.1>roKu.@:#c"gA_B@WeOqfV"!RI)#`C)R!*(K;HJLGZF-p8LM:70AnPUd]_q'p
-)>M+@H=pbn?DG-N`Pp?ss8VuHXd"9O@X74:s*t~>
-o`#*Z_lo/TipcsMorV=Eljj%)&ISpQ:SPe`n,)Q69AoU*Sm:^^rsJ57Xc8[=R[9,,nGE4nrS5>X
-Od;]1Ne"S/c2S%Jjhn-]K!+Xtrs%],YE=C=nE9fgrT2G=UmR0gG)iE)[BQToO-H$"R?WcQr9F;"
-ps6[OR?rbYV7X[b`ROGXs81Tm\#Gs[PNf%GJ,~>
-o`#*USpk'WipcsMo^2GHmdq7aj3"U,UTDDin,*+anBoYPs7bI*nbrIpl)/<.WHrAm@s759rsSJ2
-I:ACfH"^Ghc1oQ`#Q</JHsU*ip"TKOrR.Hg?!Y;?kPlCl^8$'h@ola#aP>qAk2+1GFD,9!@UY`"
-lMhao^RTFYA7Bc1lgXH7o_\[gps#U\B4YY(l)=W4~>
-o`#*UT710YipcsMo\e<Am_T^R[@rP8Q`A![n,*+anBoYPs7bI*nbrIpl)8B/WI&Gn@s@;:rsSJ2
-I:JIhH"^Ghc1oQ`#Q</JHsU-jp"TKOrR7Qi?!Y>@kPlCl^8$'h@ola$aP>qAk2+1HF_GB"@UYc#
-lMhao^moOZA7Bf2lgXH7o_\[gps#U\B4YY)l)=W4~>
-o`#*U^T!9KipcsMoS[$&m1'g>$OR5:U;YmVqu6WbdF%F_pYacqrVm5h`LVjeVOa*;PjJ;I$hVcD
-Ln(08RYu[Aps&gDrS#,eNe"q<g]%NWg;9eIJ&_3FrttFU_PirgJp*g.gudh_hT2LdS!f\/M6-I:
-ru(IQ]q_!^O-@uWnF?&@qu?]ke&%uMR$+!(W;hA~>
-o`#-TSpXpVgA^[C"T@]_p\""I$M!,kX.uc7h=(7?rr39#nF?DUrqQ0`rr3B*gRr(l_2W\Q@;"d$
-rs\kUW+'bVOa^kHB&<L2rs/AEVfl9Mg%sJ'#Pc0+F'E),qrn%trnXZ6D.[6aLXGVgrr<#sm`B`\
->$>!/P4JSO$NB_ai7ci8j6?C=rVn,AnE]E#]pj(TASZtFkNV-or9Wb8k/F0@AnGb*cfjZYk3)`H
-s*t~>
-o`#-TT6t$XgA^[C"T@N>dDbRk$Ga!9LmP-[h=(7?rr39#nF?DUrqQ0`rr3B*gS&.n_2`bR@;+j%
-rs\kUW+'eWP($tIBAWU3rs/AEVfl9Ng%sJ'#Pc0,F'E,-qrn%trnX]7D.[6bLXGVgrr<#sm`Bc]
->$>!/P4JSO$NB_ai7cl:j6?C=rVn,AnE]E#]ps.UASd(HkN_3pr9`h9k/F3AAnGb*cfjZZk3)`H
-s*t~>
-o`#-T^Sd0Lh#?mE"T?Pj8f@%,#n77L:SPe`n,*+`rs8Jjnb`@cq"=O`rsSh_^m'YkXJMAJMs($<%
-/o#$Nf(?RWL/KohYk_!#PlogUksTSqV2#Tps-RHLk+4Vkl2P"ilJBrR?NDkdI@&4s8W&caeauPL
-OslIo)8RqrqGmFjQ#7bn,!%^s!.O8nF5Vd]qLj]S#+d)n*KQAnaQ&6d_hlKR@9u)mdKW2mf'BhJ
-,~>
-p&>9rfUI1qAAA*6rr_uaq"=(I#jTO4W5RN\qu6*b%/\5;@X67aIVN;&b5VD?%K>h.I9iVgS:>$Q
-E97)srseu&j4W#8g[4q*f#-ePrVm?+nD;IBrVulhiRu`LrqQL&rp\gma3WGQSnqYIiVrfU$iTGD
-a6`g)o\S-WrVQU'rTr7if@K0ao\.C>rVlg-o=(-$>B&X%s8W)nimu]Zq>V-,le:"AlMgh`q8/\K
-BP(dkW9sT^rr`5OC0CL:32Q3Grq"sk`4`U`XfSb5[(FcZrr;`7_S!FWKl(F7COr.a[$dWS`50!q
-Y)I=3B52a`ZFI90PP;6[J,~>
-p&>9rfUI1qA\\37rri&Tfuh5$_?d`GLo&&Gn,*+Rrs\eJS76chQ@<RWB$1,Prsetr]7!t[aII`i
->B/d(r;R6*puL,ZfA#]jm+92@rr)j+rp\difDYaKo\nKRn,E+^%K>kSdE'\f^7T4HCZ59krsSel
-f>m7Wrq,'tir/cS!r_K>rmqA<rUegbg&:pM&+d8uBNoH9rr<#tpu9oVrV?I,rTi4kf'<87s7sR(
-H>$o$D5ck$r;Qltf5"Rg=?*/Js8MWGcG[H+YcY"3['dNop&>!cb/:m&VhJu"B5<*mZa?0pm)?fO
-]!%'3AnPk)S[,f5R[!QLs*t~>
-p&>9rgq9PJM9,Ydrri%ZC+^+e%L<LO$BrEan,*+Rrs\eS]T/*!ZDj@WMUDG&rsetsc_uAqb.Xg>
-KSegir;R6*q<I#!ioT_.nD`!err)j+rq#=.ir/oVp?CVroD\Ob%K>t_hUpZCcbH$,L#N%0rsSeq
-in3f#rq>O6lM^V[!r_WLro+.MrV#=)jSf)X&+dlSRtQUXrr<#tq<Hu!rV?I,rUAn.iU?dGs7t$U
-Vja$?QaH/Zr;QltfoULXFuZ\rs8M]Rh:U3%b/hWGc-=Vmp\t3eg"4[!`N>`"R@UCobg!f8m+Bn9
-dE/\dR@0SC^<FsK]X.@8s*t~>
-p&>9qe<bGiA\.^/rri;fq=jRMoEO?eX3pA4rpKdpp:Z]!N7jqXD.7%`qYpL'qp)$GD:$7nHsp9;
-li$i-rqG-bVh9;XWO9ORQuhZnrpJ^ob/:HB[J'1A`k&CNP0Nt&ruh:,e%:laFG6?XK4J52kPk5<
-g!RmUUOqY(gr[+(Ls#\qrsnq`b-[7VNMEen_5D=oqYpL+m]_pd>`%bGs8D-*^8cn'rVca4rqG*\
-UR%RPTs=LpoX0j'AnG[iJ'@WcrVlruke@"p3O[W8qqfH+UlpI\G'/(ZK85MVUXoD3Z^lo'H#IA.
-B52C3Jph<eeu=peJpMEMAnPdpG_(KqBRfHQs*t~>
-p&>9qeX1VkB"Rm1rri;ahU9C2_?RE4UXAN,rpKdpp:Z]!N7jqXD.7(aqYpL'qp)$GD:$7oHsp9;
-li$i-rqG-bVh9>YWO9RTQuq`orpJ^ob/:HB[J'1Aa1ALOPKj('ruh:,e@_)dFbQHYK4J53kPk5<
-g!RmVUP%_)grd1)M9Gksrsnqab-[7VNMEen_5D@qqYpL+m]i!e>`%bGs8D-*^T*"(rVca4rqG*\
-Um@[QU9XUqoX0j'AnG[iJ'@WcrVlruke@"p3O[W8qqfK,UlpI\G'/(ZK85MWUt5M4[%3#(H#IA.
-B52C3Jph<feuG!fJpMEMAnPdpG_(KqBRfHQs*t~>
-p&>9qft+#DNPkS`rri;GI7tRI%L*@LG1#aTrpKdpp<0q%SCt?PSs,,KqYpL'qq8lGL!\,[W02b$
-li$i-rqPR,`2olF`Qm#^\sr*crpo:3gXjTRanGAcg!Rs[\(^fXruh:0i6o0.Trl)DXHnR#kPk;D
-j58S@_Q2qsjkJ/#Yh8pRrsnqigWd+&Zbjr8e\n',qYpL+m_u]%Jskp(s8D<?eAeW;rVca,rqPO'
-_R[J$_9)TSoYn85rg<nYWS.(GrVlruke@"p3O[W8qrZY\_R?YIUnaccXKT%E_;Y@\aM+mZV4X3E
-R@BhGX/VG]f#G5%X/DV[R@0P9V5p_tQ^[?Fs*t~>
-p&>9qh3`IuAXiDbrr_rbq"=%H"QI&9o)A"U*:U4g@'&CoM/d$8Re?^\rp@4;=eXcaRs8=HV""B`
-,Q6oOY@q-TL6-A%LjW]Uk5P%GR[TP$I!M[1Y`jQ^I!fUSo_e_Fqq]5`?s\8GL2:U?@9ecXrRd?u
-QBI#DJ()9=P_4-kL%YKFp!UC%?<qlDE-@"k@q49irr3PoWJFtfV""E_i5)4IFCTpprr4)=jN*g$
-D1d%QHuQ7cnZ7LaAnG^mH'tnN`mNB$me,iCi[s?cpsm0RKlLX0=^#'8?=RSaG_1XmkFcNo?"%;V
-An>FX>?Y-1Gg1_G>$PKHralFG?X-c<=BBS.Y5a"~>
-p&>9qh3iP!AXrJcrri#Ufuh5#_?@3>b4>PuruCO6LL@4DZANX3A"3/ks8MDqFBYBr\XRhO?DR)i
-s!.L-bcb\bCPIpiI#*/[G38esTUVC9N-orM`j(_WH$k!QI.[@:1]-"IT3tuSP_O!hCLLJ,m/>S$
-PEqAeEe)WUY`sc`AqfpXrq4^MJR2W/QuR;)L1=cKqYpL+l)KPJ?)6uirSYPgMf`H\o`"k4rT)%i
-AT!0GEdVi/qsgbCDe<TpCjDGQ^W+[PkjJ-.rSfElo_?tPTnRJs?<LH:>[CoPD0UYebNGR5>[:cL
-AnGU`?<^T8=*`&@?s6fDAH$0H@p`JE>$+jJl)t&:~>
-p&>9qh7BGJO0/-Irri"VC+^+d%Km4Eb4>PuruCOJYD'@D^TaArN32dQs8MH3UO9'!ah4I3K!+VB
-s!.L1grc+;Js;grVm*+\O66H7^q@=jZ`'b5eB>>$V5L5[Sb2j[1]-:d^Q<o(S=,b7SW\Vqm/>nQ
-\%/rNTr-Gkb.+RLPbIdMrq>6rX,)+]TUDUZYEajsqYpL+l,KrjJZeMBrTDbLZ(mDOo`"k4rT`+M
-OGT3hTr=U#qshD(T:)+9SYj!@e(<I8mIKr7rSfj#o_@Cq_6'AqNJ3%>LlR^eSu&Kjg#oo6Mi<gc
-R@0G,NerOFIZr$VOGJgWQC+)-Q&gfYLP:29l)t&:~>
-p&>9ri0S\"A;0RGrri;fq=jRLoE4*fhYld?6gCXi@*J&VNH8W?MXg`Hqok^>C=;@PQZHJ=](Q+'
-rp%Lt?rMQ_`P77JBOP/&l2U+CMfW]JAS$."@r6'lA7f4[l2CX3qprKA=]_$-c+SaGB4,#@nb_+7
-M/R3CCN#8KEbJrj>'B93oZXOW<,AJK_jGIX@p<^+rVuosf;*h$?,H=6hQhEB?sHc`mJm4bi5(4Q
-EjE?WHZ!A@o('&0AS#IdBP_jEO-ucBZ*q3U`p!F%s81?YR<W=O<Duq-Am\kN&Rf6aDJsd;KO7ef
-@q'%^@p2q3<t'#lAm/8?A79%]AR/=6<rm7(Y5a"~>
-p&>9ri0\b#A;9XHrri;`hU0=0_?70AhYld?6gCXi@*J&VNcS`AMt-iIqok^>CXVIQQucS?](Q+'
-rp%Lt?rVZa`P77JBOP/&l2U+CN,rfKAS$."A8Z6nA7f4\l2CX3qprKA=]_$-c+SdHB4,&Anb_+7
-MK!BECN,AMEbJrj>'K?4oZaUX<,AJK_jPRZ@p<a,rVuosf;3n%?GcF7hm.NC?sHfbmJm4bi5(4R
-F0`HXHu<JBo(')2AS#IdBP_jEO-ucBZ*q3U`p!F%s81BZR<W=O<Dut/B4,%P&Rf6aDJsg<Kj\"j
-@q'%^@p2q3=:B/nB3SJCART.^AR/=6=93C*Y5a"~>
-p&>9ri4>bPOe;19rri;8HV,1C%Kd.DhYld?6gDU_K$Nf-Z_<_HU%/0_qq&W>K$ro&\tP+6_"Ia-
-rpACTOEHPj`P8(;RZ`8jl2U+TT9u1=Q^+/*LkgkKQ'm\hl2CX$qr-#2L3B3*c+Td@R?3$'nb_4I
-SX,h7S=?^MQBIJoJro?up"[`^H\&04_kiuoQ%k"NrVuosh8?4OJB%<]jijTgOG\IOmJm4bkLHeg
-KsJ@mVk0*@o('PkR$a;0R[p7U[(F2obKeJ^fC&Y<ruh3rdCZ6COFVLsH[U3kM34-nStDk)UOdT>
-N0K]tQ%s\aFps/NMgBPoMisHqQ]-:hFodB_Y5a"~>
-o`#-UP]^SJEpNAts7??ep$D;Pj2'a@s$ZkAU1IrnpXt[MAn6;Vs8MDpDHa4-l`?4a>@#qYs8MT-
-Uh!JR`T-LO]o6r=>bplho%(RBIqiCm<HOn>XaY%t?!u^ls"s]2]Tc]&S^Zrtj/n,S?<t/8rU&.L
-P(%.V@TRN?IUlARM<ju\Z$BA\]%ZT=bE7$Y?%_A?s!RZ_T6+:JgA'O+AS-3k;,aC]s8ColO^)V7
-i9Sg_H!=\@pX=Lu@:]@L6"akGDfpAVKo(nYS%ALrl+*7-B44b;GbVLOYFBWC@qB:fBnaC,WMYDh
-BP(^[H)@R?YKGP5WMueYFD>Du?YQ>8W<09Gn#l\@~>
-o`#-UP]^SJF6iJu"SCd-ai!M_!jnlbli0BPgnSFnhY5]cF(Ss2mJm1Q[r,BQl0GF5CKk,uqZ$Qc
-`2$pDIDt7:kIupq?sTSts74aUQ[`aY<`X@9ZE8UlAmJj*rr4hRhS#.Z=.Rh,o]**2D-gP[p&4:.
-^6="\A7AY\T7:BM:l=T7bcuFoA\-U`m)tQ:@U4WMrr4AB`h.?WA_Qq9XCZ!i>#A4rn,N@F^l_l9
-^>S>*T6XXLl1`YT@:<^GAjL'CC2\6@J;&iAR%1bbropt^G\:Ga;L,"B[BH'B@Uit^C2&C<YGnCS
-E+iim??rEIWNXIt^T"31P'(MOA7')Iri#t&b3uM5J,~>
-o`#-U[\T=SPO%l@"S@FZ.M;%X!Y#=mli0BPhnbV3hY5^3U6q+2mJm1Rc(B?gl0H9rSV_jLqZ$Qd
-f>Eo"N5aiIkJ4BrO+FJ's74aUW2c>LJ9QgEZE9[fR#H[Xrr4hRjO:SrG,*OQo]*EbSrJ99p&4:.
-^8S$$QAg6HTotC_ELH.gg<6=BICe/#m)uW0PD,:crr4DCdD)H4L"c=`a-)"2J9>q:n,N@Le[C3_
-^>S>*];CF;l1`YtO-,crrg?$?S=cRSWi`M5]"H>crp.qDV4!KrEJUEr[BH3^Ng,p!S!g%fYGnCg
-T:;74KnuV*WNXIt^T"31S>)L@QAU6hri#t&b3uM5J,~>
-o`#0XQ?d.RC=`CXrr`5dq=a^X#P.6Ah:prSnbMeYji6<Gs*X^eS76L"rSWl_B4,B:s81'6??Olp
-kbj/H>\i<ts8'mAH<=RmlhpeYbaWf_?,?77r:T0RP&"9(NPF*,fq*h.>@QXms8MN%Tk.;IdI[A;
-oXpN1>@#qYrqlBKViGOu<-5k$Z=$^Xbja>pN*KGaiVEKOiLka1>F"XUs"!`PRr)P[i7t\PD5jp_
-B:%6Erp[^p@9KJfqu,0MEE[;BrTCV-?<UZD@qGOL3bN,AF*`26p!9XhC1LLJLVhd-kiC=+Iq`J+
-BObeoj5S[aL2U[5?]*IpioKLtl/L^YZ\rm:A7'B*ro+"?mJ=!cJ,~>
-o`#0XQ?d.RC=`CXrri;^h9a+<_?[lg['-X=]"n-Y!k,,gli2A0bFN*_jo+,%G%Y2rl2UY*TO2lo
-punZ2AR'$0rr;i<YBj;Z_s@7#q95@Q?=(MBs8;QOY**R)=H1)Ijk68YAm8d*s8W)f^7f+?Fj]g[
-s7EsjEEcc&qYpBbj/@uR>uc!\d'@(]H-Gd3[u=QoWo<dQrSaH$@9f)crr4M@\XRGDI,NeeB5X`W
-EbLilp\sZtSmbg"j88f-YAm`bjo+ANE*c^S@:NmGAiaR<CNFfKX7af>JSJ_!<JSHFk31mW\pnF*
-AnY[i_W0Y-Tn[Jt@UG#Eio9%do',/nh6`,^An57idf/5-jR)fHs*t~>
-o`#0XZDF%TOkTg.rri;6GXNAF%fQn=$k3[@%K[(Cip6Vlqp`<?MWOfp[%s+OMs:9=fYE<!fD+RK
-YEt#uiVrlRfZL+DHc,1Is7t*VUlBoEpAb'`jhS?rLj56#fB(\kXI4lrj8]/Yo$Y@AI>H;Brr;W3
-\Y+e/g%t^Fp#EcnSVqcK^<j<AFc+E4iQnfeGcp$$rr(fjX-/%/mf*5;oZ=b;N0iJ`c'<p^[>9=)
-fD#:7e\@5mXQ03Vh8u@BLZSKt\W)?!NKKHlR/<:3R[p1NVo/2[a/b\qLj#!!g?.V[f".<;R$jD.
-P0)bDf<h]QR?NDqfAbfNmIKN$in_;RTp_4(MphUa!p&bFY5a"~>
-o`#0\SpbBcC8q('s8V]lq"=XY%.`iKfuLG"XLZ^>n+6GK"6[b[rp9Y=p:Z`"MX1<)Q?m4QA^gVB
-[r,BTm/>M0IUZQ1kl:YD[?G'&OQ-0;s7sX)F';l'qu6UAn$/*h>B%aLq>TigP@e$<jo>AXd]\:.
-=gIAms8V`'Rr2JHiVriV+7#tfA63'HjRh6#W5n/m\tE_>E7O^_s8LoOJ6uQaoD\bEn#qskCQ?fU
-NHDegi5i[anbr@/Y'aSseG&t.`0FV+L["j6hQqZ;=^"s4>$P?@@V#IM->.(*HI]WtFCnucBufQ:
-rr;umj0s>IAnPXcTDANWY`Ed9@UPDiq>U`q`g(a[A70WGW;hA~>
-o`#0\T7(KdC9%.(rr_oSfZF-0%)KWdXe(W3Q'8&Q^;9]`"1Y&Urp9Y=p:Z`"MX1<)Q[3=RB%-_C
-\8GNVm/>M1IUZT3kl:YD[?G'&OQ-0;s7sX)F';o(qu6UAn$/*h>B%aLq>TigP@e$=jo>AXe$"C/
-=gIAms8V`'Rr2JHiVriV+7#tfA63*IjRh6$W5n/m\tE_>E7O^_s8LoPJ6uQaoD\bEn$&$lCQHlV
-NHMkhi5i[anbr@0Y'aSteG&t.`0FV+M!=s7hQqZ<=^"s4>$P?@@V#IM->.(*He#`uFCnucC<,Z;
-rr;umj0sAJAnPXcT_\WXY`Ed9@UPDiq>U`q`g1g\A70ZHW;hA~>
-o`#0\[&KU_Q+HhcrrhtK@jhld%L<LP$OR1D$4IC>%Kd.J\,Pao0_W]"MONl2k-LqSP)Iuklcu,M
-[d<tJ_5WZQP3DrFkg$Z$I@K6ns8VoA^7pF4gACmL-1Aj`R"U19l1t>I_7,hcM<4d;qqK5oML)_s
-rr<#jah44$L#N%1ru^RG[$H5f\`ED<WN+#'n^"t>JVDYKs8W)W_Q&ZH[e'Lu1@N2lSX6>,e$G.J
-h;HAhf(&_9fZC(LMq%M#maeq,FI27lptiE>I=$HqL51YFO->otrg>(&RAS]_]q_!ZJq:u.qu6Wp
-puAo]R@'D.NjAK\n\MT+R?WN'nbN1jps-FGR?ieol)=W4~>
-o`#0bY^gP%AUF"BrtYM!q=aIQn`o#X]W8'.Uo1&mdH'cfr:C*SaOC%Qs!@0?Lg[%Js6HG3Cgq%n
-ouW_1FkQTeb+Eug>E%qKqSoF\>[52<rr35r]:3S@DrUcqru1.$M.9eIk5G>[n#qsd>`%bGs7Edj
-C0PN+q>UBun?A-h>^,B1ruh="Vh8A[No'X3o&/HpqV830@9]8err<#sd%GYh?IeiMs$GtLMJI3l
-WL\$Lh"gg9me6VZn[4^#D4p%Yf"HrE;.[o@s8McQa0:YNB4=qD<`r[6@:a%_B4Z"YTnR;p@9eiS
-rVZ[/q:UdLB4b[`MXpf;Y`Ed9@UPDiq>U`q`g(a[A70WGW;hA~>
-o`#0bY^pV&AUO(CrtYLoh9a*W^Ug\GQ&(ZkTr4WYVR=.Sr5&QGT?[9"s!@0?Lgd+Ks6HG3Cgq(o
-ouWb3G1l]fb+O&h>E/"LqT#L]>[52<rr35r]:3S@E8plrru1.%M.9eIk5G>[n$&$e>`%bGs7Egk
-C0PQ,q>UBun?A-h>^5H2ruh="W.SJ\O5Ba4o&/HpqV861@9f>frr<#sd%P_i?e+rNs$GtLMJI3l
-WL\$Lh"gg9me6VZn[=d$D4p%Yf"HrE;.[o@s8McQa0:\OB4G%F='8d7@:a%_B4Z"YTnR;p@9noT
-rVZ[/q:UdLB4b[aMt6o<Y`Ed9@UPDiq>U`q`g1g\A70ZHW;hA~>
-o`#0b]W7TkQC[U@rtG@EGXN>X%LijU$ORA5O/J%.$k<%C!t>X6qs=>/nA_\eY42JW[]>s`O3@4I
-]n_Htq>/RTVNHG#m/Qq2`2AK?`Uj*/#PH6PSV;mZrr2p9l,KrlJskd"s8VQ,\<_`7lMpnVbe9O"
-K\-&!rs%u3\=&&2kPkK(ro:quO+!JRqYp'Di:$O$aKUeVVX"0\s8CQbV2BfRq#::Ll,9itTWQ2I
-TTe1,qXEqHrVuE4\t5=nk4.H[Z&!FLb4>T3pZ';uR#$3<G'/"VK8PhYrg=.\T"De@SXGUlSE9_I
-rtG4]XJ2,NQB%[0s7*q4Tp_.$V"+9\#l)]UUm[O-Om/hEJ,~>
-o`#3jbCF>>ASnsUq#CBd'DV7gjOV8SX/2Yr_q3baZ*MsCnGMn\kK)$Fm/JBsWH)@^pAaWdLi?m?
-V;AUk=gIDnot?l=?X0]'s7*C\C0YK.qu6U"n?A-g>_D;?rs/PTUjlcWV"+Ha&F-<R@9]Mrs8M,[
-M.9eHkl1S]#4&4H@pFuZrr3`3dA)"m>f6.3s8DinrqXF(H<spup&=t,pq`M@>@ugls8W)RV1E2e
-Dfg)5C;'TDs!%ElW.SVlHC1@VA6;lY^#f.ks8Mocj4)&ZZE0a]K6:j;@fBsHA8HgPF(f/o@'0"s
-rtGCrV1reuA70`Ns7*=SEFrZfPO\JK#l)E)G@kAnGNl(+J,~>
-o`#3jbCOD?AT#$Vq#;*$jOhPe[Ao^TLm4C4_q3baZ)=V2^\kqN\=^n<m/JBsWH)@_pAaWdLi?m@
-V;AUk=gIDnot?l=?X9c(s7*F]C0YN/qu6U"n?A-g>_MA@rs/PTV12lYV"+Ha&F-?S@9fVts8M,\
-M.9eHkl1S]#4&7I@pFuZrr3`3dA2(n>f6.3s8DinrqXF(H<st!p&=t,pq`PA>A)mms8W)RVL`;f
-Dfg)5CVKcFs!%EmWIn_mHC:IYAQW#[^#f.ks8Mocj4)&ZZE0a]KQV!=@fBsHA8HjQF(f/o@BK+t
-rtGCrV1reuA70cOs7*=SEFrZfPO\JK#l)E*G@kAnGj21,J,~>
-o`#3jcDmA%R$u+pq#;'#L1;M>%1EUO$8Q4s_q3bg[V$!Xq[N];$_d@^s!?sKU4UDYs7!b+T9bhU
-iQdg:[d="dbIs^4J@+nIn]AA4LP4I[rr32l`OM7fQ0J;J#QEPsWfVe7nc&P"lGg)kJ?JDAro_;*
-P_,:drr2p%lbg&oK:M<-rtYLb_PW3<`Ua$.rVQQmq9ZpSNI].Drr3c/cG#s,KAc_.s8LonX-f*A
-U8+-@b5M8<0`BeGXI#0H]>1J/H?G(Xjno)Xrql6GeA]#)XJ;/DLPLnSR$jA-RA@$\R[K:l[IX4p
-'E77+Y+:uHN0N`0n\MT+R?WN'nbN1jps-FGR?ieol)=W4~>
-o`#6qhi2JbBP;n\rqcX2rTs@QiQJ^2WMHN)cJe6bqt/mh\(g-:rU^3Ub0]qNs!Ia#U1@`equ?<%
-MfWKKPI?KVHeJ5pn?A-r?!bbLs66G:A6jWHrr2p%l`,nQ?(CB_ru1aRT6O[J_=mp/rn!uq?!YVI
-s8C?>I:6K`nbrIlk,*c>?)7#irs/;5So@qLh#%!K#P"s\DHgE%r;Q^#o!Oiu>B]0.rs\eJTm:$G
-@q]FcB8?0Xs"O5]RWMk;>[1HHEJ1:2jQkXVf\"]ol1a`6kMtCKbe^K:DeN`p@V0q-C1_'eA@D7/
-rt=e+P]:;G?Ztc8nZ\'oAn#/3nbN1jpr8SCAn5:nl)=W4~>
-o`#6qhi;SdBP;n\rqcX2rT2eVZ_ES<PaA5XcJe6bqt/mhXKK+KrPAZITum)ss!Ia#UL[lgqu?<&
-N,rTLPdc]YI+e>qn?A-r?!khMs66J;A6s`Jrr2p%l`,nQ?(CB_ru1aRT6O[K_Y4$0rn+)s?!b\J
-s8C?>I:6NanbrIlk,3i??DR,jrs/;5So@qMh#%!K#P"s\DHgH&r;Q^#o!Oiu>Bf6/rs\eJU3U-H
-@qfLdB8?0Xs"O5]RWMk;?!UZLEJ1:2jQkXVg"Fosl1a`6kMtCKbe^K;DeN`p@V0q-C1_'eA[_@0
-rt=e,P]:;G?[(i9nZ\'oAn#/3nbN1jpr8VDAn5:ol)=W4~>
-o`#6qhl337R[Kr<rqcX1rOd/&%1ERN(Jp@-cJe6cqt/mhBabIK%Kd.JT_RpS-N;o=Q%@Zds7F@;
-TpVIXag?_[g%k[;`jhY!JBmohl,BilL6Ca!rr32g_m>PYW:0`c)Z%jrV2^#FpAb0lh8?4MJ'@Ze
-rRercObC(2rVm)a`3#/RY4;Mk#PZKWT883VqtpBun\qu/Lk"4Xrr32na1@^nNTU6?%/\PiV2p+[
-Ng,rtV=jcd0_il(UQ'_NI<pEsOK-@^n)i]kj5ASXp[RS4j5&80_69B$S!f\.OI;f4R@07s^A%L(
-'(<]HTp_1&OmE&;_6fo(P_c.*q>U`qcFKa=Q].'kW;hA~>
-o`#6sm&bA@AnZ4XqYL4/o^_[uY,e@pZGkP^oAlm+n,)qIb.c]qnc&._lHdfNmJeL0bFE$\j8T)R
-d>r?]DM3^N?+fV)s6HVBB3Sj$rVkNCIUccGm/I"iro']*?X'c,rr3o/\XRSB?/#2Us8'd/F'N>5
-r;ZQ,R<N(I[.aM!#Q<)DHsU*ip&=srn["Qp>^,?0qu6oeV28knEo[/urs%npP@RmUli-nnp:Zu8
->$@)HDJ!EsdJj+E(\4npDI@4VWi`_GcJS-cftXqsXe:!`qu6U*rr)WambP(/EFrcg@#Aq&AclRU
-U\FWb'(</mEFrZbHKtP#Y`Ed9@UPDiq>U`q`g(a[AR]oKW;hA~>
-o`#6sm&bDAAnZ7YqYL4/o\[]`MhmXjZGkP^oAlp-n,)qIb-/"Z^])(P\u!F@mJeL0bFN*]j8T)R
-d?&E^DM3aO?+fV)s6HYCB3Sm%rVkNDIUccHm/I"iro'`+?X0i-rr3o/\sm\C?J>;Vs8'd/F'N>5
-r;ZQ,R<N(J[.aM!#Q<)EHsU-jp&=srn[+Wq>^5E1qu6oeVMStoF6!9!rs%npP@RmUli-nnp:Zu8
->$@)HDJ!EtdJj+E(\4qqDI@7WWi`_GcJS-cftXqsXe:$aqu6U*rr)WambP+1EFrcg@#Aq&AclRV
-U\FWb'(</mEFrZbHKtP#Y`Ed9@UPDiq>U`q`g1g\AR]rLW;hA~>
-o`#6sm'rdWR@Bk\qYL4.oOf9T$48nBZGkP^oBO;snb`.Kb#AfZr=/o=%$LAPs!@Ql]oS!0rr;cB
-[%`t\XKIS0^@)"#lbg&sLk4C\rnbDhP_bsurr36&j27pYJ%5.Mru1OP]V((0gACpMqU30RLP"@[
-s7jjNUlgAEpAY'srRnubNe"q<rr35na1@[mNop?<rs.l(Z'pW1j8T&X#4BF=Q%>Fjrr3H$bIsO&
-H'jtfR?j2mrr)j5o#.u.N.\"-XgZ'khsgC!eBZ.V^S]QYrr3`4rV6$Qh7C%fR@&tgR[ok6R?iuB
-p\On&n&Mu4R?N>dlMpCj[%WnPLnsS:rs8DF\YPX[Ng&_+s*t~>
-oD]-ke:VIHBQ8U'qu$I:rTWITVkg?,e)^&okeDar]C5b!rThG=gZ\2"o^'uIp$Mc*p:Z`#M<b-@
-rS<QWAnZ$h=G#B*s8V5ZK4J5,jSo&"Q[*(NPOSSO#Q<&EH<ab,q>UC4n$&$i?#\g&s8V`&S8)8O
-jo5;PZ]K6:A%;=5rs/A=T64CFg%t^J#4&=M@pFuZqYpcaU5*JnGNf#*#3i+C@9ou)rr3GsYa/m*
-FiV=FB4bkDq#14/nZ\'nA9QD\jQZ+*qu6<(TS@c=F)SS`q>Ufm^R]IY@olp:Ir>6t!b[5Xqu7?/
-k-U(`Amef#m/QU[O)\c@@$C-Vrs8D=Q$-bOA9[::s*t~>
-oD]-ke:_OIBQA^*qu$I:rSk;MPaSMbe)^&okeMjt]C5b!rThG+Y.;<a_Rl\Wp$Mc*p:Z`#MX(6A
-rS<TXAnZ$h=G#B*s8V5[K4J5,jSo&"R!E1OPjn\P#Q<&FH<ae-q>UC4n$/*j?#em's8V`&S8)8P
-jo5;PZ]K6:A%;=5rs/A>T64CGg%t^J#4&=M@pFuZqYpcaUPESoGj,,+#3i+C@:$&*rr3GsZ'K!,
-G/qFHB4bnEq#14/nZ\'nA9QD\jQZ+*qu6<(TS@c=F)\Yaq>Ufm^R]IY@ols;J8Y?u!b[8Yqu7?/
-k-^.aAmef$m/QU[O)\c@@$C-Vrs8D>Q$-bOA9d@;s*t~>
-oD]-ke>&FuR\?e"qu$I3rNm"@+BkGPe)^&omF&)'_XIL(rThEe$k<1G!t>ZQp$Mc*p<0t'Rd0qQ
-rS=fSR@Bb/I$*7]s8V6#Xd+TsjSo&*\tt[NV==Ka#Q<;kVM]lSq>UC4n&Dl+LPb$is8V`6]pj_8
-jo5;P`3c8%M88ocrs/AH^S?[:g%t^J#4'78Q%PUnqYpca]W[fdP3DlE#3j.3P(C"1rr3Gs`jqIi
-M9!H.R@0DFq#14/n\DN(Oc\#NjQZ+*qu6<6^TXQ5Tps$rq>Ufmcb?0BP_4CfTUu.N!g]SOqu7?/
-kKU<'R?2ogm/QUl[%WnPLnsS:rs8DF\>5O[PEtI3s*t~>
-oD]3skbrH1ASZOGVsOE^ruh3s_Psrbh<an5ikpgsNPF3?rr<#qkeY$ekje<3d)>MBs!@0?M.*4L
-s8W)ZQ?m4V@TQdJnG`Idd\;/!>_MAAq9"eAAS-kirr35u`hIN\CuG9krs%_dLh'b>l2L\om]Vgb
->`7qJs73CMEFWXdp\t1)oYR8@?>SU"s8W)WVh8D`V"+<]#3hh8Cgq>Hrr36&goH!5?c2X;rsn@p
-N+6(Lk2;MDBOu/=rr2p%nZ@^h@Vk9*rri>h\rUh0Acl_$li-e]')U1eNc&E6<-H<EEFrfrAoc)n
-r;RH,bc6,*A6N-Ao)J6aO)\c@@$C-VrsAJ=OEG/JA9?`.WW.J~>
-oD]3skbrK2ASZOHW9jN_ruh3o[%t+Oh<an5il$q!Nka<@rr<#qkeXC'\\H"nVRQ-`s!@0?M.3:M
-s8W)ZQ[3=W@TQdJnG`Idd\D5">_VGBq9"hBAS6tkrr35u`hRT]D;bBlrs%_dLh'e@l2L\om]Vgb
->`A"Ks73CNEFW[fp\t1)oYR8@?>\[#s8W)WW.SMbV"+<]#3hk9CgqAIrr36&goQ'6?c2X;rsn@p
-N+6(Lk2;MDBOu2>rr2p%nZIdi@Vt?+rri>h\rUh0Acl_$li-e]')U4fNc&E6<HlKGEFrfrAol/o
-r;RH,c)Z;,A6N0Bo)J6aO)\c@@$C-VrsAJ=O`b8KA9Hf/WW.J~>
-oD]3skd-eER%:(W_XRR(ruh3V>_of0h<an5l.*2,SA3eNrr<#qkeTIl%1WjW$tf(ts!@0SZ%oLO
-s8W)ZZDO(YP_"%onG`IdftjYOKU:s'q9cUFR$496rr35udD;Q7LuA72rs%`,Ya'p*l2L\om`)`%
-Jt20,s73t0TTtVPp\t1)oZk7FMMU6js8W)Y`3#2SY4;Ag#3i_%SWf6#rr36&hoMjZK#m]crsnA4
-Z]p$0k2<83R[9K&rr2p%n\;?&PEP/,rri>ja0_K<R0/nXmf*+`')US3Z_!MAH&BY@TUD4:R%Dn-
-r;RH,fZ0t[Q\^!uo)J6r[%WnPLnsS:rsAJF[A0.XQ_!.8WW.J~>
-o)Bg*dtqgLAnlF@S]^I$s82'2fB2Z"kL6u'D0r;*jnJcQrsJYc_8"[ena+Z@na6>[lE,>?]Cl1'
--L%4TCLpdPK&6D)s7jL(H!t'Mn,N:<N,WB>GO5A0rpIXpE+4(Trr36&gSB=->`J.Mru1+#LLXkt
-nc/X]]7k-6BpJ>js8M,mP\afRkPkJdrR%Bf?<t/8qYqf)RXT$_DT;YTs8(!>H=1:<qu?]qiMM68
->cdMc]Qe%$C6\Mmrs/(sK5P7<\,H:*55jQB]74L*AnZ")S^HX!rqc!<cF9']AR88;ZerB<A7]Cg
-DMZI5s8W)mf!pl_ARAAEfD5I:Y`Ed9@UPDiq>Us#c&-IPB4u1McIg^bb5JLCJ,~>
-o)Bg*du%mMAnlFAT$$R%s82'2fB2Z"kL@&)DLAJ,jnJcQrsJYc_6'iM^UpANna6>[lE,>@]Cl1'
--L%7UCLpdPK&6D)s7jL(H!t'Nn,N:<NGrK?GjPJ1rpIXpE+4(Trr36&gSB=->`S4Nru1+#LLXkt
-nc/X]]7k-6C6nMls8M,mP\afRkPkJdrR%Eg?=(59qYqf)Rso-`DT;YTs8(!>H=1==qu?]qiMV<9
-?**Vd]Qn+%C6\Mmrs/(sK5P7<\,H:*55jQB]7=R+AnZ")T$lg#rqc!<cFB-^AR88;ZerB=A7]Cg
-DMZI5s8W)mf!pl_ARAAFfD5I:Y`Ed9@UPDiq>Us#c&6OQB4u1NcIgacbPeUDJ,~>
-o)Bg*e"E%mR%0kP^=i/Xs82'2fB2Z"mGQ<uP`W&jjnJcQrsJYc_*8>;%LihXna6>[lGocU_=dg-
--L%t?SX5:\Ol$!8s7jpTV36P3n,N:<Z_*YOSF$:Urp\=LT9#/urr36&hSQ:UJtDB/ru1+@YEb!S
-nc/X]`NGf"R'-)]s8M92\=J\DkPkJdrReucNe"q<qYqf)[],gaR*bg3s8(?dViZ_hqu?]qj2A$\
-J@+n:_5*KeR^)Yers/)/XIbfI`r5l955jcd_Q'&lR@9\C^#&/Trql3IgsER+R#ZK:\)4upQC+)0
-T<HoFs8W)niR#$+R#ZK?fD5I:_6fo(P_c.*q>Us#d^#L4R@BhYgZ%2BgAS2SJ,~>
-o)Ba/m(IUQ@qB=nJ![1Jce7C<f@J6]Vg;umQbhDFr;-F"qrY`0g$%bO`:<9q#6*J_F)'D)rr4>5
-W.f+u<a*6,rr<#i^n5aYBXIF3ro&]MAnPt[p&*jhVh8bsIHgb2-2YoZH='sZo)Jagd@G\sD6rp8
-s7k,rBP(q$_Ya,_]:+%ZAprqCrs/;6Soe1Bg%tRFEU03?BP2(>lM^"mYDdF1DqY-is8CB@HsL(&
-p\NU&D.[I&_>XE6oYc)fAncbIrVui^c'`OhJ7iA'B4u::SZ]T?_S<LQLiHp0:fES5o@f+9@:a(g
-H'PYSbKe,8P]gVF;H'1Mrr;MmO)\c@@$C-Vrsnq]JnS_-BPrBkWhXj:p9+FG~>
-o)Ba/m(IXR@qB=nJ![4Ld+[R>f[e?_W-W)oR).MGr;-F"qrY_sXgu'C\+/nd#6*J`F)0J*rr4>5
-W.f+u<a*6,rr<#i^n5aYBXIF3ro&`NAnQ"\p&*jiVh8bsId-k3-2YoZH='sZo)Jagd@PbtDR9$9
-s7k,sBP(q%_Ya,_]UF.[Aq'"Drs/;6Soe1Cg%tRFEU06@BP2(?lM^"mYDdF1E7t6js8CBAHsL+'
-p\NU&DJ!R'_YsN7oYl2hAnceKrVui^cC/akJS/J(B4u::T!,fC_nWURLiHp0:fES5o@f.:@:a(g
-H'Y_Tbg4;:P]gVF;H'1Mrr;MmO)\c@@$C-Vrsnq]K4nh.BPrBkWhXj:p9+FG~>
-o)Ba/m(f'QPaIr5Wk-3th;mk`iSiSA`MSQHT>B7Nr;-F"qrY^Z$k3XSAb#3g#6*T(U6+()rr4>5
-]<.ZgJ9Sfurr<#ic+g$<OM1;dro'oKR$jP^p\a=.`N>\rT'?7S-2Z3-VN6;8o)JagfY4>OR)&Cp
-s7k-ER[BS?dJNb#d_)KIQ(I7>rs/;D^8$O7g%tRFEU0s,R[KYMmeuV/ag.P'QJDK>s8CWfVi6/O
-p\NUASXGq?dJa+FoZ="uR%()6rVuicgq/okT9bb0R@BkN^<+gRf@8*^Yb78=GB9;0o@fq'P*_T.
-VRXe#gYLQ.\"oCPHul1Jrr;N)[%WnPLnsS:rsnq]W0s!?R\$Rn`knUap9+FG~>
-nc'R)iM^Kt?t<kbFFfLGWNrn2QuunCBp6-WlhUPTrs8Ma_8"[bf>[7Ks(;9#lH6&KFN!>@s8VZ#
-MJQNsK&6D(o^(GHP&OuPU>PtMl(Ds(AT*="XcddEAS,Ll[+3%=oXpK)>?o)?s8Vr8NH&QBIE]p?
-q;R?H@V9bCWMY2mBP(geDm\'3d-e,uA6Na,rqcY7o"B-RA8?UbXdaBWB4YXiRa]EmoY-W)=^g.b
-rp-Y+@qKV2^>dMmfnj<LAp9TQaMOii?&[14CgCFYAS>n&J;9&@Km[`H>uXU'PgK""m_s9V?".A\
-G(l6RSs"Y@@Tu]-MUV7us7*1@@piSIP4AAJ%fYUXB3\hR@qB=iA7:epY5a"~>
-nc'R)iM^Kt?t<kbFFfLGWj9"4R<E(FC6Q6XlhUPTrs8Ma_6'iJX0hBcs(;9#lH6)LFN!>@s8VZ$
-MelWtK&6D(o^(JIP&OuPU>PtMl(Ds(AT*@$Y**pHAS,Ll[+<.@oXpK)>?o)?s8Vr8NH&QBIEg!A
-q;RBJ@V9bDWMb8oBkCpfDm\*5d-e0!A6Nd-rqcY7o"B0SA8?UcY+0QZB4YXiS(#QpoY-W)=^p4c
-rp-\,@qKV2^>dMmfnsENAp9WRaMXrk?B!:5CgCFYAS>n&J;9&@Km[`H>uXX(Q-f+#m_s<W?".A\
-G(l6RSs"Y@@Tu]-MUV7us7*1@@piSIP4AAJ%fYUXBO"qS@qB=iA7:epY5a"~>
-nc'R)iNJ<#OHu<*UT:f<`lu]J];(@6JXa7"lhUPTrs8Ma_*8>;$r-6\s(;9'maoFRT$Qg's8VZ-
-Z(6brOl$!7p@74k\"B%Y\E<ejl*-V?R%LS"agRq4QC+&1a5PS)oZOe8LjmD=s8VrAZ_<bSVqKhH
-q;S9;PF8/P`l+mNQ'[l*S]B^>h<r7hQ\C.PrqcX&o#%)_QCY"hah=C>rg7/a\DQ#goZXk7Kn/"X
-rp.%bQ'n5Fd-9EIfqXaoRAILAf[[p/JXOolOc#3bR$sS@Wir\4Y,IqVMgf_kSC$j*m_tEKN0BX"
-Uoq8B^:()5P_j[*Q.,F+s7*h'Q&poVU[e0[%fYUjOc,9aQ'[r1Q&;L1Y5a"~>
-nc'L+p",mS?!CTA?t!MS@pr\J=&s:,]$fg9rUp0qqrY`/eBP_pnc)Gai3TGCAR/\cG-UrEpW.Sa
-:gh?5rqO73TQadJ>$Z,lPPXprG@4QW>$G08OFL_B=^#BOBs$TcB3S;>h#%-Oq9*kc=]o$FBP6f&
-^2mU`r`Tq;CS5cU=]np>C2'g1M.KgeFQ`K"55O#m@p3&?>$>'WQ=jB(=^c&ZNT?L@>>]7urr;`B
-JRDVb>\S1mVWGI1?<^]DBP:jZBq*B3fqN.d>?bE@rEq6b?!C?/;-%Y9dd[58qr>,4?<^T=?X[DR
-@UNJD<)HhTbjYN1s7)^m>$"^$O7E#F"nKol?WgM1=Thf*;NL@Ns*t~>
-nc'L+p",pU?!CTA?t!MS@pr\J=''C.]$fg9rUp0qqrY_rWM?N]nc)GaiO#VEAR/\dGI%,GpW7\c
-:gqE6rqO:5TQadJ>$Z,mPPXprG[OZX>$G08OFLbC=^#BOBs$TcB3S;?h#%-Oq9*nd=]o$FBP?l'
-^2mXar`Tq;CnPoW=]np>C2'g1MIfpfFm&T#55O#nA6N/@>$G-YQ=sH)=^c&[NoZXB>>];!rr;`B
-Jmhed>\S4oVrbR3?<^]DBP:m[C7EK4fqN1e>?bE@rEq6b?!C?/;HIk<dd[58qr>,5?X-c??X[DR
-@UNJD<)HhUbjYN1s7)an>$"^$OR`,G"nKol?WpS2=Thf*;NUFOs*t~>
-nc'L+p"-."K85AFOHG`kQ'.)ZH$+e2]$fg9rUp0qqrY^Z$k+u[nc*5"kKV#QQ].!!UW332pW]Ol
-GC.C"rqOsb^nm-KLl@n"ZMO4<QAC6NLk^D*R$!;]L51hRO1shcQA'R/h#%-Oq9YalL4tJJP)Sku
-^lsS.Lkp_3Jte9^L5(JEPE3H<Y*4EZMWag855O$,MhHkAL4OW0S;i;YL5_=YW8t@QKQVt/rr;`B
-S;W,XMjBou]&gYfKnbMJR@&t_J>(6Pfr9aYKo(eMrK&XlN/3%2F*3/;dd[58qr>2JJqSo;O-,Wj
-PE:]UHZF=pbjYN1s7*LXJ9uQ_TCM^V"nKp)Jpr4KJHUIKF.`!*s*t~>
-nGa:'o@UL#@Tc`5=&r:!<*O-jVSC^HpAOR^#5dQ!\[\s2nc&ag`,8sbrDsP4R.UFUgM'bkOQ-0;
-mYPO[qc>FQG45Cl\:.[a='g0Qa1$"i='KBoY1hojD.[F1jo5;[qr!`H='&mRNP4]TiO!b,<tf%s
-]Zd<l='&U?LT]@gI;<G.R-aYK+TCiPO^M6l>Ap1P`IV;r=(lrVd,:%)An[7ks8W&_]Qa?V)J"5b
-dI?,&I:$&S='K[-]%6?Io@LF+AQW&8r`9J.<)cdtAq$SmhXpdGrtP7f_j,4H='&F(=&r:!<F0sM
-cL(T0rrVc"K`65uJ$AM=rrr>daJ+0"rFQ.II^&CGs*t~>
-nG`^lo@UL#@p8k5$s$>+<Ej6lVSC^HpAOR^#5dQ!Vim_=nc&ag`,B'erE'V6R.UFUgM0knOQ-0;
-mYPR]qcGLSGOPLm\:.^c=C6BTa1$"j=BoTrYM/#lDJ*X5jo5;[qr!`I=BK*VNP4]TiO!e-=;,2!
-]Zd<m=BJgCLTfFhIV`Y2R-aYK+TCiPO^V?o>]?@R`IV>t=D</Yd,:(*B5*Ins8W&_]QjEX)J+;d
-dI?,&IUH8V=Boj/]%6?Io@LF+Am&5:r`9J.<)lk!B7HbohXpdGrtP7f_j,7J='&F(=&r:"<F:'P
-cL(T0rrVc"K`65uJ$AM=rrr>daJ+3$rFZ4JJ$ALHs*t~>
-nG`[ko@UL4J,Xa'H[9mXFEi=sW5$pJpAOR^#5dQ!57013nc&agc]s*,rH8`sWV$5fgQ-Q%S)X>F
-m\bqiqfXW:O73&0\rV,[G']"Ia1@.PG'JS&ZJ+?3LOO]6jo5;[qr"5uG'87gR(r"aiO4XCFq]7c
-]ZdR7G'8+]Pd9$#RY6-?V!RpW:&aV(S:#L'G_;d/`KY^mG(5INd,:gXIXdpSs8W&_^5[>[G(,FI
-eF;G+NdGqjG'J\/]%6?Io@LF7IsH<cH@(!bGBItMIZ12@hXpdGrtP7f_juO.G^4U^H[9jVFaAnF
-cL(T0rrVc+Q2ZR@Nk"ZTrrr>daJY#JrI+j!Nk"Y_s*t~>
-n,EUkpZ'?$Q[esZ#_\MH]Zo="q#9a^"oIH!ZG#VprrW&S\bi?:[++aJroh(qZdSLGs6n+6qPbL=
-b4#B*j2\I*X0fq*n)M6dWirtTh!j[V]"#B!nG`G6rpe@BWiWSBcJnTtpYiumWN<VTkOIBBXfAS8
-akZCObIG'sg%G.?)>idI[]?F4_:e8@bH\(L[`-kamF/_X^=MrUruh-t`36/A[DLGZqY0$k[&K4e
-YeS]Op\t3lp>sQ-SrS-pGmK4fX16=.meZq]rs/Q"m+&kSOb<RW#)SnWa5?IdrVlroim%JA!mTa"
-p\tBnn(c("rO;sCb2W3!s*t~>
-n,EUkpZ'?$Q[esZ#_\MH]Zo="q#9a^"oIH!VmYm]rrW&S\bi?:[++aJroh(qZdSLGs6n+6qPbL=
-b4#B*j2\I*X0fq*n)M6dWirtTh!j[V]"#B!nG`G6rpe@BWiWSBcJnTtpYiumWN<VTkOIBBXfAS8
-akZCObIG'sg%G.?)>idI[]?F4_:e8@bH\(L[`-kamF/_X^=MrUruh-t`36/A[DLGZqY0$k[&K4e
-YeS]Op\t3lp>sQ-Sr\3rGmSeROK5n6h<t.=rVm-%qWubIYE=M:GmAYPS[6Aoo)8Oe!r1d"rl"r`
-iqW9J"T.ZCb.dha"22k:poaXI~>
-n,EUkpZ'?$SW*N'#`tOY]Zo="q#9a^"oIH!@u'F@rrW&S\bi?:[++aJroh(qZdSLGs6n+6qPbL=
-b4#B*j2\I*X0fq*n)M6dWirtTh!j[V]"#B!nG`G6rpe@BWiWSBcJnTtpYiumWN<VTkOIBBXfAS8
-akZCObIG'sg%G.?)>idI[]?F4_:e8@bH\(L[`-kamF/_X^=MrUruh-t`36/A[DLGZqY0$k[&KLm
-YeS]Op\t3lp>sQ-U6^Z7L^Ap$R&da>h<t.=rVm-%qWubIYF1IML^/d#TsMeso)8Oe!r1d"rl"r`
-iqW9J"T.ZCb.dha"22k:poaXI~>
-mJd^oo&\KIa2Q$<cIh1Do_\XSrri5`f&$)irrW/kkkj?Mk4/?Ks7kj<kOSTOs8)-DqViOVmJ?k^
-qsik0j66%1rqYpAj5oUtqYp?\lKRX*qu-O?rU]75j65q(qu6WpqX3J)j6?47rqGd?j5oUtqYp?[
-l07R,rV-=/rUf@7j6#e*rql3Ij5fIoq#:0]lfmd.r;Q^2rqc'EioB7kpAFphqsin.gY_/]p\k$i
-"o\)WgsX=C`<XK0fAPrcqu6Ek#6";aimuAprl#)_d+d^Qqu6Nn!r_obrp^'\q#0pd$i^"om-<j"
-lKn'9rN?0N~>
-mJd^oo&\KIa2Q$<cIh1Do_\XSrri5`f&$)irrW/kkkj?Mk4/?Ks7kj<kOSTOs8)-DqViOVmJ?k^
-qsik0j66%1rqYpAj5oUtqYp?\lKRX*qu-O?rU]75j65q(qu6WpqX3J)j6?47rqGd?j5oUtqYp?[
-l07R,rV-=/rUf@7j6#e*rql3Ij5fIoq#:0]lfmd.r;Q^2rqc'EioB7kpAFphqsin.gY_/]p\k$i
-"o\)WgsX=C`<XK0fAPrcqu6Ek#6";aimuAprl#)_d+d^Qqu6Nn!r_obrp^'\q#0pd$i^"om-<j"
-lKn'9rN?0N~>
-mJd^oo&\KIa2Q$<cIh1Do_\XSrri5`f&$)irrW/kkkj?Mk4/?Ks7kj<kOSTOs8)-DqViOVmJ?k^
-qsik0j66%1rqYpAj5oUtqYp?\lKRX*qu-O?rU]75j65q(qu6WpqX3J)j6?47rqGd?j5oUtqYp?[
-l07R,rV-=/rUf@7j6#e*rql3Ij5fIoq#:0]lfmd.r;Q^2rqc'EioB7kpAFphqsin.gY_/]p\k$i
-"o\)WgsX=C`<XK0fAPrcqu6Ek#6";aimuAprl#)_d+d^Qqu6Nn!r_obrp^'\q#0pd$i^"om-<j"
-lKn'9rN?0N~>
-li.%cq=O[V"7l-]roa:`r:fsaJcF:#!r`#ppAY6oqtK[[nH8@Tq>Kma"9&&fo)A.]o(Mt[LAuc~>
-li.%cq=O[V"7l-]roa:`r:fsaJcF:#!r`#ppAY6oqtK[[nH8@Tq>Kma"9&&fo)A.]o(Mt[LAuc~>
-li.%cq=O[V"7l-]roa:`r:fsaJcF:#!r`#ppAY6oqtK[[nH8@Tq>Kma"9&&fo)A.]o(Mt[LAuc~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-JcC<$JcFs6J,~>
-%%EndData
-showpage
-%%Trailer
-end
-%%EOF
diff --git a/docs/draknet_advanced_doc.txt b/docs/draknet_advanced_doc.txt
deleted file mode 100644
index a0c0c63e0..000000000
--- a/docs/draknet_advanced_doc.txt
+++ /dev/null
@@ -1,165 +0,0 @@
-This document details the entry points you can call without the DrakX graohical
-toolkit. First, the general variables you will encounter further. If you don't
-know wht a variable is, look here. Any additional locally variables are
-commented 'in place'
-
-------------------------------
-Special types (in upper cases)
-------------------------------
- DB_FILE : file storing the ISDN ISP database. see share/isdndb.txt : file of lines in 'Unlisted - edit manually' or /^(.*)\|(.*)\|(.*)=>([0-9]*)=>(.*)=>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})=>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/ where $1=Land $2=City $3=ISP_name $4=phone_number $5=hostname $6=dns1 $7=dns2
-
----------------------------------------------------------------------------------------
-Summary of common variables used (local variables are described in the function itself)
----------------------------------------------------------------------------------------
-notation : keys : description : type : format (regexp or enumeration. `...' means it's not exhaustive
- $prefix : prefix path (empty in post-install) : string : path
- $isLaptop : flag for laptop : boolean or int : guess
- $isdn : hash table containing isdn infos
- $isdn->{login} : cnx login : string
- $isdn->{passwd} : cnx passwd : string
- $isdn->{phone_in} : user phone : /^[0-9]*$/
- $isdn->{phone_out} : ISP phone : /^[0-9]*$/
- $isdn->{dialing_mode} : dialing mode : "auto" or "manual"
- $isdn->{driver} : driver used for the card : "hisax" or "b1pci" or ...
- $isdn->{type} : type of card, used for the driver, see netconnect_consts : integer : /^[1-22]|[24-37]$/
- $isdn->{irq} : irq of the ISA card : integer |
- $isdn->{mem} : mem of the ISA card : string |
- $isdn->{io} : io of the ISA card : string | see netconnect_consts for examples.
- $isdn->{io0} : io0 of the ISA card : string |
- $isdn->{io1} : i01 of the ISA card : string |
- $isdn->{idl} : amount of time after the cnx times out in secs : int
- $isdn->{user_name} : not used anymore. Not explicit. It represented the name of the connexion.
- $isdn->{card_type} : card type : string : "isa" or "pci" or "pcmcia"
- $isdn->{protocol} : cnx protocol : int : 1|2|3 : 1 for old german specific (not used anymore), 2 for europe, 3 for rest of the world
- $isdn->{id} : card id. Associated with vendor, identify strictly the card. see pcitable : integer
- $isdn->{description} : card description from pcitable : string
- $isdn->{vendor} : card vendor : integer
- $isdn->{passwd2} : passwd verification : string
- $modem : hash table containing modem infos
- $modem->{device} : device of the modem : string : /ttyS[0-9]/
- $adsl : hash table containing modem infos
- $adsl->{login} : cnx login : string
- $adsl->{passwd} : cnx passwd : string
- $adsl->{atboot} :
- $netc : hash table containing system-wide networking infos (maybe not true, correct this) :
- $netc->{NET_DEVICE}
- $netc->{dnsServer2}
- $netc->{dnsServer3}
- $netc->{DOMAINNAME2}
- $netc->{NET_INTERFACE} is set to "ppp0"
- $in : interactive object
-
-------------
-Entry points
-------------
-
-isdn_write_config_backend : write isdn info, only for ippp0 -> ask_connect_now
-input :
- $prefix
- $isdn
-$isdn input:
- $isdn->{login} $isdn->{passwd} $isdn->{phone_in} $isdn->{phone_out} $isdn->{dialing_mode}
- $isdn->{driver} $isdn->{type} $isdn->{irq} $isdn->{mem} $isdn->{io} $isdn->{io0} $isdn->{io1}
-
-write_secret_backend : write login and passwd into /etc/ppp/{chap, pap}-secrets. Replace old passwd only if same login
-input :
- $a : login : string : /^.*$/
- $b : passwd : string : /^.*$/
-
-connect_backend : launch the cnx script
-input : $prefix
-
-connect_backend : launch the cnx script
-input : $prefix
-
-read_providers_backend : build the tree of isdn ISP
-input :
- $file : 1st location of the file : ISDN_DB_FILE
- $file2 : 2nd location of the file : ISDN_DB_FILE
-output : the list of ISP : array of strings : array of /^(.*)\|(.*)\|(.*)$/ where $1=Land $2=City $3=ISP_name
-
-get_info_isdn_backend : fills the infos from the line of the tree returned into $isdn and $netc
-input :
- $isdn
- $netc
- $name : the line choosen in the tree of ISP : string : /^(.*)\|(.*)\|(.*)$/ with $1=Land $2=City $3=ISP_name
- $file : 1st location of the file : ISDN_DB_FILE
- $file2 : 2nd location of the file : ISDN_DB_FILE
-$isdn ouput
- $isdn->{user_name}, $isdn->{phone_out}, $netc->{DOMAINNAME2}, $netc->{dnsServer2}, $netc->{dnsServer3},
-$netc output
- $netc->{DOMAINNAME2}, $netc->{dnsServer2}, $netc->{dnsServer3}
-
-isdn_detect_backend : detects isdn pci card and fills the infos in $isdn : only detects one card
-input
- $isdn
-$isdn output:
- $isdn->{description} $isdn->{vendor} $isdn->{id} $isdn->{driver} $isdn->{card_type} $isdn->{type}
-
-isdn_get_list : return isdn cards descriptions list. This function is not use internally.
-output : descriptions : list of strings
-
-isdn_get_info : return isdn card infos. This function is not use internally.
-input : the description of the card (see isdn_get_list)
-output : a reference on the decription of the card. : ref on a hash(description,type,irq,mem,io,io0,io1card,)
-
-conf_network_card_backend : configure the network cards and return the list of them, or configure one specified interface : WARNING, you have to setup the ethernet cards, by calling setup_thiskind($in, 'net', !$::expert, 1) or setup_thiskind_backend before calling this function. Basically, you call this function in 2 times.
-input
- $prefix
- $netc
- $intf
- $type : type of interface, must be given if $interface is : string : "static" or "dhcp"
- $interface : facultative, if given, set this interface and return it in a proper form. If not, return @all_cards
- $ipadr : facultative, ip address of the interface : string
- $netadr : facultative, netaddress of the interface : string
-when $interface is given, informations are written in $intf and $netc. If not, @all_cards is returned.
-$intf output: $device is the result of
- $intf->{$device}->{DEVICE} : which device is concerned : $device is the result of $interface =~ /(eth[0-9]+)/; my $device = $1;;
- $intf->{$device}->{BOOTPROTO} : $type
- $intf->{$device}->{NETMASK} : '255.255.255.0'
- $intf->{$device}->{NETWORK} : $netadr
- $intf->{$device}->{ONBOOT} : "yes"
-$netc output:
- $netc->{nb_cards} : nb of ethernet cards
- $netc->{NET_DEVICE} : this is used to indicate that this eth card is used to connect to internet : $device
-output:
- $all_cards : a list of a list ( (eth1, module1), ... , (ethn, modulen)). Pass the ethx as $interface in further call.
- $device : only returned in case $interface was given it's $interface, but filtered by /eth[0-9+]/ : string : /eth[0-9+]/
-
-adsl_conf_backend : write adsl configuration
-input :
- $prefix
- $adsl
- $netc
- $adsl_type : type of cnx : string : "pptp" or "pppoe"
-$adsl input:
- $adsl->{login}, $adsl->{passwd}, $adsl->{atboot}
-$netc input:
- $netc->{NET_DEVICE}
- $netc->{dnsServer2}
- $netc->{dnsServer3}
- $netc->{DOMAINNAME2}
-$netc output:
- $netc->{NET_INTERFACE} is set to "ppp0"
-
-modem_detect_backend : detects modem on serial ports and fills the infos in $modem : detects only one card
-input
- $modem
- $mouse : facultative, hash containing device to exclude not to test mouse port : ( device => /ttyS[0-9]/ )
-output:
- $modem->{device} : device where the modem were detected
-
-get_net_device : return the device choosen for the net cnx
-no input
-output : name of the internet device.
-
-read_net_conf : read the information stored in $prefix/etc/sysconfig/draknet and $prefix/etc/sysconfig/draknet.`type`
-input:
- $prefix
- $netcnx
- $netc
-
-set_net_conf : set the information from netcnx in $prefix/etc/sysconfig/draknet and $prefix/etc/sysconfig/draknet.`type`
- $prefix
- $netcnx
- $netc : useless! REMOVE ME
diff --git a/docs/interactive/ask_from b/docs/interactive/ask_from
deleted file mode 100755
index dad69247e..000000000
--- a/docs/interactive/ask_from
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/perl
-# Yves Duret <yduret at mandrakesoft.com>
-# license: GPL
-
-use lib qw(/usr/lib/libDrakX);
-use interactive;
-
-my $irq=1;
-my $login;
-my $login2="editable";
-my $check;
-my $range=57;
-
-my $in = 'interactive'->vnew(undef, 'default');
-
-$in->ask_from("window title - ask_from",
- "message\nexamples of utilisation of ask_from",
- [
- { label => "enter scalar", val => \$irq },
- { label => "combo (type=>combo optionnal)", val => \$login, list => ['Netherlands', 'France', 'Belgium', 'Italy', 'UK'], type => 'combo'},
- { label => "choose from list editable and sorted", val => \$login2, list => ['Netherlands', 'France', 'Belgium', 'Italy', 'UK'], not_edit => 0, sort => 1},
- { label => "check box", val => \$check, type => "bool", text => "text" },
- { label => "range", val => \$range, type => 'range', min => 0, max => 100 },
- ],
- complete => sub { print "complete\n";print "$irq\n$login\n$range\n"; },
-# focus_out => sub { print "focus_out\n"},
-# changed => sub { print "changed\n"; },
- ) or $in->exit(0);
-$in->exit(0);
diff --git a/docs/interactive/ask_from_list b/docs/interactive/ask_from_list
deleted file mode 100755
index 63c0ee996..000000000
--- a/docs/interactive/ask_from_list
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-# Yves Duret <yduret at mandrakesoft.com>
-# license: GPL
-
-use lib qw(/usr/lib/libDrakX);
-use common;
-use interactive;
-
-my %l = (
- 0 => "Welcome To Crackers",
- 1 => "Poor",
- 2 => "Low",
- 3 => "Medium",
- 4 => "High",
- 5 => "Paranoid",
- );
-
-my $in = 'interactive'->vnew(undef, 'default');
-
-my $level = $in->ask_from_list("window title - ask_from_list",
- "radio button\nexamples of utilisation of ask_from_list",
- [ values %l ], $l{2}
- ) or $in->exit(0);
-
-print "$level\n";
-$in->exit(0);
-
diff --git a/docs/interactive/ask_from_listf b/docs/interactive/ask_from_listf
deleted file mode 100755
index 077540b49..000000000
--- a/docs/interactive/ask_from_listf
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-# Yves Duret <yduret at mandrakesoft.com>
-# license: GPL
-
-use lib qw(/usr/lib/libDrakX);
-use interactive;
-use Data::Dumper;
-
-my $in = 'interactive'->vnew(undef, 'default');
-
-my @m=(
- { description => "dhcpcd",
- c => 1},
- { description => "dhcpxd",
- c => 3},
- { description => "dhcp-client",
- c => 4},
- );
-my $f = $in->ask_from_listf(_("ask_from_listf"),
- _("Which dhcp client do you want to use?\nDefault is dhcpcd"),
- sub { $_[0]{description} },
- \@m );
-
-print Data::Dumper->Dump([$f],['f']) . "\n";
-
-$in->exit(0);
-
diff --git a/docs/interactive/ask_from_treelist b/docs/interactive/ask_from_treelist
deleted file mode 100755
index ade7141d4..000000000
--- a/docs/interactive/ask_from_treelist
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/perl
-# Yves Duret <yduret at mandrakesoft.com>
-# license: GPL
-
-use lib qw(/usr/lib/libDrakX);
-use common;
-use interactive;
-
-my $in = 'interactive'->vnew(undef, 'default');
-my $foo = $in->ask_from_treelist("window title - ask_from_treelist",
- "message\nexamples of utilisation of ask_from_treelist",
- '|',
- ['Custom',
- 'Other|Unlisted',
- 'Matrox|Millennium II=>Matrox Millennium II',
- 'Matrox|Millennium G200=>Matrox Millennium G200',
- 'Matrox|Millennium G400=>Matrox Millennium G400',
- 'Matrox|Millennium G450=>Matrox Millennium G450',
- 'Matrox|Millennium G550=>Matrox Millennium G550',
- 'Sun|FFB 67MHz Creator=>Sun FFB 67MHz Creator',
- 'Sun|FFB 67MHz Creator 3D=>Sun FFB 67MHz Creator 3D',
- 'Sun|FFB 75MHz Creator 3D=>Sun FFB 75MHz Creator 3D',
- ],
- 'Custom'
- ) or $in->exit(0);
-print "$foo\n";
-$in->exit(0);
diff --git a/docs/interactive/wait_message b/docs/interactive/wait_message
deleted file mode 100755
index 0caec4471..000000000
--- a/docs/interactive/wait_message
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/perl
-# Yves Duret <yduret at mandrakesoft.com>
-# license: GPL
-
-use lib qw(/usr/lib/libDrakX);
-use interactive;
-
-my $in = 'interactive'->vnew(undef, 'default');
-my $wait = $in->wait_message('wainting title', _("Moving files to the new partition"));
-sleep(3);
-$wait->set(_("Removing"));
-sleep(3);
-$in->exit(0);
diff --git a/docs/mdk-9.2 b/docs/mdk-9.2
deleted file mode 100644
index 1d5a06494..000000000
--- a/docs/mdk-9.2
+++ /dev/null
@@ -1,129 +0,0 @@
--*- outline -*-
-
- todo list for mdk9.2
- (mainly gtk+ oriented for now)
-
-* erratas
-** put them in gi/perl-install/patch/mdk_9.1
-** move mdk9.1 ones from gi/perl-install/patch into gi/perl-install/patch/mdk_9.0
-
-
-* libDrakX
-** document internals through docbook like kernel-2.5.x does
-
-* mcc vs tools communication
-** faster tools embedding in mcc (gc idea)
- move gui into gui/<sg>.pm so that mcc can just do require on them
- instead of doing slow fork+perl startup (same idea as fast_cgi,
- perl_mod and the like)
-** told apps to ask user whether to save their changes or to discard them on cancel (#1437)
-** to let diskdrake fit better when embedded, we should write "formated - mounted" rather than "formated\nmounted"
-** "testing mode" option in options menu so that we pass --testing to our tools ?
-
-* ugtk2 & tools guies:
-** cleanups:
-*** $o->flush() should be sub { $_[0]->window->process_updates(1) }
- see logdrake::parse_file()'s progress bar as an example
-** saner/cleaner usage of gtk+-2.2 widgets:
-*** use MessageDialog for modal windows (cleaner)
- especially for wait/error messages so that one uses std gtk+ icons for info/error/warning and the like events
-*** use button boxes everywhere when we have several buttons for saner gui (as per gnome specs/recommendations)
-*** gtk::combo => gtk::optionMenu (as per gtk+-2 doc)
-*** use size::group to let things be smoother in some places (eg: clock.pl from mcc)
-
-* tools
-** all:
-*** provide menu entries for more gui tools (?): for now, only harddrake2 and logdrake have one
-*** explanations of std standalone.pm functions are broken due to common.pm overloading
-*** have a button or a menu to access help (was already part of mdk9.1 specs)
- only harddrake2, mcc and rpmdrake have one for now
- policy might be: "most users access tools via the mcc, so let handle help, bug reports and co only in mcc"
-*** rename and provide compatibility links:
-**** adduserdrake => drakeuseradd
-**** diskdrake => drakdisk
-**** harddrake => drakhw
-**** keyboarddrake => drakkeyboard
-**** localedrake => draklocale
-**** logdrake => draklog
-**** menudrake => drakmenu [fredc]
-**** mousedrake => drakmouse
-**** printerdrake => drakprinter
-**** userdrake => drakuser [deush]
-**** XFdrake => drakx11
-** drakboot:
-*** should prevent the user to insert a space in a kernel label (#2826)
-*** fix "Display theme under console" setting from current theme config file (#2662)
-** drakconnect
-*** does not show up zeroconf as a valid mode in "configuring lan" window in embedded mode
-** drakedm:
-*** restart dm service ?
-** harddrake:
-*** colorize the internal help
-*** add raw description (or join('|', vendor, descr)) for mass medias (see drakx bug #3???)
-*** use pure gtk+ instead of interactive for "fields description" or alter interactive so that it creates modal windows
-** logdrake:
-*** search field does not get focus when embedded
-*** we may disable the search button when one deselect all explanation files
-** mcc:
-*** make tool names be black or blue (like in rpmdrake & harddrake2 guies) (#2695)
-*** hide non executable programs instead of warning at runtime if program isn't executable
-*** make more program being options rather than depandancies (ie like rpmdrake and drakwizard)
-*** add scrollbars if root window is below 800x600 (#2961)
-*** add scrollbars for too big translated messages (but how to detect it)
-*** move drakedm from hardware to system section
-*** enhance mcc descriptions (#3265)
-** rpmdrake
-*** save mode (sort by group, mdk choice, ...)
-**** sa serait cool que tu sauve la position (aka choix mdk, tri/alpha, par
- groupe, par taille, ...) et que tu la restaure
-*** m-q accelerator to quit
-*** if package is unselectable, explain why
-*** si conflit, proposer de deselectionner le package en question +tot que de
- devoir se taper l'arborescence pour le deselectionner (a - que la
- recherche e perde pas la selection de package en cours)
-*** some windows are still non modal, like:
- o tout ce qui se rapporte aux dependances "des paquetages
- supplementaires sont necessaires", ... tu oublie de passer "{
- transient => $w->{rwindow} }"
- o toutes les fenetres grpmi. faudrait voir si on peut foutre le
- core de grpmi dans un package pour faire "use grpmi" et seter
- le nouveau $::main_window pour corriger ca.
-*** we need access to urpmi options like "no gpg signature check"
-*** bug 1
-1) selectionner des packages a installer
-
-2) rpmdrake dit que X doit etres vier
-
-3) rpmdrake le vire
-
-4) rpmdrake passe a l'update/isntall proprement dite
-
-5) rpmdrake failled
-
-rpmdrake re-tentera d'enlever le package X du 1 en cas de reessai
-alors qu'il n'est + la
-
-** scannerdrake/sane-find-scanner
-*** do not detect every usb devices as scanner
-** urpmi
-*** --repair-system: add missing dependancies for currently installed packages
-
-
-* packages
-** main package updates:
-*** rpm-4.2
-*** kernel-2.6 (if availlable and stabilized: not probable) ?
- at least, keep kernel-2.4.x
-** add new packages:
-*** kernel-mosix
-*** dvb related packages: vcr, vdr, ...
-** icewm/windowmaker/other wm
-*** export BROWSER like gnome/kde (look at /etc/gnome/gnomerc)
-
-* hardware support
-** kernel: update alsa, bttv, dvb & saa7134 drivers for better hardware support (the laters from http://bytesex.org)
-*** add "REGISTER ^dvb/adapter[0-9]+/[^/]+$ PERMISSIONS root.video 0660" to devfsd
-*** update oss audigy driver from pserver:anonymous@cvs.sourceforge.net:/cvsroot/emu10k1 cvs
-** add cx88 sound driver from http://bytesex.org/snapshot
-** isa detection/probing in ldetect ? (#118, #497) => need some old hw in order to test
- probably not
diff --git a/docs/mdk-vs-redhat b/docs/mdk-vs-redhat
deleted file mode 100644
index 4d0de8223..000000000
--- a/docs/mdk-vs-redhat
+++ /dev/null
@@ -1,43 +0,0 @@
-+ Open Development (at least DrakX)
-+ UDMA66 (HPT366)
-+ gamerz
-+ number of packages
-+ better packages(?)
-+ no automatic handling of ide burners
-+ urpmi/rpmdrake
-+ XFdrake
-+ no newbie install
-+ reiserfs
-+ fat resizing
-+ 3D handling (eg: Voodoo3)
-+ diskdrake (vs diskdruid)
-+ usb storage (?)
-+ KDE2
-+ faces in kdm/gdm
-+ menu
-+ alternatives
-+ /etc/emacs/site-start.d
-+ default config
-+ i18n (bootloader keyboard)
-
-+ More user-friendliness in general:
- + you can choose between multiple net devices when more than one are
- detected
- + you are presented with the media descriptions (disks, cdrom's)
- when you must choose between multiple media, and not only "sda",
- "hdc", ..
- + when installing from a disk partition, you are presented with an
- extract of the directory contents when you fail to give the
- correct location, which is very helpful to correct the input
- instead of simply rebooting to remember where on earth you
- mirrored the distribution on your disks
-
-+ Automatic mode (Redhat's equivalent is called "kickstart") is not
- performed according to a file on the floppy but from kernel parameters,
- which have many pros, among them: (1) we don't need the vfat filesystem
- for that purpose, and (2) with advanced bootloaders such as grub and
- lilo you can edit parameters on the fly at boot time.
-
-- no LABEL= in fstab (for auto renumbering of devices)
-- kerberos
-- LDAP
diff --git a/docs/net_object_class.fig b/docs/net_object_class.fig
deleted file mode 100644
index 19f7f5318..000000000
--- a/docs/net_object_class.fig
+++ /dev/null
@@ -1,73 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 4050 4162 675 338 4050 4162 4725 4500
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 5700 3112 675 338 5700 3112 6375 3450
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 7275 4087 675 338 7275 4087 7950 4425
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 4800 1462 975 487 4800 1462 5775 1950
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 2700 3112 675 338 2700 3112 3375 3450
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 4875 5887 975 487 4875 5887 5850 6375
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 9450 5062 675 338 9450 5062 10125 5400
-1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 4654 4038 3900 3225 4654 4038 754 813
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 4125 1875 3225 2850
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 4575 1950 4200 3750
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5250 1950 5475 2775
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 3000 3450 3600 3900
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5925 3450 6675 3900
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 2700 3450 4050 5550
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 4125 4500 4575 5400
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5625 3450 5025 5400
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5775 1575 9450 4725
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7800 4275 9000 4800
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 4800 1950 4800 5400
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 9000 975 9450 4725
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 7500 75 10687 75 10687 975 7500 975 7500 75
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7500 375 5400 1050
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5550 1800 7200 3675
-4 0 0 50 0 0 12 0.0000 4 135 885 4350 1500 Netconnect\001
-4 0 0 50 0 0 12 0.0000 4 135 435 2475 3150 ISDN\001
-4 0 0 50 0 0 12 0.0000 4 135 720 3675 4200 MODEM\001
-4 0 0 50 0 0 12 0.0000 4 135 960 6825 4125 ETHERNET\001
-4 0 0 50 0 0 12 0.0000 4 135 480 5400 3150 ADSL\001
-4 0 0 50 0 0 12 0.0000 4 135 420 4650 5925 Tools\001
-4 0 0 50 0 0 12 0.0000 4 135 660 9150 5100 Network\001
-4 0 0 50 0 0 12 0.0000 4 135 1305 8400 375 Rest of the world\001
-4 0 0 50 0 0 12 0.0000 4 180 2595 7725 600 (draknet, printerdrake, tinyfirewall\001
-4 0 0 50 0 0 12 0.0000 4 180 2310 7725 825 ftp, http, net_monitor, drakgw)\001
-4 0 0 50 0 0 12 0.0000 4 195 2760 3525 6825 Global variables $in, $prefix, $install\001
-4 0 0 50 0 0 12 0.0000 4 180 2340 3525 7050 shared with the module globals\001
diff --git a/docs/object_class.fig b/docs/object_class.fig
deleted file mode 100644
index 44fd3fe89..000000000
--- a/docs/object_class.fig
+++ /dev/null
@@ -1,32 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 2625 1200 2625 1725
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 7575 1125 7575 1650
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 7575 2100 4350 3225
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 5025 2025 4350 3225
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 2625 2100 4350 3225
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 5025 2025 6075 4125
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 2625 1200 4950 1725
-2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2
- 7575 1125 4950 1725
-4 0 0 100 0 0 12 0.0000 4 180 1755 1800 1050 install_steps_gtk\001
-4 0 0 100 0 0 12 0.0000 4 180 1440 6900 975 install_steps_stdio\001
-4 0 0 100 0 0 12 0.0000 4 180 1140 2100 1950 interactive_gtk\001
-4 0 0 100 0 0 12 0.0000 4 180 1275 6900 1950 interactive_stdio\001
-4 0 0 100 0 0 12 0.0000 4 180 1875 4125 1950 install_steps_interactive\001
-4 0 0 100 0 0 12 0.0000 4 135 810 3975 3450 interactive\001
-4 0 0 100 0 0 12 0.0000 4 180 975 5625 4350 install_steps\001
diff --git a/docs/porting-ugtk b/docs/porting-ugtk
deleted file mode 100755
index a72faabb6..000000000
--- a/docs/porting-ugtk
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/perl -pi
-#
-# $Id$
-#
-# This is not an automatic gtk+-1.x to gtk+-2.x port tool,
-# just a tool that ease perl apps' gtk2 port.
-# you'll have to fix all remaining problems, beginning by spotted warnings
-# it'll save you basic conversion work
-#
-# if you used Gtk::Text, a little more work will be needed (look at logdrake gtk2 port)
-# if you used Gtk::CTree, Gtk::CList or worse, Gtk::Tree, you'll need quite a lot of exhausting work :-(
-#
-# usage: porting-ugtk <file>
-#
-# hint: always use strict
-
-# switch to gtk2 :
-s!Gtk:!Gtk2:!g;
-/(use|require) Gtk/ and print STDERR "Warning: if this (bad) app that did not use my_gtk, you'll have a hard time :-)\n if not, using both Gtk && my_gtk was misdesigned ...\n";
-s!(use|require) Gtk.*!!g; #
-s!my_gtk!ugtk2!g;
-
-# one should pass the right ":stuff" to "use ugtk2 qw();"
-/ugtk::/ and print STDERR "Warning: you'll have to passe eiter :ask, :create, :helpers or :wrappers to ugtk\n";
-s!ugtk::!!g;
-# if my_gtk wasn't used, this'll be spotted by the lack of "use ugtk2;" anyway
-s!(require|use) ugtk.*!!g;
-
-
-# deprecated :
-/::(CTree|CList|Text[^V])/ and print STDERR "Warning: CTree, CList and Text widgets are deprecated... Good luck :-(\n";
-/gtkcreate_(png|xpm)/ and print STDERR "Warning: new Gtk::Pixmap(gtkcreate_(png|xpm)) should be replaced by gtkcreate_img\n";
-/set_policy/ and print STDERR "Warning: ->set_policy() should be replaced by allow_shrink/allow_grow/set_resizable\n";
-
-# obsoletes methods||functions :
-s!set_usize!set_size_request!g;
-s!gtkset_set_border_width!gtkset_border_width!g;
-s!border_width!set_border_width!g;
-s!-(end|spread|extended|start|single)!'\1'!g;
-s!createScrolledWindow!create_scrolled_window!g;
-# quite a lot less usefull with gtk+2 but who knows... :
-s!set_position\(1\)!set_position('center')!g;
-s!gtkpng!gtkcreate_img!g;
-# hacky but usefull in ->set_pixmap() context; else that'll be spoted at run time :
-s!gtkcreate_png!gtkcreate_img!g;
-# usefull sometimes but not in most cases :
-#s!new GtkVBox!create_vbox!g;
-#s!new GtkHBox!create_hbox!g;
diff --git a/docs/spec-DrakX-8.0.html b/docs/spec-DrakX-8.0.html
deleted file mode 100644
index 3fd545447..000000000
--- a/docs/spec-DrakX-8.0.html
+++ /dev/null
@@ -1,405 +0,0 @@
-<html><head><title>DrakX Specification for Linux-Mandrake 8.0</title></head>
-<body bgcolor="#FFFFFF" link="#0066FF" vlink="#0066FF" alink="#FF0000">
-<table border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td bgcolor="#99AAFF"><h2 align="left">DrakX Specification for Linux-Mandrake 8.0</h2></td></tr>
-<tr><td valign="top">
-Current team of Install group is :
-<p>
-<table cellpadding="2" cellspacing="2" border="1" width="30%">
-<tbody>
-<tr valign="Top">
-<td valign="Top">gc
-
-</td>
-</tr>
-<tr valign="Top">
-<td valign="Top">damien
-
-</td>
-</tr>
-<tr valign="Top">
-<td valign="Top">fpons
-
-</td>
-</tr>
-<tr valign="Top">
-<td valign="Top">pixel
-
-</td>
-</tr>
-</tbody>
-</table>
-<p>
-
-<pre>
-
- <b>Boot process (stage1)</b>
-
- Installation begin by booting from CD-ROM or Diskette. From CD-ROM all
-installation method are available (CD, HD, NFS, FTP, HTTP) on options. From
-Diskette according to image selected, only some related method (network or cdrom
-or hd) are available and module managed due to size limitation to 1.44Mb.
- Options are always available by pressing on F1.
-
- <b>DrakX process (stage2)</b>
-
- DrakX installation organized in steps (execution sequence described below).
-Steps listed on left side and help available on bottom right side. most of the
-screen is available for various dialog for interacting with the user. Steps
-execution sequence is automated and described below.
-
-Mouse is probed and if none has been found or if the mouse has not moved, a
-specific mouse configuration is displayed at the begining.
-
-
-Before the graphical steps, there is a detection step. It detects various
-hardware, including modems (from tty0 to tty7), mouse (serial, usb, ps/2) and
-tablets.
-
- <b>Steps</b>
-
- <i>Choose Your language</i>: step always displayed. default choice is previous one or
-<font color="#000080"><i>English</i></font>. After choosing a language, a license splash screen translated in the
-chosen language is displayed with <font color="#000080"><i>Accept</i></font> and <font color="#000080"><i>Refuse</i></font> buttons. <font color="#000080"><i>Refuse</i></font> should
-stop installation. <font color="#000080"><i>Accept</i></font> validate language choice which are propagated to all
-DrakX visible widget. Advanced mode allow to select other language available to
-be installed. Advanced mode allow to select language which will be installed on
-system.
- If step is redone, the license is no more displayed.
-
- <font color="#000080"><i>Select Install Class</i></font>: step always displayed. default choice is previous one
-or <font color="#000080"><i>Recommended</i></font>. Only one other option available is <font color="#000080"><i>Customized</i></font>. Two buttons
-available are <font color="#000080"><i>Install</i></font> or <font color="#000080"><i>Upgrade</i></font>. Available steps (left side) are changed
-according to installation class selected, where the default is the one of
-<font color="#000080"><i>Recommended</i></font> with <font color="#000080"><i>Install</i></font>.
-
- <font color="#000080"><i>Hard Drive Detection</i></font>: step always displayed. In recommended mode,
-automatically done. In Customized mode, all modules that manage SCSI/IDE cards
-are loaded automatically and a question asking for other module to load is
-displayed.
- If clicked later or if to the question to load other module the
-answer is <font color="#000080"><i>Yes</i></font>, a list of module is displayed (or if the question to other
-module to load is. When a module is chosen, two options are available
-<font color="#000080"><i>Autoprobe</i></font> and <font color="#000080"><i>Specify options</i></font>. Autoprobe try to load the module without any
-other user options (default module parameter). Specify options allow user to
-give module parameters individually in a list for all known parameters. At this
-point <font color="#000080"><i>Ok</i></font> or <font color="#000080"><i>Cancel</i></font> are available, Cancel should stop the module installation
-and go to next step. If any error occurs during module installation, a question
-asking to try with other parameter is displayed, the same module is still used.
-
- <font color="#000080"><i>Setup filesystems</i></font>: step always displayed. display a list of available choice
-accoding to what has been probed. May contains <font color="#000080"><i>Use free space</i></font>, "Use existing
-partition<font color="#000080"><i>, </i></font>Use the window partition for loopback<font color="#000080"><i>, </i></font>Use the free space on the
-Windows partition<font color="#000080"><i>, </i></font>Remove Windows(TM)<font color="#000080"><i>|</i></font>Erase entire disk" (according to disk
-configuration =&gt; only one big fat for the first case only), "Custom disk
-partitioning".
- If <font color="#000080"><i>Use free space</i></font> mode, auto allocation in available on available disk.
- If <font color="#000080"><i>Use existing partition</i></font> mode, a list of partition named in Linux
-scheme are displayed with their approximate size in Mb and propose mount point
-to choose in list boxes for each partitions available on hard drive.
- If <font color="#000080"><i>Use the window partition for loopback</i></font> mode, DrakX use available size
-on the windows partition to create a root file and a swap file which will be
-used in loopback, this means this is a lnx4win installation.
- If <font color="#000080"><i>Use the free space on the Windows partition</i></font> mode, DrakX will resize
-the windows partition and allocate true linux filesystem (at least / and swap).
- If <font color="#000080"><i>Remove Windows(TM)</i></font>|<font color="#000080"><i>Erase entire disk</i></font> mode, DrakX clean the
-partition table before auto allocating partition.
- If <font color="#000080"><i>Custom disk partitioning</i></font> mode, diskdrake is launch. TO BE DEFINED to
-change make diskdrake use only advanced mode.
-Diskdrake show all partition of all non-removable disk graphically. All special
-partition are hidden, only user accessible partition are visible: this remove
-extended partition, whole disk partition on sparc platform. Clicking on a disk
-notebook tab show all his partitions. Clicking on a partition show all actions
-available for this partition (depend if customized or advanced mode) as well as
-information on this partition (depend if customized or advanced mode). Most
-diskdrake operation are done without writing on disk (exception are Resizing
-partitions) and everything is written once on the disk when exiting diskdrake,
-at any time if writing partition table is necessary, there are always a dialog
-box asking the user to confirm the write. If no operation are modifying
-partition table, no dialog is displayed on exit (for example if giving mount
-point to partition). General action are available too:
- <font color="#000080"><i>Clear All</i></font>: clear all partition of the given disk.
- <font color="#000080"><i>Auto allocate</i></font>: try to allocate partition in available disk (not the
-seen disk).
- <font color="#000080"><i>Undo</i></font>: undo last operation.
- <font color="#000080"><i>Done</i></font>: quit and save changes.
-Other operations are available in advanced mode:
- <font color="#000080"><i>Rescue partition table</i></font>: try to rescue a lost partition table,
-absolutely no garantee to succeed and may destroy what could be saveable by
-another tools.
- <font color="#000080"><i>Reload</i></font>: reload partition table from disk, erasing all changes in
-memory done by the user.
- <font color="#000080"><i>Wizard</i></font>: go to partition wizard, that the partition filesystems default
-behaviour on startup.
- <font color="#000080"><i>Restore from floppy</i></font>: restore a partition table from previously saved
-partition table from diskdrake.
- <font color="#000080"><i>Save to floppy</i></font>: save partition table to floppy.
- <font color="#000080"><i>Options</i></font>: global options available for filesystem configuration. This
-include <font color="#000080"><i>Removable media automouting supermount</i></font> check box disabled by default.
- Operation available on partition are:
- <font color="#000080"><i>Mount point</i></font>: change or define mount point for partition, only
-available for true filesystem partition.
- <font color="#000080"><i>Resize</i></font>: resize partition, if a specific algorithm to keep data is
-used no data may be lost, else all data are lost but nothing is written by
-diskdrake on the partition data in this last case (this means data can be
-restored by restoring original size and location).
- <font color="#000080"><i>Delete</i></font>: delete partition, if the same partition is created (same type,
-location, size) all data can be restored as diskdrake doesn't write on partition
-data.
- Operation available on partition table but in advanced mode are:
- <font color="#000080"><i>Type</i></font>: change type of partition, all data will be lost but diskdrake as
-above does not destroy them, and everyting can be restored.
- <font color="#000080"><i>Format</i></font>: format partition, at this point, all data ARE LOST.
- <font color="#000080"><i>Mount</i></font>: mount partition now, usefull for swap to increase memory
-capacity for machine low on resource that are not available to complete setup
-filesystem step correctly (problably if a resize partition is used on FAT fs).
-allow Mounting swap on customized mode too.
- A legend for partition type colors is available
-(Ext2,ReiserFS,Swap,FAT,Other,Empty). It has additionnal features to create a
-partition or change its type (only available in advanced mode).
-
- <font color="#000080"><i>Format partitions</i></font>: step always displayed. display list of partition to
-format with click boxes. Some are defined according to type of partitions and if
-the partition has been created or taken back.
-If a partition has already been formated, it is not proposed, or if it should
-not be proposed (alrady existing partition like /mnt/windows).
-On Advanced tag, an additional dialog is displayed to select partition to format
-(all available partition listed) and to format them with bad block checking.
-
- <font color="#000080"><i>Choose packages</i></font>: step always displayed. default selection done to be
-<font color="#000080"><i>correct</i></font> according to size available, Install or Upgrade, Hardware available.
-This selection is done according to <font color="#000080"><i>Mandrake first choice</i></font> of packages.
-On all mode, display groups and main desktop used (KDE or Gnome), an
-individual package selection check box is available to allow selecting package
-individually. In this case, a dialog displaying a tree with groups, (Mandrake
-first choice/alternatives) and packages is shown on the left part, a description
-window for each packages is shown on the right part.
-
- <font color="#000080"><i>Install system</i></font>: step always displayed. no interactive and display
-installation progression. include if available and on a CD basis a spash screen
-of advertising and other (pub!).
-
- <font color="#000080"><i>Hardware panel</i></font>: step always displayed. show current configuration for
-Mouse, Keyboard, TimeZone, Graphic/TV Card, Monitor.
-At each values chosen (list boxes displayed a
-synthesis description) the current dialog is removed from screen and specific
-configuration panels are displayed (like currently for mouse, keyboard ...).
-And end of these specific configuration panels, this one is remapped on screen
-to be accepted in general.
-
- <b>Sub steps of Hardware panel:</b>
-
- <font color="#000080"><i>Configure mouse</i></font>: displayed on request or if the mouse has not been
-moved (so unsafe detection), but have to be displayed earlier. A mouse tree
-selection for type is displayed with default case as what is probed or
-<font color="#000080"><i>serial/Generic 2 button Mouse</i></font> if none has been probed. <font color="#000080"><i>Cancel</i></font> disable mouse
-modification and <font color="#000080"><i>Ok</i></font> allow next mouse configuration dialog. Then comes a serial
-port dialog for serial mice (default mouse connected to COM1 if nothing found).
-Then a mouse screen control is chown (according to mouse capacity: 3 buttons
-with or without mouse, need 7 buttons checking ?). Here <font color="#000080"><i>Ok</i></font> validate to go to
-next step and <font color="#000080"><i>Cancel</i></font> to first mouse dialog displayed (mouse tree selection for
-type).
-
- <font color="#000080"><i>Configure keyboard</i></font>: displayed on request. default is set according to
-TimeZone definition (itself defaulting to language selection at the beginning).
-A list of keyboard is shown to the user and <font color="#000080"><i>Ok</i></font> validates change and return to
-<font color="#000080"><i>Hardware panel</i></font> dialog with enabled change. <font color="#000080"><i>Cancel</i></font> abort any modification and
-return to the same <font color="#000080"><i>Hardware panel</i></font> dialog.
-
- <font color="#000080"><i>Configure timezone</i></font>: displayed on request. default is set according to
-language selection. A timezone tree selection is shown with only the subtree
-corresponding to the current selection expanded (as other tree dialog). <font color="#000080"><i>Ok</i></font>
-validates change and return to <font color="#000080"><i>Hardware panel</i></font> dialog whereas <font color="#000080"><i>Cancel</i></font> avoid
-the change before returning to the same main dialog.
-
- <font color="#000080"><i>Graphic Card</i></font>: display graphic card probed. No change available.
-
- <font color="#000080"><i>TV Card</i></font>: display TV/Tuner card probed. No change available.
-
- <font color="#000080"><i>Monitor</i></font>: need execution of ddcxinfos at this point. Only Size, Max
-resolution and depth displayed. No change available.
-
-
- Miscellaneous step have been removed and dispatched to other steps. "Use
-hard drive optimisation<font color="#000080"><i> and </i></font>Enable num lock at startup<font color="#000080"><i> are removed. </i></font>Choose
-security level<font color="#000080"><i> is moved to security step. </i></font>Precise RAM size if needed" and
-<font color="#000080"><i>Clean /tmp at each boot</i></font> are moved to bootloader step.
-<font color="#000080"><i>Removable media automouting</i></font> is moved to diskdrake options.
-
- <font color="#000080"><i>Security</i></font>: step displayed only in customized mode. TO BE DEFINED. should
-display at least securty level to choose. level are <font color="#000080"><i>Low</i></font>, <font color="#000080"><i>Medium</i></font>, <font color="#000080"><i>High</i></font> and
-for advanced there are <font color="#000080"><i>Welcome To Crackers</i></font>, <font color="#000080"><i>Poor</i></font>, <font color="#000080"><i>Paranoid</i></font> too.
-
- <font color="#000080"><i>Configure networking</i></font>: step always displayed. dialog always displayed in
-both <font color="#000080"><i>Recommended</i></font> and <font color="#000080"><i>Customized</i></font> mode. A list of network configuration
-entries are shown with the following:
- <font color="#000080"><i>Configure a normal modem connection</i></font>
- <font color="#000080"><i>Configure an ISDN connection</i></font>
- "Configure a DSL (or ADSL) connection
- <font color="#000080"><i>Configure a cable connection</i></font>
- <font color="#000080"><i>Configure local network</i></font>|<font color="#000080"><i>Reconfigure local network</i></font>
- <font color="#000080"><i>Disable networking</i></font>|<font color="#000080"><i>Enable networking</i></font>
- <font color="#000080"><i>Done</i></font>
- By cliking on a specific item, another dialog is displayed to configure
-some specific part of the network.
- <font color="#000080"><i>Configure a normal modem connection</i></font>: display a question to probe for a
-modem if not already detected, then if none are found or probe has been refused
-a list of possible serial device are listed (in the form ttySx / COM(x+1) with
-the current mouse device removed if it is serial). After that a dialog including
-all parameters than can be used is shown. This includes <font color="#000080"><i>Connection Name</i></font>,
-<font color="#000080"><i>Phone number</i></font>, <font color="#000080"><i>Login ID</i></font>, <font color="#000080"><i>Password</i></font>, <font color="#000080"><i>Authentication</i></font>, <font color="#000080"><i>Domain name</i></font>, <font color="#000080"><i>DNS 1</i></font>
-and <font color="#000080"><i>DNS 2</i></font>. Authentication is a combo of <font color="#000080"><i>PAP</i></font>, <font color="#000080"><i>Termina-Based</i></font> and
-<font color="#000080"><i>Script-Based</i></font> (It seems necessary to get CHAP back on this one, no way of
-testing TO BE DEFINED). If no DNS are given, the connection is configured to try
-using provider DNS. <font color="#000080"><i>Ok</i></font> and <font color="#000080"><i>Cancel</i></font> button are available.
- <font color="#000080"><i>Configure an ISDN connection</i></font>:
-Try to detect some PCI card. If not detected, asks if it's a ISA/pcmcia or PCI
-card, and gives the list of the cards. Information are then asked:
-<font color="#000080"><i>Card IRQ</i></font> only if ISA/pcmcia
-<font color="#000080"><i>Card mem (DMA)</i></font> only if ISA/pcmcia
-<font color="#000080"><i>Card IO</i></font> only if ISA/pcmcia
-<font color="#000080"><i>Card IO_0</i></font> only if ISA/pcmcia with io0
-<font color="#000080"><i>Card IO_1</i></font> only if ISA/pcmcia with io1
-<font color="#000080"><i>Your personal phone number</i></font> phone
-<font color="#000080"><i>Provider name (ex provider.net)</i></font>
-<font color="#000080"><i>Provider phone number</i></font>
-<font color="#000080"><i>Provider dns 1</i></font>
-<font color="#000080"><i>Provider dns 2</i></font>
-<font color="#000080"><i>Dialing mode</i></font> auto or manual
-<font color="#000080"><i>Account Login (user name)</i></font>
-<font color="#000080"><i>Account Password</i></font> hided
-<font color="#000080"><i>Confirm Password</i></font> again
- <font color="#000080"><i>Configure a DLS (or ADSL) connection</i></font>:
-The user chooses between pptp, pppoe and dhcp. If dhcp, redirection to LAN.
-If there is more than one ethernet card, The user must choose the card to use
-(displayed with the module). After that, some informations are asked:
-<font color="#000080"><i>Provider name (ex provider.net)</i></font>
-<font color="#000080"><i>Provider dns 1</i></font>
-<font color="#000080"><i>Provider dns 2</i></font>
-<font color="#000080"><i>Account Login (user name)</i></font>
-<font color="#000080"><i>Account Password</i></font> hided
-<font color="#000080"><i>Confirm Password</i></font> again
- <font color="#000080"><i>Configure a cable connection</i></font>: redirection to LAN
- <font color="#000080"><i>Configure local network</i></font>: display what has been probed with a question
-about using another module and <font color="#000080"><i>Yes</i></font>, <font color="#000080"><i>No</i></font> and <font color="#000080"><i>See hardware info</i></font> buttons.
-<font color="#000080"><i>No</i></font> is the default. If <font color="#000080"><i>Yes</i></font> is clicked a list of modules is displayed with
-<font color="#000080"><i>Ok</i></font> or <font color="#000080"><i>Cancel</i></font> buttons available. <font color="#000080"><i>Cancel</i></font> should go back to previous
-question. If <font color="#000080"><i>See hardware info</i></font> is clicked a list of probed hardware is
-displayed. If <font color="#000080"><i>Yes</i></font> is clicked, for each ethernet interface, a dialog asking for
-IP address, Netmask and Automatic IP check box (DHCP/BOOTP) is displayed. Then
-if DHCP has been chosen, only a dialog asking for Host name and another for HTTP
-proxy and FTP proxy if any. If DHCP has not been chosen, an IP address has to be
-defined and a dialog including <font color="#000080"><i>Host name</i></font>, <font color="#000080"><i>DNS server</i></font>, <font color="#000080"><i>Gateway</i></font> and "Gateway
-device" is displayed. Then the same HTTP proxy and FTP proxy dialog as above. As
-network configuration may to have been reworked a bit it has TO BE DEFINED if
-this is kept like that or not.
- <font color="#000080"><i>Disable networking</i></font>|<font color="#000080"><i>Enable networking</i></font> is just a way to toggle
-networking on or off, may be to be accessible only for advanced mode.
- <font color="#000080"><i>Quit</i></font> exit the network step.
-
-<b>NETWORK ADVANCED DOCUMENTATION:</b>
-Here is a list of entry points available in post install without using the ugly
-install graphic toolkit:
-
-<a href=<font color="#000080"><i>http://www.mandrakesoft.com/~damien/html/draknet_advanced_doc.txt</i></font>>http://www.mandrakesoft.com/~damien/html/draknet_advanced_doc.txt</a>
-
- <font color="#000080"><i>Configure Printer</i></font>: step always displayed. In recommended mode, only
-activated if a local printer is detected, else no printer are configured by
-default. In customized mode or if the step has been clicked a list of printer
-already configured is displayed and the possibility to add or exit the
-configuration. It allow configuration of printers for both LPR and CUPS
-individually (available by advanced mode when adding a printer). Printer
-protocol managed are local/usb/samba/ncp/lpd for LPR and
-local/usb/serial/samba/lpd/cups_network for CUPS.
-
- <font color="#000080"><i>Set root password</i></font>: step always displayed for Install only. In
-recommended mode display only a <font color="#000080"><i>Password</i></font> entry and a <font color="#000080"><i>Password (again)</i></font> entry
-to select the root password. In advanced mode, a Use NIS (yellow pages) check
-boxes and Use MD5 check box are available. <font color="#000080"><i>Ok</i></font> validate root password and "No
-password<font color="#000080"><i> avoid setting a password. </i></font>No password<font color="#000080"><i> is only available in </i></font>Low"
-security level or less. The length of the minimal password depend upon security level.
-
-In corporate firewall :
- <font color="#000080"><i>Set admin password</i></font>: step always displayed for Install only. It only
- displays a <font color="#000080"><i>Password</i></font> entry and a <font color="#000080"><i>Password (again)</i></font> entry
-to select the admin password.
-The length of the minimal password depend upon security level. (double of the
- security level)
-
- <font color="#000080"><i>Add a user</i></font>: step always displayed for Install Only. In recommend mode
-display <font color="#000080"><i>Real name</i></font>, <font color="#000080"><i>User name</i></font>, <font color="#000080"><i>Password</i></font>, <font color="#000080"><i>Password (again)</i></font> and icon
-choices as graphical. For customized mode a shell combo is available to choose a
-specific shell for the user depending on the package installed. The real name is
-the user friendly name of the user whereas user name is its login id name. The
-box display user that have already been added below the title. <font color="#000080"><i>Accept user</i></font>
-button allow the creation of the user and <font color="#000080"><i>Done</i></font> finish this step. High or
-higher security level implies the creation of at least one user. Password length
-are subject to same restriction according to security level. In advanced mode,
-allow to choose the user in auto login mode.
-
- <font color="#000080"><i>Create a boot disk</i></font>: step always displayed. In recommended mode this
-step is automatically done by doing nothing. If clicked or customized mode, the
-user is prompted to allow building a boot disk (default is yes). In advanced
-mode allow selection of floppy drive.
-
- <font color="#000080"><i>Install boot loader</i></font>: step always displayed. In recommended mode this
-step is automatically done. In customized mode, a combo <font color="#000080"><i>Boot device</i></font> list the
-various boot device that can be used where the bootloader can be installed. The
-boot device can the Linux description of the whole disk available (ex: /dev/hda)
-or partition available in these disk or floppy drives. Other platform
-specificity are not listed here.
- LBA check box is displayed in advanced mode (enabled by default) to
-allow using LBA addressing if available (PC with LILO). bootloader combo to
-select a given bootloader to use, available choice are <font color="#000080"><i>Grub</i></font>, "LILO with text
-menu<font color="#000080"><i>, </i></font>LILO with graphical menu<font color="#000080"><i>. default chosen is </i></font>LILO
-with graphical menu<font color="#000080"><i>. </i></font>Delay before booting default image" entry
-field is available with default value current setting (upgrade) or 5 else.
-<font color="#000080"><i>Precise RAM size if needed (found xx MB)</i></font> entry is displayed too,
-<font color="#000080"><i>clean /tmp</i></font> check box is disabled by default too.
-Boot in graphical mode (init 5) is available here in advanced mode too
-(previously in X configuration). <font color="#000080"><i>Video mode</i></font> combo, <font color="#000080"><i>Password</i></font>, <font color="#000080"><i>Password (again)</i></font>,
-<font color="#000080"><i>Restrict command line options</i></font> check box is displayed.
-Video mode combo list text mode and video mode used for frame buffer, video mode
-used for frame buffer are available only if the install managed to boot with
-frame buffer activated. Password are restricted according to security level as
-other password. Password are mandatory according to security level TO BE DEFINED.
-
- <font color="#000080"><i>Configure X</i></font>: step always displayed. By default on recommended mode,
-everything is done automatically if possible up to test of graphic card, and if
-the user accept the settings no more question are asked to him. In customized
-mode a dialog is displayed to choose resolution, color depth and which version
-of XFree (with 3D optionally) is available for the current card where only a
-short description is displayed. <font color="#000080"><i>Ok</i></font> button allow to jump to test phase (for the
-first time only) if available. <font color="#000080"><i>Cancel</i></font> return to main XFree configuration
-window allowing to change Monitor, Graphic card, Server options or Resolution
-with X version to choose. <font color="#000080"><i>Show all</i></font> extend resolution list to more resolutions
-according to card (with onboard memory) only and no more monitor capabilities.
- The main dialog is a list of command to change some X configuration aspect
-according to advanced mode or not :
- <font color="#000080"><i>Change Monitor</i></font>: display a tree selection of monitors where default one
-is selected. <font color="#000080"><i>Ok</i></font> and <font color="#000080"><i>Cancel</i></font> buttons are available.
- <font color="#000080"><i>Change Graphic card</i></font>: display a tree selection of graphic card where
-default one is selected. <font color="#000080"><i>Ok</i></font> and <font color="#000080"><i>Cancel</i></font> buttons are available. If <font color="#000080"><i>Unlisted</i></font>
-is chosen, then a tree of server/driver is displayed containing available server
-for XF3 or driver for XF4. <font color="#000080"><i>Cancel</i></font> return to main window and <font color="#000080"><i>Ok</i></font> validates
-change.
- <font color="#000080"><i>Change Server options</i></font>: available only in advanced mode. display list
-of check boxes options for server currently used. <font color="#000080"><i>Ok</i></font> and <font color="#000080"><i>Cancel</i></font> available.
- <font color="#000080"><i>Change Resolution</i></font>: change resolution and depth including with X server
-version chosen (relative to Xdrakres too).
- <font color="#000080"><i>Show Information</i></font>: display an information dialog showing current
-configuration internals of X.
- <font color="#000080"><i>Test again</i></font>: restart test with current configuration of X.
- <font color="#000080"><i>Quit</i></font>: exit X configuration main window. Other question about autologin
-and window manager to use are asked on Add user step.
-
- <font color="#000080"><i>Exit install</i></font>: step displayed only in customized mode but always
-executed. Only a text is displayed with a <font color="#000080"><i>Ok</i></font> button. If clicked and some step
-have not been executed/completed correctly, a question dialog ask the user if he
-really want to quit now, default answer is <font color="#000080"><i>No</i></font>. Advanced switch let user access
-to do the previously <font color="#000080"><i>Auto install floppy</i></font> step in DrakX &lt; 8.0. This is just a
-question asking the user to generate an auto install floppy automatically.
-</pre>
-</body>
-</html>
diff --git a/docs/wizard.doc b/docs/wizard.doc
deleted file mode 100644
index 0bbf8d254..000000000
--- a/docs/wizard.doc
+++ /dev/null
@@ -1,31 +0,0 @@
-How to handle wizard?
-
-to switch in wizard mode:
-set $::isWizard to true;
-if $::Wizard_no_previous is set to true, the wizard won't display the previous button. Usefull for first step
-if $::Wizard_finished is set to true, the wizard will display Finish instead of Next. Usefull for last step
-
-how to code:
-Code as if there were no wizard.
-OK button is displayed as Next
-Cancel is displayed as Previous
-a additional button Cancel is added, xhich die with the exception 'wizard_cancelled'
-
-You have to handle the previous button. For example:
-
-step 1:
-ask_from list( blablablabl) or return;
-step2:
-ask_from list( blablablabl) or goto step1;
-step3:
-ask_from list( blablablabl) or goto step2;
-
-etc... You don't have to handle the wizard Cancel button as it send an exception.
-
-Understood? If yes, you'll see that there is a pb with ask_yesorno. In this case, yes+next returns true, no+next returns false, Cancel send the exception 'wizard_canceled' and previous send the exception 'wizard previous'. So you have to handle the previous button manually.
-
-plop.
-
-dam's, pour vous servir
-
-
diff --git a/help.msg.xml b/help.msg.xml
deleted file mode 100644
index c20ea01c8..000000000
--- a/help.msg.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<document>
- <green>Welcome to <blue>Mandrake Linux</blue> install help</green>
-
-In most cases, the best way to get started is to simply press the <yellow>&lt;Enter&gt;</yellow> key.
-If you experience problems with standard install, try one of the following
-install types (type the highlighted text and press <yellow>&lt;Enter&gt;</yellow>):
-
- o <white>vgalo</white> for low resolution graphical installation.
- o <white>text</white> for text installation instead of the graphical one.
- o <white>linux</white> for standard graphical installation at normal resolution.
- o <white>expert</white> for expert graphical installation at normal resolution.
-
-
-To repair an already installed system type <white>rescue</white> followed
-by <yellow>&lt;Enter&gt;</yellow>.
-
-You can also pass some <white>&lt;specific kernel options&gt;</white> to the Linux kernel.
-For example, try <white>linux noapic</white> if your system has trouble operating
-your network adapter correctly.
-<red>NOTE</red>: You cannot pass options to modules (SCSI, ethernet card) or devices
-such as CD-ROM drives in this way. If you need to do so, use expert mode.
-</document>
diff --git a/isolinux-graphic-simple.bmp b/isolinux-graphic-simple.bmp
deleted file mode 100644
index 2faf02440..000000000
--- a/isolinux-graphic-simple.bmp
+++ /dev/null
Binary files differ
diff --git a/isolinux-graphic.bmp b/isolinux-graphic.bmp
deleted file mode 100644
index 061df75cb..000000000
--- a/isolinux-graphic.bmp
+++ /dev/null
Binary files differ
diff --git a/kernel/.cvsignore b/kernel/.cvsignore
deleted file mode 100644
index 827e0ba13..000000000
--- a/kernel/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-modules.description
-all.modules
-all.kernels
diff --git a/kernel/Makefile b/kernel/Makefile
deleted file mode 100644
index a821d3939..000000000
--- a/kernel/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-all: all.modules
-
-all.modules: ../mdk-stage1/mar/mar update_kernel list_modules.pm
- `../tools/specific_arch ./update_kernel`
-
-../mdk-stage1/mar/mar:
- make -C `dirname $@` mar
-
-clean:
- rm -rf *~ modules.description all.modules all.modules64
-
-check:
- perl modules.pl check > /dev/null
diff --git a/kernel/check_mar.pl b/kernel/check_mar.pl
deleted file mode 100755
index 7b9fefbbf..000000000
--- a/kernel/check_mar.pl
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/perl
-
-use MDK::Common;
-
-my $mar = '../mdk-stage1/mar/mar';
--x $mar or die "ERROR: Sorry, need $mar binary\n";
-
-my %sanity_check = (
- cdrom => [
- qw(aic7xxx),
- if_(arch() !~ /ppc|x86_64/, 'advansys'),
- ],
- all => [
- qw(3c59x eepro100 tulip via-rhine ne2k-pci 8139too),
- if_(arch() !~ /ppc/, 'e100'),
- if_(arch() !~ /ppc|ia64/, 'tlan'),
- ],
-);
-
-my $main_version = chomp_(cat_("all.kernels/.main"));
-
-foreach (keys %sanity_check) {
- my $marfile = "all.modules/$main_version/${_}_modules.mar";
- -e $marfile or die "ERROR: missing $marfile\n";
-
- my @l = map { /(\S+)\.k?o/ } `$mar -l $marfile`;
- my @pbs = difference2($sanity_check{$_}, \@l);
-
- @pbs and die "ERROR: sanity check should prove that " . join(" ", @pbs) . " be part of $marfile\n";
-}
diff --git a/kernel/dependencies.pl b/kernel/dependencies.pl
deleted file mode 100644
index e3be14212..000000000
--- a/kernel/dependencies.pl
+++ /dev/null
@@ -1,13 +0,0 @@
-use strict;
-
-use MDK::Common;
-use list_modules;
-
-my $version = shift @ARGV;
-my $depfile = shift @ARGV;
-load_dependencies($depfile);
-print STDERR "Loaded dependencies from $depfile\n";
-
-my @modules = uniq(map { dependencies_closure($_) } @ARGV);
-print join " ", map { $_ . ($version == 24 ? '.o' : '.ko') } @modules;
-print "\n";
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm
deleted file mode 100644
index 613b220d7..000000000
--- a/kernel/list_modules.pm
+++ /dev/null
@@ -1,227 +0,0 @@
-package list_modules;
-
-use MDK::Common;
-
-our @ISA = qw(Exporter);
-our @EXPORT = qw(load_dependencies dependencies_closure category2modules module2category sub_categories);
-
-# the categories have 2 purposes
-# - choosing modules to include on stage1's (cf update_kernel and mdk-stage1/pci-resource/update-pci-ids.pl)
-# - performing a load_category or probe_category (modules.pm and many files in perl-install)
-
-our %l = (
- ################################################################################
- network =>
- {
- main => [
- if_(arch() =~ /ppc/, qw(mace bmac gmac)),
- if_(arch() =~ /^sparc/, qw(sunbmac sunhme sunqe)),
- if_(arch() !~ /alpha|sparc/,
- qw(3c501 3c503 3c505 3c507 3c509 3c515 3c90x),
- qw(82596 abyss ac3200 acenic aironet4500_card at1700 atp com20020-pci),
- qw(cs89x0 de600 de620),
- qw(defxx), # most unused
- qw(depca dgrs dmfe e100 e2100 eepro eepro100 eexpress epic100 eth16i),
- qw(ewrk3 hamachi hp hp-plus hp100 ibmtr),
- qw(lance natsemi ne ne2k-pci ni5010 ni52 ni65 nvnet olympic pcnet32 plip rcpci),
- qw(sb1000 sis900 smc-ultra smc9194 starfire tlan tmspci tulip via-rhine),
- qw(wd winbond-840 forcedeth),
- qw(fealnx 3c990 3c990fx b44 bcm4400),
- qw(skfp tc35815 lanstreamer farsync sdladrv prism2_plx),
-
- qw(iph5526), #- fibre channel
- ),
- qw(3c59x 8139too 8139cp sundance), #rtl8139
- ],
- gigabit => [
- qw(dl2k myri_sbus yellowfin ns83820 r8169 tg3 e1000 sk98lin),
- qw(bcm5820 bcm5700), #- encrypted
- ],
-
- raw => [
- qw(ppp_generic ppp_async),
- ],
- pcmcia => [
- qw(3c574_cs 3c589_cs axnet_cs fmvj18x_cs),
- qw(ibmtr_cs nmclan_cs pcnet_cs smc91c92_cs),
- qw(xirc2ps_cs xircom_cb xircom_tulip_cb),
- ],
- usb => [
- qw(catc CDCEther kaweth pegasus rtl8150 usbnet),
- ],
- wireless => [
- qw(acx100_pci airo airo_cs aironet4500_cs aironet_cs at76c503 at76c503-rfmd atmel_cs),
- qw(hermes netwave_cs orinoco orinoco_cs orinoco_pci orinoco_plx prism2_usb prism54 ray_cs usbvnet_rfmd vt_ar5k wavelan_cs wvlan_cs),
- if_(arch() =~ /ppc/, qw(airport)),
- ],
- isdn => [
- qw(b1pci c4 hisax hisax_fcpcipnp hysdn t1pci tpam divas),
- ],
- },
-
- ################################################################################
- disk =>
- {
- scsi => [
- if_(arch() =~ /ppc/, qw(mesh mac53c94)),
- if_(arch() =~ /^sparc/, qw(qlogicpti)),
- if_(arch() !~ /alpha/ && arch() !~ /sparc/,
- qw(3w-xxxx AM53C974 BusLogic NCR53c406a a100u2w advansys aha152x aha1542 aha1740),
- qw(atp870u dc395x_trm dtc g_NCR5380 in2000 initio pas16 pci2220i psi240i fdomain),
- qw(qla1280 qla2x00 qlogicfas qlogicfc),
- qw(seagate wd7000 sim710 sym53c416 t128 tmscsim u14-34f ultrastor),
- qw(eata eata_pio eata_dma mptscsih nsp32),
- qw(ata_piix sata_promise sata_svw sata_via),
- ),
- '53c7,8xx',
- qw(aic7xxx aic7xxx_old aic79xx pci2000 qlogicisp sym53c8xx lpfcdd), # ncr53c8xx
- ],
- hardware_raid => [
- if_(arch() =~ /^sparc/, qw(pluto)),
- if_(arch() !~ /alpha/ && arch() !~ /sparc/,
- qw(DAC960 dpt_i2o megaraid aacraid cciss cpqarray gdth i2o_block),
- qw(cpqfc qla2200 qla2300 pdc-ultra),
- qw(ips ppa imm),
- if_(c::kernel_version =~ /^\Q2.4/,
- qw(ataraid hptraid silraid pdcraid)
- ),
- ),
- ],
- pcmcia => [ qw(aha152x_cs fdomain_cs nsp_cs qlogic_cs ide-cs) ], #ide_cs
- raw => [ qw(scsi_mod sd_mod) ],
- usb => [ qw(usb-storage) ],
- firewire => [ qw(sbp2) ],
- cdrom => [ qw(ide-cd cdrom sr_mod) ],
- },
-
- ################################################################################
-
- bus =>
- {
- usb => [ qw(usbcore usb-uhci usb-ohci ehci-hcd uhci-hcd ohci-hcd usbkbd keybdev input) ],
- firewire => [ qw(ohci1394 ieee1394) ],
- pcmcia => [
- if_(arch() !~ /^sparc/, qw(pcmcia_core tcic ds i82365 i82092 yenta_socket)), # cb_enabler
- ],
- #serial_cs
- #ftl_cs 3c575_cb apa1480_cb epic_cb serial_cb tulip_cb iflash2+_mtd iflash2_mtd
- #cb_enabler
- },
-
- fs =>
- {
- network => [ qw(af_packet nfs lockd sunrpc) ],
- cdrom => [ qw(isofs) ],
- loopback => [ qw(isofs loop), if_($ENV{MOVE}, qw(cryptoloop gzloop supermount)) ],
- local => [
- if_(arch() =~ /^i.86|x86_64/, qw(vfat fat)),
- if_(arch() =~ /^ppc/, qw(hfs)),
- qw(reiserfs),
- ],
- various => [ qw(smbfs romfs jbd xfs) ],
-
- },
-
- ################################################################################
- multimedia =>
- {
- sound => [
- if_(arch() =~ /ppc/, qw(dmasound_pmac)),
- if_(arch() !~ /^sparc/,
- qw(ad1816 ad1848 ad1889 ali5455 awe_wave audigy cmpci cs46xx cs4232 cs4281 emu10k1 es1370 es1371 esssolo1 forte),
- qw(gus i810_audio ice1712 kahlua mad16 maestro maestro3 mpu401 msnd_pinnacle nvaudio opl3 opl3sa opl3sa2 nm256_audio),
- qw(pas2 pss rme96xx sb sgalaxy sam9407 sonicvibes sscape trident via82cxxx_audio wavefront ymfpci),
- qw(snd-ali5451 snd-als100 snd-als4000 snd-azt2320 snd-azt3328 snd-cmi8330 snd-cmipci),
- qw(snd-cs4231 snd-cs4232 snd-cs4236 snd-cs46xx snd-dt0197h snd-cs4281 snd-emu10k1),
- qw(snd-ad1816a snd-ad1848 snd-gusclassic snd-gusextreme snd-gusmax snd-interwave),
- qw(snd-mpu401 snd-opti93x snd-rme9652 snd-sb8 snd-sbawe),
- qw(snd-ens1370 snd-ens1371 snd-es18xx snd-es968 snd-es1938 snd-es1968 snd-es1688),
- qw(snd-fm801 snd-hdsp snd-ice1712 snd-ice1724 snd-intel8x0 snd-korg1212 snd-maestro3),
- qw(snd-nm256 snd-rme96 snd-rme32 snd-opl3sa2 snd-sb16 snd-sgalaxy snd-sonicvibes),
- qw(snd-trident audio snd-via82xx snd-vx222 snd-wavefront snd-ymfpci),
- qw(snd-au8810 snd-au8820 snd-au8830),
- ),
- ],
- tv => [ qw(bttv cpia_usb cyber2000fb ibmcam mod_quickcam ov511 ov518_decomp pwc saa7134 ultracam usbvideo) ],
- photo => [ qw(dc2xx mdc800) ],
- radio => [ qw(radio-maxiradio) ],
- scanner => [ qw(scanner microtek) ],
- joystick => [ qw(ns558 emu10k1-gp iforce) ],
- },
-
- various =>
- # just here for classification, unused categories (nor auto-detect, nor load_thiskind)
- {
- raid => [
- qw(linear raid0 raid1 raid5 lvm-mod md multipath xor),
- ],
- mouse => [
- qw(busmouse msbusmouse logibusmouse serial qpmouse atixlmouse),
- ],
- char => [
- if_(arch() =~ /ia64/, qw(efivars)),
- qw(amd768_rng applicom n_r3964 nvram pc110pad ppdev),
- qw(mxser moxa isicom wdt_pci epca synclink istallion sonypi i810-tco sx), #- what are these???
- ],
- other => [
- qw(defxx i810_rng i810fb ide-floppy ide-scsi ide-tape loop lp nbd sg st),
- qw(parport parport_pc parport_serial),
- qw(btaudio),
-
- #- these need checking
- qw(pcilynx sktr rrunner meye 3c559 buz paep),
- ],
- agpgart => [
- if_(arch() =~ /alpha/, qw(alpha-agp)),
- if_(arch() =~ /ia64/, qw(hp-agp i460-agp)),
- if_(arch() =~ /ppc/, qw(uninorth-agp)),
-
- qw(agpgart ali-agp amd64-agp amd-k7-agp ati-agp intel-agp),
- qw(nvidia-agp sworks-agp sis-agp via-agp),
- ],
- },
-);
-
-my %dependencies;
-
-sub load_dependencies {
- my ($file) = @_;
-
- %dependencies = map {
- my ($f, $deps) = split ':';
- $f => [ split ' ', $deps ];
- } cat_($file);
-}
-
-sub dependencies_closure {
- my @l = map { dependencies_closure($_) } @{$dependencies{$_[0]} || []};
- (@l, $_[0]);
-}
-
-sub category2modules {
- map {
- my ($t1, $t2s) = m|(.*)/(.*)|;
- map {
- my $l = $l{$t1}{$_} or die "bad category $t1/$_\n" . backtrace();
- @$l;
- } split('\|', $t2s);
- } split(' ', $_[0]);
-}
-
-sub module2category {
- my ($module) = @_;
- foreach my $t1 (keys %l) {
- my $h = $l{$t1};
- foreach my $t2 (keys %$h) {
- $module eq $_ and return "$t1/$t2" foreach @{$h->{$t2}};
- }
- }
- return;
-}
-
-sub sub_categories {
- my ($t1) = @_;
- keys %{$l{$t1}};
-}
-
-1;
diff --git a/kernel/modules.pl b/kernel/modules.pl
deleted file mode 100644
index edca4f713..000000000
--- a/kernel/modules.pl
+++ /dev/null
@@ -1,201 +0,0 @@
-use strict;
-
-
-BEGIN {
- #- for testing purpose
- (my $f = __FILE__) =~ s|/[^/]*$||;
- push @INC, $f;
-}
-
-use MDK::Common;
-use list_modules;
-
-#- seldom used modules
-#- we don't bother making a special floppy for those
-my %modules_only_for_all_img = (
-
- 'network/main' => [
- qw(olympic acenic),
- qw(aironet4500_card com20020-pci hamachi starfire winbond-840),
-
- # token ring
- qw(tmspci ibmtr abyss),
-
- if_(arch() =~ /x86_64/, qw(orinoco_plx)), # don't support laptop for now
- if_(arch() =~ /x86_64/, qw(hp100 epic100)), # old (nico)
- if_(arch() =~ /alpha|ppc/, qw(sb1000)),
- qw(iph5526),
-
- qw(ac3200 at1700 atp ni5010 ni52 ni65), #- unused from Jeff
- ],
-
- 'bus/pcmcia' => [
- if_(arch() =~ /x86_64/, qw(pcmcia_core ds tcic yenta_socket)), # don't support laptop for now
- if_(arch() =~ /x86_64/, qw(i82092 i82365)), # doco says "older laptops"
- ],
-
- 'disk/scsi' => [
- # ISA cards:
- qw(NCR53c406a aha152x psi240i qlogicfas qlogicfc wd7000 sim710 t128 ultrastor), '53c7,8xx',
- qw(qla2x00 in2000 pas16 a100u2w seagate g_NCR5380),
- if_(arch() =~ /x86_64/, qw(53c7,8xx nsp32 initio advansys atp870u)), #- old
- qw(AM53C974), # deprecated by tmscsim
- qw(u14-34f), #- duplicate from ultrastor.o
- #- still used, keeping them: qw(aha1542 sym53c416),
- qw(lpfcdd), #- HUGE!!
-
- qw(dc395x_trm mptscsih BusLogic fdomain),
- qw(pci2220i eata eata_pio eata_dma),
- 'aic7xxx_old', 'qlogicisp',
- 'dtc',
- ],
-
- 'disk/hardware_raid' => [
- if_(arch() =~ /x86_64/, qw(ataraid)), #- old
- qw(i2o_block qla2200 qla2300 cpqfc DAC960 gdth pdc-ultra),
- ],
-);
-
-#- modules that will only be available in stage2
-#- those modules are NOT in all.img, network.img...
-#- there should only be modules that can't be used on stage1
-#- completly unused modules should be removed directly from the kernel
-#- (and so be removed from stage2 too)
-my %modules_removed_from_stage1 = (
- 'network/main' => [
- 'plip'
- ],
-
- 'disk/hardware_raid' => [
- qw(imm ppa),
- ],
-);
-
-my @modules_always_on_stage1 = qw(floppy);
-
-
-sub flatten_and_check {
- my ($h) = @_;
- map {
- my $category = $_;
- my @l = @{$h->{$category}};
- if (my @bad = difference2(\@l, [ category2modules($category) ])) {
- foreach (@bad) {
- if (my $cat = module2category($_)) {
- warn "ERROR in modules.pl: module $_ is in category $cat, not in $category\n";
- } else {
- warn "ERROR in modules.pl: unknown module $_\n";
- }
- }
- exit 1;
- }
- @l;
- } keys %$h;
-}
-
-my @modules_only_for_all_img = flatten_and_check(\%modules_only_for_all_img);
-my @modules_removed_from_stage1 = flatten_and_check(\%modules_removed_from_stage1);
-
-
-my %images = (
- pcmcia => 'fs/cdrom disk/cdrom|raw|pcmcia bus/pcmcia',
- cdrom => 'fs/cdrom disk/cdrom|raw|scsi',
- network => 'bus/usb|pcmcia disk/raw|usb',
- network_drivers => 'fs/network network/main|pcmcia|usb|raw|gigabit',
- all => 'fs/cdrom disk/cdrom|raw bus/usb disk/usb|scsi fs/loopback|local bus/pcmcia disk/pcmcia|hardware_raid fs/network network/main|pcmcia|usb|raw|gigabit bus/firewire disk/firewire',
-);
-
-my $verbose = "@ARGV" =~ /-v/;
-images() if "@ARGV" =~ /images/;
-check() if "@ARGV" =~ /check/;
-pci_modules4stage1($1) if "@ARGV" =~ /pci_modules4stage1:(.*)/;
-
-sub images() {
- while (my ($image, $l) = each %images) {
- my @modules = if_($image !~ /drivers/, @modules_always_on_stage1);
- push @modules, map { category2modules($_) } split(' ', $l);
-
- @modules = difference2(\@modules, \@modules_removed_from_stage1);
-
- if ($image !~ /all/) {
- @modules = difference2(\@modules, \@modules_only_for_all_img);
- }
- printf qq(%s_modules_raw="%s"\n), $image, join ' ', @modules;
- }
- printf qq(images="%s"\n), join(' ', keys %images);
-}
-
-sub pci_modules4stage1 {
- print "$_\n" foreach uniq(map { dependencies_closure($_) } difference2([ category2modules($_[0]) ], \@modules_removed_from_stage1));
-}
-
-sub check() {
- my $error;
- my %listed;
- while (my ($t1, $l) = each %list_modules::l) {
- while (my ($t2, $l) = each %$l) {
- ref $l or die "bad $l in $t1/$t2";
- foreach (@$l) {
- $listed{$_} = "$t1/$t2";
- }
- }
- }
-
- my %module2category;
- my %deprecated_modules = %listed;
- my $not_listed = sub {
- my ($msg, $verbose, @l) = @_;
- my %not_listed;
- foreach (@l) {
- my ($mod) = m|([^/]*)\.k?o(\.gz)?$| or next;
- delete $deprecated_modules{$mod};
- next if $listed{$mod};
- s|.*?mdk(BOOT)?/||;
- s|kernel/||; s|drivers/||; s|3rdparty/||;
- $_ = dirname $_;
- $_ = dirname $_ if $mod eq basename($_);
- $module2category{$mod} = $_;
- push @{$not_listed{$_}}, $mod;
- }
- if ($verbose) {
- print "$msg $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed;
- }
- };
- $not_listed->('NOT LISTED', 1, `cd all.kernels/2.6* ; find -name "*.k?o" -o -name "*.k?o.gz"`);
- $not_listed->('not listed', $verbose, `rpm -qpl /RPMS/kernel-2.6*`);
- if (%deprecated_modules) {
- my %per_cat;
- push @{$per_cat{$listed{$_}}}, $_ foreach keys %deprecated_modules;
- foreach my $cat (sort keys %per_cat) {
- print "bad/old modules ($cat) : ", join(" ", sort @{$per_cat{$cat}}), "\n";
- }
- }
-
- {
- require '/usr/bin/merge2pcitable.pl';
- my $pcitable = read_pcitable("/usr/share/ldetect-lst/pcitable");
- my $usbtable = read_pcitable("/usr/share/ldetect-lst/usbtable");
-
- my @l1 = uniq grep { !/:/ && $_ ne 'unknown' } map { $_->[0] } values %$pcitable;
- if (my @l = difference2(\@l1, [ keys %listed ])) {
- my %not_listed;
- push @{$not_listed{$module2category{$_}}}, $_ foreach @l;
- if (my $l = delete $not_listed{''}) {
- print "bad/old pcitable modules : ", join(" ", @$l), "\n";
- }
- print STDERR "PCITABLE MODULES NOT LISTED $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed;
- #$error = 1;
- }
-
- my @l2 = uniq grep { !/:/ && $_ ne 'unknown' } map { $_->[0] } values %$usbtable;
- if (my @l = difference2(\@l2, [ keys %listed ])) {
- my %not_listed;
- push @{$not_listed{$module2category{$_}}}, $_ foreach @l;
- if ($verbose) {
- print "usbtable modules not listed $_: ", join(" ", @{$not_listed{$_}}), "\n" foreach sort keys %not_listed;
- }
- }
- }
-
- exit $error;
-}
diff --git a/kernel/strip_modules b/kernel/strip_modules
deleted file mode 100755
index 98e4f4496..000000000
--- a/kernel/strip_modules
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/sh
-#
-# Given a list of objects, strip all static symbols except those
-# required by insmod.
-#
-# Copyright Keith Owens <kaos@ocs.com.au>. GPL.
-# Sat Feb 1 12:52:17 EST 1997
-#
-# Mainly intended for reducing the size of modules to save space
-# on emergency and install disks. Be aware that removing the
-# static symbols reduces the amount of diagnostic information
-# available for oops. Not recommended for normal module usage.
-#
-# This code requires the modules use MODULE_PARM and EXPORT_.
-# Do not strip modules that have not been converted to use
-# MODULE_PARM or are using the old method of exporting symbols.
-# In particular do not use on modules prior to 2.1.20 (approx).
-#
-# The objects are stripped in /tmp, only if the strip works is
-# the original overwritten. If the command line to strip the
-# symbols becomes too long, the strip is done in multiple passes.
-# Running strip_module twice on the same object is safe (and a
-# waste of time).
-#
-
-sizeofptr="/tmp/$$.sizeofptr"
-echo 'int main() { return sizeof(void *); }' | gcc -xc - -o $sizeofptr
-$sizeofptr
-export SIZEOF_POINTER=$?
-rm -f $sizeofptr
-
-cat > /tmp/$$.awk <<\EOF
-BEGIN {
- strip = "/usr/bin/objcopy";
- nm = "/usr/bin/nm";
- cp = "/bin/cp";
- mv = "/bin/mv";
- rm = "/bin/rm";
- tmp = "/tmp";
- command_size = 400; # arbitrary but safe
-
- getline < "/proc/self/stat";
- pid = $1;
- tmpcopy = tmp "/" pid ".object";
- nmout = tmp "/" pid ".nmout";
-
- for (i = 1; i < ARGC; ++i)
- strip_module(ARGV[i]);
-
- do_command(rm " -f " tmpcopy " " nmout);
-
- exit(0);
-}
-
-function strip_module(object,
- keep_symbol, to_strip, symbol, command, changed) {
- do_command(cp " -a " object " " tmpcopy);
- do_command(nm " " tmpcopy " > " nmout);
- # delete array_name sometimes breaks, internal error, play safe
- for (symbol in keep_symbol)
- delete keep_symbol[symbol];
- for (symbol in to_strip)
- delete to_strip[symbol];
- new_module_format = 0;
- ptrskip = 2 + 2 * ENVIRON["SIZEOF_POINTER"];
- while ((getline < nmout) > 0) {
- $0 = substr($0, ptrskip);
- # b static variable, uninitialised
- # d static variable, initialised
- # r static array, initialised
- # t static label/procedures
- if ($1 ~ /[bdrt]/)
- to_strip[$2] = "";
- else if ($2 ~ /R __ksymtab_/)
- keep_symbol[substr($2, 11)] = "";
- else if ($0 ~ /R __module_parm_/)
- keep_symbol[substr($2, 15)] = "";
- else if ($1 != "?")
- keep_symbol[$2] = "";
- if ($2 ~ /__module/)
- new_module_format = 1;
- }
- close(nmout);
- command = "";
- changed = 0;
- failure = 0;
- if (new_module_format) {
- for (symbol in to_strip) {
- if (!(symbol in keep_symbol)) {
- changed = 1;
- if (length(command) > command_size) {
- failure = failure || do_command(strip command " " tmpcopy);
- command = "";
- }
- command = command " --strip-symbol=" symbol;
- }
- }
- }
- if (command != "") {
- changed = 1;
- failure = failure || do_command(strip command " " tmpcopy);
- }
- if (changed && !failure)
- do_command(mv " " tmpcopy " " object);
-}
-
-function do_command(command) {
- if ((ret = system(command)) != 0) {
- giveup("command \"" command "\" failed " ret, ret);
- return 1;
- }
- return 0;
-}
-
-function giveup(message, ret) {
- print "strip_module: " message > "/dev/stderr";
-# exit(ret);
-}
-EOF
-
-awk -f /tmp/$$.awk "$@"
-ret=$?
-rm -f /tmp/$$.awk
-exit $ret
diff --git a/kernel/update_kernel b/kernel/update_kernel
deleted file mode 100755
index 5da807e71..000000000
--- a/kernel/update_kernel
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/bash
-
-ALL_KERNELS="all.kernels"
-RPMS=/export/Mandrake/RPMS
-
-ARCH=`uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/'`
-
-
-# move stuff to this new "kernel" directory
-if [ ! -d all.kernels ]; then
- if [ -d ../all.kernels ]; then
- mv ../all.kernels .
- rm -rf ../all.modules
- else
- # make sure "all.kernels" directory exists
- mkdir all.kernels
- fi
-fi
-
-function create_marfile() {
- marfile=$1
- shift
- $GIBASEDIR/mdk-stage1/mar/mar -c $marfile $*
-}
-
-function build_kernel_is_26() {
- uname -r | grep -q '^2\.6'
-}
-
-function kern_version() {
- if echo $1 | grep -q ^2.4; then
- version=24
- objects="*.o"
- else
- version=25
- objects="*.ko"
- fi
-}
-
-function create_modules() {
- kernel_path=$1
- kern=$2
- echo "Updating modules in '`pwd`' for kernel '$kern'"
- kern_version $kern
- find $kernel_path/lib/modules/ -name "$objects" -exec cp -f {} . \;
- if [ $version -eq 24 ]; then
- /sbin/depmod-24 -F $kernel_path/boot/System.map* -e *.o | perl -pe 's/\\\n//' \
- | perl -ne 's/\.o//g; s/[ \t]+/ /g; print if /: /' > modules.dep
- else
- cp $kernel_path/lib/modules/*/modules.dep .
- perl -ni -e 's|/\S+/([^/]+)\.k?o(\.gz)|$1|g; print if /: /' modules.dep
- fi
- perl -pi -e 's/((plip|ppa|imm): parport)/$1 parport_pc/' modules.dep
-
- if build_kernel_is_26; then
- /sbin/modinfo $objects | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!' > modules.description
- else
- /sbin/modinfo-$version -f '%{filename} %{description}\n' $objects | perl -lne 'print "$1\t$2" if /(.*?)\.k?o "(.*)"/' > modules.description
- fi
-}
-
-function create_modules_mar() {
- kern_version $kern
-
- if [ $version -eq 24 ]; then
- echo -n "stripping $kern: "
- $GIBASEDIR/kernel/strip_modules *.o 2>/dev/null
- echo "done"
- else
- echo "don't strip on 2.6 since it breaks modules"
- fi
-
- if [ -z "$MOVE" ]; then
- echo -n "packdrake $kern: "
- ls $objects | packdrake -b9s "modules.cz" 400000
- echo "done"
- mv modules.cz ../modules.cz-$kern
- fi
- for i in $images; do
- eval "modules=\$${i}_modules_raw"
- modules_with_deps=`perl -I $GIBASEDIR/kernel $GIBASEDIR/kernel/dependencies.pl $version modules.dep $modules`
- eval "create_marfile ${i}_modules.mar $modules_with_deps"
- done
- echo
-}
-
-function install_kernel() {
- rpm=$1
-
- ver=$(rpm -qp --qf '%{name}' $rpm 2>/dev/null | perl -pe 's/kernel(-(BOOT))?-((\.?[0-9]+){3})\.(.*)/$3-$5$2/')
- [ -n "$ver" ] || return
-
- if [ -n "$2" ]; then
- [ -d $ALL_KERNELS/$ver ] && return
- main_ver=$2
- echo Removing previous kernel $ALL_KERNELS/$main_ver*
- rm -rf $ALL_KERNELS/$main_ver*
- fi
-
- rm -rf $ALL_KERNELS/$ver
- echo "Installing kernel $ver"
- mkdir -p $ALL_KERNELS/$ver
- rpm2cpio $rpm | (cd $ALL_KERNELS/$ver ; cpio -id)
-
- find $ALL_KERNELS/$ver -type f -name "*.o.gz" -o -name "*.ko.gz" | xargs gunzip
-
- # will get back when make_boot_img is called
- for dir in /tftpboot /var/lib/tftpboot; do
- rm -f $dir/{vmlinuz,network.rdz,all.rdz}
- done
-}
-
-[ -e $ALL_KERNELS/.main ] && main=$(cat $ALL_KERNELS/.main)
-
-if [ "$1" = "--move" ]; then
- MOVE=1
- shift
-fi
-
-if [ "$ARCH" == "ia64" ] || [ "$ARCH" == "ppc" ]; then
- name=kernel
-else
- name=kernel-BOOT
-fi
-
-if [ -n "$1" ]; then
- #- allow specifying a kernel file on commandline (./update_kernel /RPMS/kernel-2.4.22.10mdk-1-1mdk.i586.rpm)
- install_kernel $1
-else
- install_kernel $RPMS/kernel-BOOT-2.4*.rpm 2.4
- install_kernel $RPMS/kernel-BOOT-2.6*.rpm 2.6
-fi
-
-[ -n "$main" -a -e $ALL_KERNELS/$main ] || {
- cd $ALL_KERNELS
- main=$(echo 2.6* | sed 's/.* //')
- [ -n "$main" ] || main=$(echo 2.4* | sed 's/.* //')
- echo "Choosing $main"
- echo $main > .main
- cd ..
-}
-
-
-if [ "$ARCH" == "i386" ]; then
- for i in $ALL_KERNELS/*/boot/vmlinuz*; do
- #disable any existing resolution!!!
- /usr/sbin/rdev -v $i 65535 #788 #785
- done
-fi
-
-
-GIBASEDIR=`pwd`/..
-
-rm -rf all.modules ; mkdir all.modules
-for i in $ALL_KERNELS/*; do
- kern=`basename $i`
- (
- mkdir all.modules/$kern
- cd all.modules/$kern
-
- create_modules ../../$i $kern
- ) || exit 1
-done
-cp -f all.modules/$main/modules.description .
-
-l=`MOVE=$MOVE perl modules.pl images` || exit 1
-eval $l
-
-for i in $ALL_KERNELS/*; do
- kern=`basename $i`
- (
- cd all.modules/$kern
-
- if [ "$kern" = "$main" ]; then
- create_modules_mar ../../$i $kern
- else
- echo "$kern ($main)"
- create_modules_mar ../../$i $kern 2>/dev/null
- fi
- ) || exit 1
-done
-
-
-./check_mar.pl
diff --git a/make_boot_img b/make_boot_img
deleted file mode 100755
index 4b18ad11f..000000000
--- a/make_boot_img
+++ /dev/null
@@ -1,811 +0,0 @@
-#!/usr/bin/perl
-
-use Config;
-use MDK::Common;
-Config->import;
-my ($arch) = $Config{archname} =~ /(.*?)-/;
-
-# move stuff to new "kernel" directory
--d 'kernel' or die "directory kernel is missing\n";
-rename 'all.kernels', 'kernel/all.kernels';
-rename 'all.modules', 'kernel/all.modules';
-
-my $default_append = "ramdisk_size=128000 root=/dev/ram3";
-# full acpi support for amd64, enough acpi support for x86 ht, no acpi for others
-my $default_acpi = $arch =~ /i.86/ ? "acpi=ht" : $arch =~ /x86_64/ ? "acpi=off" : "acpi=off";
-my $default_vga = "vga=788";
-
-my $instdir = "mdk-stage1";
-my $tmp_mnt = '/tmp/drakx_mnt';
-my $tmp_mnt_initrd = '/tmp/drakx_mnt2';
-my $mke2fs = "/sbin/mke2fs -q -m 0 -F -s 1";
-
-my $sudo;
-if ($>) {
- $sudo = "sudo";
- $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
-}
-
-sub __ { print @_, "\n"; system(@_) }
-sub _ { __ @_; $? and die }
-
-_ "$sudo mkdir -p $tmp_mnt $tmp_mnt_initrd";
-mkdir "images";
-
-chomp(my $main = `cat kernel/all.kernels/.main`);
-my @kernels = grep { /^2/ } all('kernel/all.kernels');
-
-
-my @all_images = (
- if_($arch =~ /i.86/, 'cdrom.img', 'cdrom-changedisk.img', 'pcmcia.img', 'isolinux', 'boot.iso', 'hd_grub.img', 'network.img', 'network_drivers.img'),
- if_($arch =~ /x86_64/, 'cdrom.img', 'isolinux', 'boot.iso'),
- if_($arch =~ /ia64/, 'all.img'),
- );
-
-my @images = @ARGV ? @ARGV : map { "images/$_" } @all_images;
-
-if (any { /move/ } @images) {
- -e "$instdir/init-move" or die "ERROR: $instdir not built for move\n";
-} else {
- -e "$instdir/init-move" and die "ERROR: $instdir built for move\n";
-}
-
-foreach my $img (@images) {
- my ($type, $I, $extension) = $img =~ m!([^/]*)(64)?\.([^.]*)$!;
-
- if ($img =~ /hd_grub/) {
- hd_grub($tmp_mnt, $img);
- } elsif ($img =~ /isolinux/) {
- isolinux($main, @kernels);
-
- if (my ($tftpboot) = grep { -e $_ } qw(/tftpboot /var/lib/tftpboot)) {
- system("/bin/cp -f isolinux/alt0/* $tftpboot 2>/dev/null");
- }
- } elsif ($img =~ /move/) {
- isolinux_move($main);
-
- if (my ($tftpboot) = grep { -e $_ } qw(/tftpboot /var/lib/tftpboot)) {
- system("/bin/cp -f move/isolinux/* $tftpboot/move 2>/dev/null");
- }
- } elsif ($img =~ /boot.iso/) {
- boot_iso($img);
- } elsif ($img =~ /drivers/) {
- drivers($type, $I, "$img-$_") foreach @kernels;
- rename("$img-$main", $img);
- } elsif ($extension eq 'rdz') {
- initrd($tmp_mnt_initrd, $type, $I, "$img-$_") foreach @kernels;
- } elsif ($extension eq 'img') {
- print STDERR "calling boot_img_$arch for $img\n";
- $::{"boot_img_$arch"}->($tmp_mnt, $type, $I, "$img-$_", glob("kernel/all.kernels/$_/boot/vmlinu*")) foreach @kernels;
- rename("$img-$main", $img);
- } else {
- die "unknown image $img";
- }
-}
-
-sub syslinux_color {
- "0" . {
- default => '7',
- blue => '9',
- green => 'a',
- red => 'c',
- yellow => 'e',
- white => 'f',
- }->{$_[0]} || die "unknown color $_[0]\n";
-}
-
-sub syslinux_msg {
- my ($msg_xml_file, @more_text) = @_;
-
- require XML::Parser;
-
- sub xml_tree2syslinux {
- my ($current_color, $tree) = @_;
- my (undef, @l) = @$tree;
- join('', map {
- my ($type, $val) = @$_;
- if ($type eq '0') {
- $val;
- } else {
- syslinux_color($type) . xml_tree2syslinux($type, $val) . syslinux_color($current_color);
- }
- } group_by2(@l));
- };
-
- print "parsing $msg_xml_file\n";
- my $tree = XML::Parser->new(Style => 'Tree')->parsefile($msg_xml_file);
- $tree->[0] eq 'document' or die "bad file $msg_xml_file\n";
- my $text = xml_tree2syslinux('default', $tree->[1]);
-
- pack("C*", 0x0E, 0x80, 0x03, 0x00) . " "
- . $text . join('', @more_text)
- . "\n" . syslinux_color('red') . "[F1-Help] [F2-Advanced Help] [F3-Main]" . syslinux_color('default') . "\n";
-}
-
-sub install_stripped { _ "strip $_[0]"; _ "$sudo install $_[0] $_[1]" }
-
-sub initrd {
- my ($mnt, $type, $I, $img, $o_raw_stage1_tree_kind) = @_;
- my $tmp = "$ENV{HOME}/tmp/initrd";
- my $tar = "$instdir/stage1-data/stage1$o_raw_stage1_tree_kind.tar.bz2";
-
- __ "$sudo umount $tmp $mnt 2>/dev/null";
- _ "dd if=/dev/zero of=$tmp bs=1k count=" . ($arch =~ /ia64/ ? ($type eq "all" ? 16386 : 16384) : ($type eq "all" ? 5000 : 2000));
- _ "$mke2fs $tmp";
- _ "$sudo mount -t ext2 $tmp $mnt -o loop";
-
- _ "$sudo tar xjC $mnt -f $tar";
- symlinkf "/tmp/stage2/lib64", "$mnt/lib64" if $arch =~ /x86_64/;
-
- {
- my $install = ${{
- network => "stage1-network",
- cdrom => "stage1-cdrom",
- }}{$type} || 'stage1-full';
- install_stripped("$instdir/init", "$mnt/sbin");
- install_stripped("$instdir/$install", "$mnt/sbin/stage1");
- }
-
- if (member($type, qw(network all))) {
- install_stripped("$instdir/ppp/pppd-bin", "$mnt/sbin/pppd");
- install_stripped("$instdir/rp-pppoe/pppoe-bin", "$mnt/sbin/pppoe");
- _ "$sudo mknod $mnt/dev/ppp c 108 0";
- _ "$sudo mknod $mnt/dev/ptyp0 c 2 0";
- _ "$sudo mknod $mnt/dev/ttyp0 c 3 0";
- }
-
- if (member($type, qw(pcmcia all network)) && $arch !~ /ppc|ia64|x86_64/) {
- _ "$sudo cp -a /etc/pcmcia $mnt/etc";
- _ "cp $mnt/etc/pcmcia/config /tmp/pcmcia_config_tmp";
- _ "tools/patch_pcmcia_config.pl /tmp/pcmcia_config_tmp kernel/all.modules/$main/modules.dep";
- _ "sudo mv /tmp/pcmcia_config_tmp $mnt/etc/pcmcia/config";
- }
- my ($ext) = $img =~ /rdz-(.*)/ or die "bad initrd name ($img)";
- my $modz = "kernel/all.modules$I/$ext";
- _ "$sudo cp -f $modz/${type}_modules.mar $mnt/modules/modules$I.mar";
- _ "$sudo cp -f $modz/modules.dep $mnt/modules/";
- _ "$sudo umount $mnt";
-
-# Workaround for vfat-loop bug (quite touchy)
- _ "gzip -9f $tmp";
- _ "cp -f $tmp.gz $img";
- _ "rm -f $tmp.gz";
-# _ "gzip -9 -c $tmp > $img";
-# _ "rm -f $tmp";
-}
-
-sub entries_append {
- my ($type) = @_;
-
- my $automatic = $type eq "cdrom" ? 'automatic=method:cdrom' : '';
-
- my @simple_entries = (
- linux => $default_vga,
- vgalo => "vga=785",
- vgahi => "vga=791",
- vga16 => "vga16",
- text => "text",
- patch => "patch $default_vga",
- expert => "expert $default_vga",
- rescue => "rescue rw",
- );
- my @entries = (
- (map { $_->[0] => "$automatic $default_acpi $_->[1]" } group_by2(@simple_entries)),
- acpi => "$automatic $default_vga",
- if_(member($type, "cdrom", "all"), oem => "automatic=method:cdrom $default_vga $default_acpi rescue oem rw",),
- if_($type eq "all", all => "pcmcia $default_vga $default_acpi"),
- );
-
- map { [ $_->[0], "$default_append $_->[1]" ] }
- group_by2(@entries);
-}
-
-sub boot_img_i386 {
- my ($mnt, $type, $I, $img, $kernel) = @_;
-
- __ "$sudo umount $mnt 2>/dev/null";
-
- _ "dd if=/dev/zero of=$img bs=1k count=" . ($type eq 'all' ? 2880 : 1440);
- _ "mkdosfs -f 1 -r 16 -s 2 $img"; # keep the FAT bookkeeping as small as possible
- _ "$sudo syslinux-graphic $img";
-
- _ "$sudo mount -t vfat -o umask=0 $img $mnt -o loop";
- _ "cat $kernel > $mnt/vmlinuz";
- bmp_to_msg('isolinux-graphic-simple.bmp', "$mnt/boot.msg", '397,190,14,6', 27, 27);
-
- output("$mnt/help.msg", syslinux_msg('help.msg.xml'));
- output("$mnt/advanced.msg", syslinux_msg('advanced.msg.xml'));
-
- (my $rdz = $img) =~ s/\.img/.rdz/;
- (my $initrd_type = $type) =~ s/-changedisk//;
- initrd($tmp_mnt_initrd, $initrd_type, $I, $rdz);
- my $short_type = substr($type, 0, 8);
- eval { _ "cp -f $rdz $mnt/$short_type.rdz" };
- if ($@) {
- unlink "$mnt/$short_type.rdz";
- my $avail = (split ' ', `df $mnt`)[-3];
- my $s = int((-s $rdz) / 1024);
-
- my ($ext) = $img =~ /\.img-(.*)/ or die "bad initrd name ($img)";
- my $dir = "kernel/all.modules/$ext";
- my $pcitable = cat_('/usr/share/ldetect-lst/pcitable');
- my @l = sort { $a <=> $b } map {
- my ($name) = /(\S+)\.k?o$/ or die "bad file in .mar";
- my $gz_size = chomp_(`gzip -c $dir/$_ | wc -c`);
- sprintf "%7d %6d %s\n", $gz_size, listlength($pcitable =~ /"$name"/g), $name;
- } split(' ', `mdk-stage1/mar/mar -l $dir/${type}_modules.mar`);
- output('.not-enough-room', "gz size - pcitable - name\n", @l);
-
- warn sprintf("not enough room for $rdz: need %dKB (available %dKB < needed %dKB)\n", $s - $avail, $avail, $s);
- die qq(check file ".not-enough-room" to see modules size and pcitable usage\n);
- }
- unlink $rdz;
-
- my $timeout = 72;
- output "$mnt/syslinux.cfg",
-"default linux
-prompt 1
-timeout $timeout
-display boot.msg
-F1 help.msg
-F2 advanced.msg
-F3 boot.msg
-" . join('', map {
-"label $_->[0]
- kernel vmlinuz
- append initrd=$short_type.rdz $_->[1]
-" } entries_append($type));
-
- _ "sync";
- _ "df $mnt";
- _ "$sudo umount $mnt";
-}
-
-# alias to x86 variant, slightly bigger with images though
-sub boot_img_x86_64 { &boot_img_i386 }
-
-sub boot_img_alpha {
- my ($mnt, $type, $I, $img) = @_;
-
- __ "$sudo umount $mnt 2>/dev/null";
- _ "dd if=/dev/zero of=$img bs=1k count=1440";
- _ "$mke2fs $img";
- _ "/sbin/e2writeboot $img /boot/bootlx";
- _ "$sudo mount -t ext2 $img $mnt -o loop";
- _ "cp -f vmlinux.gz $mnt";
- -f "$type.rdz" ? _ "cp -f $type.rdz $mnt" : initrd($tmp_mnt_initrd, $type, $I, "$mnt/$type.rdz");
-
- mkdir "$mnt/etc", 0777;
- output("$mnt/etc/aboot.conf",
-"0:vmlinux.gz initrd=$type.rdz rw $default_append $type
-1:vmlinux.gz initrd=$type.rdz rw $default_append text $type
-");
- _ "sync";
- _ "df $mnt";
-}
-
-sub boot_img_ia64 {
- my ($mnt, $type, $_I, $img, $kernel) = @_;
- my $rdz = $img; $rdz =~ s/\.img/.rdz/;
-
- __ "$sudo umount $mnt 2>/dev/null";
- _ "dd if=/dev/zero of=$img bs=1k count=16384";
- _ "mkdosfs $img";
- _ "$sudo mount -t vfat $img $mnt -o loop,umask=000";
- _ "$sudo cp -f $kernel $mnt/vmlinux";
- _ "cp -f $rdz $mnt/$type.rdz";
- _ "$sudo cp -f tools/ia64/elilo.efi $mnt";
- output("$mnt/elilo.conf", qq(
-prompt
-timeout=50
-
-image=vmlinux
- label=linux
- root=/dev/ram3
- initrd=$type.rdz
- append=" ramdisk_size=120000"
- read-only
-
-image=vmlinux
- label=rescue
- root=/dev/ram3
- initrd=$type.rdz
- append=" rescue ramdisk_size=120000"
-"));
- _ "sync";
- _ "df $mnt";
-
-}
-
-sub boot_img_sparc {
- my ($mnt, $type, $I, $_img) = @_;
- if ($type =~ /^live(.*)/) {
- #- hack to produce directly into /export the needed file for cdrom boot.
- my $dir = "/export";
- my $boot = "boot"; #- non-absolute pathname only!
-
- _ "mkdir -p $dir/$boot";
- _ "cp -f /boot/cd.b /boot/second.b $dir/$boot";
- _ "cp -f vmlinux$1 $dir/$boot/vmlinux$1";
- -f "live$1.rdz" ? _ "cp -f live$1.rdz $dir/$boot" : initrd($tmp_mnt_initrd, $type, $I, "$dir/$boot/live$1.rdz");
-
- output("$dir/$boot/silo.conf", qq(
-partition=1
-default=linux
-timeout=100
-read-write
-message=/$boot/boot.msg
-image="cat /$boot/boot.msg"
- label=1
- single-key
-image="cat /$boot/general.msg"
- label=2
- single-key
-image="cat /$boot/expert.msg"
- label=3
- single-key
-image="cat /$boot/rescue.msg"
- label=4
- single-key
-image="cat /$boot/kickit.msg"
- label=5
- single-key
-image="cat /$boot/param.msg"
- label=6
- single-key
-image[sun4c,sun4d,sun4m]=/$boot/vmlinux
- label=linux
- alias=install
- initrd=/$boot/live.rdz
- append="ramdisk_size=128000 root=/dev/ram3"
-image[sun4c,sun4d,sun4m]=/$boot/vmlinux
- label=text
- initrd=/$boot/live.rdz
- append="ramdisk_size=128000 text root=/dev/ram3"
-image[sun4c,sun4d,sun4m]=/$boot/vmlinux
- label=expert
- initrd=/$boot/live.rdz
- append="ramdisk_size=128000 expert root=/dev/ram3"
-image[sun4c,sun4d,sun4m]=/$boot/vmlinux
- label=ks
- initrd=/$boot/live.rdz
- append="ramdisk_size=128000 ks root=/dev/ram3"
-image[sun4c,sun4d,sun4m]=/$boot/vmlinux
- label=rescue
- initrd=/$boot/live.rdz
- append="ramdisk_size=128000 rescue rw root=/dev/ram3"
-image[sun4u]=/$boot/vmlinux64
- label=linux
- alias=install
- initrd=/$boot/live64.rdz
- append="ramdisk_size=128000 root=/dev/ram3"
-image[sun4u]=/$boot/vmlinux64
- label=text
- initrd=/$boot/live64.rdz
- append="ramdisk_size=128000 text root=/dev/ram3"
-image[sun4u]=/$boot/vmlinux64
- label=expert
- initrd=/$boot/live64.rdz
- append="ramdisk_size=128000 expert root=/dev/ram3"
-image[sun4u]=/$boot/vmlinux64
- label=ks
- initrd=/$boot/live64.rdz
- append="ramdisk_size=128000 ks root=/dev/ram3"
-image[sun4u]=/$boot/vmlinux64
- label=rescue
- initrd=/$boot/live64.rdz
- append="ramdisk_size=128000 rescue rw root=/dev/ram3"
-"));
-
- output("$dir/$boot/README", "
-To Build a Bootable CD-ROM, try:
- mkisofs -R -o t.iso -s /$boot/silo.conf /export
-");
- } elsif ($type =~ /^tftprd(.*)/) {
- my $dir = "/export";
- my $boot = "images";
- my $setarch = $1 ? "sparc64" : "sparc32";
-
- _ "mkdir -p $dir/$boot";
- -f "$type.rdz" or initrd($tmp_mnt_initrd, $type, $I, "$type.rdz");
- _ "cp -f vmlinux$1.aout $dir/$boot/$type.img";
- _ "$setarch kernel$1/src/arch/sparc$1/boot/piggyback $dir/$boot/$type.img kernel$1/boot/System.map $type.rdz";
- } elsif ($type =~ /^tftp(.*)/) {
- my $dir = "/export";
- my $boot = "images";
-
- _ "mkdir -p $dir/$boot";
- _ "cp -f vmlinux$1.aout $dir/$boot/$type.img";
- } else {
- my $dir = "floppy";
- __ "$sudo umount $mnt 2>/dev/null";
- _ "rm -rf $dir";
- _ "mkdir -p $dir";
- _ "cp -f /boot/fd.b /boot/second.b $dir";
- _ "cp -f vmlinuz$I $dir/vmlinux$I.gz";
- -f "$type.rdz" ? _ "cp -f $type.rdz $dir" : initrd($tmp_mnt_initrd, $type, $I, "$dir/$type.rdz");
-
- output("$dir/boot.msg", "
-Welcome to Mandrake Linux 7.1
-
-Press <Enter> to install or upgrade a system 7mMandrake Linux7m
-");
-
- output("$dir/silo.conf", qq(
-partition=1
-default=linux
-timeout=100
-read-write
-message=/boot.msg
-image=/vmlinux$I.gz
- label=linux
- initrd=/$type.rdz
- append="ramdisk_size=128000 $type root=/dev/ram3"
-"));
- _ "genromfs -d $dir -f /dev/ram -A 2048,/.. -a 512 -V 'DrakX boot disk'";
- _ "$sudo mount -t romfs /dev/ram $mnt";
- _ "silo -r $mnt -F -i /fd.b -b /second.b -C /silo.conf";
- _ "$sudo umount $mnt";
- _ "dd if=/dev/ram of=$type.img bs=1440k count=1";
- _ "sync";
- _ "$sudo mount -t romfs /dev/ram $mnt";
- _ "df $mnt";
- }
-}
-
-sub boot_img_ppc() {
- #- hack to produce directly into /export the needed file for cdrom boot.
- my $dir = "/export";
- my $boot = "boot"; #- non-absolute pathname only!
- _ "rm -rf $dir/$boot"; mkdir "$dir/$boot", 0777;
- foreach (glob("kernel/all.kernels/*")) {
- my $ext = basename($_);
- if ($ext =~ /2.4/) {
- _ "cp $_/boot/vmlinux $dir/$boot/vmlinux";
- _ "cp images/all.rdz-$ext $dir/$boot/all.gz";
- }
- if ($ext =~ /2.2/) {
- _ "cp $_/boot/vmlinux $dir/$boot/vmlinux-2.2";
- _ "cp images/all.rdz-$ext $dir/$boot/all-2.2.gz";
- }
- }
- _ "cp -f /usr/lib/yaboot/yaboot $dir/$boot/yaboot";
-
- output("$dir/$boot/ofboot.b", '<CHRP-BOOT>
-<COMPATIBLE>
-MacRISC
-</COMPATIBLE>
-<DESCRIPTION>
-Mandrake Linux PPC bootloader
-</DESCRIPTION>
-<BOOT-SCRIPT>
-" screen" output
-dev screen
-" "(0000000000aa00aa0000aaaaaa0000aa00aaaa5500aaaaaa)" drop 0 8 set-colors
-" "(5555555555ff55ff5555ffffff5555ff55ffffff55ffffff)" drop 8 8 set-colors
-device-end
-3 to foreground-color
-0 to background-color
-" "(0C)" fb8-write drop
-" Booting Mandrake Linux PPC..." fb8-write drop 100 ms
-boot cd:2,\\\\yaboot
-</BOOT-SCRIPT>
-<OS-BADGE-ICONS>
-1010
-000000000000F8FEACF6000000000000
-0000000000F5FFFFFEFEF50000000000
-00000000002BFAFEFAFCF70000000000
-0000000000F65D5857812B0000000000
-0000000000F5350B2F88560000000000
-0000000000F6335708F8FE0000000000
-00000000005600F600F5FD8100000000
-00000000F9F8000000F5FAFFF8000000
-000000008100F5F50000F6FEFE000000
-000000F8F700F500F50000FCFFF70000
-00000088F70000F50000F5FCFF2B0000
-0000002F582A00F5000008ADE02C0000
-00090B0A35A62B0000002D3B350A0000
-000A0A0B0B3BF60000505E0B0A0B0A00
-002E350B0B2F87FAFCF45F0B2E090000
-00000007335FF82BF72B575907000000
-000000000000ACFFFF81000000000000
-000000000081FFFFFFFF810000000000
-0000000000FBFFFFFFFFAC0000000000
-000000000081DFDFDFFFFB0000000000
-000000000081DD5F83FFFD0000000000
-000000000081DDDF5EACFF0000000000
-0000000000FDF981F981FFFF00000000
-00000000FFACF9F9F981FFFFAC000000
-00000000FFF98181F9F981FFFF000000
-000000ACACF981F981F9F9FFFFAC0000
-000000FFACF9F981F9F981FFFFFB0000
-00000083DFFBF981F9F95EFFFFFC0000
-005F5F5FDDFFFBF9F9F983DDDD5F0000
-005F5F5F5FDD81F9F9E7DF5F5F5F5F00
-0083DD5F5F83FFFFFFFFDF5F835F0000
-000000FBDDDFACFBACFBDFDFFB000000
-000000000000FFFFFFFF000000000000
-0000000000FFFFFFFFFFFF0000000000
-0000000000FFFFFFFFFFFF0000000000
-0000000000FFFFFFFFFFFF0000000000
-0000000000FFFFFFFFFFFF0000000000
-0000000000FFFFFFFFFFFF0000000000
-0000000000FFFFFFFFFFFFFF00000000
-00000000FFFFFFFFFFFFFFFFFF000000
-00000000FFFFFFFFFFFFFFFFFF000000
-000000FFFFFFFFFFFFFFFFFFFFFF0000
-000000FFFFFFFFFFFFFFFFFFFFFF0000
-000000FFFFFFFFFFFFFFFFFFFFFF0000
-00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
-00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
-00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
-000000FFFFFFFFFFFFFFFFFFFF000000
-</OS-BADGE-ICONS>
-</CHRP-BOOT>
-');
-
- output("$dir/$boot/yaboot.conf", '
-init-message = "\nWelcome to Mandrake Linux PPC!\nHit <TAB> for boot options.\n\n"
-timeout = 150
-default = install-gui
-message=cd:,\\\\yaboot.msg
-
-image = cd:,\\\\vmlinux
- label = install-gui
- root = /dev/ram3
- initrd = cd:,\\\\all.gz
- initrd-size = 34000
-
-image = cd:,\\\\vmlinux-2.2
- label = install-gui-2.2
- root = /dev/ram3
- initrd = cd:,\\\\all-2.2.gz
- initrd-size = 34000
-
-image = cd:,\\\\vmlinux
- label = install-text
- root = /dev/ram3
- initrd = cd:,\\\\all.gz
- initrd-size = 34000
- append = " text video=ofonly"
-
-image = cd:,\\\\vmlinux-2.2
- label = install-text-2.2
- root = /dev/ram3
- initrd = cd:,\\\\all-2.2.gz
- initrd-size = 34000
- append = " text video=ofonly"
-
-image = cd:,\\\\vmlinux
- label = install-gui-old
- root = /dev/ram3
- initrd = cd:,\\\\all.gz
- initrd-size = 34000
- append = " gui-old video=ofonly"
-
-image = cd:,\\\\vmlinux-2.2
- label = install-gui-old-2.2
- root = /dev/ram3
- initrd = cd:,\\\\all-2.2.gz
- initrd-size = 34000
- append = " gui-old video=ofonly"
-
-image = enet:0,vmlinux
- label = install-net
- root = /dev/ram3
- initrd = enet:0,all.gz
- initrd-size = 34000
- append = " video=ofonly"
-
-image = enet:0,vmlinux-2.2
- label = install-net-2.2
- root = /dev/ram3
- initrd = enet:0,all-2.2.gz
- initrd-size = 34000
- append = " video=ofonly"
-
-image = enet:0,vmlinux
- label = install-net-text
- root = /dev/ram3
- initrd = enet:0,all.gz
- initrd-size = 34000
- append = " text video=ofonly"
-
-image = enet:0,vmlinux-2.2
- label = install-net-text-2.2
- root = /dev/ram3
- initrd = enet:0,all-2.2.gz
- initrd-size = 34000
- append = " text video=ofonly"
-
-image = cd:,\\\\vmlinux
- label = rescue
- root = /dev/ram3
- initrd = cd:,\\\\all.gz
- initrd-size = 34000
- append = " rescue video=ofonly"
-
-image = enet:0,vmlinux
- label = rescue-net
- root = /dev/ram3
- initrd = enet:0,all.gz
- initrd-size = 34000
- append = " rescue video=ofonly"
-');
-
- output("$dir/$boot/yaboot.msg", '
-Thanks for choosing Mandrake Linux PPC. The following is a short
-explanation of the various options for booting the install CD.
-
-All options ending with "2.2" will use the 2.2.20-9mdkBOOT kernel.
-The default syntax with no suffix uses the 2.4.18-4mdkBOOT kernel.
-The default if you just hit enter is "install-gui".
-
-install-gui: uses XFree86 fbdev mode
-install-text: text based install
-install-gui-old: old Xpmac gui
-install-net: allows you to use a minimal boot CD,
- pulling the rest of the install from
- a network server
-install-net-text: text mode network install
-rescue: boots the rescue image
-rescue-net: boots the rescue image from a network server
-
-');
-
-}
-
-sub bmp_to_msg {
- my ($bmp, $msg, $progress_place, $progress_color, $clear_color) = @_;
- #- change here for newer picture isolinux-graphic.bmp and newer parameters.
- #- for old style pictures (9.1 and previous)
- # lilo-bmp2mdk mode:0x103 progress:425,173,16,7,64+21 clear:600,800,64+59 pos:0,0 <isolinux-graphic.bmp >isolinux/boot.msg
- #- for current 9.2 pictures.
- -e $bmp and _ "lilo-bmp2mdk mode:0x103 progress:$progress_place,64+$progress_color clear:600,800,64+$clear_color pos:0,0 <$bmp >$msg"
-}
-
-sub isolinux {
- my ($main, @kernels) = @_;
- @kernels = ($main, grep { $_ ne $main } @kernels);
- _ "rm -rf isolinux"; mkdir "isolinux", 0777;
-
- each_index {
- mkdir "isolinux/alt$::i", 0777;
- my ($kernel) = glob("kernel/all.kernels/$_/boot/vmlinu*");
- _ "cp $kernel isolinux/alt$::i/vmlinuz";
- initrd($tmp_mnt_initrd, 'all', '', "images/all.rdz-$_");
- _ "mv images/all.rdz-$_ isolinux/alt$::i/all.rdz";
- } @kernels;
-
- bmp_to_msg('isolinux-graphic.bmp', 'isolinux/boot.msg', '397,190,14,6', 18, 18);
-
- _ "cp /usr/lib/syslinux/isolinux.bin isolinux/isolinux.bin";
- _ "install -m 644 -D /boot/memtest* isolinux/test/memtest.bin";
- output "isolinux/isolinux.cfg", "
-default linux
-prompt 1
-timeout 150
-display boot.msg
-F1 help.msg
-F2 advanced.msg
-F3 boot.msg
-" . join('', map {
-"label $_->[0]
- kernel alt0/vmlinuz
- append initrd=alt0/all.rdz $_->[1] automatic=method:cdrom
-" } entries_append('all'))
- . join('', map_index {
-"label alt$::i
- kernel alt$::i/vmlinuz
- append initrd=alt$::i/all.rdz $default_append $default_acpi $default_vga
-" } @kernels) .
-"label memtest
- kernel test/memtest.bin
-";
-
- output("isolinux/help.msg", syslinux_msg('help.msg.xml'));
- output("isolinux/advanced.msg", syslinux_msg('advanced.msg.xml',
- "\nYou can choose the following kernels :\n",
- map_index { " o " . syslinux_color('white') . "alt$::i" . syslinux_color('default') . " is kernel $_\n" } @kernels));
-}
-
-sub isolinux_move {
- my ($main) = @_;
-
- my ($kernel) = glob("kernel/all.kernels/$main/boot/vmlinu*");
- _ "cp $kernel move/isolinux/vmlinuz";
- initrd($tmp_mnt_initrd, 'all', '', "move/isolinux/all.rdz-$main", '-with-busybox');
- rename "move/isolinux/all.rdz-$main", "move/isolinux/all.rdz";
-
- bmp_to_msg('move/data/isolinux-graphic.bmp', 'move/isolinux/boot.msg', '371,144,4,4', 11, 127);
- _ "cp /usr/lib/syslinux/isolinux.bin isolinux/isolinux.bin";
-}
-
-sub hd_grub {
- my ($mnt, $img) = @_;
- my $mapfile = '/tmp/device.map.tmp';
-
- my @grub_files = map { "/boot/grub/$_" } qw(stage1 stage2);
- my $size = 40_000 + sum(map { -s $_ } @grub_files);
-
- __ "$sudo umount $mnt 2>/dev/null";
- _ "dd if=/dev/zero of=$img bs=1 count=$size";
- _ "mkdosfs $img";
- _ "$sudo mount -t vfat -o umask=0 $img $mnt -o loop";
- _ "cp @grub_files $mnt";
-
- output("$mnt/menu.lst", <<EOF);
-timeout 0
-default 0
-fallback 1
-
-title Mandrake Install
-
-root (hd0,0)
-kernel /cooker/isolinux/alt0/vmlinuz $default_append $default_acpi $default_vga automatic=method:disk
-initrd /cooker/isolinux/alt0/all.rdz
-
-title Help
-
-pause To display the help, press <space> until you reach "HELP END"
-pause .
-pause Please see http://qa.mandrakesoft.com/hd_grub.cgi for a friendlier solution
-pause .
-pause To specify the location where Mandrake Linux is copied,
-pause choose "Mandrake Install", and press "e".
-pause Then change "root (hd0,0)". FYI:
-pause - (hd0,0) is the first partition on first bios hard drive (usually hda1)
-pause - (hd0,4) is the first extended partition (usually hda5)
-pause - (hd1,0) is the first partition on second bios hard drive
-pause Replace /cooker to suits the directory containing Mandrake Linux
-pause .
-pause HELP END
-EOF
-
- _ "$sudo umount $mnt";
-
- output($mapfile, "(fd0) $img\n");
-
- open(my $G, "| grub --device-map=$mapfile --batch");
- print $G <<EOF;
-root (fd0)
-install /stage1 d (fd0) /stage2 p /menu.lst
-quit
-EOF
- close $G;
- unlink $mapfile;
-}
-
-sub boot_iso {
- my ($iso) = @_;
-
- my $cfg = cat_('isolinux/isolinux.cfg') or die 'isolinux missing';
- $cfg =~ s/automatic=method:\w+,?//gm;
-
- eval { rm_rf('.boot_iso') };
- mkdir_p('.boot_iso/isolinux');
- _ "cd .boot_iso/isolinux ; ln -s ../../isolinux/* .";
-
- my $cfg_file = '.boot_iso/isolinux/isolinux.cfg';
- unlink $cfg_file;
- output($cfg_file, $cfg);
-
- _ "mkisofs -r -f -J -cache-inodes -V 'Mdk Boot ISO' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $iso .boot_iso";
- rm_rf('.boot_iso');
-}
-
-sub drivers {
- my ($type, $I, $img) = @_;
-
- _ "dd if=/dev/zero of=$img bs=1k count=1440";
- _ "$mke2fs $img";
- _ "$sudo mount -t ext2 $img $tmp_mnt -o loop";
-
- my ($ext) = $img =~ /img-(.*)/ or die "bad image name ($img)";
- _ "$sudo cp -f kernel/all.modules$I/$ext/${type}_modules.mar $tmp_mnt/modules$I.mar";
-
- _ "sync";
- _ "df $tmp_mnt";
-
- _ "$sudo umount $tmp_mnt";
-}
diff --git a/mdk-stage1/.cvsignore b/mdk-stage1/.cvsignore
deleted file mode 100644
index 4594eb719..000000000
--- a/mdk-stage1/.cvsignore
+++ /dev/null
@@ -1,14 +0,0 @@
-init
-init-move
-stage1-full
-stage1-cdrom
-stage1-disk
-stage1-medias-usb
-stage1-network
-stage1-network-usb
-debug.log
-.depend
-*.rdz*
-mkinitrd_helper.tar.bz2
-hack_*
-rescue-gui
diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile
deleted file mode 100644
index 76cd102a7..000000000
--- a/mdk-stage1/Makefile
+++ /dev/null
@@ -1,274 +0,0 @@
- #******************************************************************************
- #
- # mdk-stage1 - the program that will load second-stage install
- #
- # $Id$
- #
- # Pixel (pixel@mandrakesoft.com) (mostly done by Guillaume Cottenceau)
- #
- # Copyright 2000-2004 MandrakeSoft
- #
- # This software may be freely redistributed under the terms of the GNU
- # public license.
- #
- # 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- #
- # Portions from Erik Troan (ewt@redhat.com) Copyright 1996 Red Hat Software
- #
- #*****************************************************************************
- #
- # Currently:
- #
- # ix86
- # init with minilibc
- # stage1 with dietlibc
- #
- # ppc
- # init with dietlibc
- # stage1 with glibc
- #
- # ia64
- # init with glibc
- # stage1 with glibc
- #
- # x86-64
- # init with minilibc
- # stage1 with dietlibc
- #
- #*****************************************************************************
-
-
-VERSION = 10.0
-
-top_dir = .
-
-include $(top_dir)/Makefile.common
-
-
-DEFS = -DVERSION=\"$(VERSION)\" -DSPAWN_SHELL $(ADDITIONAL_DEFS)
-
-COMPILE = $(CC) $(DEFS) $(CFLAGS)
-
-
- #- stage1 "loader"
-ifeq (i386, $(ARCH))
-INITSRC = minilibc.c init.c
-INIT_DEFS = -DINIT_HEADERS=\"minilibc.h\" -fno-builtin
-INIT_DEFS_ADD = -DBINARY=\"/sbin/stage1\"
-INIT_DEFS_ADD_MANDRAKE_MOVE = -DBINARY=\"/usr/bin/runstage2.pl\"
-else
-ifeq (x86_64, $(ARCH))
-INITSRC = minilibc.c init.c
-INIT_DEFS = -DINIT_HEADERS=\"minilibc.h\" -fno-builtin
-else
-INITSRC = init.c
-ifeq (ia64, $(ARCH))
-INIT_DEFS = -DINIT_HEADERS=\"init-libc-headers.h\" $(GLIBC_INCLUDES)
-else
-INIT_DEFS = -DINIT_HEADERS=\"init-libc-headers.h\" $(DIETLIBC_INCLUDES)
-endif
-endif
-endif
-
-INITOBJS = $(subst .c,.o,$(INITSRC))
-INITOBJS-MANDRAKE_MOVE = $(subst .c,-MOVE.o,$(INITSRC))
-
-
- #- frontends
-NEWT_FRONTEND_SRC = newt-frontend.c
-NEWT_FRONTEND_LIBS = newt/libnewt.a slang/libslang.a
-
-STDIO_FRONTEND_SRC = stdio-frontend.c
-STDIO_FRONTEND_LIBS =
-STDIO_FRONTEND_LIBS =
-
-
-FRONTEND_OBJS = $(subst .c,.o,$($(F)_FRONTEND_SRC))
-
-FRONTEND_LINK = $(FRONTEND_OBJS) $($(F)_FRONTEND_LIBS)
-
-INSMOD = insmod-modutils
-ifeq (i386, $(ARCH))
-INSMOD = insmod-busybox
-endif
-ifeq (x86_64, $(ARCH))
-INSMOD = insmod-busybox
-endif
-
-STAGE1_OWN_LIBS = $(INSMOD)/libinsmod.a mar/libmar.a bzlib/libbzlib.a
-
-
-ifeq (DIETLIBC, $(L))
-STAGE1_NETWORK_LIBS = $(top_dir)/dietlibc/bin-$(ARCH)/librpc.a
-endif
-
-ifeq (GLIBC, $(L))
-ifeq (x86_64, $(ARCH))
-STAGE1_NETWORK_LIBS = /usr/lib64/libresolv.a
-else
-STAGE1_NETWORK_LIBS = /usr/lib/libresolv.a
-endif
-endif
-
-ifdef MOVE
-MOVE_ADDSRC = lomount.c
-else
-MOVE_ADDSRC =
-endif
-
- #- stage1 itself
-STAGE1SRC = stage1.c log.c tools.c modules.c probing.c mount.c automatic.c frontend-common.c
-CDROMSRC = cdrom.c $(MOVE_ADDSRC)
-DISKSRC = disk.c lomount.c
-NETWORKSRC = network.c nfsmount.c dhcp.c url.c dns.c adsl.c $(MOVE_ADDSRC)
-
-ALLSRC = $(INITSRC) $(STAGE1SRC) $(CDROMSRC) $(DISKSRC) $(NETWORKSRC)
-
-
-
-STAGE1OBJS-CDROM = $(subst .c,-CDROM.o,$(STAGE1SRC) $(CDROMSRC))
-
-CDROM_DEFS = -DDISABLE_DISK -DDISABLE_NETWORK
-
-
-STAGE1OBJS-NETWORK = $(subst .c,-NETWORK.o,$(STAGE1SRC) $(NETWORKSRC))
-
-NETWORK_DEFS = -DDISABLE_CDROM -DDISABLE_DISK
-
-
-STAGE1OBJS-FULL = $(subst .c,-FULL.o,$(STAGE1SRC) $(CDROMSRC) $(DISKSRC) $(NETWORKSRC))
-
-
-ifeq (i386, $(ARCH))
-LDFLAGS_INIT = -static -nostdlib /usr/lib/crt1.o
-else
-ifeq (x86_64, $(ARCH))
-LDFLAGS_INIT = -static -nostdlib /usr/lib64/crt1.o
-INIT_LIBC = $(GLIBC_LIBC)
-else
-ifeq (ia64, $(ARCH))
-LDFLAGS_INIT = $(GLIBC_LDFLAGS_STAGE1)
-INIT_LIBC = $(GLIBC_LIBC)
-else
-LDFLAGS_INIT = $(DIETLIBC_LDFLAGS_STAGE1)
-INIT_LIBC = $(DIETLIBC_LIBC)
-endif
-endif
-endif
-
-
-BINS = init stage1-full
-
-ifeq (i386, $(ARCH))
-BINS += stage1-cdrom stage1-network
-endif
-ifeq (x86_64, $(ARCH))
-BINS += stage1-cdrom stage1-network
-endif
-
-ifeq (i386, $(ARCH))
-DIRS = dietlibc
-endif
-ifeq (ppc, $(ARCH))
-DIRS = dietlibc
-endif
-ifeq (x86_64, $(ARCH))
-DIRS = dietlibc
-endif
-DIRS += mar pci-resource usb-resource bzlib $(INSMOD) slang newt ppp/pppd rp-pppoe/src
-ifeq (i386, $(ARCH))
-DIRS += pcmcia_
-endif
-
-
-ifeq (i386,$(ARCH))
-PCMCIA_LIB = pcmcia_/libpcmcia.a
-PCMCIA_DEFS = -DENABLE_PCMCIA
-endif
-
-USB_DEFS_GEN = -DENABLE_USB
-USB_DEFS = -DENABLE_USB -DDISABLE_PCIADAPTERS
-
-all: dirs $(BINS)
-
-dirs:
- @for n in . $(DIRS); do \
- [ "$$n" = "." ] || make -C $$n || exit 1 ;\
- done
-
-init: $(INITOBJS) $(INIT_LIBC)
- $(CC) $(LDFLAGS_INIT) -o $@ $^
- $(STRIPCMD) $@
-
-init-move: $(INITOBJS-MANDRAKE_MOVE) $(INIT_LIBC)
- $(CC) $(LDFLAGS_INIT) -o $@ $^
- $(STRIPCMD) $@
-
-stage1-cdrom: $(STAGE1OBJS-CDROM) $(STAGE1_OWN_LIBS) $(FRONTEND_LINK) $(STAGE1_LIBC)
- $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
- $(STRIPCMD) $@
-
-stage1-network: $(STAGE1OBJS-NETWORK) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB) $(STAGE1_LIBC)
- $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
- $(STRIPCMD) $@
-
-stage1-full: $(STAGE1OBJS-FULL) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB) $(STAGE1_LIBC)
- $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
- $(STRIPCMD) $@
-
-
-$(INITOBJS): %.o: %.c
- $(COMPILE) $(INIT_DEFS) $(INIT_DEFS_ADD) -c $<
-
-$(INITOBJS-MANDRAKE_MOVE): %-MOVE.o: %.c
- $(COMPILE) $(INIT_DEFS) $(INIT_DEFS_ADD_MANDRAKE_MOVE) -c $< -o $@
-
-$(STAGE1OBJS-CDROM): %-CDROM.o: %.c
- $(DIET) $(COMPILE) $(INCLUDES) $(CDROM_DEFS) -c $< -o $@
-
-$(STAGE1OBJS-NETWORK): %-NETWORK.o: %.c
- $(DIET) $(COMPILE) $(INCLUDES) $(NETWORK_DEFS) $(PCMCIA_DEFS) $(USB_DEFS_GEN) -c $< -o $@
-
-$(STAGE1OBJS-FULL): %-FULL.o: %.c
- $(DIET) $(COMPILE) $(INCLUDES) $(USB_DEFS_GEN) $(PCMCIA_DEFS) -c $< -o $@
-
-.c.o:
- $(DIET) $(COMPILE) $(INCLUDES) -c $<
-
-
-clean:
- @for n in $(DIRS); do \
- (cd $$n; make clean) \
- done
- rm -f *.o .depend *.rdz *.img rescue-gui init-move $(BINS)
-
-
-tar-mkinitrd_helper: clean
- rm -rf mkinitrd_helper-subdir
- mkdir mkinitrd_helper-subdir
- cd mkinitrd_helper-subdir ; cp -a ../dietlibc ../insmod-busybox ../Makefile.common ../insmod.h ../log.h . ; \
- cp ../Makefile.mkinitrd_helper Makefile
- tar cfj mkinitrd_helper.tar.bz2 mkinitrd_helper-subdir --exclude CVS
- rm -rf mkinitrd_helper-subdir
-
-rescue-gui: rescue-gui.o frontend-common.o $(FRONTEND_LINK) $(STAGE1_LIBC)
- $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
- $(STRIPCMD) $@
-
-
-.depend:
- $(CPP) $(CFLAGS) -M $(ALLSRC) > .depend
-
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
-
-
-*-CDROM.o: %-CDROM.o: %.o
-
-*-NETWORK.o: %-NETWORK.o: %.o
-
-*-FULL.o: %-FULL.o: %.o
-
diff --git a/mdk-stage1/Makefile.common b/mdk-stage1/Makefile.common
deleted file mode 100644
index 86e29aa02..000000000
--- a/mdk-stage1/Makefile.common
+++ /dev/null
@@ -1,64 +0,0 @@
- # -*- makefile -*-
- #******************************************************************************
- #
- # Guillaume Cottenceau (gc@mandrakesoft.com)
- #
- # Copyright 2000 MandrakeSoft
- #
- # This software may be freely redistributed under the terms of the GNU
- # public license.
- #
- # 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- #
- #*****************************************************************************
-
-ARCH := $(patsubst i%86,i386,$(shell uname -m))
-ARCH := $(patsubst sparc%,sparc,$(ARCH))
-
- #- default lib is dietlibc (honoured by main Makefile whenever possible)
-L = DIETLIBC
-#L = GLIBC
-
- #- default frontend is newt (honoured by main Makefile whenever possible)
-F = NEWT
-# F = STDIO
-
- #- override in some situations
-ifeq (ia64, $(ARCH))
-L = GLIBC
-endif
-ifeq (ppc, $(ARCH))
-L = GLIBC
-endif
-ifeq (x86_64, $(ARCH))
-#L = GLIBC
-endif
-
-ifeq (DIETLIBC, $(L))
-DIET = $(top_dir)/dietlibc/bin-$(ARCH)/diet
-endif
-
-
- #- flags used by all stuff
-ifeq (ppc, $(ARCH))
-CFLAGS = -Os -pipe -Wall -fomit-frame-pointer -fno-strict-aliasing
-else
-CFLAGS = -Os -pipe -Wall -Werror -fomit-frame-pointer -fno-strict-aliasing
-endif
-
-DIETLIBC_INCLUDES = -I$(top_dir)/dietlibc/include -I. -I$(top_dir)/bzlib
-GLIBC_INCLUDES = -I. -I$(top_dir)/bzlib
-INCLUDES = $($(L)_INCLUDES)
-
-GLIBC_LDFLAGS_STAGE1 = -static
-DIETLIBC_LDFLAGS_STAGE1 = -nostdlib
-LDFLAGS_STAGE1 = $($(L)_LDFLAGS_STAGE1)
-
-GLIBC_LIBC =
-DIETLIBC_LIBC =
-STAGE1_LIBC = $($(L)_LIBC)
-
-STRIPCMD = strip -R .note -R .comment
-
diff --git a/mdk-stage1/Makefile.mkinitrd_helper b/mdk-stage1/Makefile.mkinitrd_helper
deleted file mode 100644
index 72bef595f..000000000
--- a/mdk-stage1/Makefile.mkinitrd_helper
+++ /dev/null
@@ -1,30 +0,0 @@
- #******************************************************************************
- #
- # Guillaume Cottenceau (gc@mandrakesoft.com)
- #
- # Copyright 2000 MandrakeSoft
- #
- # This software may be freely redistributed under the terms of the GNU
- # public license.
- #
- # 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- #
- #*****************************************************************************
-
-
-DIRS = dietlibc insmod-busybox
-
-
-all: dirs
-
-dirs:
- @for n in . $(DIRS); do \
- [ "$$n" = "." ] || make -C $$n ;\
- done
-
-clean:
- @for n in $(DIRS); do \
- (cd $$n; make clean) \
- done
diff --git a/mdk-stage1/adsl.c b/mdk-stage1/adsl.c
deleted file mode 100644
index b3ed0f87e..000000000
--- a/mdk-stage1/adsl.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <stdio.h>
-#include <resolv.h>
-#include <signal.h>
-
-#include "stage1.h"
-#include "log.h"
-#include "network.h"
-#include "modules.h"
-#include "tools.h"
-#include "frontend.h"
-#include "automatic.h"
-
-#include "adsl.h"
-
-
-static enum return_type adsl_connect(char * net_device, char * username, char * password)
-{
- char pppoe_call[500];
- char * pppd_launch[] = { "/sbin/pppd", "pty", pppoe_call, "noipdefault", "noauth", "default-asyncmap", "defaultroute",
- "hide-password", "nodetach", "usepeerdns", "local", "mtu", "1492", "mru", "1492", "noaccomp",
- "noccp", "nobsdcomp", "nodeflate", "nopcomp", "novj", "novjccomp", "user", username,
- "password", password, "lcp-echo-interval", "20", "lcp-echo-failure", "3", "lock", "persist", NULL };
- int fd;
- int retries = 10;
- char * tty_adsl = "/dev/tty6";
- enum return_type status = RETURN_ERROR;
- pid_t ppp_pid;
-
- snprintf(pppoe_call, sizeof(pppoe_call), "/sbin/pppoe -p /var/run/pppoe.conf-adsl.pid.pppoe -I %s -T 80 -U -m 1412", net_device);
-
-
- fd = open(tty_adsl, O_RDWR);
- if (fd == -1) {
- log_message("cannot open tty -- no pppd");
- return RETURN_ERROR;
- }
- else if (access(pppd_launch[0], X_OK)) {
- log_message("cannot open pppd - %s doesn't exist", pppd_launch[0]);
- return RETURN_ERROR;
- }
-
- if (!(ppp_pid = fork())) {
- dup2(fd, 0);
- dup2(fd, 1);
- dup2(fd, 2);
-
- close(fd);
- setsid();
- if (ioctl(0, TIOCSCTTY, NULL))
- log_perror("could not set new controlling tty");
-
- printf("\t(exec of pppd)\n");
- execve(pppd_launch[0], pppd_launch, grab_env());
- log_message("execve of %s failed: %s", pppd_launch[0], strerror(errno));
- exit(-1);
- }
- close(fd);
- while (retries > 0 && kill(ppp_pid, 0) == 0) {
- FILE * f;
- if ((f = fopen("/var/run/pppd.tdb", "rb"))) {
- while (1) {
- char buf[500];
- if (!fgets(buf, sizeof(buf), f))
- break;
- if (strstr(buf, "IPLOCAL="))
- status = RETURN_OK;
- }
- fclose(f);
- if (status == RETURN_OK) {
- log_message("PPP: connected!");
- break;
- }
- }
- retries--;
- log_message("PPP: <sleep>");
- sleep(2);
- }
-
- if (status != RETURN_OK) {
- log_message("PPP: could not connect");
- kill(ppp_pid, SIGTERM);
- sleep(1);
- kill(ppp_pid, SIGKILL);
- sleep(1);
- }
- return status;
-}
-
-
-enum return_type perform_adsl(struct interface_info * intf)
-{
- struct in_addr addr;
- char * questions[] = { "Username", "Password", NULL };
- char * questions_auto[] = { "adsluser", "adslpass", NULL };
- static char ** answers = NULL;
- enum return_type results;
-
- inet_aton("10.0.0.10", &addr);
- memcpy(&intf->ip, &addr, sizeof(addr));
-
- inet_aton("255.255.255.0", &addr);
- memcpy(&intf->netmask, &addr, sizeof(addr));
-
- *((uint32_t *) &intf->broadcast) = (*((uint32_t *) &intf->ip) &
- *((uint32_t *) &intf->netmask)) | ~(*((uint32_t *) &intf->netmask));
-
- intf->is_ptp = 0;
-
- if (configure_net_device(intf)) {
- stg1_error_message("Could not configure..");
- return RETURN_ERROR;
- }
-
- results = ask_from_entries_auto("Please enter the username and password for your ADSL account.\n"
- "(Warning! only PPPoE protocol is supported)",
- questions, &answers, 40, questions_auto, NULL);
- if (results != RETURN_OK)
- return results;
-
- intf->boot_proto = BOOTPROTO_ADSL_PPPOE;
-
- wait_message("Waiting for ADSL connection to show up...");
- my_insmod("ppp_generic", ANY_DRIVER_TYPE, NULL, 1);
- my_insmod("ppp_async", ANY_DRIVER_TYPE, NULL, 1);
- my_insmod("ppp", ANY_DRIVER_TYPE, NULL, 1);
- results = adsl_connect(intf->device, answers[0], answers[1]);
- remove_wait_message();
-
- if (results != RETURN_OK) {
- wait_message("Retrying the ADSL connection...");
- results = adsl_connect(intf->device, answers[0], answers[1]);
- remove_wait_message();
- } else {
- intf->user = strdup(answers[0]);
- intf->pass = strdup(answers[1]);
- }
-
- if (results != RETURN_OK) {
- stg1_error_message("I could not connect to the ADSL network.");
- return perform_adsl(intf);
- }
-
- sleep(1);
- res_init(); /* reinit the resolver, pppd modified /etc/resolv.conf */
-
- return RETURN_OK;
-}
diff --git a/mdk-stage1/adsl.h b/mdk-stage1/adsl.h
deleted file mode 100644
index 9d32cc631..000000000
--- a/mdk-stage1/adsl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * View the homepage: http://us.mandrakesoft.com/~gc/html/stage1.html
- *
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * Portions from GRUB -- GRand Unified Bootloader
- * Copyright (C) 2000 Free Software Foundation, Inc.
- *
- * Itself based on etherboot-4.6.4 by Martin Renters.
- *
- */
-
-#ifndef _ADSL_H_
-#define _ADSL_H_
-
-#include "stage1.h"
-#include "network.h"
-
-enum return_type perform_adsl(struct interface_info * intf);
-
-#endif
diff --git a/mdk-stage1/automatic.c b/mdk-stage1/automatic.c
deleted file mode 100644
index 114d4d2cb..000000000
--- a/mdk-stage1/automatic.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * This is supposed to replace the redhat "kickstart", by name but
- * also by design (less code pollution).
- *
- */
-
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include "tools.h"
-#include "stage1.h"
-#include "frontend.h"
-#include "log.h"
-
-#include "automatic.h"
-
-
-static struct param_elem * automatic_params;
-static char * value_not_bound = "";
-
-void grab_automatic_params(char * line)
-{
- int i, p;
- struct param_elem tmp_params[50];
-
- i = 0; p = 0;
- while (line[i] != '\0') {
- char *name, *value;
- int k;
- int j = i;
- while (line[i] != ':' && line[i] != '\0')
- i++;
- name = memdup(&line[j], i-j + 1);
- name[i-j] = 0;
-
- k = i+1;
- i++;
- while (line[i] != ',' && line[i] != '\0')
- i++;
- value = memdup(&line[k], i-k + 1);
- value[i-k] = 0;
-
- tmp_params[p].name = name;
- tmp_params[p].value = value;
- p++;
- if (line[i] == '\0')
- break;
- i++;
- }
-
- tmp_params[p++].name = NULL;
- automatic_params = memdup(tmp_params, sizeof(struct param_elem) * p);
-
- log_message("AUTOMATIC MODE: got %d params", p-1);
-}
-
-
-char * get_auto_value(char * auto_param)
-{
- struct param_elem * ptr = automatic_params;
-
- struct param_elem short_aliases[] =
- { { "method", "met" }, { "network", "netw" }, { "interface", "int" }, { "gateway", "gat" },
- { "netmask", "netm" }, { "adsluser", "adslu" }, { "adslpass", "adslp" }, { "hostname", "hos" },
- { "domain", "dom" }, { "server", "ser" }, { "directory", "dir" }, { "user", "use" },
- { "pass", "pas" }, { "disk", "dis" }, { "partition", "par" }, { "proxy_host", "proxh" },
- { "proxy_port", "proxp" }, { NULL, NULL } };
- struct param_elem * ptr_alias = short_aliases;
- while (ptr_alias->name) {
- if (streq(auto_param, ptr_alias->name))
- break;
- ptr_alias++;
- }
-
- while (ptr->name) {
- if (streq(ptr->name, auto_param)
- || (ptr_alias->name && streq(ptr_alias->value, ptr->name)))
- return ptr->value;
- ptr++;
- }
-
- return value_not_bound;
-}
-
-
-enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, char * auto_param, char ** elems_auto)
-{
- if (!IS_AUTOMATIC)
- return ask_from_list(msg, elems, choice);
- else {
- char ** sav_elems = elems;
- char * tmp = get_auto_value(auto_param);
- while (elems && *elems) {
- if (!strcmp(tmp, *elems_auto)) {
- *choice = *elems;
- log_message("AUTOMATIC: parameter %s for %s means returning %s", tmp, auto_param, *elems);
- return RETURN_OK;
- }
- elems++;
- elems_auto++;
- }
- unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
- return ask_from_list(msg, sav_elems, choice);
- }
-}
-
-enum return_type ask_from_list_comments_auto(char *msg, char ** elems, char ** elems_comments, char ** choice, char * auto_param, char ** elems_auto)
-{
- if (!IS_AUTOMATIC)
- return ask_from_list_comments(msg, elems, elems_comments, choice);
- else {
- char ** sav_elems = elems;
- char * tmp = get_auto_value(auto_param);
- while (elems && *elems) {
- if (!strcmp(tmp, *elems_auto)) {
- *choice = *elems;
- log_message("AUTOMATIC: parameter %s for %s means returning %s", tmp, auto_param, *elems);
- return RETURN_OK;
- }
- elems++;
- elems_auto++;
- }
- unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
- return ask_from_list_comments(msg, sav_elems, elems_comments, choice);
- }
-}
-
-
-enum return_type ask_from_entries_auto(char *msg, char ** questions, char *** answers, int entry_size, char ** questions_auto, void (*callback_func)(char ** strings))
-{
- if (!IS_AUTOMATIC)
- return ask_from_entries(msg, questions, answers, entry_size, callback_func);
- else {
- char * tmp_answers[50];
- int i = 0;
- while (questions && *questions) {
- tmp_answers[i] = get_auto_value(*questions_auto);
- log_message("AUTOMATIC: question %s answers %s because of param %s", *questions, tmp_answers[i], *questions_auto);
- i++;
- questions++;
- questions_auto++;
-
- }
- *answers = memdup(tmp_answers, sizeof(char *) * i);
- return RETURN_OK;
- }
-}
diff --git a/mdk-stage1/automatic.h b/mdk-stage1/automatic.h
deleted file mode 100644
index 4b58c0ea8..000000000
--- a/mdk-stage1/automatic.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * This is supposed to replace the redhat "kickstart", by name but
- * also by design (no code pollution).
- *
- */
-
-#ifndef _AUTOMATIC_H_
-#define _AUTOMATIC_H_
-
-#include "stage1.h"
-
-void grab_automatic_params(char * line);
-char * get_auto_value(char * auto_param);
-
-enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, char * auto_param, char ** elems_auto);
-enum return_type ask_from_list_comments_auto(char *msg, char ** elems, char ** elems_comments, char ** choice, char * auto_param, char ** elems_auto);
-enum return_type ask_from_entries_auto(char *msg, char ** questions, char *** answers, int entry_size, char ** questions_auto, void (*callback_func)(char ** strings));
-
-#endif
diff --git a/mdk-stage1/bzlib/Makefile b/mdk-stage1/bzlib/Makefile
deleted file mode 100644
index 8e4bba791..000000000
--- a/mdk-stage1/bzlib/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
- #******************************************************************************
- #
- # Guillaume Cottenceau (gc@mandrakesoft.com)
- #
- # Copyright 2000 MandrakeSoft
- #
- # This software may be freely redistributed under the terms of the GNU
- # public license.
- #
- # 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- #
- #*****************************************************************************
-
-top_dir = ..
-
-include $(top_dir)/Makefile.common
-
-
-LIBNAME = libbzlib
-
-OBJS = blocksort.o bzlib.o compress.o crctable.o decompress.o huffman.o randtable.o
-
-DEFS =
-
-INCS =
-
-
-TARGETS = $(LIBNAME).a
-
-all: $(TARGETS)
-
-clean:
- rm -f *.o *.a
-
-$(LIBNAME).a: $(OBJS)
- ar -cru $@ $^
- ranlib $@
-
-$(OBJS): %.o: %.c
- $(DIET) $(CC) $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $< -o $@
diff --git a/mdk-stage1/bzlib/blocksort.c b/mdk-stage1/bzlib/blocksort.c
deleted file mode 100644
index c1b78c483..000000000
--- a/mdk-stage1/bzlib/blocksort.c
+++ /dev/null
@@ -1,1138 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Block sorting machinery ---*/
-/*--- blocksort.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
-
- To get some idea how the block sorting algorithms in this file
- work, read my paper
- On the Performance of BWT Sorting Algorithms
- in Proceedings of the IEEE Data Compression Conference 2000,
- Snowbird, Utah, USA, 27-30 March 2000. The main sort in this
- file implements the algorithm called cache in the paper.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "bzlib_private.h"
-
-/*---------------------------------------------*/
-/*--- Fallback O(N log(N)^2) sorting ---*/
-/*--- algorithm, for repetitive blocks ---*/
-/*---------------------------------------------*/
-
-/*---------------------------------------------*/
-static
-__inline__
-void fallbackSimpleSort ( UInt32* fmap,
- UInt32* eclass,
- Int32 lo,
- Int32 hi )
-{
- Int32 i, j, tmp;
- UInt32 ec_tmp;
-
- if (lo == hi) return;
-
- if (hi - lo > 3) {
- for ( i = hi-4; i >= lo; i-- ) {
- tmp = fmap[i];
- ec_tmp = eclass[tmp];
- for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
- fmap[j-4] = fmap[j];
- fmap[j-4] = tmp;
- }
- }
-
- for ( i = hi-1; i >= lo; i-- ) {
- tmp = fmap[i];
- ec_tmp = eclass[tmp];
- for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
- fmap[j-1] = fmap[j];
- fmap[j-1] = tmp;
- }
-}
-
-
-/*---------------------------------------------*/
-#define fswap(zz1, zz2) \
- { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
-
-#define fvswap(zzp1, zzp2, zzn) \
-{ \
- Int32 yyp1 = (zzp1); \
- Int32 yyp2 = (zzp2); \
- Int32 yyn = (zzn); \
- while (yyn > 0) { \
- fswap(fmap[yyp1], fmap[yyp2]); \
- yyp1++; yyp2++; yyn--; \
- } \
-}
-
-
-#define fmin(a,b) ((a) < (b)) ? (a) : (b)
-
-#define fpush(lz,hz) { stackLo[sp] = lz; \
- stackHi[sp] = hz; \
- sp++; }
-
-#define fpop(lz,hz) { sp--; \
- lz = stackLo[sp]; \
- hz = stackHi[sp]; }
-
-#define FALLBACK_QSORT_SMALL_THRESH 10
-#define FALLBACK_QSORT_STACK_SIZE 100
-
-
-static
-void fallbackQSort3 ( UInt32* fmap,
- UInt32* eclass,
- Int32 loSt,
- Int32 hiSt )
-{
- Int32 unLo, unHi, ltLo, gtHi, n, m;
- Int32 sp, lo, hi;
- UInt32 med, r, r3;
- Int32 stackLo[FALLBACK_QSORT_STACK_SIZE];
- Int32 stackHi[FALLBACK_QSORT_STACK_SIZE];
-
- r = 0;
-
- sp = 0;
- fpush ( loSt, hiSt );
-
- while (sp > 0) {
-
- AssertH ( sp < FALLBACK_QSORT_STACK_SIZE, 1004 );
-
- fpop ( lo, hi );
- if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {
- fallbackSimpleSort ( fmap, eclass, lo, hi );
- continue;
- }
-
- /* Random partitioning. Median of 3 sometimes fails to
- avoid bad cases. Median of 9 seems to help but
- looks rather expensive. This too seems to work but
- is cheaper. Guidance for the magic constants
- 7621 and 32768 is taken from Sedgewick's algorithms
- book, chapter 35.
- */
- r = ((r * 7621) + 1) % 32768;
- r3 = r % 3;
- if (r3 == 0) med = eclass[fmap[lo]]; else
- if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else
- med = eclass[fmap[hi]];
-
- unLo = ltLo = lo;
- unHi = gtHi = hi;
-
- while (1) {
- while (1) {
- if (unLo > unHi) break;
- n = (Int32)eclass[fmap[unLo]] - (Int32)med;
- if (n == 0) {
- fswap(fmap[unLo], fmap[ltLo]);
- ltLo++; unLo++;
- continue;
- };
- if (n > 0) break;
- unLo++;
- }
- while (1) {
- if (unLo > unHi) break;
- n = (Int32)eclass[fmap[unHi]] - (Int32)med;
- if (n == 0) {
- fswap(fmap[unHi], fmap[gtHi]);
- gtHi--; unHi--;
- continue;
- };
- if (n < 0) break;
- unHi--;
- }
- if (unLo > unHi) break;
- fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--;
- }
-
- AssertD ( unHi == unLo-1, "fallbackQSort3(2)" );
-
- if (gtHi < ltLo) continue;
-
- n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);
- m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);
-
- n = lo + unLo - ltLo - 1;
- m = hi - (gtHi - unHi) + 1;
-
- if (n - lo > hi - m) {
- fpush ( lo, n );
- fpush ( m, hi );
- } else {
- fpush ( m, hi );
- fpush ( lo, n );
- }
- }
-}
-
-#undef fmin
-#undef fpush
-#undef fpop
-#undef fswap
-#undef fvswap
-#undef FALLBACK_QSORT_SMALL_THRESH
-#undef FALLBACK_QSORT_STACK_SIZE
-
-
-/*---------------------------------------------*/
-/* Pre:
- nblock > 0
- eclass exists for [0 .. nblock-1]
- ((UChar*)eclass) [0 .. nblock-1] holds block
- ptr exists for [0 .. nblock-1]
-
- Post:
- ((UChar*)eclass) [0 .. nblock-1] holds block
- All other areas of eclass destroyed
- fmap [0 .. nblock-1] holds sorted order
- bhtab [ 0 .. 2+(nblock/32) ] destroyed
-*/
-
-#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31))
-#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))
-#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))
-#define WORD_BH(zz) bhtab[(zz) >> 5]
-#define UNALIGNED_BH(zz) ((zz) & 0x01f)
-
-static
-void fallbackSort ( UInt32* fmap,
- UInt32* eclass,
- UInt32* bhtab,
- Int32 nblock,
- Int32 verb )
-{
- Int32 ftab[257];
- Int32 ftabCopy[256];
- Int32 H, i, j, k, l, r, cc, cc1;
- Int32 nNotDone;
- Int32 nBhtab;
- UChar* eclass8 = (UChar*)eclass;
-
- /*--
- Initial 1-char radix sort to generate
- initial fmap and initial BH bits.
- --*/
- if (verb >= 4)
- VPrintf0 ( " bucket sorting ...\n" );
- for (i = 0; i < 257; i++) ftab[i] = 0;
- for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
- for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
- for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
-
- for (i = 0; i < nblock; i++) {
- j = eclass8[i];
- k = ftab[j] - 1;
- ftab[j] = k;
- fmap[k] = i;
- }
-
- nBhtab = 2 + (nblock / 32);
- for (i = 0; i < nBhtab; i++) bhtab[i] = 0;
- for (i = 0; i < 256; i++) SET_BH(ftab[i]);
-
- /*--
- Inductively refine the buckets. Kind-of an
- "exponential radix sort" (!), inspired by the
- Manber-Myers suffix array construction algorithm.
- --*/
-
- /*-- set sentinel bits for block-end detection --*/
- for (i = 0; i < 32; i++) {
- SET_BH(nblock + 2*i);
- CLEAR_BH(nblock + 2*i + 1);
- }
-
- /*-- the log(N) loop --*/
- H = 1;
- while (1) {
-
- if (verb >= 4)
- VPrintf1 ( " depth %6d has ", H );
-
- j = 0;
- for (i = 0; i < nblock; i++) {
- if (ISSET_BH(i)) j = i;
- k = fmap[i] - H; if (k < 0) k += nblock;
- eclass[k] = j;
- }
-
- nNotDone = 0;
- r = -1;
- while (1) {
-
- /*-- find the next non-singleton bucket --*/
- k = r + 1;
- while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
- if (ISSET_BH(k)) {
- while (WORD_BH(k) == 0xffffffff) k += 32;
- while (ISSET_BH(k)) k++;
- }
- l = k - 1;
- if (l >= nblock) break;
- while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
- if (!ISSET_BH(k)) {
- while (WORD_BH(k) == 0x00000000) k += 32;
- while (!ISSET_BH(k)) k++;
- }
- r = k - 1;
- if (r >= nblock) break;
-
- /*-- now [l, r] bracket current bucket --*/
- if (r > l) {
- nNotDone += (r - l + 1);
- fallbackQSort3 ( fmap, eclass, l, r );
-
- /*-- scan bucket and generate header bits-- */
- cc = -1;
- for (i = l; i <= r; i++) {
- cc1 = eclass[fmap[i]];
- if (cc != cc1) { SET_BH(i); cc = cc1; };
- }
- }
- }
-
- if (verb >= 4)
- VPrintf1 ( "%6d unresolved strings\n", nNotDone );
-
- H *= 2;
- if (H > nblock || nNotDone == 0) break;
- }
-
- /*--
- Reconstruct the original block in
- eclass8 [0 .. nblock-1], since the
- previous phase destroyed it.
- --*/
- if (verb >= 4)
- VPrintf0 ( " reconstructing block ...\n" );
- j = 0;
- for (i = 0; i < nblock; i++) {
- while (ftabCopy[j] == 0) j++;
- ftabCopy[j]--;
- eclass8[fmap[i]] = (UChar)j;
- }
- AssertH ( j < 256, 1005 );
-}
-
-#undef SET_BH
-#undef CLEAR_BH
-#undef ISSET_BH
-#undef WORD_BH
-#undef UNALIGNED_BH
-
-
-/*---------------------------------------------*/
-/*--- The main, O(N^2 log(N)) sorting ---*/
-/*--- algorithm. Faster for "normal" ---*/
-/*--- non-repetitive blocks. ---*/
-/*---------------------------------------------*/
-
-/*---------------------------------------------*/
-static
-__inline__
-Bool mainGtU ( UInt32 i1,
- UInt32 i2,
- UChar* block,
- UInt16* quadrant,
- UInt32 nblock,
- Int32* budget )
-{
- Int32 k;
- UChar c1, c2;
- UInt16 s1, s2;
-
- AssertD ( i1 != i2, "mainGtU" );
- /* 1 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 2 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 3 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 4 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 5 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 6 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 7 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 8 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 9 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 10 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 11 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
- /* 12 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- i1++; i2++;
-
- k = nblock + 8;
-
- do {
- /* 1 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 2 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 3 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 4 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 5 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 6 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 7 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
- /* 8 */
- c1 = block[i1]; c2 = block[i2];
- if (c1 != c2) return (c1 > c2);
- s1 = quadrant[i1]; s2 = quadrant[i2];
- if (s1 != s2) return (s1 > s2);
- i1++; i2++;
-
- if (i1 >= nblock) i1 -= nblock;
- if (i2 >= nblock) i2 -= nblock;
-
- k -= 8;
- (*budget)--;
- }
- while (k >= 0);
-
- return False;
-}
-
-
-/*---------------------------------------------*/
-/*--
- Knuth's increments seem to work better
- than Incerpi-Sedgewick here. Possibly
- because the number of elems to sort is
- usually small, typically <= 20.
---*/
-static
-Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280,
- 9841, 29524, 88573, 265720,
- 797161, 2391484 };
-
-static
-void mainSimpleSort ( UInt32* ptr,
- UChar* block,
- UInt16* quadrant,
- Int32 nblock,
- Int32 lo,
- Int32 hi,
- Int32 d,
- Int32* budget )
-{
- Int32 i, j, h, bigN, hp;
- UInt32 v;
-
- bigN = hi - lo + 1;
- if (bigN < 2) return;
-
- hp = 0;
- while (incs[hp] < bigN) hp++;
- hp--;
-
- for (; hp >= 0; hp--) {
- h = incs[hp];
-
- i = lo + h;
- while (True) {
-
- /*-- copy 1 --*/
- if (i > hi) break;
- v = ptr[i];
- j = i;
- while ( mainGtU (
- ptr[j-h]+d, v+d, block, quadrant, nblock, budget
- ) ) {
- ptr[j] = ptr[j-h];
- j = j - h;
- if (j <= (lo + h - 1)) break;
- }
- ptr[j] = v;
- i++;
-
- /*-- copy 2 --*/
- if (i > hi) break;
- v = ptr[i];
- j = i;
- while ( mainGtU (
- ptr[j-h]+d, v+d, block, quadrant, nblock, budget
- ) ) {
- ptr[j] = ptr[j-h];
- j = j - h;
- if (j <= (lo + h - 1)) break;
- }
- ptr[j] = v;
- i++;
-
- /*-- copy 3 --*/
- if (i > hi) break;
- v = ptr[i];
- j = i;
- while ( mainGtU (
- ptr[j-h]+d, v+d, block, quadrant, nblock, budget
- ) ) {
- ptr[j] = ptr[j-h];
- j = j - h;
- if (j <= (lo + h - 1)) break;
- }
- ptr[j] = v;
- i++;
-
- if (*budget < 0) return;
- }
- }
-}
-
-
-/*---------------------------------------------*/
-/*--
- The following is an implementation of
- an elegant 3-way quicksort for strings,
- described in a paper "Fast Algorithms for
- Sorting and Searching Strings", by Robert
- Sedgewick and Jon L. Bentley.
---*/
-
-#define mswap(zz1, zz2) \
- { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }
-
-#define mvswap(zzp1, zzp2, zzn) \
-{ \
- Int32 yyp1 = (zzp1); \
- Int32 yyp2 = (zzp2); \
- Int32 yyn = (zzn); \
- while (yyn > 0) { \
- mswap(ptr[yyp1], ptr[yyp2]); \
- yyp1++; yyp2++; yyn--; \
- } \
-}
-
-static
-__inline__
-UChar mmed3 ( UChar a, UChar b, UChar c )
-{
- UChar t;
- if (a > b) { t = a; a = b; b = t; };
- if (b > c) {
- b = c;
- if (a > b) b = a;
- }
- return b;
-}
-
-#define mmin(a,b) ((a) < (b)) ? (a) : (b)
-
-#define mpush(lz,hz,dz) { stackLo[sp] = lz; \
- stackHi[sp] = hz; \
- stackD [sp] = dz; \
- sp++; }
-
-#define mpop(lz,hz,dz) { sp--; \
- lz = stackLo[sp]; \
- hz = stackHi[sp]; \
- dz = stackD [sp]; }
-
-
-#define mnextsize(az) (nextHi[az]-nextLo[az])
-
-#define mnextswap(az,bz) \
- { Int32 tz; \
- tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \
- tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \
- tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; }
-
-
-#define MAIN_QSORT_SMALL_THRESH 20
-#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT)
-#define MAIN_QSORT_STACK_SIZE 100
-
-static
-void mainQSort3 ( UInt32* ptr,
- UChar* block,
- UInt16* quadrant,
- Int32 nblock,
- Int32 loSt,
- Int32 hiSt,
- Int32 dSt,
- Int32* budget )
-{
- Int32 unLo, unHi, ltLo, gtHi, n, m, med;
- Int32 sp, lo, hi, d;
-
- Int32 stackLo[MAIN_QSORT_STACK_SIZE];
- Int32 stackHi[MAIN_QSORT_STACK_SIZE];
- Int32 stackD [MAIN_QSORT_STACK_SIZE];
-
- Int32 nextLo[3];
- Int32 nextHi[3];
- Int32 nextD [3];
-
- sp = 0;
- mpush ( loSt, hiSt, dSt );
-
- while (sp > 0) {
-
- AssertH ( sp < MAIN_QSORT_STACK_SIZE, 1001 );
-
- mpop ( lo, hi, d );
- if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
- d > MAIN_QSORT_DEPTH_THRESH) {
- mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );
- if (*budget < 0) return;
- continue;
- }
-
- med = (Int32)
- mmed3 ( block[ptr[ lo ]+d],
- block[ptr[ hi ]+d],
- block[ptr[ (lo+hi)>>1 ]+d] );
-
- unLo = ltLo = lo;
- unHi = gtHi = hi;
-
- while (True) {
- while (True) {
- if (unLo > unHi) break;
- n = ((Int32)block[ptr[unLo]+d]) - med;
- if (n == 0) {
- mswap(ptr[unLo], ptr[ltLo]);
- ltLo++; unLo++; continue;
- };
- if (n > 0) break;
- unLo++;
- }
- while (True) {
- if (unLo > unHi) break;
- n = ((Int32)block[ptr[unHi]+d]) - med;
- if (n == 0) {
- mswap(ptr[unHi], ptr[gtHi]);
- gtHi--; unHi--; continue;
- };
- if (n < 0) break;
- unHi--;
- }
- if (unLo > unHi) break;
- mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--;
- }
-
- AssertD ( unHi == unLo-1, "mainQSort3(2)" );
-
- if (gtHi < ltLo) {
- mpush(lo, hi, d+1 );
- continue;
- }
-
- n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n);
- m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m);
-
- n = lo + unLo - ltLo - 1;
- m = hi - (gtHi - unHi) + 1;
-
- nextLo[0] = lo; nextHi[0] = n; nextD[0] = d;
- nextLo[1] = m; nextHi[1] = hi; nextD[1] = d;
- nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1;
-
- if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
- if (mnextsize(1) < mnextsize(2)) mnextswap(1,2);
- if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
-
- AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" );
- AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" );
-
- mpush (nextLo[0], nextHi[0], nextD[0]);
- mpush (nextLo[1], nextHi[1], nextD[1]);
- mpush (nextLo[2], nextHi[2], nextD[2]);
- }
-}
-
-#undef mswap
-#undef mvswap
-#undef mpush
-#undef mpop
-#undef mmin
-#undef mnextsize
-#undef mnextswap
-#undef MAIN_QSORT_SMALL_THRESH
-#undef MAIN_QSORT_DEPTH_THRESH
-#undef MAIN_QSORT_STACK_SIZE
-
-
-/*---------------------------------------------*/
-/* Pre:
- nblock > N_OVERSHOOT
- block32 exists for [0 .. nblock-1 +N_OVERSHOOT]
- ((UChar*)block32) [0 .. nblock-1] holds block
- ptr exists for [0 .. nblock-1]
-
- Post:
- ((UChar*)block32) [0 .. nblock-1] holds block
- All other areas of block32 destroyed
- ftab [0 .. 65536 ] destroyed
- ptr [0 .. nblock-1] holds sorted order
- if (*budget < 0), sorting was abandoned
-*/
-
-#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8])
-#define SETMASK (1 << 21)
-#define CLEARMASK (~(SETMASK))
-
-static
-void mainSort ( UInt32* ptr,
- UChar* block,
- UInt16* quadrant,
- UInt32* ftab,
- Int32 nblock,
- Int32 verb,
- Int32* budget )
-{
- Int32 i, j, k, ss, sb;
- Int32 runningOrder[256];
- Bool bigDone[256];
- Int32 copyStart[256];
- Int32 copyEnd [256];
- UChar c1;
- Int32 numQSorted;
- UInt16 s;
- if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" );
-
- /*-- set up the 2-byte frequency table --*/
- for (i = 65536; i >= 0; i--) ftab[i] = 0;
-
- j = block[0] << 8;
- i = nblock-1;
- for (; i >= 3; i -= 4) {
- quadrant[i] = 0;
- j = (j >> 8) | ( ((UInt16)block[i]) << 8);
- ftab[j]++;
- quadrant[i-1] = 0;
- j = (j >> 8) | ( ((UInt16)block[i-1]) << 8);
- ftab[j]++;
- quadrant[i-2] = 0;
- j = (j >> 8) | ( ((UInt16)block[i-2]) << 8);
- ftab[j]++;
- quadrant[i-3] = 0;
- j = (j >> 8) | ( ((UInt16)block[i-3]) << 8);
- ftab[j]++;
- }
- for (; i >= 0; i--) {
- quadrant[i] = 0;
- j = (j >> 8) | ( ((UInt16)block[i]) << 8);
- ftab[j]++;
- }
-
- /*-- (emphasises close relationship of block & quadrant) --*/
- for (i = 0; i < BZ_N_OVERSHOOT; i++) {
- block [nblock+i] = block[i];
- quadrant[nblock+i] = 0;
- }
-
- if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" );
-
- /*-- Complete the initial radix sort --*/
- for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1];
-
- s = block[0] << 8;
- i = nblock-1;
- for (; i >= 3; i -= 4) {
- s = (s >> 8) | (block[i] << 8);
- j = ftab[s] -1;
- ftab[s] = j;
- ptr[j] = i;
- s = (s >> 8) | (block[i-1] << 8);
- j = ftab[s] -1;
- ftab[s] = j;
- ptr[j] = i-1;
- s = (s >> 8) | (block[i-2] << 8);
- j = ftab[s] -1;
- ftab[s] = j;
- ptr[j] = i-2;
- s = (s >> 8) | (block[i-3] << 8);
- j = ftab[s] -1;
- ftab[s] = j;
- ptr[j] = i-3;
- }
- for (; i >= 0; i--) {
- s = (s >> 8) | (block[i] << 8);
- j = ftab[s] -1;
- ftab[s] = j;
- ptr[j] = i;
- }
-
- /*--
- Now ftab contains the first loc of every small bucket.
- Calculate the running order, from smallest to largest
- big bucket.
- --*/
- for (i = 0; i <= 255; i++) {
- bigDone [i] = False;
- runningOrder[i] = i;
- }
-
- {
- Int32 vv;
- Int32 h = 1;
- do h = 3 * h + 1; while (h <= 256);
- do {
- h = h / 3;
- for (i = h; i <= 255; i++) {
- vv = runningOrder[i];
- j = i;
- while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {
- runningOrder[j] = runningOrder[j-h];
- j = j - h;
- if (j <= (h - 1)) goto zero;
- }
- zero:
- runningOrder[j] = vv;
- }
- } while (h != 1);
- }
-
- /*--
- The main sorting loop.
- --*/
-
- numQSorted = 0;
-
- for (i = 0; i <= 255; i++) {
-
- /*--
- Process big buckets, starting with the least full.
- Basically this is a 3-step process in which we call
- mainQSort3 to sort the small buckets [ss, j], but
- also make a big effort to avoid the calls if we can.
- --*/
- ss = runningOrder[i];
-
- /*--
- Step 1:
- Complete the big bucket [ss] by quicksorting
- any unsorted small buckets [ss, j], for j != ss.
- Hopefully previous pointer-scanning phases have already
- completed many of the small buckets [ss, j], so
- we don't have to sort them at all.
- --*/
- for (j = 0; j <= 255; j++) {
- if (j != ss) {
- sb = (ss << 8) + j;
- if ( ! (ftab[sb] & SETMASK) ) {
- Int32 lo = ftab[sb] & CLEARMASK;
- Int32 hi = (ftab[sb+1] & CLEARMASK) - 1;
- if (hi > lo) {
- if (verb >= 4)
- VPrintf4 ( " qsort [0x%x, 0x%x] "
- "done %d this %d\n",
- ss, j, numQSorted, hi - lo + 1 );
- mainQSort3 (
- ptr, block, quadrant, nblock,
- lo, hi, BZ_N_RADIX, budget
- );
- numQSorted += (hi - lo + 1);
- if (*budget < 0) return;
- }
- }
- ftab[sb] |= SETMASK;
- }
- }
-
- AssertH ( !bigDone[ss], 1006 );
-
- /*--
- Step 2:
- Now scan this big bucket [ss] so as to synthesise the
- sorted order for small buckets [t, ss] for all t,
- including, magically, the bucket [ss,ss] too.
- This will avoid doing Real Work in subsequent Step 1's.
- --*/
- {
- for (j = 0; j <= 255; j++) {
- copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK;
- copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1;
- }
- for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {
- k = ptr[j]-1; if (k < 0) k += nblock;
- c1 = block[k];
- if (!bigDone[c1])
- ptr[ copyStart[c1]++ ] = k;
- }
- for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
- k = ptr[j]-1; if (k < 0) k += nblock;
- c1 = block[k];
- if (!bigDone[c1])
- ptr[ copyEnd[c1]-- ] = k;
- }
- }
-
- AssertH ( copyStart[ss]-1 == copyEnd[ss], 1007 );
-
- for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK;
-
- /*--
- Step 3:
- The [ss] big bucket is now done. Record this fact,
- and update the quadrant descriptors. Remember to
- update quadrants in the overshoot area too, if
- necessary. The "if (i < 255)" test merely skips
- this updating for the last bucket processed, since
- updating for the last bucket is pointless.
-
- The quadrant array provides a way to incrementally
- cache sort orderings, as they appear, so as to
- make subsequent comparisons in fullGtU() complete
- faster. For repetitive blocks this makes a big
- difference (but not big enough to be able to avoid
- the fallback sorting mechanism, exponential radix sort).
-
- The precise meaning is: at all times:
-
- for 0 <= i < nblock and 0 <= j <= nblock
-
- if block[i] != block[j],
-
- then the relative values of quadrant[i] and
- quadrant[j] are meaningless.
-
- else {
- if quadrant[i] < quadrant[j]
- then the string starting at i lexicographically
- precedes the string starting at j
-
- else if quadrant[i] > quadrant[j]
- then the string starting at j lexicographically
- precedes the string starting at i
-
- else
- the relative ordering of the strings starting
- at i and j has not yet been determined.
- }
- --*/
- bigDone[ss] = True;
-
- if (i < 255) {
- Int32 bbStart = ftab[ss << 8] & CLEARMASK;
- Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart;
- Int32 shifts = 0;
-
- while ((bbSize >> shifts) > 65534) shifts++;
-
- for (j = bbSize-1; j >= 0; j--) {
- Int32 a2update = ptr[bbStart + j];
- UInt16 qVal = (UInt16)(j >> shifts);
- quadrant[a2update] = qVal;
- if (a2update < BZ_N_OVERSHOOT)
- quadrant[a2update + nblock] = qVal;
- }
- AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 );
- }
-
- }
-
- if (verb >= 4)
- VPrintf3 ( " %d pointers, %d sorted, %d scanned\n",
- nblock, numQSorted, nblock - numQSorted );
-}
-
-#undef BIGFREQ
-#undef SETMASK
-#undef CLEARMASK
-
-
-/*---------------------------------------------*/
-/* Pre:
- nblock > 0
- arr2 exists for [0 .. nblock-1 +N_OVERSHOOT]
- ((UChar*)arr2) [0 .. nblock-1] holds block
- arr1 exists for [0 .. nblock-1]
-
- Post:
- ((UChar*)arr2) [0 .. nblock-1] holds block
- All other areas of block destroyed
- ftab [ 0 .. 65536 ] destroyed
- arr1 [0 .. nblock-1] holds sorted order
-*/
-void BZ2_blockSort ( EState* s )
-{
- UInt32* ptr = s->ptr;
- UChar* block = s->block;
- UInt32* ftab = s->ftab;
- Int32 nblock = s->nblock;
- Int32 verb = s->verbosity;
- Int32 wfact = s->workFactor;
- UInt16* quadrant;
- Int32 budget;
- Int32 budgetInit;
- Int32 i;
-
- if (nblock < 10000) {
- fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
- } else {
- /* Calculate the location for quadrant, remembering to get
- the alignment right. Assumes that &(block[0]) is at least
- 2-byte aligned -- this should be ok since block is really
- the first section of arr2.
- */
- i = nblock+BZ_N_OVERSHOOT;
- if (i & 1) i++;
- quadrant = (UInt16*)(&(block[i]));
-
- /* (wfact-1) / 3 puts the default-factor-30
- transition point at very roughly the same place as
- with v0.1 and v0.9.0.
- Not that it particularly matters any more, since the
- resulting compressed stream is now the same regardless
- of whether or not we use the main sort or fallback sort.
- */
- if (wfact < 1 ) wfact = 1;
- if (wfact > 100) wfact = 100;
- budgetInit = nblock * ((wfact-1) / 3);
- budget = budgetInit;
-
- mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );
- if (verb >= 3)
- VPrintf3 ( " %d work, %d block, ratio %5.2f\n",
- budgetInit - budget,
- nblock,
- (float)(budgetInit - budget) /
- (float)(nblock==0 ? 1 : nblock) );
- if (budget < 0) {
- if (verb >= 2)
- VPrintf0 ( " too repetitive; using fallback"
- " sorting algorithm\n" );
- fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );
- }
- }
-
- s->origPtr = -1;
- for (i = 0; i < s->nblock; i++)
- if (ptr[i] == 0)
- { s->origPtr = i; break; };
-
- AssertH( s->origPtr != -1, 1003 );
-}
-
-
-/*-------------------------------------------------------------*/
-/*--- end blocksort.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/bzlib.c b/mdk-stage1/bzlib/bzlib.c
deleted file mode 100644
index b1fc85236..000000000
--- a/mdk-stage1/bzlib/bzlib.c
+++ /dev/null
@@ -1,1567 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Library top-level functions. ---*/
-/*--- bzlib.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-/*--
- CHANGES
- ~~~~~~~
- 0.9.0 -- original version.
-
- 0.9.0a/b -- no changes in this file.
-
- 0.9.0c
- * made zero-length BZ_FLUSH work correctly in bzCompress().
- * fixed bzWrite/bzRead to ignore zero-length requests.
- * fixed bzread to correctly handle read requests after EOF.
- * wrong parameter order in call to bzDecompressInit in
- bzBuffToBuffDecompress. Fixed.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-
-#include "bzlib_private.h"
-
-
-/*---------------------------------------------------*/
-/*--- Compression stuff ---*/
-/*---------------------------------------------------*/
-
-
-/*---------------------------------------------------*/
-#ifndef BZ_NO_STDIO
-void BZ2_bz__AssertH__fail ( int errcode )
-{
- fprintf(stderr,
- "\n\nbzip2/libbzip2: internal error number %d.\n"
- "This is a bug in bzip2/libbzip2, %s.\n"
- "Please report it to me at: jseward@acm.org. If this happened\n"
- "when you were using some program which uses libbzip2 as a\n"
- "component, you should also report this bug to the author(s)\n"
- "of that program. Please make an effort to report this bug;\n"
- "timely and accurate bug reports eventually lead to higher\n"
- "quality software. Thanks. Julian Seward, 21 March 2000.\n\n",
- errcode,
- BZ2_bzlibVersion()
- );
- exit(3);
-}
-#endif
-
-
-/*---------------------------------------------------*/
-static
-int bz_config_ok ( void )
-{
- if (sizeof(int) != 4) return 0;
- if (sizeof(short) != 2) return 0;
- if (sizeof(char) != 1) return 0;
- return 1;
-}
-
-
-/*---------------------------------------------------*/
-static
-void* default_bzalloc ( void* opaque __attribute__ ((unused)), Int32 items, Int32 size )
-{
- void* v = malloc ( items * size );
- return v;
-}
-
-static
-void default_bzfree ( void* opaque __attribute__ ((unused)), void* addr )
-{
- if (addr != NULL) free ( addr );
-}
-
-
-/*---------------------------------------------------*/
-static
-void prepare_new_block ( EState* s )
-{
- Int32 i;
- s->nblock = 0;
- s->numZ = 0;
- s->state_out_pos = 0;
- BZ_INITIALISE_CRC ( s->blockCRC );
- for (i = 0; i < 256; i++) s->inUse[i] = False;
- s->blockNo++;
-}
-
-
-/*---------------------------------------------------*/
-static
-void init_RL ( EState* s )
-{
- s->state_in_ch = 256;
- s->state_in_len = 0;
-}
-
-
-static
-Bool isempty_RL ( EState* s )
-{
- if (s->state_in_ch < 256 && s->state_in_len > 0)
- return False; else
- return True;
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzCompressInit)
- ( bz_stream* strm,
- int blockSize100k,
- int verbosity,
- int workFactor )
-{
- Int32 n;
- EState* s;
-
- if (!bz_config_ok()) return BZ_CONFIG_ERROR;
-
- if (strm == NULL ||
- blockSize100k < 1 || blockSize100k > 9 ||
- workFactor < 0 || workFactor > 250)
- return BZ_PARAM_ERROR;
-
- if (workFactor == 0) workFactor = 30;
- if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
- if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
-
- s = BZALLOC( sizeof(EState) );
- if (s == NULL) return BZ_MEM_ERROR;
- s->strm = strm;
-
- s->arr1 = NULL;
- s->arr2 = NULL;
- s->ftab = NULL;
-
- n = 100000 * blockSize100k;
- s->arr1 = BZALLOC( n * sizeof(UInt32) );
- s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );
- s->ftab = BZALLOC( 65537 * sizeof(UInt32) );
-
- if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {
- if (s->arr1 != NULL) BZFREE(s->arr1);
- if (s->arr2 != NULL) BZFREE(s->arr2);
- if (s->ftab != NULL) BZFREE(s->ftab);
- if (s != NULL) BZFREE(s);
- return BZ_MEM_ERROR;
- }
-
- s->blockNo = 0;
- s->state = BZ_S_INPUT;
- s->mode = BZ_M_RUNNING;
- s->combinedCRC = 0;
- s->blockSize100k = blockSize100k;
- s->nblockMAX = 100000 * blockSize100k - 19;
- s->verbosity = verbosity;
- s->workFactor = workFactor;
-
- s->block = (UChar*)s->arr2;
- s->mtfv = (UInt16*)s->arr1;
- s->zbits = NULL;
- s->ptr = (UInt32*)s->arr1;
-
- strm->state = s;
- strm->total_in_lo32 = 0;
- strm->total_in_hi32 = 0;
- strm->total_out_lo32 = 0;
- strm->total_out_hi32 = 0;
- init_RL ( s );
- prepare_new_block ( s );
- return BZ_OK;
-}
-
-
-/*---------------------------------------------------*/
-static
-void add_pair_to_block ( EState* s )
-{
- Int32 i;
- UChar ch = (UChar)(s->state_in_ch);
- for (i = 0; i < s->state_in_len; i++) {
- BZ_UPDATE_CRC( s->blockCRC, ch );
- }
- s->inUse[s->state_in_ch] = True;
- switch (s->state_in_len) {
- case 1:
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- break;
- case 2:
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- break;
- case 3:
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- break;
- default:
- s->inUse[s->state_in_len-4] = True;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = (UChar)ch; s->nblock++;
- s->block[s->nblock] = ((UChar)(s->state_in_len-4));
- s->nblock++;
- break;
- }
-}
-
-
-/*---------------------------------------------------*/
-static
-void flush_RL ( EState* s )
-{
- if (s->state_in_ch < 256) add_pair_to_block ( s );
- init_RL ( s );
-}
-
-
-/*---------------------------------------------------*/
-#define ADD_CHAR_TO_BLOCK(zs,zchh0) \
-{ \
- UInt32 zchh = (UInt32)(zchh0); \
- /*-- fast track the common case --*/ \
- if (zchh != zs->state_in_ch && \
- zs->state_in_len == 1) { \
- UChar ch = (UChar)(zs->state_in_ch); \
- BZ_UPDATE_CRC( zs->blockCRC, ch ); \
- zs->inUse[zs->state_in_ch] = True; \
- zs->block[zs->nblock] = (UChar)ch; \
- zs->nblock++; \
- zs->state_in_ch = zchh; \
- } \
- else \
- /*-- general, uncommon cases --*/ \
- if (zchh != zs->state_in_ch || \
- zs->state_in_len == 255) { \
- if (zs->state_in_ch < 256) \
- add_pair_to_block ( zs ); \
- zs->state_in_ch = zchh; \
- zs->state_in_len = 1; \
- } else { \
- zs->state_in_len++; \
- } \
-}
-
-
-/*---------------------------------------------------*/
-static
-Bool copy_input_until_stop ( EState* s )
-{
- Bool progress_in = False;
-
- if (s->mode == BZ_M_RUNNING) {
-
- /*-- fast track the common case --*/
- while (True) {
- /*-- block full? --*/
- if (s->nblock >= s->nblockMAX) break;
- /*-- no input? --*/
- if (s->strm->avail_in == 0) break;
- progress_in = True;
- ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
- s->strm->next_in++;
- s->strm->avail_in--;
- s->strm->total_in_lo32++;
- if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
- }
-
- } else {
-
- /*-- general, uncommon case --*/
- while (True) {
- /*-- block full? --*/
- if (s->nblock >= s->nblockMAX) break;
- /*-- no input? --*/
- if (s->strm->avail_in == 0) break;
- /*-- flush/finish end? --*/
- if (s->avail_in_expect == 0) break;
- progress_in = True;
- ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) );
- s->strm->next_in++;
- s->strm->avail_in--;
- s->strm->total_in_lo32++;
- if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;
- s->avail_in_expect--;
- }
- }
- return progress_in;
-}
-
-
-/*---------------------------------------------------*/
-static
-Bool copy_output_until_stop ( EState* s )
-{
- Bool progress_out = False;
-
- while (True) {
-
- /*-- no output space? --*/
- if (s->strm->avail_out == 0) break;
-
- /*-- block done? --*/
- if (s->state_out_pos >= s->numZ) break;
-
- progress_out = True;
- *(s->strm->next_out) = s->zbits[s->state_out_pos];
- s->state_out_pos++;
- s->strm->avail_out--;
- s->strm->next_out++;
- s->strm->total_out_lo32++;
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
- }
-
- return progress_out;
-}
-
-
-/*---------------------------------------------------*/
-static
-Bool handle_compress ( bz_stream* strm )
-{
- Bool progress_in = False;
- Bool progress_out = False;
- EState* s = strm->state;
-
- while (True) {
-
- if (s->state == BZ_S_OUTPUT) {
- progress_out |= copy_output_until_stop ( s );
- if (s->state_out_pos < s->numZ) break;
- if (s->mode == BZ_M_FINISHING &&
- s->avail_in_expect == 0 &&
- isempty_RL(s)) break;
- prepare_new_block ( s );
- s->state = BZ_S_INPUT;
- if (s->mode == BZ_M_FLUSHING &&
- s->avail_in_expect == 0 &&
- isempty_RL(s)) break;
- }
-
- if (s->state == BZ_S_INPUT) {
- progress_in |= copy_input_until_stop ( s );
- if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
- flush_RL ( s );
- BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
- s->state = BZ_S_OUTPUT;
- }
- else
- if (s->nblock >= s->nblockMAX) {
- BZ2_compressBlock ( s, False );
- s->state = BZ_S_OUTPUT;
- }
- else
- if (s->strm->avail_in == 0) {
- break;
- }
- }
-
- }
-
- return progress_in || progress_out;
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
-{
- Bool progress;
- EState* s;
- if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
- if (s == NULL) return BZ_PARAM_ERROR;
- if (s->strm != strm) return BZ_PARAM_ERROR;
-
- preswitch:
- switch (s->mode) {
-
- case BZ_M_IDLE:
- return BZ_SEQUENCE_ERROR;
-
- case BZ_M_RUNNING:
- if (action == BZ_RUN) {
- progress = handle_compress ( strm );
- return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;
- }
- else
- if (action == BZ_FLUSH) {
- s->avail_in_expect = strm->avail_in;
- s->mode = BZ_M_FLUSHING;
- goto preswitch;
- }
- else
- if (action == BZ_FINISH) {
- s->avail_in_expect = strm->avail_in;
- s->mode = BZ_M_FINISHING;
- goto preswitch;
- }
- else
- return BZ_PARAM_ERROR;
-
- case BZ_M_FLUSHING:
- if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;
- if (s->avail_in_expect != s->strm->avail_in)
- return BZ_SEQUENCE_ERROR;
- progress = handle_compress ( strm );
- if (s->avail_in_expect > 0 || !isempty_RL(s) ||
- s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
- s->mode = BZ_M_RUNNING;
- return BZ_RUN_OK;
-
- case BZ_M_FINISHING:
- if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;
- if (s->avail_in_expect != s->strm->avail_in)
- return BZ_SEQUENCE_ERROR;
- progress = handle_compress ( strm );
- if (!progress) return BZ_SEQUENCE_ERROR;
- if (s->avail_in_expect > 0 || !isempty_RL(s) ||
- s->state_out_pos < s->numZ) return BZ_FINISH_OK;
- s->mode = BZ_M_IDLE;
- return BZ_STREAM_END;
- }
- return BZ_OK; /*--not reached--*/
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
-{
- EState* s;
- if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
- if (s == NULL) return BZ_PARAM_ERROR;
- if (s->strm != strm) return BZ_PARAM_ERROR;
-
- if (s->arr1 != NULL) BZFREE(s->arr1);
- if (s->arr2 != NULL) BZFREE(s->arr2);
- if (s->ftab != NULL) BZFREE(s->ftab);
- BZFREE(strm->state);
-
- strm->state = NULL;
-
- return BZ_OK;
-}
-
-
-/*---------------------------------------------------*/
-/*--- Decompression stuff ---*/
-/*---------------------------------------------------*/
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompressInit)
- ( bz_stream* strm,
- int verbosity,
- int small )
-{
- DState* s;
-
- if (!bz_config_ok()) return BZ_CONFIG_ERROR;
-
- if (strm == NULL) return BZ_PARAM_ERROR;
- if (small != 0 && small != 1) return BZ_PARAM_ERROR;
- if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR;
-
- if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;
- if (strm->bzfree == NULL) strm->bzfree = default_bzfree;
-
- s = BZALLOC( sizeof(DState) );
- if (s == NULL) return BZ_MEM_ERROR;
- s->strm = strm;
- strm->state = s;
- s->state = BZ_X_MAGIC_1;
- s->bsLive = 0;
- s->bsBuff = 0;
- s->calculatedCombinedCRC = 0;
- strm->total_in_lo32 = 0;
- strm->total_in_hi32 = 0;
- strm->total_out_lo32 = 0;
- strm->total_out_hi32 = 0;
- s->smallDecompress = (Bool)small;
- s->ll4 = NULL;
- s->ll16 = NULL;
- s->tt = NULL;
- s->currBlockNo = 0;
- s->verbosity = verbosity;
-
- return BZ_OK;
-}
-
-
-/*---------------------------------------------------*/
-static
-void unRLE_obuf_to_output_FAST ( DState* s )
-{
- UChar k1;
-
- if (s->blockRandomised) {
-
- while (True) {
- /* try to finish existing run */
- while (True) {
- if (s->strm->avail_out == 0) return;
- if (s->state_out_len == 0) break;
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
- s->state_out_len--;
- s->strm->next_out++;
- s->strm->avail_out--;
- s->strm->total_out_lo32++;
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
- }
-
- /* can a new run be started? */
- if (s->nblock_used == s->save_nblock+1) return;
-
-
- s->state_out_len = 1;
- s->state_out_ch = s->k0;
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 2;
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 3;
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- BZ_GET_FAST(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- s->state_out_len = ((Int32)k1) + 4;
- BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK;
- s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
- }
-
- } else {
-
- /* restore */
- UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC;
- UChar c_state_out_ch = s->state_out_ch;
- Int32 c_state_out_len = s->state_out_len;
- Int32 c_nblock_used = s->nblock_used;
- Int32 c_k0 = s->k0;
- UInt32* c_tt = s->tt;
- UInt32 c_tPos = s->tPos;
- char* cs_next_out = s->strm->next_out;
- unsigned int cs_avail_out = s->strm->avail_out;
- /* end restore */
-
- UInt32 avail_out_INIT = cs_avail_out;
- Int32 s_save_nblockPP = s->save_nblock+1;
- unsigned int total_out_lo32_old;
-
- while (True) {
-
- /* try to finish existing run */
- if (c_state_out_len > 0) {
- while (True) {
- if (cs_avail_out == 0) goto return_notr;
- if (c_state_out_len == 1) break;
- *( (UChar*)(cs_next_out) ) = c_state_out_ch;
- BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
- c_state_out_len--;
- cs_next_out++;
- cs_avail_out--;
- }
- s_state_out_len_eq_one:
- {
- if (cs_avail_out == 0) {
- c_state_out_len = 1; goto return_notr;
- };
- *( (UChar*)(cs_next_out) ) = c_state_out_ch;
- BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );
- cs_next_out++;
- cs_avail_out--;
- }
- }
- /* can a new run be started? */
- if (c_nblock_used == s_save_nblockPP) {
- c_state_out_len = 0; goto return_notr;
- };
- c_state_out_ch = c_k0;
- BZ_GET_FAST_C(k1); c_nblock_used++;
- if (k1 != c_k0) {
- c_k0 = k1; goto s_state_out_len_eq_one;
- };
- if (c_nblock_used == s_save_nblockPP)
- goto s_state_out_len_eq_one;
-
- c_state_out_len = 2;
- BZ_GET_FAST_C(k1); c_nblock_used++;
- if (c_nblock_used == s_save_nblockPP) continue;
- if (k1 != c_k0) { c_k0 = k1; continue; };
-
- c_state_out_len = 3;
- BZ_GET_FAST_C(k1); c_nblock_used++;
- if (c_nblock_used == s_save_nblockPP) continue;
- if (k1 != c_k0) { c_k0 = k1; continue; };
-
- BZ_GET_FAST_C(k1); c_nblock_used++;
- c_state_out_len = ((Int32)k1) + 4;
- BZ_GET_FAST_C(c_k0); c_nblock_used++;
- }
-
- return_notr:
- total_out_lo32_old = s->strm->total_out_lo32;
- s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);
- if (s->strm->total_out_lo32 < total_out_lo32_old)
- s->strm->total_out_hi32++;
-
- /* save */
- s->calculatedBlockCRC = c_calculatedBlockCRC;
- s->state_out_ch = c_state_out_ch;
- s->state_out_len = c_state_out_len;
- s->nblock_used = c_nblock_used;
- s->k0 = c_k0;
- s->tt = c_tt;
- s->tPos = c_tPos;
- s->strm->next_out = cs_next_out;
- s->strm->avail_out = cs_avail_out;
- /* end save */
- }
-}
-
-
-
-/*---------------------------------------------------*/
-__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )
-{
- Int32 nb, na, mid;
- nb = 0;
- na = 256;
- do {
- mid = (nb + na) >> 1;
- if (indx >= cftab[mid]) nb = mid; else na = mid;
- }
- while (na - nb != 1);
- return nb;
-}
-
-
-/*---------------------------------------------------*/
-static
-void unRLE_obuf_to_output_SMALL ( DState* s )
-{
- UChar k1;
-
- if (s->blockRandomised) {
-
- while (True) {
- /* try to finish existing run */
- while (True) {
- if (s->strm->avail_out == 0) return;
- if (s->state_out_len == 0) break;
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
- s->state_out_len--;
- s->strm->next_out++;
- s->strm->avail_out--;
- s->strm->total_out_lo32++;
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
- }
-
- /* can a new run be started? */
- if (s->nblock_used == s->save_nblock+1) return;
-
-
- s->state_out_len = 1;
- s->state_out_ch = s->k0;
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 2;
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 3;
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK;
- k1 ^= BZ_RAND_MASK; s->nblock_used++;
- s->state_out_len = ((Int32)k1) + 4;
- BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK;
- s->k0 ^= BZ_RAND_MASK; s->nblock_used++;
- }
-
- } else {
-
- while (True) {
- /* try to finish existing run */
- while (True) {
- if (s->strm->avail_out == 0) return;
- if (s->state_out_len == 0) break;
- *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;
- BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );
- s->state_out_len--;
- s->strm->next_out++;
- s->strm->avail_out--;
- s->strm->total_out_lo32++;
- if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;
- }
-
- /* can a new run be started? */
- if (s->nblock_used == s->save_nblock+1) return;
-
- s->state_out_len = 1;
- s->state_out_ch = s->k0;
- BZ_GET_SMALL(k1); s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 2;
- BZ_GET_SMALL(k1); s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- s->state_out_len = 3;
- BZ_GET_SMALL(k1); s->nblock_used++;
- if (s->nblock_used == s->save_nblock+1) continue;
- if (k1 != s->k0) { s->k0 = k1; continue; };
-
- BZ_GET_SMALL(k1); s->nblock_used++;
- s->state_out_len = ((Int32)k1) + 4;
- BZ_GET_SMALL(s->k0); s->nblock_used++;
- }
-
- }
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
-{
- DState* s;
- if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
- if (s == NULL) return BZ_PARAM_ERROR;
- if (s->strm != strm) return BZ_PARAM_ERROR;
-
- while (True) {
- if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;
- if (s->state == BZ_X_OUTPUT) {
- if (s->smallDecompress)
- unRLE_obuf_to_output_SMALL ( s ); else
- unRLE_obuf_to_output_FAST ( s );
- if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {
- BZ_FINALISE_CRC ( s->calculatedBlockCRC );
- if (s->verbosity >= 3)
- VPrintf2 ( " {0x%x, 0x%x}", s->storedBlockCRC,
- s->calculatedBlockCRC );
- if (s->verbosity >= 2) VPrintf0 ( "]" );
- if (s->calculatedBlockCRC != s->storedBlockCRC)
- return BZ_DATA_ERROR;
- s->calculatedCombinedCRC
- = (s->calculatedCombinedCRC << 1) |
- (s->calculatedCombinedCRC >> 31);
- s->calculatedCombinedCRC ^= s->calculatedBlockCRC;
- s->state = BZ_X_BLKHDR_1;
- } else {
- return BZ_OK;
- }
- }
- if (s->state >= BZ_X_MAGIC_1) {
- Int32 r = BZ2_decompress ( s );
- if (r == BZ_STREAM_END) {
- if (s->verbosity >= 3)
- VPrintf2 ( "\n combined CRCs: stored = 0x%x, computed = 0x%x",
- s->storedCombinedCRC, s->calculatedCombinedCRC );
- if (s->calculatedCombinedCRC != s->storedCombinedCRC)
- return BZ_DATA_ERROR;
- return r;
- }
- if (s->state != BZ_X_OUTPUT) return r;
- }
- }
-
- AssertH ( 0, 6001 );
-
- return 0; /*NOTREACHED*/
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
-{
- DState* s;
- if (strm == NULL) return BZ_PARAM_ERROR;
- s = strm->state;
- if (s == NULL) return BZ_PARAM_ERROR;
- if (s->strm != strm) return BZ_PARAM_ERROR;
-
- if (s->tt != NULL) BZFREE(s->tt);
- if (s->ll16 != NULL) BZFREE(s->ll16);
- if (s->ll4 != NULL) BZFREE(s->ll4);
-
- BZFREE(strm->state);
- strm->state = NULL;
-
- return BZ_OK;
-}
-
-
-#ifndef BZ_NO_STDIO
-/*---------------------------------------------------*/
-/*--- File I/O stuff ---*/
-/*---------------------------------------------------*/
-
-#define BZ_SETERR(eee) \
-{ \
- if (bzerror != NULL) *bzerror = eee; \
- if (bzf != NULL) bzf->lastErr = eee; \
-}
-
-typedef
- struct {
- FILE* handle;
- Char buf[BZ_MAX_UNUSED];
- Int32 bufN;
- Bool writing;
- bz_stream strm;
- Int32 lastErr;
- Bool initialisedOk;
- }
- bzFile;
-
-
-/*---------------------------------------------*/
-static Bool myfeof ( FILE* f )
-{
- return feof(f) ? True : False;
-}
-
-
-/*---------------------------------------------------*/
-BZFILE* BZ_API(BZ2_bzWriteOpen)
- ( int* bzerror,
- FILE* f,
- int blockSize100k,
- int verbosity,
- int workFactor )
-{
- Int32 ret;
- bzFile* bzf = NULL;
-
- BZ_SETERR(BZ_OK);
-
- if (f == NULL ||
- (blockSize100k < 1 || blockSize100k > 9) ||
- (workFactor < 0 || workFactor > 250) ||
- (verbosity < 0 || verbosity > 4))
- { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
-
- if (ferror(f))
- { BZ_SETERR(BZ_IO_ERROR); return NULL; };
-
- bzf = malloc ( sizeof(bzFile) );
- if (bzf == NULL)
- { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
-
- BZ_SETERR(BZ_OK);
- bzf->initialisedOk = False;
- bzf->bufN = 0;
- bzf->handle = f;
- bzf->writing = True;
- bzf->strm.bzalloc = NULL;
- bzf->strm.bzfree = NULL;
- bzf->strm.opaque = NULL;
-
- if (workFactor == 0) workFactor = 30;
- ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k,
- verbosity, workFactor );
- if (ret != BZ_OK)
- { BZ_SETERR(ret); free(bzf); return NULL; };
-
- bzf->strm.avail_in = 0;
- bzf->initialisedOk = True;
- return bzf;
-}
-
-
-
-/*---------------------------------------------------*/
-void BZ_API(BZ2_bzWrite)
- ( int* bzerror,
- BZFILE* b,
- void* buf,
- int len )
-{
- Int32 n, n2, ret;
- bzFile* bzf = (bzFile*)b;
-
- BZ_SETERR(BZ_OK);
- if (bzf == NULL || buf == NULL || len < 0)
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
- if (!(bzf->writing))
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
- if (ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return; };
-
- if (len == 0)
- { BZ_SETERR(BZ_OK); return; };
-
- bzf->strm.avail_in = len;
- bzf->strm.next_in = buf;
-
- while (True) {
- bzf->strm.avail_out = BZ_MAX_UNUSED;
- bzf->strm.next_out = bzf->buf;
- ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );
- if (ret != BZ_RUN_OK)
- { BZ_SETERR(ret); return; };
-
- if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
- n = BZ_MAX_UNUSED - bzf->strm.avail_out;
- n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
- n, bzf->handle );
- if (n != n2 || ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return; };
- }
-
- if (bzf->strm.avail_in == 0)
- { BZ_SETERR(BZ_OK); return; };
- }
-}
-
-
-/*---------------------------------------------------*/
-void BZ_API(BZ2_bzWriteClose)
- ( int* bzerror,
- BZFILE* b,
- int abandon,
- unsigned int* nbytes_in,
- unsigned int* nbytes_out )
-{
- BZ2_bzWriteClose64 ( bzerror, b, abandon,
- nbytes_in, NULL, nbytes_out, NULL );
-}
-
-
-void BZ_API(BZ2_bzWriteClose64)
- ( int* bzerror,
- BZFILE* b,
- int abandon,
- unsigned int* nbytes_in_lo32,
- unsigned int* nbytes_in_hi32,
- unsigned int* nbytes_out_lo32,
- unsigned int* nbytes_out_hi32 )
-{
- Int32 n, n2, ret;
- bzFile* bzf = (bzFile*)b;
-
- if (bzf == NULL)
- { BZ_SETERR(BZ_OK); return; };
- if (!(bzf->writing))
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
- if (ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return; };
-
- if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0;
- if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0;
- if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0;
- if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0;
-
- if ((!abandon) && bzf->lastErr == BZ_OK) {
- while (True) {
- bzf->strm.avail_out = BZ_MAX_UNUSED;
- bzf->strm.next_out = bzf->buf;
- ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );
- if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END)
- { BZ_SETERR(ret); return; };
-
- if (bzf->strm.avail_out < BZ_MAX_UNUSED) {
- n = BZ_MAX_UNUSED - bzf->strm.avail_out;
- n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar),
- n, bzf->handle );
- if (n != n2 || ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return; };
- }
-
- if (ret == BZ_STREAM_END) break;
- }
- }
-
- if ( !abandon && !ferror ( bzf->handle ) ) {
- fflush ( bzf->handle );
- if (ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return; };
- }
-
- if (nbytes_in_lo32 != NULL)
- *nbytes_in_lo32 = bzf->strm.total_in_lo32;
- if (nbytes_in_hi32 != NULL)
- *nbytes_in_hi32 = bzf->strm.total_in_hi32;
- if (nbytes_out_lo32 != NULL)
- *nbytes_out_lo32 = bzf->strm.total_out_lo32;
- if (nbytes_out_hi32 != NULL)
- *nbytes_out_hi32 = bzf->strm.total_out_hi32;
-
- BZ_SETERR(BZ_OK);
- BZ2_bzCompressEnd ( &(bzf->strm) );
- free ( bzf );
-}
-
-
-/*---------------------------------------------------*/
-BZFILE* BZ_API(BZ2_bzReadOpen)
- ( int* bzerror,
- FILE* f,
- int verbosity,
- int small,
- void* unused,
- int nUnused )
-{
- bzFile* bzf = NULL;
- int ret;
-
- BZ_SETERR(BZ_OK);
-
- if (f == NULL ||
- (small != 0 && small != 1) ||
- (verbosity < 0 || verbosity > 4) ||
- (unused == NULL && nUnused != 0) ||
- (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))
- { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };
-
- if (ferror(f))
- { BZ_SETERR(BZ_IO_ERROR); return NULL; };
-
- bzf = malloc ( sizeof(bzFile) );
- if (bzf == NULL)
- { BZ_SETERR(BZ_MEM_ERROR); return NULL; };
-
- BZ_SETERR(BZ_OK);
-
- bzf->initialisedOk = False;
- bzf->handle = f;
- bzf->bufN = 0;
- bzf->writing = False;
- bzf->strm.bzalloc = NULL;
- bzf->strm.bzfree = NULL;
- bzf->strm.opaque = NULL;
-
- while (nUnused > 0) {
- bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;
- unused = ((void*)( 1 + ((UChar*)(unused)) ));
- nUnused--;
- }
-
- ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );
- if (ret != BZ_OK)
- { BZ_SETERR(ret); free(bzf); return NULL; };
-
- bzf->strm.avail_in = bzf->bufN;
- bzf->strm.next_in = bzf->buf;
-
- bzf->initialisedOk = True;
- return bzf;
-}
-
-
-/*---------------------------------------------------*/
-void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )
-{
- bzFile* bzf = (bzFile*)b;
-
- BZ_SETERR(BZ_OK);
- if (bzf == NULL)
- { BZ_SETERR(BZ_OK); return; };
-
- if (bzf->writing)
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
-
- if (bzf->initialisedOk)
- (void)BZ2_bzDecompressEnd ( &(bzf->strm) );
- free ( bzf );
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzRead)
- ( int* bzerror,
- BZFILE* b,
- void* buf,
- int len )
-{
- Int32 n, ret;
- bzFile* bzf = (bzFile*)b;
-
- BZ_SETERR(BZ_OK);
-
- if (bzf == NULL || buf == NULL || len < 0)
- { BZ_SETERR(BZ_PARAM_ERROR); return 0; };
-
- if (bzf->writing)
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };
-
- if (len == 0)
- { BZ_SETERR(BZ_OK); return 0; };
-
- bzf->strm.avail_out = len;
- bzf->strm.next_out = buf;
-
- while (True) {
-
- if (ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return 0; };
-
- if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {
- n = fread ( bzf->buf, sizeof(UChar),
- BZ_MAX_UNUSED, bzf->handle );
- if (ferror(bzf->handle))
- { BZ_SETERR(BZ_IO_ERROR); return 0; };
- bzf->bufN = n;
- bzf->strm.avail_in = bzf->bufN;
- bzf->strm.next_in = bzf->buf;
- }
-
- ret = BZ2_bzDecompress ( &(bzf->strm) );
-
- if (ret != BZ_OK && ret != BZ_STREAM_END)
- { BZ_SETERR(ret); return 0; };
-
- if (ret == BZ_OK && myfeof(bzf->handle) &&
- bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)
- { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };
-
- if (ret == BZ_STREAM_END)
- { BZ_SETERR(BZ_STREAM_END);
- return len - bzf->strm.avail_out; };
- if (bzf->strm.avail_out == 0)
- { BZ_SETERR(BZ_OK); return len; };
-
- }
-
- return 0; /*not reached*/
-}
-
-
-/*---------------------------------------------------*/
-void BZ_API(BZ2_bzReadGetUnused)
- ( int* bzerror,
- BZFILE* b,
- void** unused,
- int* nUnused )
-{
- bzFile* bzf = (bzFile*)b;
- if (bzf == NULL)
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
- if (bzf->lastErr != BZ_STREAM_END)
- { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };
- if (unused == NULL || nUnused == NULL)
- { BZ_SETERR(BZ_PARAM_ERROR); return; };
-
- BZ_SETERR(BZ_OK);
- *nUnused = bzf->strm.avail_in;
- *unused = bzf->strm.next_in;
-}
-#endif
-
-
-/*---------------------------------------------------*/
-/*--- Misc convenience stuff ---*/
-/*---------------------------------------------------*/
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzBuffToBuffCompress)
- ( char* dest,
- unsigned int* destLen,
- char* source,
- unsigned int sourceLen,
- int blockSize100k,
- int verbosity,
- int workFactor )
-{
- bz_stream strm;
- int ret;
-
- if (dest == NULL || destLen == NULL ||
- source == NULL ||
- blockSize100k < 1 || blockSize100k > 9 ||
- verbosity < 0 || verbosity > 4 ||
- workFactor < 0 || workFactor > 250)
- return BZ_PARAM_ERROR;
-
- if (workFactor == 0) workFactor = 30;
- strm.bzalloc = NULL;
- strm.bzfree = NULL;
- strm.opaque = NULL;
- ret = BZ2_bzCompressInit ( &strm, blockSize100k,
- verbosity, workFactor );
- if (ret != BZ_OK) return ret;
-
- strm.next_in = source;
- strm.next_out = dest;
- strm.avail_in = sourceLen;
- strm.avail_out = *destLen;
-
- ret = BZ2_bzCompress ( &strm, BZ_FINISH );
- if (ret == BZ_FINISH_OK) goto output_overflow;
- if (ret != BZ_STREAM_END) goto errhandler;
-
- /* normal termination */
- *destLen -= strm.avail_out;
- BZ2_bzCompressEnd ( &strm );
- return BZ_OK;
-
- output_overflow:
- BZ2_bzCompressEnd ( &strm );
- return BZ_OUTBUFF_FULL;
-
- errhandler:
- BZ2_bzCompressEnd ( &strm );
- return ret;
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzBuffToBuffDecompress)
- ( char* dest,
- unsigned int* destLen,
- char* source,
- unsigned int sourceLen,
- int small,
- int verbosity )
-{
- bz_stream strm;
- int ret;
-
- if (dest == NULL || destLen == NULL ||
- source == NULL ||
- (small != 0 && small != 1) ||
- verbosity < 0 || verbosity > 4)
- return BZ_PARAM_ERROR;
-
- strm.bzalloc = NULL;
- strm.bzfree = NULL;
- strm.opaque = NULL;
- ret = BZ2_bzDecompressInit ( &strm, verbosity, small );
- if (ret != BZ_OK) return ret;
-
- strm.next_in = source;
- strm.next_out = dest;
- strm.avail_in = sourceLen;
- strm.avail_out = *destLen;
-
- ret = BZ2_bzDecompress ( &strm );
- if (ret == BZ_OK) goto output_overflow_or_eof;
- if (ret != BZ_STREAM_END) goto errhandler;
-
- /* normal termination */
- *destLen -= strm.avail_out;
- BZ2_bzDecompressEnd ( &strm );
- return BZ_OK;
-
- output_overflow_or_eof:
- if (strm.avail_out > 0) {
- BZ2_bzDecompressEnd ( &strm );
- return BZ_UNEXPECTED_EOF;
- } else {
- BZ2_bzDecompressEnd ( &strm );
- return BZ_OUTBUFF_FULL;
- };
-
- errhandler:
- BZ2_bzDecompressEnd ( &strm );
- return ret;
-}
-
-
-/*---------------------------------------------------*/
-/*--
- Code contributed by Yoshioka Tsuneo
- (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
- to support better zlib compatibility.
- This code is not _officially_ part of libbzip2 (yet);
- I haven't tested it, documented it, or considered the
- threading-safeness of it.
- If this code breaks, please contact both Yoshioka and me.
---*/
-/*---------------------------------------------------*/
-
-/*---------------------------------------------------*/
-/*--
- return version like "0.9.0c".
---*/
-const char * BZ_API(BZ2_bzlibVersion)(void)
-{
- return BZ_VERSION;
-}
-
-
-#ifndef BZ_NO_STDIO
-/*---------------------------------------------------*/
-
-#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
-# include <fcntl.h>
-# include <io.h>
-# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
-#else
-# define SET_BINARY_MODE(file)
-#endif
-static
-BZFILE * bzopen_or_bzdopen
- ( const char *path, /* no use when bzdopen */
- int fd, /* no use when bzdopen */
- const char *mode,
- int open_mode) /* bzopen: 0, bzdopen:1 */
-{
- int bzerr;
- char unused[BZ_MAX_UNUSED];
- int blockSize100k = 9;
- int writing = 0;
- char mode2[10] = "";
- FILE *fp = NULL;
- BZFILE *bzfp = NULL;
- int verbosity = 0;
- int workFactor = 30;
- int smallMode = 0;
- int nUnused = 0;
-
- if (mode == NULL) return NULL;
- while (*mode) {
- switch (*mode) {
- case 'r':
- writing = 0; break;
- case 'w':
- writing = 1; break;
- case 's':
- smallMode = 1; break;
- default:
- if (isdigit((int)(*mode))) {
- blockSize100k = *mode-'0';
- }
- }
- mode++;
- }
- strcat(mode2, writing ? "w" : "r" );
- strcat(mode2,"b"); /* binary mode */
-
- if (open_mode==0) {
- if (path==NULL || strcmp(path,"")==0) {
- fp = (writing ? stdout : stdin);
- SET_BINARY_MODE(fp);
- } else {
- fp = fopen(path,mode2);
- }
- } else {
-#ifdef BZ_STRICT_ANSI
- fp = NULL;
-#else
- fp = fdopen(fd,mode2);
-#endif
- }
- if (fp == NULL) return NULL;
-
- if (writing) {
- /* Guard against total chaos and anarchy -- JRS */
- if (blockSize100k < 1) blockSize100k = 1;
- if (blockSize100k > 9) blockSize100k = 9;
- bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,
- verbosity,workFactor);
- } else {
- bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,
- unused,nUnused);
- }
- if (bzfp == NULL) {
- if (fp != stdin && fp != stdout) fclose(fp);
- return NULL;
- }
- return bzfp;
-}
-
-
-/*---------------------------------------------------*/
-/*--
- open file for read or write.
- ex) bzopen("file","w9")
- case path="" or NULL => use stdin or stdout.
---*/
-BZFILE * BZ_API(BZ2_bzopen)
- ( const char *path,
- const char *mode )
-{
- return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);
-}
-
-
-/*---------------------------------------------------*/
-BZFILE * BZ_API(BZ2_bzdopen)
- ( int fd,
- const char *mode )
-{
- return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )
-{
- int bzerr, nread;
- if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0;
- nread = BZ2_bzRead(&bzerr,b,buf,len);
- if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) {
- return nread;
- } else {
- return -1;
- }
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )
-{
- int bzerr;
-
- BZ2_bzWrite(&bzerr,b,buf,len);
- if(bzerr == BZ_OK){
- return len;
- }else{
- return -1;
- }
-}
-
-
-/*---------------------------------------------------*/
-int BZ_API(BZ2_bzflush) (BZFILE *b __attribute__ ((unused)))
-{
- /* do nothing now... */
- return 0;
-}
-
-
-/*---------------------------------------------------*/
-void BZ_API(BZ2_bzclose) (BZFILE* b)
-{
- int bzerr;
- FILE *fp = ((bzFile *)b)->handle;
-
- if (b==NULL) {return;}
- if(((bzFile*)b)->writing){
- BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);
- if(bzerr != BZ_OK){
- BZ2_bzWriteClose(NULL,b,1,NULL,NULL);
- }
- }else{
- BZ2_bzReadClose(&bzerr,b);
- }
- if(fp!=stdin && fp!=stdout){
- fclose(fp);
- }
-}
-
-
-/*---------------------------------------------------*/
-/*--
- return last error code
---*/
-static char *bzerrorstrings[] = {
- "OK"
- ,"SEQUENCE_ERROR"
- ,"PARAM_ERROR"
- ,"MEM_ERROR"
- ,"DATA_ERROR"
- ,"DATA_ERROR_MAGIC"
- ,"IO_ERROR"
- ,"UNEXPECTED_EOF"
- ,"OUTBUFF_FULL"
- ,"CONFIG_ERROR"
- ,"???" /* for future */
- ,"???" /* for future */
- ,"???" /* for future */
- ,"???" /* for future */
- ,"???" /* for future */
- ,"???" /* for future */
-};
-
-
-const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
-{
- int err = ((bzFile *)b)->lastErr;
-
- if(err>0) err = 0;
- *errnum = err;
- return bzerrorstrings[err*-1];
-}
-#endif
-
-
-/*-------------------------------------------------------------*/
-/*--- end bzlib.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/bzlib.h b/mdk-stage1/bzlib/bzlib.h
deleted file mode 100644
index c9447a295..000000000
--- a/mdk-stage1/bzlib/bzlib.h
+++ /dev/null
@@ -1,319 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Public header file for the library. ---*/
-/*--- bzlib.h ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-
-#ifndef _BZLIB_H
-#define _BZLIB_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define BZ_RUN 0
-#define BZ_FLUSH 1
-#define BZ_FINISH 2
-
-#define BZ_OK 0
-#define BZ_RUN_OK 1
-#define BZ_FLUSH_OK 2
-#define BZ_FINISH_OK 3
-#define BZ_STREAM_END 4
-#define BZ_SEQUENCE_ERROR (-1)
-#define BZ_PARAM_ERROR (-2)
-#define BZ_MEM_ERROR (-3)
-#define BZ_DATA_ERROR (-4)
-#define BZ_DATA_ERROR_MAGIC (-5)
-#define BZ_IO_ERROR (-6)
-#define BZ_UNEXPECTED_EOF (-7)
-#define BZ_OUTBUFF_FULL (-8)
-#define BZ_CONFIG_ERROR (-9)
-
-typedef
- struct {
- char *next_in;
- unsigned int avail_in;
- unsigned int total_in_lo32;
- unsigned int total_in_hi32;
-
- char *next_out;
- unsigned int avail_out;
- unsigned int total_out_lo32;
- unsigned int total_out_hi32;
-
- void *state;
-
- void *(*bzalloc)(void *,int,int);
- void (*bzfree)(void *,void *);
- void *opaque;
- }
- bz_stream;
-
-
-#ifndef BZ_IMPORT
-#define BZ_EXPORT
-#endif
-
-#ifdef _WIN32
-# include <stdio.h>
-# include <windows.h>
-# ifdef small
- /* windows.h define small to char */
-# undef small
-# endif
-# ifdef BZ_EXPORT
-# define BZ_API(func) WINAPI func
-# define BZ_EXTERN extern
-# else
- /* import windows dll dynamically */
-# define BZ_API(func) (WINAPI * func)
-# define BZ_EXTERN
-# endif
-#else
-# define BZ_API(func) func
-# define BZ_EXTERN extern
-#endif
-
-
-/*-- Core (low-level) library functions --*/
-
-BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
- bz_stream* strm,
- int blockSize100k,
- int verbosity,
- int workFactor
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzCompress) (
- bz_stream* strm,
- int action
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
- bz_stream* strm
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
- bz_stream *strm,
- int verbosity,
- int small
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
- bz_stream* strm
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
- bz_stream *strm
- );
-
-
-
-/*-- High(er) level library functions --*/
-
-#ifndef BZ_NO_STDIO
-#define BZ_MAX_UNUSED 5000
-
-typedef void BZFILE;
-
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
- int* bzerror,
- FILE* f,
- int verbosity,
- int small,
- void* unused,
- int nUnused
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
- int* bzerror,
- BZFILE* b
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
- int* bzerror,
- BZFILE* b,
- void** unused,
- int* nUnused
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzRead) (
- int* bzerror,
- BZFILE* b,
- void* buf,
- int len
- );
-
-BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
- int* bzerror,
- FILE* f,
- int blockSize100k,
- int verbosity,
- int workFactor
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzWrite) (
- int* bzerror,
- BZFILE* b,
- void* buf,
- int len
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
- int* bzerror,
- BZFILE* b,
- int abandon,
- unsigned int* nbytes_in,
- unsigned int* nbytes_out
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
- int* bzerror,
- BZFILE* b,
- int abandon,
- unsigned int* nbytes_in_lo32,
- unsigned int* nbytes_in_hi32,
- unsigned int* nbytes_out_lo32,
- unsigned int* nbytes_out_hi32
- );
-#endif
-
-
-/*-- Utility functions --*/
-
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
- char* dest,
- unsigned int* destLen,
- char* source,
- unsigned int sourceLen,
- int blockSize100k,
- int verbosity,
- int workFactor
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
- char* dest,
- unsigned int* destLen,
- char* source,
- unsigned int sourceLen,
- int small,
- int verbosity
- );
-
-
-/*--
- Code contributed by Yoshioka Tsuneo
- (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp),
- to support better zlib compatibility.
- This code is not _officially_ part of libbzip2 (yet);
- I haven't tested it, documented it, or considered the
- threading-safeness of it.
- If this code breaks, please contact both Yoshioka and me.
---*/
-
-BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
- void
- );
-
-#ifndef BZ_NO_STDIO
-BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
- const char *path,
- const char *mode
- );
-
-BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
- int fd,
- const char *mode
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzread) (
- BZFILE* b,
- void* buf,
- int len
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzwrite) (
- BZFILE* b,
- void* buf,
- int len
- );
-
-BZ_EXTERN int BZ_API(BZ2_bzflush) (
- BZFILE* b
- );
-
-BZ_EXTERN void BZ_API(BZ2_bzclose) (
- BZFILE* b
- );
-
-BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
- BZFILE *b,
- int *errnum
- );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-/*-------------------------------------------------------------*/
-/*--- end bzlib.h ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/bzlib_private.h b/mdk-stage1/bzlib/bzlib_private.h
deleted file mode 100644
index fb51c7a1d..000000000
--- a/mdk-stage1/bzlib/bzlib_private.h
+++ /dev/null
@@ -1,530 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Private header file for the library. ---*/
-/*--- bzlib_private.h ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-
-#ifndef _BZLIB_PRIVATE_H
-#define _BZLIB_PRIVATE_H
-
-#include <stdlib.h>
-
-#ifndef BZ_NO_STDIO
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#endif
-
-#include "bzlib.h"
-
-
-
-/*-- General stuff. --*/
-
-#define BZ_VERSION "1.0.1, 23-June-2000"
-
-typedef char Char;
-typedef unsigned char Bool;
-typedef unsigned char UChar;
-typedef int Int32;
-typedef unsigned int UInt32;
-typedef short Int16;
-typedef unsigned short UInt16;
-
-#define True ((Bool)1)
-#define False ((Bool)0)
-
-#ifndef __GNUC__
-#define __inline__ /* */
-#endif
-
-#ifndef BZ_NO_STDIO
-extern void BZ2_bz__AssertH__fail ( int errcode );
-#define AssertH(cond,errcode) \
- { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); }
-#if BZ_DEBUG
-#define AssertD(cond,msg) \
- { if (!(cond)) { \
- fprintf ( stderr, \
- "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\
- exit(1); \
- }}
-#else
-#define AssertD(cond,msg) /* */
-#endif
-#define VPrintf0(zf) \
- fprintf(stderr,zf)
-#define VPrintf1(zf,za1) \
- fprintf(stderr,zf,za1)
-#define VPrintf2(zf,za1,za2) \
- fprintf(stderr,zf,za1,za2)
-#define VPrintf3(zf,za1,za2,za3) \
- fprintf(stderr,zf,za1,za2,za3)
-#define VPrintf4(zf,za1,za2,za3,za4) \
- fprintf(stderr,zf,za1,za2,za3,za4)
-#define VPrintf5(zf,za1,za2,za3,za4,za5) \
- fprintf(stderr,zf,za1,za2,za3,za4,za5)
-#else
-extern void bz_internal_error ( int errcode );
-#define AssertH(cond,errcode) \
- { if (!(cond)) bz_internal_error ( errcode ); }
-#define AssertD(cond,msg) /* */
-#define VPrintf0(zf) /* */
-#define VPrintf1(zf,za1) /* */
-#define VPrintf2(zf,za1,za2) /* */
-#define VPrintf3(zf,za1,za2,za3) /* */
-#define VPrintf4(zf,za1,za2,za3,za4) /* */
-#define VPrintf5(zf,za1,za2,za3,za4,za5) /* */
-#endif
-
-
-#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)
-#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp))
-
-
-/*-- Constants for the back end. --*/
-
-#define BZ_MAX_ALPHA_SIZE 258
-#define BZ_MAX_CODE_LEN 23
-
-#define BZ_RUNA 0
-#define BZ_RUNB 1
-
-#define BZ_N_GROUPS 6
-#define BZ_G_SIZE 50
-#define BZ_N_ITERS 4
-
-#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))
-
-
-
-/*-- Stuff for randomising repetitive blocks. --*/
-
-extern Int32 BZ2_rNums[512];
-
-#define BZ_RAND_DECLS \
- Int32 rNToGo; \
- Int32 rTPos \
-
-#define BZ_RAND_INIT_MASK \
- s->rNToGo = 0; \
- s->rTPos = 0 \
-
-#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0)
-
-#define BZ_RAND_UPD_MASK \
- if (s->rNToGo == 0) { \
- s->rNToGo = BZ2_rNums[s->rTPos]; \
- s->rTPos++; \
- if (s->rTPos == 512) s->rTPos = 0; \
- } \
- s->rNToGo--;
-
-
-
-/*-- Stuff for doing CRCs. --*/
-
-extern UInt32 BZ2_crc32Table[256];
-
-#define BZ_INITIALISE_CRC(crcVar) \
-{ \
- crcVar = 0xffffffffL; \
-}
-
-#define BZ_FINALISE_CRC(crcVar) \
-{ \
- crcVar = ~(crcVar); \
-}
-
-#define BZ_UPDATE_CRC(crcVar,cha) \
-{ \
- crcVar = (crcVar << 8) ^ \
- BZ2_crc32Table[(crcVar >> 24) ^ \
- ((UChar)cha)]; \
-}
-
-
-
-/*-- States and modes for compression. --*/
-
-#define BZ_M_IDLE 1
-#define BZ_M_RUNNING 2
-#define BZ_M_FLUSHING 3
-#define BZ_M_FINISHING 4
-
-#define BZ_S_OUTPUT 1
-#define BZ_S_INPUT 2
-
-#define BZ_N_RADIX 2
-#define BZ_N_QSORT 12
-#define BZ_N_SHELL 18
-#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)
-
-
-
-
-/*-- Structure holding all the compression-side stuff. --*/
-
-typedef
- struct {
- /* pointer back to the struct bz_stream */
- bz_stream* strm;
-
- /* mode this stream is in, and whether inputting */
- /* or outputting data */
- Int32 mode;
- Int32 state;
-
- /* remembers avail_in when flush/finish requested */
- UInt32 avail_in_expect;
-
- /* for doing the block sorting */
- UInt32* arr1;
- UInt32* arr2;
- UInt32* ftab;
- Int32 origPtr;
-
- /* aliases for arr1 and arr2 */
- UInt32* ptr;
- UChar* block;
- UInt16* mtfv;
- UChar* zbits;
-
- /* for deciding when to use the fallback sorting algorithm */
- Int32 workFactor;
-
- /* run-length-encoding of the input */
- UInt32 state_in_ch;
- Int32 state_in_len;
- BZ_RAND_DECLS;
-
- /* input and output limits and current posns */
- Int32 nblock;
- Int32 nblockMAX;
- Int32 numZ;
- Int32 state_out_pos;
-
- /* map of bytes used in block */
- Int32 nInUse;
- Bool inUse[256];
- UChar unseqToSeq[256];
-
- /* the buffer for bit stream creation */
- UInt32 bsBuff;
- Int32 bsLive;
-
- /* block and combined CRCs */
- UInt32 blockCRC;
- UInt32 combinedCRC;
-
- /* misc administratium */
- Int32 verbosity;
- Int32 blockNo;
- Int32 blockSize100k;
-
- /* stuff for coding the MTF values */
- Int32 nMTF;
- Int32 mtfFreq [BZ_MAX_ALPHA_SIZE];
- UChar selector [BZ_MAX_SELECTORS];
- UChar selectorMtf[BZ_MAX_SELECTORS];
-
- UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- /* second dimension: only 3 needed; 4 makes index calculations faster */
- UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4];
-
- }
- EState;
-
-
-
-/*-- externs for compression. --*/
-
-extern void
-BZ2_blockSort ( EState* );
-
-extern void
-BZ2_compressBlock ( EState*, Bool );
-
-extern void
-BZ2_bsInitWrite ( EState* );
-
-extern void
-BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
-
-extern void
-BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
-
-
-
-/*-- states for decompression. --*/
-
-#define BZ_X_IDLE 1
-#define BZ_X_OUTPUT 2
-
-#define BZ_X_MAGIC_1 10
-#define BZ_X_MAGIC_2 11
-#define BZ_X_MAGIC_3 12
-#define BZ_X_MAGIC_4 13
-#define BZ_X_BLKHDR_1 14
-#define BZ_X_BLKHDR_2 15
-#define BZ_X_BLKHDR_3 16
-#define BZ_X_BLKHDR_4 17
-#define BZ_X_BLKHDR_5 18
-#define BZ_X_BLKHDR_6 19
-#define BZ_X_BCRC_1 20
-#define BZ_X_BCRC_2 21
-#define BZ_X_BCRC_3 22
-#define BZ_X_BCRC_4 23
-#define BZ_X_RANDBIT 24
-#define BZ_X_ORIGPTR_1 25
-#define BZ_X_ORIGPTR_2 26
-#define BZ_X_ORIGPTR_3 27
-#define BZ_X_MAPPING_1 28
-#define BZ_X_MAPPING_2 29
-#define BZ_X_SELECTOR_1 30
-#define BZ_X_SELECTOR_2 31
-#define BZ_X_SELECTOR_3 32
-#define BZ_X_CODING_1 33
-#define BZ_X_CODING_2 34
-#define BZ_X_CODING_3 35
-#define BZ_X_MTF_1 36
-#define BZ_X_MTF_2 37
-#define BZ_X_MTF_3 38
-#define BZ_X_MTF_4 39
-#define BZ_X_MTF_5 40
-#define BZ_X_MTF_6 41
-#define BZ_X_ENDHDR_2 42
-#define BZ_X_ENDHDR_3 43
-#define BZ_X_ENDHDR_4 44
-#define BZ_X_ENDHDR_5 45
-#define BZ_X_ENDHDR_6 46
-#define BZ_X_CCRC_1 47
-#define BZ_X_CCRC_2 48
-#define BZ_X_CCRC_3 49
-#define BZ_X_CCRC_4 50
-
-
-
-/*-- Constants for the fast MTF decoder. --*/
-
-#define MTFA_SIZE 4096
-#define MTFL_SIZE 16
-
-
-
-/*-- Structure holding all the decompression-side stuff. --*/
-
-typedef
- struct {
- /* pointer back to the struct bz_stream */
- bz_stream* strm;
-
- /* state indicator for this stream */
- Int32 state;
-
- /* for doing the final run-length decoding */
- UChar state_out_ch;
- Int32 state_out_len;
- Bool blockRandomised;
- BZ_RAND_DECLS;
-
- /* the buffer for bit stream reading */
- UInt32 bsBuff;
- Int32 bsLive;
-
- /* misc administratium */
- Int32 blockSize100k;
- Bool smallDecompress;
- Int32 currBlockNo;
- Int32 verbosity;
-
- /* for undoing the Burrows-Wheeler transform */
- Int32 origPtr;
- UInt32 tPos;
- Int32 k0;
- Int32 unzftab[256];
- Int32 nblock_used;
- Int32 cftab[257];
- Int32 cftabCopy[257];
-
- /* for undoing the Burrows-Wheeler transform (FAST) */
- UInt32 *tt;
-
- /* for undoing the Burrows-Wheeler transform (SMALL) */
- UInt16 *ll16;
- UChar *ll4;
-
- /* stored and calculated CRCs */
- UInt32 storedBlockCRC;
- UInt32 storedCombinedCRC;
- UInt32 calculatedBlockCRC;
- UInt32 calculatedCombinedCRC;
-
- /* map of bytes used in block */
- Int32 nInUse;
- Bool inUse[256];
- Bool inUse16[16];
- UChar seqToUnseq[256];
-
- /* for decoding the MTF values */
- UChar mtfa [MTFA_SIZE];
- Int32 mtfbase[256 / MTFL_SIZE];
- UChar selector [BZ_MAX_SELECTORS];
- UChar selectorMtf[BZ_MAX_SELECTORS];
- UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
-
- Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 minLens[BZ_N_GROUPS];
-
- /* save area for scalars in the main decompress code */
- Int32 save_i;
- Int32 save_j;
- Int32 save_t;
- Int32 save_alphaSize;
- Int32 save_nGroups;
- Int32 save_nSelectors;
- Int32 save_EOB;
- Int32 save_groupNo;
- Int32 save_groupPos;
- Int32 save_nextSym;
- Int32 save_nblockMAX;
- Int32 save_nblock;
- Int32 save_es;
- Int32 save_N;
- Int32 save_curr;
- Int32 save_zt;
- Int32 save_zn;
- Int32 save_zvec;
- Int32 save_zj;
- Int32 save_gSel;
- Int32 save_gMinlen;
- Int32* save_gLimit;
- Int32* save_gBase;
- Int32* save_gPerm;
-
- }
- DState;
-
-
-
-/*-- Macros for decompression. --*/
-
-#define BZ_GET_FAST(cccc) \
- s->tPos = s->tt[s->tPos]; \
- cccc = (UChar)(s->tPos & 0xff); \
- s->tPos >>= 8;
-
-#define BZ_GET_FAST_C(cccc) \
- c_tPos = c_tt[c_tPos]; \
- cccc = (UChar)(c_tPos & 0xff); \
- c_tPos >>= 8;
-
-#define SET_LL4(i,n) \
- { if (((i) & 0x1) == 0) \
- s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \
- s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \
- }
-
-#define GET_LL4(i) \
- ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF)
-
-#define SET_LL(i,n) \
- { s->ll16[i] = (UInt16)(n & 0x0000ffff); \
- SET_LL4(i, n >> 16); \
- }
-
-#define GET_LL(i) \
- (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
-
-#define BZ_GET_SMALL(cccc) \
- cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
- s->tPos = GET_LL(s->tPos);
-
-
-/*-- externs for decompression. --*/
-
-extern Int32
-BZ2_indexIntoF ( Int32, Int32* );
-
-extern Int32
-BZ2_decompress ( DState* );
-
-extern void
-BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
- Int32, Int32, Int32 );
-
-
-#endif
-
-
-/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
-
-#ifdef BZ_NO_STDIO
-#ifndef NULL
-#define NULL 0
-#endif
-#endif
-
-
-/*-------------------------------------------------------------*/
-/*--- end bzlib_private.h ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/compress.c b/mdk-stage1/bzlib/compress.c
deleted file mode 100644
index 58d5abe7c..000000000
--- a/mdk-stage1/bzlib/compress.c
+++ /dev/null
@@ -1,720 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Compression machinery (not incl block sorting) ---*/
-/*--- compress.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-/*--
- CHANGES
- ~~~~~~~
- 0.9.0 -- original version.
-
- 0.9.0a/b -- no changes in this file.
-
- 0.9.0c
- * changed setting of nGroups in sendMTFValues() so as to
- do a bit better on small files
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-
-#include "bzlib_private.h"
-
-
-/*---------------------------------------------------*/
-/*--- Bit stream I/O ---*/
-/*---------------------------------------------------*/
-
-/*---------------------------------------------------*/
-void BZ2_bsInitWrite ( EState* s )
-{
- s->bsLive = 0;
- s->bsBuff = 0;
-}
-
-
-/*---------------------------------------------------*/
-static
-void bsFinishWrite ( EState* s )
-{
- while (s->bsLive > 0) {
- s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24);
- s->numZ++;
- s->bsBuff <<= 8;
- s->bsLive -= 8;
- }
-}
-
-
-/*---------------------------------------------------*/
-#define bsNEEDW(nz) \
-{ \
- while (s->bsLive >= 8) { \
- s->zbits[s->numZ] \
- = (UChar)(s->bsBuff >> 24); \
- s->numZ++; \
- s->bsBuff <<= 8; \
- s->bsLive -= 8; \
- } \
-}
-
-
-/*---------------------------------------------------*/
-static
-__inline__
-void bsW ( EState* s, Int32 n, UInt32 v )
-{
- bsNEEDW ( n );
- s->bsBuff |= (v << (32 - s->bsLive - n));
- s->bsLive += n;
-}
-
-
-/*---------------------------------------------------*/
-static
-void bsPutUInt32 ( EState* s, UInt32 u )
-{
- bsW ( s, 8, (u >> 24) & 0xffL );
- bsW ( s, 8, (u >> 16) & 0xffL );
- bsW ( s, 8, (u >> 8) & 0xffL );
- bsW ( s, 8, u & 0xffL );
-}
-
-
-/*---------------------------------------------------*/
-static
-void bsPutUChar ( EState* s, UChar c )
-{
- bsW( s, 8, (UInt32)c );
-}
-
-
-/*---------------------------------------------------*/
-/*--- The back end proper ---*/
-/*---------------------------------------------------*/
-
-/*---------------------------------------------------*/
-static
-void makeMaps_e ( EState* s )
-{
- Int32 i;
- s->nInUse = 0;
- for (i = 0; i < 256; i++)
- if (s->inUse[i]) {
- s->unseqToSeq[i] = s->nInUse;
- s->nInUse++;
- }
-}
-
-
-/*---------------------------------------------------*/
-static
-void generateMTFValues ( EState* s )
-{
- UChar yy[256];
- Int32 i, j;
- Int32 zPend;
- Int32 wr;
- Int32 EOB;
-
- /*
- After sorting (eg, here),
- s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
- and
- ((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
- holds the original block data.
-
- The first thing to do is generate the MTF values,
- and put them in
- ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ].
- Because there are strictly fewer or equal MTF values
- than block values, ptr values in this area are overwritten
- with MTF values only when they are no longer needed.
-
- The final compressed bitstream is generated into the
- area starting at
- (UChar*) (&((UChar*)s->arr2)[s->nblock])
-
- These storage aliases are set up in bzCompressInit(),
- except for the last one, which is arranged in
- compressBlock().
- */
- UInt32* ptr = s->ptr;
- UChar* block = s->block;
- UInt16* mtfv = s->mtfv;
-
- makeMaps_e ( s );
- EOB = s->nInUse+1;
-
- for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0;
-
- wr = 0;
- zPend = 0;
- for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i;
-
- for (i = 0; i < s->nblock; i++) {
- UChar ll_i;
- AssertD ( wr <= i, "generateMTFValues(1)" );
- j = ptr[i]-1; if (j < 0) j += s->nblock;
- ll_i = s->unseqToSeq[block[j]];
- AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
-
- if (yy[0] == ll_i) {
- zPend++;
- } else {
-
- if (zPend > 0) {
- zPend--;
- while (True) {
- if (zPend & 1) {
- mtfv[wr] = BZ_RUNB; wr++;
- s->mtfFreq[BZ_RUNB]++;
- } else {
- mtfv[wr] = BZ_RUNA; wr++;
- s->mtfFreq[BZ_RUNA]++;
- }
- if (zPend < 2) break;
- zPend = (zPend - 2) / 2;
- };
- zPend = 0;
- }
- {
- register UChar rtmp;
- register UChar* ryy_j;
- register UChar rll_i;
- rtmp = yy[1];
- yy[1] = yy[0];
- ryy_j = &(yy[1]);
- rll_i = ll_i;
- while ( rll_i != rtmp ) {
- register UChar rtmp2;
- ryy_j++;
- rtmp2 = rtmp;
- rtmp = *ryy_j;
- *ryy_j = rtmp2;
- };
- yy[0] = rtmp;
- j = ryy_j - &(yy[0]);
- mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++;
- }
-
- }
- }
-
- if (zPend > 0) {
- zPend--;
- while (True) {
- if (zPend & 1) {
- mtfv[wr] = BZ_RUNB; wr++;
- s->mtfFreq[BZ_RUNB]++;
- } else {
- mtfv[wr] = BZ_RUNA; wr++;
- s->mtfFreq[BZ_RUNA]++;
- }
- if (zPend < 2) break;
- zPend = (zPend - 2) / 2;
- };
- zPend = 0;
- }
-
- mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;
-
- s->nMTF = wr;
-}
-
-
-/*---------------------------------------------------*/
-#define BZ_LESSER_ICOST 0
-#define BZ_GREATER_ICOST 15
-
-static
-void sendMTFValues ( EState* s )
-{
- Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
- Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;
- Int32 nGroups, nBytes;
-
- /*--
- UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- is a global since the decoder also needs it.
-
- Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
- are also globals only used in this proc.
- Made global to keep stack frame size small.
- --*/
-
-
- UInt16 cost[BZ_N_GROUPS];
- Int32 fave[BZ_N_GROUPS];
-
- UInt16* mtfv = s->mtfv;
-
- if (s->verbosity >= 3)
- VPrintf3( " %d in block, %d after MTF & 1-2 coding, "
- "%d+2 syms in use\n",
- s->nblock, s->nMTF, s->nInUse );
-
- alphaSize = s->nInUse+2;
- for (t = 0; t < BZ_N_GROUPS; t++)
- for (v = 0; v < alphaSize; v++)
- s->len[t][v] = BZ_GREATER_ICOST;
-
- /*--- Decide how many coding tables to use ---*/
- AssertH ( s->nMTF > 0, 3001 );
- if (s->nMTF < 200) nGroups = 2; else
- if (s->nMTF < 600) nGroups = 3; else
- if (s->nMTF < 1200) nGroups = 4; else
- if (s->nMTF < 2400) nGroups = 5; else
- nGroups = 6;
-
- /*--- Generate an initial set of coding tables ---*/
- {
- Int32 nPart, remF, tFreq, aFreq;
-
- nPart = nGroups;
- remF = s->nMTF;
- gs = 0;
- while (nPart > 0) {
- tFreq = remF / nPart;
- ge = gs-1;
- aFreq = 0;
- while (aFreq < tFreq && ge < alphaSize-1) {
- ge++;
- aFreq += s->mtfFreq[ge];
- }
-
- if (ge > gs
- && nPart != nGroups && nPart != 1
- && ((nGroups-nPart) % 2 == 1)) {
- aFreq -= s->mtfFreq[ge];
- ge--;
- }
-
- if (s->verbosity >= 3)
- VPrintf5( " initial group %d, [%d .. %d], "
- "has %d syms (%4.1f%%)\n",
- nPart, gs, ge, aFreq,
- (100.0 * (float)aFreq) / (float)(s->nMTF) );
-
- for (v = 0; v < alphaSize; v++)
- if (v >= gs && v <= ge)
- s->len[nPart-1][v] = BZ_LESSER_ICOST; else
- s->len[nPart-1][v] = BZ_GREATER_ICOST;
-
- nPart--;
- gs = ge+1;
- remF -= aFreq;
- }
- }
-
- /*---
- Iterate up to BZ_N_ITERS times to improve the tables.
- ---*/
- for (iter = 0; iter < BZ_N_ITERS; iter++) {
-
- for (t = 0; t < nGroups; t++) fave[t] = 0;
-
- for (t = 0; t < nGroups; t++)
- for (v = 0; v < alphaSize; v++)
- s->rfreq[t][v] = 0;
-
- /*---
- Set up an auxiliary length table which is used to fast-track
- the common case (nGroups == 6).
- ---*/
- if (nGroups == 6) {
- for (v = 0; v < alphaSize; v++) {
- s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];
- s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];
- s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];
- }
- }
-
- nSelectors = 0;
- totc = 0;
- gs = 0;
- while (True) {
-
- /*--- Set group start & end marks. --*/
- if (gs >= s->nMTF) break;
- ge = gs + BZ_G_SIZE - 1;
- if (ge >= s->nMTF) ge = s->nMTF-1;
-
- /*--
- Calculate the cost of this group as coded
- by each of the coding tables.
- --*/
- for (t = 0; t < nGroups; t++) cost[t] = 0;
-
- if (nGroups == 6 && 50 == ge-gs+1) {
- /*--- fast track the common case ---*/
- register UInt32 cost01, cost23, cost45;
- register UInt16 icv;
- cost01 = cost23 = cost45 = 0;
-
-# define BZ_ITER(nn) \
- icv = mtfv[gs+(nn)]; \
- cost01 += s->len_pack[icv][0]; \
- cost23 += s->len_pack[icv][1]; \
- cost45 += s->len_pack[icv][2]; \
-
- BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4);
- BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9);
- BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14);
- BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19);
- BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24);
- BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29);
- BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34);
- BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39);
- BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44);
- BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49);
-
-# undef BZ_ITER
-
- cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16;
- cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16;
- cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;
-
- } else {
- /*--- slow version which correctly handles all situations ---*/
- for (i = gs; i <= ge; i++) {
- UInt16 icv = mtfv[i];
- for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
- }
- }
-
- /*--
- Find the coding table which is best for this group,
- and record its identity in the selector table.
- --*/
- bc = 999999999; bt = -1;
- for (t = 0; t < nGroups; t++)
- if (cost[t] < bc) { bc = cost[t]; bt = t; };
- totc += bc;
- fave[bt]++;
- s->selector[nSelectors] = bt;
- nSelectors++;
-
- /*--
- Increment the symbol frequencies for the selected table.
- --*/
- if (nGroups == 6 && 50 == ge-gs+1) {
- /*--- fast track the common case ---*/
-
-# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++
-
- BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4);
- BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9);
- BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14);
- BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19);
- BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24);
- BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29);
- BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34);
- BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39);
- BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44);
- BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49);
-
-# undef BZ_ITUR
-
- } else {
- /*--- slow version which correctly handles all situations ---*/
- for (i = gs; i <= ge; i++)
- s->rfreq[bt][ mtfv[i] ]++;
- }
-
- gs = ge+1;
- }
- if (s->verbosity >= 3) {
- VPrintf2 ( " pass %d: size is %d, grp uses are ",
- iter+1, totc/8 );
- for (t = 0; t < nGroups; t++)
- VPrintf1 ( "%d ", fave[t] );
- VPrintf0 ( "\n" );
- }
-
- /*--
- Recompute the tables based on the accumulated frequencies.
- --*/
- for (t = 0; t < nGroups; t++)
- BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
- alphaSize, 20 );
- }
-
-
- AssertH( nGroups < 8, 3002 );
- AssertH( nSelectors < 32768 &&
- nSelectors <= (2 + (900000 / BZ_G_SIZE)),
- 3003 );
-
-
- /*--- Compute MTF values for the selectors. ---*/
- {
- UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;
- for (i = 0; i < nGroups; i++) pos[i] = i;
- for (i = 0; i < nSelectors; i++) {
- ll_i = s->selector[i];
- j = 0;
- tmp = pos[j];
- while ( ll_i != tmp ) {
- j++;
- tmp2 = tmp;
- tmp = pos[j];
- pos[j] = tmp2;
- };
- pos[0] = tmp;
- s->selectorMtf[i] = j;
- }
- };
-
- /*--- Assign actual codes for the tables. --*/
- for (t = 0; t < nGroups; t++) {
- minLen = 32;
- maxLen = 0;
- for (i = 0; i < alphaSize; i++) {
- if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
- if (s->len[t][i] < minLen) minLen = s->len[t][i];
- }
- AssertH ( !(maxLen > 20), 3004 );
- AssertH ( !(minLen < 1), 3005 );
- BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
- minLen, maxLen, alphaSize );
- }
-
- /*--- Transmit the mapping table. ---*/
- {
- Bool inUse16[16];
- for (i = 0; i < 16; i++) {
- inUse16[i] = False;
- for (j = 0; j < 16; j++)
- if (s->inUse[i * 16 + j]) inUse16[i] = True;
- }
-
- nBytes = s->numZ;
- for (i = 0; i < 16; i++)
- if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
-
- for (i = 0; i < 16; i++)
- if (inUse16[i])
- for (j = 0; j < 16; j++) {
- if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
- }
-
- if (s->verbosity >= 3)
- VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes );
- }
-
- /*--- Now the selectors. ---*/
- nBytes = s->numZ;
- bsW ( s, 3, nGroups );
- bsW ( s, 15, nSelectors );
- for (i = 0; i < nSelectors; i++) {
- for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
- bsW(s,1,0);
- }
- if (s->verbosity >= 3)
- VPrintf1( "selectors %d, ", s->numZ-nBytes );
-
- /*--- Now the coding tables. ---*/
- nBytes = s->numZ;
-
- for (t = 0; t < nGroups; t++) {
- Int32 curr = s->len[t][0];
- bsW ( s, 5, curr );
- for (i = 0; i < alphaSize; i++) {
- while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ };
- while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ };
- bsW ( s, 1, 0 );
- }
- }
-
- if (s->verbosity >= 3)
- VPrintf1 ( "code lengths %d, ", s->numZ-nBytes );
-
- /*--- And finally, the block data proper ---*/
- nBytes = s->numZ;
- selCtr = 0;
- gs = 0;
- while (True) {
- if (gs >= s->nMTF) break;
- ge = gs + BZ_G_SIZE - 1;
- if (ge >= s->nMTF) ge = s->nMTF-1;
- AssertH ( s->selector[selCtr] < nGroups, 3006 );
-
- if (nGroups == 6 && 50 == ge-gs+1) {
- /*--- fast track the common case ---*/
- UInt16 mtfv_i;
- UChar* s_len_sel_selCtr
- = &(s->len[s->selector[selCtr]][0]);
- Int32* s_code_sel_selCtr
- = &(s->code[s->selector[selCtr]][0]);
-
-# define BZ_ITAH(nn) \
- mtfv_i = mtfv[gs+(nn)]; \
- bsW ( s, \
- s_len_sel_selCtr[mtfv_i], \
- s_code_sel_selCtr[mtfv_i] )
-
- BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4);
- BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9);
- BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14);
- BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19);
- BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24);
- BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29);
- BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34);
- BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39);
- BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44);
- BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49);
-
-# undef BZ_ITAH
-
- } else {
- /*--- slow version which correctly handles all situations ---*/
- for (i = gs; i <= ge; i++) {
- bsW ( s,
- s->len [s->selector[selCtr]] [mtfv[i]],
- s->code [s->selector[selCtr]] [mtfv[i]] );
- }
- }
-
-
- gs = ge+1;
- selCtr++;
- }
- AssertH( selCtr == nSelectors, 3007 );
-
- if (s->verbosity >= 3)
- VPrintf1( "codes %d\n", s->numZ-nBytes );
-}
-
-
-/*---------------------------------------------------*/
-void BZ2_compressBlock ( EState* s, Bool is_last_block )
-{
- if (s->nblock > 0) {
-
- BZ_FINALISE_CRC ( s->blockCRC );
- s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
- s->combinedCRC ^= s->blockCRC;
- if (s->blockNo > 1) s->numZ = 0;
-
- if (s->verbosity >= 2)
- VPrintf4( " block %d: crc = 0x%8x, "
- "combined CRC = 0x%8x, size = %d\n",
- s->blockNo, s->blockCRC, s->combinedCRC, s->nblock );
-
- BZ2_blockSort ( s );
- }
-
- s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]);
-
- /*-- If this is the first block, create the stream header. --*/
- if (s->blockNo == 1) {
- BZ2_bsInitWrite ( s );
- bsPutUChar ( s, 'B' );
- bsPutUChar ( s, 'Z' );
- bsPutUChar ( s, 'h' );
- bsPutUChar ( s, (UChar)('0' + s->blockSize100k) );
- }
-
- if (s->nblock > 0) {
-
- bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 );
- bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 );
- bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 );
-
- /*-- Now the block's CRC, so it is in a known place. --*/
- bsPutUInt32 ( s, s->blockCRC );
-
- /*--
- Now a single bit indicating (non-)randomisation.
- As of version 0.9.5, we use a better sorting algorithm
- which makes randomisation unnecessary. So always set
- the randomised bit to 'no'. Of course, the decoder
- still needs to be able to handle randomised blocks
- so as to maintain backwards compatibility with
- older versions of bzip2.
- --*/
- bsW(s,1,0);
-
- bsW ( s, 24, s->origPtr );
- generateMTFValues ( s );
- sendMTFValues ( s );
- }
-
-
- /*-- If this is the last block, add the stream trailer. --*/
- if (is_last_block) {
-
- bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 );
- bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 );
- bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 );
- bsPutUInt32 ( s, s->combinedCRC );
- if (s->verbosity >= 2)
- VPrintf1( " final combined CRC = 0x%x\n ", s->combinedCRC );
- bsFinishWrite ( s );
- }
-}
-
-
-/*-------------------------------------------------------------*/
-/*--- end compress.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/crctable.c b/mdk-stage1/bzlib/crctable.c
deleted file mode 100644
index c0ea3f769..000000000
--- a/mdk-stage1/bzlib/crctable.c
+++ /dev/null
@@ -1,148 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Table for doing CRCs ---*/
-/*--- crctable.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "bzlib_private.h"
-
-/*--
- I think this is an implementation of the AUTODIN-II,
- Ethernet & FDDI 32-bit CRC standard. Vaguely derived
- from code by Rob Warnock, in Section 51 of the
- comp.compression FAQ.
---*/
-
-UInt32 BZ2_crc32Table[256] = {
-
- /*-- Ugly, innit? --*/
-
- 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,
- 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,
- 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,
- 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,
- 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,
- 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,
- 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,
- 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,
- 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,
- 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,
- 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,
- 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,
- 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,
- 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,
- 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,
- 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,
- 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,
- 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,
- 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,
- 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,
- 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,
- 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,
- 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,
- 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,
- 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,
- 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,
- 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,
- 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,
- 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,
- 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,
- 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,
- 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,
- 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,
- 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,
- 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,
- 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,
- 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,
- 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,
- 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,
- 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,
- 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,
- 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,
- 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,
- 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,
- 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,
- 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,
- 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,
- 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,
- 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,
- 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,
- 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,
- 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,
- 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,
- 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,
- 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,
- 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,
- 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,
- 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,
- 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,
- 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,
- 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,
- 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,
- 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,
- 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L
-};
-
-
-/*-------------------------------------------------------------*/
-/*--- end crctable.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/decompress.c b/mdk-stage1/bzlib/decompress.c
deleted file mode 100644
index 65cf75d8f..000000000
--- a/mdk-stage1/bzlib/decompress.c
+++ /dev/null
@@ -1,664 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Decompression machinery ---*/
-/*--- decompress.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "bzlib_private.h"
-
-
-/*---------------------------------------------------*/
-static
-void makeMaps_d ( DState* s )
-{
- Int32 i;
- s->nInUse = 0;
- for (i = 0; i < 256; i++)
- if (s->inUse[i]) {
- s->seqToUnseq[s->nInUse] = i;
- s->nInUse++;
- }
-}
-
-
-/*---------------------------------------------------*/
-#define RETURN(rrr) \
- { retVal = rrr; goto save_state_and_return; };
-
-#define GET_BITS(lll,vvv,nnn) \
- case lll: s->state = lll; \
- while (True) { \
- if (s->bsLive >= nnn) { \
- UInt32 v; \
- v = (s->bsBuff >> \
- (s->bsLive-nnn)) & ((1 << nnn)-1); \
- s->bsLive -= nnn; \
- vvv = v; \
- break; \
- } \
- if (s->strm->avail_in == 0) RETURN(BZ_OK); \
- s->bsBuff \
- = (s->bsBuff << 8) | \
- ((UInt32) \
- (*((UChar*)(s->strm->next_in)))); \
- s->bsLive += 8; \
- s->strm->next_in++; \
- s->strm->avail_in--; \
- s->strm->total_in_lo32++; \
- if (s->strm->total_in_lo32 == 0) \
- s->strm->total_in_hi32++; \
- }
-
-#define GET_UCHAR(lll,uuu) \
- GET_BITS(lll,uuu,8)
-
-#define GET_BIT(lll,uuu) \
- GET_BITS(lll,uuu,1)
-
-/*---------------------------------------------------*/
-#define GET_MTF_VAL(label1,label2,lval) \
-{ \
- if (groupPos == 0) { \
- groupNo++; \
- if (groupNo >= nSelectors) \
- RETURN(BZ_DATA_ERROR); \
- groupPos = BZ_G_SIZE; \
- gSel = s->selector[groupNo]; \
- gMinlen = s->minLens[gSel]; \
- gLimit = &(s->limit[gSel][0]); \
- gPerm = &(s->perm[gSel][0]); \
- gBase = &(s->base[gSel][0]); \
- } \
- groupPos--; \
- zn = gMinlen; \
- GET_BITS(label1, zvec, zn); \
- while (1) { \
- if (zn > 20 /* the longest code */) \
- RETURN(BZ_DATA_ERROR); \
- if (zvec <= gLimit[zn]) break; \
- zn++; \
- GET_BIT(label2, zj); \
- zvec = (zvec << 1) | zj; \
- }; \
- if (zvec - gBase[zn] < 0 \
- || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \
- RETURN(BZ_DATA_ERROR); \
- lval = gPerm[zvec - gBase[zn]]; \
-}
-
-
-/*---------------------------------------------------*/
-Int32 BZ2_decompress ( DState* s )
-{
- UChar uc;
- Int32 retVal;
- Int32 minLen, maxLen;
- bz_stream* strm = s->strm;
-
- /* stuff that needs to be saved/restored */
- Int32 i;
- Int32 j;
- Int32 t;
- Int32 alphaSize;
- Int32 nGroups;
- Int32 nSelectors;
- Int32 EOB;
- Int32 groupNo;
- Int32 groupPos;
- Int32 nextSym;
- Int32 nblockMAX;
- Int32 nblock;
- Int32 es;
- Int32 N;
- Int32 curr;
- Int32 zt;
- Int32 zn;
- Int32 zvec;
- Int32 zj;
- Int32 gSel;
- Int32 gMinlen;
- Int32* gLimit;
- Int32* gBase;
- Int32* gPerm;
-
- if (s->state == BZ_X_MAGIC_1) {
- /*initialise the save area*/
- s->save_i = 0;
- s->save_j = 0;
- s->save_t = 0;
- s->save_alphaSize = 0;
- s->save_nGroups = 0;
- s->save_nSelectors = 0;
- s->save_EOB = 0;
- s->save_groupNo = 0;
- s->save_groupPos = 0;
- s->save_nextSym = 0;
- s->save_nblockMAX = 0;
- s->save_nblock = 0;
- s->save_es = 0;
- s->save_N = 0;
- s->save_curr = 0;
- s->save_zt = 0;
- s->save_zn = 0;
- s->save_zvec = 0;
- s->save_zj = 0;
- s->save_gSel = 0;
- s->save_gMinlen = 0;
- s->save_gLimit = NULL;
- s->save_gBase = NULL;
- s->save_gPerm = NULL;
- }
-
- /*restore from the save area*/
- i = s->save_i;
- j = s->save_j;
- t = s->save_t;
- alphaSize = s->save_alphaSize;
- nGroups = s->save_nGroups;
- nSelectors = s->save_nSelectors;
- EOB = s->save_EOB;
- groupNo = s->save_groupNo;
- groupPos = s->save_groupPos;
- nextSym = s->save_nextSym;
- nblockMAX = s->save_nblockMAX;
- nblock = s->save_nblock;
- es = s->save_es;
- N = s->save_N;
- curr = s->save_curr;
- zt = s->save_zt;
- zn = s->save_zn;
- zvec = s->save_zvec;
- zj = s->save_zj;
- gSel = s->save_gSel;
- gMinlen = s->save_gMinlen;
- gLimit = s->save_gLimit;
- gBase = s->save_gBase;
- gPerm = s->save_gPerm;
-
- retVal = BZ_OK;
-
- switch (s->state) {
-
- GET_UCHAR(BZ_X_MAGIC_1, uc);
- if (uc != 'B') RETURN(BZ_DATA_ERROR_MAGIC);
-
- GET_UCHAR(BZ_X_MAGIC_2, uc);
- if (uc != 'Z') RETURN(BZ_DATA_ERROR_MAGIC);
-
- GET_UCHAR(BZ_X_MAGIC_3, uc)
- if (uc != 'h') RETURN(BZ_DATA_ERROR_MAGIC);
-
- GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
- if (s->blockSize100k < '1' ||
- s->blockSize100k > '9') RETURN(BZ_DATA_ERROR_MAGIC);
- s->blockSize100k -= '0';
-
- if (s->smallDecompress) {
- s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
- s->ll4 = BZALLOC(
- ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
- );
- if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
- } else {
- s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
- if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
- }
-
- GET_UCHAR(BZ_X_BLKHDR_1, uc);
-
- if (uc == 0x17) goto endhdr_2;
- if (uc != 0x31) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_BLKHDR_2, uc);
- if (uc != 0x41) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_BLKHDR_3, uc);
- if (uc != 0x59) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_BLKHDR_4, uc);
- if (uc != 0x26) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_BLKHDR_5, uc);
- if (uc != 0x53) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_BLKHDR_6, uc);
- if (uc != 0x59) RETURN(BZ_DATA_ERROR);
-
- s->currBlockNo++;
- if (s->verbosity >= 2)
- VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
-
- s->storedBlockCRC = 0;
- GET_UCHAR(BZ_X_BCRC_1, uc);
- s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_BCRC_2, uc);
- s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_BCRC_3, uc);
- s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_BCRC_4, uc);
- s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
-
- GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);
-
- s->origPtr = 0;
- GET_UCHAR(BZ_X_ORIGPTR_1, uc);
- s->origPtr = (s->origPtr << 8) | ((Int32)uc);
- GET_UCHAR(BZ_X_ORIGPTR_2, uc);
- s->origPtr = (s->origPtr << 8) | ((Int32)uc);
- GET_UCHAR(BZ_X_ORIGPTR_3, uc);
- s->origPtr = (s->origPtr << 8) | ((Int32)uc);
-
- if (s->origPtr < 0)
- RETURN(BZ_DATA_ERROR);
- if (s->origPtr > 10 + 100000*s->blockSize100k)
- RETURN(BZ_DATA_ERROR);
-
- /*--- Receive the mapping table ---*/
- for (i = 0; i < 16; i++) {
- GET_BIT(BZ_X_MAPPING_1, uc);
- if (uc == 1)
- s->inUse16[i] = True; else
- s->inUse16[i] = False;
- }
-
- for (i = 0; i < 256; i++) s->inUse[i] = False;
-
- for (i = 0; i < 16; i++)
- if (s->inUse16[i])
- for (j = 0; j < 16; j++) {
- GET_BIT(BZ_X_MAPPING_2, uc);
- if (uc == 1) s->inUse[i * 16 + j] = True;
- }
- makeMaps_d ( s );
- if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);
- alphaSize = s->nInUse+2;
-
- /*--- Now the selectors ---*/
- GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
- if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
- GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
- if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
- for (i = 0; i < nSelectors; i++) {
- j = 0;
- while (True) {
- GET_BIT(BZ_X_SELECTOR_3, uc);
- if (uc == 0) break;
- j++;
- if (j >= nGroups) RETURN(BZ_DATA_ERROR);
- }
- s->selectorMtf[i] = j;
- }
-
- /*--- Undo the MTF values for the selectors. ---*/
- {
- UChar pos[BZ_N_GROUPS], tmp, v;
- for (v = 0; v < nGroups; v++) pos[v] = v;
-
- for (i = 0; i < nSelectors; i++) {
- v = s->selectorMtf[i];
- tmp = pos[v];
- while (v > 0) { pos[v] = pos[v-1]; v--; }
- pos[0] = tmp;
- s->selector[i] = tmp;
- }
- }
-
- /*--- Now the coding tables ---*/
- for (t = 0; t < nGroups; t++) {
- GET_BITS(BZ_X_CODING_1, curr, 5);
- for (i = 0; i < alphaSize; i++) {
- while (True) {
- if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);
- GET_BIT(BZ_X_CODING_2, uc);
- if (uc == 0) break;
- GET_BIT(BZ_X_CODING_3, uc);
- if (uc == 0) curr++; else curr--;
- }
- s->len[t][i] = curr;
- }
- }
-
- /*--- Create the Huffman decoding tables ---*/
- for (t = 0; t < nGroups; t++) {
- minLen = 32;
- maxLen = 0;
- for (i = 0; i < alphaSize; i++) {
- if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
- if (s->len[t][i] < minLen) minLen = s->len[t][i];
- }
- BZ2_hbCreateDecodeTables (
- &(s->limit[t][0]),
- &(s->base[t][0]),
- &(s->perm[t][0]),
- &(s->len[t][0]),
- minLen, maxLen, alphaSize
- );
- s->minLens[t] = minLen;
- }
-
- /*--- Now the MTF values ---*/
-
- EOB = s->nInUse+1;
- nblockMAX = 100000 * s->blockSize100k;
- groupNo = -1;
- groupPos = 0;
-
- for (i = 0; i <= 255; i++) s->unzftab[i] = 0;
-
- /*-- MTF init --*/
- {
- Int32 ii, jj, kk;
- kk = MTFA_SIZE-1;
- for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {
- for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
- s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);
- kk--;
- }
- s->mtfbase[ii] = kk + 1;
- }
- }
- /*-- end MTF init --*/
-
- nblock = 0;
- GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
-
- while (True) {
-
- if (nextSym == EOB) break;
-
- if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {
-
- es = -1;
- N = 1;
- do {
- if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
- if (nextSym == BZ_RUNB) es = es + (1+1) * N;
- N = N * 2;
- GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
- }
- while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
-
- es++;
- uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];
- s->unzftab[uc] += es;
-
- if (s->smallDecompress)
- while (es > 0) {
- if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
- s->ll16[nblock] = (UInt16)uc;
- nblock++;
- es--;
- }
- else
- while (es > 0) {
- if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
- s->tt[nblock] = (UInt32)uc;
- nblock++;
- es--;
- };
-
- continue;
-
- } else {
-
- if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
-
- /*-- uc = MTF ( nextSym-1 ) --*/
- {
- Int32 ii, jj, kk, pp, lno, off;
- UInt32 nn;
- nn = (UInt32)(nextSym - 1);
-
- if (nn < MTFL_SIZE) {
- /* avoid general-case expense */
- pp = s->mtfbase[0];
- uc = s->mtfa[pp+nn];
- while (nn > 3) {
- Int32 z = pp+nn;
- s->mtfa[(z) ] = s->mtfa[(z)-1];
- s->mtfa[(z)-1] = s->mtfa[(z)-2];
- s->mtfa[(z)-2] = s->mtfa[(z)-3];
- s->mtfa[(z)-3] = s->mtfa[(z)-4];
- nn -= 4;
- }
- while (nn > 0) {
- s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
- };
- s->mtfa[pp] = uc;
- } else {
- /* general case */
- lno = nn / MTFL_SIZE;
- off = nn % MTFL_SIZE;
- pp = s->mtfbase[lno] + off;
- uc = s->mtfa[pp];
- while (pp > s->mtfbase[lno]) {
- s->mtfa[pp] = s->mtfa[pp-1]; pp--;
- };
- s->mtfbase[lno]++;
- while (lno > 0) {
- s->mtfbase[lno]--;
- s->mtfa[s->mtfbase[lno]]
- = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
- lno--;
- }
- s->mtfbase[0]--;
- s->mtfa[s->mtfbase[0]] = uc;
- if (s->mtfbase[0] == 0) {
- kk = MTFA_SIZE-1;
- for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
- for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
- s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
- kk--;
- }
- s->mtfbase[ii] = kk + 1;
- }
- }
- }
- }
- /*-- end uc = MTF ( nextSym-1 ) --*/
-
- s->unzftab[s->seqToUnseq[uc]]++;
- if (s->smallDecompress)
- s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else
- s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
- nblock++;
-
- GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
- continue;
- }
- }
-
- /* Now we know what nblock is, we can do a better sanity
- check on s->origPtr.
- */
- if (s->origPtr < 0 || s->origPtr >= nblock)
- RETURN(BZ_DATA_ERROR);
-
- s->state_out_len = 0;
- s->state_out_ch = 0;
- BZ_INITIALISE_CRC ( s->calculatedBlockCRC );
- s->state = BZ_X_OUTPUT;
- if (s->verbosity >= 2) VPrintf0 ( "rt+rld" );
-
- /*-- Set up cftab to facilitate generation of T^(-1) --*/
- s->cftab[0] = 0;
- for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
- for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
-
- if (s->smallDecompress) {
-
- /*-- Make a copy of cftab, used in generation of T --*/
- for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];
-
- /*-- compute the T vector --*/
- for (i = 0; i < nblock; i++) {
- uc = (UChar)(s->ll16[i]);
- SET_LL(i, s->cftabCopy[uc]);
- s->cftabCopy[uc]++;
- }
-
- /*-- Compute T^(-1) by pointer reversal on T --*/
- i = s->origPtr;
- j = GET_LL(i);
- do {
- Int32 tmp = GET_LL(j);
- SET_LL(j, i);
- i = j;
- j = tmp;
- }
- while (i != s->origPtr);
-
- s->tPos = s->origPtr;
- s->nblock_used = 0;
- if (s->blockRandomised) {
- BZ_RAND_INIT_MASK;
- BZ_GET_SMALL(s->k0); s->nblock_used++;
- BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
- } else {
- BZ_GET_SMALL(s->k0); s->nblock_used++;
- }
-
- } else {
-
- /*-- compute the T^(-1) vector --*/
- for (i = 0; i < nblock; i++) {
- uc = (UChar)(s->tt[i] & 0xff);
- s->tt[s->cftab[uc]] |= (i << 8);
- s->cftab[uc]++;
- }
-
- s->tPos = s->tt[s->origPtr] >> 8;
- s->nblock_used = 0;
- if (s->blockRandomised) {
- BZ_RAND_INIT_MASK;
- BZ_GET_FAST(s->k0); s->nblock_used++;
- BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
- } else {
- BZ_GET_FAST(s->k0); s->nblock_used++;
- }
-
- }
-
- RETURN(BZ_OK);
-
-
-
- endhdr_2:
-
- GET_UCHAR(BZ_X_ENDHDR_2, uc);
- if (uc != 0x72) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_ENDHDR_3, uc);
- if (uc != 0x45) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_ENDHDR_4, uc);
- if (uc != 0x38) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_ENDHDR_5, uc);
- if (uc != 0x50) RETURN(BZ_DATA_ERROR);
- GET_UCHAR(BZ_X_ENDHDR_6, uc);
- if (uc != 0x90) RETURN(BZ_DATA_ERROR);
-
- s->storedCombinedCRC = 0;
- GET_UCHAR(BZ_X_CCRC_1, uc);
- s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_CCRC_2, uc);
- s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_CCRC_3, uc);
- s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
- GET_UCHAR(BZ_X_CCRC_4, uc);
- s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
-
- s->state = BZ_X_IDLE;
- RETURN(BZ_STREAM_END);
-
- default: AssertH ( False, 4001 );
- }
-
- AssertH ( False, 4002 );
-
- save_state_and_return:
-
- s->save_i = i;
- s->save_j = j;
- s->save_t = t;
- s->save_alphaSize = alphaSize;
- s->save_nGroups = nGroups;
- s->save_nSelectors = nSelectors;
- s->save_EOB = EOB;
- s->save_groupNo = groupNo;
- s->save_groupPos = groupPos;
- s->save_nextSym = nextSym;
- s->save_nblockMAX = nblockMAX;
- s->save_nblock = nblock;
- s->save_es = es;
- s->save_N = N;
- s->save_curr = curr;
- s->save_zt = zt;
- s->save_zn = zn;
- s->save_zvec = zvec;
- s->save_zj = zj;
- s->save_gSel = gSel;
- s->save_gMinlen = gMinlen;
- s->save_gLimit = gLimit;
- s->save_gBase = gBase;
- s->save_gPerm = gPerm;
-
- return retVal;
-}
-
-
-/*-------------------------------------------------------------*/
-/*--- end decompress.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/huffman.c b/mdk-stage1/bzlib/huffman.c
deleted file mode 100644
index 8994f0bb9..000000000
--- a/mdk-stage1/bzlib/huffman.c
+++ /dev/null
@@ -1,232 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Huffman coding low-level stuff ---*/
-/*--- huffman.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "bzlib_private.h"
-
-/*---------------------------------------------------*/
-#define WEIGHTOF(zz0) ((zz0) & 0xffffff00)
-#define DEPTHOF(zz1) ((zz1) & 0x000000ff)
-#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3))
-
-#define ADDWEIGHTS(zw1,zw2) \
- (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \
- (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2)))
-
-#define UPHEAP(z) \
-{ \
- Int32 zz, tmp; \
- zz = z; tmp = heap[zz]; \
- while (weight[tmp] < weight[heap[zz >> 1]]) { \
- heap[zz] = heap[zz >> 1]; \
- zz >>= 1; \
- } \
- heap[zz] = tmp; \
-}
-
-#define DOWNHEAP(z) \
-{ \
- Int32 zz, yy, tmp; \
- zz = z; tmp = heap[zz]; \
- while (True) { \
- yy = zz << 1; \
- if (yy > nHeap) break; \
- if (yy < nHeap && \
- weight[heap[yy+1]] < weight[heap[yy]]) \
- yy++; \
- if (weight[tmp] < weight[heap[yy]]) break; \
- heap[zz] = heap[yy]; \
- zz = yy; \
- } \
- heap[zz] = tmp; \
-}
-
-
-/*---------------------------------------------------*/
-void BZ2_hbMakeCodeLengths ( UChar *len,
- Int32 *freq,
- Int32 alphaSize,
- Int32 maxLen )
-{
- /*--
- Nodes and heap entries run from 1. Entry 0
- for both the heap and nodes is a sentinel.
- --*/
- Int32 nNodes, nHeap, n1, n2, i, j, k;
- Bool tooLong;
-
- Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ];
- Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];
- Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ];
-
- for (i = 0; i < alphaSize; i++)
- weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
-
- while (True) {
-
- nNodes = alphaSize;
- nHeap = 0;
-
- heap[0] = 0;
- weight[0] = 0;
- parent[0] = -2;
-
- for (i = 1; i <= alphaSize; i++) {
- parent[i] = -1;
- nHeap++;
- heap[nHeap] = i;
- UPHEAP(nHeap);
- }
-
- AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
-
- while (nHeap > 1) {
- n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
- n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
- nNodes++;
- parent[n1] = parent[n2] = nNodes;
- weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]);
- parent[nNodes] = -1;
- nHeap++;
- heap[nHeap] = nNodes;
- UPHEAP(nHeap);
- }
-
- AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );
-
- tooLong = False;
- for (i = 1; i <= alphaSize; i++) {
- j = 0;
- k = i;
- while (parent[k] >= 0) { k = parent[k]; j++; }
- len[i-1] = j;
- if (j > maxLen) tooLong = True;
- }
-
- if (! tooLong) break;
-
- for (i = 1; i < alphaSize; i++) {
- j = weight[i] >> 8;
- j = 1 + (j / 2);
- weight[i] = j << 8;
- }
- }
-}
-
-
-/*---------------------------------------------------*/
-void BZ2_hbAssignCodes ( Int32 *code,
- UChar *length,
- Int32 minLen,
- Int32 maxLen,
- Int32 alphaSize )
-{
- Int32 n, vec, i;
-
- vec = 0;
- for (n = minLen; n <= maxLen; n++) {
- for (i = 0; i < alphaSize; i++)
- if (length[i] == n) { code[i] = vec; vec++; };
- vec <<= 1;
- }
-}
-
-
-/*---------------------------------------------------*/
-void BZ2_hbCreateDecodeTables ( Int32 *limit,
- Int32 *base,
- Int32 *perm,
- UChar *length,
- Int32 minLen,
- Int32 maxLen,
- Int32 alphaSize )
-{
- Int32 pp, i, j, vec;
-
- pp = 0;
- for (i = minLen; i <= maxLen; i++)
- for (j = 0; j < alphaSize; j++)
- if (length[j] == i) { perm[pp] = j; pp++; };
-
- for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;
- for (i = 0; i < alphaSize; i++) base[length[i]+1]++;
-
- for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
-
- for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;
- vec = 0;
-
- for (i = minLen; i <= maxLen; i++) {
- vec += (base[i+1] - base[i]);
- limit[i] = vec-1;
- vec <<= 1;
- }
- for (i = minLen + 1; i <= maxLen; i++)
- base[i] = ((limit[i-1] + 1) << 1) - base[i];
-}
-
-
-/*-------------------------------------------------------------*/
-/*--- end huffman.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/bzlib/randtable.c b/mdk-stage1/bzlib/randtable.c
deleted file mode 100644
index a1fc82cfb..000000000
--- a/mdk-stage1/bzlib/randtable.c
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/*-------------------------------------------------------------*/
-/*--- Table for randomising repetitive blocks ---*/
-/*--- randtable.c ---*/
-/*-------------------------------------------------------------*/
-
-/*--
- This file is a part of bzip2 and/or libbzip2, a program and
- library for lossless, block-sorting data compression.
-
- Copyright (C) 1996-2000 Julian R Seward. 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. The origin of this software must not be misrepresented; you must
- not claim that you wrote the original software. If you use this
- software in a product, an acknowledgment in the product
- documentation would be appreciated but is not required.
-
- 3. Altered source versions must be plainly marked as such, and must
- not be misrepresented as being the original software.
-
- 4. The name of the author may not be used to endorse or promote
- products derived from this software without specific prior written
- permission.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-
- Julian Seward, Cambridge, UK.
- jseward@acm.org
- bzip2/libbzip2 version 1.0 of 21 March 2000
-
- This program is based on (at least) the work of:
- Mike Burrows
- David Wheeler
- Peter Fenwick
- Alistair Moffat
- Radford Neal
- Ian H. Witten
- Robert Sedgewick
- Jon L. Bentley
-
- For more information on these sources, see the manual.
---*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#include "bzlib_private.h"
-
-
-/*---------------------------------------------*/
-Int32 BZ2_rNums[512] = {
- 619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
- 985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
- 733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
- 419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
- 878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
- 862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
- 150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
- 170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
- 73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
- 909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
- 641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
- 161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
- 382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
- 98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
- 227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
- 469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
- 184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
- 715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
- 951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
- 652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
- 645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
- 609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
- 653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
- 411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
- 170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
- 857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
- 669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
- 944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
- 344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
- 897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
- 433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
- 686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
- 946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
- 978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
- 680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
- 707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
- 297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
- 134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
- 343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
- 140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
- 170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
- 369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
- 804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
- 896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
- 661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
- 768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
- 61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
- 372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
- 780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
- 920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
- 645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
- 936, 638
-};
-
-
-/*-------------------------------------------------------------*/
-/*--- end randtable.c ---*/
-/*-------------------------------------------------------------*/
diff --git a/mdk-stage1/cdrom.c b/mdk-stage1/cdrom.c
deleted file mode 100644
index a6d0ab726..000000000
--- a/mdk-stage1/cdrom.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * Portions from Erik Troan (ewt@redhat.com)
- *
- * Copyright 1996 Red Hat Software
- *
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/mount.h>
-#include "stage1.h"
-#include "frontend.h"
-#include "modules.h"
-#include "probing.h"
-#include "log.h"
-#include "mount.h"
-
-#include "cdrom.h"
-
-
-static int mount_that_cd_device(char * dev_name)
-{
- char device_fullname[50];
-
- strcpy(device_fullname, "/dev/");
- strcat(device_fullname, dev_name);
-
-#ifdef MANDRAKE_MOVE
- return my_mount(device_fullname, IMAGE_LOCATION, "supermount", 0);
-#else
- return my_mount(device_fullname, IMAGE_LOCATION, "iso9660", 0);
-#endif
-}
-
-
-static int test_that_cd()
-{
-#ifdef MANDRAKE_MOVE
- return access(IMAGE_LOCATION "/live_tree.clp", R_OK);
-#else
- return access(IMAGE_LOCATION LIVE_LOCATION, R_OK);
-#endif
-}
-
-
-static enum return_type try_with_device(char * dev_name, char * dev_model);
-
-static enum return_type do_with_device(char * dev_name, char * dev_model)
-{
- if (test_that_cd()) {
- enum return_type results;
- umount(IMAGE_LOCATION);
- results = ask_yes_no("That CDROM disc does not seem to be a " DISTRIB_NAME " Installation CDROM.\nRetry with another disc?");
- if (results == RETURN_OK)
- return try_with_device(dev_name, dev_model);
- return results;
- }
-
- log_message("found a " DISTRIB_NAME " CDROM, good news!");
-
-#ifndef MANDRAKE_MOVE
- if (IS_SPECIAL_STAGE2 || ramdisk_possible())
- load_ramdisk(); /* we don't care about return code, we'll do it live if we failed */
-#endif
-
- if (IS_RESCUE)
- umount(IMAGE_LOCATION);
-
- method_name = strdup("cdrom");
- return RETURN_OK;
-}
-
-static enum return_type try_with_device(char * dev_name, char * dev_model)
-{
- wait_message("Trying to access a CDROM disc (drive %s)", dev_model);
-
- if (mount_that_cd_device(dev_name) == -1) {
- enum return_type results;
- char msg[500];
- unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
- remove_wait_message();
-
- snprintf(msg, sizeof(msg), "I can't access a " DISTRIB_NAME " Installation disc in your CDROM drive (%s).\nRetry?", dev_model);
- results = ask_yes_no(msg);
- if (results == RETURN_OK)
- return try_with_device(dev_name, dev_model);
- return results;
- }
- remove_wait_message();
-
- return do_with_device(dev_name, dev_model);
-}
-
-int try_automatic(char ** medias, char ** medias_models)
-{
- static char * already_tried[50] = { NULL };
- char ** model = medias_models;
- char ** ptr = medias;
- int i = 0;
- while (ptr && *ptr) {
- char ** p;
- for (p = already_tried; p && *p; p++)
- if (streq(*p, *ptr))
- goto try_automatic_already_tried;
- *p = strdup(*ptr);
- *(p+1) = NULL;
-
- wait_message("Trying to access " DISTRIB_NAME " CDROM disc (drive %s)", *model);
- if (mount_that_cd_device(*ptr) != -1) {
- if (!test_that_cd()) {
- remove_wait_message();
- return i;
- }
- else
- umount(IMAGE_LOCATION);
- }
- remove_wait_message();
-
- try_automatic_already_tried:
- ptr++;
- model++;
- i++;
- }
- return -1;
-}
-
-enum return_type cdrom_prepare(void)
-{
- char ** medias, ** ptr, ** medias_models;
- char * choice;
- int i, count = 0;
- enum return_type results;
-
- my_insmod("ide-cd", ANY_DRIVER_TYPE, NULL, 0);
-
- if (IS_AUTOMATIC) {
- get_medias(CDROM, &medias, &medias_models, BUS_IDE);
- if ((i = try_automatic(medias, medias_models)) != -1)
- return do_with_device(medias[i], medias_models[i]);
-
- my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL, 0);
- get_medias(CDROM, &medias, &medias_models, BUS_SCSI);
- if ((i = try_automatic(medias, medias_models)) != -1)
- return do_with_device(medias[i], medias_models[i]);
-
- get_medias(CDROM, &medias, &medias_models, BUS_USB);
- if ((i = try_automatic(medias, medias_models)) != -1)
- return do_with_device(medias[i], medias_models[i]);
-
- unset_param(MODE_AUTOMATIC);
- } else
- my_insmod("sr_mod", ANY_DRIVER_TYPE, NULL, 0);
-
-
- get_medias(CDROM, &medias, &medias_models, BUS_ANY);
- ptr = medias;
- while (ptr && *ptr) {
- count++;
- ptr++;
- }
-
- if (count == 0) {
- stg1_error_message("No CDROM device found.");
- i = ask_insmod(SCSI_ADAPTERS);
- if (i == RETURN_BACK)
- return RETURN_BACK;
- return cdrom_prepare();
- }
-
- if (count == 1) {
- results = try_with_device(*medias, *medias_models);
- if (results == RETURN_OK)
- return RETURN_OK;
- i = ask_insmod(SCSI_ADAPTERS);
- if (i == RETURN_BACK)
- return RETURN_BACK;
- return cdrom_prepare();
- }
-
- results = ask_from_list_comments("Please choose the CDROM drive to use for the installation.", medias, medias_models, &choice);
- if (results == RETURN_OK) {
- char ** model = medias_models;
- ptr = medias;
- while (ptr && *ptr && model && *model) {
- if (!strcmp(*ptr, choice))
- break;
- ptr++;
- model++;
- }
- results = try_with_device(choice, *model);
- } else
- return results;
-
- if (results == RETURN_OK)
- return RETURN_OK;
- if (results == RETURN_BACK)
- return cdrom_prepare();
-
- i = ask_insmod(SCSI_ADAPTERS);
- if (i == RETURN_BACK)
- return RETURN_BACK;
- return cdrom_prepare();
-}
diff --git a/mdk-stage1/cdrom.h b/mdk-stage1/cdrom.h
deleted file mode 100644
index 639487eed..000000000
--- a/mdk-stage1/cdrom.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * Portions from Erik Troan (ewt@redhat.com)
- *
- * Copyright 1996 Red Hat Software
- *
- */
-
-#ifndef _CDROM_H_
-#define _CDROM_H_
-
-#include "stage1.h"
-
-enum return_type cdrom_prepare(void);
-
-#endif
diff --git a/mdk-stage1/config-stage1.h b/mdk-stage1/config-stage1.h
deleted file mode 100644
index 5d42bab1a..000000000
--- a/mdk-stage1/config-stage1.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef _CONFIG_STAGE1_H_
-#define _CONFIG_STAGE1_H_
-
-#define _GNU_SOURCE 1
-
-
-/* If we have more than that amount of memory (in Mbytes), we assume we can load the second stage as a ramdisk */
-#define MEM_LIMIT_RAMDISK 68
-
-/* If we have more than that amount of memory (in Mbytes), we assume we can load the rescue as a ramdisk */
-#define MEM_LIMIT_RESCUE 40
-
-
-#define RAMDISK_COMPRESSION_RATIO 1.95
-
-#define LIVE_LOCATION "/Mandrake/mdkinst/"
-#define RAMDISK_LOCATION "/Mandrake/base/"
-#define STAGE2_LOCATION "/tmp/stage2"
-
-#ifdef MANDRAKE_MOVE
-#define MEM_LIMIT_MOVE 120
-#define DISTRIB_NAME "Mandrakemove"
-#define IMAGE_LOCATION "/sysroot/cdrom"
-#define IMAGE_LOCATION_REAL "/sysroot/image"
-#define SLASH_LOCATION "/sysroot"
-#define RAW_LOCATION_REL "/cdrom"
-#define LIVE_LOCATION_REL "/image"
-#define BOOT_LOCATION "/sysroot/image_boot"
-#define ALWAYS_LOCATION "/sysroot/image_always"
-#define TOTEM_LOCATION "/sysroot/image_totem"
-#else
-#define DISTRIB_NAME "Mandrake Linux"
-#define IMAGE_LOCATION "/tmp/image"
-#define IMAGE_LOCATION_REAL "/tmp/image"
-#endif
-
-
-/* user-definable (in Makefile): DISABLE_NETWORK, DISABLE_DISK, DISABLE_CDROM, DISABLE_PCMCIA */
-
-
-/* some factorizing for disabling more features */
-
-#ifdef DISABLE_DISK
-#ifdef DISABLE_CDROM
-#define DISABLE_MEDIAS
-#endif
-#endif
-
-
-#endif
diff --git a/mdk-stage1/dhcp.c b/mdk-stage1/dhcp.c
deleted file mode 100644
index 3dbefa0bb..000000000
--- a/mdk-stage1/dhcp.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * Portions from Erik Troan (ewt@redhat.com)
- *
- * Copyright 1996 Red Hat Software
- *
- */
-
-/*
- * Portions from GRUB -- GRand Unified Bootloader
- * Copyright (C) 2000 Free Software Foundation, Inc.
- */
-
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <arpa/inet.h>
-#include <net/route.h>
-#include <errno.h>
-#include <net/ethernet.h>
-#include <netinet/ip.h>
-#include <netinet/udp.h>
-#include <sys/time.h>
-#include <time.h>
-#include <fcntl.h>
-#include <sys/poll.h>
-
-#include "stage1.h"
-#include "log.h"
-#include "network.h"
-#include "frontend.h"
-#include "automatic.h"
-
-#include "dhcp.h"
-
-
-typedef int bp_int32;
-typedef short bp_int16;
-
-#define BOOTP_OPTION_NETMASK 1
-#define BOOTP_OPTION_GATEWAY 3
-#define BOOTP_OPTION_DNS 6
-#define BOOTP_OPTION_HOSTNAME 12
-#define BOOTP_OPTION_DOMAIN 15
-#define BOOTP_OPTION_BROADCAST 28
-
-#define DHCP_OPTION_REQADDR 50
-#define DHCP_OPTION_LEASE 51
-#define DHCP_OPTION_TYPE 53
-#define DHCP_OPTION_SERVER 54
-#define DHCP_OPTION_OPTIONREQ 55
-#define DHCP_OPTION_MAXSIZE 57
-
-#define DHCP_OPTION_CLIENT_IDENTIFIER 61
-
-#define BOOTP_CLIENT_PORT 68
-#define BOOTP_SERVER_PORT 67
-
-#define BOOTP_OPCODE_REQUEST 1
-#define BOOTP_OPCODE_REPLY 2
-
-#define DHCP_TYPE_DISCOVER 1
-#define DHCP_TYPE_OFFER 2
-#define DHCP_TYPE_REQUEST 3
-#define DHCP_TYPE_ACK 5
-#define DHCP_TYPE_RELEASE 7
-
-#define BOOTP_VENDOR_LENGTH 64
-#define DHCP_VENDOR_LENGTH 340
-
-struct bootp_request {
- char opcode;
- char hw;
- char hwlength;
- char hopcount;
- bp_int32 id;
- bp_int16 secs;
- bp_int16 flags;
- bp_int32 ciaddr, yiaddr, server_ip, bootp_gw_ip;
- char hwaddr[16];
- char servername[64];
- char bootfile[128];
- char vendor[DHCP_VENDOR_LENGTH];
-} ;
-
-static const char vendor_cookie[] = { 99, 130, 83, 99, 255 };
-
-
-static unsigned int verify_checksum(void * buf2, int length2)
-{
- unsigned int csum = 0;
- unsigned short * sp;
-
- for (sp = (unsigned short *) buf2; length2 > 0; (length2 -= 2), sp++)
- csum += *sp;
-
- while (csum >> 16)
- csum = (csum & 0xffff) + (csum >> 16);
-
- return (csum == 0xffff);
-}
-
-
-static int initial_setup_interface(char * device, int s) {
- struct sockaddr_in * addrp;
- struct ifreq req;
- struct rtentry route;
- int true = 1;
-
- addrp = (struct sockaddr_in *) &req.ifr_addr;
-
- strcpy(req.ifr_name, device);
- addrp->sin_family = AF_INET;
- addrp->sin_port = 0;
- memset(&addrp->sin_addr, 0, sizeof(addrp->sin_addr));
-
- req.ifr_flags = 0; /* take it down */
- if (ioctl(s, SIOCSIFFLAGS, &req)) {
- log_perror("SIOCSIFFLAGS (downing)");
- return -1;
- }
-
- addrp->sin_family = AF_INET;
- addrp->sin_addr.s_addr = htonl(0);
- if (ioctl(s, SIOCSIFADDR, &req)) {
- log_perror("SIOCSIFADDR");
- return -1;
- }
-
- req.ifr_flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING;
- if (ioctl(s, SIOCSIFFLAGS, &req)) {
- log_perror("SIOCSIFFLAGS (upping)");
- return -1;
- }
-
- memset(&route, 0, sizeof(route));
- memcpy(&route.rt_gateway, addrp, sizeof(*addrp));
-
- addrp->sin_family = AF_INET;
- addrp->sin_port = 0;
- addrp->sin_addr.s_addr = INADDR_ANY;
- memcpy(&route.rt_dst, addrp, sizeof(*addrp));
- memcpy(&route.rt_genmask, addrp, sizeof(*addrp));
-
- route.rt_dev = device;
- route.rt_flags = RTF_UP;
- route.rt_metric = 0;
-
- if (ioctl(s, SIOCADDRT, &route)) {
- if (errno != EEXIST) {
- close(s);
- log_perror("SIOCADDRT");
- return -1;
- }
- }
-
- if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &true, sizeof(true))) {
- close(s);
- log_perror("setsockopt");
- return -1;
- }
-
- /* I need to sleep a bit in order for kernel to finish init of the
- network device; this would allow to not send further multiple
- dhcp requests when only one is needed. */
- wait_message("Bringing up networking...");
- sleep(2);
- remove_wait_message();
-
- return 0;
-}
-
-
-void set_missing_ip_info(struct interface_info * intf)
-{
- bp_int32 ipNum = *((bp_int32 *) &intf->ip);
- bp_int32 nmNum;
-
- if (intf->netmask.s_addr == 0)
- inet_aton(guess_netmask(inet_ntoa(intf->ip)), &intf->netmask);
-
- nmNum = *((bp_int32 *) &intf->netmask);
-
- if (intf->broadcast.s_addr == 0)
- *((bp_int32 *) &intf->broadcast) = (ipNum & nmNum) | ~(nmNum);
-
- if (intf->network.s_addr == 0)
- *((bp_int32 *) &intf->network) = ipNum & nmNum;
-}
-
-static void parse_reply(struct bootp_request * breq, struct interface_info * intf)
-{
- unsigned char * chptr;
- unsigned char option, length;
-
- if (breq->bootfile && strlen(breq->bootfile) > 0) {
- if (IS_NETAUTO)
- stage2_kickstart = strdup(breq->bootfile);
- else
- log_message("warning: ignoring `bootfile' DHCP server parameter, since `netauto' boot parameter was not given; reboot with `linux netauto' (and anymore useful boot parameters) if you want `bootfile' to be used as a `auto_inst.cfg.pl' stage2 configuration file");
- }
-
- memcpy(&intf->ip, &breq->yiaddr, 4);
-
- chptr = breq->vendor;
- chptr += 4;
- while (*chptr != 0xFF && (void *) chptr < (void *) breq->vendor + DHCP_VENDOR_LENGTH) {
- char tmp_str[500];
- option = *chptr++;
- if (!option)
- continue;
- length = *chptr++;
-
- switch (option) {
- case BOOTP_OPTION_DNS:
- memcpy(&dns_server, chptr, sizeof(dns_server));
- log_message("got dns %s", inet_ntoa(dns_server));
- if (length >= sizeof(dns_server)*2) {
- memcpy(&dns_server2, chptr+sizeof(dns_server), sizeof(dns_server2));
- log_message("got dns2 %s", inet_ntoa(dns_server2));
- }
- break;
-
- case BOOTP_OPTION_NETMASK:
- memcpy(&intf->netmask, chptr, sizeof(intf->netmask));
- log_message("got netmask %s", inet_ntoa(intf->netmask));
- break;
-
- case BOOTP_OPTION_DOMAIN:
- memcpy(tmp_str, chptr, length);
- tmp_str[length] = '\0';
- domain = strdup(tmp_str);
- log_message("got domain %s", domain);
- break;
-
- case BOOTP_OPTION_BROADCAST:
- memcpy(&intf->broadcast, chptr, sizeof(intf->broadcast));
- log_message("got broadcast %s", inet_ntoa(intf->broadcast));
- break;
-
- case BOOTP_OPTION_GATEWAY:
- memcpy(&gateway, chptr, sizeof(gateway));
- log_message("got gateway %s", inet_ntoa(gateway));
- break;
-
- }
-
- chptr += length;
- }
-
- set_missing_ip_info(intf);
-}
-
-
-static void init_vendor_codes(struct bootp_request * breq) {
- memcpy(breq->vendor, vendor_cookie, sizeof(vendor_cookie));
-}
-
-static char gen_hwaddr[16];
-
-static int prepare_request(struct bootp_request * breq, int sock, char * device)
-{
- struct ifreq req;
-
- memset(breq, 0, sizeof(*breq));
-
- breq->opcode = BOOTP_OPCODE_REQUEST;
-
- strcpy(req.ifr_name, device);
- if (ioctl(sock, SIOCGIFHWADDR, &req)) {
- log_perror("SIOCSIFHWADDR");
- return -1;
- }
-
- breq->hw = 1; /* ethernet */
- breq->hwlength = IFHWADDRLEN;
- memcpy(breq->hwaddr, req.ifr_hwaddr.sa_data, IFHWADDRLEN);
- memcpy(gen_hwaddr, req.ifr_hwaddr.sa_data, IFHWADDRLEN);
-
- breq->hopcount = 0;
-
- init_vendor_codes(breq);
-
- return 0;
-}
-
-static int get_vendor_code(struct bootp_request * bresp, unsigned char option, void * data)
-{
- unsigned char * chptr;
- unsigned int length, theOption;
-
- chptr = bresp->vendor + 4;
- while (*chptr != 0xFF && *chptr != option) {
- theOption = *chptr++;
- if (!theOption)
- continue;
- length = *chptr++;
- chptr += length;
- }
-
- if (*chptr++ == 0xff)
- return 1;
-
- length = *chptr++;
- memcpy(data, chptr, length);
-
- return 0;
-}
-
-
-static unsigned long currticks(void)
-{
- struct timeval tv;
- unsigned long csecs;
- unsigned long ticks_per_csec, ticks_per_usec;
-
- /* Note: 18.2 ticks/sec. */
-
- gettimeofday (&tv, 0);
- csecs = tv.tv_sec / 10;
- ticks_per_csec = csecs * 182;
- ticks_per_usec = (((tv.tv_sec - csecs * 10) * 1000000 + tv.tv_usec) * 182 / 10000000);
- return ticks_per_csec + ticks_per_usec;
-}
-
-
-#define BACKOFF_LIMIT 7
-#define TICKS_PER_SEC 18
-#define MAX_ARP_RETRIES 7
-
-static void rfc951_sleep(int exp)
-{
- static long seed = 0;
- long q;
- unsigned long tmo;
-
- if (exp > BACKOFF_LIMIT)
- exp = BACKOFF_LIMIT;
-
- if (!seed)
- /* Initialize linear congruential generator. */
- seed = (currticks () + *(long *) &gen_hwaddr + ((short *) gen_hwaddr)[2]);
-
- /* Simplified version of the LCG given in Bruce Scheier's
- "Applied Cryptography". */
- q = seed / 53668;
- if ((seed = 40014 * (seed - 53668 * q) - 12211 * q) < 0)
- seed += 2147483563l;
-
- /* Compute mask. */
- for (tmo = 63; tmo <= 60 * TICKS_PER_SEC && --exp > 0; tmo = 2 * tmo + 1)
- ;
-
- /* Sleep. */
- log_message("<sleep>");
-
- for (tmo = (tmo & seed) + currticks (); currticks () < tmo;);
-}
-
-
-static int handle_transaction(int s, struct bootp_request * breq, struct bootp_request * bresp,
- struct sockaddr_in * server_addr, int dhcp_type)
-{
- struct pollfd polls;
- int i, j;
- int retry = 1;
- int sin;
- char eth_packet[ETH_FRAME_LEN];
- struct iphdr * ip_hdr;
- struct udphdr * udp_hdr;
- unsigned char type;
- unsigned long starttime;
- int timeout = 1;
-
- breq->id = starttime = currticks();
- breq->secs = 0;
-
- sin = socket(AF_PACKET, SOCK_DGRAM, ntohs(ETH_P_IP));
- if (sin < 0) {
- log_perror("af_packet socket");
- return -1;
- }
-
- while (retry <= MAX_ARP_RETRIES) {
- i = sizeof(*breq);
-
- if (sendto(s, breq, i, 0, (struct sockaddr *) server_addr, sizeof(*server_addr)) != i) {
- close(s);
- log_perror("sendto");
- return -1;
- }
-
- polls.fd = sin;
- polls.events = POLLIN;
-
- while (poll(&polls, 1, timeout*1000) == 1) {
-
- if ((j = recv(sin, eth_packet, sizeof(eth_packet), 0)) == -1) {
- log_perror("recv");
- continue;
- }
-
- /* We need to do some basic sanity checking of the header */
- if (j < (signed)(sizeof(*ip_hdr) + sizeof(*udp_hdr)))
- continue;
-
- ip_hdr = (void *) eth_packet;
- if (!verify_checksum(ip_hdr, sizeof(*ip_hdr)))
- continue;
-
- if (ntohs(ip_hdr->tot_len) > j)
- continue;
-
- j = ntohs(ip_hdr->tot_len);
-
- if (ip_hdr->protocol != IPPROTO_UDP)
- continue;
-
- udp_hdr = (void *) (eth_packet + sizeof(*ip_hdr));
-
- if (ntohs(udp_hdr->source) != BOOTP_SERVER_PORT)
- continue;
-
- if (ntohs(udp_hdr->dest) != BOOTP_CLIENT_PORT)
- continue;
- /* Go on with this packet; it looks sane */
-
- /* Originally copied sizeof (*bresp) - this is a security
- problem due to a potential underflow of the source
- buffer. Also, it trusted that the packet was properly
- 0xFF terminated, which is not true in the case of the
- DHCP server on Cisco 800 series ISDN router. */
-
- memset (bresp, 0xFF, sizeof (*bresp));
- memcpy (bresp, (char *) udp_hdr + sizeof (*udp_hdr), j - sizeof (*ip_hdr) - sizeof (*udp_hdr));
-
- /* sanity checks */
- if (bresp->id != breq->id)
- continue;
- if (bresp->opcode != BOOTP_OPCODE_REPLY)
- continue;
- if (bresp->hwlength != breq->hwlength)
- continue;
- if (memcmp(bresp->hwaddr, breq->hwaddr, bresp->hwlength))
- continue;
- if (get_vendor_code(bresp, DHCP_OPTION_TYPE, &type) || type != dhcp_type)
- continue;
- if (memcmp(bresp->vendor, vendor_cookie, 4))
- continue;
- return 0;
- }
- rfc951_sleep(retry);
- breq->secs = htons ((currticks () - starttime) / 20);
- retry++;
- timeout *= 2;
- if (timeout > 5)
- timeout = 5;
- }
-
- return -1;
-}
-
-static void add_vendor_code(struct bootp_request * breq, unsigned char option, unsigned char length, void * data)
-{
- unsigned char * chptr;
- int theOption, theLength;
-
- chptr = breq->vendor;
- chptr += 4;
- while (*chptr != 0xFF && *chptr != option) {
- theOption = *chptr++;
- if (!theOption) continue;
- theLength = *chptr++;
- chptr += theLength;
- }
-
- *chptr++ = option;
- *chptr++ = length;
- memcpy(chptr, data, length);
- chptr[length] = 0xff;
-}
-
-
-char * dhcp_hostname = NULL;
-char * dhcp_domain = NULL;
-
-enum return_type perform_dhcp(struct interface_info * intf)
-{
- int s, i;
- struct sockaddr_in server_addr;
- struct sockaddr_in client_addr;
- struct sockaddr_in broadcast_addr;
- struct bootp_request breq, bresp;
- unsigned char messageType;
- unsigned int lease;
- short aShort;
- int num_options;
- char requested_options[50];
- char * client_id_str, * client_id_hwaddr;
-
- if (strncmp(intf->device, "eth", 3)) {
- stg1_error_message("DHCP available only for Ethernet networking.");
- return RETURN_ERROR;
- }
-
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0) {
- log_perror("socket");
- return RETURN_ERROR;
- }
-
- {
- enum return_type results;
- char * questions[] = { "Host name", "Domain name", NULL };
- char * questions_auto[] = { "hostname", "domain" };
- static char ** answers = NULL;
- char * boulet;
-
- client_id_str = client_id_hwaddr = NULL;
-
- results = ask_from_entries_auto("If the DHCP server needs to know you by name; please fill in this information. "
- "Valid answers are for example: `mybox' for hostname and `mynetwork.com' for "
- "domain name, for a machine called `mybox.mynetwork.com' on the Internet.",
- questions, &answers, 32, questions_auto, NULL);
- if (results == RETURN_OK)
- {
- dhcp_hostname = answers[0];
- if ((boulet = strchr(dhcp_hostname, '.')) != NULL)
- boulet[0] = '\0';
- dhcp_domain = answers[1];
-
- if (*dhcp_hostname && *dhcp_domain) {
- /* if we have both, then create client id from them */
- client_id_str = malloc(1 + strlen(dhcp_hostname) + 1 + strlen(dhcp_domain) + 1);
- client_id_str[0] = '\0';
- sprintf(client_id_str+1, "%s.%s", dhcp_hostname, dhcp_domain);
- }
- }
- }
-
- if (initial_setup_interface(intf->device, s) != 0) {
- close(s);
- return RETURN_ERROR;
- }
-
- if (prepare_request(&breq, s, intf->device) != 0) {
- close(s);
- return RETURN_ERROR;
- }
-
- messageType = DHCP_TYPE_DISCOVER;
- add_vendor_code(&breq, DHCP_OPTION_TYPE, 1, &messageType);
-
- /* add pieces needed to have DDNS/DHCP IP selection based on requested name */
- if (dhcp_hostname && *dhcp_hostname) { /* pick client id form based on absence or presence of domain name */
- if (*dhcp_domain) /* alternate style <hostname>.<domainname> */
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str+1)+1, client_id_str);
- else { /* usual style (aka windows / dhcpcd) */
- /* but put MAC in form required for client identifier first */
- client_id_hwaddr = malloc(IFHWADDRLEN+2);
- client_id_hwaddr[0] = 1; /* set flag for ethernet */
- memcpy(client_id_hwaddr+1, gen_hwaddr, IFHWADDRLEN);
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, IFHWADDRLEN+1, client_id_hwaddr);
- }
- /* this is the one that the dhcp server really wants for DDNS updates */
- add_vendor_code(&breq, BOOTP_OPTION_HOSTNAME, strlen(dhcp_hostname), dhcp_hostname);
- log_message("DHCP: telling server to use name = %s", dhcp_hostname);
- }
-
- memset(&client_addr.sin_addr, 0, sizeof(&client_addr.sin_addr));
- client_addr.sin_family = AF_INET;
- client_addr.sin_port = htons(BOOTP_CLIENT_PORT); /* bootp client */
-
- if (bind(s, (struct sockaddr *) &client_addr, sizeof(client_addr))) {
- log_perror("bind");
- return RETURN_ERROR;
- }
-
- broadcast_addr.sin_family = AF_INET;
- broadcast_addr.sin_port = htons(BOOTP_SERVER_PORT); /* bootp server */
- memset(&broadcast_addr.sin_addr, 0xff, sizeof(broadcast_addr.sin_addr)); /* broadcast */
-
- log_message("DHCP: sending DISCOVER");
-
- wait_message("Sending DHCP request...");
- i = handle_transaction(s, &breq, &bresp, &broadcast_addr, DHCP_TYPE_OFFER);
- remove_wait_message();
-
- if (i != 0) {
- stg1_error_message("No DHCP reply received.");
- close(s);
- return RETURN_ERROR;
- }
-
- server_addr.sin_family = AF_INET;
- server_addr.sin_port = htons(BOOTP_SERVER_PORT); /* bootp server */
- if (get_vendor_code(&bresp, DHCP_OPTION_SERVER, &server_addr.sin_addr)) {
- close(s);
- log_message("DHCPOFFER didn't include server address");
- return RETURN_ERROR;
- }
-
- init_vendor_codes(&breq);
- messageType = DHCP_TYPE_REQUEST;
- add_vendor_code(&breq, DHCP_OPTION_TYPE, 1, &messageType);
- add_vendor_code(&breq, DHCP_OPTION_SERVER, 4, &server_addr.sin_addr);
- add_vendor_code(&breq, DHCP_OPTION_REQADDR, 4, &bresp.yiaddr);
-
- /* if used the first time, then have to use it again */
- if (dhcp_hostname && *dhcp_hostname) { /* add pieces needed to have DDNS/DHCP IP selection based on requested name */
- if (dhcp_domain && *dhcp_domain) /* alternate style */
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, strlen(client_id_str+1)+1, client_id_str);
- else /* usual style (aka windows / dhcpcd) */
- add_vendor_code(&breq, DHCP_OPTION_CLIENT_IDENTIFIER, IFHWADDRLEN+1, client_id_hwaddr);
- /* this is the one that the dhcp server really wants for DDNS updates */
- add_vendor_code(&breq, BOOTP_OPTION_HOSTNAME, strlen(dhcp_hostname), dhcp_hostname);
- }
-
- aShort = ntohs(sizeof(struct bootp_request));
- add_vendor_code(&breq, DHCP_OPTION_MAXSIZE, 2, &aShort);
-
- num_options = 0;
- requested_options[num_options++] = BOOTP_OPTION_NETMASK;
- requested_options[num_options++] = BOOTP_OPTION_GATEWAY;
- requested_options[num_options++] = BOOTP_OPTION_DNS;
- requested_options[num_options++] = BOOTP_OPTION_DOMAIN;
- requested_options[num_options++] = BOOTP_OPTION_BROADCAST;
- add_vendor_code(&breq, DHCP_OPTION_OPTIONREQ, num_options, requested_options);
-
- /* request a lease of 1 hour */
- i = htonl(60 * 60);
- add_vendor_code(&breq, DHCP_OPTION_LEASE, 4, &i);
-
- log_message("DHCP: sending REQUEST");
-
- i = handle_transaction(s, &breq, &bresp, &broadcast_addr, DHCP_TYPE_ACK);
-
- if (i != 0) {
- close(s);
- return RETURN_ERROR;
- }
-
- if (get_vendor_code(&bresp, DHCP_OPTION_LEASE, &lease)) {
- log_message("failed to get lease time\n");
- return RETURN_ERROR;
- }
- lease = ntohl(lease);
-
- close(s);
-
- intf->netmask.s_addr = 0;
- intf->broadcast.s_addr = 0;
- intf->network.s_addr = 0;
-
- parse_reply(&bresp, intf);
-
- return RETURN_OK;
-}
diff --git a/mdk-stage1/dhcp.h b/mdk-stage1/dhcp.h
deleted file mode 100644
index 71d062e9c..000000000
--- a/mdk-stage1/dhcp.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Guillaume Cottenceau (gc@mandrakesoft.com)
- *
- * Copyright 2000 MandrakeSoft
- *
- * View the homepage: http://us.mandrakesoft.com/~gc/html/stage1.html
- *
- *
- * This software may be freely redistributed under the terms of the GNU
- * public license.
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-/*
- * Portions from GRUB -- GRand Unified Bootloader
- * Copyright (C) 2000 Free Software Foundation, Inc.
- *
- * Itself based on etherboot-4.6.4 by Martin Renters.
- *
- */
-
-#ifndef _DHCP_H_
-#define _DHCP_H_
-
-#include "stage1.h"
-#include "network.h"
-
-enum return_type perform_dhcp(struct interface_info * intf);
-
-extern char * dhcp_hostname;
-
-#endif
diff --git a/mdk-stage1/dietlibc/.cvsignore b/mdk-stage1/dietlibc/.cvsignore
deleted file mode 100644
index f0be42e21..000000000
--- a/mdk-stage1/dietlibc/.cvsignore
+++ /dev/null
@@ -1,28 +0,0 @@
-t
-elftrunc
-mapfile
-t1
-load
-compile
-bin-alpha
-bin-arm
-bin-i386
-bin-mips
-bin-ppc
-bin-sparc
-bin-mipsel
-bin-parisc
-bin-s390
-bin-sparc64
-pic-alpha
-pic-arm
-pic-i386
-pic-mips
-pic-ppc
-pic-sparc
-pic-mipsel
-pic-parisc
-pic-s390
-pic-sparc64
-bin-ia64
-bin-x86_64
diff --git a/mdk-stage1/dietlibc/AUTHOR b/mdk-stage1/dietlibc/AUTHOR
deleted file mode 100644
index 3f6a44e6d..000000000
--- a/mdk-stage1/dietlibc/AUTHOR
+++ /dev/null
@@ -1,3 +0,0 @@
-Felix von Leitner <felix-dietlibc@fefe.de>
-
-Please see the file THANKS for additional authors and contributors.
diff --git a/mdk-stage1/dietlibc/Makefile b/mdk-stage1/dietlibc/Makefile
deleted file mode 100644
index 0fe32e61b..000000000
--- a/mdk-stage1/dietlibc/Makefile
+++ /dev/null
@@ -1,413 +0,0 @@
-INSTALL=install
-prefix?=/usr
-# Set the following to install to a different root
-#DESTDIR=/tmp/fefix
-# Use "make DEBUG=1" to compile a debug version.
-
-MYARCH:=$(shell uname -m | sed -e 's/i[4-9]86/i386/' -e 's/armv[3-6][lb]/arm/' -e 's/ppc64/ppc/')
-
-# This extra-ugly cruft is here so make will not run uname and sed each
-# time it looks at $(OBJDIR). This alone sped up running make when
-# nothing has to be done from 1 sec to 0.12 sec on a 900 MHz Athlon.
-# We don't use ARCH:=$(MYARCH) so we can detect unknown architectures.
-ifeq ($(MYARCH),i386)
-ARCH=i386
-else
-ifeq ($(MYARCH),mips)
-ARCH=mips
-else
-ifeq ($(MYARCH),alpha)
-ARCH=alpha
-else
-ifeq ($(MYARCH),ppc)
-ARCH=ppc
-else
-ifeq ($(MYARCH),arm)
-ARCH=arm
-else
-ifeq ($(MYARCH),sparc)
-ARCH=sparc
-else
-ifeq ($(MYARCH),sparc64)
-ARCH=sparc64
-else
-ifeq ($(MYARCH),s390)
-ARCH=s390
-else
-ifeq ($(MYARCH),mipsel)
-ARCH=mipsel
-else
-ifeq ($(MYARCH),parisc)
-ARCH=parisc
-else
-ifeq ($(MYARCH),parisc64)
-ARCH=parisc
-MYARCH=parisc
-else
-ifeq ($(MYARCH),x86_64)
-ARCH=x86_64
-else
-ifeq ($(MYARCH),ia64)
-ARCH=ia64
-else
-$(error unknown architecture, please fix Makefile)
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-endif
-
-# ARCH=$(MYARCH)
-
-LIBDIR=${prefix}/lib
-ifeq ($(ARCH),x86_64)
-LIBDIR=${prefix}/lib64
-endif
-BINDIR=${prefix}/bin
-MAN1DIR=${prefix}/share/man/man1
-INSTALLHOME=$(LIBDIR)/dietlibc
-
-OBJDIR=bin-$(ARCH)
-ILIBDIR=$(INSTALLHOME)/lib-$(ARCH)
-
-HOME=$(shell pwd)
-
-WHAT= $(OBJDIR) $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o \
- $(OBJDIR)/dietlibc.a $(OBJDIR)/liblatin1.a \
- $(OBJDIR)/libcompat.a $(OBJDIR)/libm.a \
- $(OBJDIR)/librpc.a $(OBJDIR)/libpthread.a \
- $(OBJDIR)/diet $(OBJDIR)/diet-i
-
-all: $(WHAT)
-
-profiling: $(OBJDIR)/libgmon.a $(OBJDIR)/pstart.o
-
-CFLAGS=-pipe -nostdinc
-CROSS=
-
-CC=gcc
-
-VPATH=lib:libstdio:libugly:libcruft:libcrypt:libshell:liblatin1:libcompat:libdl:librpc:libregex:libm:profiling
-
-SYSCALLOBJ=$(patsubst syscalls.s/%.S,$(OBJDIR)/%.o,$(wildcard syscalls.s/*.S))
-
-LIBOBJ=$(patsubst lib/%.c,$(OBJDIR)/%.o,$(wildcard lib/*.c))
-LIBUGLYOBJ=$(patsubst libugly/%.c,$(OBJDIR)/%.o,$(wildcard libugly/*.c))
-LIBSTDIOOBJ=$(patsubst libstdio/%.c,$(OBJDIR)/%.o,$(wildcard libstdio/*.c))
-LIBCRUFTOBJ=$(patsubst libcruft/%.c,$(OBJDIR)/%.o,$(wildcard libcruft/*.c))
-LIBCRYPTOBJ=$(patsubst libcrypt/%.c,$(OBJDIR)/%.o,$(wildcard libcrypt/*.c))
-LIBSHELLOBJ=$(patsubst libshell/%.c,$(OBJDIR)/%.o,$(wildcard libshell/*.c))
-LIBCOMPATOBJ=$(patsubst libcompat/%.c,$(OBJDIR)/%.o,$(wildcard libcompat/*.c)) $(OBJDIR)/syscall.o
-LIBMATH=$(patsubst libm/%.c,%.o,$(wildcard libm/*.c))
-
-LIBRPCOBJ=$(patsubst librpc/%.c,$(OBJDIR)/%.o,$(wildcard librpc/*.c))
-LIBREGEXOBJ=$(patsubst libregex/%.c,$(OBJDIR)/%.o,$(wildcard libregex/*.c))
-
-LIBDLOBJ=$(patsubst libdl/%.c,$(OBJDIR)/%.o,$(wildcard libdl/*.c)) $(OBJDIR)/_dl_jump.o
-
-LIBPTHREAD_OBJS=$(patsubst libpthread/%.c,$(OBJDIR)/%.o,$(shell ./threadsafe.sh)) $(OBJDIR)/__testandset.o
-
-LIBGMON_OBJS=$(OBJDIR)/__mcount.o $(OBJDIR)/monitor.o $(OBJDIR)/profil.o
-
-include $(ARCH)/Makefile.add
-
-LIBMATHOBJ=$(patsubst %,$(OBJDIR)/%,$(LIBMATH))
-
-ifeq ($(CFLAGS),-pipe -nostdinc)
-CFLAGS+=-O -fomit-frame-pointer
-endif
-
-ifneq ($(DEBUG),)
-CFLAGS = -g
-COMMENT = :
-endif
-CFLAGS += -Wall -W -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wno-switch -Wredundant-decls -Wno-unused
-
-PWD=$(shell pwd)
-
-.SUFFIXES:
-.SUFFIXES: .S .c
-
-# added real dynamic dietlibc.so
-PICODIR = pic-$(ARCH)
-
-$(OBJDIR) $(PICODIR):
- mkdir $@
-
-% :: %,v
-
-$(OBJDIR)/pstart.o: start.S
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -DPROFILING -c $< -o $@
-
-$(OBJDIR)/%.o: %.S $(ARCH)/syscalls.h
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
-
-$(OBJDIR)/pthread_%.o: libpthread/pthread_%.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
- $(COMMENT) -$(CROSS)strip -x -R .comment -R .note $@
-
-$(OBJDIR)/%.o: %.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $< -o $@
- $(COMMENT) -$(CROSS)strip -x -R .comment -R .note $@
-
-DIETLIBC_OBJ = $(OBJDIR)/unified.o \
-$(SYSCALLOBJ) $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
-$(LIBCRUFTOBJ) $(LIBCRYPTOBJ) $(LIBSHELLOBJ) $(LIBREGEXOBJ) \
-$(OBJDIR)/__longjmp.o $(OBJDIR)/setjmp.o \
-$(OBJDIR)/mmap.o $(OBJDIR)/clone.o
-
-$(OBJDIR)/dietlibc.a: $(DIETLIBC_OBJ) $(OBJDIR)/start.o
- $(CROSS)ar cru $@ $(DIETLIBC_OBJ)
-
-$(OBJDIR)/librpc.a: $(LIBRPCOBJ)
- $(CROSS)ar cru $@ $(LIBRPCOBJ)
-
-LIBLATIN1_OBJS=$(patsubst liblatin1/%.c,$(OBJDIR)/%.o,$(wildcard liblatin1/*.c))
-$(OBJDIR)/liblatin1.a: $(LIBLATIN1_OBJS)
- $(CROSS)ar cru $@ $^
-
-$(OBJDIR)/libgmon.a: $(LIBGMON_OBJS)
- $(CROSS)ar cru $@ $^
-
-$(OBJDIR)/libpthread.a: $(LIBPTHREAD_OBJS) dietfeatures.h
- $(CROSS)ar cru $@ $(LIBPTHREAD_OBJS)
-
-$(OBJDIR)/libcompat.a: $(LIBCOMPATOBJ)
- $(CROSS)ar cru $@ $(LIBCOMPATOBJ)
-
-$(OBJDIR)/libm.a: $(LIBMATHOBJ)
- $(CROSS)ar cru $@ $(LIBMATHOBJ)
-
-$(OBJDIR)/libdietc.so: $(OBJDIR)/dietlibc.a
- $(CROSS)ld -whole-archive -shared -o $@ $^
-
-dyn: dyn_lib
-
-# added dynamic linker
-$(OBJDIR)/libdl.a: $(LIBDLOBJ)
- $(CROSS)ar cru $@ $(LIBDLOBJ)
-
-dyn_lib: $(PICODIR) $(PICODIR)/libc.so $(PICODIR)/dstart.o \
- $(PICODIR)/dyn_so_start.o $(PICODIR)/dyn_start.o $(PICODIR)/dyn_stop.o \
- $(PICODIR)/libpthread.so $(PICODIR)/libdl.so $(PICODIR)/libcompat.so \
- $(PICODIR)/diet-dyn $(PICODIR)/diet-dyn-i
-
-$(PICODIR)/%.o: %.S $(ARCH)/syscalls.h
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
-
-$(PICODIR)/pthread_%.o: libpthread/pthread_%.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
- $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
-
-$(PICODIR)/%.o: %.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
- $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
-
-$(PICODIR)/dstart.o: start.S
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -c $< -o $@
-
-$(PICODIR)/dyn_so_start.o: dyn_start.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -fPIC -D__DYN_LIB -D__DYN_LIB_SHARED -c $< -o $@
- $(COMMENT) $(CROSS)strip -x -R .comment -R .note $@
-
-DYN_LIBC_PIC = $(LIBOBJ) $(LIBSTDIOOBJ) $(LIBUGLYOBJ) \
-$(LIBCRUFTOBJ) $(LIBCRYPTOBJ) $(LIBSHELLOBJ) $(LIBREGEXOBJ)
-
-DYN_LIBC_OBJ = $(PICODIR)/dyn_syscalls.o $(PICODIR)/errlist.o \
- $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(DYN_LIBC_PIC))
-
-DYN_PTHREAD_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBPTHREAD_OBJS))
-
-DYN_LIBDL_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBDLOBJ))
-
-DYN_LIBCOMPAT_OBJS = $(patsubst $(OBJDIR)/%.o,$(PICODIR)/%.o,$(LIBCOMPATOBJ))
-
-$(PICODIR)/libc.so: $(PICODIR) $(DYN_LIBC_OBJ)
- $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBC_OBJ) -lgcc -Wl,-soname=libc.so
-
-$(PICODIR)/libpthread.so: $(DYN_PTHREAD_OBJS) dietfeatures.h
- $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_PTHREAD_OBJS) -L$(PICODIR) -lc -Wl,-soname=libpthread.so
-
-$(PICODIR)/libdl.so: libdl/_dl_main.c dietfeatures.h
- $(CROSS)$(CC) -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -nostdlib -shared -o $@ $(CFLAGS) -I. -Iinclude libdl/_dl_main.c -Wl,-soname=libdl.so
-
-#$(PICODIR)/libdl.so: $(DYN_LIBDL_OBJS) dietfeatures.h
-# $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBDL_OBJS) -L$(PICODIR) -ldietc -Wl,-soname=libdl.so
-
-$(PICODIR)/libcompat.so: $(DYN_LIBCOMPAT_OBJS) dietfeatures.h
- $(CROSS)$(CC) -nostdlib -shared -o $@ $(CFLAGS) -fPIC $(DYN_LIBCOMPAT_OBJS) -L$(PICODIR) -lc -Wl,-soname=libcompat.so
-
-
-
-$(SYSCALLOBJ): syscalls.h
-
-VERSION=dietlibc-$(shell head -1 CHANGES|sed 's/://')
-CURNAME=$(notdir $(shell pwd))
-
-$(OBJDIR)/diet: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
- $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -DVERSION=\"$(VERSION)\" -lgcc
- $(CROSS)strip -R .comment -R .note $@
-
-$(OBJDIR)/diet-i: $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o diet.c $(OBJDIR)/dietlibc.a $(OBJDIR)/dyn_stop.o
- $(CROSS)$(CC) -Iinclude $(CFLAGS) -nostdlib -o $@ $^ -DDIETHOME=\"$(INSTALLHOME)\" -DVERSION=\"$(VERSION)\" -DINSTALLVERSION -lgcc
- $(CROSS)strip -R .comment -R .note $@
-
-$(PICODIR)/diet-dyn: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
- $(CROSS)$(CC) -Iinclude $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(HOME)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(HOME)/$(PICODIR)/libdl.so
- $(CROSS)strip -R .command -R .note $@
-
-$(PICODIR)/diet-dyn-i: $(PICODIR)/start.o $(PICODIR)/dyn_start.o diet.c
- $(CROSS)$(CC) -Iinclude $(CFLAGS) -fPIC -nostdlib -o $@ $^ -DDIETHOME=\"$(prefix)\" -D__DYN_LIB -DVERSION=\"$(VERSION)\" -L$(PICODIR) -lc -lgcc $(PICODIR)/dyn_stop.o -Wl,-dynamic-linker=$(ILIBDIR)/libdl.so -DINSTALLVERSION
- $(CROSS)strip -R .command -R .note $@
-
-$(OBJDIR)/djb: $(OBJDIR)/compile $(OBJDIR)/load
-
-$(OBJDIR)/compile:
- echo 'exec' $(CC) '$(CFLAGS) -I$(PWD)/$(OBJDIR)/include -c $${1+"$$@"}' > $@
- chmod 755 $@
-
-$(OBJDIR)/load:
- echo 'main="$$1"; shift; exec' $(CC) '-nostdlib -o "$$main" $(PWD)/$(OBJDIR)/start.o "$$main".o $${1+"$$@"} $(PWD)/$(OBJDIR)/dietlibc.a -lgcc' > $@
- chmod 755 $@
-
-clean:
- rm -f *.o *.a t t1 compile load exports mapfile libdietc.so
- rm -rf bin-* pic-*
- $(MAKE) -C libdl clean
-
-tar: clean rename
- cd ..; tar cvvf $(VERSION).tar.bz2 $(VERSION) --use=bzip2 --exclude CVS
-
-rename:
- if test $(CURNAME) != $(VERSION); then cd .. && mv $(CURNAME) $(VERSION); fi
-
-$(OBJDIR)/exports: $(OBJDIR)/dietlibc.a
- nm -g $(OBJDIR)/dietlibc.a | grep -w T | awk '{ print $$3 }' | sort -u > $(OBJDIR)/exports
-
-.PHONY: t t1
-t:
- $(CROSS)$(CC) -g $(CFLAGS) -fno-builtin -nostdlib -Iinclude -o t t.c $(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dietlibc.a -lgcc $(OBJDIR)/dyn_stop.o -Wl,-Map,mapfile
-
-t1:
- $(CROSS)$(CC) -g -o t1 t.c
-
-install: $(OBJDIR)/start.o $(OBJDIR)/dietlibc.a $(OBJDIR)/librpc.a $(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(OBJDIR)/diet-i
- $(INSTALL) -d $(DESTDIR)$(ILIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(BINDIR)
- $(INSTALL) $(OBJDIR)/start.o $(DESTDIR)$(ILIBDIR)/start.o
- $(INSTALL) -m 644 $(OBJDIR)/libm.a $(OBJDIR)/libpthread.a $(OBJDIR)/librpc.a \
-$(OBJDIR)/liblatin1.a $(OBJDIR)/libcompat.a $(DESTDIR)$(ILIBDIR)
- $(INSTALL) -m 644 $(OBJDIR)/dietlibc.a $(DESTDIR)$(ILIBDIR)/libc.a
-ifeq ($(MYARCH),$(ARCH))
- $(INSTALL) $(OBJDIR)/diet-i $(DESTDIR)$(BINDIR)/diet
- -$(INSTALL) $(PICODIR)/diet-dyn-i $(DESTDIR)$(BINDIR)/diet-dyn
-endif
- -$(INSTALL) $(OBJDIR)/pstart.o $(OBJDIR)/libgmon.a $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o $(DESTDIR)$(ILIBDIR)
- -$(INSTALL) $(PICODIR)/libc.so $(DESTDIR)$(ILIBDIR)/libc.so
- -$(INSTALL) $(PICODIR)/libpthread.so $(DESTDIR)$(ILIBDIR)/libpthread.so
- -$(INSTALL) $(PICODIR)/libdl.so $(DESTDIR)$(ILIBDIR)/libdl.so
- -$(INSTALL) $(PICODIR)/libcompat.so $(DESTDIR)$(ILIBDIR)/libcompat.so
- -$(INSTALL) $(PICODIR)/dyn_start.o $(DESTDIR)$(ILIBDIR)/dyn_dstart.o
- -$(INSTALL) $(PICODIR)/dyn_stop.o $(DESTDIR)$(ILIBDIR)/dyn_dstop.o
- -$(INSTALL) $(PICODIR)/dstart.o $(PICODIR)/dyn_so_start.o $(DESTDIR)$(ILIBDIR)
- $(INSTALL) -m 644 diet.1 $(DESTDIR)$(MAN1DIR)/diet.1
- if test -f $(PICODIR)/libc.so -a ! -f $(DESTDIR)/etc/diet.ld.conf; then echo "$(ILIBDIR)" > $(DESTDIR)/etc/diet.ld.conf; fi
- for i in `find include -name \*.h`; do install -m 644 -D $$i $(DESTDIR)$(INSTALLHOME)/$$i; done
-
-.PHONY: sparc ppc mips arm alpha i386 parisc mipsel powerpc s390 sparc64
-.PHONY: x86_64 ia64
-
-arm sparc ppc alpha i386 mips parisc s390 sparc64 x86_64 ia64:
- $(MAKE) ARCH=$@ CROSS=$@-linux- all
-
-# Cross compile for little endian MIPS
-mipsel:
- $(MAKE) ARCH=$@ CROSS=mips-linux- all
-
-mips-gnu:
- $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all
-
-# Some people named their cross compiler toolchain powerpc-linux-gcc
-powerpc:
- $(MAKE) ARCH=ppc CROSS=powerpc-linux- all
-
-cross:
- $(MAKE) arm sparc ppc alpha i386 mips sparc64
-
-
-# these depend on dietfeatures.h for large file backward compatibility
-$(OBJDIR)/__fstat64.o $(OBJDIR)/__lstat64.o $(OBJDIR)/__stat64.o $(OBJDIR)/lseek64.o $(OBJDIR)/readdir64.o $(OBJDIR)/stat64.o $(OBJDIR)/lstat64.o $(OBJDIR)/fstat64.o $(OBJDIR)/truncate64.o $(OBJDIR)/__truncate64.o $(OBJDIR)/ftruncate64.o $(OBJDIR)/__ftruncate64.o $(PICODIR)/dyn_syscalls.o $(PICODIR)/__truncate64.o $(PICODIR)/__ftruncate64.o $(PICODIR)/__stat64.o $(PICODIR)/__lstat64.o $(PICODIR)/__fstat64.o: dietfeatures.h
-
-# these depend on dietfeatures.h for thread support
-$(OBJDIR)/alloc.o $(OBJDIR)/perror.o $(OBJDIR)/logging.o $(OBJDIR)/unified.o $(OBJDIR)/clone.o $(OBJDIR)/set_errno.o: dietfeatures.h
-
-# these depend on dietfeatures.h for linker warnings
-$(OBJDIR)/assert_fail.o $(OBJDIR)/sprintf.o $(OBJDIR)/vsnprintf.o $(OBJDIR)/___div.o $(OBJDIR)/fflush.o $(OBJDIR)/setvbuf.o $(OBJDIR)/system.o $(OBJDIR)/sendfile.o $(OBJDIR)/setenv.o: dietfeatures.h
-
-# these depend on dietfeatures.h for buffered stdio
-fclose.o $(OBJDIR)/fdglue.o $(OBJDIR)/fflush.o $(OBJDIR)/fgetc.o $(OBJDIR)/fputc.o $(OBJDIR)/fread.o $(OBJDIR)/fseek.o $(OBJDIR)/printf.o $(OBJDIR)/setvbuf.o $(OBJDIR)/stderr.o $(OBJDIR)/stdin.o $(OBJDIR)/stdout.o $(OBJDIR)/fwrite.o $(OBJDIR)/puts.o: dietfeatures.h
-
-# these depend on dietfeatures.h for fast string routines
-strcasecmp.o $(OBJDIR)/strcat.o $(OBJDIR)/strchr.o $(OBJDIR)/strcmp.o $(OBJDIR)/strcpy.o $(OBJDIR)/strlen.o $(OBJDIR)/strncasecmp.o $(OBJDIR)/strncat.o $(OBJDIR)/strrchr.o: dietfeatures.h
-
-# these depend on dietfeatures.h for /proc
-$(OBJDIR)/ttyname.o $(OBJDIR)/sysconf_cpus.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_TZFILE_PARSER
-$(OBJDIR)/localtime_r.o $(OBJDIR)/strftime.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_SMALL_STDIO_BUFS
-$(LIBSTDIOOBJ): dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_FULL_RESOLV_CONF
-$(OBJDIR)/dnscruft.o $(OBJDIR)/dnscruft2.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_THREAD_SAFE and errno
-$(LIBRPCOBJ) $(OBJDIR)/logging.o $(OBJDIR)/alloc.o $(OBJDIR)/cfsetospeed.o $(OBJDIR)/cfsetispeed.o \
-$(OBJDIR)/execl.o $(OBJDIR)/execlp.o $(OBJDIR)/execv.o $(OBJDIR)/execvp.o $(OBJDIR)/isatty.o \
-$(OBJDIR)/lockf.o $(OBJDIR)/perror.o $(OBJDIR)/remove.o $(OBJDIR)/set_errno.o $(OBJDIR)/sigemptyset.o \
-$(OBJDIR)/tcsetattr.o $(OBJDIR)/dnscruft2.o $(OBJDIR)/dnscruft.o $(OBJDIR)/entlib.o \
-$(OBJDIR)/gethostbyaddr.o $(OBJDIR)/gethostbyaddr_r.o $(OBJDIR)/gethostbyname.o \
-$(OBJDIR)/gethostbyname_r.o $(OBJDIR)/gethostbyname2.o $(OBJDIR)/gethostbyname2_r.o \
-$(OBJDIR)/inet_pton.o $(OBJDIR)/mkstemp.o $(OBJDIR)/mktemp.o $(OBJDIR)/tempnam.o \
-$(OBJDIR)/glob.o $(OBJDIR)/realpath.o $(OBJDIR)/fdglue.o $(OBJDIR)/fdglue2.o \
-$(OBJDIR)/getaddrinfo.o $(OBJDIR)/getnameinfo.o $(OBJDIR)/getprotoent.o \
-$(OBJDIR)/getservent.o $(OBJDIR)/iconv.o $(OBJDIR)/iconv_open.o \
-$(OBJDIR)/netent.o $(OBJDIR)/system.o $(OBJDIR)/stdin.o $(OBJDIR)/stdout.o \
-$(OBJDIR)/stderr.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_CRYPT_MD5
-$(OBJDIR)/crypt.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_FREAD_OPTIMIZATION
-$(OBJDIR)/fread.o $(OBJDIR)/fwrite.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_DYNAMIC
-$(OBJDIR)/start.o $(OBJDIR)/dyn_start.o $(OBJDIR)/dyn_stop.o: dietfeatures.h
-
-$(OBJDIR)/unified.o: dietuglyweaks.h
-
-$(OBJDIR)/adjtimex.o: include/sys/timex.h
-
-$(OBJDIR)/fgetc_unlocked.o $(OBJDIR)/fread.o $(OBJDIR)/ungetc.o: dietstdio.h
-
-# these depend on dietfeatures.h for WANT_LINKER_WARNINGS
-$(OBJDIR)/setlinebuf.o $(OBJDIR)/bzero.o $(OBJDIR)/setegid.o \
-$(OBJDIR)/seteuid.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_FULL_POSIX_COMPAT
-$(OBJDIR)/strncpy.o: dietfeatures.h
-$(OBJDIR)/strxfrm.o: dietfeatures.h
-
-# these depend on dietfeatures.h for WANT_INET_ADDR_DNS
-$(OBJDIR)/gethostbyname_r.o: dietfeatures.h
-
-
-# CFLAGS+=-W -Wshadow -Wid-clash-31 -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wwrite-strings
diff --git a/mdk-stage1/dietlibc/README b/mdk-stage1/dietlibc/README
deleted file mode 100644
index 2a1fa332c..000000000
--- a/mdk-stage1/dietlibc/README
+++ /dev/null
@@ -1,49 +0,0 @@
- The system library is a challenge to all those using the computer to
- write their own faster and better routines or to bow to the superior
- strength and skill of a true master.
- --http://www.inner.net/users/cmetz/program-like-a-klingon
-
-diet libc to statically link programs that don't need all the bloat
-from glibc.
-
-malloc, printf and scanf contributed from Olaf Dreesen.
-
-To compile:
-
- $ make
-
-make should compile the diet libc itself.
-
-When make is done, it will have created dietlibc.a in bin-i386 (or
-bin-ppc, bin-alpha, bin-sparc, bin-ppc or bin-arm, depending on your
-architecture). In that directory you will also find a program called
-"diet", which you need to copy in a directory in your $PATH:
-
- # install bin-i386/diet /usr/local/bin
-
-Then you can compile programs by prepending diet to the command line,
-i.e.
-
- $ diet gcc -s -Os -pipe -o t t.c
-
-diet is cross-compiler friendly and can also be used like this:
-
- $ diet sparc-linux-gcc -o t t.c
-
-diet will then link against dietlibc.a from bin-sparc, of course.
-diet comes with a man page (diet.1), which you can copy to an
-appropriate location, too:
-
- # cp diet.1 /usr/local/man/man1
-
-After you compiled the diet libc successfully, I invite you to check out
-the embedded utils (http://www.fefe.de/embutils/) and the diet libc
-binary repository (ftp://foobar.math.fu-berlin.de/pub/dietlibc/), too.
-The embedded utils are small replacements for common utilities like mv,
-chown, ls, and even a small tar that can extract tar files. The binary
-repository contains a few utilities I linked against the diet libc, for
-example gzip, bzip2 and fdisk.
-
-
-The license for the diet libc is the GNU General Public License, version
-2 (as included in the file COPYING).
diff --git a/mdk-stage1/dietlibc/alpha/Makefile.add b/mdk-stage1/dietlibc/alpha/Makefile.add
deleted file mode 100644
index 68b10b43c..000000000
--- a/mdk-stage1/dietlibc/alpha/Makefile.add
+++ /dev/null
@@ -1,5 +0,0 @@
-
-CFLAGS+=-Os -Iinclude -fomit-frame-pointer -fstrict-aliasing
-VPATH:=alpha:syscalls.s:$(VPATH)
-
-LIBOBJ+=$(patsubst %,$(OBJDIR)/%,divq.o divl.o remq.o reml.o __time.o __alarm.o)
diff --git a/mdk-stage1/dietlibc/alpha/__alarm.c b/mdk-stage1/dietlibc/alpha/__alarm.c
deleted file mode 100644
index 7ca35cb78..000000000
--- a/mdk-stage1/dietlibc/alpha/__alarm.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <sys/time.h>
-
-unsigned int alarm(unsigned int seconds) {
- struct itimerval old, new;
- unsigned int ret;
- new.it_interval.tv_usec=0;
- new.it_interval.tv_sec=0;
- new.it_value.tv_usec =0;
- new.it_value.tv_sec =(long)seconds;
- if (setitimer(ITIMER_REAL,&new,&old)==-1) return 0;
- return old.it_value.tv_sec+(old.it_value.tv_usec?1:0);
-}
diff --git a/mdk-stage1/dietlibc/alpha/__longjmp.S b/mdk-stage1/dietlibc/alpha/__longjmp.S
deleted file mode 100644
index 31e374d0f..000000000
--- a/mdk-stage1/dietlibc/alpha/__longjmp.S
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <setjmp.h>
-
-.text
-.align 2
-
-.global __longjmp
-.type __longjmp,@function
-__longjmp:
- mov $17, $0 /* a1 -> v0 */
-
- ldq $9, (JB_S0*8) ($16) /* s0 */
- ldq $10, (JB_S1*8) ($16) /* s1 */
- ldq $11, (JB_S2*8) ($16) /* s2 */
- ldq $12, (JB_S3*8) ($16) /* s3 */
- ldq $13, (JB_S4*8) ($16) /* s4 */
- ldq $14, (JB_S5*8) ($16) /* s5 */
-
- ldq $26, (JB_PC*8) ($16) /* ra */
- ldq $fp, (JB_FP*8) ($16) /* fp */
- ldq $sp, (JB_SP*8) ($16) /* sp */
-
- ldt $f2, (JB_F2*8) ($16) /* f2 */
- ldt $f3, (JB_F3*8) ($16) /* f3 */
- ldt $f4, (JB_F4*8) ($16) /* f4 */
- ldt $f5, (JB_F5*8) ($16) /* f5 */
- ldt $f6, (JB_F6*8) ($16) /* f6 */
- ldt $f7, (JB_F7*8) ($16) /* f7 */
- ldt $f8, (JB_F8*8) ($16) /* f8 */
- ldt $f9, (JB_F9*8) ($16) /* f9 */
-
- cmoveq $0, 0x1, $0
-
- ret $31, ($26), 1
diff --git a/mdk-stage1/dietlibc/alpha/__testandset.S b/mdk-stage1/dietlibc/alpha/__testandset.S
deleted file mode 100644
index c5ef81241..000000000
--- a/mdk-stage1/dietlibc/alpha/__testandset.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.align 2
-.global __testandsets
-.type __testandsets,@function
-__testandset:
- ldq_l $0, 0($16) /* load lock */
- bne $0,1f /* ok there is a lock... */
- lda $0, 1($31) /* load a 1 to register 0 */
- stq_c $0, 0($16) /* write lock is locked :) */
- beq $0,__testandset /* oops someone changed MY lock */
-1: ret $31, ($26), 0x01 /* return */
diff --git a/mdk-stage1/dietlibc/alpha/__time.c b/mdk-stage1/dietlibc/alpha/__time.c
deleted file mode 100644
index 07275e0e3..000000000
--- a/mdk-stage1/dietlibc/alpha/__time.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <time.h>
-#include <sys/time.h>
-
-time_t time(time_t *foo) {
- struct timeval tv;
- time_t tmp=(time_t)-1;
- if (gettimeofday(&tv,0)==0)
- tmp=(time_t)tv.tv_sec;
- if (foo) *foo=tmp;
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/alpha/accept.S b/mdk-stage1/dietlibc/alpha/accept.S
deleted file mode 100644
index 459c45d7a..000000000
--- a/mdk-stage1/dietlibc/alpha/accept.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(accept,accept,__libc_accept)
diff --git a/mdk-stage1/dietlibc/alpha/bind.S b/mdk-stage1/dietlibc/alpha/bind.S
deleted file mode 100644
index 86a04cb70..000000000
--- a/mdk-stage1/dietlibc/alpha/bind.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(bind,bind)
diff --git a/mdk-stage1/dietlibc/alpha/clone.S b/mdk-stage1/dietlibc/alpha/clone.S
deleted file mode 100644
index 28e61a8bc..000000000
--- a/mdk-stage1/dietlibc/alpha/clone.S
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "syscalls.h"
-#include <errno.h>
-
-.text
-.align 2
-.weak clone
-clone:
-.global __clone
-.type __clone,@function
-__clone:
- ldiq $0, EINVAL
- beq $16, .Lerror
- beq $17, .Lerror
-
- subq $17, 16, $17
- stq $16, 0($17)
- stq $19, 8($17)
- mov $18, $16
-
- lda $0, __NR_clone($31)
- callsys
- bne $19, .Lerror
-
- beq $0, .Lstart_thread
-
- ret $31, ($26), 0x01
-
-.Lerror:
- jmp error_unified_syscall
-
-.Lstart_thread:
- clr $fp
-
- ldq $27, 0($sp)
- ldq $16, 8($sp)
-
- jsr $26, ($27), 0x04
-
- ldgp $gp, 0($26)
- mov $0, $16
- jsr $26, exit
-
diff --git a/mdk-stage1/dietlibc/alpha/connect.S b/mdk-stage1/dietlibc/alpha/connect.S
deleted file mode 100644
index c191ca808..000000000
--- a/mdk-stage1/dietlibc/alpha/connect.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(connect,connect,__libc_connect)
diff --git a/mdk-stage1/dietlibc/alpha/divl.S b/mdk-stage1/dietlibc/alpha/divl.S
deleted file mode 100644
index 3af22a5e8..000000000
--- a/mdk-stage1/dietlibc/alpha/divl.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* taken from glibc 2.2 */
-
- .set noreorder
- .set noat
-
- .ent __divlu
- .globl __divlu
-
- .align 3
-__divlu :
- lda $30 , - 48 ($30 )
- .frame $30 , 48 , $23 , 0
- .prologue 0
-.Ludiv:
- stq $1 , 0($30 )
- zapnot $25 ,15, $1
- stq $2 , 8($30 )
- zapnot $24 ,15, $2
- stq $0 , 16($30 )
- clr $27
- stq $3 , 24($30 )
- ldiq $0 , 1
- stq $4 ,32($30 )
- beq $1 , .Ldivbyzero
-
- .align 3
-
-
-1: cmpult $1 , $2 , $at
- s8addq $1 , $31 , $1
- s8addq $0 , $31 , $0
- bne $at , 1b
-
-
-
-3: addq $27 ,$0 , $4
- srl $0 , 1, $0
- cmpule $1 , $2 , $at
- subq $2 , $1 , $3
- cmovne $at ,$4 , $27
- srl $1 , 1, $1
- cmovne $at , $3 , $2
- bne $0 , 3b
-
-.Ldone: ldq $1 , 0($30 )
- ldq $2 , 8($30 )
- ldq $0 , 16($30 )
- ldq $3 , 24($30 )
- ldq $4 ,32($30 )
- lda $30 , 48 ($30 )
- ret $31 , ($23 ), 1
-
-.Ldivbyzero:
- mov $16 , $3
- ldiq $16 , -2
- call_pal 170
- mov $3 , $16
- clr $27
- br .Ldone
-
- .end __divlu
-
- .ent __divl
- .globl __divl
-
- .align 3
-__divl :
- lda $30 , - 48 ($30 )
- .frame $30 , 48 , $23 , 0
- .prologue 0
- or $24 , $25 , $at
- sextl $at , $at
- bge $at , .Ludiv
-
-
- stq $24 , 0($30 )
- negl $24 , $at
- stq $25 , 8($30 )
- cmovge $at , $at , $24
- stq $23 , 16($30 )
- negl $25 , $at
- stq $3 , 24($30 )
- cmovge $at , $at , $25
-
-
- bsr $23 , __divlu
-
-
- ldq $24 , 0($30 )
- ldq $25 , 8($30 )
- xor $24 , $25 , $at
- negl $27 , $3
- sextl $at , $at
- ldq $23 , 16($30 )
- cmovlt $at , $3 , $27
- ldq $3 , 24($30 )
-
- lda $30 , 48 ($30 )
- ret $31 , ($23 ), 1
-
- .end __divl
diff --git a/mdk-stage1/dietlibc/alpha/divq.S b/mdk-stage1/dietlibc/alpha/divq.S
deleted file mode 100644
index cf70862c4..000000000
--- a/mdk-stage1/dietlibc/alpha/divq.S
+++ /dev/null
@@ -1,102 +0,0 @@
-/* taken from glibc 2.2 */
-
- .set noreorder
- .set noat
-
- .ent __divqu
- .globl __divqu
-
- .align 3
-__divqu :
- lda $30 , - 48 ($30 )
- .frame $30 , 48 , $23 , 0
- .prologue 0
-$udiv:
- stq $1 , 0($30 )
- mov $25 , $1
- stq $2 , 8($30 )
- mov $24 , $2
- stq $0 , 16($30 )
- clr $27
- stq $3 , 24($30 )
- ldiq $0 , 1
- stq $4 ,32($30 )
- beq $1 , $divbyzero
-
- .align 3
-
-
-1: cmpult $1 , $2 , $at
- blt $1 , 2f
- addq $1 , $1 , $1
- addq $0 , $0 , $0
- bne $at , 1b
- unop
-2:
-3: addq $27 ,$0 , $4
- srl $0 , 1, $0
- cmpule $1 , $2 , $at
- subq $2 , $1 , $3
- cmovne $at ,$4 , $27
- srl $1 , 1, $1
- cmovne $at , $3 , $2
- bne $0 , 3b
-
-$done: ldq $1 , 0($30 )
- ldq $2 , 8($30 )
- ldq $0 , 16($30 )
- ldq $3 , 24($30 )
- ldq $4 ,32($30 )
- lda $30 , 48 ($30 )
- ret $31 , ($23 ), 1
-
-$divbyzero:
- mov $16 , $3
- ldiq $16 , -2
- call_pal 170
- mov $3 , $16
- clr $27
- br $done
-
- .end __divqu
-
- .ent __divq
- .globl __divq
-
- .align 3
-__divq :
- lda $30 , - 48 ($30 )
- .frame $30 , 48 , $23 , 0
- .prologue 0
- or $24 , $25 , $at
-
- bge $at , $udiv
-
-
- stq $24 , 0($30 )
- negq $24 , $at
- stq $25 , 8($30 )
- cmovge $at , $at , $24
- stq $23 , 16($30 )
- negq $25 , $at
- stq $3 , 24($30 )
- cmovge $at , $at , $25
-
-
- bsr $23 , __divqu
-
-
- ldq $24 , 0($30 )
- ldq $25 , 8($30 )
- xor $24 , $25 , $at
- negq $27 , $3
-
- ldq $23 , 16($30 )
- cmovlt $at , $3 , $27
- ldq $3 , 24($30 )
-
- lda $30 , 48 ($30 )
- ret $31 , ($23 ), 1
-
- .end __divq
-
diff --git a/mdk-stage1/dietlibc/alpha/errlist.S b/mdk-stage1/dietlibc/alpha/errlist.S
deleted file mode 100644
index a5956ce05..000000000
--- a/mdk-stage1/dietlibc/alpha/errlist.S
+++ /dev/null
@@ -1,288 +0,0 @@
-#ifdef __DYN_LIB
-.section .data
-#else
-.section .rodata
-#endif
-
-.align 8
-.global sys_errlist
-.type sys_errlist,@object
-
-sys_errlist:
- .quad .LC000
- .quad .LC001
- .quad .LC002
- .quad .LC003
- .quad .LC004
- .quad .LC005
- .quad .LC006
- .quad .LC007
- .quad .LC008
- .quad .LC009
- .quad .LC010
- .quad .LC011
- .quad .LC012
- .quad .LC013
- .quad .LC014
- .quad .LC015
- .quad .LC016
- .quad .LC017
- .quad .LC018
- .quad .LC019
- .quad .LC020
- .quad .LC021
- .quad .LC022
- .quad .LC023
- .quad .LC024
- .quad .LC025
- .quad .LC026
- .quad .LC027
- .quad .LC028
- .quad .LC029
- .quad .LC030
- .quad .LC031
- .quad .LC032
- .quad .LC033
- .quad .LC034
- .quad .LC035
- .quad .LC036
- .quad .LC037
- .quad .LC038
- .quad .LC039
- .quad .LC040
- .quad .LC041
- .quad .LC042
- .quad .LC043
- .quad .LC044
- .quad .LC045
- .quad .LC046
- .quad .LC047
- .quad .LC048
- .quad .LC049
- .quad .LC050
- .quad .LC051
- .quad .LC052
- .quad .LC053
- .quad .LC054
- .quad .LC055
- .quad .LC056
- .quad .LC057
- .quad .LC058
- .quad .LC059
- .quad .LC060
- .quad .LC061
- .quad .LC062
- .quad .LC063
- .quad .LC064
- .quad .LC065
- .quad .LC066
- .quad .LC067
- .quad .LC068
- .quad .LC069
- .quad .LC070
- .quad .LC071
- .quad .LC072
- .quad .LC073
- .quad .LC074
- .quad .LC075
- .quad .LC076
- .quad .LC077
- .quad .LC078
- .quad .LC079
- .quad .LC080
- .quad .LC081
- .quad .LC082
- .quad .LC083
- .quad .LC084
- .quad .LC085
- .quad .LC086
- .quad .LC087
- .quad .LC088
- .quad .LC089
- .quad .LC090
- .quad .LC091
- .quad .LC092
- .quad .LC093
- .quad .LC094
- .quad .LC095
- .quad .LC096
- .quad .LC097
- .quad .LC098
- .quad .LC099
- .quad .LC100
- .quad .LC101
- .quad .LC102
- .quad .LC103
- .quad .LC104
- .quad .LC105
- .quad .LC106
- .quad .LC107
- .quad .LC108
- .quad .LC109
- .quad .LC110
- .quad .LC111
- .quad .LC112
- .quad .LC113
- .quad .LC114
- .quad .LC115
- .quad .LC116
- .quad .LC117
- .quad .LC118
- .quad .LC119
- .quad .LC120
- .quad .LC121
- .quad .LC122
- .quad .LC123
- .quad .LC124
- .quad .LC125
- .quad .LC126
- .quad .LC127
- .quad .LC128
- .quad .LC129
- .quad .LC130
- .quad 0
-.size sys_errlist,.-sys_errlist
-
-.align 4
-.global sys_nerr
-.type sys_nerr,@object
-sys_nerr:
- .long 130
-.size sys_nerr,4
-
-#ifdef __DYN_LIB
-.section .rodata
-#endif
-
-.LC000: .string "Success"
-.LC001: .string "Operation not permitted"
-.LC002: .string "No such file or directory"
-.LC003: .string "No such process"
-.LC004: .string "Interrupted system call"
-.LC005: .string "I/O error"
-.LC006: .string "No such device or address"
-.LC007: .string "Arg list too long"
-.LC008: .string "Exec format error"
-.LC009: .string "Bad file number"
-.LC010: .string "No child processes"
-.LC011: .string "Resource deadlock would occur"
-.LC012: .string "Out of memory"
-.LC013: .string "Permission denied"
-.LC014: .string "Bad address"
-.LC015: .string "Block device required"
-.LC016: .string "Device or resource busy"
-.LC017: .string "File exists"
-.LC018: .string "Cross-device link"
-.LC019: .string "No such device"
-.LC020: .string "Not a directory"
-.LC021: .string "Is a directory"
-.LC022: .string "Invalid argument"
-.LC023: .string "File table overflow"
-.LC024: .string "Too many open files"
-.LC025: .string "Not a typewriter"
-.LC026: .string "Text file busy"
-.LC027: .string "File too large"
-.LC028: .string "No space left on device"
-.LC029: .string "Illegal seek"
-.LC030: .string "Read-only file system"
-.LC031: .string "Too many links"
-.LC032: .string "Broken pipe"
-.LC033: .string "Math argument out of domain of func"
-.LC034: .string "Math result not representable"
-.LC035: .string "Try again"
-.LC036: .string "Operation now in progress"
-.LC037: .string "Operation already in progress"
-.LC038: .string "Socket operation on non-socket"
-.LC039: .string "Destination address required"
-.LC040: .string "Message too long"
-.LC041: .string "Protocol wrong type for socket"
-.LC042: .string "Protocol not available"
-.LC043: .string "Protocol not supported"
-.LC044: .string "Socket type not supported"
-.LC045: .string "Operation not supported on transport endpoint"
-.LC046: .string "Protocol family not supported"
-.LC047: .string "Address family not supported by protocol"
-.LC048: .string "Address already in use"
-.LC049: .string "Cannot assign requested address"
-.LC050: .string "Network is down"
-.LC051: .string "Network is unreachable"
-.LC052: .string "Network dropped connection because of reset"
-.LC053: .string "Software caused connection abort"
-.LC054: .string "Connection reset by peer"
-.LC055: .string "No buffer space available"
-.LC056: .string "Transport endpoint is already connected"
-.LC057: .string "Transport endpoint is not connected"
-.LC058: .string "Cannot send after transport endpoint shutdown"
-.LC059: .string "Too many references: cannot splice"
-.LC060: .string "Connection timed out"
-.LC061: .string "Connection refused"
-.LC062: .string "Too many symbolic links encountered"
-.LC063: .string "File name too long"
-.LC064: .string "Host is down"
-.LC065: .string "No route to host"
-.LC066: .string "Directory not empty"
-.LC067: .string "Error 67"
-.LC068: .string "Too many users"
-.LC069: .string "Quota exceeded"
-.LC070: .string "Stale NFS file handle"
-.LC071: .string "Object is remote"
-.LC072: .string "Error 72"
-.LC073: .string "Error 73"
-.LC074: .string "Error 74"
-.LC075: .string "Error 75"
-.LC076: .string "Error 76"
-.LC077: .string "No record locks available"
-.LC078: .string "Function not implemented"
-.LC079: .string "Error 79"
-.LC080: .string "No message of desired type"
-.LC081: .string "Identifier removed"
-.LC082: .string "Out of streams resources"
-.LC083: .string "Timer expired"
-.LC084: .string "Not a data message"
-.LC085: .string "Protocol error"
-.LC086: .string "No data available"
-.LC087: .string "Device not a stream"
-.LC088: .string "Channel number out of range"
-.LC089: .string "Level 2 not synchronized"
-.LC090: .string "Level 3 halted"
-.LC091: .string "Level 3 reset"
-.LC092: .string "Package not installed"
-.LC093: .string "Link number out of range"
-.LC094: .string "Protocol driver not attached"
-.LC095: .string "No CSI structure available"
-.LC096: .string "Level 2 halted"
-.LC097: .string "Invalid exchange"
-.LC098: .string "Invalid request descriptor"
-.LC099: .string "Exchange full"
-.LC100: .string "No anode"
-.LC101: .string "Invalid request code"
-.LC102: .string "Invalid slot"
-.LC103: .string "Error 103"
-.LC104: .string "Bad font file format"
-.LC105: .string "Machine is not on the network"
-.LC106: .string "Link has been severed"
-.LC107: .string "Advertise error"
-.LC108: .string "Srmount error"
-.LC109: .string "Communication error on send"
-.LC110: .string "Multihop attempted"
-.LC111: .string "RFS specific error"
-.LC112: .string "Value too large for defined data type"
-.LC113: .string "Name not unique on network"
-.LC114: .string "File descriptor in bad state"
-.LC115: .string "Remote address changed"
-.LC116: .string "Illegal byte sequence"
-.LC117: .string "Structure needs cleaning"
-.LC118: .string "Not a XENIX named type file"
-.LC119: .string "No XENIX semaphores available"
-.LC120: .string "Is a named type file"
-.LC121: .string "Remote I/O error"
-.LC122: .string "Can not access a needed shared library"
-.LC123: .string "Accessing a corrupted shared library"
-.LC124: .string ".lib section in a.out corrupted"
-.LC125: .string "Attempting to link in too many shared libraries"
-.LC126: .string "Cannot exec a shared library directly"
-.LC127: .string "Interrupted system call should be restarted"
-.LC128: .string "Streams pipe error"
-.LC129: .string "No medium found"
-.LC130: .string "Wrong medium type"
-
diff --git a/mdk-stage1/dietlibc/alpha/getegid.S b/mdk-stage1/dietlibc/alpha/getegid.S
deleted file mode 100644
index 89c35d45e..000000000
--- a/mdk-stage1/dietlibc/alpha/getegid.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.align 2
-.global getegid
-getegid:
- lda $sp,-8($sp)
- stq $26, 0($sp)
- jsr getgid
- ldq $26, 0($sp)
- lda $sp, 8($sp)
- cmovge $0, $20, $0
- ret
diff --git a/mdk-stage1/dietlibc/alpha/geteuid.S b/mdk-stage1/dietlibc/alpha/geteuid.S
deleted file mode 100644
index 087ca7348..000000000
--- a/mdk-stage1/dietlibc/alpha/geteuid.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.align 2
-.global geteuid
-geteuid:
- lda $sp,-8($sp)
- stq $26, 0($sp)
- jsr getuid
- ldq $26, 0($sp)
- lda $sp, 8($sp)
- cmovge $0, $20, $0
- ret
diff --git a/mdk-stage1/dietlibc/alpha/getgid.S b/mdk-stage1/dietlibc/alpha/getgid.S
deleted file mode 100644
index 7350082f3..000000000
--- a/mdk-stage1/dietlibc/alpha/getgid.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getxgid,getgid)
diff --git a/mdk-stage1/dietlibc/alpha/getpeername.S b/mdk-stage1/dietlibc/alpha/getpeername.S
deleted file mode 100644
index 3b3f48b1a..000000000
--- a/mdk-stage1/dietlibc/alpha/getpeername.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getpeername,getpeername)
diff --git a/mdk-stage1/dietlibc/alpha/getpid.S b/mdk-stage1/dietlibc/alpha/getpid.S
deleted file mode 100644
index d8b3523b2..000000000
--- a/mdk-stage1/dietlibc/alpha/getpid.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getxpid,getpid)
diff --git a/mdk-stage1/dietlibc/alpha/getppid.S b/mdk-stage1/dietlibc/alpha/getppid.S
deleted file mode 100644
index e181268c3..000000000
--- a/mdk-stage1/dietlibc/alpha/getppid.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.align 2
-.global getppid
-getppid:
- lda $sp,-8($sp)
- stq $26, 0($sp)
- jsr getpid
- ldq $26, 0($sp)
- lda $sp, 8($sp)
- cmovge $0, $20, $0
- ret
diff --git a/mdk-stage1/dietlibc/alpha/getsockname.S b/mdk-stage1/dietlibc/alpha/getsockname.S
deleted file mode 100644
index 2727d88da..000000000
--- a/mdk-stage1/dietlibc/alpha/getsockname.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getsockname,getsockname)
diff --git a/mdk-stage1/dietlibc/alpha/getsockopt.S b/mdk-stage1/dietlibc/alpha/getsockopt.S
deleted file mode 100644
index 44b4a910a..000000000
--- a/mdk-stage1/dietlibc/alpha/getsockopt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getsockopt,getsockopt)
diff --git a/mdk-stage1/dietlibc/alpha/getuid.S b/mdk-stage1/dietlibc/alpha/getuid.S
deleted file mode 100644
index fcb5570c2..000000000
--- a/mdk-stage1/dietlibc/alpha/getuid.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getxuid,getuid)
diff --git a/mdk-stage1/dietlibc/alpha/listen.S b/mdk-stage1/dietlibc/alpha/listen.S
deleted file mode 100644
index 1102831d4..000000000
--- a/mdk-stage1/dietlibc/alpha/listen.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(listen,listen)
diff --git a/mdk-stage1/dietlibc/alpha/lseek64.S b/mdk-stage1/dietlibc/alpha/lseek64.S
deleted file mode 100644
index f051e734d..000000000
--- a/mdk-stage1/dietlibc/alpha/lseek64.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "syscalls.h"
-
-.global lseek64
-lseek64:
- br lseek
diff --git a/mdk-stage1/dietlibc/alpha/mmap.S b/mdk-stage1/dietlibc/alpha/mmap.S
deleted file mode 100644
index 2e57fbb74..000000000
--- a/mdk-stage1/dietlibc/alpha/mmap.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(mmap,mmap)
diff --git a/mdk-stage1/dietlibc/alpha/msgctl.S b/mdk-stage1/dietlibc/alpha/msgctl.S
deleted file mode 100644
index d7caed2cc..000000000
--- a/mdk-stage1/dietlibc/alpha/msgctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgctl,msgctl)
diff --git a/mdk-stage1/dietlibc/alpha/msgget.S b/mdk-stage1/dietlibc/alpha/msgget.S
deleted file mode 100644
index 518d67ac4..000000000
--- a/mdk-stage1/dietlibc/alpha/msgget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgget,msgget)
diff --git a/mdk-stage1/dietlibc/alpha/msgrcv.S b/mdk-stage1/dietlibc/alpha/msgrcv.S
deleted file mode 100644
index ab62e6c30..000000000
--- a/mdk-stage1/dietlibc/alpha/msgrcv.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgrcv,msgrcv)
diff --git a/mdk-stage1/dietlibc/alpha/msgsnd.S b/mdk-stage1/dietlibc/alpha/msgsnd.S
deleted file mode 100644
index 890a996a2..000000000
--- a/mdk-stage1/dietlibc/alpha/msgsnd.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgsnd,msgsnd)
diff --git a/mdk-stage1/dietlibc/alpha/n_sigprocmask.S b/mdk-stage1/dietlibc/alpha/n_sigprocmask.S
deleted file mode 100644
index 55f9fde28..000000000
--- a/mdk-stage1/dietlibc/alpha/n_sigprocmask.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(osf_sigprocmask,__old_sigprocmask,__n_sigprocmask)
diff --git a/mdk-stage1/dietlibc/alpha/pipe.S b/mdk-stage1/dietlibc/alpha/pipe.S
deleted file mode 100644
index 3dfef10bf..000000000
--- a/mdk-stage1/dietlibc/alpha/pipe.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "syscalls.h"
-
-.text
-.align 2
-.global pipe
-.type pipe,@function
-pipe:
- lda $0, __NR_pipe($31)
- callsys
- bne $19, .Lerror
- stl $0, 0($16)
- stl $20, 4($16)
- clr $0
- ret $31, ($26), 0x01
-.Lerror:
- br error_unified_syscall
-
diff --git a/mdk-stage1/dietlibc/alpha/recv.S b/mdk-stage1/dietlibc/alpha/recv.S
deleted file mode 100644
index 17664f2e2..000000000
--- a/mdk-stage1/dietlibc/alpha/recv.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(recv,recv,__libc_recv)
diff --git a/mdk-stage1/dietlibc/alpha/recvfrom.S b/mdk-stage1/dietlibc/alpha/recvfrom.S
deleted file mode 100644
index d8e3922af..000000000
--- a/mdk-stage1/dietlibc/alpha/recvfrom.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(recvfrom,recvfrom,__libc_recvfrom)
diff --git a/mdk-stage1/dietlibc/alpha/recvmsg.S b/mdk-stage1/dietlibc/alpha/recvmsg.S
deleted file mode 100644
index 6ce87eebb..000000000
--- a/mdk-stage1/dietlibc/alpha/recvmsg.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(recvmsg,recvmsg)
diff --git a/mdk-stage1/dietlibc/alpha/reml.S b/mdk-stage1/dietlibc/alpha/reml.S
deleted file mode 100644
index 2d89e3280..000000000
--- a/mdk-stage1/dietlibc/alpha/reml.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* taken from glibc 2.2 */
-
- .set noreorder
- .set noat
-
- .ent __remlu
- .globl __remlu
-
- .align 3
-__remlu :
- lda $30 , -32($30)
- .frame $30 , 32 , $23 , 0
- .prologue 0
-.Ludiv:
- stq $1 , 0($30)
- zapnot $25 , 15 , $1
- stq $2 , 8($30)
- zapnot $24 , 15 , $27
- stq $0 , 16($30)
- clr $2
- stq $3 , 24($30)
- ldiq $0 , 1
-
- beq $1 , .Ldivbyzero
-
- .align 3
-
-
-1: cmpult $1 , $27 , $at
- s8addq $1 , $31 , $1
- s8addq $0 , $31 , $0
- bne $at , 1b
-
-
-
-3:
- srl $0 , 1 , $0
- cmpule $1 , $27 , $at
- subq $27 , $1 , $3
-
- srl $1 , 1 , $1
- cmovne $at , $3 , $27
- bne $0 , 3b
-
-.Ldone: ldq $1 , 0($30)
- ldq $2 , 8($30)
- ldq $0 , 16($30)
- ldq $3 , 24($30)
-
- lda $30 , 32($30)
- ret $31 , ($23), 1
-
-.Ldivbyzero:
- mov $16 , $3
- ldiq $16 , -2
- call_pal 170
- mov $3 , $16
- clr $27
- br .Ldone
-
- .end __remlu
-
- .ent __reml
- .globl __reml
-
- .align 3
-__reml :
- lda $30 , - 32 ($30 )
- .frame $30 , 32 , $23 , 0
- .prologue 0
- or $24 , $25 , $at
- sextl $at , $at
- bge $at , .Ludiv
-
-
- stq $24 , 0($30 )
- negl $24 , $at
- stq $25 , 8($30 )
- cmovge $at , $at , $24
- stq $23 , 16($30 )
- negl $25 , $at
- stq $3 , 24($30 )
- cmovge $at , $at , $25
-
-
- bsr $23 , __remlu
-
-
- ldq $24 , 0($30 )
- ldq $25 , 8($30 )
- mov $24 , $at
- negl $27 , $3
- sextl $at , $at
- ldq $23 , 16($30 )
- cmovlt $at , $3 , $27
- ldq $3 , 24($30 )
-
- lda $30 , 32 ($30 )
- ret $31 , ($23 ), 1
-
- .end __reml
diff --git a/mdk-stage1/dietlibc/alpha/remq.S b/mdk-stage1/dietlibc/alpha/remq.S
deleted file mode 100644
index 713484da3..000000000
--- a/mdk-stage1/dietlibc/alpha/remq.S
+++ /dev/null
@@ -1,97 +0,0 @@
-/* taken from glibc 2.2 */
-
- .set noreorder
- .set noat
-
- .ent __remqu
- .globl __remqu
-
- .align 3
-__remqu :
- lda $30 , - 32 ($30 )
- .frame $30 , 32 , $23 , 0
- .prologue 0
-.Ludiv:
- stq $1 , 0($30 )
- mov $25 , $1
- stq $2 , 8($30 )
- mov $24 , $27
- stq $0 , 16($30 )
- clr $2
- stq $3 , 24($30 )
- ldiq $0 , 1
-
- beq $1 , .Ldivbyzero
-
- .align 3
-
-1: cmpult $1 , $27 , $at
- blt $1 , 2f
- addq $1 , $1 , $1
- addq $0 , $0 , $0
- bne $at , 1b
- unop
-2:
-3:
- srl $0 , 1, $0
- cmpule $1 , $27 , $at
- subq $27 , $1 , $3
-
- srl $1 , 1, $1
- cmovne $at , $3 , $27
- bne $0 , 3b
-
-.Ldone: ldq $1 , 0($30 )
- ldq $2 , 8($30 )
- ldq $0 , 16($30 )
- ldq $3 , 24($30 )
-
- lda $30 , 32 ($30 )
- ret $31 , ($23 ), 1
-
-.Ldivbyzero:
- mov $16 , $3
- ldiq $16 , -2
- call_pal 170
- mov $3 , $16
- clr $27
- br .Ldone
-
- .end __remqu
-
- .ent __remq
- .globl __remq
-
- .align 3
-__remq :
- lda $30 , - 32 ($30 )
- .frame $30 , 32 , $23 , 0
- .prologue 0
- or $24 , $25 , $at
-
- bge $at , .Ludiv
-
- stq $24 , 0($30 )
- negq $24 , $at
- stq $25 , 8($30 )
- cmovge $at , $at , $24
- stq $23 , 16($30 )
- negq $25 , $at
- stq $3 , 24($30 )
- cmovge $at , $at , $25
-
- bsr $23 , __remqu
-
- ldq $24 , 0($30 )
- ldq $25 , 8($30 )
- mov $24 , $at
- negq $27 , $3
-
- ldq $23 , 16($30 )
- cmovlt $at , $3 , $27
- ldq $3 , 24($30 )
-
- lda $30 , 32 ($30 )
- ret $31 , ($23 ), 1
-
- .end __remq
diff --git a/mdk-stage1/dietlibc/alpha/semctl.S b/mdk-stage1/dietlibc/alpha/semctl.S
deleted file mode 100644
index e215ed955..000000000
--- a/mdk-stage1/dietlibc/alpha/semctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semctl,semctl)
diff --git a/mdk-stage1/dietlibc/alpha/semget.S b/mdk-stage1/dietlibc/alpha/semget.S
deleted file mode 100644
index 67f488546..000000000
--- a/mdk-stage1/dietlibc/alpha/semget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semget,semget)
diff --git a/mdk-stage1/dietlibc/alpha/semop.S b/mdk-stage1/dietlibc/alpha/semop.S
deleted file mode 100644
index 81b6fc606..000000000
--- a/mdk-stage1/dietlibc/alpha/semop.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semop,semop)
diff --git a/mdk-stage1/dietlibc/alpha/send.S b/mdk-stage1/dietlibc/alpha/send.S
deleted file mode 100644
index cfd11be2a..000000000
--- a/mdk-stage1/dietlibc/alpha/send.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(send,send,__libc_send)
diff --git a/mdk-stage1/dietlibc/alpha/sendmsg.S b/mdk-stage1/dietlibc/alpha/sendmsg.S
deleted file mode 100644
index 14646ad68..000000000
--- a/mdk-stage1/dietlibc/alpha/sendmsg.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(sendmsg,sendmsg)
diff --git a/mdk-stage1/dietlibc/alpha/sendto.S b/mdk-stage1/dietlibc/alpha/sendto.S
deleted file mode 100644
index 17a033011..000000000
--- a/mdk-stage1/dietlibc/alpha/sendto.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(sendto,sendto,__libc_sendto)
diff --git a/mdk-stage1/dietlibc/alpha/seteuid.c b/mdk-stage1/dietlibc/alpha/seteuid.c
deleted file mode 100644
index a7cf47893..000000000
--- a/mdk-stage1/dietlibc/alpha/seteuid.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-
-#undef seteuid
-int seteuid(uid_t euid) {
- return setreuid(-1,euid);
-}
diff --git a/mdk-stage1/dietlibc/alpha/setjmp.S b/mdk-stage1/dietlibc/alpha/setjmp.S
deleted file mode 100644
index 04bfd3d94..000000000
--- a/mdk-stage1/dietlibc/alpha/setjmp.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <setjmp.h>
-
-.text
-.weak setjmp
-.type setjmp,@function
-setjmp:
-.weak __setjmp
-.type __setjmp,@function
-__setjmp:
- mov 0, $17
-.global __sigsetjmp
-.type __sigsetjmp,@function
-__sigsetjmp:
- stq $9, (JB_S0*8) ($16) /* s0 */
- stq $10, (JB_S1*8) ($16) /* s1 */
- stq $11, (JB_S2*8) ($16) /* s2 */
- stq $12, (JB_S3*8) ($16) /* s3 */
- stq $13, (JB_S4*8) ($16) /* s4 */
- stq $14, (JB_S5*8) ($16) /* s5 */
-
- stq $26, (JB_PC*8) ($16) /* ra */
- stq $fp, (JB_FP*8) ($16) /* fp */
- stq $sp, (JB_SP*8) ($16) /* sp */
-
- stt $f2, (JB_F2*8) ($16) /* f2 */
- stt $f3, (JB_F3*8) ($16) /* f3 */
- stt $f4, (JB_F4*8) ($16) /* f4 */
- stt $f5, (JB_F5*8) ($16) /* f5 */
- stt $f6, (JB_F6*8) ($16) /* f6 */
- stt $f7, (JB_F7*8) ($16) /* f7 */
- stt $f8, (JB_F8*8) ($16) /* f8 */
- stt $f9, (JB_F9*8) ($16) /* f9 */
-
- br $31, __sigjmp_save /* jmp __sigjmp_save */
-
diff --git a/mdk-stage1/dietlibc/alpha/setsockopt.S b/mdk-stage1/dietlibc/alpha/setsockopt.S
deleted file mode 100644
index e3fe1d321..000000000
--- a/mdk-stage1/dietlibc/alpha/setsockopt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(setsockopt,setsockopt)
diff --git a/mdk-stage1/dietlibc/alpha/shmat.S b/mdk-stage1/dietlibc/alpha/shmat.S
deleted file mode 100644
index 51248173d..000000000
--- a/mdk-stage1/dietlibc/alpha/shmat.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmat,shmat)
diff --git a/mdk-stage1/dietlibc/alpha/shmctl.S b/mdk-stage1/dietlibc/alpha/shmctl.S
deleted file mode 100644
index d56caace4..000000000
--- a/mdk-stage1/dietlibc/alpha/shmctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmctl,shmctl)
diff --git a/mdk-stage1/dietlibc/alpha/shmdt.S b/mdk-stage1/dietlibc/alpha/shmdt.S
deleted file mode 100644
index d9812a799..000000000
--- a/mdk-stage1/dietlibc/alpha/shmdt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmdt,shmdt)
diff --git a/mdk-stage1/dietlibc/alpha/shmget.S b/mdk-stage1/dietlibc/alpha/shmget.S
deleted file mode 100644
index 82914223f..000000000
--- a/mdk-stage1/dietlibc/alpha/shmget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmget,shmget)
diff --git a/mdk-stage1/dietlibc/alpha/shutdown.S b/mdk-stage1/dietlibc/alpha/shutdown.S
deleted file mode 100644
index 9b5139325..000000000
--- a/mdk-stage1/dietlibc/alpha/shutdown.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shutdown,shutdown)
diff --git a/mdk-stage1/dietlibc/alpha/sigaction.c b/mdk-stage1/dietlibc/alpha/sigaction.c
deleted file mode 100644
index f6c3ada7d..000000000
--- a/mdk-stage1/dietlibc/alpha/sigaction.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <signal.h>
-
-int __rt_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact, long nr, void* restorer);
-
-int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
- return __rt_sigaction(signum, act, oldact, _NSIG/8, 0);
-}
diff --git a/mdk-stage1/dietlibc/alpha/socket.S b/mdk-stage1/dietlibc/alpha/socket.S
deleted file mode 100644
index 85401f56e..000000000
--- a/mdk-stage1/dietlibc/alpha/socket.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(socket,socket)
diff --git a/mdk-stage1/dietlibc/alpha/socketcall.S b/mdk-stage1/dietlibc/alpha/socketcall.S
deleted file mode 100644
index b150bd5d5..000000000
--- a/mdk-stage1/dietlibc/alpha/socketcall.S
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "syscalls.h"
-
-/*
- * Doesn't exist on alpha ( accept, bind, ... are SYSCALLS !?! )
- */
diff --git a/mdk-stage1/dietlibc/alpha/socketpair.S b/mdk-stage1/dietlibc/alpha/socketpair.S
deleted file mode 100644
index 06956a7ce..000000000
--- a/mdk-stage1/dietlibc/alpha/socketpair.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(socketpair,socketpair)
diff --git a/mdk-stage1/dietlibc/alpha/start.S b/mdk-stage1/dietlibc/alpha/start.S
deleted file mode 100644
index 850ce2420..000000000
--- a/mdk-stage1/dietlibc/alpha/start.S
+++ /dev/null
@@ -1,33 +0,0 @@
-.text
-.align 2
- .set noreorder
-
-.global __start
-__start:
-.global _start
-_start:
- clr $fp /* clear frame pointer */
-
- br $gp,.Lstart /* set global pointer */
-.Lstart:
- ldgp $gp, 0($gp)
-
-/* prepare to call main */
- ldl $16, 0($sp) /* argc / a0 */
-
- lda $17, 8($sp) /* argv / a1 */
-
- addq $16, 1, $18 /* argp / a2 */
- s8addq $18, $17, $18 /* (8*(argc+1))+argv -> argp */
-
- stq $18, environ
-
-#ifdef WANT_DYNAMIC
-/* in v0 ($0) is the ld.so _fini pointer */
- mov $0, $19 /* mov v0(dynload) to a3 */
- jsr $26, dyn_start
-#else
- jsr $26, main
-#endif
- mov $0, $16
- jsr $26, exit /* YES, CALL! for threads and atexit ! (+4 byte) */
diff --git a/mdk-stage1/dietlibc/alpha/strlen.c b/mdk-stage1/dietlibc/alpha/strlen.c
deleted file mode 100644
index ac532254a..000000000
--- a/mdk-stage1/dietlibc/alpha/strlen.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <string.h>
-
-static const unsigned long long magic = 0x0101010101010101LL;
-
-size_t strlen(const char *s)
-{
- const char *t = s;
- unsigned long long word;
-
- if (!s) return 0;
-
- /* Byte compare up until 64 bit word boundary */
- for (; ((unsigned long long) t & 7); t++)
- if (!*t) return t - s;
-
- /* Word compare */
- do {
- word = *((unsigned long long *) t); t += 8;
- word = (word - magic) &~ word;
- word &= (magic << 7);
- } while (word == 0);
-
- /* word & 0x8080808080808080 == word */
- word = (word - 1) & (magic << 8);
- word += (word << 32);
- word += (word << 16);
- word += (word << 8);
- t += word >> 56;
- return ((const char *) t) - 8 - s;
-}
-
-
diff --git a/mdk-stage1/dietlibc/alpha/syscalls.h b/mdk-stage1/dietlibc/alpha/syscalls.h
deleted file mode 100644
index 5c654b4bf..000000000
--- a/mdk-stage1/dietlibc/alpha/syscalls.h
+++ /dev/null
@@ -1,371 +0,0 @@
-
-#define __NR_osf_syscall 0 /* not implemented */
-#define __NR_exit 1
-#define __NR_fork 2
-#define __NR_read 3
-#define __NR_write 4
-#define __NR_osf_old_open 5 /* not implemented */
-#define __NR_close 6
-#define __NR_osf_wait4 7
-#define __NR_osf_old_creat 8 /* not implemented */
-#define __NR_link 9
-#define __NR_unlink 10
-#define __NR_osf_execve 11 /* not implemented */
-#define __NR_chdir 12
-#define __NR_fchdir 13
-#define __NR_mknod 14
-#define __NR_chmod 15
-#define __NR_chown 16
-#define __NR_brk 17
-#define __NR_osf_getfsstat 18 /* not implemented */
-#define __NR_lseek 19
-#define __NR_getxpid 20
-#define __NR_osf_mount 21
-#define __NR_umount 22
-#define __NR_setuid 23
-#define __NR_getxuid 24
-#define __NR_exec_with_loader 25 /* not implemented */
-#define __NR_ptrace 26
-#define __NR_osf_nrecvmsg 27 /* not implemented */
-#define __NR_osf_nsendmsg 28 /* not implemented */
-#define __NR_osf_nrecvfrom 29 /* not implemented */
-#define __NR_osf_naccept 30 /* not implemented */
-#define __NR_osf_ngetpeername 31 /* not implemented */
-#define __NR_osf_ngetsockname 32 /* not implemented */
-#define __NR_access 33
-#define __NR_osf_chflags 34 /* not implemented */
-#define __NR_osf_fchflags 35 /* not implemented */
-#define __NR_sync 36
-#define __NR_kill 37
-#define __NR_osf_old_stat 38 /* not implemented */
-#define __NR_setpgid 39
-#define __NR_osf_old_lstat 40 /* not implemented */
-#define __NR_dup 41
-#define __NR_pipe 42
-#define __NR_osf_set_program_attributes 43
-#define __NR_osf_profil 44 /* not implemented */
-#define __NR_open 45
-#define __NR_osf_old_sigaction 46 /* not implemented */
-#define __NR_getxgid 47
-#define __NR_osf_sigprocmask 48
-#define __NR_osf_getlogin 49 /* not implemented */
-#define __NR_osf_setlogin 50 /* not implemented */
-#define __NR_acct 51
-#define __NR_sigpending 52
-
-#define __NR_ioctl 54
-#define __NR_osf_reboot 55 /* not implemented */
-#define __NR_osf_revoke 56 /* not implemented */
-#define __NR_symlink 57
-#define __NR_readlink 58
-#define __NR_execve 59
-#define __NR_umask 60
-#define __NR_chroot 61
-#define __NR_osf_old_fstat 62 /* not implemented */
-#define __NR_getpgrp 63
-#define __NR_getpagesize 64
-#define __NR_osf_mremap 65 /* not implemented */
-#define __NR_vfork 66
-#define __NR_stat 67
-#define __NR_lstat 68
-#define __NR_osf_sbrk 69 /* not implemented */
-#define __NR_osf_sstk 70 /* not implemented */
-#define __NR_mmap 71 /* OSF/1 mmap is superset of Linux */
-#define __NR_osf_old_vadvise 72 /* not implemented */
-#define __NR_munmap 73
-#define __NR_mprotect 74
-#define __NR_madvise 75
-#define __NR_vhangup 76
-#define __NR_osf_kmodcall 77 /* not implemented */
-#define __NR_osf_mincore 78 /* not implemented */
-#define __NR_getgroups 79
-#define __NR_setgroups 80
-#define __NR_osf_old_getpgrp 81 /* not implemented */
-#define __NR_setpgrp 82 /* BSD alias for setpgid */
-#define __NR_osf_setitimer 83
-#define __NR_osf_old_wait 84 /* not implemented */
-#define __NR_osf_table 85 /* not implemented */
-#define __NR_osf_getitimer 86
-#define __NR_gethostname 87
-#define __NR_sethostname 88
-#define __NR_getdtablesize 89
-#define __NR_dup2 90
-#define __NR_fstat 91
-#define __NR_fcntl 92
-#define __NR_osf_select 93
-#define __NR_poll 94
-#define __NR_fsync 95
-#define __NR_setpriority 96
-#define __NR_socket 97
-#define __NR_connect 98
-#define __NR_accept 99
-#define __NR_getpriority 100
-#define __NR_send 101
-#define __NR_recv 102
-#define __NR_sigreturn 103
-#define __NR_bind 104
-#define __NR_setsockopt 105
-#define __NR_listen 106
-#define __NR_osf_plock 107 /* not implemented */
-#define __NR_osf_old_sigvec 108 /* not implemented */
-#define __NR_osf_old_sigblock 109 /* not implemented */
-#define __NR_osf_old_sigsetmask 110 /* not implemented */
-#define __NR_sigsuspend 111
-#define __NR_osf_sigstack 112
-#define __NR_recvmsg 113
-#define __NR_sendmsg 114
-#define __NR_osf_old_vtrace 115 /* not implemented */
-#define __NR_osf_gettimeofday 116
-#define __NR_osf_getrusage 117
-#define __NR_getsockopt 118
-
-#define __NR_readv 120
-#define __NR_writev 121
-#define __NR_osf_settimeofday 122
-#define __NR_fchown 123
-#define __NR_fchmod 124
-#define __NR_recvfrom 125
-#define __NR_setreuid 126
-#define __NR_setregid 127
-#define __NR_rename 128
-#define __NR_truncate 129
-#define __NR_ftruncate 130
-#define __NR_flock 131
-#define __NR_setgid 132
-#define __NR_sendto 133
-#define __NR_shutdown 134
-#define __NR_socketpair 135
-#define __NR_mkdir 136
-#define __NR_rmdir 137
-#define __NR_osf_utimes 138
-#define __NR_osf_old_sigreturn 139 /* not implemented */
-#define __NR_osf_adjtime 140 /* not implemented */
-#define __NR_getpeername 141
-#define __NR_osf_gethostid 142 /* not implemented */
-#define __NR_osf_sethostid 143 /* not implemented */
-#define __NR_getrlimit 144
-#define __NR_setrlimit 145
-#define __NR_osf_old_killpg 146 /* not implemented */
-#define __NR_setsid 147
-#define __NR_quotactl 148
-#define __NR_osf_oldquota 149 /* not implemented */
-#define __NR_getsockname 150
-
-#define __NR_osf_pid_block 153 /* not implemented */
-#define __NR_osf_pid_unblock 154 /* not implemented */
-
-#define __NR_sigaction 156
-#define __NR_osf_sigwaitprim 157 /* not implemented */
-#define __NR_osf_nfssvc 158 /* not implemented */
-#define __NR_osf_getdirentries 159
-#define __NR_osf_statfs 160
-#define __NR_osf_fstatfs 161
-
-#define __NR_osf_asynch_daemon 163 /* not implemented */
-#define __NR_osf_getfh 164 /* not implemented */
-#define __NR_osf_getdomainname 165
-#define __NR_setdomainname 166
-
-#define __NR_osf_exportfs 169 /* not implemented */
-
-#define __NR_osf_alt_plock 181 /* not implemented */
-
-#define __NR_osf_getmnt 184 /* not implemented */
-
-#define __NR_osf_alt_sigpending 187 /* not implemented */
-#define __NR_osf_alt_setsid 188 /* not implemented */
-
-#define __NR_osf_swapon 199
-#define __NR_msgctl 200
-#define __NR_msgget 201
-#define __NR_msgrcv 202
-#define __NR_msgsnd 203
-#define __NR_semctl 204
-#define __NR_semget 205
-#define __NR_semop 206
-#define __NR_osf_utsname 207
-#define __NR_lchown 208
-#define __NR_osf_shmat 209
-#define __NR_shmctl 210
-#define __NR_shmdt 211
-#define __NR_shmget 212
-#define __NR_osf_mvalid 213 /* not implemented */
-#define __NR_osf_getaddressconf 214 /* not implemented */
-#define __NR_osf_msleep 215 /* not implemented */
-#define __NR_osf_mwakeup 216 /* not implemented */
-#define __NR_msync 217
-#define __NR_osf_signal 218 /* not implemented */
-#define __NR_osf_utc_gettime 219 /* not implemented */
-#define __NR_osf_utc_adjtime 220 /* not implemented */
-
-#define __NR_osf_security 222 /* not implemented */
-#define __NR_osf_kloadcall 223 /* not implemented */
-
-#define __NR_getpgid 233
-#define __NR_getsid 234
-#define __NR_sigaltstack 235
-#define __NR_osf_waitid 236 /* not implemented */
-#define __NR_osf_priocntlset 237 /* not implemented */
-#define __NR_osf_sigsendset 238 /* not implemented */
-#define __NR_osf_set_speculative 239 /* not implemented */
-#define __NR_osf_msfs_syscall 240 /* not implemented */
-#define __NR_osf_sysinfo 241
-#define __NR_osf_uadmin 242 /* not implemented */
-#define __NR_osf_fuser 243 /* not implemented */
-#define __NR_osf_proplist_syscall 244
-#define __NR_osf_ntp_adjtime 245 /* not implemented */
-#define __NR_osf_ntp_gettime 246 /* not implemented */
-#define __NR_osf_pathconf 247 /* not implemented */
-#define __NR_osf_fpathconf 248 /* not implemented */
-
-#define __NR_osf_uswitch 250 /* not implemented */
-#define __NR_osf_usleep_thread 251
-#define __NR_osf_audcntl 252 /* not implemented */
-#define __NR_osf_audgen 253 /* not implemented */
-#define __NR_sysfs 254
-#define __NR_osf_subsys_info 255 /* not implemented */
-#define __NR_osf_getsysinfo 256
-#define __NR_osf_setsysinfo 257
-#define __NR_osf_afs_syscall 258 /* not implemented */
-#define __NR_osf_swapctl 259 /* not implemented */
-#define __NR_osf_memcntl 260 /* not implemented */
-#define __NR_osf_fdatasync 261 /* not implemented */
-
-
-/*
- * Linux-specific system calls begin at 300
- */
-#define __NR_bdflush 300
-#define __NR_sethae 301
-#define __NR_mount 302
-#define __NR_old_adjtimex 303
-#define __NR_swapoff 304
-#define __NR_getdents 305
-#define __NR_create_module 306
-#define __NR_init_module 307
-#define __NR_delete_module 308
-#define __NR_get_kernel_syms 309
-#define __NR_syslog 310
-#define __NR_reboot 311
-#define __NR_clone 312
-#define __NR_uselib 313
-#define __NR_mlock 314
-#define __NR_munlock 315
-#define __NR_mlockall 316
-#define __NR_munlockall 317
-#define __NR_sysinfo 318
-#define __NR__sysctl 319
-/* 320 was sys_idle. */
-#define __NR_oldumount 321
-#define __NR_swapon 322
-#define __NR_times 323
-#define __NR_personality 324
-#define __NR_setfsuid 325
-#define __NR_setfsgid 326
-#define __NR_ustat 327
-#define __NR_statfs 328
-#define __NR_fstatfs 329
-#define __NR_sched_setparam 330
-#define __NR_sched_getparam 331
-#define __NR_sched_setscheduler 332
-#define __NR_sched_getscheduler 333
-#define __NR_sched_yield 334
-#define __NR_sched_get_priority_max 335
-#define __NR_sched_get_priority_min 336
-#define __NR_sched_rr_get_interval 337
-#define __NR_afs_syscall 338
-#define __NR_uname 339
-#define __NR_nanosleep 340
-#define __NR_mremap 341
-#define __NR_nfsservctl 342
-#define __NR_setresuid 343
-#define __NR_getresuid 344
-#define __NR_pciconfig_read 345
-#define __NR_pciconfig_write 346
-#define __NR_query_module 347
-#define __NR_prctl 348
-#define __NR_pread 349
-#define __NR_pwrite 350
-#define __NR_rt_sigreturn 351
-#define __NR_rt_sigaction 352
-#define __NR_rt_sigprocmask 353
-#define __NR_rt_sigpending 354
-#define __NR_rt_sigtimedwait 355
-#define __NR_rt_sigqueueinfo 356
-#define __NR_rt_sigsuspend 357
-#define __NR_select 358
-#define __NR_gettimeofday 359
-#define __NR_settimeofday 360
-#define __NR_getitimer 361
-#define __NR_setitimer 362
-#define __NR_utimes 363
-#define __NR_getrusage 364
-#define __NR_wait4 365
-#define __NR_adjtimex 366
-#define __NR_getcwd 367
-#define __NR_capget 368
-#define __NR_capset 369
-#define __NR_sendfile 370
-#define __NR_setresgid 371
-#define __NR_getresgid 372
-#define __NR_dipc 373
-#define __NR_pivot_root 374
-#define __NR_mincore 375
-#define __NR_pciconfig_iobase 376
-#define __NR_getdents64 377
-#define __NR_gettid 378
-#define __NR_readahead 379
-#define __NR_security 380 /* syscall for security modules */
-#define __NR_tkill 381
-#define __NR_setxattr 382
-#define __NR_lsetxattr 383
-#define __NR_fsetxattr 384
-#define __NR_getxattr 385
-#define __NR_lgetxattr 386
-#define __NR_fgetxattr 387
-#define __NR_listxattr 388
-#define __NR_llistxattr 389
-#define __NR_flistxattr 390
-#define __NR_removexattr 391
-#define __NR_lremovexattr 392
-#define __NR_fremovexattr 393
-#define __NR_futex 394
-#define __NR_sched_setaffinity 395
-#define __NR_sched_getaffinity 396
-#define __NR_tuxcall 397
-#define __NR_io_setup 398
-#define __NR_io_destroy 399
-#define __NR_io_getevents 400
-#define __NR_io_submit 401
-#define __NR_io_cancel 402
-#define __NR_alloc_hugepages 403
-#define __NR_free_hugepages 404
-#define __NR_exit_group 405
-#define __NR_lookup_dcookie 406
-#define __NR_sys_epoll_create 407
-#define __NR_sys_epoll_ctl 408
-#define __NR_sys_epoll_wait 409
-#define __NR_remap_file_pages 410
-#define __NR_set_tid_address 411
-
-#define syscall_weak(name,wsym,sym) \
-.text ; \
-.align 2 ; \
-.weak wsym; \
-.type wsym,@function ; \
-wsym: ; \
-.global sym ; \
-.type sym,@function ; \
-sym: ; \
- lda $0, __NR_##name($31) ; \
- br __unified_syscall
-
-#define syscall(name,sym) \
-.text ; \
-.align 2 ; \
-.global sym ; \
-.type sym,@function ; \
-sym: ; \
- lda $0, __NR_##name($31) ; \
- br __unified_syscall
-
diff --git a/mdk-stage1/dietlibc/alpha/time.S b/mdk-stage1/dietlibc/alpha/time.S
deleted file mode 100644
index e69de29bb..000000000
--- a/mdk-stage1/dietlibc/alpha/time.S
+++ /dev/null
diff --git a/mdk-stage1/dietlibc/alpha/unified.S b/mdk-stage1/dietlibc/alpha/unified.S
deleted file mode 100644
index 506bf7387..000000000
--- a/mdk-stage1/dietlibc/alpha/unified.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <dietfeatures.h>
-#include "syscalls.h"
-
-.weak exit
-exit:
-.global _exit
-_exit:
- lda $0, __NR_exit
-.global __unified_syscall
-__unified_syscall:
- callsys
- bne $19, .Lerror
-
-/* here we go and "reuse" the return for weak-void functions */
-#include "dietuglyweaks.h"
-
- ret $31, ($26), 0x01
-
-.Lerror:
-.global error_unified_syscall
-error_unified_syscall:
-#ifdef WANT_THREAD_SAFE
- lda $sp, -16($sp) /* alloc 2 qwords on stack */
- stq $26, 0($sp) /* save ra to stack */
- stq $0, 8($sp) /* save v0 to stack */
-
- jsr $26, __errno_location /* call __errno_location */
-
- ldq $1, 8($sp) /* write old v0 to errno */
- stl $1, 0($0)
-
- lda $0, -1($31) /* new return value is -1 */
- ldq $26, 0($sp) /* restore return address */
- lda $sp, 16($sp) /* free 2 qwords on stack */
-#else
- lda $1, errno
- stl $0, 0($1)
-#endif
- ret $31, ($26), 0x01 /* return */
diff --git a/mdk-stage1/dietlibc/alpha/utime.S b/mdk-stage1/dietlibc/alpha/utime.S
deleted file mode 100644
index a9a8aada6..000000000
--- a/mdk-stage1/dietlibc/alpha/utime.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(utimes,utime)
diff --git a/mdk-stage1/dietlibc/alpha/waitpid.S b/mdk-stage1/dietlibc/alpha/waitpid.S
deleted file mode 100644
index 6dc1c99db..000000000
--- a/mdk-stage1/dietlibc/alpha/waitpid.S
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <syscalls.h>
-
-.text
-.align 2
-.weak waitpid
-waitpid:
-.global __libc_waitpid
-__libc_waitpid:
- clr $19
- br wait4
diff --git a/mdk-stage1/dietlibc/binshstr.h b/mdk-stage1/dietlibc/binshstr.h
deleted file mode 100644
index f1bf789fe..000000000
--- a/mdk-stage1/dietlibc/binshstr.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-extern const char __binsh [8];
-
-#define __sh (__binsh + 5 )
-
-/* end of binshstr.h */
diff --git a/mdk-stage1/dietlibc/diet.c b/mdk-stage1/dietlibc/diet.c
deleted file mode 100644
index c3a053ac8..000000000
--- a/mdk-stage1/dietlibc/diet.c
+++ /dev/null
@@ -1,367 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <write12.h>
-
-#include "dietfeatures.h"
-
-/* goal:
- * when invoked as
- * "diet gcc -c t.c"
- * exec
- * "gcc -I/path/to/dietlibc/include -c t.c"
- *
- * when invoked as
- * "diet sparc-linux-gcc -o t t.o"
- * exec
- * "sparc-linux-gcc -nostdlib -static -o t t.o /path/to/dietlibc/bin-sparc/start.o /path/to/dietlibc/bin-sparc/dietlibc.a"
-*/
-
-static void error(const char *message) {
- __write2(message);
- exit(1);
-}
-
-static const char* Os[] = {
- "i386","-Os","-mpreferred-stack-boundary=2",
- "-malign-functions=0","-malign-jumps=0",
- "-malign-loops=0","-fomit-frame-pointer",0,
- "x86_64","-Os","-fno-omit-frame-pointer",0,
- "sparc","-Os","-mcpu=supersparc",0,
- "sparc64","-Os","-m64",0,
- "alpha","-Os","-fomit-frame-pointer",0,
- "arm","-Os","-fomit-frame-pointer",0,
- "mips","-Os","-fomit-frame-pointer","-mno-abicalls","-G","8","-fno-pic",0,
- "ppc","-Os","-fomit-frame-pointer","-mpowerpc-gpopt","-mpowerpc-gfxopt",0,
- "s390","-Os","-fomit-frame-pointer",0,
- "sh","-Os","-fomit-frame-pointer",0,
- "ia64","-Os","-fno-omit-frame-pointer",0,
- "x86_64","-Os","-fstrict-aliasing","-momit-leaf-frame-pointer","-mfance-math-387",0,
- 0};
-
-int main(int argc,char *argv[]) {
- int _link=0;
- int compile=0;
- int preprocess=0;
- int verbose=0;
- int profile=0;
- char diethome[]=DIETHOME;
- char platform[1000];
-#ifdef __DYN_LIB
- int shared=0;
-#endif
- char* shortplatform=0;
-#ifdef WANT_SAFEGUARD
- char safeguard1[]="-include";
- char safeguard2[]=DIETHOME "/include/dietref.h";
-#endif
- const char *nostdlib="-nostdlib";
- const char *libgcc="-lgcc";
- char dashL[1000];
- char dashstatic[]="-static";
- int i;
- int mangleopts=0;
- char manglebuf[1024];
-
-#ifdef INSTALLVERSION
- strcpy(platform,DIETHOME "/lib-");
-#else
-#ifndef __DYN_LIB
- strcpy(platform,DIETHOME "/bin-");
-#else
- strcpy(platform,DIETHOME "/pic-");
-#endif
-#endif
- strcpy(dashL,"-L");
-
- if (argc<2) {
-usage:
- if (verbose) {
- __write2(
-#ifdef __DYN_LIB
- "dyn-"
-#endif
- "diet version " VERSION
-#ifndef INSTALLVERSION
- " (non-install version in source tree)"
-#endif
- "\n\n");
- }
- error("usage: diet [-v] [-Os] gcc command line\n"
- "e.g. diet -Os gcc -c t.c\n"
- "or diet sparc-linux-gcc -o foo foo.c bar.o\n");
- }
- if (!strcmp(argv[1],"-v")) {
- ++argv; --argc;
- verbose=1;
- }
- if (argv[1] && !strcmp(argv[1],"-Os")) {
- ++argv; --argc;
- mangleopts=1;
- }
- if (!argv[1]) goto usage;
- {
- char *tmp=strchr(argv[1],0)-2;
- char *tmp2,*tmp3;
- char *cc=argv[1];
- if (tmp<cc) goto donttouch;
- if ((tmp2=strstr(cc,"linux-"))) { /* cross compiling? */
- int len=strlen(platform);
- --tmp2;
- tmp3=strchr(cc,'-');
- if (tmp3<tmp2) tmp2=tmp3;
- if (tmp2-cc>90) error("platform name too long!\n");
- shortplatform=platform+len;
- memmove(shortplatform,argv[1],(size_t)(tmp2-cc));
- platform[tmp2-cc+len]=0;
- if (shortplatform[0]=='i' && shortplatform[2]=='8' && shortplatform[3]=='6') shortplatform[1]='3';
- } else {
-#ifdef __sparc__
-#ifdef __arch64__
- shortplatform="sparc64";
-#else
- shortplatform="sparc";
-#endif
-#endif
-#ifdef __powerpc__
- shortplatform="ppc";
-#endif
-#ifdef __i386__
- shortplatform="i386";
-#endif
-#ifdef __alpha__
- shortplatform="alpha";
-#endif
-#ifdef __arm__
- shortplatform="arm";
-#endif
-#ifdef __mips__
- shortplatform="mips";
-#endif
-#ifdef __s390__
- shortplatform="s390";
-#endif
-#ifdef __sh__
- shortplatform="sh";
-#endif
-#ifdef __hppa__
- shortplatform="parisc";
-#endif
-#ifdef __x86_64__
- shortplatform="x86_64";
-#endif
-#ifdef __ia64__
- shortplatform="ia64";
-#endif
- {
- char *tmp=platform+strlen(platform);
- strcpy(tmp,shortplatform);
- shortplatform=tmp;
- }
- }
- /* MIPS needs special handling. If argv contains -EL, change
- * platform name to mipsel */
- if (!strcmp(shortplatform,"mips")) {
- int i;
- for (i=1; i<argc; ++i)
- if (!strcmp(argv[i],"-EL"))
- strcpy(shortplatform,"mipsel");
- }
- strcat(dashL,platform);
- if (!strcmp(tmp,"cc")) {
- char **newargv;
- char **dest;
- char *a,*b,*c;
-#ifdef WANT_DYNAMIC
- char *d,*e,*f;
-#endif
-/* we need to add -I... if the command line contains -c, -S or -E */
- for (i=2; i<argc; ++i) {
- if (argv[i][0]=='-' && argv[i][1]=='M')
- goto pp;
- if (!strcmp(argv[i],"-pg"))
- profile=1;
- if (!strcmp(argv[i],"-c") || !strcmp(argv[i],"-S"))
- compile=1;
- if (!strcmp(argv[i],"-E"))
-pp:
- preprocess=compile=1;
- }
-/* we need to add -nostdlib if we are not compiling*/
- _link=!compile;
-#ifdef __DYN_LIB
- if (_link) {
- for (i=2; i<argc; ++i)
- if (!strcmp(argv[i],"-shared")) {
- shared=1;
- _link=0;
- }
- }
-#endif
-#if 0
- for (i=2; i<argc; ++i)
- if (!strcmp(argv[i],"-o"))
- if (!compile) _link=1;
-#endif
- newargv=alloca(sizeof(char*)*(argc+100));
- a=alloca(strlen(diethome)+20);
- b=alloca(strlen(platform)+20);
- c=alloca(strlen(platform)+20);
-
- strcpy(a,"-I"); strcat(a,diethome); strcat(a,"/include");
-#ifndef __DYN_LIB
- strcpy(b,platform);
- if (profile) strcat(b,"/pstart.o"); else strcat(b,"/start.o");
-#ifdef INSTALLVERSION
- strcpy(c,platform); strcat(c,"/libc.a");
-#else
- strcpy(c,platform); strcat(c,"/dietlibc.a");
-#endif
-#else
- strcpy(b,platform); strcat(b,"/dstart.o");
- strcpy(c,"-lc");
-#endif
-
-#ifdef WANT_DYNAMIC
- d=alloca(strlen(platform)+20);
- e=alloca(strlen(platform)+20);
-#ifdef __DYN_LIB
- strcpy(d,platform);
- strcpy(e,platform);
- if (shared)
- strcat(d,"/dyn_so_start.o");
-#ifdef INSTALLVERSION
- else
- strcat(d,"/dyn_dstart.o");
- strcat(e,"/dyn_dstop.o");
-#else
- else
- strcat(d,"/dyn_start.o");
- strcat(e,"/dyn_stop.o");
-#endif
-#else
- strcpy(d,platform); strcat(d,"/dyn_start.o");
- strcpy(e,platform); strcat(e,"/dyn_stop.o");
-#endif
-#endif
-
- dest=newargv;
- *dest++=argv[1];
-#ifndef __DYN_LIB
- if (_link) { *dest++=(char*)nostdlib; *dest++=dashstatic; *dest++=dashL; }
-#else
- /* avoid R_*_COPY relocations */
- *dest++="-fPIC";
- if (_link || shared) { *dest++=(char*)nostdlib; *dest++=dashL; }
-#endif
-#ifdef WANT_SAFEGUARD
- if (compile && !preprocess) {
- *dest++=safeguard1;
- *dest++=safeguard2;
- }
-#endif
- if (_link) { *dest++=b; }
-#ifdef WANT_DYNAMIC
- if (_link) { *dest++=d; }
-#endif
- for (i=2; i<argc; ++i) {
- if (mangleopts)
- if (argv[i][0]=='-' && (argv[i][1]=='O' || argv[i][1]=='f' || argv[i][1]=='m')) {
- if (strcmp(argv[i],"-fpic") && strcmp(argv[i],"-fno-pic"))
- continue;
- }
- *dest++=argv[i];
- }
-#ifndef __DYN_LIB
- if (compile || _link) *dest++=a;
-#else
- if (compile || _link || shared) *dest++=a;
-#endif
- *dest++="-D__dietlibc__";
- if (mangleopts) {
- const char **o=Os;
-
- {
- int fd;
- char* tmp=getenv("HOME");
- if (tmp) {
- if (strlen(tmp)+strlen(cc)<900) {
- strcpy(manglebuf,tmp);
- strcat(manglebuf,"/.diet/");
- strcat(manglebuf,cc);
- if ((fd=open(manglebuf,O_RDONLY))>=0) {
- int len=read(fd,manglebuf,1023);
- if (len>0) {
- int i;
- manglebuf[len]=0;
- *dest++=manglebuf;
- for (i=1; i<len; ++i) {
- if (manglebuf[i]==' ' || manglebuf[i]=='\n') {
- manglebuf[i]=0;
- if (i+1<len)
- *dest++=manglebuf+i+1;
- }
- }
- goto incorporated;
- }
- }
- }
- }
- }
- for (o=Os;*o;++o) {
- if (!strcmp(*o,shortplatform)) {
- ++o;
- while (*o) {
- *dest++=(char*)*o;
- ++o;
- }
- break;
- } else
- while (*o) ++o;
- }
- }
-incorporated:
- if (_link) {
- if (profile) *dest++="-lgmon";
- if (!strcmp(shortplatform,"sparc") || !strcmp(shortplatform,"sparc64")) {
- *dest++=(char*)libgcc; *dest++=c;
- } else {
- *dest++=c; *dest++=(char*)libgcc;
- }
- }
-#ifdef WANT_DYNAMIC
- if (_link) { *dest++=e; }
-#endif
-#ifdef __DYN_LIB
- if (shared){ *dest++=c; }
- f=alloca(strlen(platform)+100);
- if (_link) {
- strcpy(f,"-Wl,-dynamic-linker=");
- strcat(f,platform);
-// strcat(f,"/diet-linux.so");
- strcat(f,"/libdl.so");
- *dest++=f;
- }
-#endif
- *dest=0;
- if (verbose) {
- int i;
- for (i=0; newargv[i]; i++) {
- __write2(newargv[i]);
- __write2(" ");
- }
- __write2("\n");
- }
- execvp(newargv[0],newargv);
- goto error;
- } else if (!strcmp(tmp,"ld")) {
- }
- }
-donttouch:
- execvp(argv[1],argv+1);
-error:
- error("execvp() failed!\n");
- return 1;
-}
diff --git a/mdk-stage1/dietlibc/dietdirent.h b/mdk-stage1/dietlibc/dietdirent.h
deleted file mode 100644
index dbd7206a6..000000000
--- a/mdk-stage1/dietlibc/dietdirent.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/shm.h>
-
-struct __dirstream {
- int fd;
- char buf[PAGE_SIZE-(sizeof (int)*3)];
- unsigned int num;
- unsigned int cur;
-}; /* stream data from opendir() */
diff --git a/mdk-stage1/dietlibc/dietdns.h b/mdk-stage1/dietlibc/dietdns.h
deleted file mode 100644
index c4c1c5f72..000000000
--- a/mdk-stage1/dietlibc/dietdns.h
+++ /dev/null
@@ -1,4 +0,0 @@
-
-int __dns_gethostbyx_r(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop, int lookfor);
diff --git a/mdk-stage1/dietlibc/dietfeatures.h b/mdk-stage1/dietlibc/dietfeatures.h
deleted file mode 100644
index a7b84d5b9..000000000
--- a/mdk-stage1/dietlibc/dietfeatures.h
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef _DIETFEATURES_H
-#define _DIETFEATURES_H
-
-/* feel free to comment some of these out to reduce code size */
-
-/* #define WANT_FLOATING_POINT_IN_PRINTF */
-/* #define WANT_FLOATING_POINT_IN_SCANF */
-#define WANT_CHARACTER_CLASSES_IN_SCANF
-#define WANT_NULL_PRINTF
-/* #define WANT_LONGLONG_PRINTF */
-/* #define WANT_LONGLONG_SCANF */
-
-/* 128 or 2048 bytes buffer size? */
-/* #define WANT_SMALL_STDIO_BUFS */
-
-/* want fread to read() directly if size of data is larger than buffer?
- * This costs a few bytes but is worth it if the application is already
- * buffering. */
-#define WANT_FREAD_OPTIMIZATION
-
-/* this is only for meaningful for ttyname and sysconf_cpus so far */
-#define SLASH_PROC_OK
-
-/* use errno_location instead of errno */
-/* #define WANT_THREAD_SAFE */
-
-/* make the startcode, etc. dynamic aware ({con,de}structors) */
-/* #define WANT_DYNAMIC */
-
-/* do you want smaller or faster string routines? */
-/* #define WANT_FASTER_STRING_ROUTINES */
-
-/* define this to have strncpy zero-fill and not just zero-terminate the
- * string */
-/* #define WANT_FULL_POSIX_COMPAT */
-
-/* read the comment in lib/strncat.c for an explanation */
-/* #define WANT_NON_COMPLIANT_STRNCAT */
-
-/* #define WANT_LINKER_WARNINGS */
-
-/* you need to define this if you want to run your programs with large
- * file support on kernel 2.2 or 2.0 */
-/* #define WANT_LARGEFILE_BACKCOMPAT */
-
-/* do you want localtime(3) to read /etc/localtime?
- * Needed for daylight saving time etc. */
-/* #define WANT_TZFILE_PARSER */
-
-/* do you want the DNS routines to parse and use "domain" and "search"
- * lines from /etc/resolv.conf? Normally not used on boot floppies and
- * embedded environments. */
-#define WANT_FULL_RESOLV_CONF
-
-/* do you want IPv6 transport support in the DNS resolver? */
-/* #define WANT_IPV6_DNS */
-
-/* do you want gethostbyname and friends to consult /etc/hosts? */
-#define WANT_ETC_HOSTS
-
-/* do you want gethostbyname to understand dotted decimal IP numbers
- * directly and not try to resolve them? */
-#define WANT_INET_ADDR_DNS
-
-/* do you want math functions high precision rather than fast/small? */
-/* #define WANT_HIGH_PRECISION_MATH */
-
-/* do you want support for matherr? */
-/* #define WANT_MATHERR */
-
-/* do you want crypt(3) to use MD5 if the salt starts with "$1$"? */
-/* #define WANT_CRYPT_MD5 */
-
-/* do you want diet to include a safeguard dependency to make linking
- * against glibc fail? This may fail with older binutils. */
-#define WANT_SAFEGUARD
-
-/* dy you want that malloc(0) return a pointer to a "zero-length" object
- * that is realloc-able; means realloc(..,size) gives a NEW object (like a
- * call to malloc(size)).
- * WARNING: this violates C99 */
-/* #define WANT_MALLOC_ZERO */
-
-
-/* stop uncommenting here ;-) */
-#ifndef WANT_FASTER_STRING_ROUTINES
-#define WANT_SMALL_STRING_ROUTINES
-#endif
-
-#ifdef WANT_THREAD_SAFE
-#ifndef __ASSEMBLER__
-#define errno (*__errno_location())
-#define _REENTRANT
-#endif
-#endif
-
-#ifdef __DYN_LIB
-/* with shared libraries you MUST have a dynamic aware startcode */
-#ifndef WANT_DYNAMIC
-#define WANT_DYNAMIC
-#endif
-/* saveguard crashes with shared objects ... */
-#ifdef WANT_SAFEGUARD
-#undef WANT_SAFEGUARD
-#endif
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/dieticonv.h b/mdk-stage1/dietlibc/dieticonv.h
deleted file mode 100644
index 540ef2f6f..000000000
--- a/mdk-stage1/dietlibc/dieticonv.h
+++ /dev/null
@@ -1,12 +0,0 @@
-enum charset {
- INVALID=0,
- ISO_8859_1,
- UTF_8,
- UCS_2,
- UCS_4
-};
-
-#define ic_from(x) (((x) )&0xffff)
-#define ic_to(x) (((x)>>16)&0xffff)
-
-#include <iconv.h>
diff --git a/mdk-stage1/dietlibc/dietlibm.h b/mdk-stage1/dietlibc/dietlibm.h
deleted file mode 100644
index fe735e40d..000000000
--- a/mdk-stage1/dietlibc/dietlibm.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <sys/types.h>
-
-double __poly(double x, size_t n, const double* c);
-double exp2(double x);
-double log2(double x);
diff --git a/mdk-stage1/dietlibc/dietstdio.h b/mdk-stage1/dietlibc/dietstdio.h
deleted file mode 100644
index 2e0e93601..000000000
--- a/mdk-stage1/dietlibc/dietstdio.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* diet stdio */
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include "dietfeatures.h"
-#ifdef WANT_THREAD_SAFE
-#include <pthread.h>
-#endif
-#include <stdarg.h>
-
-#ifdef WANT_SMALL_STDIO_BUFS
-#define BUFSIZE 128
-#else
-#define BUFSIZE 2048
-#endif
-
-struct __stdio_file {
- int fd;
- int flags;
- unsigned int bs; /* read: bytes in buffer */
- unsigned int bm; /* position in buffer */
- unsigned int buflen; /* length of buf */
- char *buf;
- struct __stdio_file *next; /* for fflush */
- pid_t popen_kludge;
- unsigned char ungetbuf;
- char ungotten;
-#ifdef WANT_THREAD_SAFE
- pthread_mutex_t m;
-#endif
-};
-
-#define ERRORINDICATOR 1
-#define EOFINDICATOR 2
-#define BUFINPUT 4
-#define BUFLINEWISE 8
-#define NOBUF 16
-#define STATICBUF 32
-#define FDPIPE 64
-
-#define _IONBF 0
-#define _IOLBF 1
-#define _IOFBF 2
-
-#include <stdio.h>
-
-/* internal function to flush buffer.
- * However, if next is BUFINPUT and the buffer is an input buffer, it
- * will not be flushed. Vice versa for output */
-extern int __fflush4(FILE *stream,int next);
-extern int __buffered_outs(const char *s,size_t len);
-
-/* ..scanf */
-struct arg_scanf {
- void *data;
- int (*getch)(void*);
- int (*putch)(int,void*);
-};
-
-int __v_scanf(struct arg_scanf* fn, const unsigned char *format, va_list arg_ptr);
-
-struct arg_printf {
- void *data;
- int (*put)(void*,size_t,void*);
-};
-
-int __v_printf(struct arg_printf* fn, const unsigned char *format, va_list arg_ptr);
-
-extern FILE *__stdio_root;
-
-int __fflush_stdin(void);
-int __fflush_stdout(void);
-int __fflush_stderr(void);
-
-FILE* __stdio_init_file(int fd,int closeonerror);
-int __stdio_parse_mode(const char *mode);
-void __stdio_flushall(void);
diff --git a/mdk-stage1/dietlibc/dietuglyweaks.h b/mdk-stage1/dietlibc/dietuglyweaks.h
deleted file mode 100644
index 4b2aa231a..000000000
--- a/mdk-stage1/dietlibc/dietuglyweaks.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __DIET_UGLY_WEAKS__
-#define __DIET_UGLY_WEAKS__
-
-/* if you change something here ... KNOW what you're doing !
- * it'll effect ALL platforms ! */
-
-.weak __thread_doexit
-__thread_doexit:
-.weak __fflush_stdin
-__fflush_stdin:
-.weak __fflush_stdout
-__fflush_stdout:
-.weak __fflush_stderr
-__fflush_stderr:
-.weak flockfile
-flockfile:
-.weak funlockfile
-funlockfile:
-.weak __nop
-__nop:
-.global __you_tried_to_link_a_dietlibc_object_against_glibc
-__you_tried_to_link_a_dietlibc_object_against_glibc:
-
-#endif
diff --git a/mdk-stage1/dietlibc/dietwarning.h b/mdk-stage1/dietlibc/dietwarning.h
deleted file mode 100644
index f7c67a175..000000000
--- a/mdk-stage1/dietlibc/dietwarning.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "dietfeatures.h"
-
-#ifdef WANT_LINKER_WARNINGS
-
-#ifndef __ASSEMBLER__
-
-#define link_warning(symbol,msg) \
- asm (".section .gnu.warning." symbol "\n\t.string \"" msg "\"\n\t.previous");
-
-#else
-
-#define link_warning(symbol,msg) \
- .section .gnu.warning.##symbol ;\
- .string msg ;\
- .previous
-
-#endif
-
-#else
-
-#define link_warning(foo,bar)
-
-#endif
diff --git a/mdk-stage1/dietlibc/dyn_start.c b/mdk-stage1/dietlibc/dyn_start.c
deleted file mode 100644
index 391797e12..000000000
--- a/mdk-stage1/dietlibc/dyn_start.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "dietfeatures.h"
-
-#ifdef WANT_DYNAMIC
-#include <stdlib.h>
-
-typedef void(*structor)(void);
-
-__attribute__((section(".ctors")))
-static structor __CTOR_LIST__[1]={((structor)-1)};
-
-__attribute__((section(".dtors")))
-static structor __DTOR_LIST__[1]={((structor)-1)};
-
-static void __do_global_dtors_aux(void)
-{
- structor *df=__CTOR_LIST__; /* ugly trick to prevent warning */
- for (df=((__DTOR_LIST__)+1);(*df) != (structor)0; df++) (*df)();
-}
-
-void _fini(void) __attribute__((section(".fini")));
-__attribute__((section(".fini"))) void _fini(void)
-{
- __do_global_dtors_aux();
-}
-
-#ifndef __DYN_LIB_SHARED
-/* pre main, post _start */
-int _dyn_start(int argc, char **argv, char **envp, structor dl_init);
-int _dyn_start(int argc, char **argv, char **envp, structor dl_init)
-{
- static __attribute__((section(".init"))) void _init(void);
- int main(int argc, char **argv, char **envp);
-
- if (dl_init) atexit(dl_init);
- _init();
- atexit(_fini);
- return main(argc, argv, envp);
-}
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/dyn_stop.c b/mdk-stage1/dietlibc/dyn_stop.c
deleted file mode 100644
index 7213a8089..000000000
--- a/mdk-stage1/dietlibc/dyn_stop.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "dietfeatures.h"
-
-#ifdef WANT_DYNAMIC
-typedef void(*structor)(void);
-
-__attribute__((section(".ctors")))
-static structor __CTOR_END__[1]={((structor)0)};
-
-__attribute__((section(".dtors")))
-static structor __DTOR_END__[1]={((structor)0)};
-
-static void __do_global_ctors_aux(void)
-{
- structor *cf=__DTOR_END__; /* ugly trick to prevent warning */
- for(cf=((__CTOR_END__)-1); (*cf) != (structor)-1; cf--) (*cf)();
-}
-
-void _init() __attribute__((section(".init")));
-__attribute__((section(".init"))) void _init()
-{
- __do_global_ctors_aux();
-}
-#endif
diff --git a/mdk-stage1/dietlibc/findcflags.sh b/mdk-stage1/dietlibc/findcflags.sh
deleted file mode 100755
index 8b8b3d74a..000000000
--- a/mdk-stage1/dietlibc/findcflags.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-version=`${1:-gcc} -v 2>&1 |sed -n '/gcc version/ {s/gcc version //;p;}'`
-case $version in
- 2.9*) echo -march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2 ;;
- 3.0*) echo -march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2 ;;
- 3*) echo -Os -fomit-frame-pointer -falign-functions=0 -falign-jumps=0 -falign-loops=0 -mpreferred-stack-boundary=2;;
- *) echo -O2 -pipe -fomit-frame-pointer ;;
-esac
diff --git a/mdk-stage1/dietlibc/i386/Makefile.add b/mdk-stage1/dietlibc/i386/Makefile.add
deleted file mode 100644
index 83b18ae29..000000000
--- a/mdk-stage1/dietlibc/i386/Makefile.add
+++ /dev/null
@@ -1,8 +0,0 @@
-
-M:=$(shell ./findcflags.sh $(CC))
-LIBOBJ+=$(OBJDIR)/__ten.o $(OBJDIR)/md5asm.o $(OBJDIR)/mmap64.o
-LIBMATH+=acos.o asin.o atan.o atan2.o ceil.o cos.o exp.o exp10.o exp2.o expm1.o fabs.o floor.o hypot.o log.o log10.o log2.o sin.o sqrt.o tan.o copysign.o sincos.o __half.o ldexp.o pow.o ilogb.o cbrt.o log1p.o sqrtl.o fmod.o libm2.o
-#CFLAGS+=-march=i386 -Os -fomit-frame-pointer -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mpreferred-stack-boundary=2
-CFLAGS+=$(M)
-VPATH:=i386:syscalls.s:$(VPATH)
-LIBGMON_OBJS+=$(OBJDIR)/mcount.o
diff --git a/mdk-stage1/dietlibc/i386/PIC.h b/mdk-stage1/dietlibc/i386/PIC.h
deleted file mode 100644
index 45ddeb446..000000000
--- a/mdk-stage1/dietlibc/i386/PIC.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef __I386_PIC_H__
-#define __I386_PIC_H__
-#ifdef __DYN_LIB
-
-#if 1
-/* don't trash the athlon return stack */
-.text
-.Lgetpic:
- mov (%esp),%ebx
- ret
-
-.macro PIC_INIT
- call .Lgetpic
- addl $_GLOBAL_OFFSET_TABLE_, %ebx
-.endm
-#else
-/* standard code for PIC init */
-.macro PIC_INIT
- call 0f
-0: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-0b], %ebx
-.endm
-#endif
-
-#define PIC_SAVE pushl %ebx
-#define PIC_RESTORE popl %ebx
-
-
-/* get memory variable (var) in register (reg) */
-.macro GET_VAR var reg
- movl \var@GOT(%ebx), \reg
- movl (\reg), \reg
-.endm
-
-/* put register (reg) into memory variable (var) TRASH register (tmp) */
-.macro PUT_VAR reg var tmp
- movl \var@GOT(%ebx), \tmp
- movl \reg, (\tmp)
-.endm
-
-/* get memory variable (var) in register (reg)
- * IF no more PIC-code is needed */
-.macro GET_1VAR var reg
- PIC_SAVE
- PIC_INIT
- GET_VAR \var, \reg
- PIC_RESTORE
-.endm
-
-/* put register (reg) into memory variable (var)
- * IF no more PIC-code is needed */
-.macro PUT_1VAR reg var
- PIC_SAVE
- PIC_INIT
- PUT_VAR \reg, \var, %ebx
- PIC_RESTORE
-.endm
-
-#else
-
-#define PIC_SAVE
-#define PIC_RESTORE
-#define PIC_INIT
-
-.macro GET_VAR var reg
- movl \var, \reg
-.endm
-
-.macro PUT_VAR reg var tmp
- movl \reg, \var
-.endm
-
-.macro GET_1VAR var reg
- GET_VAR \var, \reg
-.endm
-
-.macro PUT_1VAR reg var
- PUT_VAR \reg, \var, none
-.endm
-
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/i386/__half.S b/mdk-stage1/dietlibc/i386/__half.S
deleted file mode 100644
index 6355c93e4..000000000
--- a/mdk-stage1/dietlibc/i386/__half.S
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Definiert Konstante (float)0.5 unter dem Namen __half
-# Wird von etlichen Funktionen benutzt (sinh, cosh, atanh)
-#
-
-.global __half
-.data
-.type __half,@object
-.size __half,4
-__half: .long 0x3f000000
diff --git a/mdk-stage1/dietlibc/i386/__longjmp.S b/mdk-stage1/dietlibc/i386/__longjmp.S
deleted file mode 100644
index a09191f0b..000000000
--- a/mdk-stage1/dietlibc/i386/__longjmp.S
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <setjmp.h>
-
-.text
-.global __longjmp
-.type __longjmp,@function
-__longjmp:
- movl 4(%esp), %ecx /* User's jmp_buf in %ecx. */
- movl 8(%esp), %eax /* Second argument is return value. */
- /* Save the return address now. */
- movl (JB_PC*4)(%ecx), %edx
- /* Restore registers. */
- movl (JB_BX*4)(%ecx), %ebx
- movl (JB_SI*4)(%ecx), %esi
- movl (JB_DI*4)(%ecx), %edi
- movl (JB_BP*4)(%ecx), %ebp
- movl (JB_SP*4)(%ecx), %esp
- /* Jump to saved PC. */
- jmp *%edx
-.size __longjmp,.-__longjmp;
diff --git a/mdk-stage1/dietlibc/i386/__ten.S b/mdk-stage1/dietlibc/i386/__ten.S
deleted file mode 100644
index 47b9431f4..000000000
--- a/mdk-stage1/dietlibc/i386/__ten.S
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Definiert Konstante (float)10. unter dem Namen __ten
-#
-
-.global __ten
-.data
-.type __ten,@object
-.size __ten,4
-__ten: .long 0x41200000
diff --git a/mdk-stage1/dietlibc/i386/__testandset.S b/mdk-stage1/dietlibc/i386/__testandset.S
deleted file mode 100644
index 29b02d57a..000000000
--- a/mdk-stage1/dietlibc/i386/__testandset.S
+++ /dev/null
@@ -1,9 +0,0 @@
-.text
-.global __testandset
-.type __testandset,@function
-__testandset:
- xorl %eax, %eax
- movl 0x4(%esp),%edx
- incl %eax
- xchgl %eax,(%edx)
- ret
diff --git a/mdk-stage1/dietlibc/i386/accept.S b/mdk-stage1/dietlibc/i386/accept.S
deleted file mode 100644
index d8be36a54..000000000
--- a/mdk-stage1/dietlibc/i386/accept.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(accept,ACCEPT)
diff --git a/mdk-stage1/dietlibc/i386/acos.S b/mdk-stage1/dietlibc/i386/acos.S
deleted file mode 100644
index baabf9f04..000000000
--- a/mdk-stage1/dietlibc/i386/acos.S
+++ /dev/null
@@ -1,30 +0,0 @@
-
-.text
-
-.global acosf,acos,acosl # ,__acos
- .type acosf,@function
- .type acos,@function
- .type acosl,@function
-# .type __acos,@function
-acosf:
- flds 4(%esp)
- jmp __acos
-acosl:
- fldt 4(%esp)
- jmp __acos
-acos:
- fldl 4(%esp)
-__acos:
- fld %st
- fmul %st
- fld1
- fsubp
- fsqrt
- fxch %st(1)
- fpatan
- ret
-
-.ende:
-.size acos,.ende-acos
-.size acosf,.ende-acosf
-.size acosl,.ende-acosl
diff --git a/mdk-stage1/dietlibc/i386/acosh.S b/mdk-stage1/dietlibc/i386/acosh.S
deleted file mode 100644
index 0611c9d31..000000000
--- a/mdk-stage1/dietlibc/i386/acosh.S
+++ /dev/null
@@ -1,18 +0,0 @@
-.text
-.global acosh
-.type acosh,@function
-
-acosh:
- fldln2
- fldl 4(%esp)
- fld %st(0)
- fmul %st(0),%st(0)
- fld1
- fsubrp %st(0),%st(1)
- fsqrt
- faddp %st(0),%st(1)
- fyl2x
- ret
-
-.Lende:
- .size acosh,.Lende-acosh
diff --git a/mdk-stage1/dietlibc/i386/asin.S b/mdk-stage1/dietlibc/i386/asin.S
deleted file mode 100644
index 7b0c31407..000000000
--- a/mdk-stage1/dietlibc/i386/asin.S
+++ /dev/null
@@ -1,29 +0,0 @@
-
-.text
-
-.global asinf,asin,asinl # ,__asin
- .type asinf,@function
- .type asin,@function
- .type asinl,@function
-# .type __asin,@function
-asinf:
- flds 4(%esp)
- jmp __asin
-asinl:
- fldt 4(%esp)
- jmp __asin
-asin:
- fldl 4(%esp)
-__asin:
- fld %st
- fmul %st
- fld1
- fsubp
- fsqrt
- fpatan
- ret
-
-.ende:
-.size asin,.ende-asin
-.size asinf,.ende-asinf
-.size asinl,.ende-asinl
diff --git a/mdk-stage1/dietlibc/i386/asinh.S b/mdk-stage1/dietlibc/i386/asinh.S
deleted file mode 100644
index 8c3964392..000000000
--- a/mdk-stage1/dietlibc/i386/asinh.S
+++ /dev/null
@@ -1,18 +0,0 @@
-.text
-.global asinh
-.type asinh,@function
-
-asinh:
- fldln2
- fldl 4(%esp)
- fld %st(0)
- fmul %st(0),%st(0)
- fld1
- faddp %st(0),%st(1)
- fsqrt
- faddp %st(0),%st(1)
- fyl2x
- ret
-
-.Lende:
- .size asinh,.Lende-asinh
diff --git a/mdk-stage1/dietlibc/i386/atan.S b/mdk-stage1/dietlibc/i386/atan.S
deleted file mode 100644
index 76513f928..000000000
--- a/mdk-stage1/dietlibc/i386/atan.S
+++ /dev/null
@@ -1,27 +0,0 @@
-
-.text
-
-.global atanf,atan,atanl
- .type atanf,@function
- .type atan,@function
- .type atanl,@function
-atanf:
- flds 4(%esp)
- fld1
- fpatan
- ret
-atan:
- fldl 4(%esp)
- fld1
- fpatan
- ret
-atanl:
- fldt 4(%esp)
- fld1
- fpatan
- ret
-
-.ende:
-.size atan,.ende-atan
-.size atanf,.ende-atanf
-.size atanl,.ende-atanl
diff --git a/mdk-stage1/dietlibc/i386/atan2.S b/mdk-stage1/dietlibc/i386/atan2.S
deleted file mode 100644
index acf6e03ae..000000000
--- a/mdk-stage1/dietlibc/i386/atan2.S
+++ /dev/null
@@ -1,12 +0,0 @@
-
-.text
-.type atan2,@function
-.global atan2
-atan2:
- fldl 4(%esp)
- fldl 12(%esp)
- fpatan
- ret
-
-.ende:
-.size atan2,.ende-atan2
diff --git a/mdk-stage1/dietlibc/i386/atanh.S b/mdk-stage1/dietlibc/i386/atanh.S
deleted file mode 100644
index b75f0fa8e..000000000
--- a/mdk-stage1/dietlibc/i386/atanh.S
+++ /dev/null
@@ -1,19 +0,0 @@
-.text
-.global atanh
-.type atanh,@function
-
-atanh:
- fldln2
- fldl 4(%esp)
- fld1
- fld %st(1)
- fadd %st(1),%st(0)
- fxch %st(1)
- fsubp %st(0),%st(2)
- fdivp %st(0),%st(1)
- fyl2x
- fmuls __half
- ret
-
-.Lende:
- .size atanh,.Lende-atanh
diff --git a/mdk-stage1/dietlibc/i386/atol.S b/mdk-stage1/dietlibc/i386/atol.S
deleted file mode 100644
index 5bd7f2c24..000000000
--- a/mdk-stage1/dietlibc/i386/atol.S
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright (C) 2001, 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- atol.S
- i386 assembler implementation of atoi(3) & atol(3)
-*/
-
-.text
-.globl atoi
-.globl atol
-.type atoi,@function
-.type atol,@function
-
-atoi:
-atol:
- pushl %esi
- movl 0x8(%esp), %esi
- xorl %eax, %eax
- xorl %edx, %edx
- xorb %cl, %cl
-.LSpace:
- lodsb
- cmpb $0x21, %al
- jng .LSpace
- cmpb $'+', %al
- jz .Lfe5
- cmpb $'-', %al
- jnz .Lfe3
- inc %cl
- jmp .Lfe5
-.Lfe2:
- imul $0xa, %edx
- addl %eax, %edx
-.Lfe5:
- lodsb
-.Lfe3:
- cmpb $47, %al
- jng .Lout
- subb $('0'), %al
- cmpb $9, %al
- jng .Lfe2
-.Lout:
- movl %edx, %eax
- or %cl, %cl
- jz .Lreturn
- negl %eax
-.Lreturn:
- popl %esi
- ret
-.size atoi, . - atoi
-.size atol, . - atol
diff --git a/mdk-stage1/dietlibc/i386/atoll.S b/mdk-stage1/dietlibc/i386/atoll.S
deleted file mode 100644
index 093bf762a..000000000
--- a/mdk-stage1/dietlibc/i386/atoll.S
+++ /dev/null
@@ -1,64 +0,0 @@
-
-.text
-.type atoll,@function
-.global atoll
-
-atoll:
- movl 4(%esp),%ecx
- push %edi
-
- xorl %edi,%edi # sign = 0
-
- decl %ecx
-.Lspaces:
- incl %ecx # while ( isspace(*p) ) p++;
- movb (%ecx),%al
- cmpb $' ',%al
- je .Lspaces
- subb $9,%al
- cmpb $5,%al
- jc .Lspaces # c = *p - 9;
-
- cmpb $'+'-9,%al # if ( c == '+' - 9 ) p++;
- je .Lpos
- cmpb $'-'-9,%al # else if ( c == '-' - 9 ) sign = -sign, p++;
- jne .Lnosign
- decl %edi
-.Lpos: incl %ecx
-.Lnosign:
-
- push %ebx
- push %esi
- push %ebp
- movl $10,%ebp
-
- xorl %esi,%esi # Hi(value) = 0;
- xorl %eax,%eax # Lo(value) = 0;
-.Lcont: movzbl (%ecx),%ebx # while ( (unsigned) (*p - '0') < 10 )
- inc %ecx
- subl $'0',%ebx
- cmpl %ebp,%ebx
- jnc .Lfini
- imull %ebp,%esi # value *= 10,
- mull %ebp
- addl %edx,%esi
- addl %ebx,%eax # value += (*p - '0');
- adcl $0,%esi
- jmp .Lcont
-
-.Lfini: xchg %edx,%esi # return sign== 0 ? +value
- xorl %edi,%eax # sign==-1 ? -value
- xorl %edi,%edx
- subl %edi,%eax
- sbbl %edi,%edx
-
- pop %ebp
- pop %esi
- pop %ebx
- pop %edi
- ret
-
-.Lende:
-
-.size atoll,.Lende-atoll
-
diff --git a/mdk-stage1/dietlibc/i386/bind.S b/mdk-stage1/dietlibc/i386/bind.S
deleted file mode 100644
index caff9bb8b..000000000
--- a/mdk-stage1/dietlibc/i386/bind.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(bind,BIND)
diff --git a/mdk-stage1/dietlibc/i386/cbrt.S b/mdk-stage1/dietlibc/i386/cbrt.S
deleted file mode 100644
index 9d8aebd1e..000000000
--- a/mdk-stage1/dietlibc/i386/cbrt.S
+++ /dev/null
@@ -1,46 +0,0 @@
-.text
-
-tab: .byte 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4
- .byte 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9
- .byte 10,10,11,11,12,12,12,13,13,14,14,14,15,15,15,16
-
-_3: .long 0x40400000
-
-
-.global cbrt
-cbrt:
- fldl 4(%esp)
- movw 10(%esp),%ax
- movb %ah,%ch
- andw $0x7FFF,%ax
- jz zero /* cbrt(0) = 0 */
- pushl %ebx
- cwd
- movl $16*3,%ebx /* AX 3FE0 3FF0 4000 4010 */
- divw %bx /* AX 154 155 155 155 */
- /* DX 20 0 10 20 */
- shlw $5,%ax
- addb %ch,%ch
- rcrw %ax /* AX 1540 1550 1550 1550 */
- addw $0x3FF0-0x1550,%ax /* AX 3FE0 3FF0 3FF0 3FF0 */
- movw %dx,%bx
- addb tab(%ebx),%al
- adcb $0,%ah
- popl %ebx
- movw %ax,10(%esp)
- fldl 4(%esp) /* y x */
-
- movl $4,%ecx
-lop:
- fld %st(0) /* y y x */
- fmul %st(0),%st(0) /* y^2 y x */
- fdivr %st(2),%st(0) /* x/y^2 y x */
- fadd %st(1),%st(0) /* x/y^2+y y x */
- faddp /* x/y^2+2y x */
- fdivs _3 /* y' x */
- loop lop
-
- fstp %st(1) /* y' */
-zero:
- ret
-
diff --git a/mdk-stage1/dietlibc/i386/ceil.S b/mdk-stage1/dietlibc/i386/ceil.S
deleted file mode 100644
index e6a4e989c..000000000
--- a/mdk-stage1/dietlibc/i386/ceil.S
+++ /dev/null
@@ -1,44 +0,0 @@
-.text
-
-.global ceilf,ceil,ceill,__flcetr
- .type ceilf,@function
- .type ceil,@function
- .type ceill,@function
- .type __flcetr,@function
-
-ceilf:
- flds 4(%esp)
- movb $0x08,%ah
- jmp __flcetr
-
-ceill:
- fldt 4(%esp)
- movb $0x08,%ah
- jmp __flcetr
-
-ceil:
- fldl 4(%esp)
- movb $0x08,%ah
-
-# Wspolny kod dla funkcji floor, ceil i trunc
-# W ah maska bitow 11 i 10 rejestru sterowania koprocesora
-__flcetr:
- xorl %ecx,%ecx # wyzerowanie rejestru
- movb %ah,%ch # i utworzenie maski w cx
- pushl %eax # krotsze niz subl $4,%esp
- fstcw (%esp)
- movw (%esp),%ax
- andb $0x03,%ah # wyzerowanie bitow 11 i 10
- orl %ecx,%eax # ustawienie bitow z maski
- movw %ax,2(%esp)
- fldcw 2(%esp)
- frndint
- fldcw (%esp) # odtworzenie rejestru sterowania
- popl %eax # i polozenia stosu
- ret
-
-.Lende:
-.size ceil,.Lende-ceil
-.size ceill,.Lende-ceill
-.size ceilf,.Lende-ceilf
-.size flcetr,.Lende-__flcetr
diff --git a/mdk-stage1/dietlibc/i386/clone.S b/mdk-stage1/dietlibc/i386/clone.S
deleted file mode 100644
index ea43bc2e2..000000000
--- a/mdk-stage1/dietlibc/i386/clone.S
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "syscalls.h"
-#include <errno.h>
-#include "PIC.h"
-
-.text
-.type clone,@function
-.weak clone
-clone:
-.type __clone,@function
-.global __clone
-__clone:
- mov $-EINVAL, %eax
-
- movl 4(%esp), %ecx /* have non null thread_funcion */
- jecxz .Lclone_error
-
- movl 8(%esp), %ecx /* have non null child_stack pointer */
- jecxz .Lclone_error
-
- /* put the parameter on thread stack */
- subl $8, %ecx
-
- movl 16(%esp), %eax /* arg */
- movl %eax, 4(%ecx)
-
- movl 4(%esp), %eax /* thread_func */
- movl %eax, 0(%ecx)
-
- /* the syscall */
- pushl %ebx
- movl 16(%esp), %ebx /* flags */
- movl $__NR_clone, %eax
- int $0x80
- popl %ebx
-
- testl %eax, %eax
- jl .Lclone_error
- jne .Lreturn
-.Lstart_thread:
- xorl %ebp,%ebp
- call *%ebx
- pushl %eax
- call _exit
-
-.Lclone_error:
- negl %eax
- pushl %eax
-#ifdef PIC
- pushl %ebx
- PIC_INIT
- call __errno_location@PLT
- popl %ebx
-#else
- call __errno_location
-#endif
- popl %ecx
- movl %ecx, (%eax)
- orl $-1, %eax
-.Lreturn:
- ret
diff --git a/mdk-stage1/dietlibc/i386/connect.S b/mdk-stage1/dietlibc/i386/connect.S
deleted file mode 100644
index a295a8814..000000000
--- a/mdk-stage1/dietlibc/i386/connect.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(connect,CONNECT)
diff --git a/mdk-stage1/dietlibc/i386/copysign.S b/mdk-stage1/dietlibc/i386/copysign.S
deleted file mode 100644
index 3a495efee..000000000
--- a/mdk-stage1/dietlibc/i386/copysign.S
+++ /dev/null
@@ -1,18 +0,0 @@
-
-.text
-.type copysign,@function
-.global copysign
-
-# double copysign ( double value, double sign );
-
-copysign:
- movb 12+7(%esp),%al
- movb 4+7(%esp),%ah
- andw $0x7F80,%ax
- orb %ah,%al
- movb 4+7(%esp),%al
- fldl 4(%esp)
- ret
-
-.ende:
-.size copysign,.ende-copysign
diff --git a/mdk-stage1/dietlibc/i386/cos.S b/mdk-stage1/dietlibc/i386/cos.S
deleted file mode 100644
index f95c81ca7..000000000
--- a/mdk-stage1/dietlibc/i386/cos.S
+++ /dev/null
@@ -1,35 +0,0 @@
-.text
-
-.global cosf,cos,cosl
-.type cosf,@function
-.type cos,@function
-.type cosl,@function
-
-cosf:
- flds 4(%esp)
- jmp 1f
-cos:
- fldl 4(%esp)
-1:
- fcos
- fnstsw %ax
- testb $0x04, %ah
- je 3f
- fldpi
- fadd %st
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testb $0x04, %ah
- jne 2b
- fstp %st(1)
- fcos
-3: ret
-cosl:
- fldt 4(%esp)
- jmp 1b
-
-.Lende:
-.size cos,.Lende-cos
-.size cosl,.Lende-cosl
-.size cosf,.Lende-cosf
diff --git a/mdk-stage1/dietlibc/i386/cosh.S b/mdk-stage1/dietlibc/i386/cosh.S
deleted file mode 100644
index f6a33704d..000000000
--- a/mdk-stage1/dietlibc/i386/cosh.S
+++ /dev/null
@@ -1,29 +0,0 @@
-
-.text
-.type cosh,@function
-.global cosh
-
-cosh: # note: exp(x) = 2^(x*log2(e))
- fldl2e
- fmull 4(%esp) # x*log2(e)
- fld %st(0) # x*log2(e) x*log2(e)
- frndint # int(x*log2(e)) x*log2(e)
- fxch # x*log2(e) int(x*log2(e))
- fsub %st(1),%st(0) # frac(x*log2(e)) int(x*log2(e))
- f2xm1 # 2^(fract(x*log2(e)))-1 int(x*log2(e))
- fld1 # 1 2^(fract(x*log2(e)))-1 int(x*log2(e))
- faddp %st(0),%st(1) # 2^(fract(x*log2(e))) int(x*log2(e))
- fscale # 2^(x*log2(e)) int(x*log2(e))
- fstp %st(1) # 2^(x*log2(e))
-
-# now we have y = exp(x), but cosh(x) = (y + 1/y) * 0.5
-
- fld1
- fdiv %st(1),%st(0)
- faddp
- fmuls __half
- ret
-
-.Lende:
-
-.size cosh,.ende-cosh
diff --git a/mdk-stage1/dietlibc/i386/dyn_syscalls.S b/mdk-stage1/dietlibc/i386/dyn_syscalls.S
deleted file mode 100644
index c4fd2fff5..000000000
--- a/mdk-stage1/dietlibc/i386/dyn_syscalls.S
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * dynamic unified-syscalls
- * Olaf Dreesen
- */
-
-#include "../syscalls.s/environ.S"
-#include "../syscalls.s/errno.S"
-
-#include <dietfeatures.h>
-#include "syscalls.h"
-#include "PIC.h"
-
-/* ok now include all syscalls.s (*.S) and sysdep *.S */
-
-#include "mmap.S"
-
-/* here on i386 I had split them some pre- some post-unified-syscall,
- * because the jumps pre-u.s.c. have only a 1 byte displacement. the first
- * post-u.s.c. have also 1 byte dsplacement the rest a 4 byte.
- * this pre/post split saves about 250 byte of code ....
- *
- * Please put additional syscalls AFTER the post-u.s.c.
- * or try to not break the savings :) */
-
-#include "select.S"
-
-#include "../syscalls.s/fork.S"
-#include "../syscalls.s/read.S"
-#include "../syscalls.s/write.S"
-#include "../syscalls.s/open.S"
-#include "../syscalls.s/close.S"
-#include "../syscalls.s/waitpid.S"
-
-#include "../syscalls.s/getgid.S"
-#include "../syscalls.s/getpgid.S"
-#include "../syscalls.s/getpid.S"
-#include "../syscalls.s/getppid.S"
-#include "../syscalls.s/getuid.S"
-#include "../syscalls.s/kill.S"
-#include "../syscalls.s/ioctl.S"
-#include "../syscalls.s/_llseek.S"
-#include "../syscalls.s/lseek.S"
-#include "../syscalls.s/lstat.S"
-#include "../syscalls.s/lstat64.S"
-#include "../syscalls.s/mkdir.S"
-#include "../syscalls.s/mprotect.S"
-#include "../syscalls.s/nanosleep.S"
-#include "../syscalls.s/pipe.S"
-#include "../syscalls.s/poll.S"
-#include "../syscalls.s/readv.S"
-#include "../syscalls.s/stat.S"
-#include "../syscalls.s/stat64.S"
-#include "../syscalls.s/truncate.S"
-#include "../syscalls.s/umask.S"
-#include "../syscalls.s/wait4.S"
-#include "../syscalls.s/writev.S"
-#include "../syscalls.s/__getpagesize.S"
-
-/* OK this is basicaly unified.S */
-.text
-.type __unified_syscall_256,@function
-__unified_syscall_256:
- movzwl %ax, %eax
- jmp .L23
-.L22:
-.size __unified_syscall_256,.L22-__unified_syscall_256
-.type exit,@function
-.weak exit
-exit:
-.type _exit,@function
-.global _exit
-_exit:
-__exit:
- mov $__NR_exit, %al
-__unified_syscall:
- movzbl %al, %eax
-.L23:
- push %edi
- push %esi
- push %ebx
- movl %esp,%edi
- movl 0x10(%edi),%ebx
- movl 0x14(%edi),%ecx
- movl 0x18(%edi),%edx
- movl 0x1c(%edi),%esi
- movl 0x20(%edi),%edi
- int $0x80
- cmp $-124,%eax
- jbe .Lnoerror
- neg %eax
-
- /* PIC-code Ohhhhh My. */
- push %eax
- PIC_INIT
- call __errno_location@PLT
- popl %ebx
- movl %ebx,(%eax)
- orl $-1,%eax
-.Lnoerror:
- pop %ebx
- pop %esi
- pop %edi
-#include "dietuglyweaks.h"
- ret
-
-#include "../syscalls.s/__pread.S"
-#include "../syscalls.s/__pwrite.S"
-#include "../syscalls.s/__reboot.S"
-#include "../syscalls.s/access.S"
-#include "../syscalls.s/adjtimex.S"
-#include "../syscalls.s/brk.S"
-#include "../syscalls.s/chdir.S"
-#include "../syscalls.s/chmod.S"
-#include "../syscalls.s/chown.S"
-#include "../syscalls.s/chroot.S"
-#include "../syscalls.s/dup.S"
-#include "../syscalls.s/dup2.S"
-#include "../syscalls.s/execve.S"
-#include "../syscalls.s/fchdir.S"
-#include "../syscalls.s/fchmod.S"
-#include "../syscalls.s/fchown.S"
-#include "../syscalls.s/fcntl.S"
-#include "../syscalls.s/flock.S"
-#include "../syscalls.s/fstat.S"
-#include "../syscalls.s/fstat64.S"
-#include "../syscalls.s/fstatfs.S"
-#include "../syscalls.s/fsync.S"
-#include "../syscalls.s/fdatasync.S"
-#include "../syscalls.s/ftruncate.S"
-#include "../syscalls.s/getcwd.S"
-#include "../syscalls.s/getdents.S"
-#include "../syscalls.s/getdents64.S"
-#include "../syscalls.s/getegid.S"
-#include "../syscalls.s/geteuid.S"
-#include "../syscalls.s/getgroups.S"
-#include "../syscalls.s/getitimer.S"
-#include "../syscalls.s/getpriority.S"
-#include "../syscalls.s/getresgid.S"
-#include "../syscalls.s/getresuid.S"
-#include "../syscalls.s/getrlimit.S"
-#include "../syscalls.s/getrusage.S"
-#include "../syscalls.s/getsid.S"
-#include "../syscalls.s/gettimeofday.S"
-#include "../syscalls.s/ioperm.S"
-#include "../syscalls.s/iopl.S"
-#include "../syscalls.s/ipc.S"
-#include "../syscalls.s/lchown.S"
-#include "../syscalls.s/link.S"
-#include "../syscalls.s/mknod.S"
-#include "../syscalls.s/mlock.S"
-#include "../syscalls.s/mlockall.S"
-#include "../syscalls.s/mount.S"
-#include "../syscalls.s/mremap.S"
-#include "../syscalls.s/munlockall.S"
-#include "../syscalls.s/munmap.S"
-#include "../syscalls.s/n_sigaction.S"
-#include "../syscalls.s/n_sigpending.S"
-#include "../syscalls.s/n_sigprocmask.S"
-#include "../syscalls.s/n_sigsuspend.S"
-#include "../syscalls.s/nice.S"
-#include "../syscalls.s/pause.S"
-#include "../syscalls.s/personality.S"
-#include "../syscalls.s/query_module.S"
-#include "../syscalls.s/init_module.S"
-#include "../syscalls.s/delete_module.S"
-#include "../syscalls.s/create_module.S"
-#include "../syscalls.s/readlink.S"
-#include "../syscalls.s/rename.S"
-#include "../syscalls.s/rmdir.S"
-#include "../syscalls.s/rt_sigaction.S"
-#include "../syscalls.s/rt_sigpending.S"
-#include "../syscalls.s/rt_sigprocmask.S"
-#include "../syscalls.s/rt_sigqueueinfo.S"
-#include "../syscalls.s/rt_sigsuspend.S"
-#include "../syscalls.s/rt_sigtimedwait.S"
-#include "../syscalls.s/sched_get_priority_max.S"
-#include "../syscalls.s/sched_get_priority_min.S"
-#include "../syscalls.s/sched_getparam.S"
-#include "../syscalls.s/sched_getscheduler.S"
-#include "../syscalls.s/sched_rr_get_interval.S"
-#include "../syscalls.s/sched_setparam.S"
-#include "../syscalls.s/sched_setscheduler.S"
-#include "../syscalls.s/sched_yield.S"
-#include "../syscalls.s/sendfile.S"
-#include "../syscalls.s/setdomainname.S"
-#include "../syscalls.s/setfsgid.S"
-#include "../syscalls.s/setfsuid.S"
-#include "../syscalls.s/setgid.S"
-#include "../syscalls.s/setgroups.S"
-#include "../syscalls.s/sethostname.S"
-#include "../syscalls.s/setitimer.S"
-#include "../syscalls.s/setpgid.S"
-#include "../syscalls.s/setpriority.S"
-#include "../syscalls.s/setregid.S"
-#include "../syscalls.s/setresgid.S"
-#include "../syscalls.s/setresuid.S"
-#include "../syscalls.s/setreuid.S"
-#include "../syscalls.s/setrlimit.S"
-#include "../syscalls.s/setsid.S"
-#include "../syscalls.s/setuid.S"
-#include "../syscalls.s/sigaltstack.S"
-#include "../syscalls.s/statfs.S"
-#include "../syscalls.s/stime.S"
-#include "../syscalls.s/swapoff.S"
-#include "../syscalls.s/swapon.S"
-#include "../syscalls.s/symlink.S"
-#include "../syscalls.s/sync.S"
-#include "../syscalls.s/sysctl.S"
-#include "../syscalls.s/sysinfo.S"
-#include "../syscalls.s/syslog.S"
-#include "../syscalls.s/time.S"
-#include "../syscalls.s/times.S"
-#include "../syscalls.s/umount.S"
-#include "../syscalls.s/umount2.S"
-#include "../syscalls.s/uname.S"
-#include "../syscalls.s/unlink.S"
-#include "../syscalls.s/utime.S"
-#include "../syscalls.s/vhangup.S"
-
-#include "../syscalls.s/chown32.S"
-#include "../syscalls.s/fchown32.S"
-#include "../syscalls.s/getegid32.S"
-#include "../syscalls.s/geteuid32.S"
-#include "../syscalls.s/getgid32.S"
-#include "../syscalls.s/getgroups32.S"
-#include "../syscalls.s/getresgid32.S"
-#include "../syscalls.s/getuid32.S"
-#include "../syscalls.s/lchown32.S"
-#include "../syscalls.s/setfsgid32.S"
-#include "../syscalls.s/setfsuid32.S"
-#include "../syscalls.s/setgid32.S"
-#include "../syscalls.s/setregid32.S"
-#include "../syscalls.s/setresgid32.S"
-#include "../syscalls.s/setreuid32.S"
-#include "../syscalls.s/setuid32.S"
-#include "../syscalls.s/alarm.S"
-#include "../syscalls.s/ptrace.S"
-#include "../syscalls.s/truncate64.S"
-#include "../syscalls.s/ftruncate64.S"
-#include "../syscalls.s/epoll_create.S"
-#include "../syscalls.s/epoll_ctl.S"
-#include "../syscalls.s/epoll_wait.S"
-
-#undef __PIC__
-#undef __socketcall
-/* oh what a kludge! */
-#define socketcall .Lsocketcall
-#include "../i386/send.S"
-#include "../i386/recv.S"
-#include "../i386/socket.S"
-#include "../i386/accept.S"
-#include "../i386/shutdown.S"
-#include "../i386/socketpair.S"
-#include "../i386/setsockopt.S"
-#include "../i386/sendto.S"
-#include "../i386/sendmsg.S"
-#include "../i386/recvmsg.S"
-#include "../i386/recvfrom.S"
-#include "../i386/listen.S"
-#include "../i386/getsockopt.S"
-#include "../i386/getsockname.S"
-#include "../i386/getpeername.S"
-#include "../i386/connect.S"
-#include "../i386/bind.S"
-#undef socketcall
-.Lsocketcall:
-#include "../i386/socketcall.S"
-#define __PIC__
-#undef __socketcall
-
-
-/* so now this was the last u.s.c. */
-
-/* other asm-files ... */
-#define PIC
-
-#define _exit __exit
-#include "clone.S"
-#undef _exit
-
-#include "__longjmp.S"
-#include "setjmp.S"
diff --git a/mdk-stage1/dietlibc/i386/exp.S b/mdk-stage1/dietlibc/i386/exp.S
deleted file mode 100644
index 6c82128e4..000000000
--- a/mdk-stage1/dietlibc/i386/exp.S
+++ /dev/null
@@ -1,35 +0,0 @@
-.text
-
-.global expf,exp,expl,__finexp
- .type expf,@function
- .type exp,@function
- .type expl,@function
- .type __finexp,@function
-expf:
- fldl2e
- fmuls 4(%esp)
- jmp __finexp
-expl:
- fldl2e
- fldt 4(%esp)
- fmulp
- jmp __finexp
-exp:
- fldl2e
- fmull 4(%esp)
-__finexp:
- fst %st(1)
- frndint
- fst %st(2)
- fsubrp
- f2xm1
- fld1
- faddp
- fscale
- ret
-
-.Lende:
-.size exp,.Lende-exp
-.size expl,.Lende-expl
-.size expf,.Lende-expf
-.size __finexp,.Lende-__finexp
diff --git a/mdk-stage1/dietlibc/i386/exp10.S b/mdk-stage1/dietlibc/i386/exp10.S
deleted file mode 100644
index 6223e5f85..000000000
--- a/mdk-stage1/dietlibc/i386/exp10.S
+++ /dev/null
@@ -1,27 +0,0 @@
-
-.text
-.type exp10,@function
-.global exp10
-.type pow10,@function
-.global pow10
-
-
-pow10:
-exp10: # note: 10^(x) = 2^(x*log2(10))
- fldl2t
- fmull 4(%esp) # x*log2(10)
- fld %st(0) # x*log2(10) x*log2(10)
- frndint # int(x*log2(10)) x*log2(10)
- fxch # x*log2(10) int(x*log2(10))
- fsub %st(1),%st(0) # frac(x*log2(10)) int(x*log2(10))
- f2xm1 # 2^(fract(x*log2(10)))-1 int(x*log2(10))
- fld1 # 1 2^(fract(x*log2(10)))-1 int(x*log2(10))
- faddp %st(0),%st(1) # 2^(fract(x*log2(10))) int(x*log2(10))
- fscale # 2^(x*log2(10)) int(x*log2(10))
- fstp %st(1) # 2^(x*log2(10))
- ret
-
-.ende:
-
-.size exp10,.ende-exp10
-.size pow10,.ende-pow10
diff --git a/mdk-stage1/dietlibc/i386/exp2.S b/mdk-stage1/dietlibc/i386/exp2.S
deleted file mode 100644
index d5389a22e..000000000
--- a/mdk-stage1/dietlibc/i386/exp2.S
+++ /dev/null
@@ -1,18 +0,0 @@
-.text
-.type exp2,@function
-.global exp2
-exp2: # note: exp2(x) = 2^x
- fldl 4(%esp) # x
- fld %st(0) # x x
- frndint # int(x) x
- fxch # x int(x)
- fsub %st(1),%st(0) # frac(x) int(x)
- f2xm1 # 2^(fract(x))-1 int(x)
- fld1 # 1 2^(fract(x))-1 int(x)
- faddp %st(0),%st(1) # 2^(fract(x)) int(x)
- fscale # 2^x int(x)
- fstp %st(1) # 2^x
- ret
-
-.ende:
-.size exp2,.ende-exp2
diff --git a/mdk-stage1/dietlibc/i386/expm1.S b/mdk-stage1/dietlibc/i386/expm1.S
deleted file mode 100644
index 677f4723f..000000000
--- a/mdk-stage1/dietlibc/i386/expm1.S
+++ /dev/null
@@ -1,23 +0,0 @@
-.text
-.type expm1,@function
-.global expm1
-expm1: # note: exp(x) = 2^(x*log2(e))
- fldl2e
- fmull 4(%esp) # x*log2(e)
- fld %st(0) # x*log2(e) x*log2(e)
- frndint # int(x*log2(e)) x*log2(e)
- fxch # x*log2(e) int(x*log2(e))
- fsub %st(1),%st(0) # frac(x*log2(e)) int(x*log2(e))
- f2xm1 # 2^(fract(x*log2(e)))-1 int(x*log2(e))
- fscale # 2^(x*log2(e))-2^int(x*log2(e)) int(x*log2(e))
- fxch # int(x*log2(e)) 2^(x*log2(e))-2^int(x*log2(e))
- fld1 # 1 int(x*log2(e)) 2^(x*log2(e))-2^int(x*log2(e))
- fscale # 2^int(x*log2(e)) int(x*log2(e)) 2^(x*log2(e))-2^int(x*log2(e))
- fstp %st(1) # 2^int(x*log2(e)) 2^(x*log2(e))-2^int(x*log2(e))
- fld1 # 1 2^int(x*log2(e)) 2^(x*log2(e))-2^int(x*log2(e))
- fsubrp %st(1) # 2^int(x*log2(e))-1 2^(x*log2(e))-2^int(x*log2(e))
- faddp %st(1)
- ret
-
-.ende:
-.size expm1,.ende-expm1
diff --git a/mdk-stage1/dietlibc/i386/fabs.S b/mdk-stage1/dietlibc/i386/fabs.S
deleted file mode 100644
index d9c1c2212..000000000
--- a/mdk-stage1/dietlibc/i386/fabs.S
+++ /dev/null
@@ -1,11 +0,0 @@
-
-.text
-.type fabs,@function
-.global fabs
-fabs:
- fldl 4(%esp)
- fabs
- ret
-
-.ende:
-.size fabs,.ende-fabs
diff --git a/mdk-stage1/dietlibc/i386/floor.S b/mdk-stage1/dietlibc/i386/floor.S
deleted file mode 100644
index af26d0c94..000000000
--- a/mdk-stage1/dietlibc/i386/floor.S
+++ /dev/null
@@ -1,26 +0,0 @@
-.text
-
-.global floorf,floor,floorl
- .type floorf,@function
- .type floor,@function
- .type floorf,@function
-
-floorf:
- flds 4(%esp)
- movb $0x04,%ah
- jmp __flcetr
-
-floor:
- fldl 4(%esp)
- movb $0x04,%ah
- jmp __flcetr
-
-floorl:
- fldt 4(%esp)
- movb $0x04,%ah
- jmp __flcetr
-
-.Lende:
-.size floor,.Lende-floor
-.size floorl,.Lende-floorl
-.size floorf,.Lende-floorf
diff --git a/mdk-stage1/dietlibc/i386/fmod.S b/mdk-stage1/dietlibc/i386/fmod.S
deleted file mode 100644
index 5bf4c06ab..000000000
--- a/mdk-stage1/dietlibc/i386/fmod.S
+++ /dev/null
@@ -1,37 +0,0 @@
-.text
-.type fmod,@function
-.type fmodf,@function
-.type fmodl,@function
-.type __fmod2pi,@function
-.global fmod, fmodl, fmodf, __fmod2pi
-
-__fmod2pi:
- fldpi
- fadd %st(0)
- fxch
- jmp .Lfmod
-
-fmodf:
- flds 8(%esp) # y
- flds 4(%esp) # x
- jmp .Lfmod
-fmod:
- fldl 12(%esp)
- fldl 4(%esp)
-.Lfmod:
- fprem
- fstsw %ax
- sahf
- jp .Lfmod
- ret
-
-fmodl:
- fldt 16(%esp)
- fldt 4(%esp)
- jmp .Lfmod
-
-
-.ende:
-.size fmod,.ende-fmod
-.size fmodl,.ende-fmodl
-.size fmodf,.ende-fmodf
diff --git a/mdk-stage1/dietlibc/i386/getenv.S b/mdk-stage1/dietlibc/i386/getenv.S
deleted file mode 100644
index dafbf37ee..000000000
--- a/mdk-stage1/dietlibc/i386/getenv.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "PIC.h"
-
-.text
-.global getenv
-.type getenv,@function
-getenv:
- pushl %esi
- pushl %edi
- movl 0xc(%esp), %edi
- cld
- movl %edi, %edx
- xorl %eax, %eax
- leal -1(%eax), %ecx
- repnz scasb
- not %ecx
- dec %ecx
- pushl %ecx
- movl (%edx), %ecx
-
- GET_1VAR environ, %esi # non-PIC: movl environ, %esi
- jmp .Lloop
-
-.Lprepare:
- movl (%edx), %ecx
- movl %eax, %esi
-.Lloop:
- lodsl
- or %eax, %eax
- jz .Lout
- cmpb %cl, (%eax)
- jnz .Lloop
-
- movl %edx, %edi
- xchg %esi, %eax
- movl (%esp), %ecx
- repz cmpsb
- jne .Lprepare
- or %ecx, %ecx
- jnz .Lprepare
- cmpb $'=', (%esi)
- jne .Lprepare
- leal 0x1(%esi), %eax
-.Lout:
- popl %ecx
- popl %edi
- popl %esi
- ret
-.size getenv, . - getenv
diff --git a/mdk-stage1/dietlibc/i386/getpeername.S b/mdk-stage1/dietlibc/i386/getpeername.S
deleted file mode 100644
index 833322941..000000000
--- a/mdk-stage1/dietlibc/i386/getpeername.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(getpeername,GETPEERNAME)
diff --git a/mdk-stage1/dietlibc/i386/getsockname.S b/mdk-stage1/dietlibc/i386/getsockname.S
deleted file mode 100644
index f0618481c..000000000
--- a/mdk-stage1/dietlibc/i386/getsockname.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(getsockname,GETSOCKNAME)
diff --git a/mdk-stage1/dietlibc/i386/getsockopt.S b/mdk-stage1/dietlibc/i386/getsockopt.S
deleted file mode 100644
index 23d7c2470..000000000
--- a/mdk-stage1/dietlibc/i386/getsockopt.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(getsockopt,GETSOCKOPT)
diff --git a/mdk-stage1/dietlibc/i386/htonl.S b/mdk-stage1/dietlibc/i386/htonl.S
deleted file mode 100644
index f3732d16a..000000000
--- a/mdk-stage1/dietlibc/i386/htonl.S
+++ /dev/null
@@ -1,13 +0,0 @@
-.text
-.global htonl
-.type htonl,@function
-.global ntohl
-.type ntohl,@function
-
-htonl:
-ntohl:
- movl 4(%esp),%eax
- xchgb %al,%ah
- rorl $16,%eax
- xchgb %al,%ah
- ret
diff --git a/mdk-stage1/dietlibc/i386/htons.S b/mdk-stage1/dietlibc/i386/htons.S
deleted file mode 100644
index 367d6d03c..000000000
--- a/mdk-stage1/dietlibc/i386/htons.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.global htons
-.type htons,@function
-.global ntohs
-.type ntohs,@function
-
-htons:
-ntohs:
- movzwl 4(%esp),%eax
- xchgb %al,%ah
- ret
diff --git a/mdk-stage1/dietlibc/i386/hypot.S b/mdk-stage1/dietlibc/i386/hypot.S
deleted file mode 100644
index 730b2c5c9..000000000
--- a/mdk-stage1/dietlibc/i386/hypot.S
+++ /dev/null
@@ -1,15 +0,0 @@
-
-.text
-.type hypot,@function
-.global hypot
-hypot:
- fldl 4(%esp)
- fmul %st(0),%st(0)
- fldl 12(%esp)
- fmul %st(0),%st(0)
- faddp
- fsqrt
- ret
-
-.ende:
-.size hypot,.ende-hypot
diff --git a/mdk-stage1/dietlibc/i386/ilogb.S b/mdk-stage1/dietlibc/i386/ilogb.S
deleted file mode 100644
index 3bebd88ba..000000000
--- a/mdk-stage1/dietlibc/i386/ilogb.S
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# int ilogb ( double x );
-#
-# returns (int) log2 (fabs(x)) for x!=0
-# returns MIN_INT for x==0
-#
-
-.text
-.global ilogb
-.type ilogb,@function
-
-ilogb:
- movl 8(%esp),%eax
- addl %eax,%eax
- jz .Lzero
- shrl $21,%eax
- subl $1023,%eax
- ret
-
-.Lzero:
- stc
- rcrl %eax
- ret
diff --git a/mdk-stage1/dietlibc/i386/ipow.S b/mdk-stage1/dietlibc/i386/ipow.S
deleted file mode 100644
index cca6a0ce1..000000000
--- a/mdk-stage1/dietlibc/i386/ipow.S
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# This is not standard, but often you only need such this function
-# which is much shorter than the generic pow() function.
-#
-# double ipow ( double mant, int expo );
-#
-
-.text
-.global ipow
-.type ipow,@function
-
-ipow: fld1
- movl 12(%esp),%ecx
- fldl 4(%esp)
- and %ecx,%ecx
- jns .Lstart
- negl %ecx
- fdivr %st(1),%st(0)
- jmp .Lstart
-
-.Lnext: fmul %st(0),%st(0)
-.Lstart:shrl %ecx
- jnc .Lnomul
- fmul %st(0),%st(1)
-.Lnomul:jnz .Lnext
- fcomp
- ret
diff --git a/mdk-stage1/dietlibc/i386/isleap.S b/mdk-stage1/dietlibc/i386/isleap.S
deleted file mode 100644
index 28d1ee0ce..000000000
--- a/mdk-stage1/dietlibc/i386/isleap.S
+++ /dev/null
@@ -1,28 +0,0 @@
-.text
-.globl __isleap
-.type __isleap,@function
-
-__isleap:
- movl 4(%esp),%eax
- testb $3,%al
- jne .Lretzero
-#if 1
- movb $100,%cl /* this works only for 0 a.D. ... 25599 a.C. */
- divb %cl
- andb %ah,%ah
-#else
- cltd /* This works for 2147483648 b.C. ... 2147483647 a.C. */
- movl $100,%ecx
- divl %ecx
- andl %edx,%edx
-#endif
- jne .Lretone
- testb $3,%al
- jne .Lretzero
-.Lretone: xorl %eax,%eax
- incl %eax
- ret
-
-.Lretzero:xorl %eax,%eax
- ret
-
diff --git a/mdk-stage1/dietlibc/i386/ldexp.S b/mdk-stage1/dietlibc/i386/ldexp.S
deleted file mode 100644
index 51d9bae89..000000000
--- a/mdk-stage1/dietlibc/i386/ldexp.S
+++ /dev/null
@@ -1,28 +0,0 @@
-.text
-.global ldexpf,ldexp,ldexpl
- .type ldexpf,@function
- .type ldexp,@function
- .type ldexpl,@function
-
-ldexpf:
- fildl 8(%esp)
- flds 4(%esp)
- fscale
- ret
-
-ldexp:
- fildl 12(%esp)
- fldl 4(%esp)
- fscale
- ret
-
-ldexpl:
- fildl 16(%esp)
- fldt 4(%esp)
- fscale
- ret
-
-.ende:
-.size ldexpl,.ende-ldexpl
-.size ldexp,ldexpl-ldexp
-.size ldexpf,ldexp-ldexpf
diff --git a/mdk-stage1/dietlibc/i386/libm2.S b/mdk-stage1/dietlibc/i386/libm2.S
deleted file mode 100644
index 91c4437cd..000000000
--- a/mdk-stage1/dietlibc/i386/libm2.S
+++ /dev/null
@@ -1,643 +0,0 @@
-.text
-#d.half:
-# .long 0x3f000000 # 1/2
-#d.log1p:
-# .long 0x3ed413cc # < sqrt(2)-1-2^(-25)
-
-.global fabsf,fabs,fabsl
- .type fabsf,@function
- .type fabs,@function
- .type fabsl,@function
-fabsf:
- flds 4(%esp)
- fabs
- ret
-fabs:
- fldl 4(%esp)
- fabs
- ret
-fabsl:
- fldt 4(%esp)
- fabs
- ret
-
-.global sincosf,sincos,sincosl
-.type sincosf,@function
-.type sincos,@function
-.type sincosl,@function
-# void sincos ( double x, double* sinx, double* cosx );
-
-sincosf:
- flds 4(%esp)
- call __fmod2pi
- movl 12(%esp),%eax
- movl 8(%esp),%ecx
- fsincos
- fstps (%eax)
- fstps (%ecx)
- ret
-sincos:
- fldl 4(%esp)
- call __fmod2pi
- movl 16(%esp),%eax
- movl 12(%esp),%ecx
- fsincos
- fstpl (%eax)
- fstpl (%ecx)
- ret
-sincosl:
- fldt 4(%esp)
- call __fmod2pi
- movl 20(%esp),%eax
- movl 16(%esp),%ecx
- fsincos
- fstpt (%eax)
- fstpt (%ecx)
- ret
-
-.global tanf,tan,tanl
-.type tanf,@function
-.type tan,@function
-.type tanl,@function
-tanf:
- flds 4(%esp)
- jmp __tan
-tan:
- fldl 4(%esp)
-__tan:
- call __fmod2pi
- fsincos
- fdivrp
- ret
-tanl:
- fldt 4(%esp)
- jmp __tan
-
-.global atan2f,atan2,atan2l
- .type atan2f,@function
- .type atan2,@function
- .type atan2l,@function
-atan2f:
- flds 4(%esp)
- flds 8(%esp)
- fpatan
- ret
-atan2l:
- fldt 4(%esp)
- fldt 16(%esp)
- fpatan
- ret
-atan2:
- fldl 4(%esp)
- fldl 12(%esp)
- fpatan
- ret
-
-.global cbrtf,cbrt,cbrtl
- .type cbrtf,@function
- .type cbrt,@function
- .type cbrtl,@function
-cbrtf:
- flds 4(%esp)
- jmp __cbrt
-cbrtl:
- fldt 4(%esp)
- jmp __cbrt
-cbrt:
- fldl 4(%esp)
-# fldt 1/3
-__cbrt:
- pushl $0x00003ffd # yes, this method of loading 1/3
- pushl $0xaaaaaaaa # is shorter than keeping the data
- pushl $0xaaaaaaab # separate
- fldt (%esp)
- addl $12,%esp
- fxch # st(0)=x, st(1)=1/3
- ftst
- fstsw %ax
- sahf
- jz 1f
- jnc finpow
- fchs
- call finpow
- fchs
-1: ret
-
-# x^y; st(0)=x, st(1)=y (x > 0)
-finpow:
- fyl2x
- jmp __finexp
-
-.global exp2f,exp2,exp2l
- .type exp2f,@function
- .type exp2,@function
- .type exp2l,@function
-exp2f:
- flds 4(%esp)
- jmp __finexp
-exp2:
- fldl 4(%esp)
- jmp __finexp
-exp2l:
- fldt 4(%esp)
- jmp __finexp
-
-.global exp10f,exp10,exp10l #,pow10f,pow10,pow10l
- .type exp10f,@function
- .type exp10,@function
- .type exp10l,@function
-# .type pow10f,@function
-# .type pow10,@function
-# .type pow10l,@function
-exp10f:
-#pow10f:
- fldl2t
- fmuls 4(%esp)
- jmp __finexp
-exp10:
-#pow10:
- fldl2t
- fmull 4(%esp)
- jmp __finexp
-exp10l:
-#pow10l:
- fldl2t
- fldt 4(%esp)
- fmulp
- jmp __finexp
-
-# exp(x)-1
-.global expm1f,expm1,expm1l
- .type expm1f,@function
- .type expm1,@function
- .type expm1l,@function
-expm1f:
- fldl2e
- fmuls 4(%esp)
- jmp finem1
-expm1l:
- fldl2e
- fldt 4(%esp)
- fmulp
- jmp finem1
-expm1:
- fldl2e
- fmull 4(%esp)
-# -1 <= st <= 1 ?
-finem1:
- fst %st(1) # st(1)=st(0)
- fabs
- fld1
- fcompp
- fstsw %ax
- sahf
-# |x| >= 1
- jc 1f
- f2xm1
- ret
-1: call __finexp
- fld1
- fsubrp
- ret
-
-# sinh(x)=(exp(x)-exp(-x))/2
-# cosh(x)=(exp(x)+exp(-x))/2
-# tanh(x)=sinh(x)/cosh(x)
-.global sinhf,sinh,sinhl
- .type sinhf,@function
- .type sinh,@function
- .type sinhl,@function
-sinhf:
- fldl2e
- fmuls 4(%esp)
- jmp finsinh
-sinh:
- fldl2e
- fmull 4(%esp)
-finsinh:
- call __finexp
- fld1
- fdiv %st(1),%st(0) # st(0)=1/exp(x), st(1)=exp(x)
- fsubrp %st(0),%st(1)
- pushl $0x3f000000 # 1/2
- flds (%esp)
- popl %eax
- fmulp
- ret
-
-sinhl:
- fldl2e
- fldt 4(%esp)
- fmulp
- jmp finsinh
-
-.global coshf,cosh,coshl
- .type coshf,@function
- .type cosh,@function
- .type coshl,@function
-coshf:
- fldl2e
- fmuls 4(%esp)
- jmp fincosh
-cosh:
- fldl2e
- fmull 4(%esp)
-fincosh:
- call __finexp
- fld1
- fdiv %st(1),%st(0) # st(0)=1/exp(x), st(1)=exp(x)
- faddp %st,%st(1)
- pushl $0x3f000000 # 1/2
- flds (%esp)
- popl %eax
- fmulp
- ret
-
-coshl:
- fldl2e
- fldt 4(%esp)
- fmulp
- jmp fincosh
-
-.global tanhf,tanh,tanhl
- .type tanhf,@function
- .type tanh,@function
- .type tanhl,@function
-tanhf:
- fldl2e
- fmuls 4(%esp)
- call __finexp
- jmp fintanh
-tanh:
- fldl2e
- fmull 4(%esp)
- call __finexp
-fintanh:
- fld1
- fdiv %st(1),%st # st(0)=1/exp(x), st(1)=exp(x)
- fst %st(2) # st(2)=1/exp(x)
- fadd %st(1),%st(0)
- fstp %st(3) # st(2)=exp(x)+exp(-x), st(1)=exp(-x), st(0)=exp(x)
- fsubp # st(1)=exp(x)+exp(-x), st(0)=exp(x)-exp(-x)
- fdivp
- ret
-
-tanhl:
- fldl2e
- fldt 4(%esp)
- fmulp
- call __finexp
- jmp fintanh
-
-.global hypotf,hypot,hypotl # ,__hypot
- .type hypotf,@function
- .type hypot,@function
- .type hypotl,@function
-# .type __hypot,@function
-hypotf:
- flds 8(%esp)
- flds 4(%esp)
- jmp __hypot
-hypotl:
- fldt 16(%esp)
- fldt 4(%esp)
- jmp __hypot
-hypot:
- fldl 12(%esp)
- fldl 4(%esp)
-__hypot:
- fmul %st(0),%st(0)
- fxch
- fmul %st(0),%st(0)
- faddp
- fsqrt
- ret
-
-.global log1pf,log1p,log1pl
- .type log1pf,@function
- .type log1p,@function
- .type log1pl,@function
-log1pf:
- flds 4(%esp)
- jmp __log1p
-log1pl:
- fldt 4(%esp)
- jmp __log1p
-log1p:
- fldl 4(%esp)
-__log1p:
-# Sprawdzenie zakresu parametru
- fst %st(1)
- pushl $0x3ed413cc # sqrt(2)-1-2^(-25)
- fabs
- flds (%esp)
- popl %eax
- fcompp # porownanie
- fstsw %ax
- fldln2
- fxch
- sahf
-# |x| >= sqrt(2)-1
- jc 1f
- fyl2xp1
- ret
-1: fld1 # x = x + 1
- faddp
- fyl2x
- ret
-
-.global log10f,log10,log10l
- .type log10f,@function
- .type log10,@function
- .type log10l,@function
-log10f:
- fldlg2
- flds 4(%esp)
- fyl2x
- ret
-log10l:
- fldlg2
- fldt 4(%esp)
- fyl2x
- ret
-log10:
- fldlg2
- fldl 4(%esp)
- fyl2x
- ret
-
-.global log2f,log2,log2l
- .type log2f,@function
- .type log2,@function
- .type log2l,@function
-log2f:
- fld1
- flds 4(%esp)
- fyl2x
- ret
-log2l:
- fld1
- fldt 4(%esp)
- fyl2x
- ret
-log2:
- fld1
- fldl 4(%esp)
- fyl2x
- ret
-
-.global fmaf,fma,fmal
- .type fmaf,@function
- .type fma,@function
- .type fmal,@function
-fmaf:
- flds 4(%esp)
- fmuls 8(%esp)
- fadds 12(%esp)
- ret
-fma:
- fldl 4(%esp)
- fmull 12(%esp)
- faddl 20(%esp)
- ret
-fmal:
- fldt 4(%esp)
- fldt 16(%esp)
- fmulp %st,%st(1)
- fldt 28(%esp)
- faddp %st,%st(1)
- ret
-
-.global asinhf,asinh,asinhl
- .type asinhf,@function
- .type asinh,@function
- .type asinhl,@function
-asinhf:
- flds 4(%esp)
- jmp __asinh
-asinh:
- fldl 4(%esp)
-__asinh:
- fld %st(0)
- fmul %st(0),%st(0)
- fld1
- faddp %st(0),%st(1)
-finasch:
- fsqrt
- faddp %st(0),%st(1)
- fldln2
- fxch
- fyl2x
- ret
-asinhl:
- fldt 4(%esp)
- jmp __asinh
-
-.global acoshf,acosh,acoshl
- .type acoshf,@function
- .type acosh,@function
- .type acoshl,@function
-acoshf:
- flds 4(%esp)
- jmp __acosh
-acosh:
- fldl 4(%esp)
-__acosh:
- fld %st(0)
- fmul %st(0),%st(0)
- fld1
- fsubrp %st(0),%st(1) # st1=st1-st0; pop
- jmp finasch
-acoshl:
- fldt 4(%esp)
- jmp __acosh
-
-.global atanhf,atanh,atanhl
- .type atanhf,@function
- .type atanh,@function
- .type atanhl,@function
-atanhf:
- flds 4(%esp)
- jmp __atanh
-atanh:
- fldl 4(%esp)
-__atanh:
- fst %st(1)
- fld1 # st0=1, st1=x, st2=x
- fadd %st(0),%st(2) # st0=1, st1=x, st2=x+1
- fsubp %st(0),%st(1) # st0=1-x, st1=x+1
- fdivrp %st(0),%st(1)
- fsqrt
- fldln2
- fxch
- fyl2x
- ret
-atanhl:
- fldt 4(%esp)
- jmp __atanh
-
-.global dremf,drem,dreml
- .type dremf,@function
- .type drem,@function
- .type dreml,@function
-dremf:
- flds 8(%esp) # y
- flds 4(%esp) # x
- jmp __drem
-drem:
- fldl 12(%esp)
- fldl 4(%esp)
-__drem:
- fprem1
- fstsw %ax
- sahf
- jp __drem
- ret
-
-dreml:
- fldt 16(%esp)
- fldt 4(%esp)
- jmp __drem
-
-# |ret| = |x|, sign(ret) = sign(y)
-.global copysignf,copysign,copysignl
- .type copysignf,@function
- .type copysign,@function
- .type copysignl,@function
-copysignf:
- flds 4(%esp) # x
- flds 8(%esp) # y
- jmp __copysign
-copysign:
- fldl 4(%esp)
- fldl 12(%esp)
-__copysign:
- fmul %st(1),%st # st = x*y
- ftst
- fstsw %ax
- fincstp
- sahf
- jnc 1f
- fchs
-1: ret
-
-copysignl:
- fldt 4(%esp)
- fldt 16(%esp)
- jmp __copysign
-
-.global fdimf,fdim,fdiml
- .type fdimf,@function
- .type fdim,@function
- .type fdiml,@function
-fdimf:
- flds 4(%esp)
- fsubl 12(%esp)
- jmp __fdim
-fdim:
- fldl 4(%esp)
- fsubl 12(%esp)
-__fdim:
- fstsw %ax
- sahf
- jnc 1f
- fldz
-1: ret
-fdiml:
- fldt 4(%esp)
- fldt 16(%esp)
- fsubp
- jmp __fdim
-
-
-.global truncf,trunc,truncl
- .type truncf,@function
- .type trunc,@function
- .type truncl,@function
-
-truncf:
- flds 4(%esp)
- movb $0x0c,%ah
- jmp __flcetr
-
-trunc:
- fldl 4(%esp)
- movb $0x0c,%ah
- jmp __flcetr
-
-truncl:
- fldt 4(%esp)
- movb $0x0c,%ah
- jmp __flcetr
-
-.global frexpf,frexp,frexpl
- .type frexpf,@function
- .type frexp,@function
- .type frexpl,@function
-
-frexpf:
- flds 4(%esp)
- movl 8(%esp),%eax
- jmp __frexp
-
-frexp:
- fldl 4(%esp)
- movl 12(%esp),%eax
-__frexp:
- fxtract
- fxch
- fistpl (%eax)
- pushl $0x3f000000 # 1/2
- fmuls (%esp)
- incl (%eax)
- popl %eax
- ret
-
-frexpl:
- fldt 4(%esp)
- movl 16(%esp),%eax
- jmp __frexp
-
-.global logbf,logb,logbl
- .type logbf,@function
- .type logb,@function
- .type logbl,@function
-
-#logbf: flds 4(%esp)
-# fxtract
-# fxch
-# ret
-
-#logb: fldl 4(%esp)
-# fxtract
-# fxch
-# ret
-
-#logbl: fldt 4(%esp)
-# fxtract
-# fxch
-# ret
-
-.global ilogbf,ilogb,ilogbl
- .type ilogbf,@function
- .type ilogb,@function
- .type ilogbl,@function
-
-logbf:
-ilogbf: flds 4(%esp)
- jmp __ilogb
-
-logb:
-ilogb: fldl 4(%esp)
-__ilogb:
- fxtract
- pushl %eax
- fxch
- fistl (%esp)
- popl %eax
- ret
-
-logbl:
-ilogbl: fldt 4(%esp)
- jmp __ilogb
-
diff --git a/mdk-stage1/dietlibc/i386/listen.S b/mdk-stage1/dietlibc/i386/listen.S
deleted file mode 100644
index a0879be37..000000000
--- a/mdk-stage1/dietlibc/i386/listen.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(listen,LISTEN)
diff --git a/mdk-stage1/dietlibc/i386/log.S b/mdk-stage1/dietlibc/i386/log.S
deleted file mode 100644
index 0d42c9297..000000000
--- a/mdk-stage1/dietlibc/i386/log.S
+++ /dev/null
@@ -1,26 +0,0 @@
-.text
-
-.global logf,log,logl
- .type logf,@function
- .type log,@function
- .type logl,@function
-logf:
- fldln2
- flds 4(%esp)
- fyl2x
- ret
-logl:
- fldln2
- fldt 4(%esp)
- fyl2x
- ret
-log:
- fldln2
- fldl 4(%esp)
- fyl2x
- ret
-
-.Lende:
-.size log,.Lende-log
-.size logl,.Lende-logl
-.size logf,.Lende-logf
diff --git a/mdk-stage1/dietlibc/i386/log10.S b/mdk-stage1/dietlibc/i386/log10.S
deleted file mode 100644
index dcd08cc3f..000000000
--- a/mdk-stage1/dietlibc/i386/log10.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.type log10,@function
-.global log10
-log10:
- fldlg2
- fldl 4(%esp)
- fyl2x
- ret
-
-.ende:
-.size log10,.ende-log10
diff --git a/mdk-stage1/dietlibc/i386/log1p.S b/mdk-stage1/dietlibc/i386/log1p.S
deleted file mode 100644
index 4dd2d58b4..000000000
--- a/mdk-stage1/dietlibc/i386/log1p.S
+++ /dev/null
@@ -1,12 +0,0 @@
-.text
-.type log1p,@function
-.global log1p
-log1p:
- fldln2
- fldl 4(%esp)
- fyl2xp1
- ret
-
-.ende:
-.size log1p,.ende-log1p
-
diff --git a/mdk-stage1/dietlibc/i386/log2.S b/mdk-stage1/dietlibc/i386/log2.S
deleted file mode 100644
index 80e99a8c9..000000000
--- a/mdk-stage1/dietlibc/i386/log2.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.type log2,@function
-.global log2
-log2:
- fld1
- fldl 4(%esp)
- fyl2x
- ret
-
-.ende:
-.size log2,.ende-log2
diff --git a/mdk-stage1/dietlibc/i386/ltostr.S b/mdk-stage1/dietlibc/i386/ltostr.S
deleted file mode 100644
index ddf85a4f6..000000000
--- a/mdk-stage1/dietlibc/i386/ltostr.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (C) 2002 Thomas M. Ogrisegg
-
- __ltostr.S -- convert an integer into a string
-
- %eax = dividend
- %ebx = divisor
- %ecx = size of output-buffer
- %edi = output-buffer
- %ebp = if uppercase is set, then %ebp is 'A'-10 else %ebp is 'a'-10
-
-*/
-
-.text
-.globl __ltostr
-__ltostr:
- pushl %esi
- pushl %edi # destination
- pushl %ebp
- pushl %ebx
- movl %esp, %eax
- movl 0x14(%eax), %edi
- movl 0x18(%eax), %ecx # size
- movl 0x20(%eax), %ebx # divisor
- movl 0x1c(%eax), %eax # dividend
- decl %ecx
- movl %ecx, %esi
- movl $('A'-0xa), %ebp
- xorl %edx, %edx # must be 0 -- used by idiv
- cmpl $0x0, 36(%esp) # check for uppercase
- jnz .Lnext
- addl $0x20, %ebp # set lowercase
-.Lnext:
- idiv %ebx, %eax
- cmpb $0x9, %dl
- jg .Lnext2
- addb $'0', %dl
- jmp .Lstos
-.Lnext2:
- addl %ebp, %edx
-.Lstos:
- movb %dl, (%edi, %ecx)
- xorl %edx, %edx
- decl %ecx
- jz .Lout
- orl %eax, %eax
- jnz .Lnext
-.Lout:
- cld
- movl %esi, %ebx
- leal 1(%edi, %ecx), %esi
- subl %ebx, %ecx
- negl %ecx
- movl %ecx, %eax
- repnz movsb
- movb $0x0, (%edi)
- popl %ebx
- popl %ebp
- popl %edi
- popl %esi
- ret
-.size __ltostr, . - __ltostr
diff --git a/mdk-stage1/dietlibc/i386/mcount.S b/mdk-stage1/dietlibc/i386/mcount.S
deleted file mode 100644
index 11feed5e0..000000000
--- a/mdk-stage1/dietlibc/i386/mcount.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (C) 2001, 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- mcount.S
- i386 assembler implementation of mcount
-*/
-
-/* .section ".profile" */
-.text
-.globl mcount
-.type mcount,@function
-mcount:
-/*
- save all generic registers which
- might be used by __mcount, but aren't
- automatically saved
- */
- pushl %eax
- pushl %ecx
- pushl %edx
-
-/* push the instruction pointer of the calling function */
- pushl 0xc(%esp)
-
-/* push the instruction pointer of the
- function that called the calling function */
- pushl 0x4(%ebp)
-
- call __mcount
-
-/* clean up stack */
- addl $0x8, %esp
-
-/* restore the previously saved registers */
- popl %edx
- popl %ecx
- popl %eax
- ret
-
-.size mcount,.-mcount
diff --git a/mdk-stage1/dietlibc/i386/md5asm.S b/mdk-stage1/dietlibc/i386/md5asm.S
deleted file mode 100644
index a99a92934..000000000
--- a/mdk-stage1/dietlibc/i386/md5asm.S
+++ /dev/null
@@ -1,300 +0,0 @@
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-
-// #define F(x, y, z) (x & y) + (~x & z) = x&y + (z - z&x) = z + y&x - z&x
-//#define F(x, y, z) movl x,%ebx; movl x,%eax; notl %ebx; andl y,%eax; andl z,%ebx; addl %ebx,%eax
-#define F(x, y, z) movl y,%eax; movl z,%ebx; andl x,%eax; andl x,%ebx; addl z,%eax; subl %ebx,%eax
-
-// #define G(x, y, z) (x & z) + (y & ~z) = x&z + (y - y&z) = y + x&z - y&z
-#define G(x, y, z) movl z,%ebx; movl z,%eax; notl %ebx; andl x,%eax; andl y,%ebx; addl %ebx,%eax
-//#define G(x, y, z) movl x,%eax; movl y,%ebx; andl z,%eax; andl z,%ebx; addl y,%eax; subl %ebx,%eax
-//#define G(x, y, z) movl z,%eax; movl z,%ebx; andl x,%eax; andl y,%ebx; addl y,%eax; subl %ebx,%eax
-
-// #define H(x, y, z) x ^ y ^ z
-#define H(x, y, z) movl z,%eax; xorl y,%eax; xorl x,%eax
-
-// #define I(x, y, z) y ^ (x | ~z)
-#define I(x, y, z) movl z,%eax; notl %eax; orl x,%eax; xorl y,%eax
-
-
-// #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-#define ROTATE_LEFT(x, n) roll $n,x
-
-// #define FF(a, b, c, d, x, s, ac) { (a) += F (b, c, d) + (x) + (word)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-// #define GG(a, b, c, d, x, s, ac) { (a) += G (b, c, d) + (x) + (word)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-// #define HH(a, b, c, d, x, s, ac) { (a) += H (b, c, d) + (x) + (word)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-// #define II(a, b, c, d, x, s, ac) { (a) += I (b, c, d) + (x) + (word)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-
-#define FF(a, b, c, d, x, s, ac) addl x, a; addl $ac,a; F (b, c, d); addl %eax,a; roll $s,a; addl b,a
-#define GG(a, b, c, d, x, s, ac) addl x, a; addl $ac,a; G (b, c, d); addl %eax,a; roll $s,a; addl b,a
-#define HH(a, b, c, d, x, s, ac) addl x, a; addl $ac,a; H (b, c, d); addl %eax,a; roll $s,a; addl b,a
-#define II(a, b, c, d, x, s, ac) addl x, a; addl $ac,a; I (b, c, d); addl %eax,a; roll $s,a; addl b,a
-
-
-// // x is ecx
-// word a = state [0]; // a is edx
-// word b = state [1]; // b is esi
-// word c = state [2]; // c is edi
-// word d = state [3]; // d is ebp
-
-#define X(n) 4*(n)(%ecx)
-#define X0 (%ecx)
-#define a %edx
-#define b %esi
-#define c %edi
-#define d %ebp
-
-
-
-/* MD5 basic transformation: Transforms state based on data block */
-
-// void __MD5Transform ( word state[4], const word* x, size_t repeat )
-
-.text
-.type __MD5Transform, @function
-.align 32
-.global __MD5Transform
-
- .align 32
-.Lrepeat:
-
- /* Round 1 */
- FF (a, b, c, d, X0 , S11, 0xd76aa478); /* 1 */
- FF (d, a, b, c, X( 1), S12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, X( 2), S13, 0x242070db); /* 3 */
- FF (b, c, d, a, X( 3), S14, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, X( 4), S11, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, X( 5), S12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, X( 6), S13, 0xa8304613); /* 7 */
- FF (b, c, d, a, X( 7), S14, 0xfd469501); /* 8 */
- FF (a, b, c, d, X( 8), S11, 0x698098d8); /* 9 */
- FF (d, a, b, c, X( 9), S12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, X(10), S13, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, X(11), S14, 0x895cd7be); /* 12 */
- FF (a, b, c, d, X(12), S11, 0x6b901122); /* 13 */
- FF (d, a, b, c, X(13), S12, 0xfd987193); /* 14 */
- FF (c, d, a, b, X(14), S13, 0xa679438e); /* 15 */
- FF (b, c, d, a, X(15), S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, X( 1), S21, 0xf61e2562); /* 17 */
- GG (d, a, b, c, X( 6), S22, 0xc040b340); /* 18 */
- GG (c, d, a, b, X(11), S23, 0x265e5a51); /* 19 */
- GG (b, c, d, a, X0 , S24, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, X( 5), S21, 0xd62f105d); /* 21 */
- GG (d, a, b, c, X(10), S22, 0x02441453); /* 22 */
- GG (c, d, a, b, X(15), S23, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, X( 4), S24, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, X( 9), S21, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, X(14), S22, 0xc33707d6); /* 26 */
- GG (c, d, a, b, X( 3), S23, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, X( 8), S24, 0x455a14ed); /* 28 */
- GG (a, b, c, d, X(13), S21, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, X( 2), S22, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, X( 7), S23, 0x676f02d9); /* 31 */
- GG (b, c, d, a, X(12), S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, X( 5), S31, 0xfffa3942); /* 33 */
- HH (d, a, b, c, X( 8), S32, 0x8771f681); /* 34 */
- HH (c, d, a, b, X(11), S33, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, X(14), S34, 0xfde5380c); /* 36 */
- HH (a, b, c, d, X( 1), S31, 0xa4beea44); /* 37 */
- HH (d, a, b, c, X( 4), S32, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, X( 7), S33, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, X(10), S34, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, X(13), S31, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, X0 , S32, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, X( 3), S33, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, X( 6), S34, 0x04881d05); /* 44 */
- HH (a, b, c, d, X( 9), S31, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, X(12), S32, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, X(15), S33, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, X( 2), S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II (a, b, c, d, X0 , S41, 0xf4292244); /* 49 */
- II (d, a, b, c, X( 7), S42, 0x432aff97); /* 50 */
- II (c, d, a, b, X(14), S43, 0xab9423a7); /* 51 */
- II (b, c, d, a, X( 5), S44, 0xfc93a039); /* 52 */
- II (a, b, c, d, X(12), S41, 0x655b59c3); /* 53 */
- II (d, a, b, c, X( 3), S42, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, X(10), S43, 0xffeff47d); /* 55 */
- II (b, c, d, a, X( 1), S44, 0x85845dd1); /* 56 */
- II (a, b, c, d, X( 8), S41, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, X(15), S42, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, X( 6), S43, 0xa3014314); /* 59 */
- II (b, c, d, a, X(13), S44, 0x4e0811a1); /* 60 */
- II (a, b, c, d, X( 4), S41, 0xf7537e82); /* 61 */
- II (d, a, b, c, X(11), S42, 0xbd3af235); /* 62 */
- II (c, d, a, b, X( 2), S43, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, X( 9), S44, 0xeb86d391); /* 64 */
-
-// state [0] += a;
-// state [1] += b;
-// state [2] += c;
-// state [3] += d;
-
- addl $64,%ecx
-
- movl 4+32(%esp),%eax // state
- addl (%eax),a
- addl 4(%eax),b
- addl 8(%eax),c
- addl 12(%eax),d
- movl a, (%eax)
- movl b, 4(%eax)
- movl c, 8(%eax)
- movl d,12(%eax)
-
-.Lstart:
- decl 12+32(%esp)
- jns .Lrepeat
-
- popal
- ret
-
-__MD5Transform:
-__MD5TransformLocal:
- pushal
- movl 8+32(%esp),%ecx // x
- movl 4+32(%esp),%eax // state
- movl (%eax),a
- movl 4(%eax),b
- movl 8(%eax),c
- movl 12(%eax),d
- jmp .Lstart
-
-.Lende:
-.size __MD5Transform, .Lende-__MD5Transform
-
-.type MD5Init,@function
-.global MD5Init
-
-MD5Init:
- movl 4(%esp), %ecx
- xorl %eax,%eax
- movl $0x67452301, (%ecx)
- movl $0xefcdab89, 4(%ecx)
- movl $0x98badcfe, 8(%ecx)
- movl $0x10325476, 12(%ecx)
- movl %eax, 16(%ecx)
- movl %eax, 20(%ecx)
- ret
-
-
-.global MD5Update
-.type MD5Update,@function
-
-
-// void MD5Update ( MD5_CTX* context, const byte* input, size_t inputBytes )
-
-#define CONTEXT 4+32(%esp)
-#define INPUT 8+32(%esp)
-#define INPUTBYTES 12+32(%esp)
-
-#define COUNT 16(%ebx)
-#define BUFFER 24(%ebx)
-
-
-MD5Update:
- pushal
- cld
- movl CONTEXT, %ebx
-
-// ByteIndex = (context->count[0] >> 3) & 0x3F;
-
- movl COUNT, %ebp
- shrl $3, %ebp
- andl $63,%ebp // ebp = ByteIndex
-
-// if ( (context->count[0] += inputBytes << 3 ) < (inputBytes << 3) )
-// context->count[1]++;
-// context->count[1] += inputBytes >> (32-3);
-
- movl $8, %eax
- mull INPUTBYTES
- addl %eax, 0+COUNT
- adcl %edx, 4+COUNT
-
-// partLen = 64 - ByteIndex;
-
- movl $64, %eax
- subl %ebp, %eax // eax = partLen
-
-// i = 0;
-// if ( partLen <= inputBytes ) {
-
- xorl %ecx,%ecx // ecx = i
- cmpl INPUTBYTES, %eax
- ja .Lende2
-
-// memcpy ( context->buffer + ByteIndex, input, partLen );
-
- leal 24(%ebx,%ebp,1), %edi
- movl INPUT, %esi
- movl %eax, %ecx
- rep movsb
-
-// MD5Transform ( context->state, context->buffer, 1 );
-
- pushl $1
- leal BUFFER, %ecx
- pushl %ecx
- push %ebx
- call __MD5TransformLocal
-
-// len = (inputBytes - partLen) / 64;
-
- movl 12+INPUTBYTES, %ecx
- subl %eax, %ecx
- shrl $6, %ecx
-
-// MD5Transform ( context->state, input+partLen, len );
-
- pushl %ecx
- pushl %esi
- pushl %ebx
- call __MD5TransformLocal
- addl $24,%esp
-
-// i = partLen + 64 * len;
-// ByteIndex = 0;
-
- shll $6, %ecx
- addl %eax, %ecx
- xorl %ebp, %ebp
-
-.Lende2:
-
-// }
-// memcpy ( context->buffer + ByteIndex, input + i, inputBytes - i );
-
- movl INPUT, %esi
- addl %ecx, %esi
-
- negl %ecx
- addl INPUTBYTES, %ecx
-
- leal 24(%ebx,%ebp,1), %edi
- rep movsb
-
- popal
- ret
-
-
diff --git a/mdk-stage1/dietlibc/i386/memccpy.S b/mdk-stage1/dietlibc/i386/memccpy.S
deleted file mode 100644
index 0b7dce49e..000000000
--- a/mdk-stage1/dietlibc/i386/memccpy.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (C) 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- memccpy.S
- i386 assembler implementation of memccpy(3)
-*/
-
-.text
-.global memccpy
-.type memccpy,@function
-memccpy:
- pushl %esi
- pushl %edi
-
- movl %esp, %ecx
- movl 0x0c(%ecx), %edi
- movl 0x10(%ecx), %esi
- movb 0x14(%ecx), %dl
- movl 0x18(%ecx), %ecx
- cld
-.Lloop:
- lodsb
- stosb
- cmp %al, %dl
- jz .Lout
- decl %ecx
- jnz .Lloop
- xorl %edi, %edi
-.Lout:
- movl %edi, %eax
- popl %edi
- popl %esi
- ret
-.Lende:
-.size memccpy,.Lende-memccpy
diff --git a/mdk-stage1/dietlibc/i386/memchr.S b/mdk-stage1/dietlibc/i386/memchr.S
deleted file mode 100644
index 7d04f990b..000000000
--- a/mdk-stage1/dietlibc/i386/memchr.S
+++ /dev/null
@@ -1,24 +0,0 @@
-.text
-.align 0
-.global memchr
-.type memchr,@function
-memchr:
- pushl %edi
- movl 8(%esp),%edi
- movl 12(%esp),%eax
- movl 16(%esp),%ecx
- cld
- jecxz .Lnotfound
-
- repne scasb
-
- je .Lfound
-.Lnotfound:
- xorl %edi, %edi
- incl %edi
-.Lfound:
- movl %edi, %eax
- decl %eax
-
- popl %edi
- ret
diff --git a/mdk-stage1/dietlibc/i386/memcmp.S b/mdk-stage1/dietlibc/i386/memcmp.S
deleted file mode 100644
index aa6d55f23..000000000
--- a/mdk-stage1/dietlibc/i386/memcmp.S
+++ /dev/null
@@ -1,26 +0,0 @@
-.text
-.align 0
-.global memcmp
-.type memcmp,@function
-memcmp:
- xorl %eax,%eax
- orl 12(%esp),%eax
- jz .Lempty
- pushl %esi
- pushl %edi
- movl 12(%esp),%esi
- movl 16(%esp),%edi
- movl %eax,%ecx
-
- rep cmpsb
-
- decl %esi
- decl %edi
- lodsb
- subb (%edi), %al
- movsx %al, %eax
-
- popl %edi
- popl %esi
-.Lempty:
- ret
diff --git a/mdk-stage1/dietlibc/i386/memcpy.S b/mdk-stage1/dietlibc/i386/memcpy.S
deleted file mode 100644
index cbe74459f..000000000
--- a/mdk-stage1/dietlibc/i386/memcpy.S
+++ /dev/null
@@ -1,16 +0,0 @@
-.text
-.align 0
-.global memcpy
-.type memcpy,@function
-memcpy:
- pushl %esi
- pushl %edi
- movl 12(%esp),%edi
- movl 16(%esp),%esi
- movl 20(%esp),%ecx
- movl %edi, %eax
- cld
- rep movsb
- popl %edi
- popl %esi
- ret
diff --git a/mdk-stage1/dietlibc/i386/memset.S b/mdk-stage1/dietlibc/i386/memset.S
deleted file mode 100644
index 472390b84..000000000
--- a/mdk-stage1/dietlibc/i386/memset.S
+++ /dev/null
@@ -1,15 +0,0 @@
-.text
-.align 0
-.global memset
-.type memset,@function
-memset:
- pushl %edi
- movl 8(%esp),%edi
- movl 12(%esp),%eax
- movl 16(%esp),%ecx
- cld
- pushl %edi
- rep stosb
- popl %eax
- popl %edi
- ret
diff --git a/mdk-stage1/dietlibc/i386/mmap.S b/mdk-stage1/dietlibc/i386/mmap.S
deleted file mode 100644
index c824aa037..000000000
--- a/mdk-stage1/dietlibc/i386/mmap.S
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "syscalls.h"
-
-.text
-.global mmap
-.type mmap,@function
-mmap:
- mov $__NR_mmap,%al
- lea 0x4(%esp,1),%edx
- push %edx
- call __unified_syscall
- pop %ecx
- ret
-.Lende3:
-.size mmap,.Lende3-mmap
diff --git a/mdk-stage1/dietlibc/i386/mmap.c b/mdk-stage1/dietlibc/i386/mmap.c
deleted file mode 100644
index 26ecb55c0..000000000
--- a/mdk-stage1/dietlibc/i386/mmap.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <linux/types.h>
-#include <linux/unistd.h>
-
-#define __NR__mmap __NR_mmap
-_syscall1(int,_mmap,unsigned long *,buffer)
-
-char *mmap(char *addr, size_t len, int prot, int flags, int fd, unsigned long off) {
- unsigned long buffer[6];
- buffer[0] = (unsigned long)addr;
- buffer[1] = (unsigned long)len;
- buffer[2] = (unsigned long)prot;
- buffer[3] = (unsigned long)flags;
- buffer[4] = (unsigned long)fd;
- buffer[5] = (unsigned long)off;
- return (char*) _mmap(buffer);
-}
diff --git a/mdk-stage1/dietlibc/i386/mmap64.S b/mdk-stage1/dietlibc/i386/mmap64.S
deleted file mode 100644
index 421325260..000000000
--- a/mdk-stage1/dietlibc/i386/mmap64.S
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <dietfeatures.h>
-#include <syscalls.h>
-#include <errno.h>
-
-#ifdef __DYN_LIB
-#ifndef WANT_THREAD_SAFE
-#define WANT_THREAD_SAFE
-#endif
-#endif
-
-.text
-.global mmap64
-.type mmap64,@function
-mmap64:
-/* man is this ugly! */
- push %ebp
- push %edi
- push %esi
- push %ebx
- movl %esp, %edi
- movl 0x28(%edi), %eax
- movl 0x2c(%edi), %edx
- testl $0xfff, %eax /* offset in pages */
- jnz .Leinval
- shrdl $12, %edx, %eax
- shrl $12, %edx
- jnz .Leinval
- movl %eax, %ebp
- movl 0x14(%edi),%ebx
- movl 0x18(%edi),%ecx
- movl 0x1c(%edi),%edx
- movl 0x20(%edi),%esi
- movl 0x24(%edi),%edi
- movl $__NR_mmap2,%eax
- int $0x80
- cmp $-124,%eax
- jbe .Lnoerror
- neg %eax
-.Lerror:
-#ifdef WANT_THREAD_SAFE
- movl %eax,%ebx
-#ifdef __DYN_LIB
- call __errno_location@PLT
-#else
- call __errno_location
-#endif
- movl %ebx,(%eax)
- orl $-1,%eax
-#else
- mov %eax,errno
- sbb %eax,%eax # eax = eax - eax - CY = -1
-#endif
-.Lnoerror:
- pop %ebx
- pop %esi
- pop %edi
- pop %ebp
- ret
-.Leinval:
- movl $EINVAL,%eax
- jmp .Lerror
-.Lende2:
-.size mmap64,.Lende2-mmap64
diff --git a/mdk-stage1/dietlibc/i386/poly.S b/mdk-stage1/dietlibc/i386/poly.S
deleted file mode 100644
index d8be7d7f5..000000000
--- a/mdk-stage1/dietlibc/i386/poly.S
+++ /dev/null
@@ -1,24 +0,0 @@
-
-.text
-.global __poly
-.type __poly,@function
-
-
-#
-# double __poly ( double x, int n, const double* c );
-#
-
-__poly:
- movl 16(%esp),%eax
- movl 12(%esp),%ecx
- leal (%eax,%ecx,8),%eax
- fldl 4(%esp)
- fldz
-.Lloop:
- fmul %st(1),%st(0)
- faddl (%eax)
- addl $-8,%eax
- decl %ecx
- jns .Lloop
- fstp %st(1)
- ret
diff --git a/mdk-stage1/dietlibc/i386/pow.S b/mdk-stage1/dietlibc/i386/pow.S
deleted file mode 100644
index 46562a299..000000000
--- a/mdk-stage1/dietlibc/i386/pow.S
+++ /dev/null
@@ -1,67 +0,0 @@
-.text
-.global pow
-.type pow,@function
-
-# pow(x,y)
-.global powf,pow,powl
- .type powf,@function
- .type pow,@function
- .type powl,@function
-powf:
- flds 4(%esp) # x
- flds 8(%esp) # y
- jmp .L__pow
-powl:
- fldt 4(%esp)
- fldt 16(%esp)
- jmp .L__pow
-pow:
- fldl 4(%esp)
- fldl 12(%esp)
-# x^y; st(0)=y, st(1)=x
-.L__pow:
- ftst # y = 0 ?
- fstsw %ax
- fld1 # st(0)=1, st(1)=y, st(2)=x
- sahf
- jz 1f # return 1
- fcomp %st(1) # y = 1 ?
- fstsw %ax
- fxch # st(0)=x, st(1)=y
- sahf
- jz 1f # return x
- ftst # x = 0 ?
- fstsw %ax
- sahf
- jz 1f
- jnc .Lfinpow # x > 0
- fxch # st(0)=y, st(1)=x
- fld %st(0) # st(0)=y, st(1)=y, st(2)=x
- frndint # st(0)=int(y)
- fcomp %st(1) # y = int(y)?
- fstsw %ax
- fxch
- sahf
- jnz .Lfinpow # fyl2x -> st(0) = NaN
-# y even or odd ?
- fld1
- fadd %st(0) # st(0) = 2
- fdivr %st(2),%st(0) # st(0)=st(2)/2
- frndint
- fadd %st(0),%st(0)
- fcomp %st(2) # st(0) = x, st(1) = y
- fstsw %ax
- fchs # st(0) = -x
- sahf
- jz .Lfinpow # y even
- call .Lfinpow # y odd
- fchs
-1: ret
-.Lfinpow:
- fyl2x
- jmp __finexp
-
-.Lende:
-.size pow,.Lende-pow
-.size powf,.Lende-powf
-.size powl,.Lende-powl
diff --git a/mdk-stage1/dietlibc/i386/recv.S b/mdk-stage1/dietlibc/i386/recv.S
deleted file mode 100644
index 215343ccc..000000000
--- a/mdk-stage1/dietlibc/i386/recv.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(recv,RECV)
diff --git a/mdk-stage1/dietlibc/i386/recvfrom.S b/mdk-stage1/dietlibc/i386/recvfrom.S
deleted file mode 100644
index a9dde840d..000000000
--- a/mdk-stage1/dietlibc/i386/recvfrom.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(recvfrom,RECVFROM)
diff --git a/mdk-stage1/dietlibc/i386/recvmsg.S b/mdk-stage1/dietlibc/i386/recvmsg.S
deleted file mode 100644
index cb26e2f08..000000000
--- a/mdk-stage1/dietlibc/i386/recvmsg.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(recvmsg,RECVMSG)
diff --git a/mdk-stage1/dietlibc/i386/rint.S b/mdk-stage1/dietlibc/i386/rint.S
deleted file mode 100644
index f56ab1f93..000000000
--- a/mdk-stage1/dietlibc/i386/rint.S
+++ /dev/null
@@ -1,23 +0,0 @@
-.text
-
-.global rintf,rint,rintl
- .type rintf,@function
- .type rint,@function
- .type rintl,@function
-rintf:
- flds 4(%esp)
- frndint
- ret
-rint:
- fldl 4(%esp)
- frndint
- ret
-rintl:
- fldt 4(%esp)
- frndint
- ret
-
-.Lende:
-.size rint,.Lende-rint
-.size rintl,.Lende-rintl
-.size rintf,.Lende-rintf
diff --git a/mdk-stage1/dietlibc/i386/select.S b/mdk-stage1/dietlibc/i386/select.S
deleted file mode 100644
index 9e7066eae..000000000
--- a/mdk-stage1/dietlibc/i386/select.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall_weak(_newselect,select,__libc_select)
diff --git a/mdk-stage1/dietlibc/i386/send.S b/mdk-stage1/dietlibc/i386/send.S
deleted file mode 100644
index f2dd7e3d5..000000000
--- a/mdk-stage1/dietlibc/i386/send.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(send,SEND)
diff --git a/mdk-stage1/dietlibc/i386/sendmsg.S b/mdk-stage1/dietlibc/i386/sendmsg.S
deleted file mode 100644
index 484d62e50..000000000
--- a/mdk-stage1/dietlibc/i386/sendmsg.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(sendmsg,SENDMSG)
diff --git a/mdk-stage1/dietlibc/i386/sendto.S b/mdk-stage1/dietlibc/i386/sendto.S
deleted file mode 100644
index 04270f0f0..000000000
--- a/mdk-stage1/dietlibc/i386/sendto.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(sendto,SENDTO)
diff --git a/mdk-stage1/dietlibc/i386/setjmp.S b/mdk-stage1/dietlibc/i386/setjmp.S
deleted file mode 100644
index 09b266c61..000000000
--- a/mdk-stage1/dietlibc/i386/setjmp.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <setjmp.h>
-
-.text
-.weak setjmp
-.type setjmp,@function
-setjmp:
-.globl __setjmp
-.type __setjmp,@function
-__setjmp:
- popl %eax
- popl %ecx
- pushl $0
- pushl %ecx
- pushl %eax
-
-.globl __sigsetjmp
-.type __sigsetjmp,@function
-__sigsetjmp:
- movl 4(%esp), %eax
-
- /* Save registers. */
- movl %ebx, (JB_BX*4)(%eax)
- movl %esi, (JB_SI*4)(%eax)
- movl %edi, (JB_DI*4)(%eax)
- movl %ebp, (JB_BP*4)(%eax)
- leal 4(%esp), %edx /* Save SP as it will be after we return. */
- movl 0(%esp), %ecx /* Save PC we are returning to now. */
- movl %edx, (JB_SP*4)(%eax)
- movl %ecx, (JB_PC*4)(%eax)
-
- /* Make a tail call to __sigjmp_save; it takes the same args. */
-#ifdef PIC
- call 1f
- addl $_GLOBAL_OFFSET_TABLE_, %ecx
- jmp *__sigjmp_save@GOT(%ecx)
-1: movl (%esp), %ecx
- ret
-#else
- jmp __sigjmp_save
-#endif
-.size __sigsetjmp,.-__sigsetjmp;
diff --git a/mdk-stage1/dietlibc/i386/setsockopt.S b/mdk-stage1/dietlibc/i386/setsockopt.S
deleted file mode 100644
index 6a81aec82..000000000
--- a/mdk-stage1/dietlibc/i386/setsockopt.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(setsockopt,SETSOCKOPT)
diff --git a/mdk-stage1/dietlibc/i386/shutdown.S b/mdk-stage1/dietlibc/i386/shutdown.S
deleted file mode 100644
index f9dc707e8..000000000
--- a/mdk-stage1/dietlibc/i386/shutdown.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(shutdown,SHUTDOWN)
diff --git a/mdk-stage1/dietlibc/i386/sin.S b/mdk-stage1/dietlibc/i386/sin.S
deleted file mode 100644
index 404bf5eed..000000000
--- a/mdk-stage1/dietlibc/i386/sin.S
+++ /dev/null
@@ -1,34 +0,0 @@
-
-.text
-
-.global sinf,sin,sinl
-.type sinf,@function
-.type sin,@function
-.type sinl,@function
-sinf:
- flds 4(%esp)
- jmp 1f
-sin:
- fldl 4(%esp)
-1: fsin
- fnstsw %ax
- testb $0x04, %ah
- je 3f
- fldpi
- fadd %st
- fxch %st(1)
-2: fprem1
- fnstsw %ax
- testb $0x04, %ah
- jne 2b
- fstp %st(1)
- fsin
-3: ret
-sinl:
- fldt 4(%esp)
- jmp 1b
-
-.ende:
-.size sin,.ende-sin
-.size sinf,.ende-sinf
-.size sinl,.ende-sinl
diff --git a/mdk-stage1/dietlibc/i386/sincos.S b/mdk-stage1/dietlibc/i386/sincos.S
deleted file mode 100644
index 7395075f3..000000000
--- a/mdk-stage1/dietlibc/i386/sincos.S
+++ /dev/null
@@ -1,18 +0,0 @@
-
-.text
-.type sincos,@function
-.global sincos
-
-# void sincos ( double x, double* sinx, double* cosx );
-
-sincos:
- fldl 4(%esp)
- fsincos
- movl 16(%esp),%eax
- movl 12(%esp),%ecx
- fstpl (%eax)
- fstpl (%ecx)
- ret
-
-.ende:
-.size sincos,.ende-sincos
diff --git a/mdk-stage1/dietlibc/i386/sinh.S b/mdk-stage1/dietlibc/i386/sinh.S
deleted file mode 100644
index 98f7ee752..000000000
--- a/mdk-stage1/dietlibc/i386/sinh.S
+++ /dev/null
@@ -1,29 +0,0 @@
-
-.text
-.type sinh,@function
-.global sinh
-
-sinh: # note: exp(x) = 2^(x*log2(e))
- fldl2e
- fmull 4(%esp) # x*log2(e)
- fld %st(0) # x*log2(e) x*log2(e)
- frndint # int(x*log2(e)) x*log2(e)
- fxch # x*log2(e) int(x*log2(e))
- fsub %st(1),%st(0) # frac(x*log2(e)) int(x*log2(e))
- f2xm1 # 2^(fract(x*log2(e)))-1 int(x*log2(e))
- fld1 # 1 2^(fract(x*log2(e)))-1 int(x*log2(e))
- faddp %st(0),%st(1) # 2^(fract(x*log2(e))) int(x*log2(e))
- fscale # 2^(x*log2(e)) int(x*log2(e))
- fstp %st(1) # 2^(x*log2(e))
-
-# now we have y = exp(x), but sinh(x) = (y - 1/y) * 0.5
-
- fld1
- fdiv %st(1),%st(0)
- fsubrp
- fmuls __half
- ret
-
-.Lende:
-
-.size sinh,.ende-sinh
diff --git a/mdk-stage1/dietlibc/i386/sleep.S b/mdk-stage1/dietlibc/i386/sleep.S
deleted file mode 100644
index 356552dc2..000000000
--- a/mdk-stage1/dietlibc/i386/sleep.S
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "PIC.h"
-
-.text
-.global sleep
-.type sleep,@function
-
-sleep:
- movl 4(%esp),%eax # Argument holen
- PIC_SAVE # non-PIC: empty line
- PIC_INIT # non-PIC: empty line
- pushl $0 # 0 ns
- pushl %eax # 'x' µs warten
- movl %esp,%eax
- pushl %eax # zweimal ein Zeiger auf das Stackobjekt
- pushl %eax # ptr ptr sec nsec return arg
-#ifdef __DYN_LIB
- call nanosleep@PLT
-#else
- call nanosleep
-#endif
- movl 20(%esp),%eax # 'x' holen
- subl 8(%esp),%eax # schon abgelaufende Zeit subtrahieren
- addl $16,%esp
- PIC_RESTORE # non-PIC: empty line
- ret
diff --git a/mdk-stage1/dietlibc/i386/socket.S b/mdk-stage1/dietlibc/i386/socket.S
deleted file mode 100644
index bc8cbe536..000000000
--- a/mdk-stage1/dietlibc/i386/socket.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(socket,SOCKET)
diff --git a/mdk-stage1/dietlibc/i386/socketcall.S b/mdk-stage1/dietlibc/i386/socketcall.S
deleted file mode 100644
index 4e8019ec2..000000000
--- a/mdk-stage1/dietlibc/i386/socketcall.S
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <syscalls.h>
-
-.text
-.global socketcall
-.type socketcall,@function
-socketcall:
- leal 4(%esp), %ecx
- pushl %ecx
- movzbl %al,%eax
- pushl %eax
- movb $__NR_socketcall,%al
- call __unified_syscall
- popl %ecx
- popl %ecx
- retl
-.Lende:
-.size socketcall,.Lende-socketcall
diff --git a/mdk-stage1/dietlibc/i386/socketpair.S b/mdk-stage1/dietlibc/i386/socketpair.S
deleted file mode 100644
index a5de65f25..000000000
--- a/mdk-stage1/dietlibc/i386/socketpair.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <linuxnet.h>
-#include <syscalls.h>
-
-__socketcall(socketpair,SOCKETPAIR)
diff --git a/mdk-stage1/dietlibc/i386/sqrt.S b/mdk-stage1/dietlibc/i386/sqrt.S
deleted file mode 100644
index 5e4527612..000000000
--- a/mdk-stage1/dietlibc/i386/sqrt.S
+++ /dev/null
@@ -1,23 +0,0 @@
-.text
-
-.global sqrtf,sqrt,sqrtl
- .type sqrtf,@function
- .type sqrt,@function
- .type sqrtl,@function
-sqrtf:
- flds 4(%esp)
- fsqrt
- ret
-sqrt:
- fldl 4(%esp)
- fsqrt
- ret
-sqrtl:
- fldt 4(%esp)
- fsqrt
- ret
-
-.ende:
-.size sqrt,.ende-sqrt
-.size sqrtf,.ende-sqrtf
-.size sqrtl,.ende-sqrtl
diff --git a/mdk-stage1/dietlibc/i386/sqrtl.S b/mdk-stage1/dietlibc/i386/sqrtl.S
deleted file mode 100644
index c1a931fd8..000000000
--- a/mdk-stage1/dietlibc/i386/sqrtl.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.type sqrtl,@function
-.global sqrtl
-sqrtl:
- fldt 4(%esp)
- fsqrt
- ret
-
-.ende:
-.size sqrtl,.ende-sqrtl
-
diff --git a/mdk-stage1/dietlibc/i386/start.S b/mdk-stage1/dietlibc/i386/start.S
deleted file mode 100644
index 1a825fc2a..000000000
--- a/mdk-stage1/dietlibc/i386/start.S
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "dietfeatures.h"
-#include "PIC.h"
-
-.text
-.global _start
-_start:
-#if 1
- popl %ecx /* %ecx = argc */
- movl %esp,%esi /* %esi = argv */
- pushl %ecx
-#else
- movl (%esp),%ecx /* %ecx = argc */
- leal 4(%esp),%esi /* %esi = argv */
-#endif
- leal 4(%esi,%ecx,4),%eax /* %eax = envp = (4*ecx)+%esi+4 */
-
-#ifdef WANT_DYNAMIC
-/* in %edx we have the ld.so dynamic _fini ( register this if non null ) */
- push %edx
-#endif
-
- pushl %eax
- pushl %esi
- pushl %ecx
- PIC_INIT /* non-PIC: this is an empty line */
- PUT_VAR %eax, environ, %ecx /* non-PIC: movl %eax,environ */
-
-#ifdef PROFILING
- pushl $_etext
- pushl $.text
- call monitor
- addl $0x8, %esp
-#endif
-
-#ifdef WANT_DYNAMIC
- call _dyn_start
-#else
- call main
-#endif
-
-#ifdef PROFILING
- pushl %eax
- call _stop_monitor
- popl %eax
-#endif
- pushl %eax
- call exit
- hlt /* die now ! will ya ... */
-.Lstart:
- .size _start,.Lstart-_start
-
diff --git a/mdk-stage1/dietlibc/i386/stpcpy.S b/mdk-stage1/dietlibc/i386/stpcpy.S
deleted file mode 100644
index 1cb74b2ea..000000000
--- a/mdk-stage1/dietlibc/i386/stpcpy.S
+++ /dev/null
@@ -1,22 +0,0 @@
-.text
-.global stpcpy
-.type stpcpy,@function
-stpcpy:
- pushl %edi
- pushl %esi
- movl 0xc(%esp), %edi
- movl 0x10(%esp), %esi
-
-.Lcopy:
- lodsb
- stosb
- testb %al, %al
- jnz .Lcopy
-
- movl %edi, %eax
- decl %eax
- popl %esi
- popl %edi
- ret
-.Lende:
-.size stpcpy,.Lende-stpcpy
diff --git a/mdk-stage1/dietlibc/i386/strcasecmp.S b/mdk-stage1/dietlibc/i386/strcasecmp.S
deleted file mode 100644
index a836680db..000000000
--- a/mdk-stage1/dietlibc/i386/strcasecmp.S
+++ /dev/null
@@ -1,31 +0,0 @@
-.text
-.globl strcasecmp
-
-strcasecmp:
- pushl %esi
- movl 0x8(%esp), %esi
- movl 0xc(%esp), %edx
- xorl %eax, %eax
- xorl %ecx, %ecx
- cld
-.Lloop:
- lodsb
- movb (%edx), %cl
- incl %edx
- or %al, %al
- jz .Lfinifirst
- cmp $'A', %al
- jnge .Lcmp
- cmp $'z', %al
- jg .Lcmp
- or $0x20, %al
- or $0x20, %cl
-.Lcmp:
- subl %ecx, %eax
- jz .Lloop
-.Lret:
- popl %esi
- ret
-.Lfinifirst:
- subl %ecx, %eax
- jmp .Lret
diff --git a/mdk-stage1/dietlibc/i386/strcat.S b/mdk-stage1/dietlibc/i386/strcat.S
deleted file mode 100644
index e7d74ef13..000000000
--- a/mdk-stage1/dietlibc/i386/strcat.S
+++ /dev/null
@@ -1,29 +0,0 @@
-.text
-.align 0
-.global strcat
-.type strcat,@function
-strcat:
- pushl %edi
- pushl %esi
-
- movl 12(%esp), %edi
- movl 16(%esp), %esi
-
- pushl %edi
-
- xorl %eax, %eax
- xorl %ecx, %ecx
- decl %ecx
- repne scasb
- decl %edi
-
-.Lloop:
- lodsb
- stosb
- testb %al, %al
- jnz .Lloop
-
- popl %eax
- popl %esi
- popl %edi
- ret
diff --git a/mdk-stage1/dietlibc/i386/strchr.S b/mdk-stage1/dietlibc/i386/strchr.S
deleted file mode 100644
index 4515d9835..000000000
--- a/mdk-stage1/dietlibc/i386/strchr.S
+++ /dev/null
@@ -1,22 +0,0 @@
-
-.text
-.type strchr,@function
-.global strchr
-.weak index
-.type index,@function
-
-index:
-strchr:
- movl 4(%esp),%ecx
- movb 8(%esp),%dl
-.Lloop:
- movb (%ecx),%al
- cmpb %al,%dl
- jz .Lfound
- incl %ecx
- testb %al,%al
- jnz .Lloop
- xorl %ecx,%ecx
-.Lfound:
- movl %ecx,%eax
- ret
diff --git a/mdk-stage1/dietlibc/i386/strcmp.S b/mdk-stage1/dietlibc/i386/strcmp.S
deleted file mode 100644
index e01064ffb..000000000
--- a/mdk-stage1/dietlibc/i386/strcmp.S
+++ /dev/null
@@ -1,31 +0,0 @@
-.text
-.global strcmp
-.type strcmp,@function
-.weak strcoll
-.type strcoll,@function
-
-#ifdef HIGH_PERFORMANCE
-.align 16
-#endif
-
-.Ldiff:
- movzbl (%edx), %ecx
- subl %ecx, %eax # (unsigned char)*p - (unsigned char)*q, so wie die Original libc
- ret # und ohne Überlaufprobleme:
- # (int) ((signed char)c - (signed char)d) != (int)(signed char) ((unsigned char)c - (unsigned char)d)
- # c = 'ä', d = 'e': left expression: -129, right expression: 127
-
-strcoll:
-strcmp:
- movl 4(%esp), %ecx
- movl 8(%esp), %edx
- xorl %eax, %eax
-.Lloop: # Schleifenanfang liegt genau auf Modulanfang + 0x10, damit alignbar
- movb (%ecx), %al
- cmpb (%edx), %al
- jnz .Ldiff
- incl %edx
- incl %ecx
- testb %al, %al
- jnz .Lloop
- ret
diff --git a/mdk-stage1/dietlibc/i386/strcpy.S b/mdk-stage1/dietlibc/i386/strcpy.S
deleted file mode 100644
index a597436bc..000000000
--- a/mdk-stage1/dietlibc/i386/strcpy.S
+++ /dev/null
@@ -1,24 +0,0 @@
-
-.text
-.align 0
-.global strcpy
-.type strcpy,@function
-strcpy:
- pushl %esi
- pushl %edi
-
- movl 12(%esp), %edx
- movl 16(%esp), %esi
- movl %edx, %edi
- cld
-
-.Lloop:
- lodsb
- stosb
- orb %al, %al
- jnz .Lloop
-
- popl %edi
- popl %esi
- movl %edx,%eax
- ret
diff --git a/mdk-stage1/dietlibc/i386/strlen.S b/mdk-stage1/dietlibc/i386/strlen.S
deleted file mode 100644
index 66f8ee553..000000000
--- a/mdk-stage1/dietlibc/i386/strlen.S
+++ /dev/null
@@ -1,18 +0,0 @@
-
-.text
-.type strlen,@function
-.global strlen
-
-strlen:
- movl 4(%esp),%ecx
- xorl %eax,%eax
- jecxz .Lnull
- decl %eax
-.Llbl: incl %eax
- cmpb $0,(%ecx, %eax)
- jne .Llbl
-.Lnull: ret
-
-.Lende:
-
-.size strlen,.Lende-strlen
diff --git a/mdk-stage1/dietlibc/i386/strncmp.S b/mdk-stage1/dietlibc/i386/strncmp.S
deleted file mode 100644
index bf07b07d0..000000000
--- a/mdk-stage1/dietlibc/i386/strncmp.S
+++ /dev/null
@@ -1,28 +0,0 @@
-.text
-.align 0
-.global strncmp
-.type strncmp,@function
-strncmp:
- push %ebx
- movl %esp,%ebx
- movl 12(%ebx),%edx
- movl 16(%ebx),%ecx
- movl 8(%ebx),%ebx
-.Lloop:
- jecxz .Ldone
- decl %ecx
- movb (%ebx),%al
- incl %edx
- incl %ebx
- movb %al,%ah
- subb -1(%edx),%al
- jnz .Lnotequal
- testb %ah,%ah
- jnz .Lloop
-
-.Ldone:
- xorl %eax,%eax
-.Lnotequal:
- movsx %al, %eax
- popl %ebx
- ret
diff --git a/mdk-stage1/dietlibc/i386/strncpy.S b/mdk-stage1/dietlibc/i386/strncpy.S
deleted file mode 100644
index 837b43c41..000000000
--- a/mdk-stage1/dietlibc/i386/strncpy.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright (C) 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- strncpy.S
- i386 assembler implementation of strncpy(3)
-*/
-
-#include "dietfeatures.h"
-
-.text
-.globl strncpy
-.type strncpy,@function
-
-strncpy:
- pushl %esi
- pushl %edi
- movl %esp, %ecx
- movl 0x0c(%ecx), %edi
- movl 0x10(%ecx), %esi
- movl 0x14(%ecx), %ecx
-
- movl %edi, %edx
-
-.Lloop:
- dec %ecx
- js .Lout
- lodsb
- stosb
- or %al, %al
- jnz .Lloop
-#ifdef WANT_FULL_POSIX_COMPAT
- repnz stosb
-#endif
-.Lout:
- movl %edx, %eax
- popl %edi
- popl %esi
- ret
diff --git a/mdk-stage1/dietlibc/i386/strrchr.S b/mdk-stage1/dietlibc/i386/strrchr.S
deleted file mode 100644
index 9fd6e8b32..000000000
--- a/mdk-stage1/dietlibc/i386/strrchr.S
+++ /dev/null
@@ -1,19 +0,0 @@
-.text
-.globl strrchr
-.type strrchr,@function
-
-strrchr:
- movl 0x4(%esp), %edx
- movb 0x8(%esp), %cl
- xorl %eax, %eax
- decl %edx
-.Lloop:
- incl %edx
- cmpb $0x0,(%edx)
- jz .Lret
- cmpb %cl, (%edx)
- jnz .Lloop
- movl %edx, %eax
- jmp .Lloop
-.Lret:
- ret
diff --git a/mdk-stage1/dietlibc/i386/syscalls.h b/mdk-stage1/dietlibc/i386/syscalls.h
deleted file mode 100644
index 3cbf7b605..000000000
--- a/mdk-stage1/dietlibc/i386/syscalls.h
+++ /dev/null
@@ -1,303 +0,0 @@
-
-#define __NR_exit 1
-#define __NR_fork 2
-#define __NR_read 3
-#define __NR_write 4
-#define __NR_open 5
-#define __NR_close 6
-#define __NR_waitpid 7
-#define __NR_creat 8
-#define __NR_link 9
-#define __NR_unlink 10
-#define __NR_execve 11
-#define __NR_chdir 12
-#define __NR_time 13
-#define __NR_mknod 14
-#define __NR_chmod 15
-#define __NR_lchown 16
-#define __NR_break 17
-#define __NR_oldstat 18
-#define __NR_lseek 19
-#define __NR_getpid 20
-#define __NR_mount 21
-#define __NR_umount 22
-#define __NR_setuid 23
-#define __NR_getuid 24
-#define __NR_stime 25
-#define __NR_ptrace 26
-#define __NR_alarm 27
-#define __NR_oldfstat 28
-#define __NR_pause 29
-#define __NR_utime 30
-#define __NR_stty 31
-#define __NR_gtty 32
-#define __NR_access 33
-#define __NR_nice 34
-#define __NR_ftime 35
-#define __NR_sync 36
-#define __NR_kill 37
-#define __NR_rename 38
-#define __NR_mkdir 39
-#define __NR_rmdir 40
-#define __NR_dup 41
-#define __NR_pipe 42
-#define __NR_times 43
-#define __NR_prof 44
-#define __NR_brk 45
-#define __NR_setgid 46
-#define __NR_getgid 47
-#define __NR_signal 48
-#define __NR_geteuid 49
-#define __NR_getegid 50
-#define __NR_acct 51
-#define __NR_umount2 52
-#define __NR_lock 53
-#define __NR_ioctl 54
-#define __NR_fcntl 55
-#define __NR_mpx 56
-#define __NR_setpgid 57
-#define __NR_ulimit 58
-#define __NR_oldolduname 59
-#define __NR_umask 60
-#define __NR_chroot 61
-#define __NR_ustat 62
-#define __NR_dup2 63
-#define __NR_getppid 64
-#define __NR_getpgrp 65
-#define __NR_setsid 66
-#define __NR_sigaction 67
-#define __NR_sgetmask 68
-#define __NR_ssetmask 69
-#define __NR_setreuid 70
-#define __NR_setregid 71
-#define __NR_sigsuspend 72
-#define __NR_sigpending 73
-#define __NR_sethostname 74
-#define __NR_setrlimit 75
-#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
-#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
-#define __NR_getgroups 80
-#define __NR_setgroups 81
-#define __NR_select 82
-#define __NR_symlink 83
-#define __NR_oldlstat 84
-#define __NR_readlink 85
-#define __NR_uselib 86
-#define __NR_swapon 87
-#define __NR_reboot 88
-#define __NR_readdir 89
-#define __NR_mmap 90
-#define __NR_munmap 91
-#define __NR_truncate 92
-#define __NR_ftruncate 93
-#define __NR_fchmod 94
-#define __NR_fchown 95
-#define __NR_getpriority 96
-#define __NR_setpriority 97
-#define __NR_profil 98
-#define __NR_statfs 99
-#define __NR_fstatfs 100
-#define __NR_ioperm 101
-#define __NR_socketcall 102
-#define __NR_syslog 103
-#define __NR_setitimer 104
-#define __NR_getitimer 105
-#define __NR_stat 106
-#define __NR_lstat 107
-#define __NR_fstat 108
-#define __NR_olduname 109
-#define __NR_iopl 110
-#define __NR_vhangup 111
-#define __NR_idle 112
-#define __NR_vm86old 113
-#define __NR_wait4 114
-#define __NR_swapoff 115
-#define __NR_sysinfo 116
-#define __NR_ipc 117
-#define __NR_fsync 118
-#define __NR_sigreturn 119
-#define __NR_clone 120
-#define __NR_setdomainname 121
-#define __NR_uname 122
-#define __NR_modify_ldt 123
-#define __NR_adjtimex 124
-#define __NR_mprotect 125
-#define __NR_sigprocmask 126
-#define __NR_create_module 127
-#define __NR_init_module 128
-#define __NR_delete_module 129
-#define __NR_get_kernel_syms 130
-#define __NR_quotactl 131
-#define __NR_getpgid 132
-#define __NR_fchdir 133
-#define __NR_bdflush 134
-#define __NR_sysfs 135
-#define __NR_personality 136
-#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
-#define __NR_setfsuid 138
-#define __NR_setfsgid 139
-#define __NR__llseek 140
-#define __NR_getdents 141
-#define __NR__newselect 142
-#define __NR_flock 143
-#define __NR_msync 144
-#define __NR_readv 145
-#define __NR_writev 146
-#define __NR_getsid 147
-#define __NR_fdatasync 148
-#define __NR__sysctl 149
-#define __NR_mlock 150
-#define __NR_munlock 151
-#define __NR_mlockall 152
-#define __NR_munlockall 153
-#define __NR_sched_setparam 154
-#define __NR_sched_getparam 155
-#define __NR_sched_setscheduler 156
-#define __NR_sched_getscheduler 157
-#define __NR_sched_yield 158
-#define __NR_sched_get_priority_max 159
-#define __NR_sched_get_priority_min 160
-#define __NR_sched_rr_get_interval 161
-#define __NR_nanosleep 162
-#define __NR_mremap 163
-#define __NR_setresuid 164
-#define __NR_getresuid 165
-#define __NR_vm86 166
-#define __NR_query_module 167
-#define __NR_poll 168
-#define __NR_nfsservctl 169
-#define __NR_setresgid 170
-#define __NR_getresgid 171
-#define __NR_prctl 172
-#define __NR_rt_sigreturn 173
-#define __NR_rt_sigaction 174
-#define __NR_rt_sigprocmask 175
-#define __NR_rt_sigpending 176
-#define __NR_rt_sigtimedwait 177
-#define __NR_rt_sigqueueinfo 178
-#define __NR_rt_sigsuspend 179
-#define __NR_pread 180
-#define __NR_pwrite 181
-#define __NR_chown 182
-#define __NR_getcwd 183
-#define __NR_capget 184
-#define __NR_capset 185
-#define __NR_sigaltstack 186
-#define __NR_sendfile 187
-#define __NR_getpmsg 188 /* some people actually want streams */
-#define __NR_putpmsg 189 /* some people actually want streams */
-#define __NR_vfork 190
-#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
-#define __NR_mmap2 192
-#define __NR_truncate64 193
-#define __NR_ftruncate64 194
-#define __NR_stat64 195
-#define __NR_lstat64 196
-#define __NR_fstat64 197
-#define __NR_lchown32 198
-#define __NR_getuid32 199
-#define __NR_getgid32 200
-#define __NR_geteuid32 201
-#define __NR_getegid32 202
-#define __NR_setreuid32 203
-#define __NR_setregid32 204
-#define __NR_getgroups32 205
-#define __NR_setgroups32 206
-#define __NR_fchown32 207
-#define __NR_setresuid32 208
-#define __NR_getresuid32 209
-#define __NR_setresgid32 210
-#define __NR_getresgid32 211
-#define __NR_chown32 212
-#define __NR_setuid32 213
-#define __NR_setgid32 214
-#define __NR_setfsuid32 215
-#define __NR_setfsgid32 216
-#define __NR_pivot_root 217
-#define __NR_mincore 218
-#define __NR_madvise 219
-#define __NR_madvise1 219 /* delete when C lib stub is removed */
-#define __NR_getdents64 220
-#define __NR_fcntl64 221
-#define __NR_security 223 /* syscall for security modules */
-#define __NR_gettid 224
-#define __NR_readahead 225
-#define __NR_setxattr 226
-#define __NR_lsetxattr 227
-#define __NR_fsetxattr 228
-#define __NR_getxattr 229
-#define __NR_lgetxattr 230
-#define __NR_fgetxattr 231
-#define __NR_listxattr 232
-#define __NR_llistxattr 233
-#define __NR_flistxattr 234
-#define __NR_removexattr 235
-#define __NR_lremovexattr 236
-#define __NR_fremovexattr 237
-#define __NR_tkill 238
-#define __NR_sendfile64 239
-#define __NR_futex 240
-#define __NR_sched_setaffinity 241
-#define __NR_sched_getaffinity 242
-#define __NR_set_thread_area 243
-#define __NR_get_thread_area 244
-#define __NR_io_setup 245
-#define __NR_io_destroy 246
-#define __NR_io_getevents 247
-#define __NR_io_submit 248
-#define __NR_io_cancel 249
-#define __NR_alloc_hugepages 250
-#define __NR_free_hugepages 251
-#define __NR_exit_group 252
-#define __NR_lookup_dcookie 253
-#define __NR_sys_epoll_create 254
-#define __NR_sys_epoll_ctl 255
-#define __NR_sys_epoll_wait 256
-#define __NR_remap_file_pages 257
-#define __NR_set_tid_address 258
-
-#define syscall_weak(name,wsym,sym) \
-.text; \
-.type wsym,@function; \
-.weak wsym; \
-wsym: ; \
-.type sym,@function; \
-.global sym; \
-sym: \
- movb $__NR_##name,%al; \
- jmp __unified_syscall; \
-.Lend##sym: ; \
-.size sym,.Lend##sym-sym
-
-#define syscall(name,sym) \
-.text; \
-.type sym,@function; \
-.global sym; \
-sym: \
-.ifle __NR_##name-255; \
- movb $__NR_##name,%al; \
- jmp __unified_syscall; \
-.else; \
- movw $__NR_##name,%ax; \
- jmp __unified_syscall_256; \
-.endif; \
-.Lend##sym: ; \
-.size sym,.Lend##sym-sym
-
-#ifndef __PIC__
-#define __socketcall(name,NAME) \
-.text; \
-.type name,@function; \
-.weak name; \
-name: ; \
-.global __libc_##name; \
-__libc_##name: ; \
- movb $SYS_##NAME,%al; \
- jmp socketcall; \
-.Lend##name:; \
-.size name,.Lend##name-name
-#else
-#define __socketcall(name,NAME)
-#endif
diff --git a/mdk-stage1/dietlibc/i386/tan.S b/mdk-stage1/dietlibc/i386/tan.S
deleted file mode 100644
index 4904c2d59..000000000
--- a/mdk-stage1/dietlibc/i386/tan.S
+++ /dev/null
@@ -1,12 +0,0 @@
-
-.text
-.type tan,@function
-.global tan
-tan:
- fldl 4(%esp)
- fsincos
- fdivrp
- ret
-
-.Lende:
-.size tan,.Lende-tan
diff --git a/mdk-stage1/dietlibc/i386/tanh.S b/mdk-stage1/dietlibc/i386/tanh.S
deleted file mode 100644
index 61d3f3376..000000000
--- a/mdk-stage1/dietlibc/i386/tanh.S
+++ /dev/null
@@ -1,32 +0,0 @@
-
-.text
-.type tanh,@function
-.global tanh
-
-tanh: # note: exp(x) = 2^(x*log2(e))
- fldl2e
- fmull 4(%esp) # x*log2(e)
- fld %st(0) # x*log2(e) x*log2(e)
- frndint # int(x*log2(e)) x*log2(e)
- fxch # x*log2(e) int(x*log2(e))
- fsub %st(1),%st(0) # frac(x*log2(e)) int(x*log2(e))
- f2xm1 # 2^(fract(x*log2(e)))-1 int(x*log2(e))
- fld1 # 1 2^(fract(x*log2(e)))-1 int(x*log2(e))
- faddp %st(0),%st(1) # 2^(fract(x*log2(e))) int(x*log2(e))
- fscale # 2^(x*log2(e)) int(x*log2(e))
- fstp %st(1) # 2^(x*log2(e))
-
-# now we have y = exp(x), but tanh(x) = (y - 1/y) / (y + 1/y)
-
- fld1
- fdiv %st(1),%st(0) # 1/y y
- fld %st(0) # 1/y 1/y y
- fadd %st(2) # y+1/y 1/y y
- fxch %st(2) # y 1/y y+1/y
- fsubp # y-1/y y+1/y
- fdivp # (y-1/y)/(y+1/y)
- ret
-
-.Lende:
-
-.size tanh,.ende-tanh
diff --git a/mdk-stage1/dietlibc/i386/unified.S b/mdk-stage1/dietlibc/i386/unified.S
deleted file mode 100644
index 989bf37b5..000000000
--- a/mdk-stage1/dietlibc/i386/unified.S
+++ /dev/null
@@ -1,59 +0,0 @@
-
-#include <dietfeatures.h>
-
-.text
-.global __unified_syscall_256
-.type __unified_syscall_256,@function
-__unified_syscall_256:
- movzwl %ax,%eax
- jmp .L1
-.L2:
-.size __unified_syscall_256,.L2-__unified_syscall_256
-.weak exit
-exit:
-.global _exit
-.type _exit,@function
-_exit:
- movb $1,%al
-.global __unified_syscall
-.type __unified_syscall,@function
-__unified_syscall:
-.size _exit,__unified_syscall-_exit
- movzbl %al, %eax
-.L1:
- push %edi
- push %esi
- push %ebx
- movl %esp,%edi
- /* we use movl instead of pop because otherwise a signal would
- destroy the stack frame and crash the program, although it
- would save a few bytes. */
- movl 0x10(%edi),%ebx
- movl 0x14(%edi),%ecx
- movl 0x18(%edi),%edx
- movl 0x1c(%edi),%esi
- movl 0x20(%edi),%edi
- int $0x80
- cmp $-124,%eax
- jbe .Lnoerror
- neg %eax
-#ifdef WANT_THREAD_SAFE
- movl %eax,%ebx
- call __errno_location
- movl %ebx,(%eax)
- orl $-1,%eax
-#else
- mov %eax,errno
- sbb %eax,%eax # eax = eax - eax - CY = -1
-#endif
-.Lnoerror:
- pop %ebx
- pop %esi
- pop %edi
-
-/* here we go and "reuse" the return for weak-void functions */
-#include "dietuglyweaks.h"
-
- ret
-.L3:
-.size __unified_syscall,.L3-__unified_syscall
diff --git a/mdk-stage1/dietlibc/i386/usleep.S b/mdk-stage1/dietlibc/i386/usleep.S
deleted file mode 100644
index 7c0cc6ce7..000000000
--- a/mdk-stage1/dietlibc/i386/usleep.S
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "PIC.h"
-
-.text
-.global usleep
-.type usleep,@function
-
-usleep:
- movl 4(%esp),%eax
- PIC_SAVE # non-PIC: empty line
- PIC_INIT # non-PIC: empty line
- xorl %edx,%edx
- movl $1000000,%ecx
- divl %ecx
- imull $1000,%edx
- pushl %edx
- pushl %eax
- movl %esp,%eax
- pushl %eax
- pushl %eax
-#ifdef __DYN_LIB
- call nanosleep@PLT
-#else
- call nanosleep
-#endif
- addl $16,%esp
- PIC_RESTORE # non-PIC: empty line
- ret
-
-.Lende:
-.size usleep,.Lende-usleep
-
diff --git a/mdk-stage1/dietlibc/i386/vfork.S b/mdk-stage1/dietlibc/i386/vfork.S
deleted file mode 100644
index c07c5f6af..000000000
--- a/mdk-stage1/dietlibc/i386/vfork.S
+++ /dev/null
@@ -1,9 +0,0 @@
-.text
-.globl vfork
-vfork:
- popl %edx
- xorl %eax,%eax
- movb $190, %al
- int $0x80
- jmpl *%edx
-.size vfork, . - vfork
diff --git a/mdk-stage1/dietlibc/i386/write12.S b/mdk-stage1/dietlibc/i386/write12.S
deleted file mode 100644
index a40f63a86..000000000
--- a/mdk-stage1/dietlibc/i386/write12.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "PIC.h"
-
-.text
-
-.global __write1
-.type __write1,@function
-
-.global __write2
-.type __write2,@function
-
- # regparm=1, daher Stringadresse in %eax
-__write2:
- clc # CY = 0
- .byte 0xB2 # zusammen mit nächstem Byte: mov dl,0xF9
-__write1:
- stc # CY = 1
- sbbl %ecx,%ecx # __write2: ecx=0, __write1: ecx=-1
- incl %ecx
- incl %ecx # __write2: ecx=2, __write1: ecx=1
- xorl %edx,%edx
- decl %edx
-.Lnext: incl %edx
- cmpb %ch,(%edx,%eax) # ch=0, da bei beiden Filedescriptoren Bits 15:8 0 sind
- jnz .Lnext # Stringlänge in edx, ohne eax zerstört zu haben
- PIC_SAVE # non-PIC: empty line
- PIC_INIT # non-PIC: empty line
- pushl %edx
- pushl %eax
- pushl %ecx
-#ifdef __DYN_LIB
- call write@PLT
-#else
- call write # alles ruf uf dn Stack und ab damit
-#endif
- addl $12,%esp # und das leidvolle Putzen
- PIC_RESTORE # non-PIC: empty line
- ret
diff --git a/mdk-stage1/dietlibc/ia64/Makefile.add b/mdk-stage1/dietlibc/ia64/Makefile.add
deleted file mode 100644
index f660930af..000000000
--- a/mdk-stage1/dietlibc/ia64/Makefile.add
+++ /dev/null
@@ -1,2 +0,0 @@
-VPATH:=ia64:syscalls.s:$(VPATH)
-LIBOBJ+=$(OBJDIR)/__time.o $(OBJDIR)/__waitpid.o $(OBJDIR)/__nice.o $(OBJDIR)/__alarm.o
diff --git a/mdk-stage1/dietlibc/ia64/README b/mdk-stage1/dietlibc/ia64/README
deleted file mode 100644
index 684364d93..000000000
--- a/mdk-stage1/dietlibc/ia64/README
+++ /dev/null
@@ -1,4 +0,0 @@
-A Port for IA64.
-
-Does not yet support: clone, FPU and profiling. And includes
-some subtle bugs which will hopefully be fixed later.
diff --git a/mdk-stage1/dietlibc/ia64/__alarm.c b/mdk-stage1/dietlibc/ia64/__alarm.c
deleted file mode 100644
index e2c499f2c..000000000
--- a/mdk-stage1/dietlibc/ia64/__alarm.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "alpha/__alarm.c"
diff --git a/mdk-stage1/dietlibc/ia64/__longjmp.S b/mdk-stage1/dietlibc/ia64/__longjmp.S
deleted file mode 100644
index 698bda528..000000000
--- a/mdk-stage1/dietlibc/ia64/__longjmp.S
+++ /dev/null
@@ -1 +0,0 @@
-/* No longjmp yet */
diff --git a/mdk-stage1/dietlibc/ia64/__nice.c b/mdk-stage1/dietlibc/ia64/__nice.c
deleted file mode 100644
index 012ea2628..000000000
--- a/mdk-stage1/dietlibc/ia64/__nice.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <sys/resource.h>
-
-int nice(int x) {
- if (setpriority(PRIO_PROCESS,0,x)) return -1;
- return getpriority(PRIO_PROCESS,0);
-}
diff --git a/mdk-stage1/dietlibc/ia64/__testandset.S b/mdk-stage1/dietlibc/ia64/__testandset.S
deleted file mode 100644
index d462e3c58..000000000
--- a/mdk-stage1/dietlibc/ia64/__testandset.S
+++ /dev/null
@@ -1,11 +0,0 @@
-.text
-.globl __testandset
-.proc __testandset
-__testandset:
- mov ar.ccv = r0
- mov r29 = 1
- ld8 r3 = [r32]
- cmpxchg8.acq r8 = [r32], r29, ar.ccv /* cmpxchg is atomic */
- br.ret.sptk.clr b0
-.endp __testandset
-.size __testandset, . - __testandset
diff --git a/mdk-stage1/dietlibc/ia64/__time.c b/mdk-stage1/dietlibc/ia64/__time.c
deleted file mode 100644
index 7547acb1d..000000000
--- a/mdk-stage1/dietlibc/ia64/__time.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <time.h>
-#include <sys/time.h>
-
-time_t time(time_t*t) {
- struct timeval tv;
- time_t ret;
- if (gettimeofday(&tv,0)) {
- ret=(time_t)-1;
- } else {
- ret=(time_t)tv.tv_sec;
- }
- if (t) *t=ret;
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/ia64/__waitpid.c b/mdk-stage1/dietlibc/ia64/__waitpid.c
deleted file mode 100644
index 8c228f375..000000000
--- a/mdk-stage1/dietlibc/ia64/__waitpid.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <sys/types.h>
-
-pid_t waitpid(int pid, int * wait_stat, int flags) {
- return wait4(pid, wait_stat, flags, 0);
-}
diff --git a/mdk-stage1/dietlibc/ia64/accept.S b/mdk-stage1/dietlibc/ia64/accept.S
deleted file mode 100644
index 7bdc38c7e..000000000
--- a/mdk-stage1/dietlibc/ia64/accept.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(accept, accept);
diff --git a/mdk-stage1/dietlibc/ia64/bind.S b/mdk-stage1/dietlibc/ia64/bind.S
deleted file mode 100644
index 05849d470..000000000
--- a/mdk-stage1/dietlibc/ia64/bind.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(bind, bind);
diff --git a/mdk-stage1/dietlibc/ia64/clone.S b/mdk-stage1/dietlibc/ia64/clone.S
deleted file mode 100644
index ba768141c..000000000
--- a/mdk-stage1/dietlibc/ia64/clone.S
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This is untested code which probably won´t work out of the box! */
-
-#include "syscalls.h"
-#include <errno.h>
-
-.text
-.globl __clone
-.proc __clone
-.weak __clone2
-__clone2:
-__clone:
- mov r8 = EINVAL
- cmp.eq p6,p0=0,r32
-(p6) br.cond.spnt.few __error_unified_syscall
- cmp.eq p6,p0=0,r33
-(p6) br.cond.spnt.few __error_unified_syscall
- flushrs
-
- mov.m r17 = ar.rsc
- mov r14 = r32
- mov r18 = r33
- mov r16 = r36;;
- mov r15 = __NR_clone2
- break 0x100000
- cmp.eq p6,p0=-1,r10
-(p6) br.cond.spnt.few __error_unified_syscall
- cmp.eq p6,p7=0,r8
-(p6) ld8 r34=[r14],8
-(p6) mov.m ar.bspstore=r18
-(p6) mov r32 = r16
- mov.m ar.rsc = r17
-(p7) br.ret.sptk b0
- ld8 r1 = [r14]
- mov b6 = r34
- br.call.dptk.few b0=b6
- mov r32 = r8
- br.call.dptk.few b0=__error_unified_syscall
- br.ret.sptk.few b0
-.endp __clone
-.endp __clone2
-.size __clone, . - __clone
diff --git a/mdk-stage1/dietlibc/ia64/connect.S b/mdk-stage1/dietlibc/ia64/connect.S
deleted file mode 100644
index 5fbd151ae..000000000
--- a/mdk-stage1/dietlibc/ia64/connect.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(connect, connect);
diff --git a/mdk-stage1/dietlibc/ia64/fork.S b/mdk-stage1/dietlibc/ia64/fork.S
deleted file mode 100644
index 3b253a80b..000000000
--- a/mdk-stage1/dietlibc/ia64/fork.S
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "syscalls.h"
-
-.text
-.globl fork
-fork:
- mov r15 = __NR_clone
- mov r32 = 17
- br __unified_syscall
diff --git a/mdk-stage1/dietlibc/ia64/getpeername.S b/mdk-stage1/dietlibc/ia64/getpeername.S
deleted file mode 100644
index fdaa1038a..000000000
--- a/mdk-stage1/dietlibc/ia64/getpeername.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getpeername, getpeername);
diff --git a/mdk-stage1/dietlibc/ia64/getsockname.S b/mdk-stage1/dietlibc/ia64/getsockname.S
deleted file mode 100644
index 1ea0bc000..000000000
--- a/mdk-stage1/dietlibc/ia64/getsockname.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getsockname, getsockname);
diff --git a/mdk-stage1/dietlibc/ia64/getsockopt.S b/mdk-stage1/dietlibc/ia64/getsockopt.S
deleted file mode 100644
index 465c4e08e..000000000
--- a/mdk-stage1/dietlibc/ia64/getsockopt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(getsockopt, getsockopt);
diff --git a/mdk-stage1/dietlibc/ia64/listen.S b/mdk-stage1/dietlibc/ia64/listen.S
deleted file mode 100644
index 66a3fe376..000000000
--- a/mdk-stage1/dietlibc/ia64/listen.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(listen, listen);
diff --git a/mdk-stage1/dietlibc/ia64/mmap.S b/mdk-stage1/dietlibc/ia64/mmap.S
deleted file mode 100644
index cca4bbdbb..000000000
--- a/mdk-stage1/dietlibc/ia64/mmap.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall (mmap, mmap)
diff --git a/mdk-stage1/dietlibc/ia64/msgctl.S b/mdk-stage1/dietlibc/ia64/msgctl.S
deleted file mode 100644
index d7caed2cc..000000000
--- a/mdk-stage1/dietlibc/ia64/msgctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgctl,msgctl)
diff --git a/mdk-stage1/dietlibc/ia64/msgget.S b/mdk-stage1/dietlibc/ia64/msgget.S
deleted file mode 100644
index 518d67ac4..000000000
--- a/mdk-stage1/dietlibc/ia64/msgget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgget,msgget)
diff --git a/mdk-stage1/dietlibc/ia64/msgrcv.S b/mdk-stage1/dietlibc/ia64/msgrcv.S
deleted file mode 100644
index ab62e6c30..000000000
--- a/mdk-stage1/dietlibc/ia64/msgrcv.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgrcv,msgrcv)
diff --git a/mdk-stage1/dietlibc/ia64/msgsnd.S b/mdk-stage1/dietlibc/ia64/msgsnd.S
deleted file mode 100644
index 890a996a2..000000000
--- a/mdk-stage1/dietlibc/ia64/msgsnd.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(msgsnd,msgsnd)
diff --git a/mdk-stage1/dietlibc/ia64/pipe.S b/mdk-stage1/dietlibc/ia64/pipe.S
deleted file mode 100644
index c3bf4570b..000000000
--- a/mdk-stage1/dietlibc/ia64/pipe.S
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "syscalls.h"
-
-.text
-.globl pipe
-.proc pipe
-
-pipe:
- st8 [r12] = r32
- mov r15 = __NR_pipe
- break.i 0x100000
- ld8 r2 = [r12]
- cmp.eq p7,p6=-1,r10
-(p6) st4 [r2] = r8,4
- mov r8 = r0
-(p7) br.cond.spnt.few __error_unified_syscall
-(p6) st4 [r2] = r9
-(p6) br.ret.sptk.few b0
-
-.endp pipe
-.size pipe, . - pipe
diff --git a/mdk-stage1/dietlibc/ia64/recv.S b/mdk-stage1/dietlibc/ia64/recv.S
deleted file mode 100644
index 1f1640390..000000000
--- a/mdk-stage1/dietlibc/ia64/recv.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(recv, recv);
diff --git a/mdk-stage1/dietlibc/ia64/recvfrom.S b/mdk-stage1/dietlibc/ia64/recvfrom.S
deleted file mode 100644
index d3c2e602f..000000000
--- a/mdk-stage1/dietlibc/ia64/recvfrom.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(recvfrom, recvfrom);
diff --git a/mdk-stage1/dietlibc/ia64/recvmsg.S b/mdk-stage1/dietlibc/ia64/recvmsg.S
deleted file mode 100644
index cfbbafdc1..000000000
--- a/mdk-stage1/dietlibc/ia64/recvmsg.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(recvmsg, recvmsg);
diff --git a/mdk-stage1/dietlibc/ia64/semctl.S b/mdk-stage1/dietlibc/ia64/semctl.S
deleted file mode 100644
index e215ed955..000000000
--- a/mdk-stage1/dietlibc/ia64/semctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semctl,semctl)
diff --git a/mdk-stage1/dietlibc/ia64/semget.S b/mdk-stage1/dietlibc/ia64/semget.S
deleted file mode 100644
index 67f488546..000000000
--- a/mdk-stage1/dietlibc/ia64/semget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semget,semget)
diff --git a/mdk-stage1/dietlibc/ia64/semop.S b/mdk-stage1/dietlibc/ia64/semop.S
deleted file mode 100644
index 81b6fc606..000000000
--- a/mdk-stage1/dietlibc/ia64/semop.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(semop,semop)
diff --git a/mdk-stage1/dietlibc/ia64/send.S b/mdk-stage1/dietlibc/ia64/send.S
deleted file mode 100644
index 38f47f398..000000000
--- a/mdk-stage1/dietlibc/ia64/send.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(send, send);
diff --git a/mdk-stage1/dietlibc/ia64/sendmsg.S b/mdk-stage1/dietlibc/ia64/sendmsg.S
deleted file mode 100644
index c2bc80f72..000000000
--- a/mdk-stage1/dietlibc/ia64/sendmsg.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(sendmsg, sendmsg);
diff --git a/mdk-stage1/dietlibc/ia64/sendto.S b/mdk-stage1/dietlibc/ia64/sendto.S
deleted file mode 100644
index 1579a3b45..000000000
--- a/mdk-stage1/dietlibc/ia64/sendto.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(sendto, sendto);
diff --git a/mdk-stage1/dietlibc/ia64/setjmp.S b/mdk-stage1/dietlibc/ia64/setjmp.S
deleted file mode 100644
index f0f5bc431..000000000
--- a/mdk-stage1/dietlibc/ia64/setjmp.S
+++ /dev/null
@@ -1 +0,0 @@
-/* No, I am not going to save 128 registers */
diff --git a/mdk-stage1/dietlibc/ia64/setsockopt.S b/mdk-stage1/dietlibc/ia64/setsockopt.S
deleted file mode 100644
index 45fcfbb6c..000000000
--- a/mdk-stage1/dietlibc/ia64/setsockopt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(setsockopt, setsockopt);
diff --git a/mdk-stage1/dietlibc/ia64/shmat.S b/mdk-stage1/dietlibc/ia64/shmat.S
deleted file mode 100644
index 51248173d..000000000
--- a/mdk-stage1/dietlibc/ia64/shmat.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmat,shmat)
diff --git a/mdk-stage1/dietlibc/ia64/shmctl.S b/mdk-stage1/dietlibc/ia64/shmctl.S
deleted file mode 100644
index d56caace4..000000000
--- a/mdk-stage1/dietlibc/ia64/shmctl.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmctl,shmctl)
diff --git a/mdk-stage1/dietlibc/ia64/shmdt.S b/mdk-stage1/dietlibc/ia64/shmdt.S
deleted file mode 100644
index d9812a799..000000000
--- a/mdk-stage1/dietlibc/ia64/shmdt.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmdt,shmdt)
diff --git a/mdk-stage1/dietlibc/ia64/shmget.S b/mdk-stage1/dietlibc/ia64/shmget.S
deleted file mode 100644
index 82914223f..000000000
--- a/mdk-stage1/dietlibc/ia64/shmget.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shmget,shmget)
diff --git a/mdk-stage1/dietlibc/ia64/shutdown.S b/mdk-stage1/dietlibc/ia64/shutdown.S
deleted file mode 100644
index 024e99e18..000000000
--- a/mdk-stage1/dietlibc/ia64/shutdown.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(shutdown, shutdown);
diff --git a/mdk-stage1/dietlibc/ia64/socket.S b/mdk-stage1/dietlibc/ia64/socket.S
deleted file mode 100644
index cc453881f..000000000
--- a/mdk-stage1/dietlibc/ia64/socket.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(socket, socket);
diff --git a/mdk-stage1/dietlibc/ia64/socketpair.S b/mdk-stage1/dietlibc/ia64/socketpair.S
deleted file mode 100644
index d92eaa4d8..000000000
--- a/mdk-stage1/dietlibc/ia64/socketpair.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(socketpair, socketpair);
diff --git a/mdk-stage1/dietlibc/ia64/start.S b/mdk-stage1/dietlibc/ia64/start.S
deleted file mode 100644
index dbacb25f6..000000000
--- a/mdk-stage1/dietlibc/ia64/start.S
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- Copyright (C) 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- This file is part of the IA64-Port of the dietlibc
-
- start.S
- Implemenation of the _start startup function
-*/
-
-.psr abi64
-.psr lsb
-.lsb
-
-.text
-.globl _start
-.proc _start
-
-_start:
- alloc r2 = ar.pfs,0,0,7,0
- adds out1 = 16, sp /* base arguments */
- movl gp = @gprel(0f) /* base offset */
- ;;
-0:
- ld8 out0 = [out1], 8 /* load argc and set argv */
- mov r9 = ip
- ;;
- shladd out2=out0,3,out1 /* envp = argv+8*argc */
- sub gp = r9, gp /* subtract program counter */
- ;;
- addl r15 = @ltoff(environ#), gp /* offset to environ */
- adds out2 = 8, out2 /* envp += 8 */
- ;;
- ld8 r14 = [r15]
- ;;
- st8 [r14] = out2 /* store envp in environ */
- br.call.sptk.few rp = main /* call main */
- ;;
- mov r32 = r8 /* store return code */
- br _exit /* branch to _exit */
-.endp _start
-.size _start, . - _start
diff --git a/mdk-stage1/dietlibc/ia64/syscalls.h b/mdk-stage1/dietlibc/ia64/syscalls.h
deleted file mode 100644
index 65eda0ed2..000000000
--- a/mdk-stage1/dietlibc/ia64/syscalls.h
+++ /dev/null
@@ -1,242 +0,0 @@
-#ifndef __DLIBC_SYSCALL_H_
-#define __DLIBC_SYSCALL_H_
-
-#define __NR_ni_syscall 1024
-#define __NR_exit 1025
-#define __NR_read 1026
-#define __NR_write 1027
-#define __NR_open 1028
-#define __NR_close 1029
-#define __NR_creat 1030
-#define __NR_link 1031
-#define __NR_unlink 1032
-#define __NR_execve 1033
-#define __NR_chdir 1034
-#define __NR_fchdir 1035
-#define __NR_utimes 1036
-#define __NR_mknod 1037
-#define __NR_chmod 1038
-#define __NR_chown 1039
-#define __NR_lseek 1040
-#define __NR_getpid 1041
-#define __NR_getppid 1042
-#define __NR_mount 1043
-#define __NR_umount 1044
-#define __NR_setuid 1045
-#define __NR_getuid 1046
-#define __NR_geteuid 1047
-#define __NR_ptrace 1048
-#define __NR_access 1049
-#define __NR_sync 1050
-#define __NR_fsync 1051
-#define __NR_fdatasync 1052
-#define __NR_kill 1053
-#define __NR_rename 1054
-#define __NR_mkdir 1055
-#define __NR_rmdir 1056
-#define __NR_dup 1057
-#define __NR_pipe 1058
-#define __NR_times 1059
-#define __NR_brk 1060
-#define __NR_setgid 1061
-#define __NR_getgid 1062
-#define __NR_getegid 1063
-#define __NR_acct 1064
-#define __NR_ioctl 1065
-#define __NR_fcntl 1066
-#define __NR_umask 1067
-#define __NR_chroot 1068
-#define __NR_ustat 1069
-#define __NR_dup2 1070
-#define __NR_setreuid 1071
-#define __NR_setregid 1072
-#define __NR_getresuid 1073
-#define __NR_setresuid 1074
-#define __NR_getresgid 1075
-#define __NR_setresgid 1076
-#define __NR_getgroups 1077
-#define __NR_setgroups 1078
-#define __NR_getpgid 1079
-#define __NR_setpgid 1080
-#define __NR_setsid 1081
-#define __NR_getsid 1082
-#define __NR_sethostname 1083
-#define __NR_setrlimit 1084
-#define __NR_getrlimit 1085
-#define __NR_getrusage 1086
-#define __NR_gettimeofday 1087
-#define __NR_settimeofday 1088
-#define __NR_select 1089
-#define __NR_poll 1090
-#define __NR_symlink 1091
-#define __NR_readlink 1092
-#define __NR_uselib 1093
-#define __NR_swapon 1094
-#define __NR_swapoff 1095
-#define __NR_reboot 1096
-#define __NR_truncate 1097
-#define __NR_ftruncate 1098
-#define __NR_fchmod 1099
-#define __NR_fchown 1100
-#define __NR_getpriority 1101
-#define __NR_setpriority 1102
-#define __NR_statfs 1103
-#define __NR_fstatfs 1104
-#define __NR_gettid 1105
-#define __NR_semget 1106
-#define __NR_semop 1107
-#define __NR_semctl 1108
-#define __NR_msgget 1109
-#define __NR_msgsnd 1110
-#define __NR_msgrcv 1111
-#define __NR_msgctl 1112
-#define __NR_shmget 1113
-#define __NR_shmat 1114
-#define __NR_shmdt 1115
-#define __NR_shmctl 1116
-#define __NR_syslog 1117
-#define __NR_setitimer 1118
-#define __NR_getitimer 1119
-#define __NR_old_stat 1120
-#define __NR_old_lstat 1121
-#define __NR_old_fstat 1122
-#define __NR_vhangup 1123
-#define __NR_lchown 1124
-#define __NR_vm86 1125
-#define __NR_wait4 1126
-#define __NR_sysinfo 1127
-#define __NR_clone 1128
-#define __NR_setdomainname 1129
-#define __NR_uname 1130
-#define __NR_adjtimex 1131
-#define __NR_create_module 1132
-#define __NR_init_module 1133
-#define __NR_delete_module 1134
-#define __NR_get_kernel_syms 1135
-#define __NR_query_module 1136
-#define __NR_quotactl 1137
-#define __NR_bdflush 1138
-#define __NR_sysfs 1139
-#define __NR_personality 1140
-#define __NR_afs_syscall 1141
-#define __NR_setfsuid 1142
-#define __NR_setfsgid 1143
-#define __NR_getdents 1144
-#define __NR_flock 1145
-#define __NR_readv 1146
-#define __NR_writev 1147
-#define __NR_pread 1148
-#define __NR_pwrite 1149
-#define __NR__sysctl 1150
-#define __NR_mmap 1151
-#define __NR_munmap 1152
-#define __NR_mlock 1153
-#define __NR_mlockall 1154
-#define __NR_mprotect 1155
-#define __NR_mremap 1156
-#define __NR_msync 1157
-#define __NR_munlock 1158
-#define __NR_munlockall 1159
-#define __NR_sched_getparam 1160
-#define __NR_sched_setparam 1161
-#define __NR_sched_getscheduler 1162
-#define __NR_sched_setscheduler 1163
-#define __NR_sched_yield 1164
-#define __NR_sched_get_priority_max 1165
-#define __NR_sched_get_priority_min 1166
-#define __NR_sched_rr_get_interval 1167
-#define __NR_nanosleep 1168
-#define __NR_nfsservctl 1169
-#define __NR_prctl 1170
-#define __NR_mmap2 1172
-#define __NR_pciconfig_read 1173
-#define __NR_pciconfig_write 1174
-#define __NR_perfmonctl 1175
-#define __NR_sigaltstack 1176
-#define __NR_rt_sigaction 1177
-#define __NR_rt_sigpending 1178
-#define __NR_rt_sigprocmask 1179
-#define __NR_rt_sigqueueinfo 1180
-#define __NR_rt_sigreturn 1181
-#define __NR_rt_sigsuspend 1182
-#define __NR_rt_sigtimedwait 1183
-#define __NR_getcwd 1184
-#define __NR_capget 1185
-#define __NR_capset 1186
-#define __NR_sendfile 1187
-#define __NR_getpmsg 1188
-#define __NR_putpmsg 1189
-#define __NR_socket 1190
-#define __NR_bind 1191
-#define __NR_connect 1192
-#define __NR_listen 1193
-#define __NR_accept 1194
-#define __NR_getsockname 1195
-#define __NR_getpeername 1196
-#define __NR_socketpair 1197
-#define __NR_send 1198
-#define __NR_sendto 1199
-#define __NR_recv 1200
-#define __NR_recvfrom 1201
-#define __NR_shutdown 1202
-#define __NR_setsockopt 1203
-#define __NR_getsockopt 1204
-#define __NR_sendmsg 1205
-#define __NR_recvmsg 1206
-#define __NR_pivot_root 1207
-#define __NR_mincore 1208
-#define __NR_madvise 1209
-#define __NR_stat 1210
-#define __NR_lstat 1211
-#define __NR_fstat 1212
-#define __NR_clone2 1213
-#define __NR_getdents64 1214
-#define __NR_getunwind 1215
-#define __NR_readahead 1216
-#define __NR_setxattr 1217
-#define __NR_lsetxattr 1218
-#define __NR_fsetxattr 1219
-#define __NR_getxattr 1220
-#define __NR_lgetxattr 1221
-#define __NR_fgetxattr 1222
-#define __NR_listxattr 1223
-#define __NR_llistxattr 1224
-#define __NR_flistxattr 1225
-#define __NR_removexattr 1226
-#define __NR_lremovexattr 1227
-#define __NR_fremovexattr 1228
-#define __NR_tkill 1229
-#define __NR_futex 1230
-#define __NR_sched_setaffinity 1231
-#define __NR_sched_getaffinity 1232
-#define __NR_security 1233
-#define __NR_alloc_hugepages 1234
-#define __NR_free_hugepages 1235
-#define __NR_exit_group 1236
-#define __NR_lookup_dcookie 1237
-#define __NR_io_setup 1238
-#define __NR_io_destroy 1239
-#define __NR_io_getevents 1240
-#define __NR_io_submit 1241
-#define __NR_io_cancel 1242
-#define __NR_epoll_create 1243
-#define __NR_epoll_ctl 1244
-#define __NR_epoll_wait 1245
-
-#define syscall(name, sym) \
-.text; \
-.globl sym; \
-sym: \
- mov r15 = __NR_##name; \
- br __unified_syscall;
-
-#define syscall_weak(name, sym, wsym) \
-.text; \
-.weak wsym; \
-wsym: \
-.globl sym; \
-sym: \
- mov r15 = __NR_##name; \
- br __unified_syscall;
-
-#endif
diff --git a/mdk-stage1/dietlibc/ia64/unified.S b/mdk-stage1/dietlibc/ia64/unified.S
deleted file mode 100644
index 998fba75e..000000000
--- a/mdk-stage1/dietlibc/ia64/unified.S
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2002 Thomas M. Ogrisegg
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-
- This file is part of the ia64-Port of dietlibc
-
- unified.S
- General system-call interface
-*/
-
-.lsb
-
-.text
-
-.globl __unified_syscall
-.proc __unified_syscall
-.globl __error_unified_syscall
-.proc __error_unified_syscall
-.globl _exit
-.proc _exit
-
-_exit:
- mov r15 = 1025
-.endp _exit
-.size _exit, . - _exit
-
-__unified_syscall:
- break.i 0x100000
- movl r2=errno
- cmp.eq p6,p0=-1,r10
- ;;
-__error_unified_syscall:
-(p6) st4 [r2]=r8
-(p6) mov r8=-1
-
-#include "dietuglyweaks.h"
-
- br.ret.sptk.few rp
-
-.endp __unified_syscall
-.endp __error_unified_syscall
-.size __unified_syscall, __error_unified_syscall - __unified_syscall
-.size __error_unified_syscall, . - __error_unified_syscall
diff --git a/mdk-stage1/dietlibc/ia64/utime.S b/mdk-stage1/dietlibc/ia64/utime.S
deleted file mode 100644
index a9a8aada6..000000000
--- a/mdk-stage1/dietlibc/ia64/utime.S
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "syscalls.h"
-
-syscall(utimes,utime)
diff --git a/mdk-stage1/dietlibc/ia64/vfork.S b/mdk-stage1/dietlibc/ia64/vfork.S
deleted file mode 100644
index e59f04364..000000000
--- a/mdk-stage1/dietlibc/ia64/vfork.S
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "syscalls.h"
-
-.text
-.globl vfork
-vfork:
- mov r15 = __NR_clone
- mov r32 = 16657
- br __unified_syscall
diff --git a/mdk-stage1/dietlibc/include/alloca.h b/mdk-stage1/dietlibc/include/alloca.h
deleted file mode 100644
index 41f92354f..000000000
--- a/mdk-stage1/dietlibc/include/alloca.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ALLOCA_H
-#define _ALLOCA_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#ifdef __GNUC__
-#define alloca(x) __builtin_alloca(x)
-#else
-void *alloca(size_t size) __THROW;
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/arpa/inet.h b/mdk-stage1/dietlibc/include/arpa/inet.h
deleted file mode 100644
index bb278d399..000000000
--- a/mdk-stage1/dietlibc/include/arpa/inet.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ARPA_INET_H
-#define _ARPA_INET_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-
-int inet_aton(const char *cp, struct in_addr *inp) __THROW;
-unsigned long int inet_addr(const char *cp) __THROW;
-unsigned long int inet_network(const char *cp) __THROW;
-char *inet_ntoa(struct in_addr in) __THROW;
-char *inet_ntoa_r(struct in_addr in,char* buf) __THROW;
-struct in_addr inet_makeaddr(int net, int host) __THROW;
-unsigned long int inet_lnaof(struct in_addr in) __THROW;
-unsigned long int inet_netof(struct in_addr in) __THROW;
-
-int inet_pton (int AF, const char* CP, void* BUF) __THROW;
-const char* inet_ntop (int AF, const void* CP, char* BUF, size_t LEN) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/arpa/nameser.h b/mdk-stage1/dietlibc/include/arpa/nameser.h
deleted file mode 100644
index 9327006b0..000000000
--- a/mdk-stage1/dietlibc/include/arpa/nameser.h
+++ /dev/null
@@ -1,253 +0,0 @@
-#ifndef _ARPA_NAMESER_H
-#define _ARPA_NAMESER_H
-
-#include <endian.h>
-
-#define NS_PACKETSZ 512 /* maximum packet size */
-#define NS_MAXDNAME 1025 /* maximum domain name */
-#define NS_MAXCDNAME 255 /* maximum compressed domain name */
-#define NS_MAXLABEL 63 /* maximum length of domain label */
-#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
-#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
-#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
-#define NS_INT32SZ 4 /* #/bytes of data in a u_int32_t */
-#define NS_INT16SZ 2 /* #/bytes of data in a u_int16_t */
-#define NS_INT8SZ 1 /* #/bytes of data in a u_int8_t */
-#define NS_INADDRSZ 4 /* IPv4 T_A */
-#define NS_IN6ADDRSZ 16 /* IPv6 T_AAAA */
-#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
-#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
-
-/*
- * Currently defined type values for resources and queries.
- */
-typedef enum __ns_type {
- ns_t_invalid = 0, /* Cookie. */
- ns_t_a = 1, /* Host address. */
- ns_t_ns = 2, /* Authoritative server. */
- ns_t_md = 3, /* Mail destination. */
- ns_t_mf = 4, /* Mail forwarder. */
- ns_t_cname = 5, /* Canonical name. */
- ns_t_soa = 6, /* Start of authority zone. */
- ns_t_mb = 7, /* Mailbox domain name. */
- ns_t_mg = 8, /* Mail group member. */
- ns_t_mr = 9, /* Mail rename name. */
- ns_t_null = 10, /* Null resource record. */
- ns_t_wks = 11, /* Well known service. */
- ns_t_ptr = 12, /* Domain name pointer. */
- ns_t_hinfo = 13, /* Host information. */
- ns_t_minfo = 14, /* Mailbox information. */
- ns_t_mx = 15, /* Mail routing information. */
- ns_t_txt = 16, /* Text strings. */
- ns_t_rp = 17, /* Responsible person. */
- ns_t_afsdb = 18, /* AFS cell database. */
- ns_t_x25 = 19, /* X_25 calling address. */
- ns_t_isdn = 20, /* ISDN calling address. */
- ns_t_rt = 21, /* Router. */
- ns_t_nsap = 22, /* NSAP address. */
- ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */
- ns_t_sig = 24, /* Security signature. */
- ns_t_key = 25, /* Security key. */
- ns_t_px = 26, /* X.400 mail mapping. */
- ns_t_gpos = 27, /* Geographical position (withdrawn). */
- ns_t_aaaa = 28, /* Ip6 Address. */
- ns_t_loc = 29, /* Location Information. */
- ns_t_nxt = 30, /* Next domain (security). */
- ns_t_eid = 31, /* Endpoint identifier. */
- ns_t_nimloc = 32, /* Nimrod Locator. */
- ns_t_srv = 33, /* Server Selection. */
- ns_t_atma = 34, /* ATM Address */
- ns_t_naptr = 35, /* Naming Authority PoinTeR */
- ns_t_kx = 36, /* Key Exchange */
- ns_t_cert = 37, /* Certification record */
- ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */
- ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
- ns_t_sink = 40, /* Kitchen sink (experimentatl) */
- ns_t_opt = 41, /* EDNS0 option (meta-RR) */
- ns_t_tsig = 250, /* Transaction signature. */
- ns_t_ixfr = 251, /* Incremental zone transfer. */
- ns_t_axfr = 252, /* Transfer zone of authority. */
- ns_t_mailb = 253, /* Transfer mailbox records. */
- ns_t_maila = 254, /* Transfer mail agent records. */
- ns_t_any = 255, /* Wildcard match. */
- ns_t_zxfr = 256, /* BIND-specific, nonstandard. */
- ns_t_max = 65536
-} ns_type;
-
-/*
- * Values for class field
- */
-typedef enum __ns_class {
- ns_c_invalid = 0, /* Cookie. */
- ns_c_in = 1, /* Internet. */
- ns_c_2 = 2, /* unallocated/unsupported. */
- ns_c_chaos = 3, /* MIT Chaos-net. */
- ns_c_hs = 4, /* MIT Hesiod. */
- /* Query class values which do not appear in resource records */
- ns_c_none = 254, /* for prereq. sections in update requests */
- ns_c_any = 255, /* Wildcard match. */
- ns_c_max = 65536
-} ns_class;
-
-/*
- * Currently defined opcodes.
- */
-typedef enum __ns_opcode {
- ns_o_query = 0, /* Standard query. */
- ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
- ns_o_status = 2, /* Name server status query (unsupported). */
- /* Opcode 3 is undefined/reserved. */
- ns_o_notify = 4, /* Zone change notification. */
- ns_o_update = 5, /* Zone update message. */
- ns_o_max = 6
-} ns_opcode;
-
-/*
- * Currently defined response codes.
- */
-typedef enum __ns_rcode {
- ns_r_noerror = 0, /* No error occurred. */
- ns_r_formerr = 1, /* Format error. */
- ns_r_servfail = 2, /* Server failure. */
- ns_r_nxdomain = 3, /* Name error. */
- ns_r_notimpl = 4, /* Unimplemented. */
- ns_r_refused = 5, /* Operation refused. */
- /* these are for BIND_UPDATE */
- ns_r_yxdomain = 6, /* Name exists */
- ns_r_yxrrset = 7, /* RRset exists */
- ns_r_nxrrset = 8, /* RRset does not exist */
- ns_r_notauth = 9, /* Not authoritative for zone */
- ns_r_notzone = 10, /* Zone of record different from zone section */
- ns_r_max = 11,
- /* The following are TSIG extended errors */
- ns_r_badsig = 16,
- ns_r_badkey = 17,
- ns_r_badtime = 18
-} ns_rcode;
-
-typedef struct {
- unsigned id :16; /* query identification number */
-#if BYTE_ORDER == BIG_ENDIAN
- /* fields in third byte */
- unsigned qr: 1; /* response flag */
- unsigned opcode: 4; /* purpose of message */
- unsigned aa: 1; /* authoritive answer */
- unsigned tc: 1; /* truncated message */
- unsigned rd: 1; /* recursion desired */
- /* fields in fourth byte */
- unsigned ra: 1; /* recursion available */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ad: 1; /* authentic data from named */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned rcode :4; /* response code */
-#endif
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
- /* fields in third byte */
- unsigned rd :1; /* recursion desired */
- unsigned tc :1; /* truncated message */
- unsigned aa :1; /* authoritive answer */
- unsigned opcode :4; /* purpose of message */
- unsigned qr :1; /* response flag */
- /* fields in fourth byte */
- unsigned rcode :4; /* response code */
- unsigned cd: 1; /* checking disabled by resolver */
- unsigned ad: 1; /* authentic data from named */
- unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
- unsigned ra :1; /* recursion available */
-#endif
- /* remaining bytes */
- unsigned qdcount :16; /* number of question entries */
- unsigned ancount :16; /* number of answer entries */
- unsigned nscount :16; /* number of authority entries */
- unsigned arcount :16; /* number of resource entries */
-} HEADER;
-
-#define PACKETSZ NS_PACKETSZ
-#define MAXDNAME NS_MAXDNAME
-#define MAXCDNAME NS_MAXCDNAME
-#define MAXLABEL NS_MAXLABEL
-#define HFIXEDSZ NS_HFIXEDSZ
-#define QFIXEDSZ NS_QFIXEDSZ
-#define RRFIXEDSZ NS_RRFIXEDSZ
-#define INT32SZ NS_INT32SZ
-#define INT16SZ NS_INT16SZ
-#define INADDRSZ NS_INADDRSZ
-#define IN6ADDRSZ NS_IN6ADDRSZ
-#define INDIR_MASK NS_CMPRSFLGS
-#define NAMESERVER_PORT NS_DEFAULTPORT
-
-#define S_ZONE ns_s_zn
-#define S_PREREQ ns_s_pr
-#define S_UPDATE ns_s_ud
-#define S_ADDT ns_s_ar
-
-#define QUERY ns_o_query
-#define IQUERY ns_o_iquery
-#define STATUS ns_o_status
-#define NS_NOTIFY_OP ns_o_notify
-#define NS_UPDATE_OP ns_o_update
-
-#define NOERROR ns_r_noerror
-#define FORMERR ns_r_formerr
-#define SERVFAIL ns_r_servfail
-#define NXDOMAIN ns_r_nxdomain
-#define NOTIMP ns_r_notimpl
-#define REFUSED ns_r_refused
-#define YXDOMAIN ns_r_yxdomain
-#define YXRRSET ns_r_yxrrset
-#define NXRRSET ns_r_nxrrset
-#define NOTAUTH ns_r_notauth
-#define NOTZONE ns_r_notzone
-
-#define DELETE ns_uop_delete
-#define ADD ns_uop_add
-
-#define T_A ns_t_a
-#define T_NS ns_t_ns
-#define T_MD ns_t_md
-#define T_MF ns_t_mf
-#define T_CNAME ns_t_cname
-#define T_SOA ns_t_soa
-#define T_MB ns_t_mb
-#define T_MG ns_t_mg
-#define T_MR ns_t_mr
-#define T_NULL ns_t_null
-#define T_WKS ns_t_wks
-#define T_PTR ns_t_ptr
-#define T_HINFO ns_t_hinfo
-#define T_MINFO ns_t_minfo
-#define T_MX ns_t_mx
-#define T_TXT ns_t_txt
-#define T_RP ns_t_rp
-#define T_AFSDB ns_t_afsdb
-#define T_X25 ns_t_x25
-#define T_ISDN ns_t_isdn
-#define T_RT ns_t_rt
-#define T_NSAP ns_t_nsap
-#define T_NSAP_PTR ns_t_nsap_ptr
-#define T_SIG ns_t_sig
-#define T_KEY ns_t_key
-#define T_PX ns_t_px
-#define T_GPOS ns_t_gpos
-#define T_AAAA ns_t_aaaa
-#define T_LOC ns_t_loc
-#define T_NXT ns_t_nxt
-#define T_EID ns_t_eid
-#define T_NIMLOC ns_t_nimloc
-#define T_SRV ns_t_srv
-#define T_ATMA ns_t_atma
-#define T_NAPTR ns_t_naptr
-#define T_TSIG ns_t_tsig
-#define T_IXFR ns_t_ixfr
-#define T_AXFR ns_t_axfr
-#define T_MAILB ns_t_mailb
-#define T_MAILA ns_t_maila
-#define T_ANY ns_t_any
-
-#define C_IN ns_c_in
-#define C_CHAOS ns_c_chaos
-#define C_HS ns_c_hs
-#define C_NONE ns_c_none
-#define C_ANY ns_c_any
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h b/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h
deleted file mode 100644
index 13faab0b5..000000000
--- a/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h
+++ /dev/null
@@ -1,29 +0,0 @@
-struct sigcontext {
- /*
- * What should we have here? I'd probably better use the same
- * stack layout as OSF/1, just in case we ever want to try
- * running their binaries..
- *
- * This is the basic layout, but I don't know if we'll ever
- * actually fill in all the values..
- */
- long sc_onstack;
- long sc_mask;
- long sc_pc;
- long sc_ps;
- long sc_regs[32];
- long sc_ownedfp;
- long sc_fpregs[32];
- unsigned long sc_fpcr;
- unsigned long sc_fp_control;
- unsigned long sc_reserved1, sc_reserved2;
- unsigned long sc_ssize;
- char * sc_sbase;
- unsigned long sc_traparg_a0;
- unsigned long sc_traparg_a1;
- unsigned long sc_traparg_a2;
- unsigned long sc_fp_trap_pc;
- unsigned long sc_fp_trigger_sum;
- unsigned long sc_fp_trigger_inst;
-};
-
diff --git a/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h b/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h
deleted file mode 100644
index 26fa04e64..000000000
--- a/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h
+++ /dev/null
@@ -1,32 +0,0 @@
-
-#define PC(ctx) (ctx.arm_pc)
-
-/*
- * Signal context structure - contains all info to do with the state
- * before the signal handler was invoked. Note: only add new entries
- * to the end of the structure.
- */
-struct sigcontext {
- unsigned long trap_no;
- unsigned long error_code;
- unsigned long oldmask;
- unsigned long arm_r0;
- unsigned long arm_r1;
- unsigned long arm_r2;
- unsigned long arm_r3;
- unsigned long arm_r4;
- unsigned long arm_r5;
- unsigned long arm_r6;
- unsigned long arm_r7;
- unsigned long arm_r8;
- unsigned long arm_r9;
- unsigned long arm_r10;
- unsigned long arm_fp;
- unsigned long arm_ip;
- unsigned long arm_sp;
- unsigned long arm_lr;
- unsigned long arm_pc;
- unsigned long arm_cpsr;
- unsigned long fault_address;
-};
-
diff --git a/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h b/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h
deleted file mode 100644
index e830b9b97..000000000
--- a/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-struct _fpreg {
- unsigned short significand[4];
- unsigned short exponent;
-};
-
-struct _fpxreg {
- unsigned short significand[4];
- unsigned short exponent;
- unsigned short padding[3];
-};
-
-struct _xmmreg {
- unsigned long element[4];
-};
-
-struct _fpstate {
- /* Regular FPU environment */
- unsigned long cw;
- unsigned long sw;
- unsigned long tag;
- unsigned long ipoff;
- unsigned long cssel;
- unsigned long dataoff;
- unsigned long datasel;
- struct _fpreg _st[8];
- unsigned short status;
- unsigned short magic; /* 0xffff = regular FPU data only */
-
- /* FXSR FPU environment */
- unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
- unsigned long mxcsr;
- unsigned long reserved;
- struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
- struct _xmmreg _xmm[8];
- unsigned long padding[56];
-};
-
-#define X86_FXSR_MAGIC 0x0000
-#define PC(ctx) (ctx.eip)
-
-struct sigcontext {
- unsigned short gs, __gsh;
- unsigned short fs, __fsh;
- unsigned short es, __esh;
- unsigned short ds, __dsh;
- unsigned long edi;
- unsigned long esi;
- unsigned long ebp;
- unsigned long esp;
- unsigned long ebx;
- unsigned long edx;
- unsigned long ecx;
- unsigned long eax;
- unsigned long trapno;
- unsigned long err;
- unsigned long eip;
- unsigned short cs, __csh;
- unsigned long eflags;
- unsigned long esp_at_signal;
- unsigned short ss, __ssh;
- struct _fpstate * fpstate;
- unsigned long oldmask;
- unsigned long cr2;
-};
-
diff --git a/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h b/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h
deleted file mode 100644
index ebab3c8f4..000000000
--- a/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <sys/ptrace.h>
-
-#define PC(ctx) (ctx.sc_ip)
-
-struct sigcontext {
- unsigned long sc_flags;
- unsigned long sc_nat;
- stack_t sc_stack;
- unsigned long sc_ip;
- unsigned long sc_cfm;
- unsigned long sc_um;
- unsigned long sc_ar_rsc;
- unsigned long sc_ar_bsp;
- unsigned long sc_ar_rnat;
- unsigned long sc_ar_ccv;
- unsigned long sc_ar_unat;
- unsigned long sc_ar_fpsr;
- unsigned long sc_ar_pfs;
- unsigned long sc_ar_lc;
- unsigned long sc_pr;
- unsigned long sc_br[8];
- unsigned long sc_gr[32];
- struct ia64_fpreg sc_fr[128];
- sigset_t sc_mask;
-};
diff --git a/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h b/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h
deleted file mode 100644
index 1210abf31..000000000
--- a/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/*
- * Keep this struct definition in sync with the sigcontext fragment
- * in arch/mips/tools/offset.c
- */
-struct sigcontext {
- unsigned int sc_regmask; /* Unused */
- unsigned int sc_status;
- unsigned long long sc_pc;
- unsigned long long sc_regs[32];
- unsigned long long sc_fpregs[32]; /* Unused */
- unsigned int sc_ownedfp;
- unsigned int sc_fpc_csr; /* Unused */
- unsigned int sc_fpc_eir; /* Unused */
- unsigned int sc_ssflags; /* Unused */
- unsigned long long sc_mdhi;
- unsigned long long sc_mdlo;
-
- unsigned int sc_cause; /* Unused */
- unsigned int sc_badvaddr; /* Unused */
-
- unsigned long sc_sigset[4]; /* kernel's sigset_t */
-};
diff --git a/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h
deleted file mode 100644
index 9428dd3e5..000000000
--- a/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#define PARISC_SC_FLAG_ONSTACK 1<<0
-#define PARISC_SC_FLAG_IN_SYSCALL 1<<1
-
-/* We will add more stuff here as it becomes necessary, until we know
- it works. */
-struct sigcontext {
- unsigned long sc_flags;
-
- unsigned long sc_gr[32]; /* PSW in sc_gr[0] */
- unsigned long long sc_fr[32]; /* FIXME, do we need other state info? */
- unsigned long sc_iasq[2];
- unsigned long sc_iaoq[2];
- unsigned long sc_sar; /* cr11 */
-};
-
diff --git a/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h
deleted file mode 100644
index 1d9704f3a..000000000
--- a/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h
+++ /dev/null
@@ -1,76 +0,0 @@
-
-struct pt_regs {
- unsigned long gpr[32];
- unsigned long nip;
- unsigned long msr;
- unsigned long orig_gpr3; /* Used for restarting system calls */
- unsigned long ctr;
- unsigned long link;
- unsigned long xer;
- unsigned long ccr;
- unsigned long mq; /* 601 only (not used at present) */
- /* Used on APUS to hold IPL value. */
- unsigned long trap; /* Reason for being here */
- unsigned long dar; /* Fault registers */
- unsigned long dsisr;
- unsigned long result; /* Result of a system call */
-};
-
-/*
- * Offsets used by 'ptrace' system call interface.
- * These can't be changed without breaking binary compatibility
- * with MkLinux, etc.
- */
-#define PT_R0 0
-#define PT_R1 1
-#define PT_R2 2
-#define PT_R3 3
-#define PT_R4 4
-#define PT_R5 5
-#define PT_R6 6
-#define PT_R7 7
-#define PT_R8 8
-#define PT_R9 9
-#define PT_R10 10
-#define PT_R11 11
-#define PT_R12 12
-#define PT_R13 13
-#define PT_R14 14
-#define PT_R15 15
-#define PT_R16 16
-#define PT_R17 17
-#define PT_R18 18
-#define PT_R19 19
-#define PT_R20 20
-#define PT_R21 21
-#define PT_R22 22
-#define PT_R23 23
-#define PT_R24 24
-#define PT_R25 25
-#define PT_R26 26
-#define PT_R27 27
-#define PT_R28 28
-#define PT_R29 29
-#define PT_R30 30
-#define PT_R31 31
-
-#define PT_NIP 32
-#define PT_MSR 33
-#define PT_CTR 35
-#define PT_LNK 36
-#define PT_XER 37
-#define PT_CCR 38
-#define PT_MQ 39
-
-#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
-#define PT_FPR31 (PT_FPR0 + 2*31)
-#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
-
-#define sigcontext_struct sigcontext
-struct sigcontext {
- unsigned long _unused[4];
- int signal;
- unsigned long handler;
- unsigned long oldmask;
- struct pt_regs *regs;
-};
diff --git a/mdk-stage1/dietlibc/include/asm/sigcontext.h b/mdk-stage1/dietlibc/include/asm/sigcontext.h
deleted file mode 100644
index c4a720cc0..000000000
--- a/mdk-stage1/dietlibc/include/asm/sigcontext.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _ASM_SIGCONTEXT_H
-#define _ASM_SIGCONTEXT_H
-
-#if defined(__i386__) || defined(__x86_64__)
-#include <asm/i386-sigcontext.h>
-#endif
-
-#ifdef __sparc__
-#include <asm/sparc-sigcontext.h>
-#endif
-
-#ifdef __mips__
-#include <asm/mips-sigcontext.h>
-#endif
-
-#ifdef __powerpc__
-#include <asm/ppc-sigcontext.h>
-#endif
-
-#ifdef __alpha__
-#include <asm/alpha-sigcontext.h>
-#endif
-
-#ifdef __arm__
-#include <asm/arm-sigcontext.h>
-#endif
-
-#ifdef __hppa__
-#include <asm/parisc-sigcontext.h>
-#endif
-
-#ifdef __ia64__
-#include <asm/ia64-sigcontext.h>
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h
deleted file mode 100644
index 98e4e09ce..000000000
--- a/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h
+++ /dev/null
@@ -1,50 +0,0 @@
-
-#define __SUNOS_MAXWIN 31
-
-/* This is what SunOS does, so shall I. */
-struct sigcontext {
- int sigc_onstack; /* state to restore */
- int sigc_mask; /* sigmask to restore */
- int sigc_sp; /* stack pointer */
- int sigc_pc; /* program counter */
- int sigc_npc; /* next program counter */
- int sigc_psr; /* for condition codes etc */
- int sigc_g1; /* User uses these two registers */
- int sigc_o0; /* within the trampoline code. */
-
- /* Now comes information regarding the users window set
- * at the time of the signal.
- */
- int sigc_oswins; /* outstanding windows */
-
- /* stack ptrs for each regwin buf */
- char *sigc_spbuf[__SUNOS_MAXWIN];
-
- /* Windows to restore after signal */
- struct {
- unsigned long locals[8];
- unsigned long ins[8];
- } sigc_wbuf[__SUNOS_MAXWIN];
-};
-
-typedef struct {
- struct {
- unsigned long psr;
- unsigned long pc;
- unsigned long npc;
- unsigned long y;
- unsigned long u_regs[16]; /* globals and ins */
- } si_regs;
- int si_mask;
-} __siginfo_t;
-
-typedef struct {
- unsigned long si_float_regs [32];
- unsigned long si_fsr;
- unsigned long si_fpqdepth;
- struct {
- unsigned long *insn_addr;
- unsigned long insn;
- } si_fpqueue [16];
-} __siginfo_fpu_t;
-
diff --git a/mdk-stage1/dietlibc/include/asm/statfs.h b/mdk-stage1/dietlibc/include/asm/statfs.h
deleted file mode 100644
index 53b3b5e4d..000000000
--- a/mdk-stage1/dietlibc/include/asm/statfs.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sys/vfs.h>
diff --git a/mdk-stage1/dietlibc/include/asm/types.h b/mdk-stage1/dietlibc/include/asm/types.h
deleted file mode 100644
index aafa80f16..000000000
--- a/mdk-stage1/dietlibc/include/asm/types.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _ASM_TYPES_H
-#define _ASM_TYPES_H
-
-#include <sys/types.h>
-
-#ifdef __alpha__
-typedef unsigned int umode_t;
-#else
-typedef unsigned short umode_t;
-#endif
-
-typedef uint8_t __u8;
-typedef uint16_t __u16;
-typedef uint32_t __u32;
-#ifndef __STRICT_ANSI__
-typedef uint64_t __u64;
-#endif
-
-typedef int8_t __s8;
-typedef int16_t __s16;
-typedef int32_t __s32;
-#ifndef __STRICT_ANSI__
-typedef int64_t __s64;
-#endif
-
-#if defined(__alpha__)
-typedef unsigned long __kernel_size_t;
-#else
-typedef unsigned int __kernel_size_t;
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/assert.h b/mdk-stage1/dietlibc/include/assert.h
deleted file mode 100644
index a8ce3ce87..000000000
--- a/mdk-stage1/dietlibc/include/assert.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _ASSERT_H
-#define _ASSERT_H
-
-#include <sys/cdefs.h>
-
-/* This prints an "Assertion failed" message and aborts. */
-extern void __assert_fail (const char *__assertion, const char *__file,
- unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
-
-#ifdef __PRETTY_FUNCTION__
-#define __ASSERT_FUNCTION __PRETTY_FUNCTION__
-#else
-# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-# define __ASSERT_FUNCTION __func__
-# else
-# define __ASSERT_FUNCTION ((const char *) 0)
-# endif
-#endif
-
-#undef assert
-#ifdef NDEBUG
-#define assert(expr)
-#else
-#ifdef expect
-# define assert(expr) \
- ((void) (expect((long)(expr),0) ? 0 : \
- (__assert_fail (#expr, \
- __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
-#else
-# define assert(expr) \
- ((void) ((expr) ? 0 : \
- (__assert_fail (#expr, \
- __FILE__, __LINE__, __ASSERT_FUNCTION), 0)))
-#endif
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/cpio.h b/mdk-stage1/dietlibc/include/cpio.h
deleted file mode 100644
index a18c2fbb6..000000000
--- a/mdk-stage1/dietlibc/include/cpio.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _CPIO_H_
-#define _CPIO_H_
-
-#define C_IRUSR 0000400
-#define C_IWUSR 0000200
-#define C_IXUSR 0000100
-#define C_IRGRP 0000040
-#define C_IWGRP 0000020
-#define C_IXGRP 0000010
-#define C_IROTH 0000004
-#define C_IWOTH 0000002
-#define C_IXOTH 0000001
-#define C_ISUID 0004000
-#define C_ISGID 0002000
-#define C_ISVTX 0001000
-#define C_ISDIR 0040000
-#define C_ISFIFO 0010000
-#define C_ISREG 0100000
-#define C_ISBLK 0060000
-#define C_ISCHR 0020000
-#define C_ISCTG 0110000
-#define C_ISLNK 0120000
-#define C_ISSOCK 0140000
-
-#define MAGIC "070707"
-
-#endif /* _CPIO_H_ */
diff --git a/mdk-stage1/dietlibc/include/ctype.h b/mdk-stage1/dietlibc/include/ctype.h
deleted file mode 100644
index 9322e8c7b..000000000
--- a/mdk-stage1/dietlibc/include/ctype.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _CTYPE_H
-#define _CTYPE_H
-
-#include <sys/cdefs.h>
-
-extern int isascii (int c) __THROW __attribute__ ((__const__));
-extern int isblank (int c) __THROW __attribute__ ((__const__));
-extern int isalnum (int c) __THROW __attribute__ ((__const__));
-extern int isalpha (int c) __THROW __attribute__ ((__const__));
-extern int isdigit (int c) __THROW __attribute__ ((__const__));
-extern int isspace (int c) __THROW __attribute__ ((__const__));
-
-extern int isupper (int c) __THROW __attribute__ ((__const__));
-extern int islower (int c) __THROW __attribute__ ((__const__));
-
-extern int tolower(int c) __THROW __attribute__ ((__const__));
-extern int toupper(int c) __THROW __attribute__ ((__const__));
-
-extern int isprint(int c) __THROW __attribute__ ((__const__));
-extern int ispunct(int c) __THROW __attribute__ ((__const__));
-extern int iscntrl(int c) __THROW __attribute__ ((__const__));
-
-/* fscking GNU extensions! */
-extern int isxdigit(int c) __THROW __attribute__ ((__const__));
-
-extern int isgraph(int c) __THROW __attribute__ ((__const__));
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/daemon.h b/mdk-stage1/dietlibc/include/daemon.h
deleted file mode 100644
index e2413d42b..000000000
--- a/mdk-stage1/dietlibc/include/daemon.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _DAEMON_H
-#define _DAEMON_H
-
-#include <unistd.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/dietref.h b/mdk-stage1/dietlibc/include/dietref.h
deleted file mode 100644
index 99d446300..000000000
--- a/mdk-stage1/dietlibc/include/dietref.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* diet includes this file to create linker dependencies on the diet
- * libc, so trying to link an object file compiled with diet against
- * glibc will fail. */
-
-#ifndef NODIETREF
-#include <endian.h>
-#ifdef __ASSEMBLER__
-.section .note
-#if (__WORDSIZE == 64)
-.quad __you_tried_to_link_a_dietlibc_object_against_glibc
-#else
-.long __you_tried_to_link_a_dietlibc_object_against_glibc
-#endif
-.previous
-#else
-#if (__WORDSIZE == 64)
-__asm__ (".section .note\n\t.quad __you_tried_to_link_a_dietlibc_object_against_glibc\n\t.previous");
-#else
-__asm__ (".section .note\n\t.long __you_tried_to_link_a_dietlibc_object_against_glibc\n\t.previous");
-#endif
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/include/dirent.h b/mdk-stage1/dietlibc/include/dirent.h
deleted file mode 100644
index ad8b3a41a..000000000
--- a/mdk-stage1/dietlibc/include/dirent.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _DIRENT_H
-#define _DIRENT_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <limits.h>
-
-struct dirent {
- long d_ino;
- off_t d_off;
- unsigned short d_reclen;
- char d_name[256]; /* We must not include limits.h! */
-};
-
-#ifndef __STRICT_ANSI__
-struct dirent64 {
- uint64_t d_ino;
- int64_t d_off;
- unsigned short d_reclen;
- unsigned char d_type;
- char d_name[256];
-};
-#endif
-
-#define d_fileno d_ino /* Backwards compatibility. */
-
-#undef _DIRENT_HAVE_D_NAMLEN
-#define _DIRENT_HAVE_D_RECLEN
-#define _DIRENT_HAVE_D_OFF
-
-typedef struct __dirstream DIR;
-
-DIR *opendir (const char *__name) __THROW;
-int closedir (DIR *__dirp) __THROW;
-struct dirent *readdir (DIR *__dirp) __THROW;
-struct dirent64 *readdir64 (DIR *__dirp) __THROW;
-void rewinddir (DIR *__dirp) __THROW;
-void seekdir (DIR *__dirp, long int __pos) __THROW;
-long int telldir (DIR *__dirp) __THROW;
-
-int scandir(const char *dir, struct dirent ***namelist,
- int (*selection)(const struct dirent *),
- int (*compar)(const struct dirent **, const struct dirent **)) __THROW;
-int scandir64(const char *dir, struct dirent64 ***namelist,
- int (*selection)(const struct dirent64 *),
- int (*compar)(const struct dirent64 **, const struct dirent64 **)) __THROW;
-
-int alphasort(const struct dirent **a, const struct dirent **b) __THROW __attribute__((const));
-int alphasort64(const struct dirent64 **a, const struct dirent64 **b) __THROW __attribute__((const));
-
-#define MAXNAMLEN NAME_MAX
-
-#ifdef _BSD_SOURCE
-extern int dirfd(DIR *dirp) __THROW;
-#endif
-
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-#define dirent dirent64
-#define readdir readdir64
-#define scandir scandir64
-#define alphasort alphasort64
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/dlfcn.h b/mdk-stage1/dietlibc/include/dlfcn.h
deleted file mode 100644
index 0ddcafdba..000000000
--- a/mdk-stage1/dietlibc/include/dlfcn.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _DLFCN_H
-#define _DLFCN_H 1
-
-#define RTLD_LAZY 0x00000
-#define RTLD_NOW 0x00001
-
-#define RTLD_LOCAL 0x00000
-#define RTLD_GLOBAL 0x10000
-
-#define RTLD_DEFAULT ((void*)1)
-#define RTLD_NEXT ((void*)2)
-
-void *dlopen (const char *filename, int flag);
-const char *dlerror(void);
-void *dlsym(void *handle, char *symbol);
-int dlclose (void *handle);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/elf.h b/mdk-stage1/dietlibc/include/elf.h
deleted file mode 100644
index 7b198bad3..000000000
--- a/mdk-stage1/dietlibc/include/elf.h
+++ /dev/null
@@ -1,780 +0,0 @@
-#ifndef _ELF_H
-#define _ELF_H
-
-#include <inttypes.h>
-
-/* 32-bit ELF base types. */
-typedef uint32_t Elf32_Addr;
-typedef uint16_t Elf32_Half;
-typedef uint32_t Elf32_Off;
-typedef int32_t Elf32_Sword;
-typedef uint32_t Elf32_Word;
-
-/* 64-bit ELF base types. */
-typedef uint64_t Elf64_Addr;
-typedef uint16_t Elf64_Half;
-typedef int16_t Elf64_SHalf;
-typedef uint64_t Elf64_Off;
-typedef int32_t Elf64_Sword;
-typedef uint32_t Elf64_Word;
-typedef uint64_t Elf64_Xword;
-typedef int64_t Elf64_Sxword;
-
-/* These constants are for the segment types stored in the image headers */
-#define PT_NULL 0
-#define PT_LOAD 1
-#define PT_DYNAMIC 2
-#define PT_INTERP 3
-#define PT_NOTE 4
-#define PT_SHLIB 5
-#define PT_PHDR 6
-#define PT_LOPROC 0x70000000
-#define PT_HIPROC 0x7fffffff
-#define PT_MIPS_REGINFO 0x70000000
-
-/* Flags in the e_flags field of the header */
-#define EF_MIPS_NOREORDER 0x00000001
-#define EF_MIPS_PIC 0x00000002
-#define EF_MIPS_CPIC 0x00000004
-#define EF_MIPS_ARCH 0xf0000000
-
-/* These constants define the different elf file types */
-#define ET_NONE 0
-#define ET_REL 1
-#define ET_EXEC 2
-#define ET_DYN 3
-#define ET_CORE 4
-#define ET_LOPROC 0xff00
-#define ET_HIPROC 0xffff
-
-/* These constants define the various ELF target machines */
-#define EM_NONE 0
-#define EM_M32 1
-#define EM_SPARC 2
-#define EM_386 3
-#define EM_68K 4
-#define EM_88K 5
-#define EM_486 6 /* Perhaps disused */
-#define EM_860 7
-
-#define EM_MIPS 8 /* MIPS R3000 (officially, big-endian only) */
-#define EM_MIPS_RS4_BE 10 /* MIPS R4000 big-endian */
-
-#define EM_PARISC 15 /* HPPA */
-#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */
-#define EM_PPC 20 /* PowerPC */
-#define EM_S390 22 /* IBM S/390 */
-
-#define EM_ARM 40 /* ARM */
-#define EM_SH 42 /* SuperH */
-#define EM_SPARCV9 43 /* SPARC v9 64-bit */
-#define EM_IA_64 50 /* HP/Intel IA-64 */
-#define EM_X86_64 62 /* AMD x86-64 */
-#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
-
-/*
- * This is an interim value that we will use until the committee comes
- * up with a final number.
- */
-#define EM_ALPHA 0x9026
-
-/*
- * This is the old interim value for S/390 architecture
- */
-#define EM_S390_OLD 0xA390
-
-/* This is the info that is needed to parse the dynamic section of the file */
-#define DT_NULL 0
-#define DT_NEEDED 1
-#define DT_PLTRELSZ 2
-#define DT_PLTGOT 3
-#define DT_HASH 4
-#define DT_STRTAB 5
-#define DT_SYMTAB 6
-#define DT_RELA 7
-#define DT_RELASZ 8
-#define DT_RELAENT 9
-#define DT_STRSZ 10
-#define DT_SYMENT 11
-#define DT_INIT 12
-#define DT_FINI 13
-#define DT_SONAME 14
-#define DT_RPATH 15
-#define DT_SYMBOLIC 16
-#define DT_REL 17
-#define DT_RELSZ 18
-#define DT_RELENT 19
-#define DT_PLTREL 20
-#define DT_DEBUG 21
-#define DT_TEXTREL 22
-#define DT_JMPREL 23
-#define DT_NUM 24
-#define DT_LOPROC 0x70000000
-#define DT_HIPROC 0x7fffffff
-#define DT_MIPS_RLD_VERSION 0x70000001
-#define DT_MIPS_TIME_STAMP 0x70000002
-#define DT_MIPS_ICHECKSUM 0x70000003
-#define DT_MIPS_IVERSION 0x70000004
-#define DT_MIPS_FLAGS 0x70000005
- #define RHF_NONE 0
- #define RHF_HARDWAY 1
- #define RHF_NOTPOT 2
-#define DT_MIPS_BASE_ADDRESS 0x70000006
-#define DT_MIPS_CONFLICT 0x70000008
-#define DT_MIPS_LIBLIST 0x70000009
-#define DT_MIPS_LOCAL_GOTNO 0x7000000a
-#define DT_MIPS_CONFLICTNO 0x7000000b
-#define DT_MIPS_LIBLISTNO 0x70000010
-#define DT_MIPS_SYMTABNO 0x70000011
-#define DT_MIPS_UNREFEXTNO 0x70000012
-#define DT_MIPS_GOTSYM 0x70000013
-#define DT_MIPS_HIPAGENO 0x70000014
-#define DT_MIPS_RLD_MAP 0x70000016
-
-/* This info is needed when parsing the symbol table */
-#define STB_LOCAL 0
-#define STB_GLOBAL 1
-#define STB_WEAK 2
-
-#define STT_NOTYPE 0
-#define STT_OBJECT 1
-#define STT_FUNC 2
-#define STT_SECTION 3
-#define STT_FILE 4
-
-#define ELF32_ST_BIND(x) ((x) >> 4)
-#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf)
-
-#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
-#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
-
-/* Symbolic values for the entries in the auxiliary table
- put on the initial stack */
-#define AT_NULL 0 /* end of vector */
-#define AT_IGNORE 1 /* entry should be ignored */
-#define AT_EXECFD 2 /* file descriptor of program */
-#define AT_PHDR 3 /* program headers for program */
-#define AT_PHENT 4 /* size of program header entry */
-#define AT_PHNUM 5 /* number of program headers */
-#define AT_PAGESZ 6 /* system page size */
-#define AT_BASE 7 /* base address of interpreter */
-#define AT_FLAGS 8 /* flags */
-#define AT_ENTRY 9 /* entry point of program */
-#define AT_NOTELF 10 /* program is not ELF */
-#define AT_UID 11 /* real uid */
-#define AT_EUID 12 /* effective uid */
-#define AT_GID 13 /* real gid */
-#define AT_EGID 14 /* effective gid */
-#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
-#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
-#define AT_CLKTCK 17 /* frequency at which times() increments */
-
-typedef struct dynamic{
- Elf32_Sword d_tag;
- union{
- Elf32_Sword d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef struct {
- Elf64_Sxword d_tag; /* entry tag value */
- union {
- Elf64_Xword d_val;
- Elf64_Addr d_ptr;
- } d_un;
-} Elf64_Dyn;
-
-/* The following are used with relocations */
-#define ELF32_R_SYM(x) ((x) >> 8)
-#define ELF32_R_TYPE(x) ((x) & 0xff)
-
-#define ELF64_R_SYM(x) ((x) >> 32)
-#define ELF64_R_TYPE(x) ((x) & 0xffffffff)
-
-#define R_386_NONE 0
-#define R_386_32 1
-#define R_386_PC32 2
-#define R_386_GOT32 3
-#define R_386_PLT32 4
-#define R_386_COPY 5
-#define R_386_GLOB_DAT 6
-#define R_386_JMP_SLOT 7
-#define R_386_RELATIVE 8
-#define R_386_GOTOFF 9
-#define R_386_GOTPC 10
-#define R_386_NUM 11
-
-#define R_MIPS_NONE 0
-#define R_MIPS_16 1
-#define R_MIPS_32 2
-#define R_MIPS_REL32 3
-#define R_MIPS_26 4
-#define R_MIPS_HI16 5
-#define R_MIPS_LO16 6
-#define R_MIPS_GPREL16 7
-#define R_MIPS_LITERAL 8
-#define R_MIPS_GOT16 9
-#define R_MIPS_PC16 10
-#define R_MIPS_CALL16 11
-#define R_MIPS_GPREL32 12
-/* The remaining relocs are defined on Irix, although they are not
- in the MIPS ELF ABI. */
-#define R_MIPS_UNUSED1 13
-#define R_MIPS_UNUSED2 14
-#define R_MIPS_UNUSED3 15
-#define R_MIPS_SHIFT5 16
-#define R_MIPS_SHIFT6 17
-#define R_MIPS_64 18
-#define R_MIPS_GOT_DISP 19
-#define R_MIPS_GOT_PAGE 20
-#define R_MIPS_GOT_OFST 21
-/*
- * The following two relocation types are specified in the MIPS ABI
- * conformance guide version 1.2 but not yet in the psABI.
- */
-#define R_MIPS_GOTHI16 22
-#define R_MIPS_GOTLO16 23
-#define R_MIPS_SUB 24
-#define R_MIPS_INSERT_A 25
-#define R_MIPS_INSERT_B 26
-#define R_MIPS_DELETE 27
-#define R_MIPS_HIGHER 28
-#define R_MIPS_HIGHEST 29
-/*
- * The following two relocation types are specified in the MIPS ABI
- * conformance guide version 1.2 but not yet in the psABI.
- */
-#define R_MIPS_CALLHI16 30
-#define R_MIPS_CALLLO16 31
-/*
- * This range is reserved for vendor specific relocations.
- */
-#define R_MIPS_LOVENDOR 100
-#define R_MIPS_HIVENDOR 127
-
-
-/*
- * Sparc ELF relocation types
- */
-#define R_SPARC_NONE 0
-#define R_SPARC_8 1
-#define R_SPARC_16 2
-#define R_SPARC_32 3
-#define R_SPARC_DISP8 4
-#define R_SPARC_DISP16 5
-#define R_SPARC_DISP32 6
-#define R_SPARC_WDISP30 7
-#define R_SPARC_WDISP22 8
-#define R_SPARC_HI22 9
-#define R_SPARC_22 10
-#define R_SPARC_13 11
-#define R_SPARC_LO10 12
-#define R_SPARC_GOT10 13
-#define R_SPARC_GOT13 14
-#define R_SPARC_GOT22 15
-#define R_SPARC_PC10 16
-#define R_SPARC_PC22 17
-#define R_SPARC_WPLT30 18
-#define R_SPARC_COPY 19
-#define R_SPARC_GLOB_DAT 20
-#define R_SPARC_JMP_SLOT 21
-#define R_SPARC_RELATIVE 22
-#define R_SPARC_UA32 23
-#define R_SPARC_PLT32 24
-#define R_SPARC_HIPLT22 25
-#define R_SPARC_LOPLT10 26
-#define R_SPARC_PCPLT32 27
-#define R_SPARC_PCPLT22 28
-#define R_SPARC_PCPLT10 29
-#define R_SPARC_10 30
-#define R_SPARC_11 31
-#define R_SPARC_WDISP16 40
-#define R_SPARC_WDISP19 41
-#define R_SPARC_7 43
-#define R_SPARC_5 44
-#define R_SPARC_6 45
-
-/* Bits present in AT_HWCAP, primarily for Sparc32. */
-
-#define HWCAP_SPARC_FLUSH 1 /* CPU supports flush instruction. */
-#define HWCAP_SPARC_STBAR 2
-#define HWCAP_SPARC_SWAP 4
-#define HWCAP_SPARC_MULDIV 8
-#define HWCAP_SPARC_V9 16
-#define HWCAP_SPARC_ULTRA3 32
-
-/*
- * 68k ELF relocation types
- */
-#define R_68K_NONE 0
-#define R_68K_32 1
-#define R_68K_16 2
-#define R_68K_8 3
-#define R_68K_PC32 4
-#define R_68K_PC16 5
-#define R_68K_PC8 6
-#define R_68K_GOT32 7
-#define R_68K_GOT16 8
-#define R_68K_GOT8 9
-#define R_68K_GOT32O 10
-#define R_68K_GOT16O 11
-#define R_68K_GOT8O 12
-#define R_68K_PLT32 13
-#define R_68K_PLT16 14
-#define R_68K_PLT8 15
-#define R_68K_PLT32O 16
-#define R_68K_PLT16O 17
-#define R_68K_PLT8O 18
-#define R_68K_COPY 19
-#define R_68K_GLOB_DAT 20
-#define R_68K_JMP_SLOT 21
-#define R_68K_RELATIVE 22
-
-/*
- * Alpha ELF relocation types
- */
-#define R_ALPHA_NONE 0 /* No reloc */
-#define R_ALPHA_REFLONG 1 /* Direct 32 bit */
-#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */
-#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */
-#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */
-#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */
-#define R_ALPHA_GPDISP 6 /* Add displacement to GP */
-#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */
-#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */
-#define R_ALPHA_SREL16 9 /* PC relative 16 bit */
-#define R_ALPHA_SREL32 10 /* PC relative 32 bit */
-#define R_ALPHA_SREL64 11 /* PC relative 64 bit */
-#define R_ALPHA_OP_PUSH 12 /* OP stack push */
-#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
-#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
-#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
-#define R_ALPHA_GPVALUE 16
-#define R_ALPHA_GPRELHIGH 17
-#define R_ALPHA_GPRELLOW 18
-#define R_ALPHA_IMMED_GP_16 19
-#define R_ALPHA_IMMED_GP_HI32 20
-#define R_ALPHA_IMMED_SCN_HI32 21
-#define R_ALPHA_IMMED_BR_HI32 22
-#define R_ALPHA_IMMED_LO32 23
-#define R_ALPHA_COPY 24 /* Copy symbol at runtime */
-#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */
-#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
-#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
-
-/* Legal values for e_flags field of Elf64_Ehdr. */
-
-#define EF_ALPHA_32BIT 1 /* All addresses are below 2GB */
-
-/*
- * PowerPC
- */
-
-/* Values for Elf32/64_Ehdr.e_flags. */
-#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
-
-/* Cygnus local bits below */
-#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
-#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib flag */
-
-/* PowerPC relocations defined by the ABIs */
-#define R_PPC_NONE 0
-#define R_PPC_ADDR32 1 /* 32bit absolute address */
-#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */
-#define R_PPC_ADDR16 3 /* 16bit absolute address */
-#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */
-#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */
-#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */
-#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */
-#define R_PPC_ADDR14_BRTAKEN 8
-#define R_PPC_ADDR14_BRNTAKEN 9
-#define R_PPC_REL24 10 /* PC relative 26 bit */
-#define R_PPC_REL14 11 /* PC relative 16 bit */
-#define R_PPC_REL14_BRTAKEN 12
-#define R_PPC_REL14_BRNTAKEN 13
-#define R_PPC_GOT16 14
-#define R_PPC_GOT16_LO 15
-#define R_PPC_GOT16_HI 16
-#define R_PPC_GOT16_HA 17
-#define R_PPC_PLTREL24 18
-#define R_PPC_COPY 19
-#define R_PPC_GLOB_DAT 20
-#define R_PPC_JMP_SLOT 21
-#define R_PPC_RELATIVE 22
-#define R_PPC_LOCAL24PC 23
-#define R_PPC_UADDR32 24
-#define R_PPC_UADDR16 25
-#define R_PPC_REL32 26
-#define R_PPC_PLT32 27
-#define R_PPC_PLTREL32 28
-#define R_PPC_PLT16_LO 29
-#define R_PPC_PLT16_HI 30
-#define R_PPC_PLT16_HA 31
-#define R_PPC_SDAREL16 32
-#define R_PPC_SECTOFF 33
-#define R_PPC_SECTOFF_LO 34
-#define R_PPC_SECTOFF_HI 35
-#define R_PPC_SECTOFF_HA 36
-/* Keep this the last entry. */
-#define R_PPC_NUM 37
-
-/* The remaining relocs are from the Embedded ELF ABI, and are not
- in the SVR4 ELF ABI. */
-#define R_PPC_EMB_NADDR32 101
-#define R_PPC_EMB_NADDR16 102
-#define R_PPC_EMB_NADDR16_LO 103
-#define R_PPC_EMB_NADDR16_HI 104
-#define R_PPC_EMB_NADDR16_HA 105
-#define R_PPC_EMB_SDAI16 106
-#define R_PPC_EMB_SDA2I16 107
-#define R_PPC_EMB_SDA2REL 108
-#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */
-#define R_PPC_EMB_MRKREF 110
-#define R_PPC_EMB_RELSEC16 111
-#define R_PPC_EMB_RELST_LO 112
-#define R_PPC_EMB_RELST_HI 113
-#define R_PPC_EMB_RELST_HA 114
-#define R_PPC_EMB_BIT_FLD 115
-#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */
-
-/* Diab tool relocations. */
-#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */
-#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */
-#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */
-#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */
-#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
-#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
-
-/* This is a phony reloc to handle any old fashioned TOC16 references
- that may still be in object files. */
-#define R_PPC_TOC16 255
-
-/*
- * ARM ELF relocation types
- */
-#define R_ARM_NONE 0 /* No reloc */
-#define R_ARM_PC24 1 /* PC relative 26 bit branch */
-#define R_ARM_ABS32 2 /* Direct 32 bit */
-#define R_ARM_REL32 3 /* PC relative 32 bit */
-#define R_ARM_PC13 4
-#define R_ARM_ABS16 5 /* Direct 16 bit */
-#define R_ARM_ABS12 6 /* Direct 12 bit */
-#define R_ARM_THM_ABS5 7
-#define R_ARM_ABS8 8 /* Direct 8 bit */
-#define R_ARM_SBREL32 9
-#define R_ARM_THM_PC22 10
-#define R_ARM_THM_PC8 11
-#define R_ARM_AMP_VCALL9 12
-#define R_ARM_SWI24 13
-#define R_ARM_THM_SWI8 14
-#define R_ARM_XPC25 15
-#define R_ARM_THM_XPC22 16
-#define R_ARM_COPY 20 /* Copy symbol at runtime */
-#define R_ARM_GLOB_DAT 21 /* Create GOT entry */
-#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */
-#define R_ARM_RELATIVE 23 /* Adjust by program base */
-#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */
-#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */
-#define R_ARM_GOT32 26 /* 32 bit GOT entry */
-#define R_ARM_PLT32 27 /* 32 bit PLT address */
-#define R_ARM_GNU_VTENTRY 100
-#define R_ARM_GNU_VTINHERIT 101
-#define R_ARM_THM_PC11 102 /* thumb unconditional branch */
-#define R_ARM_THM_PC9 103 /* thumb conditional branch */
-#define R_ARM_RXPC25 249
-#define R_ARM_RSBREL32 250
-#define R_ARM_THM_RPC22 251
-#define R_ARM_RREL32 252
-#define R_ARM_RABS22 253
-#define R_ARM_RPC24 254
-#define R_ARM_RBASE 255
-/* Keep this the last entry. */
-#define R_ARM_NUM 256
-
-/* Processor specific flags for the ELF header e_flags field. */
-#define EF_ARM_RELEXEC 0x01
-#define EF_ARM_HASENTRY 0x02
-#define EF_ARM_INTERWORK 0x04
-#define EF_ARM_APCS_26 0x08
-#define EF_ARM_APCS_FLOAT 0x10
-#define EF_ARM_PIC 0x20
-#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use */
-#define EF_NEW_ABI 0x80
-#define EF_OLD_ABI 0x100
-
-/* Additional symbol types for Thumb */
-#define STT_ARM_TFUNC 0xd
-
-/* AMD x86-64 relocations. */
-#define R_X86_64_NONE 0 /* No reloc */
-#define R_X86_64_64 1 /* Direct 64 bit */
-#define R_X86_64_PC32 2 /* PC relative 32 bit signed */
-#define R_X86_64_GOT32 3 /* 32 bit GOT entry */
-#define R_X86_64_PLT32 4 /* 32 bit PLT address */
-#define R_X86_64_COPY 5 /* Copy symbol at runtime */
-#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */
-#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */
-#define R_X86_64_RELATIVE 8 /* Adjust by program base */
-#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative
- offset to GOT */
-#define R_X86_64_32 10 /* Direct 32 bit zero extended */
-#define R_X86_64_32S 11 /* Direct 32 bit sign extended */
-#define R_X86_64_16 12 /* Direct 16 bit zero extended */
-#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */
-#define R_X86_64_8 14 /* Direct 8 bit sign extended */
-#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */
-#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
-#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */
-#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */
-#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset
- to two GOT entries for GD symbol */
-#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset
- to two GOT entries for LD symbol */
-#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
-#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset
- to GOT entry for IE symbol */
-#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */
-
-#define R_X86_64_NUM 24
-
-typedef struct elf32_rel {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
-} Elf32_Rel;
-
-typedef struct elf64_rel {
- Elf64_Addr r_offset; /* Location at which to apply the action */
- Elf64_Xword r_info; /* index and type of relocation */
-} Elf64_Rel;
-
-typedef struct elf32_rela{
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- Elf32_Sword r_addend;
-} Elf32_Rela;
-
-typedef struct elf64_rela {
- Elf64_Addr r_offset; /* Location at which to apply the action */
- Elf64_Xword r_info; /* index and type of relocation */
- Elf64_Sxword r_addend; /* Constant addend used to compute value */
-} Elf64_Rela;
-
-typedef struct elf32_sym{
- Elf32_Word st_name;
- Elf32_Addr st_value;
- Elf32_Word st_size;
- unsigned char st_info;
- unsigned char st_other;
- Elf32_Half st_shndx;
-} Elf32_Sym;
-
-typedef struct elf64_sym {
- Elf64_Word st_name; /* Symbol name, index in string tbl */
- unsigned char st_info; /* Type and binding attributes */
- unsigned char st_other; /* No defined meaning, 0 */
- Elf64_Half st_shndx; /* Associated section index */
- Elf64_Addr st_value; /* Value of the symbol */
- Elf64_Xword st_size; /* Associated symbol size */
-} Elf64_Sym;
-
-
-#define EI_NIDENT 16
-
-typedef struct elf32_hdr{
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry; /* Entry point */
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
-} Elf32_Ehdr;
-
-typedef struct elf64_hdr {
- unsigned char e_ident[16]; /* ELF "magic number" */
- Elf64_Half e_type;
- Elf64_Half e_machine;
- Elf64_Word e_version;
- Elf64_Addr e_entry; /* Entry point virtual address */
- Elf64_Off e_phoff; /* Program header table file offset */
- Elf64_Off e_shoff; /* Section header table file offset */
- Elf64_Word e_flags;
- Elf64_Half e_ehsize;
- Elf64_Half e_phentsize;
- Elf64_Half e_phnum;
- Elf64_Half e_shentsize;
- Elf64_Half e_shnum;
- Elf64_Half e_shstrndx;
-} Elf64_Ehdr;
-
-/* These constants define the permissions on sections in the program
- header, p_flags. */
-#define PF_R 0x4
-#define PF_W 0x2
-#define PF_X 0x1
-
-typedef struct elf32_phdr{
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
-} Elf32_Phdr;
-
-typedef struct elf64_phdr {
- Elf64_Word p_type;
- Elf64_Word p_flags;
- Elf64_Off p_offset; /* Segment file offset */
- Elf64_Addr p_vaddr; /* Segment virtual address */
- Elf64_Addr p_paddr; /* Segment physical address */
- Elf64_Xword p_filesz; /* Segment size in file */
- Elf64_Xword p_memsz; /* Segment size in memory */
- Elf64_Xword p_align; /* Segment alignment, file & memory */
-} Elf64_Phdr;
-
-/* sh_type */
-#define SHT_NULL 0
-#define SHT_PROGBITS 1
-#define SHT_SYMTAB 2
-#define SHT_STRTAB 3
-#define SHT_RELA 4
-#define SHT_HASH 5
-#define SHT_DYNAMIC 6
-#define SHT_NOTE 7
-#define SHT_NOBITS 8
-#define SHT_REL 9
-#define SHT_SHLIB 10
-#define SHT_DYNSYM 11
-#define SHT_NUM 12
-#define SHT_LOPROC 0x70000000
-#define SHT_HIPROC 0x7fffffff
-#define SHT_LOUSER 0x80000000
-#define SHT_HIUSER 0xffffffff
-#define SHT_MIPS_LIST 0x70000000
-#define SHT_MIPS_CONFLICT 0x70000002
-#define SHT_MIPS_GPTAB 0x70000003
-#define SHT_MIPS_UCODE 0x70000004
-
-/* sh_flags */
-#define SHF_WRITE 0x1
-#define SHF_ALLOC 0x2
-#define SHF_EXECINSTR 0x4
-#define SHF_MASKPROC 0xf0000000
-#define SHF_MIPS_GPREL 0x10000000
-#define SHF_ALPHA_GPREL 0x10000000
-
-/* special section indexes */
-#define SHN_UNDEF 0
-#define SHN_LORESERVE 0xff00
-#define SHN_LOPROC 0xff00
-#define SHN_HIPROC 0xff1f
-#define SHN_ABS 0xfff1
-#define SHN_COMMON 0xfff2
-#define SHN_HIRESERVE 0xffff
-#define SHN_MIPS_ACCOMON 0xff00
-
-typedef struct {
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
-} Elf32_Shdr;
-
-typedef struct elf64_shdr {
- Elf64_Word sh_name; /* Section name, index in string tbl */
- Elf64_Word sh_type; /* Type of section */
- Elf64_Xword sh_flags; /* Miscellaneous section attributes */
- Elf64_Addr sh_addr; /* Section virtual addr at execution */
- Elf64_Off sh_offset; /* Section file offset */
- Elf64_Xword sh_size; /* Size of section in bytes */
- Elf64_Word sh_link; /* Index of another section */
- Elf64_Word sh_info; /* Additional section information */
- Elf64_Xword sh_addralign; /* Section alignment */
- Elf64_Xword sh_entsize; /* Entry size if section holds table */
-} Elf64_Shdr;
-
-#define EI_MAG0 0 /* e_ident[] indexes */
-#define EI_MAG1 1
-#define EI_MAG2 2
-#define EI_MAG3 3
-#define EI_CLASS 4
-#define EI_DATA 5
-#define EI_VERSION 6
-#define EI_PAD 7
-
-#define ELFMAG0 0x7f /* EI_MAG */
-#define ELFMAG1 'E'
-#define ELFMAG2 'L'
-#define ELFMAG3 'F'
-#define ELFMAG "\177ELF"
-#define SELFMAG 4
-
-#define ELFCLASSNONE 0 /* EI_CLASS */
-#define ELFCLASS32 1
-#define ELFCLASS64 2
-#define ELFCLASSNUM 3
-
-#define ELFDATANONE 0 /* e_ident[EI_DATA] */
-#define ELFDATA2LSB 1
-#define ELFDATA2MSB 2
-
-#define EV_NONE 0 /* e_version, EI_VERSION */
-#define EV_CURRENT 1
-#define EV_NUM 2
-
-/* Notes used in ET_CORE */
-#define NT_PRSTATUS 1
-#define NT_PRFPREG 2
-#define NT_PRPSINFO 3
-#define NT_TASKSTRUCT 4
-#define NT_PRFPXREG 20
-
-/* Note header in a PT_NOTE section */
-typedef struct elf32_note {
- Elf32_Word n_namesz; /* Name size */
- Elf32_Word n_descsz; /* Content size */
- Elf32_Word n_type; /* Content type */
-} Elf32_Nhdr;
-
-/* Note header in a PT_NOTE section */
-typedef struct elf64_note {
- Elf64_Word n_namesz; /* Name size */
- Elf64_Word n_descsz; /* Content size */
- Elf64_Word n_type; /* Content type */
-} Elf64_Nhdr;
-
-#if ELF_CLASS == ELFCLASS32
-
-extern Elf32_Dyn _DYNAMIC [];
-#define elfhdr elf32_hdr
-#define elf_phdr elf32_phdr
-#define elf_note elf32_note
-
-#else
-
-extern Elf64_Dyn _DYNAMIC [];
-#define elfhdr elf64_hdr
-#define elf_phdr elf64_phdr
-#define elf_note elf64_note
-
-#endif
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/endian.h b/mdk-stage1/dietlibc/include/endian.h
deleted file mode 100644
index 93b1f2948..000000000
--- a/mdk-stage1/dietlibc/include/endian.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _ENDIAN_H
-#define _ENDIAN_H
-
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
-
-#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-
-#ifdef __sparc__
-#define __BYTE_ORDER __BIG_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-
-#ifdef __hppa__
-/* I hope this is correct...? */
-#define __BYTE_ORDER __BIG_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-
-#ifdef __mips__
-#ifdef __MIPSEB__
-#define __BYTE_ORDER __BIG_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-#endif
-
-#ifndef __BYTE_ORDER
-#ifdef __BIG_ENDIAN__
-#define __BYTE_ORDER __BIG_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#else
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#define __FLOAT_WORD_ORDER __BYTE_ORDER
-#endif
-#endif
-
-#define LITTLE_ENDIAN __LITTLE_ENDIAN
-#define BIG_ENDIAN __BIG_ENDIAN
-#define BYTE_ORDER __BYTE_ORDER
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define __LONG_LONG_PAIR(HI, LO) LO, HI
-#elif __BYTE_ORDER == __BIG_ENDIAN
-# define __LONG_LONG_PAIR(HI, LO) HI, LO
-#endif
-
-#if defined(__alpha__) || defined(__mips64) || defined(__sparc_v9__) || defined(__x86_64__) || defined(__ia64__)
-#define __WORDSIZE 64
-#endif
-
-#if defined(__sparc__) && (__arch64__)
-#define __WORDSIZE 64
-#endif
-
-#ifndef __WORDSIZE
-#define __WORDSIZE 32
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/errno.h b/mdk-stage1/dietlibc/include/errno.h
deleted file mode 100644
index 12aa394da..000000000
--- a/mdk-stage1/dietlibc/include/errno.h
+++ /dev/null
@@ -1,546 +0,0 @@
-#ifndef _ERRNO_H
-#define _ERRNO_H
-
-#if defined(__alpha__)
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* I/O error */
-#define ENXIO 6 /* No such device or address */
-#define E2BIG 7 /* Arg list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file number */
-#define ECHILD 10 /* No child processes */
-#define EDEADLK 11 /* Resource deadlock would occur */
-#define ENOMEM 12 /* Out of memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#define ENOTBLK 15 /* Block device required */
-#define EBUSY 16 /* Device or resource busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* No such device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* File table overflow */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Not a typewriter */
-#define ETXTBSY 26 /* Text file busy */
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-#define EDOM 33 /* Math argument out of domain of func */
-#define ERANGE 34 /* Math result not representable */
-#define EAGAIN 35 /* Try again */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Operation not supported on transport endpoint */
-#define ENOTSUP EOPNOTSUPP/* Operation not supported on transport endpoint */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Cannot assign requested address */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Network dropped connection because of reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Transport endpoint is already connected */
-#define ENOTCONN 57 /* Transport endpoint is not connected */
-#define ESHUTDOWN 58 /* Cannot send after transport endpoint shutdown */
-#define ETOOMANYREFS 59 /* Too many references: cannot splice */
-#define ETIMEDOUT 60 /* Connection timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-#define ELOOP 62 /* Too many symbolic links encountered */
-#define ENAMETOOLONG 63 /* File name too long */
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#define ENOTEMPTY 66 /* Directory not empty */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Quota exceeded */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Object is remote */
-#define ENOLCK 77 /* No record locks available */
-#define ENOSYS 78 /* Function not implemented */
-#define ENOMSG 80 /* No message of desired type */
-#define EIDRM 81 /* Identifier removed */
-#define ENOSR 82 /* Out of streams resources */
-#define ETIME 83 /* Timer expired */
-#define EBADMSG 84 /* Not a data message */
-#define EPROTO 85 /* Protocol error */
-#define ENODATA 86 /* No data available */
-#define ENOSTR 87 /* Device not a stream */
-#define ENOPKG 92 /* Package not installed */
-#define EILSEQ 116 /* Illegal byte sequence */
-/* The following are just random noise.. */
-#define ECHRNG 88 /* Channel number out of range */
-#define EL2NSYNC 89 /* Level 2 not synchronized */
-#define EL3HLT 90 /* Level 3 halted */
-#define EL3RST 91 /* Level 3 reset */
-#define ELNRNG 93 /* Link number out of range */
-#define EUNATCH 94 /* Protocol driver not attached */
-#define ENOCSI 95 /* No CSI structure available */
-#define EL2HLT 96 /* Level 2 halted */
-#define EBADE 97 /* Invalid exchange */
-#define EBADR 98 /* Invalid request descriptor */
-#define EXFULL 99 /* Exchange full */
-#define ENOANO 100 /* No anode */
-#define EBADRQC 101 /* Invalid request code */
-#define EBADSLT 102 /* Invalid slot */
-#define EDEADLOCK EDEADLK
-#define EBFONT 104 /* Bad font file format */
-#define ENONET 105 /* Machine is not on the network */
-#define ENOLINK 106 /* Link has been severed */
-#define EADV 107 /* Advertise error */
-#define ESRMNT 108 /* Srmount error */
-#define ECOMM 109 /* Communication error on send */
-#define EMULTIHOP 110 /* Multihop attempted */
-#define EDOTDOT 111 /* RFS specific error */
-#define EOVERFLOW 112 /* Value too large for defined data type */
-#define ENOTUNIQ 113 /* Name not unique on network */
-#define EBADFD 114 /* File descriptor in bad state */
-#define EREMCHG 115 /* Remote address changed */
-#define EUCLEAN 117 /* Structure needs cleaning */
-#define ENOTNAM 118 /* Not a XENIX named type file */
-#define ENAVAIL 119 /* No XENIX semaphores available */
-#define EISNAM 120 /* Is a named type file */
-#define EREMOTEIO 121 /* Remote I/O error */
-#define ELIBACC 122 /* Can not access a needed shared library */
-#define ELIBBAD 123 /* Accessing a corrupted shared library */
-#define ELIBSCN 124 /* .lib section in a.out corrupted */
-#define ELIBMAX 125 /* Attempting to link in too many shared libraries */
-#define ELIBEXEC 126 /* Cannot exec a shared library directly */
-#define ERESTART 127 /* Interrupted system call should be restarted */
-#define ESTRPIPE 128 /* Streams pipe error */
-#define ENOMEDIUM 129 /* No medium found */
-#define EMEDIUMTYPE 130 /* Wrong medium type */
-
-#elif defined(__mips__)
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* I/O error */
-#define ENXIO 6 /* No such device or address */
-#define E2BIG 7 /* Arg list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file number */
-#define ECHILD 10 /* No child processes */
-#define EAGAIN 11 /* Try again */
-#define ENOMEM 12 /* Out of memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#define ENOTBLK 15 /* Block device required */
-#define EBUSY 16 /* Device or resource busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* No such device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* File table overflow */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Not a typewriter */
-#define ETXTBSY 26 /* Text file busy */
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-#define EDOM 33 /* Math argument out of domain of func */
-#define ERANGE 34 /* Math result not representable */
-#define ENOMSG 35 /* No message of desired type */
-#define EIDRM 36 /* Identifier removed */
-#define ECHRNG 37 /* Channel number out of range */
-#define EL2NSYNC 38 /* Level 2 not synchronized */
-#define EL3HLT 39 /* Level 3 halted */
-#define EL3RST 40 /* Level 3 reset */
-#define ELNRNG 41 /* Link number out of range */
-#define EUNATCH 42 /* Protocol driver not attached */
-#define ENOCSI 43 /* No CSI structure available */
-#define EL2HLT 44 /* Level 2 halted */
-#define EDEADLK 45 /* Resource deadlock would occur */
-#define ENOLCK 46 /* No record locks available */
-#define EBADE 50 /* Invalid exchange */
-#define EBADR 51 /* Invalid request descriptor */
-#define EXFULL 52 /* Exchange full */
-#define ENOANO 53 /* No anode */
-#define EBADRQC 54 /* Invalid request code */
-#define EBADSLT 55 /* Invalid slot */
-#define EDEADLOCK 56 /* File locking deadlock error */
-#define EBFONT 59 /* Bad font file format */
-#define ENOSTR 60 /* Device not a stream */
-#define ENODATA 61 /* No data available */
-#define ETIME 62 /* Timer expired */
-#define ENOSR 63 /* Out of streams resources */
-#define ENONET 64 /* Machine is not on the network */
-#define ENOPKG 65 /* Package not installed */
-#define EREMOTE 66 /* Object is remote */
-#define ENOLINK 67 /* Link has been severed */
-#define EADV 68 /* Advertise error */
-#define ESRMNT 69 /* Srmount error */
-#define ECOMM 70 /* Communication error on send */
-#define EPROTO 71 /* Protocol error */
-#define EDOTDOT 73 /* RFS specific error */
-#define EMULTIHOP 74 /* Multihop attempted */
-#define EBADMSG 77 /* Not a data message */
-#define ENAMETOOLONG 78 /* File name too long */
-#define EOVERFLOW 79 /* Value too large for defined data type */
-#define ENOTUNIQ 80 /* Name not unique on network */
-#define EBADFD 81 /* File descriptor in bad state */
-#define EREMCHG 82 /* Remote address changed */
-#define ELIBACC 83 /* Can not access a needed shared library */
-#define ELIBBAD 84 /* Accessing a corrupted shared library */
-#define ELIBSCN 85 /* .lib section in a.out corrupted */
-#define ELIBMAX 86 /* Attempting to link in too many shared libraries */
-#define ELIBEXEC 87 /* Cannot exec a shared library directly */
-#define EILSEQ 88 /* Illegal byte sequence */
-#define ENOSYS 89 /* Function not implemented */
-#define ELOOP 90 /* Too many symbolic links encountered */
-#define ERESTART 91 /* Interrupted system call should be restarted */
-#define ESTRPIPE 92 /* Streams pipe error */
-#define ENOTEMPTY 93 /* Directory not empty */
-#define EUSERS 94 /* Too many users */
-#define ENOTSOCK 95 /* Socket operation on non-socket */
-#define EDESTADDRREQ 96 /* Destination address required */
-#define EMSGSIZE 97 /* Message too long */
-#define EPROTOTYPE 98 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 99 /* Protocol not available */
-#define EPROTONOSUPPORT 120 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 121 /* Socket type not supported */
-#define EOPNOTSUPP 122 /* Operation not supported on transport endpoint */
-#define ENOTSUP EOPNOTSUPP/* Operation not supported on transport endpoint */
-#define EPFNOSUPPORT 123 /* Protocol family not supported */
-#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
-#define EADDRINUSE 125 /* Address already in use */
-#define EADDRNOTAVAIL 126 /* Cannot assign requested address */
-#define ENETDOWN 127 /* Network is down */
-#define ENETUNREACH 128 /* Network is unreachable */
-#define ENETRESET 129 /* Network dropped connection because of reset */
-#define ECONNABORTED 130 /* Software caused connection abort */
-#define ECONNRESET 131 /* Connection reset by peer */
-#define ENOBUFS 132 /* No buffer space available */
-#define EISCONN 133 /* Transport endpoint is already connected */
-#define ENOTCONN 134 /* Transport endpoint is not connected */
-#define EUCLEAN 135 /* Structure needs cleaning */
-#define ENOTNAM 137 /* Not a XENIX named type file */
-#define ENAVAIL 138 /* No XENIX semaphores available */
-#define EISNAM 139 /* Is a named type file */
-#define EREMOTEIO 140 /* Remote I/O error */
-#define EINIT 141 /* Reserved */
-#define EREMDEV 142 /* Error 142 */
-#define ESHUTDOWN 143 /* Cannot send after transport endpoint shutdown */
-#define ETOOMANYREFS 144 /* Too many references: cannot splice */
-#define ETIMEDOUT 145 /* Connection timed out */
-#define ECONNREFUSED 146 /* Connection refused */
-#define EHOSTDOWN 147 /* Host is down */
-#define EHOSTUNREACH 148 /* No route to host */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EALREADY 149 /* Operation already in progress */
-#define EINPROGRESS 150 /* Operation now in progress */
-#define ESTALE 151 /* Stale NFS file handle */
-#define ECANCELED 158 /* AIO operation canceled */
-#define ENOMEDIUM 159 /* No medium found */
-#define EMEDIUMTYPE 160 /* Wrong medium type */
-#define EDQUOT 1133 /* Quota exceeded */
-
-#elif defined(__sparc__)
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* I/O error */
-#define ENXIO 6 /* No such device or address */
-#define E2BIG 7 /* Arg list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file number */
-#define ECHILD 10 /* No child processes */
-#define EAGAIN 11 /* Try again */
-#define ENOMEM 12 /* Out of memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#define ENOTBLK 15 /* Block device required */
-#define EBUSY 16 /* Device or resource busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* No such device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* File table overflow */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Not a typewriter */
-#define ETXTBSY 26 /* Text file busy */
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-#define EDOM 33 /* Math argument out of domain of func */
-#define ERANGE 34 /* Math result not representable */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EINPROGRESS 36 /* Operation now in progress */
-#define EALREADY 37 /* Operation already in progress */
-#define ENOTSOCK 38 /* Socket operation on non-socket */
-#define EDESTADDRREQ 39 /* Destination address required */
-#define EMSGSIZE 40 /* Message too long */
-#define EPROTOTYPE 41 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 42 /* Protocol not available */
-#define EPROTONOSUPPORT 43 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
-#define EOPNOTSUPP 45 /* Op not supported on transport endpoint */
-#define ENOTSUP EOPNOTSUPP/* Operation not supported on transport endpoint */
-#define EPFNOSUPPORT 46 /* Protocol family not supported */
-#define EAFNOSUPPORT 47 /* Address family not supported by protocol */
-#define EADDRINUSE 48 /* Address already in use */
-#define EADDRNOTAVAIL 49 /* Cannot assign requested address */
-#define ENETDOWN 50 /* Network is down */
-#define ENETUNREACH 51 /* Network is unreachable */
-#define ENETRESET 52 /* Net dropped connection because of reset */
-#define ECONNABORTED 53 /* Software caused connection abort */
-#define ECONNRESET 54 /* Connection reset by peer */
-#define ENOBUFS 55 /* No buffer space available */
-#define EISCONN 56 /* Transport endpoint is already connected */
-#define ENOTCONN 57 /* Transport endpoint is not connected */
-#define ESHUTDOWN 58 /* No send after transport endpoint shutdown */
-#define ETOOMANYREFS 59 /* Too many references: cannot splice */
-#define ETIMEDOUT 60 /* Connection timed out */
-#define ECONNREFUSED 61 /* Connection refused */
-#define ELOOP 62 /* Too many symbolic links encountered */
-#define ENAMETOOLONG 63 /* File name too long */
-#define EHOSTDOWN 64 /* Host is down */
-#define EHOSTUNREACH 65 /* No route to host */
-#define ENOTEMPTY 66 /* Directory not empty */
-#define EPROCLIM 67 /* SUNOS: Too many processes */
-#define EUSERS 68 /* Too many users */
-#define EDQUOT 69 /* Quota exceeded */
-#define ESTALE 70 /* Stale NFS file handle */
-#define EREMOTE 71 /* Object is remote */
-#define ENOSTR 72 /* Device not a stream */
-#define ETIME 73 /* Timer expired */
-#define ENOSR 74 /* Out of streams resources */
-#define ENOMSG 75 /* No message of desired type */
-#define EBADMSG 76 /* Not a data message */
-#define EIDRM 77 /* Identifier removed */
-#define EDEADLK 78 /* Resource deadlock would occur */
-#define ENOLCK 79 /* No record locks available */
-#define ENONET 80 /* Machine is not on the network */
-#define ERREMOTE 81 /* SunOS: Too many lvls of remote in path */
-#define ENOLINK 82 /* Link has been severed */
-#define EADV 83 /* Advertise error */
-#define ESRMNT 84 /* Srmount error */
-#define ECOMM 85 /* Communication error on send */
-#define EPROTO 86 /* Protocol error */
-#define EMULTIHOP 87 /* Multihop attempted */
-#define EDOTDOT 88 /* RFS specific error */
-#define EREMCHG 89 /* Remote address changed */
-#define ENOSYS 90 /* Function not implemented */
-#define ESTRPIPE 91 /* Streams pipe error */
-#define EOVERFLOW 92 /* Value too large for defined data type */
-#define EBADFD 93 /* File descriptor in bad state */
-#define ECHRNG 94 /* Channel number out of range */
-#define EL2NSYNC 95 /* Level 2 not synchronized */
-#define EL3HLT 96 /* Level 3 halted */
-#define EL3RST 97 /* Level 3 reset */
-#define ELNRNG 98 /* Link number out of range */
-#define EUNATCH 99 /* Protocol driver not attached */
-#define ENOCSI 100 /* No CSI structure available */
-#define EL2HLT 101 /* Level 2 halted */
-#define EBADE 102 /* Invalid exchange */
-#define EBADR 103 /* Invalid request descriptor */
-#define EXFULL 104 /* Exchange full */
-#define ENOANO 105 /* No anode */
-#define EBADRQC 106 /* Invalid request code */
-#define EBADSLT 107 /* Invalid slot */
-#define EDEADLOCK 108 /* File locking deadlock error */
-#define EBFONT 109 /* Bad font file format */
-#define ELIBEXEC 110 /* Cannot exec a shared library directly */
-#define ENODATA 111 /* No data available */
-#define ELIBBAD 112 /* Accessing a corrupted shared library */
-#define ENOPKG 113 /* Package not installed */
-#define ELIBACC 114 /* Can not access a needed shared library */
-#define ENOTUNIQ 115 /* Name not unique on network */
-#define ERESTART 116 /* Interrupted syscall should be restarted */
-#define EUCLEAN 117 /* Structure needs cleaning */
-#define ENOTNAM 118 /* Not a XENIX named type file */
-#define ENAVAIL 119 /* No XENIX semaphores available */
-#define EISNAM 120 /* Is a named type file */
-#define EREMOTEIO 121 /* Remote I/O error */
-#define EILSEQ 122 /* Illegal byte sequence */
-#define ELIBMAX 123 /* Atmpt to link in too many shared libs */
-#define ELIBSCN 124 /* .lib section in a.out corrupted */
-#define ENOMEDIUM 125 /* No medium found */
-#define EMEDIUMTYPE 126 /* Wrong medium type */
-
-#else
-
-/* i386, arm, ppc, x86_64, ia64 */
-
-#define EPERM 1 /* Operation not permitted */
-#define ENOENT 2 /* No such file or directory */
-#define ESRCH 3 /* No such process */
-#define EINTR 4 /* Interrupted system call */
-#define EIO 5 /* I/O error */
-#define ENXIO 6 /* No such device or address */
-#define E2BIG 7 /* Arg list too long */
-#define ENOEXEC 8 /* Exec format error */
-#define EBADF 9 /* Bad file number */
-#define ECHILD 10 /* No child processes */
-#define EAGAIN 11 /* Try again */
-#define ENOMEM 12 /* Out of memory */
-#define EACCES 13 /* Permission denied */
-#define EFAULT 14 /* Bad address */
-#define ENOTBLK 15 /* Block device required */
-#define EBUSY 16 /* Device or resource busy */
-#define EEXIST 17 /* File exists */
-#define EXDEV 18 /* Cross-device link */
-#define ENODEV 19 /* No such device */
-#define ENOTDIR 20 /* Not a directory */
-#define EISDIR 21 /* Is a directory */
-#define EINVAL 22 /* Invalid argument */
-#define ENFILE 23 /* File table overflow */
-#define EMFILE 24 /* Too many open files */
-#define ENOTTY 25 /* Not a typewriter */
-#define ETXTBSY 26 /* Text file busy */
-#define EFBIG 27 /* File too large */
-#define ENOSPC 28 /* No space left on device */
-#define ESPIPE 29 /* Illegal seek */
-#define EROFS 30 /* Read-only file system */
-#define EMLINK 31 /* Too many links */
-#define EPIPE 32 /* Broken pipe */
-#define EDOM 33 /* Math argument out of domain of func */
-#define ERANGE 34 /* Math result not representable */
-#define EDEADLK 35 /* Resource deadlock would occur */
-#define ENAMETOOLONG 36 /* File name too long */
-#define ENOLCK 37 /* No record locks available */
-#define ENOSYS 38 /* Function not implemented */
-#define ENOTEMPTY 39 /* Directory not empty */
-#define ELOOP 40 /* Too many symbolic links encountered */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define ENOMSG 42 /* No message of desired type */
-#define EIDRM 43 /* Identifier removed */
-#define ECHRNG 44 /* Channel number out of range */
-#define EL2NSYNC 45 /* Level 2 not synchronized */
-#define EL3HLT 46 /* Level 3 halted */
-#define EL3RST 47 /* Level 3 reset */
-#define ELNRNG 48 /* Link number out of range */
-#define EUNATCH 49 /* Protocol driver not attached */
-#define ENOCSI 50 /* No CSI structure available */
-#define EL2HLT 51 /* Level 2 halted */
-#define EBADE 52 /* Invalid exchange */
-#define EBADR 53 /* Invalid request descriptor */
-#define EXFULL 54 /* Exchange full */
-#define ENOANO 55 /* No anode */
-#define EBADRQC 56 /* Invalid request code */
-#define EBADSLT 57 /* Invalid slot */
-#define EDEADLOCK EDEADLK
-#define EBFONT 59 /* Bad font file format */
-#define ENOSTR 60 /* Device not a stream */
-#define ENODATA 61 /* No data available */
-#define ETIME 62 /* Timer expired */
-#define ENOSR 63 /* Out of streams resources */
-#define ENONET 64 /* Machine is not on the network */
-#define ENOPKG 65 /* Package not installed */
-#define EREMOTE 66 /* Object is remote */
-#define ENOLINK 67 /* Link has been severed */
-#define EADV 68 /* Advertise error */
-#define ESRMNT 69 /* Srmount error */
-#define ECOMM 70 /* Communication error on send */
-#define EPROTO 71 /* Protocol error */
-#define EMULTIHOP 72 /* Multihop attempted */
-#define EDOTDOT 73 /* RFS specific error */
-#define EBADMSG 74 /* Not a data message */
-#define EOVERFLOW 75 /* Value too large for defined data type */
-#define ENOTUNIQ 76 /* Name not unique on network */
-#define EBADFD 77 /* File descriptor in bad state */
-#define EREMCHG 78 /* Remote address changed */
-#define ELIBACC 79 /* Can not access a needed shared library */
-#define ELIBBAD 80 /* Accessing a corrupted shared library */
-#define ELIBSCN 81 /* .lib section in a.out corrupted */
-#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
-#define ELIBEXEC 83 /* Cannot exec a shared library directly */
-#define EILSEQ 84 /* Illegal byte sequence */
-#define ERESTART 85 /* Interrupted system call should be restarted */
-#define ESTRPIPE 86 /* Streams pipe error */
-#define EUSERS 87 /* Too many users */
-#define ENOTSOCK 88 /* Socket operation on non-socket */
-#define EDESTADDRREQ 89 /* Destination address required */
-#define EMSGSIZE 90 /* Message too long */
-#define EPROTOTYPE 91 /* Protocol wrong type for socket */
-#define ENOPROTOOPT 92 /* Protocol not available */
-#define EPROTONOSUPPORT 93 /* Protocol not supported */
-#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
-#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
-#define ENOTSUP EOPNOTSUPP/* Operation not supported on transport endpoint */
-#define EPFNOSUPPORT 96 /* Protocol family not supported */
-#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
-#define EADDRINUSE 98 /* Address already in use */
-#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
-#define ENETDOWN 100 /* Network is down */
-#define ENETUNREACH 101 /* Network is unreachable */
-#define ENETRESET 102 /* Network dropped connection because of reset */
-#define ECONNABORTED 103 /* Software caused connection abort */
-#define ECONNRESET 104 /* Connection reset by peer */
-#define ENOBUFS 105 /* No buffer space available */
-#define EISCONN 106 /* Transport endpoint is already connected */
-#define ENOTCONN 107 /* Transport endpoint is not connected */
-#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
-#define ETOOMANYREFS 109 /* Too many references: cannot splice */
-#define ETIMEDOUT 110 /* Connection timed out */
-#define ECONNREFUSED 111 /* Connection refused */
-#define EHOSTDOWN 112 /* Host is down */
-#define EHOSTUNREACH 113 /* No route to host */
-#define EALREADY 114 /* Operation already in progress */
-#define EINPROGRESS 115 /* Operation now in progress */
-#define ESTALE 116 /* Stale NFS file handle */
-#define EUCLEAN 117 /* Structure needs cleaning */
-#define ENOTNAM 118 /* Not a XENIX named type file */
-#define ENAVAIL 119 /* No XENIX semaphores available */
-#define EISNAM 120 /* Is a named type file */
-#define EREMOTEIO 121 /* Remote I/O error */
-#define EDQUOT 122 /* Quota exceeded */
-#define ENOMEDIUM 123 /* No medium found */
-#define EMEDIUMTYPE 124 /* Wrong medium type */
-#endif
-
-#define __SYS_NERR ((EMEDIUMTYPE) + 1)
-
-#ifndef __ASSEMBLER__
-
-#ifndef _REENTRANT
-extern int errno;
-#else
-#define errno (*__errno_location())
-#endif
-
-extern int *__errno_location(void);
-
-#define __set_errno(x) errno=(x)
-
-#ifdef _BSD_SOURCE
-extern const char *const sys_errlist[];
-extern int sys_nerr;
-#endif
-
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/fcntl.h b/mdk-stage1/dietlibc/include/fcntl.h
deleted file mode 100644
index 33f58d82a..000000000
--- a/mdk-stage1/dietlibc/include/fcntl.h
+++ /dev/null
@@ -1,564 +0,0 @@
-#ifndef _FCNTL_H
-#define _FCNTL_H
-
-#include <sys/cdefs.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#define F_LINUX_SPECIFIC_BASE 1024
-
-#if defined(__i386__) || defined(__s390__) || defined(__x86_64__) || defined(__ia64__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_ACCMODE 0003
-#define O_RDONLY 00
-#define O_WRONLY 01
-#define O_RDWR 02
-#define O_CREAT 0100 /* not fcntl */
-#define O_EXCL 0200 /* not fcntl */
-#define O_NOCTTY 0400 /* not fcntl */
-#define O_TRUNC 01000 /* not fcntl */
-#define O_APPEND 02000
-#define O_NONBLOCK 04000
-#define O_NDELAY O_NONBLOCK
-#define O_SYNC 010000
-#define FASYNC 020000 /* fcntl, for BSD compatibility */
-#define O_DIRECT 040000 /* direct disk access hint - currently ignored */
-#define O_LARGEFILE 0100000
-#define O_DIRECTORY 0200000 /* must be a directory */
-#define O_NOFOLLOW 0400000 /* don't follow links */
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETLK 5
-#define F_SETLK 6
-#define F_SETLKW 7
-#define F_SETOWN 8 /* for sockets. */
-#define F_GETOWN 9 /* for sockets. */
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-#define F_GETLK64 12 /* using 'struct flock64' */
-#define F_SETLK64 13
-#define F_SETLKW64 14
-
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-/* for leases */
-#define F_INPROGRESS 16
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
-
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
-};
-
-struct flock64 {
- short l_type;
- short l_whence;
- loff_t l_start;
- loff_t l_len;
- pid_t l_pid;
-};
-
-#elif defined(__alpha__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_ACCMODE 0003
-#define O_RDONLY 00
-#define O_WRONLY 01
-#define O_RDWR 02
-#define O_CREAT 01000 /* not fcntl */
-#define O_TRUNC 02000 /* not fcntl */
-#define O_EXCL 04000 /* not fcntl */
-#define O_NOCTTY 010000 /* not fcntl */
-
-#define O_NONBLOCK 00004
-#define O_APPEND 00010
-#define O_NDELAY O_NONBLOCK
-#define O_SYNC 040000
-#define FASYNC 020000 /* fcntl, for BSD compatibility */
-#define O_DIRECT 040000 /* direct disk access - should check with OSF/1 */
-#define O_DIRECTORY 0100000 /* must be a directory */
-#define O_NOFOLLOW 0200000 /* don't follow links */
-#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETLK 7
-#define F_SETLK 8
-#define F_SETLKW 9
-
-#define F_SETOWN 5 /* for sockets. */
-#define F_GETOWN 6 /* for sockets. */
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 1
-#define F_WRLCK 2
-#define F_UNLCK 8
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 16 /* or 3 */
-#define F_SHLCK 32 /* or 4 */
-
-#define F_INPROGRESS 64
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
-};
-
-#elif defined(__mips__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_ACCMODE 0x0003
-#define O_RDONLY 0x0000
-#define O_WRONLY 0x0001
-#define O_RDWR 0x0002
-#define O_APPEND 0x0008
-#define O_SYNC 0x0010
-#define O_NONBLOCK 0x0080
-#define O_CREAT 0x0100 /* not fcntl */
-#define O_TRUNC 0x0200 /* not fcntl */
-#define O_EXCL 0x0400 /* not fcntl */
-#define O_NOCTTY 0x0800 /* not fcntl */
-#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
-#define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */
-#define O_DIRECT 0x8000 /* direct disk access hint - currently ignored */
-#define O_DIRECTORY 0x10000 /* must be a directory */
-#define O_NOFOLLOW 0x20000 /* don't follow links */
-
-#define O_NDELAY O_NONBLOCK
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETLK 14
-#define F_SETLK 6
-#define F_SETLKW 7
-
-#define F_SETOWN 24 /* for sockets. */
-#define F_GETOWN 23 /* for sockets. */
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-/* for leases */
-#define F_INPROGRESS 16
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent XXXXXXXXXXXXXXXXXX
- blocking */
-#define LOCK_UN 8 /* remove lock */
-
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-typedef struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- long l_sysid; /* XXXXXXXXXXXXXXXXXXXXXXXXX */
- pid_t l_pid;
- long pad[4]; /* ZZZZZZZZZZZZZZZZZZZZZZZZZZ */
-} flock_t;
-
-#elif defined(__sparc__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_RDONLY 0x0000
-#define O_WRONLY 0x0001
-#define O_RDWR 0x0002
-#define O_ACCMODE 0x0003
-#define O_APPEND 0x0008
-#define FASYNC 0x0040 /* fcntl, for BSD compatibility */
-#define O_CREAT 0x0200 /* not fcntl */
-#define O_TRUNC 0x0400 /* not fcntl */
-#define O_EXCL 0x0800 /* not fcntl */
-#define O_SYNC 0x2000
-#define O_NONBLOCK 0x4000
-#define O_NDELAY (0x0004 | O_NONBLOCK)
-#define O_NOCTTY 0x8000 /* not fcntl */
-#define O_DIRECTORY 0x10000 /* must be a directory */
-#define O_NOFOLLOW 0x20000 /* don't follow links */
-#define O_LARGEFILE 0x40000
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETOWN 5 /* for sockets. */
-#define F_SETOWN 6 /* for sockets. */
-#define F_GETLK 7
-#define F_SETLK 8
-#define F_SETLKW 9
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-#define F_GETLK64 12 /* using 'struct flock64' */
-#define F_SETLK64 13
-#define F_SETLKW64 14
-
-/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 1
-#define F_WRLCK 2
-#define F_UNLCK 3
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-/* for leases */
-#define F_INPROGRESS 16
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
-
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
- short __unused;
-};
-
-#ifdef __arch64__
-#define flock64 flock
-#else
-struct flock64 {
- short l_type;
- short l_whence;
- loff_t l_start;
- loff_t l_len;
- pid_t l_pid;
- short __unused;
-};
-#endif
-
-#elif defined(__powerpc__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_ACCMODE 0003
-#define O_RDONLY 00
-#define O_WRONLY 01
-#define O_RDWR 02
-#define O_CREAT 0100 /* not fcntl */
-#define O_EXCL 0200 /* not fcntl */
-#define O_NOCTTY 0400 /* not fcntl */
-#define O_TRUNC 01000 /* not fcntl */
-#define O_APPEND 02000
-#define O_NONBLOCK 04000
-#define O_NDELAY O_NONBLOCK
-#define O_SYNC 010000
-#define FASYNC 020000 /* fcntl, for BSD compatibility */
-#define O_DIRECTORY 040000 /* must be a directory */
-#define O_NOFOLLOW 0100000 /* don't follow links */
-#define O_LARGEFILE 0200000
-#define O_DIRECT 0400000 /* direct disk access hint - currently ignored */
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETLK 5
-#define F_SETLK 6
-#define F_SETLKW 7
-
-#define F_SETOWN 8 /* for sockets. */
-#define F_GETOWN 9 /* for sockets. */
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-#define F_GETLK64 12 /* using 'struct flock64' */
-#define F_SETLK64 13
-#define F_SETLKW64 14
-
-/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-/* for leases */
-#define F_INPROGRESS 16
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
-
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
-};
-
-struct flock64 {
- short l_type;
- short l_whence;
- loff_t l_start;
- loff_t l_len;
- pid_t l_pid;
-};
-
-#elif defined (__arm__)
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
- located on an ext2 file system */
-#define O_ACCMODE 0003
-#define O_RDONLY 00
-#define O_WRONLY 01
-#define O_RDWR 02
-#define O_CREAT 0100 /* not fcntl */
-#define O_EXCL 0200 /* not fcntl */
-#define O_NOCTTY 0400 /* not fcntl */
-#define O_TRUNC 01000 /* not fcntl */
-#define O_APPEND 02000
-#define O_NONBLOCK 04000
-#define O_NDELAY O_NONBLOCK
-#define O_SYNC 010000
-#define FASYNC 020000 /* fcntl, for BSD compatibility */
-#define O_DIRECTORY 040000 /* must be a directory */
-#define O_NOFOLLOW 0100000 /* don't follow links */
-#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
-#define O_LARGEFILE 0400000
-
-#define F_DUPFD 0 /* dup */
-#define F_GETFD 1 /* get close_on_exec */
-#define F_SETFD 2 /* set/clear close_on_exec */
-#define F_GETFL 3 /* get file->f_flags */
-#define F_SETFL 4 /* set file->f_flags */
-#define F_GETLK 5
-#define F_SETLK 6
-#define F_SETLKW 7
-
-#define F_SETOWN 8 /* for sockets. */
-#define F_GETOWN 9 /* for sockets. */
-#define F_SETSIG 10 /* for sockets. */
-#define F_GETSIG 11 /* for sockets. */
-
-#define F_GETLK64 12 /* using 'struct flock64' */
-#define F_SETLK64 13
-#define F_SETLKW64 14
-
-/* for F_[GET|SET]FL */
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK 0
-#define F_WRLCK 1
-#define F_UNLCK 2
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-/* for leases */
-#define F_INPROGRESS 16
-
-/* operations for bsd flock(), also used by the kernel implementation */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
-
-#define LOCK_MAND 32 /* This is a mandatory flock */
-#define LOCK_READ 64 /* ... Which allows concurrent read operations */
-#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
-#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
-
-struct flock {
- short l_type;
- short l_whence;
- off_t l_start;
- off_t l_len;
- pid_t l_pid;
-};
-
-struct flock64 {
- short l_type;
- short l_whence;
- loff_t l_start;
- loff_t l_len;
- pid_t l_pid;
-};
-
-#elif defined(__hppa__)
-
-/* Copied from bits/fcntl.h */
-
-#define O_RDONLY 00000000
-#define O_WRONLY 00000001
-#define O_RDWR 00000002
-#define O_ACCMODE 00000003
-#define O_APPEND 00000010
-#define O_BLKSEEK 00000100 /* HPUX only */
-#define O_CREAT 00000400 /* not fcntl */
-#define O_TRUNC 00001000 /* not fcntl */
-#define O_EXCL 00002000 /* not fcntl */
-#define O_ASYNC 00020000
-#define O_SYNC 00100000
-#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */
-#define O_NDELAY O_NONBLOCK
-#define O_NOCTTY 00400000 /* not fcntl */
-#define O_DIRECTORY 00010000
-
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
-#define F_GETLK 5 /* Get record locking info. */
-#define F_SETLK 6 /* Set record locking info (non-blocking). */
-#define F_SETLKW 7 /* Set record locking info (blocking). */
-
-#define F_GETLK64 8 /* Get record locking info. */
-#define F_SETLK64 9 /* Set record locking info (non-blocking). */
-#define F_SETLKW64 10 /* Set record locking info (blocking). */
-
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
-
-#define F_RDLCK 1 /* Read lock. */
-#define F_WRLCK 2 /* Write lock. */
-#define F_UNLCK 3 /* Remove lock. */
-
-#define F_EXLCK 4 /* or 3 */
-#define F_SHLCK 8 /* or 4 */
-
-struct flock
-{
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- off_t l_start; /* Offset where the lock begins. */
- off_t l_len; /* Size of the locked area; zero means until EOF. */
- pid_t l_pid; /* Process holding the lock. */
-};
-
-struct flock64
-{
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
- off64_t l_start; /* Offset where the lock begins. */
- off64_t l_len; /* Size of the locked area; zero means until EOF. */
- pid_t l_pid; /* Process holding the lock. */
-};
-
-#endif
-
-extern int fcntl (int __fd, int __cmd, ...) __THROW;
-extern int lockf (int __fd, int __cmd, off_t __len) __THROW;
-extern int lockf64 (int __fd, int __cmd, off64_t __len) __THROW;
-
-#define F_ULOCK 0 /* Unlock a previously locked region. */
-#define F_LOCK 1 /* Lock a region for exclusive use. */
-#define F_TLOCK 2 /* Test and lock a region for exclusive use. */
-#define F_TEST 3 /* Test a region for other processes locks. */
-
-#if !defined(O_ASYNC) && defined(FASYNC)
-#define O_ASYNC FASYNC
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/features.h b/mdk-stage1/dietlibc/include/features.h
deleted file mode 100644
index d2b92d15c..000000000
--- a/mdk-stage1/dietlibc/include/features.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _FEATURES_H
-#define _FEATURES_H
-
-#ifndef __dietlibc__
-#error "not using the diet wrapper?!"
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/float.h b/mdk-stage1/dietlibc/include/float.h
deleted file mode 100644
index 9c9c85a3a..000000000
--- a/mdk-stage1/dietlibc/include/float.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef _FLOAT_H
-#define _FLOAT_H
-
-/* blatantly copied from gcc headers for sparc */
-
- /* Radix of exponent representation */
-#undef FLT_RADIX
-#define FLT_RADIX 2
- /* Number of base-FLT_RADIX digits in the significand of a float */
-#undef FLT_MANT_DIG
-#define FLT_MANT_DIG 24
- /* Number of decimal digits of precision in a float */
-#undef FLT_DIG
-#define FLT_DIG 6
- /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
-#undef FLT_ROUNDS
-#define FLT_ROUNDS 1
- /* Difference between 1.0 and the minimum float greater than 1.0 */
-#undef FLT_EPSILON
-#define FLT_EPSILON 1.19209290e-07F
- /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
-#undef FLT_MIN_EXP
-#define FLT_MIN_EXP (-125)
- /* Minimum normalised float */
-#undef FLT_MIN
-#define FLT_MIN 1.17549435e-38F
- /* Minimum int x such that 10**x is a normalised float */
-#undef FLT_MIN_10_EXP
-#define FLT_MIN_10_EXP (-37)
- /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
-#undef FLT_MAX_EXP
-#define FLT_MAX_EXP 128
- /* Maximum float */
-#undef FLT_MAX
-#define FLT_MAX 3.40282347e+38F
- /* Maximum int x such that 10**x is a representable float */
-#undef FLT_MAX_10_EXP
-#define FLT_MAX_10_EXP 38
-
- /* Number of base-FLT_RADIX digits in the significand of a double */
-#undef DBL_MANT_DIG
-#define DBL_MANT_DIG 53
- /* Number of decimal digits of precision in a double */
-#undef DBL_DIG
-#define DBL_DIG 15
- /* Difference between 1.0 and the minimum double greater than 1.0 */
-#undef DBL_EPSILON
-#define DBL_EPSILON 2.2204460492503131e-16
- /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
-#undef DBL_MIN_EXP
-#define DBL_MIN_EXP (-1021)
- /* Minimum normalised double */
-#undef DBL_MIN
-#define DBL_MIN 2.2250738585072014e-308
- /* Minimum int x such that 10**x is a normalised double */
-#undef DBL_MIN_10_EXP
-#define DBL_MIN_10_EXP (-307)
- /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
-#undef DBL_MAX_EXP
-#define DBL_MAX_EXP 1024
- /* Maximum double */
-#undef DBL_MAX
-#define DBL_MAX 1.7976931348623157e+308
- /* Maximum int x such that 10**x is a representable double */
-#undef DBL_MAX_10_EXP
-#define DBL_MAX_10_EXP 308
-
- /* Number of base-FLT_RADIX digits in the significand of a long double */
-#undef LDBL_MANT_DIG
-#define LDBL_MANT_DIG 53
- /* Number of decimal digits of precision in a long double */
-#undef LDBL_DIG
-#define LDBL_DIG 15
- /* Difference between 1.0 and the minimum long double greater than 1.0 */
-#undef LDBL_EPSILON
-#define LDBL_EPSILON 2.2204460492503131e-16L
- /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
-#undef LDBL_MIN_EXP
-#define LDBL_MIN_EXP (-1021)
- /* Minimum normalised long double */
-#undef LDBL_MIN
-#define LDBL_MIN 2.2250738585072014e-308L
- /* Minimum int x such that 10**x is a normalised long double */
-#undef LDBL_MIN_10_EXP
-#define LDBL_MIN_10_EXP (-307)
- /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
-#undef LDBL_MAX_EXP
-#define LDBL_MAX_EXP 1024
- /* Maximum long double */
-#undef LDBL_MAX
-#define LDBL_MAX 1.7976931348623157e+308L
- /* Maximum int x such that 10**x is a representable long double */
-#undef LDBL_MAX_10_EXP
-#define LDBL_MAX_10_EXP 308
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/fnmatch.h b/mdk-stage1/dietlibc/include/fnmatch.h
deleted file mode 100644
index 146e700bd..000000000
--- a/mdk-stage1/dietlibc/include/fnmatch.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _FNMATCH_H
-#define _FNMATCH_H
-
-#include <sys/cdefs.h>
-
-int fnmatch(const char *pattern, const char *string, int flags) __THROW;
-
-#define FNM_NOESCAPE 1
-#define FNM_PATHNAME 2
-#define FNM_FILE_NAME 2
-#define FNM_PERIOD 4
-#define FNM_LEADING_DIR 8
-#define FNM_CASEFOLD 16
-
-#define FNM_NOMATCH 1
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/ftw.h b/mdk-stage1/dietlibc/include/ftw.h
deleted file mode 100644
index e0450518e..000000000
--- a/mdk-stage1/dietlibc/include/ftw.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _FTW_H
-#define _FTW_H
-
-#include <sys/cdefs.h>
-#include <sys/stat.h>
-
-struct FTW
- {
- int base;
- int level;
- };
-
-int ftw (const char *dir, int (*fn)(const char *file, const struct stat *sb, int flag), int depth) __THROW;
-int nftw (const char *dir, int (*fn)(const char *file, const struct stat *sb, int flag, struct FTW *s), int depth, int flags) __THROW;
-
-enum
-{
- FTW_F, /* Regular file. */
-#define FTW_F FTW_F
- FTW_D, /* Directory. */
-#define FTW_D FTW_D
- FTW_DNR, /* Unreadable directory. */
-#define FTW_DNR FTW_DNR
- FTW_NS, /* Unstatable file. */
-#define FTW_NS FTW_NS
- FTW_SL, /* Symbolic link. */
-# define FTW_SL FTW_SL
-/* These flags are only passed from the `nftw' function. */
- FTW_DP, /* Directory, all subdirs have been visited. */
-# define FTW_DP FTW_DP
- FTW_SLN /* Symbolic link naming non-existing file. */
-# define FTW_SLN FTW_SLN
-};
-
-typedef int (*__ftw_func_t) (const char *__filename,
- const struct stat *__status, int __flag) __THROW;
-
-typedef int (*__nftw_func_t) (const char *__filename,
- const struct stat *__status, int __flag,
- struct FTW *__info) __THROW;
-
-#ifndef __NO_STAT64
-typedef int (*__ftw64_func_t) (const char *__filename,
- const struct stat64 *__status, int __flag) __THROW;
-
-typedef int (*__nftw64_func_t) (const char *__filename,
- const struct stat64 *__status,
- int __flag, struct FTW *__info) __THROW;
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/getopt.h b/mdk-stage1/dietlibc/include/getopt.h
deleted file mode 100644
index db1592c52..000000000
--- a/mdk-stage1/dietlibc/include/getopt.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __GETOPT_H__
-#define __GETOPT_H__
-
-#include <unistd.h>
-
-extern int optopt;
-
-struct option {
- const char* name;
- int has_arg;
- int* flag;
- int val;
-};
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-extern int getopt_long(int argc, char *const *argv,
- const char *shortopts, const struct option *longopts,
- int *longind);
-
-extern int getopt_long_only(int argc, char *const *argv,
- const char *shortopts, const struct option *longopts,
- int *longind);
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/glob.h b/mdk-stage1/dietlibc/include/glob.h
deleted file mode 100644
index bc8f779c9..000000000
--- a/mdk-stage1/dietlibc/include/glob.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef _GLOB_H
-#define _GLOB_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-typedef struct {
- size_t gl_pathc; /* Count of paths matched so far */
- char **gl_pathv; /* List of matched pathnames. */
- size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
- int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
-} glob_t;
-
-
-int glob(const char *pattern, int flags,
- int errfunc(const char * epath, int eerrno),
- glob_t *pglob) __THROW;
-
-void globfree(glob_t *pglob) __THROW;
-
-
-
-/* Bits set in the FLAGS argument to `glob'. */
-#define GLOB_ERR (1 << 0)/* Return on read errors. */
-#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
-#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
-#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
-#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
-#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
-#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
-#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
-
-#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
-#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
-#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
-#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
-#define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
-#define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
-#define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
- if the user name is not available. */
-#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
- GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
- GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
- GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
-
-
-/* Error returns from `glob'. */
-#define GLOB_NOSPACE 1 /* Ran out of memory. */
-#define GLOB_ABORTED 2 /* Read error. */
-#define GLOB_NOMATCH 3 /* No matches found. */
-#define GLOB_NOSYS 4 /* Not implemented. */
-/* Previous versions of this file defined GLOB_ABEND instead of
- GLOB_ABORTED. Provide a compatibility definition here. */
-#define GLOB_ABEND GLOB_ABORTED
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/grp.h b/mdk-stage1/dietlibc/include/grp.h
deleted file mode 100644
index 08b153137..000000000
--- a/mdk-stage1/dietlibc/include/grp.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _GRP_H
-#define _GRP_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct group
- {
- char *gr_name; /* Group name. */
- char *gr_passwd; /* Password. */
- gid_t gr_gid; /* Group ID. */
- char **gr_mem; /* Member list. */
- };
-
-extern struct group *getgrgid (gid_t uid) __THROW;
-extern struct group *getgrnam (const char *name) __THROW;
-
-extern struct group *getgrent(void) __THROW;
-extern void setgrent(void) __THROW;
-extern void endgrent(void) __THROW;
-
-int getgrent_r(struct group *res, char *buf, size_t buflen,
- struct group **res_sig) __THROW;
-int getgrnam_r(const char* name,
- struct group *res, char *buf, size_t buflen,
- struct group **res_sig) __THROW;
-int getgrgid_r(uid_t uid,
- struct group *res, char *buf, size_t buflen,
- struct group **res_sig) __THROW;
-
-extern int setgroups(size_t n, const gid_t *groups) __THROW;
-extern int setgroups32(size_t n, const gid32_t *groups) __THROW;
-extern int initgroups(const char *user, gid_t group) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/iconv.h b/mdk-stage1/dietlibc/include/iconv.h
deleted file mode 100644
index 1205994ca..000000000
--- a/mdk-stage1/dietlibc/include/iconv.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ICONV_H
-#define _ICONV_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* Identifier for conversion method from one codeset to another. */
-typedef unsigned int iconv_t;
-
-/* Allocate descriptor for code conversion from codeset FROMCODE to
- codeset TOCODE. */
-extern iconv_t iconv_open (const char *tocode, const char *fromcode) __THROW;
-
-/* Convert at most *INBYTESLEFT bytes from *INBUF according to the
- code conversion algorithm specified by CD and place up to
- *OUTBYTESLEFT bytes in buffer at *OUTBUF. */
-extern size_t iconv (iconv_t cd, const char** inbuf,
- size_t* inbytesleft,
- char** outbuf,
- size_t* outbytesleft) __THROW;
-
-/* Free resources allocated for descriptor CD for code conversion. */
-extern int iconv_close (iconv_t cd) __THROW;
-
-#endif /* iconv.h */
diff --git a/mdk-stage1/dietlibc/include/inttypes.h b/mdk-stage1/dietlibc/include/inttypes.h
deleted file mode 100644
index 32637f5f7..000000000
--- a/mdk-stage1/dietlibc/include/inttypes.h
+++ /dev/null
@@ -1,247 +0,0 @@
-#ifndef _INTTYPES_H
-#define _INTTYPES_H
-
-#include <sys/cdefs.h>
-#include <endian.h>
-
-# if __WORDSIZE == 64
-# define __PRI64_PREFIX "l"
-# define __PRIPTR_PREFIX "l"
-# else
-# define __PRI64_PREFIX "ll"
-# define __PRIPTR_PREFIX
-# endif
-
-/* Macros for printing format specifiers. */
-
-/* Decimal notation. */
-# define PRId8 "d"
-# define PRId16 "d"
-# define PRId32 "d"
-# define PRId64 __PRI64_PREFIX "d"
-
-# define PRIdLEAST8 "d"
-# define PRIdLEAST16 "d"
-# define PRIdLEAST32 "d"
-# define PRIdLEAST64 __PRI64_PREFIX "d"
-
-# define PRIdFAST8 "d"
-# define PRIdFAST16 "d"
-# define PRIdFAST32 "d"
-# define PRIdFAST64 __PRI64_PREFIX "d"
-
-
-# define PRIi8 "i"
-# define PRIi16 "i"
-# define PRIi32 "i"
-# define PRIi64 __PRI64_PREFIX "i"
-
-# define PRIiLEAST8 "i"
-# define PRIiLEAST16 "i"
-# define PRIiLEAST32 "i"
-# define PRIiLEAST64 __PRI64_PREFIX "i"
-
-# define PRIiFAST8 "i"
-# define PRIiFAST16 "i"
-# define PRIiFAST32 "i"
-# define PRIiFAST64 __PRI64_PREFIX "i"
-
-/* Octal notation. */
-# define PRIo8 "o"
-# define PRIo16 "o"
-# define PRIo32 "o"
-# define PRIo64 __PRI64_PREFIX "o"
-
-# define PRIoLEAST8 "o"
-# define PRIoLEAST16 "o"
-# define PRIoLEAST32 "o"
-# define PRIoLEAST64 __PRI64_PREFIX "o"
-
-# define PRIoFAST8 "o"
-# define PRIoFAST16 "o"
-# define PRIoFAST32 "o"
-# define PRIoFAST64 __PRI64_PREFIX "o"
-
-/* Unsigned integers. */
-# define PRIu8 "u"
-# define PRIu16 "u"
-# define PRIu32 "u"
-# define PRIu64 __PRI64_PREFIX "u"
-
-# define PRIuLEAST8 "u"
-# define PRIuLEAST16 "u"
-# define PRIuLEAST32 "u"
-# define PRIuLEAST64 __PRI64_PREFIX "u"
-
-# define PRIuFAST8 "u"
-# define PRIuFAST16 "u"
-# define PRIuFAST32 "u"
-# define PRIuFAST64 __PRI64_PREFIX "u"
-
-/* lowercase hexadecimal notation. */
-# define PRIx8 "x"
-# define PRIx16 "x"
-# define PRIx32 "x"
-# define PRIx64 __PRI64_PREFIX "x"
-
-# define PRIxLEAST8 "x"
-# define PRIxLEAST16 "x"
-# define PRIxLEAST32 "x"
-# define PRIxLEAST64 __PRI64_PREFIX "x"
-
-# define PRIxFAST8 "x"
-# define PRIxFAST16 "x"
-# define PRIxFAST32 "x"
-# define PRIxFAST64 __PRI64_PREFIX "x"
-
-/* UPPERCASE hexadecimal notation. */
-# define PRIX8 "X"
-# define PRIX16 "X"
-# define PRIX32 "X"
-# define PRIX64 __PRI64_PREFIX "X"
-
-# define PRIXLEAST8 "X"
-# define PRIXLEAST16 "X"
-# define PRIXLEAST32 "X"
-# define PRIXLEAST64 __PRI64_PREFIX "X"
-
-# define PRIXFAST8 "X"
-# define PRIXFAST16 "X"
-# define PRIXFAST32 "X"
-# define PRIXFAST64 __PRI64_PREFIX "X"
-
-
-/* Macros for printing `intmax_t' and `uintmax_t'. */
-# define PRIdMAX __PRI64_PREFIX "d"
-# define PRIiMAX __PRI64_PREFIX "i"
-# define PRIoMAX __PRI64_PREFIX "o"
-# define PRIuMAX __PRI64_PREFIX "u"
-# define PRIxMAX __PRI64_PREFIX "x"
-# define PRIXMAX __PRI64_PREFIX "X"
-
-
-/* Macros for printing `intptr_t' and `uintptr_t'. */
-# define PRIdPTR __PRIPTR_PREFIX "d"
-# define PRIiPTR __PRIPTR_PREFIX "i"
-# define PRIoPTR __PRIPTR_PREFIX "o"
-# define PRIuPTR __PRIPTR_PREFIX "u"
-# define PRIxPTR __PRIPTR_PREFIX "x"
-# define PRIXPTR __PRIPTR_PREFIX "X"
-
-
-/* Macros for scanning format specifiers. */
-
-/* Signed decimal notation. */
-# define SCNd8 "hhd"
-# define SCNd16 "hd"
-# define SCNd32 "d"
-# define SCNd64 __PRI64_PREFIX "d"
-
-# define SCNdLEAST8 "hhd"
-# define SCNdLEAST16 "hd"
-# define SCNdLEAST32 "d"
-# define SCNdLEAST64 __PRI64_PREFIX "d"
-
-# define SCNdFAST8 "hhd"
-# define SCNdFAST16 __PRIPTR_PREFIX "d"
-# define SCNdFAST32 __PRIPTR_PREFIX "d"
-# define SCNdFAST64 __PRI64_PREFIX "d"
-
-/* Signed decimal notation. */
-# define SCNi8 "hhi"
-# define SCNi16 "hi"
-# define SCNi32 "i"
-# define SCNi64 __PRI64_PREFIX "i"
-
-# define SCNiLEAST8 "hhi"
-# define SCNiLEAST16 "hi"
-# define SCNiLEAST32 "i"
-# define SCNiLEAST64 __PRI64_PREFIX "i"
-
-# define SCNiFAST8 "hhi"
-# define SCNiFAST16 __PRIPTR_PREFIX "i"
-# define SCNiFAST32 __PRIPTR_PREFIX "i"
-# define SCNiFAST64 __PRI64_PREFIX "i"
-
-/* Unsigned decimal notation. */
-# define SCNu8 "hhu"
-# define SCNu16 "hu"
-# define SCNu32 "u"
-# define SCNu64 __PRI64_PREFIX "u"
-
-# define SCNuLEAST8 "hhu"
-# define SCNuLEAST16 "hu"
-# define SCNuLEAST32 "u"
-# define SCNuLEAST64 __PRI64_PREFIX "u"
-
-# define SCNuFAST8 "hhu"
-# define SCNuFAST16 __PRIPTR_PREFIX "u"
-# define SCNuFAST32 __PRIPTR_PREFIX "u"
-# define SCNuFAST64 __PRI64_PREFIX "u"
-
-/* Octal notation. */
-# define SCNo8 "hho"
-# define SCNo16 "ho"
-# define SCNo32 "o"
-# define SCNo64 __PRI64_PREFIX "o"
-
-# define SCNoLEAST8 "hho"
-# define SCNoLEAST16 "ho"
-# define SCNoLEAST32 "o"
-# define SCNoLEAST64 __PRI64_PREFIX "o"
-
-# define SCNoFAST8 "hho"
-# define SCNoFAST16 __PRIPTR_PREFIX "o"
-# define SCNoFAST32 __PRIPTR_PREFIX "o"
-# define SCNoFAST64 __PRI64_PREFIX "o"
-
-/* Hexadecimal notation. */
-# define SCNx8 "hhx"
-# define SCNx16 "hx"
-# define SCNx32 "x"
-# define SCNx64 __PRI64_PREFIX "x"
-
-# define SCNxLEAST8 "hhx"
-# define SCNxLEAST16 "hx"
-# define SCNxLEAST32 "x"
-# define SCNxLEAST64 __PRI64_PREFIX "x"
-
-# define SCNxFAST8 "hhx"
-# define SCNxFAST16 __PRIPTR_PREFIX "x"
-# define SCNxFAST32 __PRIPTR_PREFIX "x"
-# define SCNxFAST64 __PRI64_PREFIX "x"
-
-
-/* Macros for scanning `intmax_t' and `uintmax_t'. */
-# define SCNdMAX __PRI64_PREFIX "d"
-# define SCNiMAX __PRI64_PREFIX "i"
-# define SCNoMAX __PRI64_PREFIX "o"
-# define SCNuMAX __PRI64_PREFIX "u"
-# define SCNxMAX __PRI64_PREFIX "x"
-
-/* Macros for scanning `intptr_t' and `uintptr_t'. */
-# define SCNdPTR __PRIPTR_PREFIX "d"
-# define SCNiPTR __PRIPTR_PREFIX "i"
-# define SCNoPTR __PRIPTR_PREFIX "o"
-# define SCNuPTR __PRIPTR_PREFIX "u"
-# define SCNxPTR __PRIPTR_PREFIX "x"
-
-typedef signed char int8_t;
-typedef signed short int16_t;
-typedef signed int int32_t;
-
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-
-typedef signed long int intptr_t;
-typedef unsigned long int uintptr_t;
-
-#ifndef __STRICT_ANSI__
-__extension__ typedef signed long long int64_t;
-__extension__ typedef unsigned long long uint64_t;
-__extension__ typedef signed long long int intmax_t;
-__extension__ typedef unsigned long long int uintmax_t;
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/libgen.h b/mdk-stage1/dietlibc/include/libgen.h
deleted file mode 100644
index ab13b0a30..000000000
--- a/mdk-stage1/dietlibc/include/libgen.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _LIBGEN_H
-#define _LIBGEN_H
-
-#include <sys/cdefs.h>
-
-char *dirname(char *path) __THROW;
-char *basename(char *path) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/libintl.h b/mdk-stage1/dietlibc/include/libintl.h
deleted file mode 100644
index 20873f55f..000000000
--- a/mdk-stage1/dietlibc/include/libintl.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _LIBINTL_H
-#define _LIBINTL_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <locale.h>
-
-#define gettext(msgid) dgettext(0,msgid)
-#define dgettext(domainname,msgid) dcgettext(domainname,msgid,LC_MESSAGES)
-
-#define ngettext(msgid1,msgid2,n) dngettext(0,msgid1,msgid2,n)
-#define dngettext(dn,msgid1,msgid2,n) dngettext(dn,msgid1,msgid2,n,LC_MESSAGES)
-
-char* dcgettext(const char *domainname, const char *msgid, int category) __THROW;
-char* dcngettext(const char *domainname,
- const char *msgid1, const char *msgid2,
- unsigned long int n, int __category) __THROW;
-
-char* textdomain(const char *domainname) __THROW;
-char* bindtextdomain(const char *domainname, const char *dirname) __THROW;
-char* bind_textdomain_codeset(const char *domainname, const char *codeset) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/limits.h b/mdk-stage1/dietlibc/include/limits.h
deleted file mode 100644
index b5577a0bf..000000000
--- a/mdk-stage1/dietlibc/include/limits.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef _LIMITS_H
-#define _LIMITS_H
-
-#include <endian.h>
-
-#define CHAR_BIT 8
-
-#define SCHAR_MIN (-128)
-#define SCHAR_MAX 0x7f
-#define UCHAR_MAX 0xff
-
-#ifdef __CHAR_UNSIGNED__
-#undef CHAR_MIN
-#define CHAR_MIN 0
-#undef CHAR_MAX
-#define CHAR_MAX UCHAR_MAX
-#else
-#undef CHAR_MIN
-#define CHAR_MIN SCHAR_MIN
-#undef CHAR_MAX
-#define CHAR_MAX SCHAR_MAX
-#endif
-
-#define SHRT_MIN (-SHRT_MAX-1)
-#define SHRT_MAX 0x7fff
-#define USHRT_MAX 0xffff
-
-#define INT_MIN (-INT_MAX-1)
-#define INT_MAX 0x7fffffff
-#define UINT_MAX 0xffffffff
-
-#if __WORDSIZE == 64
-#define LONG_MAX 9223372036854775807L
-#define ULONG_MAX 18446744073709551615UL
-#else
-#define LONG_MAX 2147483647L
-#define ULONG_MAX 4294967295UL
-#endif
-#define LONG_MIN (-LONG_MAX - 1L)
-
-#define LLONG_MAX 9223372036854775807LL
-#define LLONG_MIN (-LLONG_MAX - 1LL)
-
-/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
-#define ULLONG_MAX 18446744073709551615ULL
-
-#define SSIZE_MIN LONG_MIN
-#define SSIZE_MAX LONG_MAX
-
-#define PASS_MAX 256
-
-#define NR_OPEN 1024
-
-#define NGROUPS_MAX 32 /* supplemental group IDs are available */
-#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
-#define CHILD_MAX 999 /* no limit :-) */
-#define OPEN_MAX 256 /* # open files a process may have */
-#define LINK_MAX 127 /* # links a file may have */
-#define MAX_CANON 255 /* size of the canonical input queue */
-#define MAX_INPUT 255 /* size of the type-ahead buffer */
-#define NAME_MAX 255 /* # chars in a file name */
-#define PATH_MAX 4095 /* # chars in a path name */
-#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
-
-#define RTSIG_MAX 32
-
-#define LINE_MAX 2048
-
-/* mutt demanded these */
-#define _POSIX_PATH_MAX PATH_MAX
-#define MB_LEN_MAX 16
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/linux/eventpoll.h b/mdk-stage1/dietlibc/include/linux/eventpoll.h
deleted file mode 100644
index 19990ac2a..000000000
--- a/mdk-stage1/dietlibc/include/linux/eventpoll.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _LINUX_EVENTPOLL_H
-#define _LINUX_EVENTPOLL_H
-
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/shm.h>
-
-#define POLLFD_X_PAGE (PAGE_SIZE / sizeof(struct pollfd))
-#define EP_FDS_PAGES(n) (((n) + POLLFD_X_PAGE - 1) / POLLFD_X_PAGE)
-#define EP_MAP_SIZE(n) (EP_FDS_PAGES(n) * PAGE_SIZE * 2)
-
-struct evpoll {
- int ep_timeout;
- unsigned long ep_resoff;
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/linux/if_ether.h b/mdk-stage1/dietlibc/include/linux/if_ether.h
deleted file mode 100644
index dbeb3728e..000000000
--- a/mdk-stage1/dietlibc/include/linux/if_ether.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * INET An implementation of the TCP/IP protocol suite for the LINUX
- * operating system. INET is implemented using the BSD Socket
- * interface as the means of communication with the user level.
- *
- * Global definitions for the Ethernet IEEE 802.3 interface.
- *
- * Version: @(#)if_ether.h 1.0.1a 02/08/94
- *
- * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
- * Donald Becker, <becker@super.org>
- * Alan Cox, <alan@redhat.com>
- * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
- *
- * 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.
- */
-
-#ifndef _LINUX_IF_ETHER_H
-#define _LINUX_IF_ETHER_H
-
-/*
- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
- * and FCS/CRC (frame check sequence).
- */
-
-#define ETH_ALEN 6 /* Octets in one ethernet addr */
-#define ETH_HLEN 14 /* Total octets in header. */
-#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
-#define ETH_DATA_LEN 1500 /* Max. octets in payload */
-#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
-
-/*
- * These are the defined Ethernet Protocol ID's.
- */
-
-#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
-#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
-#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
-#define ETH_P_IP 0x0800 /* Internet Protocol packet */
-#define ETH_P_X25 0x0805 /* CCITT X.25 */
-#define ETH_P_ARP 0x0806 /* Address Resolution packet */
-#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
-#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
-#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
-#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
-#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
-#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
-#define ETH_P_LAT 0x6004 /* DEC LAT */
-#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
-#define ETH_P_CUST 0x6006 /* DEC Customer use */
-#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
-#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
-#define ETH_P_ATALK 0x809B /* Appletalk DDP */
-#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
-#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
-#define ETH_P_IPX 0x8137 /* IPX over DIX */
-#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
-#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
-#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
-#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
-#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
- * over Ethernet
- */
-
-/*
- * Non DIX types. Won't clash for 1500 types.
- */
-
-#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
-#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
-#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
-#define ETH_P_802_2 0x0004 /* 802.2 frames */
-#define ETH_P_SNAP 0x0005 /* Internal only */
-#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
-#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
-#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
-#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
-#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
-#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
-#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
-#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
-#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
-#define ETH_P_ECONET 0x0018 /* Acorn Econet */
-#define ETH_P_HDLC 0x0019 /* HDLC frames */
-
-/*
- * This is an Ethernet frame header.
- */
-
-struct ethhdr
-{
- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
- unsigned char h_source[ETH_ALEN]; /* source ether addr */
- unsigned short h_proto; /* packet type ID field */
-};
-
-#endif /* _LINUX_IF_ETHER_H */
diff --git a/mdk-stage1/dietlibc/include/linux/loop.h b/mdk-stage1/dietlibc/include/linux/loop.h
deleted file mode 100644
index 1366f1877..000000000
--- a/mdk-stage1/dietlibc/include/linux/loop.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _LINUX_LOOP_H
-#define _LINUX_LOOP_H
-
-/* stolen form kernel */
-
-#define LO_NAME_SIZE 64
-#define LO_KEY_SIZE 32
-
-/* Loop flags */
-#define LO_FLAGS_DO_BMAP 1
-#define LO_FLAGS_READ_ONLY 2
-#define LO_FLAGS_BH_REMAP 4
-
-struct loop_info {
- int lo_number; /* ioctl r/o */
- dev_t lo_device; /* ioctl r/o */
- unsigned long lo_inode; /* ioctl r/o */
- dev_t lo_rdevice; /* ioctl r/o */
- int lo_offset;
- int lo_encrypt_type;
- int lo_encrypt_key_size; /* ioctl w/o */
- int lo_flags; /* ioctl r/o */
- char lo_name[LO_NAME_SIZE];
- unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
- unsigned long lo_init[2];
- char reserved[4];
-};
-
-/* Loop filter types */
-#define LO_CRYPT_NONE 0
-#define LO_CRYPT_XOR 1
-#define LO_CRYPT_DES 2
-#define LO_CRYPT_FISH2 3 /* Brand new Twofish encryption */
-#define LO_CRYPT_BLOW 4
-#define LO_CRYPT_CAST128 5
-#define LO_CRYPT_IDEA 6
-#define LO_CRYPT_DUMMY 9
-#define LO_CRYPT_SKIPJACK 10
-#define MAX_LO_CRYPT 20
-
-/* IOCTL commands --- we will commandeer 0x4C ('L') */
-#define LOOP_SET_FD 0x4C00
-#define LOOP_CLR_FD 0x4C01
-#define LOOP_SET_STATUS 0x4C02
-#define LOOP_GET_STATUS 0x4C03
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/linux/nfs.h b/mdk-stage1/dietlibc/include/linux/nfs.h
deleted file mode 100644
index 9be6db37e..000000000
--- a/mdk-stage1/dietlibc/include/linux/nfs.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * NFS protocol definitions
- *
- * This file contains constants mostly for Version 2 of the protocol,
- * but also has a couple of NFSv3 bits in (notably the error codes).
- */
-#ifndef _LINUX_NFS_H
-#define _LINUX_NFS_H
-
-#define NFS_PROGRAM 100003
-#define NFS_PORT 2049
-#define NFS_MAXDATA 8192
-#define NFS_MAXPATHLEN 1024
-#define NFS_MAXNAMLEN 255
-#define NFS_MAXGROUPS 16
-#define NFS_FHSIZE 32
-#define NFS_COOKIESIZE 4
-#define NFS_FIFO_DEV (-1)
-#define NFSMODE_FMT 0170000
-#define NFSMODE_DIR 0040000
-#define NFSMODE_CHR 0020000
-#define NFSMODE_BLK 0060000
-#define NFSMODE_REG 0100000
-#define NFSMODE_LNK 0120000
-#define NFSMODE_SOCK 0140000
-#define NFSMODE_FIFO 0010000
-
-#define NFS_MNT_PROGRAM 100005
-#define NFS_MNT_PORT 627
-
-/*
- * NFS stats. The good thing with these values is that NFSv3 errors are
- * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
- * no-one uses anyway), so we can happily mix code as long as we make sure
- * no NFSv3 errors are returned to NFSv2 clients.
- * Error codes that have a `--' in the v2 column are not part of the
- * standard, but seem to be widely used nevertheless.
- */
- enum nfs_stat {
- NFS_OK = 0, /* v2 v3 */
- NFSERR_PERM = 1, /* v2 v3 */
- NFSERR_NOENT = 2, /* v2 v3 */
- NFSERR_IO = 5, /* v2 v3 */
- NFSERR_NXIO = 6, /* v2 v3 */
- NFSERR_EAGAIN = 11, /* v2 v3 */
- NFSERR_ACCES = 13, /* v2 v3 */
- NFSERR_EXIST = 17, /* v2 v3 */
- NFSERR_XDEV = 18, /* v3 */
- NFSERR_NODEV = 19, /* v2 v3 */
- NFSERR_NOTDIR = 20, /* v2 v3 */
- NFSERR_ISDIR = 21, /* v2 v3 */
- NFSERR_INVAL = 22, /* v2 v3 that Sun forgot */
- NFSERR_FBIG = 27, /* v2 v3 */
- NFSERR_NOSPC = 28, /* v2 v3 */
- NFSERR_ROFS = 30, /* v2 v3 */
- NFSERR_MLINK = 31, /* v3 */
- NFSERR_OPNOTSUPP = 45, /* v2 v3 */
- NFSERR_NAMETOOLONG = 63, /* v2 v3 */
- NFSERR_NOTEMPTY = 66, /* v2 v3 */
- NFSERR_DQUOT = 69, /* v2 v3 */
- NFSERR_STALE = 70, /* v2 v3 */
- NFSERR_REMOTE = 71, /* v2 v3 */
- NFSERR_WFLUSH = 99, /* v2 */
- NFSERR_BADHANDLE = 10001, /* v3 */
- NFSERR_NOT_SYNC = 10002, /* v3 */
- NFSERR_BAD_COOKIE = 10003, /* v3 */
- NFSERR_NOTSUPP = 10004, /* v3 */
- NFSERR_TOOSMALL = 10005, /* v3 */
- NFSERR_SERVERFAULT = 10006, /* v3 */
- NFSERR_BADTYPE = 10007, /* v3 */
- NFSERR_JUKEBOX = 10008 /* v3 */
- };
-
-/* NFSv2 file types - beware, these are not the same in NFSv3 */
-
-enum nfs_ftype {
- NFNON = 0,
- NFREG = 1,
- NFDIR = 2,
- NFBLK = 3,
- NFCHR = 4,
- NFLNK = 5,
- NFSOCK = 6,
- NFBAD = 7,
- NFFIFO = 8
-};
-
-#endif /* _LINUX_NFS_H */
diff --git a/mdk-stage1/dietlibc/include/linux/posix_types.h b/mdk-stage1/dietlibc/include/linux/posix_types.h
deleted file mode 100644
index 0d494a1f6..000000000
--- a/mdk-stage1/dietlibc/include/linux/posix_types.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef _LINUX_POSIX_TYPES_H
-#define _LINUX_POSIX_TYPES_H
-
-/*
- * This allows for 1024 file descriptors: if NR_OPEN is ever grown
- * beyond that you'll have to change this too. But 1024 fd's seem to be
- * enough even for such "real" unices like OSF/1, so hopefully this is
- * one limit that doesn't have to be changed [again].
- *
- * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
- * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
- * place for them. Solved by having dummy defines in <sys/time.h>.
- */
-
-/*
- * Those macros may have been defined in <gnu/types.h>. But we always
- * use the ones here.
- */
-#undef __NFDBITS
-#define __NFDBITS (8 * sizeof(unsigned long))
-
-#undef __FD_SETSIZE
-#define __FD_SETSIZE 1024
-
-#undef __FDSET_LONGS
-#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
-
-#undef __FDELT
-#define __FDELT(d) ((d) / __NFDBITS)
-
-#undef __FDMASK
-#define __FDMASK(d) (1UL << ((d) % __NFDBITS))
-
-typedef struct {
- unsigned long fds_bits [__FDSET_LONGS];
-} __kernel_fd_set;
-
-#ifndef __KERNEL_STRICT_NAMES
-typedef __kernel_fd_set fd_set;
-#endif
-
-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
-
-#undef __FD_SET
-static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
-{
- unsigned long _tmp = fd / __NFDBITS;
- unsigned long _rem = fd % __NFDBITS;
- fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
-}
-
-#undef __FD_CLR
-static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
-{
- unsigned long _tmp = fd / __NFDBITS;
- unsigned long _rem = fd % __NFDBITS;
- fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
-}
-
-#undef __FD_ISSET
-static __inline__ int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
-{
- unsigned long _tmp = fd / __NFDBITS;
- unsigned long _rem = fd % __NFDBITS;
- return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
-}
-
-/*
- * This will unroll the loop for the normal constant cases (8 or 32 longs,
- * for 256 and 1024-bit fd_sets respectively)
- */
-#undef __FD_ZERO
-static __inline__ void __FD_ZERO(__kernel_fd_set *p)
-{
- unsigned long *tmp = p->fds_bits;
- int i;
-
- if (__builtin_constant_p(__FDSET_LONGS)) {
- switch (__FDSET_LONGS) {
- case 32:
- tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
- tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
- tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
- tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
- tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
- tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
- tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
- tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
- return;
- case 16:
- tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
- tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
- tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
- tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
- return;
- case 8:
- tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
- tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
- return;
- case 4:
- tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
- return;
- }
- }
- i = __FDSET_LONGS;
- while (i) {
- i--;
- *tmp = 0;
- tmp++;
- }
-}
-
-#endif /* defined(__KERNEL__) */
-
-#endif /* _LINUX_POSIX_TYPES_H */
diff --git a/mdk-stage1/dietlibc/include/linux/types.h b/mdk-stage1/dietlibc/include/linux/types.h
deleted file mode 100644
index 1cd33bd41..000000000
--- a/mdk-stage1/dietlibc/include/linux/types.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _LINUX_TYPES_H
-#define _LINUX_TYPES_H
-
-#include <asm/types.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/locale.h b/mdk-stage1/dietlibc/include/locale.h
deleted file mode 100644
index 5cd002019..000000000
--- a/mdk-stage1/dietlibc/include/locale.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef _LOCALE_H
-#define _LOCALE_H
-
-#include <sys/cdefs.h>
-
-enum {
- LC_CTYPE = 0,
- LC_NUMERIC = 1,
- LC_TIME = 2,
- LC_COLLATE = 3,
- LC_MONETARY = 4,
- LC_MESSAGES = 5,
- LC_ALL = 6,
- LC_PAPER = 7,
- LC_NAME = 8,
- LC_ADDRESS = 9,
- LC_TELEPHONE = 10,
- LC_MEASUREMENT = 11,
- LC_IDENTIFICATION = 12
-};
-
-/* Structure giving information about numeric and monetary notation. */
-struct lconv {
- /* Numeric (non-monetary) information. */
- char *decimal_point;
- char *thousands_sep;
- /* Each element is the number of digits in each group;
- elements with higher indices are farther left.
- An element with value CHAR_MAX means that no further grouping is done.
- An element with value 0 means that the previous element is used
- for all groups farther left. */
- char *grouping;
-
- /* Monetary information. */
-
- /* First three chars are a currency symbol from ISO 4217.
- Fourth char is the separator. Fifth char is '\0'. */
- char *int_curr_symbol;
- char *currency_symbol; /* Local currency symbol. */
- char *mon_decimal_point; /* Decimal point character. */
- char *mon_thousands_sep; /* Thousands separator. */
- char *mon_grouping; /* Like `grouping' element (above). */
- char *positive_sign; /* Sign for positive values. */
- char *negative_sign; /* Sign for negative values. */
- char int_frac_digits; /* Int'l fractional digits. */
- char frac_digits; /* Local fractional digits. */
- /* 1 if currency_symbol precedes a positive value, 0 if succeeds. */
- char p_cs_precedes;
- /* 1 iff a space separates currency_symbol from a positive value. */
- char p_sep_by_space;
- /* 1 if currency_symbol precedes a negative value, 0 if succeeds. */
- char n_cs_precedes;
- /* 1 iff a space separates currency_symbol from a negative value. */
- char n_sep_by_space;
- /* Positive and negative sign positions:
- 0 Parentheses surround the quantity and currency_symbol.
- 1 The sign string precedes the quantity and currency_symbol.
- 2 The sign string follows the quantity and currency_symbol.
- 3 The sign string immediately precedes the currency_symbol.
- 4 The sign string immediately follows the currency_symbol. */
- char p_sign_posn;
- char n_sign_posn;
- /* 1 if int_curr_symbol precedes a positive value, 0 if succeeds. */
- char int_p_cs_precedes;
- /* 1 iff a space separates int_curr_symbol from a positive value. */
- char int_p_sep_by_space;
- /* 1 if int_curr_symbol precedes a negative value, 0 if succeeds. */
- char int_n_cs_precedes;
- /* 1 iff a space separates int_curr_symbol from a negative value. */
- char int_n_sep_by_space;
- /* Positive and negative sign positions:
- 0 Parentheses surround the quantity and int_curr_symbol.
- 1 The sign string precedes the quantity and int_curr_symbol.
- 2 The sign string follows the quantity and int_curr_symbol.
- 3 The sign string immediately precedes the int_curr_symbol.
- 4 The sign string immediately follows the int_curr_symbol. */
- char int_p_sign_posn;
- char int_n_sign_posn;
-};
-
-char *setlocale (int category, const char *locale) __THROW;
-struct lconv *localeconv (void) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/malloc.h b/mdk-stage1/dietlibc/include/malloc.h
deleted file mode 100644
index c8b49f26d..000000000
--- a/mdk-stage1/dietlibc/include/malloc.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdlib.h>
diff --git a/mdk-stage1/dietlibc/include/math.h b/mdk-stage1/dietlibc/include/math.h
deleted file mode 100644
index 2cb545237..000000000
--- a/mdk-stage1/dietlibc/include/math.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef _MATH_H
-#define _MATH_H
-
-#include <sys/cdefs.h>
-
-#define M_E 2.7182818284590452354 /* e */
-#define M_LOG2E 1.4426950408889634074 /* log_2 e */
-#define M_LOG10E 0.43429448190325182765 /* log_10 e */
-#define M_LN2 0.69314718055994530942 /* log_e 2 */
-#define M_LN10 2.30258509299404568402 /* log_e 10 */
-#define M_PI 3.14159265358979323846 /* pi */
-#define M_PI_2 1.57079632679489661923 /* pi/2 */
-#define M_PI_4 0.78539816339744830962 /* pi/4 */
-#define M_1_PI 0.31830988618379067154 /* 1/pi */
-#define M_2_PI 0.63661977236758134308 /* 2/pi */
-#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
-#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
-#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-
-#define M_El 2.7182818284590452353602874713526625L /* e */
-#define M_LOG2El 1.4426950408889634073599246810018922L /* log_2 e */
-#define M_LOG10El 0.4342944819032518276511289189166051L /* log_10 e */
-#define M_LN2l 0.6931471805599453094172321214581766L /* log_e 2 */
-#define M_LN10l 2.3025850929940456840179914546843642L /* log_e 10 */
-#define M_PIl 3.1415926535897932384626433832795029L /* pi */
-#define M_PI_2l 1.5707963267948966192313216916397514L /* pi/2 */
-#define M_PI_4l 0.7853981633974483096156608458198757L /* pi/4 */
-#define M_1_PIl 0.3183098861837906715377675267450287L /* 1/pi */
-#define M_2_PIl 0.6366197723675813430755350534900574L /* 2/pi */
-#define M_2_SQRTPIl 1.1283791670955125738961589031215452L /* 2/sqrt(pi) */
-#define M_SQRT2l 1.4142135623730950488016887242096981L /* sqrt(2) */
-#define M_SQRT1_2l 0.7071067811865475244008443621048490L /* 1/sqrt(2) */
-
-double sin(double d) __THROW __attribute__((__const__));
-double cos(double d) __THROW __attribute__((__const__));
-double tan(double d) __THROW __attribute__((__const__));
-
-double sinh(double d) __THROW __attribute__((__const__));
-double cosh(double d) __THROW __attribute__((__const__));
-double tanh(double d) __THROW __attribute__((__const__));
-
-double asin(double d) __THROW __attribute__((__const__));
-double acos(double d) __THROW __attribute__((__const__));
-double atan(double d) __THROW __attribute__((__const__));
-
-double asinh(double d) __THROW __attribute__((__const__));
-double acosh(double d) __THROW __attribute__((__const__));
-double atanh(double d) __THROW __attribute__((__const__));
-
-double exp(double d) __THROW __attribute__((__const__));
-double exp10(double d) __THROW __attribute__((__const__));
-double log(double d) __THROW __attribute__((__const__));
-double log10(double d) __THROW __attribute__((__const__));
-
-double pow(double x, double y) __THROW __attribute__((__const__));
-
-double sqrt(double x) __THROW __attribute__((__const__));
-double fabs(double x) __THROW __attribute__((__const__));
-double fmod(double x, double y) __THROW __attribute__((__const__));
-
-double floor(double x) __attribute__((__const__));
-double ceil(double x) __attribute__((__const__));
-
-double expm1(double x) __THROW __attribute__((__const__));
-double hypot(double x, double y) __THROW __attribute__((__const__));
-double atan2(double x, double y) __THROW __attribute__((__const__));
-
-double copysign(double value, double sign) __attribute__((__const__));
-
-# define HUGE_VAL \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \
- { __l: 0x000000007ff00000ULL }).__d)
-
-#ifdef _GNU_SOURCE
-void sincos(double x, double* sinx, double* cosx);
-double ipow (double mant, int expo);
-#endif
-
-int isnan(double d) __attribute__((__const__));
-int isinf(double d) __attribute__((__const__));
-int finite(double d) __attribute__((__const__));
-
-double j0(double x);
-double j1(double x);
-double jn(int n, double x);
-double y0(double x);
-double y1(double x);
-double yn(int n, double x);
-double erf(double x);
-double erfc(double x);
-double lgamma(double x);
-
-double rint(double x);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/md5.h b/mdk-stage1/dietlibc/include/md5.h
deleted file mode 100644
index 7cbc0e8f3..000000000
--- a/mdk-stage1/dietlibc/include/md5.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
- rights reserved.
-
- License to copy and use this software is granted provided that it
- is identified as the "RSA Data Security, Inc. MD5 Message-Digest
- Algorithm" in all material mentioning or referencing this software
- or this function.
-
- License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
- RSA Data Security, Inc. makes no representations concerning either
- the merchantability of this software or the suitability of this
- software for any particular purpose. It is provided "as is"
- without express or implied warranty of any kind.
- These notices must be retained in any copies of any part of this
- documentation and/or software.
-*/
-
-#ifndef _MD5_H
-#define _MD5_H
-
-#include <sys/types.h>
-
-/*
- Define the MD5 context structure.
- Please DO NOT change the order or contents of the structure as
- various assembler files depend on it !!
-*/
-typedef struct
-{
- uint32_t state[4]; /* state (ABCD) */
- uint32_t count[2]; /* number of bits, modulo 2^64 (least sig word first) */
- uint8_t buffer[64]; /* input buffer for incomplete buffer data */
-}
-MD5_CTX;
-
-void MD5Init (MD5_CTX* ctx);
-void MD5Update (MD5_CTX* ctx, const uint8_t* buf, size_t len);
-void MD5Final (uint8_t digest[16], MD5_CTX* ctx);
-
-char* md5crypt (const char* pw, const char* salt);
-
-#endif
-
diff --git a/mdk-stage1/dietlibc/include/memory.h b/mdk-stage1/dietlibc/include/memory.h
deleted file mode 100644
index 39adee705..000000000
--- a/mdk-stage1/dietlibc/include/memory.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _MEMORY_H
-#define _MEMORY_H
-
-#include <string.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/mntent.h b/mdk-stage1/dietlibc/include/mntent.h
deleted file mode 100644
index 301403224..000000000
--- a/mdk-stage1/dietlibc/include/mntent.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef _MNTENT_H
-#define _MNTENT_H
-
-#include <sys/cdefs.h>
-#include <stdio.h>
-#include <paths.h>
-
-#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
-#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
-
-/* General filesystem types. */
-#define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */
-#define MNTTYPE_NFS "nfs" /* Network file system. */
-#define MNTTYPE_SWAP "swap" /* Swap device. */
-
-
-/* Generic mount options. */
-#define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
-#define MNTOPT_RO "ro" /* Read only. */
-#define MNTOPT_RW "rw" /* Read/write. */
-#define MNTOPT_SUID "suid" /* Set uid allowed. */
-#define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
-#define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
-
-__BEGIN_DECLS
-
-/* Structure describing a mount table entry. */
-struct mntent
- {
- char *mnt_fsname; /* Device or server for filesystem. */
- char *mnt_dir; /* Directory mounted on. */
- char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */
- char *mnt_opts; /* Comma-separated options for fs. */
- int mnt_freq; /* Dump frequency (in days). */
- int mnt_passno; /* Pass number for `fsck'. */
- };
-
-
-/* Prepare to begin reading and/or writing mount table entries from the
- beginning of FILE. MODE is as for `fopen'. */
-extern FILE *setmntent (const char *file, const char *mode) __THROW;
-
-/* Read one mount table entry from STREAM. Returns a pointer to storage
- reused on the next call, or null for EOF or error (use feof/ferror to
- check). */
-extern struct mntent *getmntent (FILE* stream) __THROW;
-
-#ifdef __USE_MISC
-/* Reentrant version of the above function. */
-extern struct mntent *getmntent_r (FILE* stream,
- struct mntent* result,
- char* buffer,
- int bufsize) __THROW;
-#endif
-
-/* Write the mount table entry described by MNT to STREAM.
- Return zero on success, nonzero on failure. */
-extern int addmntent (FILE* stream,
- const struct mntent* mnt) __THROW;
-
-/* Close a stream opened with `setmntent'. */
-extern int endmntent (FILE *stream) __THROW;
-
-/* Search MNT->mnt_opts for an option matching OPT.
- Returns the address of the substring, or null if none found. */
-extern char *hasmntopt (const struct mntent *__mnt,
- const char *opt) __THROW;
-
-
-__END_DECLS
-
-#endif /* mntent.h */
diff --git a/mdk-stage1/dietlibc/include/net/ethernet.h b/mdk-stage1/dietlibc/include/net/ethernet.h
deleted file mode 100644
index 900ffd536..000000000
--- a/mdk-stage1/dietlibc/include/net/ethernet.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (C) 1997, 1999, 2001 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 Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Based on the FreeBSD version of this file. Curiously, that file
- lacks a copyright in the header. */
-
-#ifndef __NET_ETHERNET_H
-#define __NET_ETHERNET_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <linux/if_ether.h> /* IEEE 802.3 Ethernet constants */
-
-__BEGIN_DECLS
-
-/* This is a name for the 48 bit ethernet address available on many
- systems. */
-struct ether_addr
-{
- uint8_t ether_addr_octet[ETH_ALEN];
-} __attribute__ ((__packed__));
-
-/* 10Mb/s ethernet header */
-struct ether_header
-{
- uint8_t ether_dhost[ETH_ALEN]; /* destination eth addr */
- uint8_t ether_shost[ETH_ALEN]; /* source ether addr */
- uint16_t ether_type; /* packet type ID field */
-} __attribute__ ((__packed__));
-
-/* Ethernet protocol ID's */
-#define ETHERTYPE_PUP 0x0200 /* Xerox PUP */
-#define ETHERTYPE_IP 0x0800 /* IP */
-#define ETHERTYPE_ARP 0x0806 /* Address resolution */
-#define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */
-
-#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
-#define ETHER_TYPE_LEN 2 /* bytes in type field */
-#define ETHER_CRC_LEN 4 /* bytes in CRC field */
-#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
-#define ETHER_MIN_LEN (ETH_ZLEN + ETHER_CRC_LEN) /* min packet length */
-#define ETHER_MAX_LEN (ETH_FRAME_LEN + ETHER_CRC_LEN) /* max packet length */
-
-/* make sure ethenet length is valid */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-/*
- * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
- * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
- * by an ETHER type (as given above) and then the (variable-length) header.
- */
-#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
-#define ETHERTYPE_NTRAILER 16
-
-#define ETHERMTU ETH_DATA_LEN
-#define ETHERMIN (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
-
-__END_DECLS
-
-#endif /* net/ethernet.h */
diff --git a/mdk-stage1/dietlibc/include/net/if.h b/mdk-stage1/dietlibc/include/net/if.h
deleted file mode 100644
index ac4737db3..000000000
--- a/mdk-stage1/dietlibc/include/net/if.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _NET_IF_H
-#define _NET_IF_H
-
-#include <sys/cdefs.h>
-#include <sys/socket.h>
-
-/* Standard interface flags. */
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
-#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
-#define IFF_RUNNING 0x40 /* resources allocated */
-#define IFF_NOARP 0x80 /* no ARP protocol */
-#define IFF_PROMISC 0x100 /* receive all packets */
-#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
-
-#define IFF_MASTER 0x400 /* master of a load balancer */
-#define IFF_SLAVE 0x800 /* slave of a load balancer */
-
-#define IFF_MULTICAST 0x1000 /* Supports multicast */
-
-#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING)
-
-#define IFF_PORTSEL 0x2000 /* can set media type */
-#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
-#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
-
-struct ifmap {
- unsigned long mem_start;
- unsigned long mem_end;
- unsigned short base_addr;
- unsigned char irq;
- unsigned char dma;
- unsigned char port;
- /* 3 bytes spare */
-};
-
-struct ifreq {
-#define IFHWADDRLEN 6
-#define IFNAMSIZ 16
- union
- {
- char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- } ifr_ifrn;
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- struct sockaddr ifru_hwaddr;
- short ifru_flags;
- int ifru_ivalue;
- int ifru_mtu;
- struct ifmap ifru_map;
- char ifru_slave[IFNAMSIZ]; /* Just fits the size */
- char ifru_newname[IFNAMSIZ];
- char* ifru_data;
- } ifr_ifru;
-};
-
-#define ifr_name ifr_ifrn.ifrn_name /* interface name */
-#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
-#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#define ifr_map ifr_ifru.ifru_map /* device map */
-#define ifr_slave ifr_ifru.ifru_slave /* slave device */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
-#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
-#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
-#define ifr_newname ifr_ifru.ifru_newname /* New name */
-
-struct ifconf {
- int ifc_len; /* size of buffer */
- union {
- char * ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-};
-
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
-
-unsigned int if_nametoindex (const char *ifname) __THROW;
-char *if_indextoname (unsigned int ifindex, char *ifname) __THROW;
-
-struct if_nameindex {
- unsigned int if_index;
- char *if_name;
-};
-
-struct if_nameindex* if_nameindex(void) __THROW;
-void if_freenameindex(struct if_nameindex* ptr) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/net/if_arp.h b/mdk-stage1/dietlibc/include/net/if_arp.h
deleted file mode 100644
index b1054066a..000000000
--- a/mdk-stage1/dietlibc/include/net/if_arp.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef _NET_IF_ARP_H
-#define _NET_IF_ARP_H
-
-#include <sys/socket.h>
-
-#define MAX_ADDR_LEN 7
-
-/* ARP protocol HARDWARE identifiers. */
-#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
-#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
-#define ARPHRD_EETHER 2 /* Experimental Ethernet */
-#define ARPHRD_AX25 3 /* AX.25 Level 2 */
-#define ARPHRD_PRONET 4 /* PROnet token ring */
-#define ARPHRD_CHAOS 5 /* Chaosnet */
-#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
-#define ARPHRD_ARCNET 7 /* ARCnet */
-#define ARPHRD_APPLETLK 8 /* APPLEtalk */
-#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
-#define ARPHRD_ATM 19 /* ATM */
-#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
-
-/* Dummy types for non ARP hardware */
-#define ARPHRD_SLIP 256
-#define ARPHRD_CSLIP 257
-#define ARPHRD_SLIP6 258
-#define ARPHRD_CSLIP6 259
-#define ARPHRD_RSRVD 260 /* Notional KISS type */
-#define ARPHRD_ADAPT 264
-#define ARPHRD_ROSE 270
-#define ARPHRD_X25 271 /* CCITT X.25 */
-#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
-#define ARPHRD_PPP 512
-#define ARPHRD_CISCO 513 /* Cisco HDLC */
-#define ARPHRD_HDLC ARPHRD_CISCO
-#define ARPHRD_LAPB 516 /* LAPB */
-#define ARPHRD_DDCMP 517 /* Digital's DDCMP protocol */
-#define ARPHRD_RAWHDLC 518 /* Raw HDLC */
-
-#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
-#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */
-#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
-#define ARPHRD_SKIP 771 /* SKIP vif */
-#define ARPHRD_LOOPBACK 772 /* Loopback device */
-#define ARPHRD_LOCALTLK 773 /* Localtalk device */
-#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
-#define ARPHRD_BIF 775 /* AP1000 BIF */
-#define ARPHRD_SIT 776 /* sit0 device - IPv6-in-IPv4 */
-#define ARPHRD_IPDDP 777 /* IP over DDP tunneller */
-#define ARPHRD_IPGRE 778 /* GRE over IP */
-#define ARPHRD_PIMREG 779 /* PIMSM register interface */
-#define ARPHRD_HIPPI 780 /* High Performance Parallel Interface */
-#define ARPHRD_ASH 781 /* Nexus 64Mbps Ash */
-#define ARPHRD_ECONET 782 /* Acorn Econet */
-#define ARPHRD_IRDA 783 /* Linux-IrDA */
-/* ARP works differently on different FC media .. so */
-#define ARPHRD_FCPP 784 /* Point to point fibrechannel */
-#define ARPHRD_FCAL 785 /* Fibrechannel arbitrated loop */
-#define ARPHRD_FCPL 786 /* Fibrechannel public loop */
-#define ARPHRD_FCFABRIC 787 /* Fibrechannel fabric */
- /* 787->799 reserved for fibrechannel media types */
-#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
-#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
-
-#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
-
-/* ARP protocol opcodes. */
-#define ARPOP_REQUEST 1 /* ARP request */
-#define ARPOP_REPLY 2 /* ARP reply */
-#define ARPOP_RREQUEST 3 /* RARP request */
-#define ARPOP_RREPLY 4 /* RARP reply */
-#define ARPOP_InREQUEST 8 /* InARP request */
-#define ARPOP_InREPLY 9 /* InARP reply */
-#define ARPOP_NAK 10 /* (ATM)ARP NAK */
-
-
-/* ARP ioctl request. */
-struct arpreq {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
- char arp_dev[16];
-};
-
-struct arpreq_old {
- struct sockaddr arp_pa; /* protocol address */
- struct sockaddr arp_ha; /* hardware address */
- int arp_flags; /* flags */
- struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
-};
-
-/* ARP Flag values. */
-#define ATF_COM 0x02 /* completed entry (ha valid) */
-#define ATF_PERM 0x04 /* permanent entry */
-#define ATF_PUBL 0x08 /* publish entry */
-#define ATF_USETRAILERS 0x10 /* has requested trailers */
-#define ATF_NETMASK 0x20 /* want to use a netmask (only
- for proxy entries) */
-#define ATF_DONTPUB 0x40 /* don't answer this addresses */
-
-/*
- * This structure defines an ethernet arp header.
- */
-
-struct arphdr
-{
- unsigned short ar_hrd; /* format of hardware address */
- unsigned short ar_pro; /* format of protocol address */
- unsigned char ar_hln; /* length of hardware address */
- unsigned char ar_pln; /* length of protocol address */
- unsigned short ar_op; /* ARP opcode (command) */
-};
-#endif
diff --git a/mdk-stage1/dietlibc/include/net/if_ether.h b/mdk-stage1/dietlibc/include/net/if_ether.h
deleted file mode 100644
index 7451a6dc6..000000000
--- a/mdk-stage1/dietlibc/include/net/if_ether.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef _NET_IF_ETHER_H
-#define _NET_IF_ETHER_H
-
-/* taken from <linux/if_ether.h> */
-
-#define ETH_ALEN 6 /* Octets in one ethernet addr */
-#define ETH_HLEN 14 /* Total octets in header. */
-#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
-#define ETH_DATA_LEN 1500 /* Max. octets in payload */
-#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
-
-/*
- * These are the defined Ethernet Protocol ID's.
- */
-
-#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
-#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
-#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
-#define ETH_P_IP 0x0800 /* Internet Protocol packet */
-#define ETH_P_X25 0x0805 /* CCITT X.25 */
-#define ETH_P_ARP 0x0806 /* Address Resolution packet */
-#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
-#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
-#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
-#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
-#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
-#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
-#define ETH_P_LAT 0x6004 /* DEC LAT */
-#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
-#define ETH_P_CUST 0x6006 /* DEC Customer use */
-#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
-#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
-#define ETH_P_ATALK 0x809B /* Appletalk DDP */
-#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
-#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
-#define ETH_P_IPX 0x8137 /* IPX over DIX */
-#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
-#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
-#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
-#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
-#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport over Ethernet */
-
-/*
- * Non DIX types. Won't clash for 1500 types.
- */
-
-#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
-#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
-#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
-#define ETH_P_802_2 0x0004 /* 802.2 frames */
-#define ETH_P_SNAP 0x0005 /* Internal only */
-#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
-#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
-#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
-#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
-#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
-#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
-#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
-#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
-#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
-#define ETH_P_ECONET 0x0018 /* Acorn Econet */
-
-/*
- * This is an Ethernet frame header.
- */
-
-struct ethhdr {
- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
- unsigned char h_source[ETH_ALEN]; /* source ether addr */
- unsigned short h_proto; /* packet type ID field */
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/net/route.h b/mdk-stage1/dietlibc/include/net/route.h
deleted file mode 100644
index 383bb8370..000000000
--- a/mdk-stage1/dietlibc/include/net/route.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _NET_ROUTE_H
-#define _NET_ROUTE_H
-
-#include <inttypes.h>
-#include <netinet/in.h>
-
-/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
-struct rtentry {
- unsigned long rt_pad1;
- struct sockaddr rt_dst; /* target address */
- struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */
- struct sockaddr rt_genmask; /* target network mask (IP) */
- unsigned short rt_flags;
- short rt_pad2;
- unsigned long rt_pad3;
- void *rt_pad4;
- short rt_metric; /* +1 for binary compatibility! */
- char *rt_dev; /* forcing the device at add */
- unsigned long rt_mtu; /* per route MTU/Window */
-#ifndef __KERNEL__
-#define rt_mss rt_mtu /* Compatibility :-( */
-#endif
- unsigned long rt_window; /* Window clamping */
- unsigned short rt_irtt; /* Initial RTT */
-};
-
-#define RTF_UP 0x0001 /* route usable */
-#define RTF_GATEWAY 0x0002 /* destination is a gateway */
-#define RTF_HOST 0x0004 /* host entry (net otherwise) */
-#define RTF_REINSTATE 0x0008 /* reinstate route after tmout */
-#define RTF_DYNAMIC 0x0010 /* created dyn. (by redirect) */
-#define RTF_MODIFIED 0x0020 /* modified dyn. (by redirect) */
-#define RTF_MTU 0x0040 /* specific MTU for this route */
-#define RTF_MSS RTF_MTU /* Compatibility :-( */
-#define RTF_WINDOW 0x0080 /* per route window clamping */
-#define RTF_IRTT 0x0100 /* Initial round trip time */
-#define RTF_REJECT 0x0200 /* Reject route */
-
-struct in6_rtmsg {
- struct in6_addr rtmsg_dst;
- struct in6_addr rtmsg_src;
- struct in6_addr rtmsg_gateway;
- uint32_t rtmsg_type;
- uint16_t rtmsg_dst_len;
- uint16_t rtmsg_src_len;
- uint32_t rtmsg_metric;
- unsigned long int rtmsg_info;
- uint32_t rtmsg_flags;
- int rtmsg_ifindex;
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netdb.h b/mdk-stage1/dietlibc/include/netdb.h
deleted file mode 100644
index be64f659f..000000000
--- a/mdk-stage1/dietlibc/include/netdb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef _NETDB_H
-#define _NETDB_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* Absolute file name for network data base files. */
-#define _PATH_HEQUIV "/etc/hosts.equiv"
-#define _PATH_HOSTS "/etc/hosts"
-#define _PATH_NETWORKS "/etc/networks"
-#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
-#define _PATH_PROTOCOLS "/etc/protocols"
-#define _PATH_SERVICES "/etc/services"
-
-/* Description of data base entry for a single service. */
-struct servent {
- char *s_name; /* Official service name. */
- char **s_aliases; /* Alias list. */
- int s_port; /* Port number. */
- char *s_proto; /* Protocol to use. */
-};
-
-extern void endservent (void) __THROW;
-extern void setservent(int stayopen) __THROW;
-
-extern int getservent_r(struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) __THROW;
-extern int getservbyname_r(const char* name,const char* proto,
- struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) __THROW;
-extern int getservbyport_r(int port,const char* proto,
- struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) __THROW;
-
-extern struct servent *getservent(void) __THROW;
-extern struct servent *getservbyname (const char *__name,
- const char *__proto) __THROW;
-extern struct servent *getservbyport (int __port, const char *__proto)
- __THROW;
-
-struct hostent {
- char *h_name; /* Official name of host. */
- char **h_aliases; /* Alias list. */
- int h_addrtype; /* Host address type. */
- socklen_t h_length; /* Length of address. */
- char **h_addr_list; /* List of addresses from name server. */
-#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
-};
-
-extern void endhostent (void) __THROW;
-extern struct hostent *gethostent (void) __THROW;
-extern struct hostent *gethostent_r (char* buf,int len) __THROW;
-extern struct hostent *gethostbyaddr (const void *__addr, socklen_t __len,
- int __type) __THROW;
-extern struct hostent *gethostbyname (const char *__name) __THROW;
-extern struct hostent *gethostbyname2 (const char *__name, int __af) __THROW;
-
-/* this glibc "invention" is so ugly, I'm going to throw up any minute
- * now */
-extern int gethostbyname_r(const char* NAME, struct hostent* RESULT_BUF,char* BUF,
- size_t BUFLEN, struct hostent** RESULT,
- int* H_ERRNOP) __THROW;
-
-#define HOST_NOT_FOUND 1
-#define TRY_AGAIN 2
-#define NO_RECOVERY 3
-#define NO_ADDRESS 4
-#define NO_DATA 5
-
-extern int gethostbyaddr_r(const char* addr, size_t length, int format,
- struct hostent* result, char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop) __THROW;
-
-int gethostbyname2_r(const char* name, int AF, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop) __THROW;
-
-struct protoent {
- char *p_name; /* official protocol name */
- char **p_aliases; /* alias list */
- int p_proto; /* protocol number */
-};
-
-struct protoent *getprotoent(void) __THROW;
-struct protoent *getprotobyname(const char *name) __THROW;
-struct protoent *getprotobynumber(int proto) __THROW;
-void setprotoent(int stayopen) __THROW;
-void endprotoent(void) __THROW;
-
-int getprotoent_r(struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) __THROW;
-int getprotobyname_r(const char* name,
- struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) __THROW;
-int getprotobynumber_r(int proto,
- struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) __THROW;
-
-
-void sethostent(int stayopen) __THROW;
-
-/* dummy */
-extern int h_errno;
-
-struct netent {
- char *n_name; /* official network name */
- char **n_aliases; /* alias list */
- int n_addrtype; /* net address type */
- unsigned long int n_net; /* network number */
-};
-
-struct netent *getnetbyaddr(unsigned long net, int type) __THROW;
-void endnetent(void) __THROW;
-void setnetent(int stayopen) __THROW;
-struct netent *getnetbyname(const char *name) __THROW;
-struct netent *getnetent(void) __THROW;
-
-extern const char *hstrerror (int err_num) __THROW;
-void herror(const char *s) __THROW;
-
-#define NI_MAXHOST 1025
-#define NI_MAXSERV 32
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netinet/in.h b/mdk-stage1/dietlibc/include/netinet/in.h
deleted file mode 100644
index 9f98cc050..000000000
--- a/mdk-stage1/dietlibc/include/netinet/in.h
+++ /dev/null
@@ -1,404 +0,0 @@
-#ifndef _NETINET_IN_H
-#define _NETINET_IN_H
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <endian.h>
-
-/* Standard well-defined IP protocols. */
-enum {
- IPPROTO_IP = 0, /* Dummy protocol for TCP */
-#define IPPROTO_IP IPPROTO_IP
- IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
-#define IPPROTO_ICMP IPPROTO_ICMP
- IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
-#define IPPROTO_IGMP IPPROTO_IGMP
- IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
-#define IPPROTO_IPIP IPPROTO_IPIP
- IPPROTO_TCP = 6, /* Transmission Control Protocol */
-#define IPPROTO_TCP IPPROTO_TCP
- IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
-#define IPPROTO_EGP IPPROTO_EGP
- IPPROTO_PUP = 12, /* PUP protocol */
-#define IPPROTO_PUP IPPROTO_PUP
- IPPROTO_UDP = 17, /* User Datagram Protocol */
-#define IPPROTO_UDP IPPROTO_UDP
- IPPROTO_IDP = 22, /* XNS IDP protocol */
-#define IPPROTO_IDP IPPROTO_IDP
- IPPROTO_RSVP = 46, /* RSVP protocol */
-#define IPPROTO_RSVP IPPROTO_RSVP
- IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
-#define IPPROTO_GRE IPPROTO_GRE
- IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
-#define IPPROTO_IPV6 IPPROTO_IPV6
- IPPROTO_PIM = 103, /* Protocol Independent Multicast */
-#define IPPROTO_PIM IPPROTO_PIM
- IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
-#define IPPROTO_ESP IPPROTO_ESP
- IPPROTO_AH = 51, /* Authentication Header protocol */
-#define IPPROTO_AH IPPROTO_AH
- IPPROTO_COMP = 108, /* Compression Header protocol */
-#define IPPROTO_COMP IPPROTO_COMP
- IPPROTO_RAW = 255, /* Raw IP packets */
-#define IPPROTO_RAW IPPROTO_RAW
- IPPROTO_MAX
-};
-
-#define IP_TOS 1
-#define IP_TTL 2
-#define IP_HDRINCL 3
-#define IP_OPTIONS 4
-#define IP_ROUTER_ALERT 5
-#define IP_RECVOPTS 6
-#define IP_RETOPTS 7
-#define IP_PKTINFO 8
-#define IP_PKTOPTIONS 9
-#define IP_MTU_DISCOVER 10
-#define IP_RECVERR 11
-#define IP_RECVTTL 12
-#define IP_RECVTOS 13
-#define IP_MTU 14
-#define IP_FREEBIND 15
-
-/* BSD compatibility */
-#define IP_RECVRETOPTS IP_RETOPTS
-
-/* IP_MTU_DISCOVER values */
-#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
-#define IP_PMTUDISC_WANT 1 /* Use per route hints */
-#define IP_PMTUDISC_DO 2 /* Always DF */
-
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-
-/* These need to appear somewhere around here */
-#define IP_DEFAULT_MULTICAST_TTL 1
-#define IP_DEFAULT_MULTICAST_LOOP 1
-
-#define IN6ADDR_ANY_INIT {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
-#define IN6ADDR_LOOPBACK_INIT {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }}}
-extern const struct in6_addr in6addr_any;
-extern const struct in6_addr in6addr_loopback;
-
-typedef uint16_t in_port_t;
-typedef uint32_t in_addr_t;
-
-struct in_addr {
- in_addr_t s_addr;
-};
-
-struct ip_mreq {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_interface; /* local IP address of interface */
-};
-
-struct ip_mreqn {
- struct in_addr imr_multiaddr; /* IP multicast address of group */
- struct in_addr imr_address; /* local IP address of interface */
- int imr_ifindex; /* Interface index */
-};
-
-struct in_pktinfo {
- int ipi_ifindex;
- struct in_addr ipi_spec_dst;
- struct in_addr ipi_addr;
-};
-
-/* Structure describing an Internet (IP) socket address. */
-#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
-struct sockaddr_in {
- sa_family_t sin_family; /* Address family */
- in_port_t sin_port; /* Port number */
- struct in_addr sin_addr; /* Internet address */
- /* Pad to size of `struct sockaddr'. */
- unsigned char sin_zero[__SOCK_SIZE__ - sizeof(short int) -
- sizeof(unsigned short int) - sizeof(struct in_addr)];
-};
-
-
-/*
- * Definitions of the bits in an Internet address integer.
- * On subnets, host and network parts are found according
- * to the subnet mask, not these masks.
- */
-#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
-#define IN_CLASSA_NET 0xff000000
-#define IN_CLASSA_NSHIFT 24
-#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
-#define IN_CLASSA_MAX 128
-
-#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
-#define IN_CLASSB_NET 0xffff0000
-#define IN_CLASSB_NSHIFT 16
-#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
-#define IN_CLASSB_MAX 65536
-
-#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
-#define IN_CLASSC_NET 0xffffff00
-#define IN_CLASSC_NSHIFT 8
-#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
-
-#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
-#define IN_MULTICAST(a) IN_CLASSD(a)
-#define IN_MULTICAST_NET 0xF0000000
-
-#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
-#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
-
-/* Address to accept any incoming messages. */
-#define INADDR_ANY ((unsigned long int) 0x00000000)
-
-/* Address to send to all hosts. */
-#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
-
-/* Address indicating an error return. */
-#define INADDR_NONE ((unsigned long int) 0xffffffff)
-
-/* Network number for local host loopback. */
-#define IN_LOOPBACKNET 127
-
-/* Address to loopback in software to local host. */
-#define INADDR_LOOPBACK 0x7f000001 /* 127.0.0.1 */
-#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
-
-/* Defines for Multicast INADDR */
-#define INADDR_UNSPEC_GROUP 0xe0000000U /* 224.0.0.0 */
-#define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
-#define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
-#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU /* 224.0.0.255 */
-
-struct in6_addr {
- union {
- uint8_t u6_addr8[16];
- uint16_t u6_addr16[8];
- uint32_t u6_addr32[4];
- } in6_u;
-#define s6_addr in6_u.u6_addr8
-#define s6_addr16 in6_u.u6_addr16
-#define s6_addr32 in6_u.u6_addr32
-};
-
-struct sockaddr_in6 {
- unsigned short int sin6_family; /* AF_INET6 */
- uint16_t sin6_port; /* Transport layer port # */
- uint32_t sin6_flowinfo; /* IPv6 flow information */
- struct in6_addr sin6_addr; /* IPv6 address */
- uint32_t sin6_scope_id; /* scope id (new in RFC2553) */
-};
-
-struct sockaddr_in_pad {
- sa_family_t sin_family; /* Address family */
- in_port_t sin_port; /* Port number */
- struct in_addr sin_addr; /* Internet address */
- /* Pad to size of `struct sockaddr_in6'. */
- unsigned char sin_zero[sizeof(struct sockaddr_in6) - sizeof(short int) -
- sizeof(unsigned short int) - sizeof(struct in_addr)];
-};
-
-struct ipv6_mreq {
- /* IPv6 multicast address of group */
- struct in6_addr ipv6mr_multiaddr;
- /* local IPv6 address of interface */
- int ipv6mr_interface;
-};
-
-struct in6_flowlabel_req {
- struct in6_addr flr_dst;
- uint32_t flr_label;
- uint8_t flr_action;
- uint8_t flr_share;
- uint16_t flr_flags;
- uint16_t flr_expires;
- uint16_t flr_linger;
- uint32_t __flr_pad;
- /* Options in format of IPV6_PKTOPTIONS */
-};
-
-#define IPV6_FL_A_GET 0
-#define IPV6_FL_A_PUT 1
-#define IPV6_FL_A_RENEW 2
-
-#define IPV6_FL_F_CREATE 1
-#define IPV6_FL_F_EXCL 2
-
-#define IPV6_FL_S_NONE 0
-#define IPV6_FL_S_EXCL 1
-#define IPV6_FL_S_PROCESS 2
-#define IPV6_FL_S_USER 3
-#define IPV6_FL_S_ANY 255
-
-#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
-#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
-
-/*
- * IPV6 extension headers
- */
-#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
-#define IPPROTO_ROUTING 43 /* IPv6 routing header */
-#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
-#define IPPROTO_ICMPV6 58 /* ICMPv6 */
-#define IPPROTO_NONE 59 /* IPv6 no next header */
-#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
-
-/* IPv6 TLV options. */
-#define IPV6_TLV_PAD0 0
-#define IPV6_TLV_PADN 1
-#define IPV6_TLV_ROUTERALERT 5
-#define IPV6_TLV_JUMBO 194
-
-/* IPV6 socket options. */
-#define IPV6_ADDRFORM 1
-#define IPV6_PKTINFO 2
-#define IPV6_HOPOPTS 3
-#define IPV6_DSTOPTS 4
-#define IPV6_RTHDR 5
-#define IPV6_PKTOPTIONS 6
-#define IPV6_CHECKSUM 7
-#define IPV6_HOPLIMIT 8
-#define IPV6_NEXTHOP 9
-#define IPV6_AUTHHDR 10
-#define IPV6_FLOWINFO 11
-
-#define IPV6_UNICAST_HOPS 16
-#define IPV6_MULTICAST_IF 17
-#define IPV6_MULTICAST_HOPS 18
-#define IPV6_MULTICAST_LOOP 19
-#define IPV6_ADD_MEMBERSHIP 20
-#define IPV6_DROP_MEMBERSHIP 21
-#define IPV6_ROUTER_ALERT 22
-#define IPV6_MTU_DISCOVER 23
-#define IPV6_MTU 24
-#define IPV6_RECVERR 25
-
-/* IPV6_MTU_DISCOVER values */
-#define IPV6_PMTUDISC_DONT 0
-#define IPV6_PMTUDISC_WANT 1
-#define IPV6_PMTUDISC_DO 2
-
-/* Flowlabel */
-#define IPV6_FLOWLABEL_MGR 32
-#define IPV6_FLOWINFO_SEND 33
-
-#define IPV6_MIN_MTU 1280
-
-struct in6_pktinfo {
- struct in6_addr ipi6_addr;
- int ipi6_ifindex;
-};
-
-struct in6_ifreq {
- struct in6_addr ifr6_addr;
- uint32_t ifr6_prefixlen;
- int ifr6_ifindex;
-};
-
-#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
-#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
-
-/* routing header */
-struct ipv6_rt_hdr {
- uint8_t nexthdr;
- uint8_t hdrlen;
- uint8_t type;
- uint8_t segments_left;
- /* type specific data, variable length field */
-};
-
-struct ipv6_opt_hdr {
- uint8_t nexthdr;
- uint8_t hdrlen;
- /* TLV encoded option data follows. */
-};
-
-#define ipv6_destopt_hdr ipv6_opt_hdr
-#define ipv6_hopopt_hdr ipv6_opt_hdr
-
-/* routing header type 0 (used in cmsghdr struct) */
-
-#ifndef __STRICT_ANSI__
-struct rt0_hdr {
- struct ipv6_rt_hdr rt_hdr;
- uint32_t bitmap; /* strict/loose bit map */
- struct in6_addr addr[0];
-#define rt0_type rt_hdr.type;
-};
-#endif
-
-struct ipv6hdr {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- unsigned int flow_lbl:20,
- priority:8,
- version:4;
-#else
- unsigned int version:4,
- priority:8,
- flow_lbl:20;
-#endif
-
- uint16_t payload_len;
- uint8_t nexthdr;
- uint8_t hop_limit;
-
- struct in6_addr saddr;
- struct in6_addr daddr;
-};
-/* fnord */
-
-#define IPPORT_RESERVED 1024
-#define INET6_ADDRSTRLEN 46
-
-#undef htonl
-#undef htons
-#undef ntohl
-#undef ntohs
-uint32_t htonl(uint32_t hostlong);
-uint16_t htons(uint16_t hostshort);
-uint32_t ntohl(uint32_t netlong);
-uint16_t ntohs(uint16_t netshort);
-
-#define IN6_IS_ADDR_UNSPECIFIED(a) \
- (((__const uint32_t *) (a))[0] == 0 \
- && ((__const uint32_t *) (a))[1] == 0 \
- && ((__const uint32_t *) (a))[2] == 0 \
- && ((__const uint32_t *) (a))[3] == 0)
-
-#define IN6_IS_ADDR_LOOPBACK(a) \
- (((__const uint32_t *) (a))[0] == 0 \
- && ((__const uint32_t *) (a))[1] == 0 \
- && ((__const uint32_t *) (a))[2] == 0 \
- && ((__const uint32_t *) (a))[3] == htonl (1))
-
-#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)
-
-#define IN6_IS_ADDR_LINKLOCAL(a) \
- ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
- == htonl (0xfe800000))
-
-#define IN6_IS_ADDR_SITELOCAL(a) \
- ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
- == htonl (0xfec00000))
-
-#define IN6_IS_ADDR_V4MAPPED(a) \
- ((((__const uint32_t *) (a))[0] == 0) \
- && (((__const uint32_t *) (a))[1] == 0) \
- && (((__const uint32_t *) (a))[2] == htonl (0xffff)))
-
-#define IN6_IS_ADDR_V4COMPAT(a) \
- ((((__const uint32_t *) (a))[0] == 0) \
- && (((__const uint32_t *) (a))[1] == 0) \
- && (((__const uint32_t *) (a))[2] == 0) \
- && (ntohl (((__const uint32_t *) (a))[3]) > 1))
-
-#define IN6_ARE_ADDR_EQUAL(a,b) \
- ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \
- && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \
- && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \
- && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3]))
-
-/* old legacy bullshit */
-int bindresvport(int sd, struct sockaddr_in* sin);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netinet/in_systm.h b/mdk-stage1/dietlibc/include/netinet/in_systm.h
deleted file mode 100644
index e69de29bb..000000000
--- a/mdk-stage1/dietlibc/include/netinet/in_systm.h
+++ /dev/null
diff --git a/mdk-stage1/dietlibc/include/netinet/ip.h b/mdk-stage1/dietlibc/include/netinet/ip.h
deleted file mode 100644
index 4ebf21706..000000000
--- a/mdk-stage1/dietlibc/include/netinet/ip.h
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef _NETINET_IP_H
-#define _NETINET_IP_H
-
-#include <inttypes.h>
-#include <endian.h>
-#include <netinet/in.h>
-
-#define IPVERSION 4 /* IP version number */
-#define IP_MAXPACKET 65535 /* maximum packet size */
-
-#define IPTOS_TOS_MASK 0x1E
-#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
-#define IPTOS_MINCOST 0x02
-#define IPTOS_LOWCOST IPTOS_MINCOST
-
-#define IPTOS_PREC_MASK 0xE0
-#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
-#define IPTOS_PREC_NETCONTROL 0xe0
-#define IPTOS_PREC_INTERNETCONTROL 0xc0
-#define IPTOS_PREC_CRITIC_ECP 0xa0
-#define IPTOS_PREC_FLASHOVERRIDE 0x80
-#define IPTOS_PREC_FLASH 0x60
-#define IPTOS_PREC_IMMEDIATE 0x40
-#define IPTOS_PREC_PRIORITY 0x20
-#define IPTOS_PREC_ROUTINE 0x00
-
-
-/* IP options */
-#define IPOPT_COPY 0x80
-#define IPOPT_CLASS_MASK 0x60
-#define IPOPT_NUMBER_MASK 0x1f
-
-#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
-#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
-#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
-
-#define IPOPT_CONTROL 0x00
-#define IPOPT_RESERVED1 0x20
-#define IPOPT_MEASUREMENT 0x40
-#define IPOPT_RESERVED2 0x60
-
-#define IPOPT_END (0 |IPOPT_CONTROL)
-#define IPOPT_NOOP (1 |IPOPT_CONTROL)
-#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
-#define IPOPT_RR (7 |IPOPT_CONTROL)
-#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
-#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
-
-#define IPVERSION 4
-#define MAXTTL 255
-#define IPDEFTTL 64
-
-/* struct timestamp, struct route and MAX_ROUTES are removed.
-
- REASONS: it is clear that nobody used them because:
- - MAX_ROUTES value was wrong.
- - "struct route" was wrong.
- - "struct timestamp" had fatally misaligned bitfields and was completely unusable.
- */
-
-#define IPOPT_OPTVAL 0
-#define IPOPT_OLEN 1
-#define IPOPT_OFFSET 2
-#define IPOPT_MINOFF 4
-#define MAX_IPOPTLEN 40
-#define IPOPT_NOP IPOPT_NOOP
-#define IPOPT_EOL IPOPT_END
-#define IPOPT_TS IPOPT_TIMESTAMP
-
-#define IPOPT_TS_TSONLY 0 /* timestamps only */
-#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
-#define IPOPT_TS_PRESPEC 3 /* specified modules only */
-
-struct iphdr { /* size 20/0x14 */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- unsigned int ihl:4, version:4; /* offset 0; version=ip version (4) */
-#else
- unsigned int version:4, ihl:4; /* offset 0; ihl=ip header length, measured in words (5) */
-#endif
- unsigned char tos; /* offset 1 */
- unsigned short tot_len; /* offset 2; total bytes in packet in network byte order */
- unsigned short id; /* offset 4 */
- unsigned short frag_off; /* offset 6 */
- unsigned char ttl; /* offset 8 */
- unsigned char protocol; /* offset 9; 1=ICMP, 6=TCP, 17=UDP (see netinet/in.h) */
- unsigned short check; /* offset 10/0xa */
- unsigned int saddr; /* offset 12/0xc */
- unsigned int daddr; /* offset 16/0x10 */
- /*The options start here. */
-};
-
-struct ip {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- unsigned int ip_hl:4; /* header length */
- unsigned int ip_v:4; /* version */
-#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
- unsigned int ip_v:4; /* version */
- unsigned int ip_hl:4; /* header length */
-#endif
- unsigned char ip_tos; /* type of service */
- unsigned short ip_len; /* total length */
- unsigned short ip_id; /* identification */
- unsigned short ip_off; /* fragment offset field */
-#define IP_RF 0x8000 /* reserved fragment flag */
-#define IP_DF 0x4000 /* dont fragment flag */
-#define IP_MF 0x2000 /* more fragments flag */
-#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
- unsigned char ip_ttl; /* time to live */
- unsigned char ip_p; /* protocol */
- unsigned short ip_sum; /* checksum */
- struct in_addr ip_src, ip_dst; /* source and dest address */
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netinet/ip_icmp.h b/mdk-stage1/dietlibc/include/netinet/ip_icmp.h
deleted file mode 100644
index cf8e016f7..000000000
--- a/mdk-stage1/dietlibc/include/netinet/ip_icmp.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef NETINET_IP_ICMP_H
-#define NETINET_IP_ICMP_H
-
-#include <sys/cdefs.h>
-#include <inttypes.h>
-#include <netinet/ip.h>
-
-struct icmphdr {
- uint8_t type; /* message type */
- uint8_t code; /* type sub-code */
- uint16_t checksum;
- union {
- struct {
- uint16_t id;
- uint16_t sequence;
- } echo; /* echo datagram */
- uint32_t gateway; /* gateway address */
- struct {
- uint16_t __unused;
- uint16_t mtu;
- } frag; /* path mtu discovery */
- } un;
-};
-
-#define ICMP_ECHOREPLY 0 /* Echo Reply */
-#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
-#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
-#define ICMP_REDIRECT 5 /* Redirect (change route) */
-#define ICMP_ECHO 8 /* Echo Request */
-#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
-#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
-#define ICMP_TIMESTAMP 13 /* Timestamp Request */
-#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
-#define ICMP_INFO_REQUEST 15 /* Information Request */
-#define ICMP_INFO_REPLY 16 /* Information Reply */
-#define ICMP_ADDRESS 17 /* Address Mask Request */
-#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
-#define NR_ICMP_TYPES 18
-
-
-/* Codes for UNREACH. */
-#define ICMP_NET_UNREACH 0 /* Network Unreachable */
-#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
-#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
-#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
-#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
-#define ICMP_SR_FAILED 5 /* Source Route failed */
-#define ICMP_NET_UNKNOWN 6
-#define ICMP_HOST_UNKNOWN 7
-#define ICMP_HOST_ISOLATED 8
-#define ICMP_NET_ANO 9
-#define ICMP_HOST_ANO 10
-#define ICMP_NET_UNR_TOS 11
-#define ICMP_HOST_UNR_TOS 12
-#define ICMP_PKT_FILTERED 13 /* Packet filtered */
-#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
-#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
-#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
-
-/* Codes for REDIRECT. */
-#define ICMP_REDIR_NET 0 /* Redirect Net */
-#define ICMP_REDIR_HOST 1 /* Redirect Host */
-#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
-#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
-
-/* Codes for TIME_EXCEEDED. */
-#define ICMP_EXC_TTL 0 /* TTL count exceeded */
-#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
-
-/*
- * Lower bounds on packet lengths for various types.
- * For the error advice packets must first insure that the
- * packet is large enough to contain the returned ip header.
- * Only then can we do the check to see if 64 bits of packet
- * data have been returned, since we need to check the returned
- * ip header length.
- */
-#define ICMP_MINLEN 8 /* abs minimum */
-#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
-#define ICMP_MASKLEN 12 /* address mask */
-#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
-#ifndef _IP_VHL
-#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
- /* N.B.: must separately check that ip_hl >= 5 */
-#else
-#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
- /* N.B.: must separately check that header length >= 5 */
-#endif
-
-/* Definition of type and code fields. */
-/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
-#define ICMP_UNREACH 3 /* dest unreachable, codes: */
-#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
-#define ICMP_ROUTERADVERT 9 /* router advertisement */
-#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
-#define ICMP_TIMXCEED 11 /* time exceeded, code: */
-#define ICMP_PARAMPROB 12 /* ip header bad */
-#define ICMP_TSTAMP 13 /* timestamp request */
-#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
-#define ICMP_IREQ 15 /* information request */
-#define ICMP_IREQREPLY 16 /* information reply */
-#define ICMP_MASKREQ 17 /* address mask request */
-#define ICMP_MASKREPLY 18 /* address mask reply */
-
-#define ICMP_MAXTYPE 18
-
-/* UNREACH codes */
-#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 */
-#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
-#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
-#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
-#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
-#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
-#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
-#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
-#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
-#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
-#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
-
-/* REDIRECT codes */
-#define ICMP_REDIRECT_NET 0 /* for network */
-#define ICMP_REDIRECT_HOST 1 /* for host */
-#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
-#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
-
-/* TIMEXCEED codes */
-#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
-#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
-
-/* PARAMPROB code */
-#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
-
-#define ICMP_INFOTYPE(type) \
- ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
- (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
- (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
- (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
- (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netinet/tcp.h b/mdk-stage1/dietlibc/include/netinet/tcp.h
deleted file mode 100644
index e47f24dff..000000000
--- a/mdk-stage1/dietlibc/include/netinet/tcp.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef _NETINET_TCP_H
-#define _NETINET_TCP_H
-
-#include <inttypes.h>
-#include <endian.h>
-
-struct tcphdr { /* size 20/0x14 40/0x28 with IP header */
- uint16_t source; /* offset 0 20/0x14 */
- uint16_t dest; /* offset 2 22/0x16 */
- uint32_t seq; /* offset 4 24/0x18 */
- uint32_t ack_seq; /* offset 8 28/0x1c */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- uint16_t res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1;
-#else
- uint16_t doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1;
-#endif
- /* offset 12/0xc 32/0x20 */
- uint16_t window; /* offset 14/0xe 34/0x22 */
- uint16_t check; /* offset 16/0x10 36/0x24 */
- uint16_t urg_ptr; /* offset 18/0x12 38/0x26 */
-};
-
-
-enum {
- TCP_ESTABLISHED = 1,
- TCP_SYN_SENT,
- TCP_SYN_RECV,
- TCP_FIN_WAIT1,
- TCP_FIN_WAIT2,
- TCP_TIME_WAIT,
- TCP_CLOSE,
- TCP_CLOSE_WAIT,
- TCP_LAST_ACK,
- TCP_LISTEN,
- TCP_CLOSING, /* now a valid state */
-
- TCP_MAX_STATES /* Leave at the end! */
-};
-
-#define TCP_STATE_MASK 0xF
-#define TCP_ACTION_FIN (1 << 7)
-
-enum {
- TCPF_ESTABLISHED = (1 << 1),
- TCPF_SYN_SENT = (1 << 2),
- TCPF_SYN_RECV = (1 << 3),
- TCPF_FIN_WAIT1 = (1 << 4),
- TCPF_FIN_WAIT2 = (1 << 5),
- TCPF_TIME_WAIT = (1 << 6),
- TCPF_CLOSE = (1 << 7),
- TCPF_CLOSE_WAIT = (1 << 8),
- TCPF_LAST_ACK = (1 << 9),
- TCPF_LISTEN = (1 << 10),
- TCPF_CLOSING = (1 << 11)
-};
-
-/*
- * The union cast uses a gcc extension to avoid aliasing problems
- * (union is compatible to any of its members)
- * This means this part of the code is -fstrict-aliasing safe now.
- */
-union tcp_word_hdr {
- struct tcphdr hdr;
- uint32_t words[5];
-};
-
-#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
-
-enum {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- TCP_FLAG_CWR = 0x00008000,
- TCP_FLAG_ECE = 0x00004000,
- TCP_FLAG_URG = 0x00002000,
- TCP_FLAG_ACK = 0x00001000,
- TCP_FLAG_PSH = 0x00000800,
- TCP_FLAG_RST = 0x00000400,
- TCP_FLAG_SYN = 0x00000200,
- TCP_FLAG_FIN = 0x00000100,
- TCP_RESERVED_BITS = 0x0000C00F,
- TCP_DATA_OFFSET = 0x000000F0
-#else
- TCP_FLAG_CWR = 0x00800000,
- TCP_FLAG_ECE = 0x00400000,
- TCP_FLAG_URG = 0x00200000,
- TCP_FLAG_ACK = 0x00100000,
- TCP_FLAG_PSH = 0x00080000,
- TCP_FLAG_RST = 0x00040000,
- TCP_FLAG_SYN = 0x00020000,
- TCP_FLAG_FIN = 0x00010000,
- TCP_RESERVED_BITS = 0x0FC00000,
- TCP_DATA_OFFSET = 0xF0000000
-#endif
-};
-
-/* TCP socket options */
-#define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */
-#define TCP_MAXSEG 2 /* Limit MSS */
-#define TCP_CORK 3 /* Never send partially complete segments */
-#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
-#define TCP_KEEPINTVL 5 /* Interval between keepalives */
-#define TCP_KEEPCNT 6 /* Number of keepalives before death */
-#define TCP_SYNCNT 7 /* Number of SYN retransmits */
-#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
-#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
-#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
-#define TCP_INFO 11 /* Information about this connection. */
-#define TCP_QUICKACK 12 /* Block/reenable quick acks */
-
-#define TCPI_OPT_TIMESTAMPS 1
-#define TCPI_OPT_SACK 2
-#define TCPI_OPT_WSCALE 4
-#define TCPI_OPT_ECN 8
-
-enum tcp_ca_state {
- TCP_CA_Open = 0,
-#define TCPF_CA_Open (1<<TCP_CA_Open)
- TCP_CA_Disorder = 1,
-#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
- TCP_CA_CWR = 2,
-#define TCPF_CA_CWR (1<<TCP_CA_CWR)
- TCP_CA_Recovery = 3,
-#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
- TCP_CA_Loss = 4
-#define TCPF_CA_Loss (1<<TCP_CA_Loss)
-};
-
-struct tcp_info {
- uint8_t tcpi_state;
- uint8_t tcpi_ca_state;
- uint8_t tcpi_retransmits;
- uint8_t tcpi_probes;
- uint8_t tcpi_backoff;
- uint8_t tcpi_options;
- uint8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
-
- uint32_t tcpi_rto;
- uint32_t tcpi_ato;
- uint32_t tcpi_snd_mss;
- uint32_t tcpi_rcv_mss;
-
- uint32_t tcpi_unacked;
- uint32_t tcpi_sacked;
- uint32_t tcpi_lost;
- uint32_t tcpi_retrans;
- uint32_t tcpi_fackets;
-
- /* Times. */
- uint32_t tcpi_last_data_sent;
- uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
- uint32_t tcpi_last_data_recv;
- uint32_t tcpi_last_ack_recv;
-
- /* Metrics. */
- uint32_t tcpi_pmtu;
- uint32_t tcpi_rcv_ssthresh;
- uint32_t tcpi_rtt;
- uint32_t tcpi_rttvar;
- uint32_t tcpi_snd_ssthresh;
- uint32_t tcpi_snd_cwnd;
- uint32_t tcpi_advmss;
- uint32_t tcpi_reordering;
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netinet/udp.h b/mdk-stage1/dietlibc/include/netinet/udp.h
deleted file mode 100644
index 3c5e9524e..000000000
--- a/mdk-stage1/dietlibc/include/netinet/udp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _NETINET_UDP_H
-#define _NETINET_UDP_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct udphdr { /* size 8 28/0x1c with IP header */
- uint16_t source; /* offset 0 20/0x14 */
- uint16_t dest; /* offset 2 22/0x16 */
- uint16_t len; /* offset 4 24/0x18 */
- uint16_t check; /* offset 6 26/0x1a */
-};
-
-#define SOL_UDP 17 /* sockopt level for UDP */
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/netpacket/packet.h b/mdk-stage1/dietlibc/include/netpacket/packet.h
deleted file mode 100644
index b265094c6..000000000
--- a/mdk-stage1/dietlibc/include/netpacket/packet.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef __NETPACKET_PACKET_H
-#define __NETPACKET_PACKET_H
-
-struct sockaddr_ll {
- unsigned short int sll_family;
- unsigned short int sll_protocol;
- int sll_ifindex;
- unsigned short int sll_hatype;
- unsigned char sll_pkttype;
- unsigned char sll_halen;
- unsigned char sll_addr[8];
-};
-
-#define PACKET_HOST 0 /* To us. */
-#define PACKET_BROADCAST 1 /* To all. */
-#define PACKET_MULTICAST 2 /* To group. */
-#define PACKET_OTHERHOST 3 /* To someone else. */
-#define PACKET_OUTGOING 4 /* Originated by us. */
-#define PACKET_LOOPBACK 5
-#define PACKET_FASTROUTE 6
-
-/* Packet socket options. */
-
-#define PACKET_ADD_MEMBERSHIP 1
-#define PACKET_DROP_MEMBERSHIP 2
-#define PACKET_RECV_OUTPUT 3
-#define PACKET_RX_RING 5
-#define PACKET_STATISTICS 6
-
-struct packet_mreq {
- int mr_ifindex;
- unsigned short int mr_type;
- unsigned short int mr_alen;
- unsigned char mr_address[8];
-};
-
-#define PACKET_MR_MULTICAST 0
-#define PACKET_MR_PROMISC 1
-#define PACKET_MR_ALLMULTI 2
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/paths.h b/mdk-stage1/dietlibc/include/paths.h
deleted file mode 100644
index 9073d267a..000000000
--- a/mdk-stage1/dietlibc/include/paths.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _PATHS_H
-#define _PATHS_H
-
-#define _PATH_BSHELL "/bin/sh"
-#define _PATH_DEFPATH "/bin:/usr/bin:"
-
-#define _PATH_DEVNULL "/dev/null"
-
-#define _PATH_CONSOLE "/dev/console"
-#define _PATH_MOUNTED "/etc/mtab"
-
-#define _PATH_PASSWD "/etc/passwd"
-#define _PATH_GROUP "/etc/group"
-#define _PATH_SHADOW "/etc/shadow"
-
-#define _PATH_SHELLS "/etc/shells"
-
-#define _PATH_VARRUN "/var/run/"
-
-/* puke */
-#define _PATH_MAILDIR "/var/mail"
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/pthread.h b/mdk-stage1/dietlibc/include/pthread.h
deleted file mode 100644
index e243c0281..000000000
--- a/mdk-stage1/dietlibc/include/pthread.h
+++ /dev/null
@@ -1,244 +0,0 @@
-#ifndef _PTHREAD_H
-#define _PTHREAD_H 1
-
-#include <sched.h>
-#include <signal.h>
-#include <setjmp.h>
-
-#define PTHREAD_STACK_SIZE 16384
-
-#define PTHREAD_THREADS_MAX 128
-
-#define MAX_SPIN_COUNT 50
-#define SPIN_SLEEP_DURATION 2000001
-
-#define PTHREAD_KEYS_MAX 7
-#define PTHREAD_DESTRUCTOR_ITERATIONS 10
-
-typedef struct _pthread_descr_struct *_pthread_descr;
-typedef int pthread_t;
-
-/* Fast locks */
-#ifdef __parisc__
-#define PTHREAD_SPIN_LOCKED 0
-#define PTHREAD_SPIN_UNLOCKED 1
-#else
-#define PTHREAD_SPIN_LOCKED 1
-#define PTHREAD_SPIN_UNLOCKED 0
-#endif
-struct _pthread_fastlock {
- int __spinlock;
-};
-
-/* Mutexes */
-typedef struct {
- struct _pthread_fastlock lock;
- _pthread_descr owner;
- int kind;
- unsigned int count;
-} pthread_mutex_t;
-
-enum {
- PTHREAD_MUTEX_FAST_NP,
- PTHREAD_MUTEX_RECURSIVE_NP,
- PTHREAD_MUTEX_ERRORCHECK_NP,
-};
-
-enum
-{
- PTHREAD_PROCESS_PRIVATE,
-#define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
- PTHREAD_PROCESS_SHARED
-#define PTHREAD_PROCESS_SHARED PTHREAD_PROCESS_SHARED
-};
-
-#define PTHREAD_MUTEX_INITIALIZER \
-{{PTHREAD_SPIN_UNLOCKED}, 0, PTHREAD_MUTEX_FAST_NP, 0}
-
-#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-{{PTHREAD_SPIN_UNLOCKED}, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0}
-
-#define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-{{PTHREAD_SPIN_UNLOCKED}, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0}
-
-typedef struct {
- int __mutexkind;
-} pthread_mutexattr_t;
-
-int pthread_mutexattr_init(pthread_mutexattr_t *attr);
-int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
-
-int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr, int *kind);
-int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
-
-int pthread_mutex_init(pthread_mutex_t *mutex,
- const pthread_mutexattr_t *mutexattr);
-int pthread_mutex_lock(pthread_mutex_t *mutex);
-int pthread_mutex_unlock(pthread_mutex_t *mutex);
-int pthread_mutex_trylock(pthread_mutex_t *mutex);
-int pthread_mutex_destroy(pthread_mutex_t *mutex);
-
-/* Conditions */
-typedef void* pthread_condattr_t;
-
-typedef struct {
- struct _pthread_fastlock lock;
- _pthread_descr wait_chain;
-} pthread_cond_t;
-
-#define PTHREAD_COND_INITIALIZER \
-{{PTHREAD_SPIN_UNLOCKED},0}
-
-int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr);
-int pthread_cond_destroy(pthread_cond_t *cond);
-int pthread_cond_signal(pthread_cond_t *cond);
-int pthread_cond_broadcast(pthread_cond_t *cond);
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec *abstime);
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
-
-/* only for completeness (always return NULL) */
-int pthread_condattr_init(pthread_condattr_t *attr);
-int pthread_condattr_destroy(pthread_condattr_t *attr);
-int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
-int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
-
-/* thread specific variables */
-typedef unsigned int pthread_key_t;
-
-int pthread_key_create(pthread_key_t *key, void (*destructor)(const void*));
-int pthread_key_delete(pthread_key_t key);
-int pthread_setspecific(pthread_key_t key, const void *value);
-const void *pthread_getspecific(pthread_key_t key);
-
-
-/* Attributes for threads. */
-typedef struct
-{
- int __detachstate;
- int __schedpolicy;
- struct sched_param __schedparam;
- int __inheritsched;
- int __scope;
- void * __stackaddr;
- unsigned long __stacksize;
-} pthread_attr_t;
-
-enum
-{
- PTHREAD_CREATE_JOINABLE,
-#define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
- PTHREAD_CREATE_DETACHED
-#define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
-};
-
-enum
-{
- PTHREAD_EXPLICIT_SCHED,
-#define PTHREAD_EXPLICIT_SCHED PTHREAD_EXPLICIT_SCHED
- PTHREAD_INHERIT_SCHED
-#define PTHREAD_INHERIT_SCHED PTHREAD_INHERIT_SCHED
-};
-
-enum /* for completeness */
-{
- PTHREAD_SCOPE_SYSTEM,
-#define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
- PTHREAD_SCOPE_PROCESS
-#define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_PROCESS
-};
-
-int pthread_attr_init(pthread_attr_t *attr);
-int pthread_attr_destroy(pthread_attr_t *attr);
-
-int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
-int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate);
-
-int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
-int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy);
-
-int pthread_attr_setschedparam(pthread_attr_t *attr,
- const struct sched_param *param);
-int pthread_attr_getschedparam(const pthread_attr_t *attr,
- struct sched_param *param);
-
-int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit);
-int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit);
-
-int pthread_attr_setscope(pthread_attr_t *attr, int scope);
-int pthread_attr_getscope(const pthread_attr_t *attr, int *scope);
-
-int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stack);
-int pthread_attr_getstackaddr(pthread_attr_t *attr, void **stack);
-
-int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
-int pthread_attr_getstacksize(pthread_attr_t *attr, size_t *stacksize);
-
-int pthread_setschedparam(pthread_t target_thread, int policy,
- const struct sched_param *param);
-int pthread_getschedparam(pthread_t target_thread, int *policy,
- struct sched_param *param);
-
-/* ONCE */
-typedef int pthread_once_t;
-#define PTHREAD_ONCE_INIT PTHREAD_SPIN_UNLOCKED
-
-int __pthread_once(pthread_once_t* once_control, void (*init_routine)(void));
-int pthread_once(pthread_once_t* once_control, void (*init_routine)(void));
-
-/* CANCEL */
-
-enum {
- PTHREAD_CANCEL_ENABLE,
-#define PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE
- PTHREAD_CANCEL_DISABLE,
-#define PTHREAD_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE
-};
-
-enum {
- PTHREAD_CANCEL_ASYNCHRONOUS,
-#define PTHREAD_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS
- PTHREAD_CANCEL_DEFERRED,
-#define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
-};
-
-#define PTHREAD_CANCELED ((void *) -1)
-
-int pthread_cancel(pthread_t thread);
-int pthread_setcancelstate(int state, int *oldstate);
-
-int pthread_setcanceltype(int type, int *oldtype);
-
-void pthread_testcancel(void);
-
-/* CLEANUP */
-
-void pthread_cleanup_push(void (*routine)(void*), void *arg);
-void pthread_cleanup_pop (int execute);
-
-void pthread_cleanup_push_defer_np(void (*routine)(void *), void *arg);
-void pthread_cleanup_pop_restore_np(int execute);
-
-/* FORK */
-
-pid_t pthread_atfork(void (*prepare)(void), void (*parent)(void),
- void (*child)(void));
-
-/* THREADS */
-int pthread_create (pthread_t *__threadarg,
- const pthread_attr_t *__attr,
- void *(*__start_routine) (void *),
- void *__arg);
-
-void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
-
-int pthread_join (pthread_t __th, void **__thread_return);
-
-int pthread_detach (pthread_t __th);
-
-pthread_t pthread_self (void);
-int pthread_equal (pthread_t __thread1, pthread_t __thread2);
-
-int pthread_sigmask(int how, const sigset_t*newset, sigset_t *oldset);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/pty.h b/mdk-stage1/dietlibc/include/pty.h
deleted file mode 100644
index fa53d9934..000000000
--- a/mdk-stage1/dietlibc/include/pty.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _PTY_H
-#define _PTY_H
-
-#include <sys/cdefs.h>
-#include <termios.h>
-
-/* Create pseudo tty master slave pair with NAME and set terminal
- * attributes according to TERMP and WINP and return handles for both
- * ends in AMASTER and ASLAVE. */
-extern int openpty (int *__amaster, int *__aslave, char *__name, struct
- termios *__termp, struct winsize *__winp) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/pwd.h b/mdk-stage1/dietlibc/include/pwd.h
deleted file mode 100644
index 8901a2d7f..000000000
--- a/mdk-stage1/dietlibc/include/pwd.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _PWD_H
-#define _PWD_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <stdio.h>
-
-struct passwd {
- char *pw_name; /* Username. */
- char *pw_passwd; /* Password. */
- uid_t pw_uid; /* User ID. */
- gid_t pw_gid; /* Group ID. */
- char *pw_gecos; /* Real name. */
- char *pw_dir; /* Home directory. */
- char *pw_shell; /* Shell program. */
-};
-
-extern struct passwd *getpwuid (uid_t uid) __THROW;
-extern struct passwd *getpwnam (const char *name) __THROW;
-
-extern struct passwd *getpwent(void) __THROW;
-extern void setpwent(void) __THROW;
-extern void endpwent(void) __THROW;
-extern int putpwent(const struct passwd *p, FILE *stream) __THROW;
-
-int getpwent_r(struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) __THROW;
-int getpwnam_r(const char* name,
- struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) __THROW;
-int getpwuid_r(uid_t uid,
- struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/regex.h b/mdk-stage1/dietlibc/include/regex.h
deleted file mode 100644
index abc9ab57b..000000000
--- a/mdk-stage1/dietlibc/include/regex.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef _REGEX_H
-#define _REGEX_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-typedef ptrdiff_t regoff_t;
-
-typedef struct {
- regoff_t rm_so;
- regoff_t rm_eo;
-} regmatch_t;
-
-#define REG_EXTENDED 1
-#define REG_ICASE 2
-#define REG_NOSUB 4
-#define REG_NEWLINE 8
-
-#define REG_NOTBOL 1
-#define REG_NOTEOL 2
-
-#define REG_NOMATCH -1
-
-#define RE_DUP_MAX 255
-
-struct __regex_t;
-
-typedef int (*matcher)(void*,const char*,int ofs,struct __regex_t *t,int plus,int eflags);
-
-typedef struct __regex_t {
- struct regex {
- matcher m;
- void* next;
- int pieces;
- int num;
- struct branch *b;
- } r;
- int brackets,cflags;
- regmatch_t *l;
-} regex_t;
-#define re_nsub r.pieces
-
-int regcomp(regex_t *preg, const char *regex, int cflags) __THROW;
-int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags) __THROW;
-size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size) __THROW;
-void regfree(regex_t *preg) __THROW;
-
-enum __regex_errors {
- REG_NOERROR,
- REG_BADRPT, /* Invalid use of repetition operators such as using `*' as the first character. */
- REG_BADBR, /* Invalid use of back reference operator. */
- REG_EBRACE, /* Un-matched brace interval operators. */
- REG_EBRACK, /* Un-matched bracket list operators. */
- REG_ERANGE, /* Invalid use of the range operator, eg. the ending point of the
- range occurs prior to the starting point. */
- REG_ECTYPE, /* Unknown character class name. */
- REG_ECOLLATE, /* Invalid collating element. */
- REG_EPAREN, /* Un-matched parenthesis group operators. */
- REG_ESUBREG, /* Invalid back reference to a subexpression. */
- REG_EEND, /* Non specific error. This is not defined by POSIX.2. */
- REG_EESCAPE, /* Trailing backslash. */
- REG_BADPAT, /* Invalid use of pattern operators such as group or list. */
- REG_ESIZE, /* Compiled regular expression requires a pattern buffer
- larger than 64Kb. This is not defined by POSIX.2. */
- REG_ESPACE /* regcomp ran out of space */
-};
-
-char * re_comp(char * regex);
-int re_exec(char * string);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/resolv.h b/mdk-stage1/dietlibc/include/resolv.h
deleted file mode 100644
index dae226582..000000000
--- a/mdk-stage1/dietlibc/include/resolv.h
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef _RESOLV_H
-#define _RESOLV_H
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <netinet/in.h>
-
-#ifndef _PATH_RESCONF
-#define _PATH_RESCONF "/etc/resolv.conf"
-#endif
-
-/*
- * Global defines and variables for resolver stub.
- */
-#define MAXNS 8 /* max # name servers we'll track */
-#define MAXDFLSRCH 3 /* # default domain levels to try */
-#define MAXDNSRCH 6 /* max # domains in search path */
-#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
-
-#define RES_TIMEOUT 5 /* min. seconds between retries */
-#define MAXRESOLVSORT 10 /* number of net to sort on */
-#define RES_MAXNDOTS 15 /* should reflect bit field size */
-
-struct res_state {
- int retrans; /* retransmission time interval */
- int retry; /* number of times to retransmit */
- unsigned long options; /* option flags - see below. */
- int nscount; /* number of name servers */
- struct sockaddr_in_pad
- nsaddr_list[MAXNS]; /* address of name server */
-#define nsaddr nsaddr_list[0] /* for backward compatibility */
- unsigned short id; /* current message id */
- char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
- char defdname[256]; /* default domain (deprecated) */
- unsigned long pfcode; /* RES_PRF_ flags - see below. */
- unsigned ndots:4; /* threshold for initial abs. query */
- unsigned nsort:4; /* number of elements in sort_list[] */
- char unused[3];
- struct {
- struct in_addr addr;
- uint32_t mask;
- } sort_list[MAXRESOLVSORT];
- char pad[72]; /* on an i386 this means 512b total */
-};
-
-/*
- * Resolver options (keep these in synch with res_debug.c, please)
- */
-#define RES_INIT 0x00000001 /* address initialized */
-#define RES_DEBUG 0x00000002 /* print debug messages */
-#define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
-#define RES_USEVC 0x00000008 /* use virtual circuit */
-#define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
-#define RES_IGNTC 0x00000020 /* ignore trucation errors */
-#define RES_RECURSE 0x00000040 /* recursion desired */
-#define RES_DEFNAMES 0x00000080 /* use default domain name */
-#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
-#define RES_DNSRCH 0x00000200 /* search up local domain tree */
-#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
-#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
-#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
-
-#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
-
-/*
- * Resolver "pfcode" values. Used by dig.
- */
-#define RES_PRF_STATS 0x00000001
-/* 0x00000002 */
-#define RES_PRF_CLASS 0x00000004
-#define RES_PRF_CMD 0x00000008
-#define RES_PRF_QUES 0x00000010
-#define RES_PRF_ANS 0x00000020
-#define RES_PRF_AUTH 0x00000040
-#define RES_PRF_ADD 0x00000080
-#define RES_PRF_HEAD1 0x00000100
-#define RES_PRF_HEAD2 0x00000200
-#define RES_PRF_TTLID 0x00000400
-#define RES_PRF_HEADX 0x00000800
-#define RES_PRF_QUERY 0x00001000
-#define RES_PRF_REPLY 0x00002000
-#define RES_PRF_INIT 0x00004000
-/* 0x00008000 */
-
-struct res_sym {
- int number; /* Identifying number, like T_MX */
- char * name; /* Its symbolic name, like "MX" */
- char * humanname; /* Its fun name, like "mail exchanger" */
-};
-
-extern struct res_state _res;
-extern const struct res_sym __p_class_syms[];
-extern const struct res_sym __p_type_syms[];
-
-int res_init(void) __THROW;
-
-int res_query(const char *dname, int class, int type,
- unsigned char *answer, int anslen) __THROW;
-
-int res_search(const char *dname, int class, int type,
- unsigned char *answer, int anslen) __THROW;
-
-int res_querydomain(const char *name, const char *domain,
- int class, int type, unsigned char *answer,
- int anslen) __THROW;
-
-int res_mkquery(int op, const char *dname, int class,
- int type, char *data, int datalen, const unsigned char* newrr,
- char *buf, int buflen) __THROW;
-
-int res_send(const char *msg, int msglen, char *answer,
- int anslen) __THROW;
-
-int dn_comp(unsigned char *msg, unsigned char *comp_dn,
- int length, unsigned char **dnptrs, unsigned char *exp_dn,
- unsigned char **lastdnptr) __THROW;
-
-int dn_expand(unsigned char *msg, unsigned char *eomorig,
- unsigned char *comp_dn, unsigned char *exp_dn,
- int length) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/rpc/auth.h b/mdk-stage1/dietlibc/include/rpc/auth.h
deleted file mode 100644
index 6e0ae0675..000000000
--- a/mdk-stage1/dietlibc/include/rpc/auth.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* @(#)auth.h 2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * auth.h, Authentication interface.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * The data structures are completely opaque to the client. The client
- * is required to pass a AUTH * to routines that create rpc
- * "sessions".
- */
-
-#ifndef _RPC_AUTH_H
-
-#define _RPC_AUTH_H 1
-#include <sys/cdefs.h>
-#include <sys/socket.h>
-#include <rpc/xdr.h>
-
-__BEGIN_DECLS
-
-#define MAX_AUTH_BYTES 400
-#define MAXNETNAMELEN 255 /* maximum length of network user's name */
-
-/*
- * Status returned from authentication check
- */
-enum auth_stat {
- AUTH_OK=0,
- /*
- * failed at remote end
- */
- AUTH_BADCRED=1, /* bogus credentials (seal broken) */
- AUTH_REJECTEDCRED=2, /* client should begin new session */
- AUTH_BADVERF=3, /* bogus verifier (seal broken) */
- AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */
- AUTH_TOOWEAK=5, /* rejected due to security reasons */
- /*
- * failed locally
- */
- AUTH_INVALIDRESP=6, /* bogus response verifier */
- AUTH_FAILED=7 /* some unknown reason */
-};
-
-union des_block {
- struct {
- uint32_t high;
- uint32_t low;
- } key;
- char c[8];
-};
-typedef union des_block des_block;
-extern bool_t xdr_des_block (XDR *__xdrs, des_block *__blkp) __THROW;
-
-/*
- * Authentication info. Opaque to client.
- */
-struct opaque_auth {
- enum_t oa_flavor; /* flavor of auth */
- char* oa_base; /* address of more auth stuff */
- unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */
-};
-
-/*
- * Auth handle, interface to client side authenticators.
- */
-typedef struct AUTH AUTH;
-struct AUTH {
- struct opaque_auth ah_cred;
- struct opaque_auth ah_verf;
- union des_block ah_key;
- struct auth_ops {
- void (*ah_nextverf) (AUTH *);
- int (*ah_marshal) (AUTH *, XDR *); /* nextverf & serialize */
- int (*ah_validate) (AUTH *, struct opaque_auth *);
- /* validate verifier */
- int (*ah_refresh) (AUTH *); /* refresh credentials */
- void (*ah_destroy) (AUTH *); /* destroy this structure */
- } *ah_ops;
- char* ah_private;
-};
-
-
-/*
- * Authentication ops.
- * The ops and the auth handle provide the interface to the authenticators.
- *
- * AUTH *auth;
- * XDR *xdrs;
- * struct opaque_auth verf;
- */
-#define AUTH_NEXTVERF(auth) \
- ((*((auth)->ah_ops->ah_nextverf))(auth))
-#define auth_nextverf(auth) \
- ((*((auth)->ah_ops->ah_nextverf))(auth))
-
-#define AUTH_MARSHALL(auth, xdrs) \
- ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
-#define auth_marshall(auth, xdrs) \
- ((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
-
-#define AUTH_VALIDATE(auth, verfp) \
- ((*((auth)->ah_ops->ah_validate))((auth), verfp))
-#define auth_validate(auth, verfp) \
- ((*((auth)->ah_ops->ah_validate))((auth), verfp))
-
-#define AUTH_REFRESH(auth) \
- ((*((auth)->ah_ops->ah_refresh))(auth))
-#define auth_refresh(auth) \
- ((*((auth)->ah_ops->ah_refresh))(auth))
-
-#define AUTH_DESTROY(auth) \
- ((*((auth)->ah_ops->ah_destroy))(auth))
-#define auth_destroy(auth) \
- ((*((auth)->ah_ops->ah_destroy))(auth))
-
-
-extern struct opaque_auth _null_auth;
-
-
-/*
- * These are the various implementations of client side authenticators.
- */
-
-/*
- * Unix style authentication
- * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
- * char *machname;
- * int uid;
- * int gid;
- * int len;
- * int *aup_gids;
- */
-extern AUTH *authunix_create (char *__machname,uid_t __uid, gid_t __gid,
- int __len, gid_t *__aup_gids) __THROW;
-extern AUTH *authunix_create_default (void) __THROW;
-extern AUTH *authnone_create (void) __THROW;
-extern AUTH *authdes_create (const char *__servername, unsigned int __window,
- struct sockaddr *__syncaddr, des_block *__ckey)
- __THROW;
-extern AUTH *authdes_pk_create (const char *, netobj *, unsigned int,
- struct sockaddr *, des_block *) __THROW;
-
-
-#define AUTH_NONE 0 /* no authentication */
-#define AUTH_NULL 0 /* backward compatibility */
-#define AUTH_SYS 1 /* unix style (uid, gids) */
-#define AUTH_UNIX AUTH_SYS
-#define AUTH_SHORT 2 /* short hand unix style */
-#define AUTH_DES 3 /* des style (encrypted timestamps) */
-#define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */
-#define AUTH_KERB 4 /* kerberos style */
-
-/*
- * Netname manipulating functions
- *
- */
-extern int getnetname (char *) __THROW;
-extern int host2netname (char *, const char *, const char *) __THROW;
-extern int user2netname (char *, const uid_t, const char *) __THROW;
-extern int netname2user (const char *, uid_t *, gid_t *, int *, gid_t *)
- __THROW;
-extern int netname2host (const char *, char *, const int) __THROW;
-
-/*
- *
- * These routines interface to the keyserv daemon
- *
- */
-extern int key_decryptsession (char *, des_block *) __THROW;
-extern int key_decryptsession_pk (char *, netobj *, des_block *) __THROW;
-extern int key_encryptsession (char *, des_block *) __THROW;
-extern int key_encryptsession_pk (char *, netobj *, des_block *) __THROW;
-extern int key_gendes (des_block *) __THROW;
-extern int key_setsecret (char *) __THROW;
-extern int key_secretkey_is_set (void) __THROW;
-extern int key_get_conv (char *, des_block *) __THROW;
-
-/*
- * XDR an opaque authentication struct.
- */
-extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *) __THROW;
-
-__END_DECLS
-
-#endif /* rpc/auth.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/auth_des.h b/mdk-stage1/dietlibc/include/rpc/auth_des.h
deleted file mode 100644
index 8accd3779..000000000
--- a/mdk-stage1/dietlibc/include/rpc/auth_des.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _RPC_AUTH_DES_H
-#define _RPC_AUTH_DES_H 1
-
-#include <sys/cdefs.h>
-#include <rpc/auth.h>
-
-__BEGIN_DECLS
-
-/* There are two kinds of "names": fullnames and nicknames */
-enum authdes_namekind
- {
- ADN_FULLNAME,
- ADN_NICKNAME
- };
-
-/* A fullname contains the network name of the client,
- a conversation key and the window */
-struct authdes_fullname
- {
- char *name; /* network name of client, up to MAXNETNAMELEN */
- des_block key; /* conversation key */
- uint32_t window; /* associated window */
- };
-
-/* A credential */
-struct authdes_cred
- {
- enum authdes_namekind adc_namekind;
- struct authdes_fullname adc_fullname;
- uint32_t adc_nickname;
- };
-
-/* A timeval replacement for !32bit platforms */
-struct rpc_timeval
- {
- uint32_t tv_sec; /* Seconds. */
- uint32_t tv_usec; /* Microseconds. */
- };
-
-/* A des authentication verifier */
-struct authdes_verf
- {
- union
- {
- struct rpc_timeval adv_ctime; /* clear time */
- des_block adv_xtime; /* crypt time */
- }
- adv_time_u;
- uint32_t adv_int_u;
- };
-
-/* des authentication verifier: client variety
-
- adv_timestamp is the current time.
- adv_winverf is the credential window + 1.
- Both are encrypted using the conversation key. */
-#define adv_timestamp adv_time_u.adv_ctime
-#define adv_xtimestamp adv_time_u.adv_xtime
-#define adv_winverf adv_int_u
-
-/* des authentication verifier: server variety
-
- adv_timeverf is the client's timestamp + client's window
- adv_nickname is the server's nickname for the client.
- adv_timeverf is encrypted using the conversation key. */
-#define adv_timeverf adv_time_u.adv_ctime
-#define adv_xtimeverf adv_time_u.adv_xtime
-#define adv_nickname adv_int_u
-
-/* Map a des credential into a unix cred. */
-extern int authdes_getucred (const struct authdes_cred * __adc,
- uid_t * __uid, gid_t * __gid,
- short *__grouplen, gid_t * __groups) __THROW;
-
-/* Get the public key for NAME and place it in KEY. NAME can only be
- up to MAXNETNAMELEN bytes long and the destination buffer KEY should
- have HEXKEYBYTES + 1 bytes long to fit all characters from the key. */
-extern int getpublickey (const char *__name, char *__key) __THROW;
-
-/* Get the secret key for NAME and place it in KEY. PASSWD is used to
- decrypt the encrypted key stored in the database. NAME can only be
- up to MAXNETNAMELEN bytes long and the destination buffer KEY
- should have HEXKEYBYTES + 1 bytes long to fit all characters from
- the key. */
-extern int getsecretkey (const char *__name, char *__key,
- const char *__passwd) __THROW;
-
-extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep,
- struct rpc_timeval *__timeout) __THROW;
-
-__END_DECLS
-
-
-#endif /* rpc/auth_des.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/auth_unix.h b/mdk-stage1/dietlibc/include/rpc/auth_unix.h
deleted file mode 100644
index 9dd8142f1..000000000
--- a/mdk-stage1/dietlibc/include/rpc/auth_unix.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC; from 1.8 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/* @(#)auth_unix.h 1.5 86/07/16 SMI */
-
-/*
- * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-/*
- * The system is very weak. The client uses no encryption for it
- * credentials and only sends null verifiers. The server sends backs
- * null verifiers or optionally a verifier that suggests a new short hand
- * for the credentials.
- */
-
-#ifndef _RPC_AUTH_UNIX_H
-#define _RPC_AUTH_UNIX_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <rpc/types.h>
-#include <rpc/auth.h>
-#include <rpc/xdr.h>
-
-__BEGIN_DECLS
-
-/* The machine name is part of a credential; it may not exceed 255 bytes */
-#define MAX_MACHINE_NAME 255
-
-/* gids compose part of a credential; there may not be more than 16 of them */
-#define NGRPS 16
-
-/*
- * Unix style credentials.
- */
-struct authunix_parms
- {
- unsigned long aup_time;
- char *aup_machname;
- uid_t aup_uid;
- gid_t aup_gid;
- unsigned int aup_len;
- gid_t *aup_gids;
- };
-
-extern bool_t xdr_authunix_parms (XDR *__xdrs, struct authunix_parms *__p)
- __THROW;
-
-/*
- * If a response verifier has flavor AUTH_SHORT,
- * then the body of the response verifier encapsulates the following structure;
- * again it is serialized in the obvious fashion.
- */
-struct short_hand_verf
- {
- struct opaque_auth new_cred;
- };
-
-__END_DECLS
-
-#endif /* rpc/auth_unix.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/clnt.h b/mdk-stage1/dietlibc/include/rpc/clnt.h
deleted file mode 100644
index 9b100556c..000000000
--- a/mdk-stage1/dietlibc/include/rpc/clnt.h
+++ /dev/null
@@ -1,421 +0,0 @@
-/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * clnt.h - Client side remote procedure call interface.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_CLNT_H
-#define _RPC_CLNT_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <rpc/types.h>
-#include <rpc/auth.h>
-#include <sys/un.h>
-
-__BEGIN_DECLS
-
-/*
- * Rpc calls return an enum clnt_stat. This should be looked at more,
- * since each implementation is required to live with this (implementation
- * independent) list of errors.
- */
-enum clnt_stat {
- RPC_SUCCESS=0, /* call succeeded */
- /*
- * local errors
- */
- RPC_CANTENCODEARGS=1, /* can't encode arguments */
- RPC_CANTDECODERES=2, /* can't decode results */
- RPC_CANTSEND=3, /* failure in sending call */
- RPC_CANTRECV=4, /* failure in receiving result */
- RPC_TIMEDOUT=5, /* call timed out */
- /*
- * remote errors
- */
- RPC_VERSMISMATCH=6, /* rpc versions not compatible */
- RPC_AUTHERROR=7, /* authentication error */
- RPC_PROGUNAVAIL=8, /* program not available */
- RPC_PROGVERSMISMATCH=9, /* program version mismatched */
- RPC_PROCUNAVAIL=10, /* procedure unavailable */
- RPC_CANTDECODEARGS=11, /* decode arguments error */
- RPC_SYSTEMERROR=12, /* generic "other problem" */
- RPC_NOBROADCAST = 21, /* Broadcasting not supported */
- /*
- * callrpc & clnt_create errors
- */
- RPC_UNKNOWNHOST=13, /* unknown host name */
- RPC_UNKNOWNPROTO=17, /* unknown protocol */
- RPC_UNKNOWNADDR = 19, /* Remote address unknown */
-
- /*
- * rpcbind errors
- */
- RPC_RPCBFAILURE=14, /* portmapper failed in its call */
-#define RPC_PMAPFAILURE RPC_RPCBFAILURE
- RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
- RPC_N2AXLATEFAILURE = 22, /* Name to addr translation failed */
- /*
- * unspecified error
- */
- RPC_FAILED=16,
- RPC_INTR=18,
- RPC_TLIERROR=20,
- RPC_UDERROR=23,
- /*
- * asynchronous errors
- */
- RPC_INPROGRESS = 24,
- RPC_STALERACHANDLE = 25
-};
-
-
-/*
- * Error info.
- */
-struct rpc_err {
- enum clnt_stat re_status;
- union {
- int RE_errno; /* related system error */
- enum auth_stat RE_why; /* why the auth error occurred */
- struct {
- unsigned long low; /* lowest verion supported */
- unsigned long high; /* highest verion supported */
- } RE_vers;
- struct { /* maybe meaningful if RPC_FAILED */
- long s1;
- long s2;
- } RE_lb; /* life boot & debugging only */
- } ru;
-#define re_errno ru.RE_errno
-#define re_why ru.RE_why
-#define re_vers ru.RE_vers
-#define re_lb ru.RE_lb
-};
-
-
-/*
- * Client rpc handle.
- * Created by individual implementations, see e.g. rpc_udp.c.
- * Client is responsible for initializing auth, see e.g. auth_none.c.
- */
-typedef struct CLIENT CLIENT;
-struct CLIENT {
- AUTH *cl_auth; /* authenticator */
- struct clnt_ops {
- enum clnt_stat (*cl_call) (CLIENT *, unsigned long, xdrproc_t, char*, xdrproc_t,
- char*, struct timeval);
- /* call remote procedure */
- void (*cl_abort) (void); /* abort a call */
- void (*cl_geterr) (CLIENT *, struct rpc_err *);
- /* get specific error code */
- bool_t (*cl_freeres) (CLIENT *, xdrproc_t, char*);
- /* frees results */
- void (*cl_destroy) (CLIENT *); /* destroy this structure */
- bool_t (*cl_control) (CLIENT *, int, char *);
- /* the ioctl() of rpc */
- } *cl_ops;
- char* cl_private; /* private stuff */
-};
-
-
-/*
- * client side rpc interface ops
- *
- * Parameter types are:
- *
- */
-
-/*
- * enum clnt_stat
- * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
- * CLIENT *rh;
- * unsigned long proc;
- * xdrproc_t xargs;
- * char* argsp;
- * xdrproc_t xres;
- * char* resp;
- * struct timeval timeout;
- */
-#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
- ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
-#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
- ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
-
-/*
- * void
- * CLNT_ABORT(rh);
- * CLIENT *rh;
- */
-#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
-#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
-
-/*
- * struct rpc_err
- * CLNT_GETERR(rh);
- * CLIENT *rh;
- */
-#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
-#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
-
-
-/*
- * bool_t
- * CLNT_FREERES(rh, xres, resp);
- * CLIENT *rh;
- * xdrproc_t xres;
- * char* resp;
- */
-#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
-
-/*
- * bool_t
- * CLNT_CONTROL(cl, request, info)
- * CLIENT *cl;
- * unsigned int request;
- * char *info;
- */
-#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
-
-/*
- * control operations that apply to all transports
- *
- * Note: options marked XXX are no-ops in this implementation of RPC.
- * The are present in TI-RPC but can't be implemented here since they
- * depend on the presence of STREAMS/TLI, which we don't have.
- */
-#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
-#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
-#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
-#define CLGET_FD 6 /* get connections file descriptor */
-#define CLGET_SVC_ADDR 7 /* get server's address (netbuf) XXX */
-#define CLSET_FD_CLOSE 8 /* close fd while clnt_destroy */
-#define CLSET_FD_NCLOSE 9 /* Do not close fd while clnt_destroy*/
-#define CLGET_XID 10 /* Get xid */
-#define CLSET_XID 11 /* Set xid */
-#define CLGET_VERS 12 /* Get version number */
-#define CLSET_VERS 13 /* Set version number */
-#define CLGET_PROG 14 /* Get program number */
-#define CLSET_PROG 15 /* Set program number */
-#define CLSET_SVC_ADDR 16 /* get server's address (netbuf) XXX */
-#define CLSET_PUSH_TIMOD 17 /* push timod if not already present XXX */
-#define CLSET_POP_TIMOD 18 /* pop timod XXX */
-/*
- * Connectionless only control operations
- */
-#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
-#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
-
-/*
- * void
- * CLNT_DESTROY(rh);
- * CLIENT *rh;
- */
-#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
-#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
-
-
-/*
- * RPCTEST is a test program which is accessible on every rpc
- * transport/port. It is used for testing, performance evaluation,
- * and network administration.
- */
-
-#define RPCTEST_PROGRAM ((unsigned long)1)
-#define RPCTEST_VERSION ((unsigned long)1)
-#define RPCTEST_NULL_PROC ((unsigned long)2)
-#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3)
-
-/*
- * By convention, procedure 0 takes null arguments and returns them
- */
-
-#define NULLPROC ((unsigned long)0)
-
-/*
- * Below are the client handle creation routines for the various
- * implementations of client side rpc. They can return NULL if a
- * creation failure occurs.
- */
-
-/*
- * Memory based rpc (for speed check and testing)
- * CLIENT *
- * clntraw_create(prog, vers)
- * unsigned long prog;
- * unsigned long vers;
- */
-extern CLIENT *clntraw_create (const unsigned long __prog, const unsigned long __vers)
- __THROW;
-
-
-/*
- * Generic client creation routine. Supported protocols are "udp", "tcp" and
- * "unix"
- * CLIENT *
- * clnt_create(host, prog, vers, prot)
- * char *host; -- hostname
- * unsigned long prog; -- program number
- * u_ong vers; -- version number
- * char *prot; -- protocol
- */
-extern CLIENT *clnt_create (const char *__host, const unsigned long __prog,
- const unsigned long __vers, const char *__prot)
- __THROW;
-
-
-/*
- * TCP based rpc
- * CLIENT *
- * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
- * struct sockaddr_in *raddr;
- * unsigned long prog;
- * unsigned long version;
- * register int *sockp;
- * unsigned int sendsz;
- * unsigned int recvsz;
- */
-extern CLIENT *clnttcp_create (struct sockaddr_in *__raddr, unsigned long __prog,
- unsigned long __version, int *__sockp, unsigned int __sendsz,
- unsigned int __recvsz) __THROW;
-
-/*
- * UDP based rpc.
- * CLIENT *
- * clntudp_create(raddr, program, version, wait, sockp)
- * struct sockaddr_in *raddr;
- * unsigned long program;
- * unsigned long version;
- * struct timeval wait_resend;
- * int *sockp;
- *
- * Same as above, but you specify max packet sizes.
- * CLIENT *
- * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
- * struct sockaddr_in *raddr;
- * unsigned long program;
- * unsigned long version;
- * struct timeval wait_resend;
- * int *sockp;
- * unsigned int sendsz;
- * unsigned int recvsz;
- */
-extern CLIENT *clntudp_create (struct sockaddr_in *__raddr, unsigned long __program,
- unsigned long __version, struct timeval __wait_resend,
- int *__sockp) __THROW;
-extern CLIENT *clntudp_bufcreate (struct sockaddr_in *__raddr,
- unsigned long __program, unsigned long __version,
- struct timeval __wait_resend, int *__sockp,
- unsigned int __sendsz, unsigned int __recvsz) __THROW;
-
-
-
-
-/*
- * AF_UNIX based rpc
- * CLIENT *
- * clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
- * struct sockaddr_un *raddr;
- * unsigned long prog;
- * unsigned long version;
- * register int *sockp;
- * unsigned int sendsz;
- * unsigned int recvsz;
- */
-extern CLIENT *clntunix_create (struct sockaddr_un *__raddr, unsigned long __program,
- unsigned long __version, int *__sockp,
- unsigned int __sendsz, unsigned int __recvsz) __THROW;
-
-
-extern int callrpc (const char *__host, const unsigned long __prognum,
- const unsigned long __versnum, const unsigned long __procnum,
- const xdrproc_t __inproc, const char *__in,
- const xdrproc_t __outproc, char *__out) __THROW;
-extern int _rpc_dtablesize (void) __THROW;
-
-/*
- * Print why creation failed
- */
-extern void clnt_pcreateerror (const char *__msg) __THROW; /* stderr */
-extern char *clnt_spcreateerror(const char *__msg) __THROW; /* string */
-
-/*
- * Like clnt_perror(), but is more verbose in its output
- */
-extern void clnt_perrno (enum clnt_stat __num) __THROW; /* stderr */
-
-/*
- * Print an English error message, given the client error code
- */
-extern void clnt_perror (CLIENT *__clnt, const char *__msg) __THROW;
- /* stderr */
-extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW;
- /* string */
-
-/*
- * If a creation fails, the following allows the user to figure out why.
- */
-struct rpc_createerr {
- enum clnt_stat cf_stat;
- struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
-};
-
-extern struct rpc_createerr rpc_createerr;
-
-
-
-/*
- * Copy error message to buffer.
- */
-extern char *clnt_sperrno (enum clnt_stat __num) __THROW; /* string */
-
-/*
- * get the port number on the host for the rpc program,version and proto
- */
-extern int getrpcport (const char * __host, unsigned long __prognum,
- unsigned long __versnum, unsigned int proto) __THROW;
-
-/*
- * get the local host's IP address without consulting
- * name service library functions
- */
-extern void get_myaddress (struct sockaddr_in *) __THROW;
-
-#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
-#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
-
-__END_DECLS
-
-#endif /* rpc/clnt.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/des_crypt.h b/mdk-stage1/dietlibc/include/rpc/des_crypt.h
deleted file mode 100644
index 6a65887d3..000000000
--- a/mdk-stage1/dietlibc/include/rpc/des_crypt.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * @(#)des_crypt.h 2.1 88/08/11 4.0 RPCSRC; from 1.4 88/02/08 (C) 1986 SMI
- *
- * des_crypt.h, des library routine interface
- * Copyright (C) 1986, Sun Microsystems, Inc.
- */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-#ifndef __DES_CRYPT_H__
-#define __DES_CRYPT_H__ 1
-
-#include <features.h>
-
-__BEGIN_DECLS
-
-#define DES_MAXDATA 8192 /* max bytes encrypted in one call */
-#define DES_DIRMASK (1 << 0)
-#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */
-#define DES_DECRYPT (1*DES_DIRMASK) /* Decrypt */
-
-
-#define DES_DEVMASK (1 << 1)
-#define DES_HW (0*DES_DEVMASK) /* Use hardware device */
-#define DES_SW (1*DES_DEVMASK) /* Use software device */
-
-
-#define DESERR_NONE 0 /* succeeded */
-#define DESERR_NOHWDEVICE 1 /* succeeded, but hw device not available */
-#define DESERR_HWERROR 2 /* failed, hardware/driver error */
-#define DESERR_BADPARAM 3 /* failed, bad parameter to call */
-
-#define DES_FAILED(err) \
- ((err) > DESERR_NOHWDEVICE)
-
-/*
- * cbc_crypt()
- * ecb_crypt()
- *
- * Encrypt (or decrypt) len bytes of a buffer buf.
- * The length must be a multiple of eight.
- * The key should have odd parity in the low bit of each byte.
- * ivec is the input vector, and is updated to the new one (cbc only).
- * The mode is created by oring together the appropriate parameters.
- * DESERR_NOHWDEVICE is returned if DES_HW was specified but
- * there was no hardware to do it on (the data will still be
- * encrypted though, in software).
- */
-
-
-/*
- * Cipher Block Chaining mode
- */
-extern int cbc_crypt (char *__key, char *__buf, unsigned __len,
- unsigned __mode, char *__ivec) __THROW;
-
-/*
- * Electronic Code Book mode
- */
-extern int ecb_crypt (char *__key, char *__buf, unsigned __len,
- unsigned __mode) __THROW;
-
-/*
- * Set des parity for a key.
- * DES parity is odd and in the low bit of each byte
- */
-extern void des_setparity (char *__key) __THROW;
-
-__END_DECLS
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/rpc/key_prot.h b/mdk-stage1/dietlibc/include/rpc/key_prot.h
deleted file mode 100644
index c398b82f8..000000000
--- a/mdk-stage1/dietlibc/include/rpc/key_prot.h
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Please do not edit this file.
- * It was generated using rpcgen.
- */
-
-#ifndef _KEY_PROT_H_RPCGEN
-#define _KEY_PROT_H_RPCGEN
-
-#include <rpc/rpc.h>
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if 0
-#pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
-#endif
-/* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
-
-/*
- * Compiled from key_prot.x using rpcgen.
- * DO NOT EDIT THIS FILE!
- * This is NOT source code!
- */
-#define PROOT 3
-#define HEXMODULUS "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b"
-#define HEXKEYBYTES 48
-#define KEYSIZE 192
-#define KEYBYTES 24
-#define KEYCHECKSUMSIZE 16
-
-enum keystatus {
- KEY_SUCCESS = 0,
- KEY_NOSECRET = 1,
- KEY_UNKNOWN = 2,
- KEY_SYSTEMERR = 3,
-};
-typedef enum keystatus keystatus;
-#ifdef __cplusplus
-extern "C" bool_t xdr_keystatus(XDR *, keystatus*);
-#elif __STDC__
-extern bool_t xdr_keystatus(XDR *, keystatus*);
-#else /* Old Style C */
-bool_t xdr_keystatus();
-#endif /* Old Style C */
-
-
-typedef char keybuf[HEXKEYBYTES];
-#ifdef __cplusplus
-extern "C" bool_t xdr_keybuf(XDR *, keybuf);
-#elif __STDC__
-extern bool_t xdr_keybuf(XDR *, keybuf);
-#else /* Old Style C */
-bool_t xdr_keybuf();
-#endif /* Old Style C */
-
-
-typedef char *netnamestr;
-#ifdef __cplusplus
-extern "C" bool_t xdr_netnamestr(XDR *, netnamestr*);
-#elif __STDC__
-extern bool_t xdr_netnamestr(XDR *, netnamestr*);
-#else /* Old Style C */
-bool_t xdr_netnamestr();
-#endif /* Old Style C */
-
-
-struct cryptkeyarg {
- netnamestr remotename;
- des_block deskey;
-};
-typedef struct cryptkeyarg cryptkeyarg;
-#ifdef __cplusplus
-extern "C" bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
-#elif __STDC__
-extern bool_t xdr_cryptkeyarg(XDR *, cryptkeyarg*);
-#else /* Old Style C */
-bool_t xdr_cryptkeyarg();
-#endif /* Old Style C */
-
-
-struct cryptkeyarg2 {
- netnamestr remotename;
- netobj remotekey;
- des_block deskey;
-};
-typedef struct cryptkeyarg2 cryptkeyarg2;
-#ifdef __cplusplus
-extern "C" bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
-#elif __STDC__
-extern bool_t xdr_cryptkeyarg2(XDR *, cryptkeyarg2*);
-#else /* Old Style C */
-bool_t xdr_cryptkeyarg2();
-#endif /* Old Style C */
-
-
-struct cryptkeyres {
- keystatus status;
- union {
- des_block deskey;
- } cryptkeyres_u;
-};
-typedef struct cryptkeyres cryptkeyres;
-#ifdef __cplusplus
-extern "C" bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
-#elif __STDC__
-extern bool_t xdr_cryptkeyres(XDR *, cryptkeyres*);
-#else /* Old Style C */
-bool_t xdr_cryptkeyres();
-#endif /* Old Style C */
-
-#define MAXGIDS 16
-
-struct unixcred {
- unsigned int uid;
- unsigned int gid;
- struct {
- unsigned int gids_len;
- unsigned int *gids_val;
- } gids;
-};
-typedef struct unixcred unixcred;
-#ifdef __cplusplus
-extern "C" bool_t xdr_unixcred(XDR *, unixcred*);
-#elif __STDC__
-extern bool_t xdr_unixcred(XDR *, unixcred*);
-#else /* Old Style C */
-bool_t xdr_unixcred();
-#endif /* Old Style C */
-
-
-struct getcredres {
- keystatus status;
- union {
- unixcred cred;
- } getcredres_u;
-};
-typedef struct getcredres getcredres;
-#ifdef __cplusplus
-extern "C" bool_t xdr_getcredres(XDR *, getcredres*);
-#elif __STDC__
-extern bool_t xdr_getcredres(XDR *, getcredres*);
-#else /* Old Style C */
-bool_t xdr_getcredres();
-#endif /* Old Style C */
-
-
-struct key_netstarg {
- keybuf st_priv_key;
- keybuf st_pub_key;
- netnamestr st_netname;
-};
-typedef struct key_netstarg key_netstarg;
-#ifdef __cplusplus
-extern "C" bool_t xdr_key_netstarg(XDR *, key_netstarg*);
-#elif __STDC__
-extern bool_t xdr_key_netstarg(XDR *, key_netstarg*);
-#else /* Old Style C */
-bool_t xdr_key_netstarg();
-#endif /* Old Style C */
-
-
-struct key_netstres {
- keystatus status;
- union {
- key_netstarg knet;
- } key_netstres_u;
-};
-typedef struct key_netstres key_netstres;
-#ifdef __cplusplus
-extern "C" bool_t xdr_key_netstres(XDR *, key_netstres*);
-#elif __STDC__
-extern bool_t xdr_key_netstres(XDR *, key_netstres*);
-#else /* Old Style C */
-bool_t xdr_key_netstres();
-#endif /* Old Style C */
-
-
-#ifndef opaque
-#define opaque char
-#endif
-
-
-#define KEY_PROG ((unsigned long)100029)
-#define KEY_VERS ((unsigned long)1)
-
-#ifdef __cplusplus
-#define KEY_SET ((unsigned long)1)
-extern "C" keystatus * key_set_1(opaque *, CLIENT *);
-extern "C" keystatus * key_set_1_svc(opaque *, struct svc_req *);
-#define KEY_ENCRYPT ((unsigned long)2)
-extern "C" cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
-extern "C" cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
-#define KEY_DECRYPT ((unsigned long)3)
-extern "C" cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
-extern "C" cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
-#define KEY_GEN ((unsigned long)4)
-extern "C" des_block * key_gen_1(void *, CLIENT *);
-extern "C" des_block * key_gen_1_svc(void *, struct svc_req *);
-#define KEY_GETCRED ((unsigned long)5)
-extern "C" getcredres * key_getcred_1(netnamestr *, CLIENT *);
-extern "C" getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
-
-#elif __STDC__
-#define KEY_SET ((unsigned long)1)
-extern keystatus * key_set_1(opaque *, CLIENT *);
-extern keystatus * key_set_1_svc(opaque *, struct svc_req *);
-#define KEY_ENCRYPT ((unsigned long)2)
-extern cryptkeyres * key_encrypt_1(cryptkeyarg *, CLIENT *);
-extern cryptkeyres * key_encrypt_1_svc(cryptkeyarg *, struct svc_req *);
-#define KEY_DECRYPT ((unsigned long)3)
-extern cryptkeyres * key_decrypt_1(cryptkeyarg *, CLIENT *);
-extern cryptkeyres * key_decrypt_1_svc(cryptkeyarg *, struct svc_req *);
-#define KEY_GEN ((unsigned long)4)
-extern des_block * key_gen_1(void *, CLIENT *);
-extern des_block * key_gen_1_svc(void *, struct svc_req *);
-#define KEY_GETCRED ((unsigned long)5)
-extern getcredres * key_getcred_1(netnamestr *, CLIENT *);
-extern getcredres * key_getcred_1_svc(netnamestr *, struct svc_req *);
-
-#else /* Old Style C */
-#define KEY_SET ((unsigned long)1)
-extern keystatus * key_set_1();
-extern keystatus * key_set_1_svc();
-#define KEY_ENCRYPT ((unsigned long)2)
-extern cryptkeyres * key_encrypt_1();
-extern cryptkeyres * key_encrypt_1_svc();
-#define KEY_DECRYPT ((unsigned long)3)
-extern cryptkeyres * key_decrypt_1();
-extern cryptkeyres * key_decrypt_1_svc();
-#define KEY_GEN ((unsigned long)4)
-extern des_block * key_gen_1();
-extern des_block * key_gen_1_svc();
-#define KEY_GETCRED ((unsigned long)5)
-extern getcredres * key_getcred_1();
-extern getcredres * key_getcred_1_svc();
-#endif /* Old Style C */
-#define KEY_VERS2 ((unsigned long)2)
-
-#ifdef __cplusplus
-extern "C" keystatus * key_set_2(opaque *, CLIENT *);
-extern "C" keystatus * key_set_2_svc(opaque *, struct svc_req *);
-extern "C" cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
-extern "C" cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
-extern "C" cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
-extern "C" cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
-extern "C" des_block * key_gen_2(void *, CLIENT *);
-extern "C" des_block * key_gen_2_svc(void *, struct svc_req *);
-extern "C" getcredres * key_getcred_2(netnamestr *, CLIENT *);
-extern "C" getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
-#define KEY_ENCRYPT_PK ((unsigned long)6)
-extern "C" cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
-extern "C" cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
-#define KEY_DECRYPT_PK ((unsigned long)7)
-extern "C" cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
-extern "C" cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
-#define KEY_NET_PUT ((unsigned long)8)
-extern "C" keystatus * key_net_put_2(key_netstarg *, CLIENT *);
-extern "C" keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
-#define KEY_NET_GET ((unsigned long)9)
-extern "C" key_netstres * key_net_get_2(void *, CLIENT *);
-extern "C" key_netstres * key_net_get_2_svc(void *, struct svc_req *);
-#define KEY_GET_CONV ((unsigned long)10)
-extern "C" cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
-extern "C" cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
-
-#elif __STDC__
-extern keystatus * key_set_2(opaque *, CLIENT *);
-extern keystatus * key_set_2_svc(opaque *, struct svc_req *);
-extern cryptkeyres * key_encrypt_2(cryptkeyarg *, CLIENT *);
-extern cryptkeyres * key_encrypt_2_svc(cryptkeyarg *, struct svc_req *);
-extern cryptkeyres * key_decrypt_2(cryptkeyarg *, CLIENT *);
-extern cryptkeyres * key_decrypt_2_svc(cryptkeyarg *, struct svc_req *);
-extern des_block * key_gen_2(void *, CLIENT *);
-extern des_block * key_gen_2_svc(void *, struct svc_req *);
-extern getcredres * key_getcred_2(netnamestr *, CLIENT *);
-extern getcredres * key_getcred_2_svc(netnamestr *, struct svc_req *);
-#define KEY_ENCRYPT_PK ((unsigned long)6)
-extern cryptkeyres * key_encrypt_pk_2(cryptkeyarg2 *, CLIENT *);
-extern cryptkeyres * key_encrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
-#define KEY_DECRYPT_PK ((unsigned long)7)
-extern cryptkeyres * key_decrypt_pk_2(cryptkeyarg2 *, CLIENT *);
-extern cryptkeyres * key_decrypt_pk_2_svc(cryptkeyarg2 *, struct svc_req *);
-#define KEY_NET_PUT ((unsigned long)8)
-extern keystatus * key_net_put_2(key_netstarg *, CLIENT *);
-extern keystatus * key_net_put_2_svc(key_netstarg *, struct svc_req *);
-#define KEY_NET_GET ((unsigned long)9)
-extern key_netstres * key_net_get_2(void *, CLIENT *);
-extern key_netstres * key_net_get_2_svc(void *, struct svc_req *);
-#define KEY_GET_CONV ((unsigned long)10)
-extern cryptkeyres * key_get_conv_2(opaque *, CLIENT *);
-extern cryptkeyres * key_get_conv_2_svc(opaque *, struct svc_req *);
-
-#else /* Old Style C */
-extern keystatus * key_set_2();
-extern keystatus * key_set_2_svc();
-extern cryptkeyres * key_encrypt_2();
-extern cryptkeyres * key_encrypt_2_svc();
-extern cryptkeyres * key_decrypt_2();
-extern cryptkeyres * key_decrypt_2_svc();
-extern des_block * key_gen_2();
-extern des_block * key_gen_2_svc();
-extern getcredres * key_getcred_2();
-extern getcredres * key_getcred_2_svc();
-#define KEY_ENCRYPT_PK ((unsigned long)6)
-extern cryptkeyres * key_encrypt_pk_2();
-extern cryptkeyres * key_encrypt_pk_2_svc();
-#define KEY_DECRYPT_PK ((unsigned long)7)
-extern cryptkeyres * key_decrypt_pk_2();
-extern cryptkeyres * key_decrypt_pk_2_svc();
-#define KEY_NET_PUT ((unsigned long)8)
-extern keystatus * key_net_put_2();
-extern keystatus * key_net_put_2_svc();
-#define KEY_NET_GET ((unsigned long)9)
-extern key_netstres * key_net_get_2();
-extern key_netstres * key_net_get_2_svc();
-#define KEY_GET_CONV ((unsigned long)10)
-extern cryptkeyres * key_get_conv_2();
-extern cryptkeyres * key_get_conv_2_svc();
-#endif /* Old Style C */
-
-#endif /* !_KEY_PROT_H_RPCGEN */
diff --git a/mdk-stage1/dietlibc/include/rpc/netdb.h b/mdk-stage1/dietlibc/include/rpc/netdb.h
deleted file mode 100644
index a991d3a95..000000000
--- a/mdk-stage1/dietlibc/include/rpc/netdb.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* @(#)netdb.h 2.1 88/07/29 3.9 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/* @(#)rpc.h 1.8 87/07/24 SMI */
-
-/* Cleaned up for GNU C library roland@gnu.ai.mit.edu:
- added multiple inclusion protection and use of <sys/cdefs.h>.
- In GNU this file is #include'd by <netdb.h>. */
-
-#ifndef _RPC_NETDB_H
-#define _RPC_NETDB_H 1
-
-#include <sys/cdefs.h>
-
-#define __need_size_t
-#include <stddef.h>
-
-__BEGIN_DECLS
-
-struct rpcent
-{
- char *r_name; /* Name of server for this rpc program. */
- char **r_aliases; /* Alias list. */
- int r_number; /* RPC program number. */
-};
-
-extern void setrpcent (int __stayopen) __THROW;
-extern void endrpcent (void) __THROW;
-extern struct rpcent *getrpcbyname (const char *__name) __THROW;
-extern struct rpcent *getrpcbynumber (int __number) __THROW;
-extern struct rpcent *getrpcent (void) __THROW;
-
-#ifdef __USE_MISC
-extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf,
- char *__buffer, size_t __buflen,
- struct rpcent **__result) __THROW;
-
-extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf,
- char *__buffer, size_t __buflen,
- struct rpcent **__result) __THROW;
-
-extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer,
- size_t __buflen, struct rpcent **__result) __THROW;
-#endif
-
-__END_DECLS
-
-#endif /* rpc/netdb.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/pmap_clnt.h b/mdk-stage1/dietlibc/include/rpc/pmap_clnt.h
deleted file mode 100644
index c63922772..000000000
--- a/mdk-stage1/dietlibc/include/rpc/pmap_clnt.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * pmap_clnt.h
- * Supplies C routines to get to portmap services.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_PMAP_CLNT_H
-#define _RPC_PMAP_CLNT_H 1
-
-#include <sys/cdefs.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/clnt.h>
-
-__BEGIN_DECLS
-
-typedef bool_t (*resultproc_t) (char* resp, struct sockaddr_in *raddr);
-
-/*
- * Usage:
- * success = pmap_set(program, version, protocol, port);
- * success = pmap_unset(program, version);
- * port = pmap_getport(address, program, version, protocol);
- * head = pmap_getmaps(address);
- * clnt_stat = pmap_rmtcall(address, program, version, procedure,
- * xdrargs, argsp, xdrres, resp, tout, port_ptr)
- * (works for udp only.)
- * clnt_stat = clnt_broadcast(program, version, procedure,
- * xdrargs, argsp, xdrres, resp, eachresult)
- * (like pmap_rmtcall, except the call is broadcasted to all
- * locally connected nets. For each valid response received,
- * the procedure eachresult is called. Its form is:
- * done = eachresult(resp, raddr)
- * bool_t done;
- * char* resp;
- * struct sockaddr_in raddr;
- * where resp points to the results of the call and raddr is the
- * address if the responder to the broadcast.
- */
-
-extern bool_t pmap_set (const unsigned long __program, const unsigned long __vers,
- int __protocol, unsigned short __port) __THROW;
-extern bool_t pmap_unset (const unsigned long __program, const unsigned long __vers)
- __THROW;
-extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW;
-extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr,
- const unsigned long __prog,
- const unsigned long __vers,
- const unsigned long __proc,
- xdrproc_t __xdrargs,
- char* __argsp, xdrproc_t __xdrres,
- char* __resp, struct timeval __tout,
- unsigned long *__port_ptr) __THROW;
-extern enum clnt_stat clnt_broadcast (const unsigned long __prog,
- const unsigned long __vers,
- const unsigned long __proc, xdrproc_t __xargs,
- char* __argsp, xdrproc_t __xresults,
- char* __resultsp,
- resultproc_t __eachresult) __THROW;
-extern unsigned short pmap_getport (struct sockaddr_in *__address,
- const unsigned long __program,
- const unsigned long __version, unsigned int __protocol)
- __THROW;
-
-__END_DECLS
-
-#endif /* rpc/pmap_clnt.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/pmap_prot.h b/mdk-stage1/dietlibc/include/rpc/pmap_prot.h
deleted file mode 100644
index da06d34c1..000000000
--- a/mdk-stage1/dietlibc/include/rpc/pmap_prot.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC; from 1.14 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * pmap_prot.h
- * Protocol for the local binder service, or pmap.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_PMAP_PROT_H
-#define _RPC_PMAP_PROT_H 1
-
-#include <sys/cdefs.h>
-
-#include <rpc/xdr.h>
-
-__BEGIN_DECLS
-
-/* The following procedures are supported by the protocol:
- *
- * PMAPPROC_NULL() returns ()
- * takes nothing, returns nothing
- *
- * PMAPPROC_SET(struct pmap) returns (bool_t)
- * TRUE is success, FALSE is failure. Registers the tuple
- * [prog, vers, prot, port].
- *
- * PMAPPROC_UNSET(struct pmap) returns (bool_t)
- * TRUE is success, FALSE is failure. Un-registers pair
- * [prog, vers]. prot and port are ignored.
- *
- * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
- * 0 is failure. Otherwise returns the port number where the pair
- * [prog, vers] is registered. It may lie!
- *
- * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
- *
- * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
- * RETURNS (port, string<>);
- * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
- * Calls the procedure on the local machine. If it is not registered,
- * this procedure is quite; ie it does not return error information!!!
- * This procedure only is supported on rpc/udp and calls via
- * rpc/udp. This routine only passes null authentication parameters.
- * This file has no interface to xdr routines for PMAPPROC_CALLIT.
- *
- * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
- */
-
-#define PMAPPORT ((unsigned short)111)
-#define PMAPPROG ((unsigned long)100000)
-#define PMAPVERS ((unsigned long)2)
-#define PMAPVERS_PROTO ((unsigned long)2)
-#define PMAPVERS_ORIG ((unsigned long)1)
-#define PMAPPROC_NULL ((unsigned long)0)
-#define PMAPPROC_SET ((unsigned long)1)
-#define PMAPPROC_UNSET ((unsigned long)2)
-#define PMAPPROC_GETPORT ((unsigned long)3)
-#define PMAPPROC_DUMP ((unsigned long)4)
-#define PMAPPROC_CALLIT ((unsigned long)5)
-
-struct pmap {
- long unsigned pm_prog;
- long unsigned pm_vers;
- long unsigned pm_prot;
- long unsigned pm_port;
-};
-
-extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs) __THROW;
-
-struct pmaplist {
- struct pmap pml_map;
- struct pmaplist *pml_next;
-};
-
-extern bool_t xdr_pmaplist (XDR *__xdrs, struct pmaplist **__rp) __THROW;
-
-__END_DECLS
-
-#endif /* rpc/pmap_prot.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/pmap_rmt.h b/mdk-stage1/dietlibc/include/rpc/pmap_rmt.h
deleted file mode 100644
index 3b975d0fb..000000000
--- a/mdk-stage1/dietlibc/include/rpc/pmap_rmt.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC; from 1.2 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * Structures and XDR routines for parameters to and replies from
- * the portmapper remote-call-service.
- *
- * Copyright (C) 1986, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_PMAP_RMT_H
-#define _RPC_PMAP_RMT_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-
-__BEGIN_DECLS
-
-struct rmtcallargs {
- unsigned long prog, vers, proc, arglen;
- char* args_ptr;
- xdrproc_t xdr_args;
-};
-
-extern bool_t xdr_rmtcall_args (XDR *__xdrs, struct rmtcallargs *__crp)
- __THROW;
-
-struct rmtcallres {
- unsigned long *port_ptr;
- unsigned long resultslen;
- char* results_ptr;
- xdrproc_t xdr_results;
-};
-
-extern bool_t xdr_rmtcallres (XDR *__xdrs, struct rmtcallres *__crp) __THROW;
-
-__END_DECLS
-
-#endif /* rpc/pmap_rmt.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/rpc.h b/mdk-stage1/dietlibc/include/rpc/rpc.h
deleted file mode 100644
index a966d2e23..000000000
--- a/mdk-stage1/dietlibc/include/rpc/rpc.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* @(#)rpc.h 2.3 88/08/10 4.0 RPCSRC; from 1.9 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * rpc.h, Just includes the billions of rpc header files necessary to
- * do remote procedure calling.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_RPC_H
-#define _RPC_RPC_H 1
-
-#include <rpc/types.h> /* some typedefs */
-#include <netinet/in.h>
-
-/* external data representation interfaces */
-#include <rpc/xdr.h> /* generic (de)serializer */
-
-/* Client side only authentication */
-#include <rpc/auth.h> /* generic authenticator (client side) */
-
-/* Client side (mostly) remote procedure call */
-#include <rpc/clnt.h> /* generic rpc stuff */
-
-/* semi-private protocol headers */
-#include <rpc/rpc_msg.h> /* protocol for rpc messages */
-#include <rpc/auth_unix.h> /* protocol for unix style cred */
-#include <rpc/auth_des.h> /* protocol for des style cred */
-
-/* Server side only remote procedure callee */
-#include <rpc/svc.h> /* service manager and multiplexer */
-#include <rpc/svc_auth.h> /* service side authenticator */
-
-/*
- * COMMENT OUT THE NEXT INCLUDE IF RUNNING ON SUN OS OR ON A VERSION
- * OF UNIX BASED ON NFSSRC. These systems will already have the structures
- * defined by <rpc/netdb.h> included in <netdb.h>.
- */
-/* routines for parsing /etc/rpc */
-#include <rpc/netdb.h> /* structures and routines to parse /etc/rpc */
-
-#endif /* rpc/rpc.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/rpc_des.h b/mdk-stage1/dietlibc/include/rpc/rpc_des.h
deleted file mode 100644
index 0f36d1697..000000000
--- a/mdk-stage1/dietlibc/include/rpc/rpc_des.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/*
- * Generic DES driver interface
- * Keep this file hardware independent!
- * Copyright (c) 1986 by Sun Microsystems, Inc.
- */
-
-#ifndef _DES_H
-#define _DES_H
-
-#include <sys/types.h>
-
-#define DES_MAXLEN 65536 /* maximum # of bytes to encrypt */
-#define DES_QUICKLEN 16 /* maximum # of bytes to encrypt quickly */
-
-enum desdir
- {
- ENCRYPT, DECRYPT
- };
-enum desmode
- {
- CBC, ECB
- };
-
-/*
- * parameters to ioctl call
- */
-struct desparams
- {
- u_char des_key[8]; /* key (with low bit parity) */
- enum desdir des_dir; /* direction */
- enum desmode des_mode; /* mode */
- u_char des_ivec[8]; /* input vector */
- unsigned des_len; /* number of bytes to crypt */
- union
- {
- u_char UDES_data[DES_QUICKLEN];
- u_char *UDES_buf;
- }
- UDES;
-#define des_data UDES.UDES_data /* direct data here if quick */
-#define des_buf UDES.UDES_buf /* otherwise, pointer to data */
- };
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/rpc/rpc_msg.h b/mdk-stage1/dietlibc/include/rpc/rpc_msg.h
deleted file mode 100644
index d597608ab..000000000
--- a/mdk-stage1/dietlibc/include/rpc/rpc_msg.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/* @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/* @(#)rpc_msg.h 1.7 86/07/16 SMI */
-
-#ifndef _RPC_MSG_H
-#define _RPC_MSG_H 1
-
-#include <sys/cdefs.h>
-
-#include <rpc/xdr.h>
-#include <rpc/clnt.h>
-
-/*
- * rpc_msg.h
- * rpc message definition
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#define RPC_MSG_VERSION ((unsigned long) 2)
-#define RPC_SERVICE_PORT ((unsigned short) 2048)
-
-__BEGIN_DECLS
-
-/*
- * Bottom up definition of an rpc message.
- * NOTE: call and reply use the same overall struct but
- * different parts of unions within it.
- */
-
-enum msg_type {
- CALL=0,
- REPLY=1
-};
-
-enum reply_stat {
- MSG_ACCEPTED=0,
- MSG_DENIED=1
-};
-
-enum accept_stat {
- SUCCESS=0,
- PROG_UNAVAIL=1,
- PROG_MISMATCH=2,
- PROC_UNAVAIL=3,
- GARBAGE_ARGS=4,
- SYSTEM_ERR=5
-};
-
-enum reject_stat {
- RPC_MISMATCH=0,
- AUTH_ERROR=1
-};
-
-/*
- * Reply part of an rpc exchange
- */
-
-/*
- * Reply to an rpc request that was accepted by the server.
- * Note: there could be an error even though the request was
- * accepted.
- */
-struct accepted_reply {
- struct opaque_auth ar_verf;
- enum accept_stat ar_stat;
- union {
- struct {
- unsigned long low;
- unsigned long high;
- } AR_versions;
- struct {
- char* where;
- xdrproc_t proc;
- } AR_results;
- /* and many other null cases */
- } ru;
-#define ar_results ru.AR_results
-#define ar_vers ru.AR_versions
-};
-
-/*
- * Reply to an rpc request that was rejected by the server.
- */
-struct rejected_reply {
- enum reject_stat rj_stat;
- union {
- struct {
- unsigned long low;
- unsigned long high;
- } RJ_versions;
- enum auth_stat RJ_why; /* why authentication did not work */
- } ru;
-#define rj_vers ru.RJ_versions
-#define rj_why ru.RJ_why
-};
-
-/*
- * Body of a reply to an rpc request.
- */
-struct reply_body {
- enum reply_stat rp_stat;
- union {
- struct accepted_reply RP_ar;
- struct rejected_reply RP_dr;
- } ru;
-#define rp_acpt ru.RP_ar
-#define rp_rjct ru.RP_dr
-};
-
-/*
- * Body of an rpc request call.
- */
-struct call_body {
- unsigned long cb_rpcvers; /* must be equal to two */
- unsigned long cb_prog;
- unsigned long cb_vers;
- unsigned long cb_proc;
- struct opaque_auth cb_cred;
- struct opaque_auth cb_verf; /* protocol specific - provided by client */
-};
-
-/*
- * The rpc message
- */
-struct rpc_msg {
- unsigned long rm_xid;
- enum msg_type rm_direction;
- union {
- struct call_body RM_cmb;
- struct reply_body RM_rmb;
- } ru;
-#define rm_call ru.RM_cmb
-#define rm_reply ru.RM_rmb
-};
-#define acpted_rply ru.RM_rmb.ru.RP_ar
-#define rjcted_rply ru.RM_rmb.ru.RP_dr
-
-
-/*
- * XDR routine to handle a rpc message.
- * xdr_callmsg(xdrs, cmsg)
- * XDR *xdrs;
- * struct rpc_msg *cmsg;
- */
-extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
-
-/*
- * XDR routine to pre-serialize the static part of a rpc message.
- * xdr_callhdr(xdrs, cmsg)
- * XDR *xdrs;
- * struct rpc_msg *cmsg;
- */
-extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
-
-/*
- * XDR routine to handle a rpc reply.
- * xdr_replymsg(xdrs, rmsg)
- * XDR *xdrs;
- * struct rpc_msg *rmsg;
- */
-extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW;
-
-/*
- * Fills in the error part of a reply message.
- * _seterr_reply(msg, error)
- * struct rpc_msg *msg;
- * struct rpc_err *error;
- */
-extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error)
- __THROW;
-
-__END_DECLS
-
-#endif /* rpc/rpc_msg.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/svc.h b/mdk-stage1/dietlibc/include/rpc/svc.h
deleted file mode 100644
index ec598ba79..000000000
--- a/mdk-stage1/dietlibc/include/rpc/svc.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * svc.h, Server-side remote procedure call interface.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_SVC_H
-#define _RPC_SVC_H 1
-
-#include <sys/cdefs.h>
-#include <rpc/rpc_msg.h>
-
-__BEGIN_DECLS
-
-/*
- * This interface must manage two items concerning remote procedure calling:
- *
- * 1) An arbitrary number of transport connections upon which rpc requests
- * are received. The two most notable transports are TCP and UDP; they are
- * created and registered by routines in svc_tcp.c and svc_udp.c, respectively;
- * they in turn call xprt_register and xprt_unregister.
- *
- * 2) An arbitrary number of locally registered services. Services are
- * described by the following four data: program number, version number,
- * "service dispatch" function, a transport handle, and a boolean that
- * indicates whether or not the exported program should be registered with a
- * local binder service; if true the program's number and version and the
- * port number from the transport handle are registered with the binder.
- * These data are registered with the rpc svc system via svc_register.
- *
- * A service's dispatch function is called whenever an rpc request comes in
- * on a transport. The request's program and version numbers must match
- * those of the registered service. The dispatch function is passed two
- * parameters, struct svc_req * and SVCXPRT *, defined below.
- */
-
-enum xprt_stat {
- XPRT_DIED,
- XPRT_MOREREQS,
- XPRT_IDLE
-};
-
-/*
- * Server side transport handle
- */
-typedef struct SVCXPRT SVCXPRT;
-struct SVCXPRT {
- int xp_sock;
- unsigned short xp_port; /* associated port number */
- const struct xp_ops {
- bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg);
- /* receive incoming requests */
- enum xprt_stat (*xp_stat) (SVCXPRT *__xprt);
- /* get transport status */
- bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
- char* args_ptr); /* get arguments */
- bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg);
- /* send reply */
- bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
- char* args_ptr);
- /* free mem allocated for args */
- void (*xp_destroy) (SVCXPRT *__xprt);
- /* destroy this struct */
- } *xp_ops;
- int xp_addrlen; /* length of remote address */
- struct sockaddr_in xp_raddr; /* remote address */
- struct opaque_auth xp_verf; /* raw response verifier */
- char* xp_p1; /* private */
- char* xp_p2; /* private */
- char xp_pad [256]; /* padding, internal use */
-};
-
-/*
- * Approved way of getting address of caller
- */
-#define svc_getcaller(x) (&(x)->xp_raddr)
-
-/*
- * Operations defined on an SVCXPRT handle
- *
- * SVCXPRT *xprt;
- * struct rpc_msg *msg;
- * xdrproc_t xargs;
- * char* argsp;
- */
-#define SVC_RECV(xprt, msg) \
- (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
-#define svc_recv(xprt, msg) \
- (*(xprt)->xp_ops->xp_recv)((xprt), (msg))
-
-#define SVC_STAT(xprt) \
- (*(xprt)->xp_ops->xp_stat)(xprt)
-#define svc_stat(xprt) \
- (*(xprt)->xp_ops->xp_stat)(xprt)
-
-#define SVC_GETARGS(xprt, xargs, argsp) \
- (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
-#define svc_getargs(xprt, xargs, argsp) \
- (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp))
-
-#define SVC_REPLY(xprt, msg) \
- (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
-#define svc_reply(xprt, msg) \
- (*(xprt)->xp_ops->xp_reply) ((xprt), (msg))
-
-#define SVC_FREEARGS(xprt, xargs, argsp) \
- (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
-#define svc_freeargs(xprt, xargs, argsp) \
- (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp))
-
-#define SVC_DESTROY(xprt) \
- (*(xprt)->xp_ops->xp_destroy)(xprt)
-#define svc_destroy(xprt) \
- (*(xprt)->xp_ops->xp_destroy)(xprt)
-
-
-/*
- * Service request
- */
-struct svc_req {
- rpcprog_t rq_prog; /* service program number */
- rpcvers_t rq_vers; /* service protocol version */
- rpcproc_t rq_proc; /* the desired procedure */
- struct opaque_auth rq_cred; /* raw creds from the wire */
- char* rq_clntcred; /* read only cooked cred */
- SVCXPRT *rq_xprt; /* associated transport */
-};
-
-#ifndef __DISPATCH_FN_T
-#define __DISPATCH_FN_T
-typedef void (*__dispatch_fn_t) (struct svc_req*, SVCXPRT*);
-#endif
-
-/*
- * Service registration
- *
- * svc_register(xprt, prog, vers, dispatch, protocol)
- * SVCXPRT *xprt;
- * rpcprog_t prog;
- * rpcvers_t vers;
- * void (*dispatch)(struct svc_req*, SVCXPRT*);
- * rpcprot_t protocol; like TCP or UDP, zero means do not register
- */
-extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
- rpcvers_t __vers, __dispatch_fn_t __dispatch,
- rpcprot_t __protocol) __THROW;
-
-/*
- * Service un-registration
- *
- * svc_unregister(prog, vers)
- * rpcprog_t prog;
- * rpcvers_t vers;
- */
-extern void svc_unregister (rpcprog_t __prog, rpcvers_t __vers) __THROW;
-
-/*
- * Transport registration.
- *
- * xprt_register(xprt)
- * SVCXPRT *xprt;
- */
-extern void xprt_register (SVCXPRT *__xprt) __THROW;
-
-/*
- * Transport un-register
- *
- * xprt_unregister(xprt)
- * SVCXPRT *xprt;
- */
-extern void xprt_unregister (SVCXPRT *__xprt) __THROW;
-
-
-/*
- * When the service routine is called, it must first check to see if it
- * knows about the procedure; if not, it should call svcerr_noproc
- * and return. If so, it should deserialize its arguments via
- * SVC_GETARGS (defined above). If the deserialization does not work,
- * svcerr_decode should be called followed by a return. Successful
- * decoding of the arguments should be followed the execution of the
- * procedure's code and a call to svc_sendreply.
- *
- * Also, if the service refuses to execute the procedure due to too-
- * weak authentication parameters, svcerr_weakauth should be called.
- * Note: do not confuse access-control failure with weak authentication!
- *
- * NB: In pure implementations of rpc, the caller always waits for a reply
- * msg. This message is sent when svc_sendreply is called.
- * Therefore pure service implementations should always call
- * svc_sendreply even if the function logically returns void; use
- * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows
- * for the abuse of pure rpc via batched calling or pipelining. In the
- * case of a batched call, svc_sendreply should NOT be called since
- * this would send a return message, which is what batching tries to avoid.
- * It is the service/protocol writer's responsibility to know which calls are
- * batched and which are not. Warning: responding to batch calls may
- * deadlock the caller and server processes!
- */
-
-extern bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t __xdr_results,
- char* __xdr_location) __THROW;
-
-extern void svcerr_decode (SVCXPRT *__xprt) __THROW;
-
-extern void svcerr_weakauth (SVCXPRT *__xprt) __THROW;
-
-extern void svcerr_noproc (SVCXPRT *__xprt) __THROW;
-
-extern void svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
- rpcvers_t __high_vers) __THROW;
-
-extern void svcerr_auth (SVCXPRT *__xprt, enum auth_stat __why) __THROW;
-
-extern void svcerr_noprog (SVCXPRT *__xprt) __THROW;
-
-extern void svcerr_systemerr (SVCXPRT *__xprt) __THROW;
-
-/*
- * Lowest level dispatching -OR- who owns this process anyway.
- * Somebody has to wait for incoming requests and then call the correct
- * service routine. The routine svc_run does infinite waiting; i.e.,
- * svc_run never returns.
- * Since another (coexistent) package may wish to selectively wait for
- * incoming calls or other events outside of the rpc architecture, the
- * routine svc_getreq is provided. It must be passed readfds, the
- * "in-place" results of a select system call (see select, section 2).
- */
-
-/*
- * Global keeper of rpc service descriptors in use
- * dynamic; must be inspected before each call to select
- */
-
-extern struct pollfd *svc_pollfd;
-extern int svc_max_pollfd;
-extern fd_set svc_fdset;
-#define svc_fds svc_fdset.fds_bits[0] /* compatibility */
-
-/*
- * a small program implemented by the svc_rpc implementation itself;
- * also see clnt.h for protocol numbers.
- */
-extern void svc_getreq (int __rdfds) __THROW;
-extern void svc_getreq_common (const int __fd) __THROW;
-extern void svc_getreqset (fd_set *__readfds) __THROW;
-extern void svc_getreq_poll (struct pollfd *, const int) __THROW;
-extern void svc_exit (void) __THROW;
-extern void svc_run (void) __THROW;
-
-/*
- * Socket to use on svcxxx_create call to get default socket
- */
-#define RPC_ANYSOCK -1
-
-/*
- * These are the existing service side transport implementations
- */
-
-/*
- * Memory based rpc for testing and timing.
- */
-extern SVCXPRT *svcraw_create (void) __THROW;
-
-/*
- * Udp based rpc.
- */
-extern SVCXPRT *svcudp_create (int __sock) __THROW;
-extern SVCXPRT *svcudp_bufcreate (int __sock, unsigned int __sendsz, unsigned int __recvsz)
- __THROW;
-
-/*
- * Tcp based rpc.
- */
-extern SVCXPRT *svctcp_create (int __sock, unsigned int __sendsize, unsigned int __recvsize)
- __THROW;
-
-
-/*
- * Unix based rpc.
- */
-extern SVCXPRT *svcunix_create (int __sock, unsigned int __sendsize, unsigned int __recvsize,
- char *__path) __THROW;
-
-
-__END_DECLS
-
-#endif /* rpc/svc.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/svc_auth.h b/mdk-stage1/dietlibc/include/rpc/svc_auth.h
deleted file mode 100644
index cd4b8da29..000000000
--- a/mdk-stage1/dietlibc/include/rpc/svc_auth.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/* @(#)svc_auth.h 1.6 86/07/16 SMI */
-
-/*
- * svc_auth.h, Service side of rpc authentication.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_SVC_AUTH_H
-#define _RPC_SVC_AUTH_H 1
-
-#include <sys/cdefs.h>
-#include <rpc/svc.h>
-
-__BEGIN_DECLS
-
-/*
- * Server side authenticator
- */
-extern enum auth_stat _authenticate (struct svc_req *__rqst,
- struct rpc_msg *__msg) __THROW;
-
-__END_DECLS
-
-#endif /* rpc/svc_auth.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/types.h b/mdk-stage1/dietlibc/include/rpc/types.h
deleted file mode 100644
index d4be65e38..000000000
--- a/mdk-stage1/dietlibc/include/rpc/types.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-/* fixincludes should not add extern "C" to this file */
-/*
- * Rpc additions to <sys/types.h>
- */
-#ifndef _RPC_TYPES_H
-#define _RPC_TYPES_H 1
-
-typedef int bool_t;
-typedef int enum_t;
-/* This needs to be changed to uint32_t in the future */
-typedef unsigned long rpcprog_t;
-typedef unsigned long rpcvers_t;
-typedef unsigned long rpcproc_t;
-typedef unsigned long rpcprot_t;
-typedef unsigned long rpcport_t;
-
-#define __dontcare__ -1
-
-#ifndef FALSE
-# define FALSE (0)
-#endif
-
-#ifndef TRUE
-# define TRUE (1)
-#endif
-
-#include <stdlib.h> /* For malloc decl. */
-#define mem_alloc(bsize) malloc(bsize)
-#define mem_free(ptr, bsize) free(ptr)
-
-#ifndef makedev /* ie, we haven't already included it */
-#include <sys/types.h>
-#endif
-
-# ifndef __dietlibc_u_char_defined
-typedef char* caddr_t;
-typedef uint32_t u_long;
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
-# define __dietlibc_u_char_defined
-#endif
-
-#include <sys/time.h>
-#include <sys/param.h>
-
-#include <netinet/in.h>
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7F000001UL
-#endif
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif
-
-#endif /* rpc/types.h */
diff --git a/mdk-stage1/dietlibc/include/rpc/xdr.h b/mdk-stage1/dietlibc/include/rpc/xdr.h
deleted file mode 100644
index 590392070..000000000
--- a/mdk-stage1/dietlibc/include/rpc/xdr.h
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * xdr.h, External Data Representation Serialization Routines.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#ifndef _RPC_XDR_H
-#define _RPC_XDR_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <rpc/types.h>
-
-/* We need FILE. */
-#include <stdio.h>
-
-__BEGIN_DECLS
-
-/*
- * XDR provides a conventional way for converting between C data
- * types and an external bit-string representation. Library supplied
- * routines provide for the conversion on built-in C data types. These
- * routines and utility routines defined here are used to help implement
- * a type encode/decode routine for each user-defined type.
- *
- * Each data type provides a single procedure which takes two arguments:
- *
- * bool_t
- * xdrproc(xdrs, argresp)
- * XDR *xdrs;
- * <type> *argresp;
- *
- * xdrs is an instance of a XDR handle, to which or from which the data
- * type is to be converted. argresp is a pointer to the structure to be
- * converted. The XDR handle contains an operation field which indicates
- * which of the operations (ENCODE, DECODE * or FREE) is to be performed.
- *
- * XDR_DECODE may allocate space if the pointer argresp is null. This
- * data can be freed with the XDR_FREE operation.
- *
- * We write only one procedure per data type to make it easy
- * to keep the encode and decode procedures for a data type consistent.
- * In many cases the same code performs all operations on a user defined type,
- * because all the hard work is done in the component type routines.
- * decode as a series of calls on the nested data types.
- */
-
-/*
- * Xdr operations. XDR_ENCODE causes the type to be encoded into the
- * stream. XDR_DECODE causes the type to be extracted from the stream.
- * XDR_FREE can be used to release the space allocated by an XDR_DECODE
- * request.
- */
-enum xdr_op {
- XDR_ENCODE = 0,
- XDR_DECODE = 1,
- XDR_FREE = 2
-};
-
-/*
- * This is the number of bytes per unit of external data.
- */
-#define BYTES_PER_XDR_UNIT (4)
-/*
- * This only works if the above is a power of 2. But it's defined to be
- * 4 by the appropriate RFCs. So it will work. And it's normally quicker
- * than the old routine.
- */
-#if 1
-#define RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
-#else /* this is the old routine */
-#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \
- * BYTES_PER_XDR_UNIT)
-#endif
-
-/*
- * The XDR handle.
- * Contains operation which is being applied to the stream,
- * an operations vector for the particular implementation (e.g. see xdr_mem.c),
- * and two private fields for the use of the particular implementation.
- */
-typedef struct XDR XDR;
-struct XDR
- {
- enum xdr_op x_op; /* operation; fast additional param */
- struct xdr_ops
- {
- bool_t (*x_getlong) (XDR *__xdrs, long *__lp);
- /* get a long from underlying stream */
- bool_t (*x_putlong) (XDR *__xdrs, const long *__lp);
- /* put a long to " */
- bool_t (*x_getbytes) (XDR *__xdrs, char* __addr, unsigned int __len);
- /* get some bytes from " */
- bool_t (*x_putbytes) (XDR *__xdrs, const char *__addr, unsigned int __len);
- /* put some bytes to " */
- unsigned int (*x_getpostn) (const XDR *__xdrs);
- /* returns bytes off from beginning */
- bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos);
- /* lets you reposition the stream */
- int32_t *(*x_inline) (XDR *__xdrs, int __len);
- /* buf quick ptr to buffered data */
- void (*x_destroy) (XDR *__xdrs);
- /* free privates of this xdr_stream */
- bool_t (*x_getint32) (XDR *__xdrs, int32_t *__ip);
- /* get a int from underlying stream */
- bool_t (*x_putint32) (XDR *__xdrs, const int32_t *__ip);
- /* put a int to " */
- }
- *x_ops;
- char* x_public; /* users' data */
- char* x_private; /* pointer to private data */
- char* x_base; /* private used for position info */
- int x_handy; /* extra private word */
- };
-
-/*
- * A xdrproc_t exists for each data type which is to be encoded or decoded.
- *
- * The second argument to the xdrproc_t is a pointer to an opaque pointer.
- * The opaque pointer generally points to a structure of the data type
- * to be decoded. If this pointer is 0, then the type routines should
- * allocate dynamic storage of the appropriate size and return it.
- * bool_t (*xdrproc_t)(XDR *, char* *);
- */
-typedef bool_t (*xdrproc_t) (XDR *, void *,...);
-
-
-/*
- * Operations defined on a XDR handle
- *
- * XDR *xdrs;
- * int32_t *int32p;
- * long *longp;
- * char* addr;
- * unsigned int len;
- * unsigned int pos;
- */
-#define XDR_GETINT32(xdrs, int32p) \
- (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
-#define xdr_getint32(xdrs, int32p) \
- (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
-
-#define XDR_PUTINT32(xdrs, int32p) \
- (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
-#define xdr_putint32(xdrs, int32p) \
- (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
-
-#define XDR_GETLONG(xdrs, longp) \
- (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
-#define xdr_getlong(xdrs, longp) \
- (*(xdrs)->x_ops->x_getlong)(xdrs, longp)
-
-#define XDR_PUTLONG(xdrs, longp) \
- (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
-#define xdr_putlong(xdrs, longp) \
- (*(xdrs)->x_ops->x_putlong)(xdrs, longp)
-
-#define XDR_GETBYTES(xdrs, addr, len) \
- (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
-#define xdr_getbytes(xdrs, addr, len) \
- (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
-
-#define XDR_PUTBYTES(xdrs, addr, len) \
- (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
-#define xdr_putbytes(xdrs, addr, len) \
- (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
-
-#define XDR_GETPOS(xdrs) \
- (*(xdrs)->x_ops->x_getpostn)(xdrs)
-#define xdr_getpos(xdrs) \
- (*(xdrs)->x_ops->x_getpostn)(xdrs)
-
-#define XDR_SETPOS(xdrs, pos) \
- (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
-#define xdr_setpos(xdrs, pos) \
- (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
-
-#define XDR_INLINE(xdrs, len) \
- (*(xdrs)->x_ops->x_inline)(xdrs, len)
-#define xdr_inline(xdrs, len) \
- (*(xdrs)->x_ops->x_inline)(xdrs, len)
-
-#define XDR_DESTROY(xdrs) \
- do { \
- if ((xdrs)->x_ops->x_destroy) \
- (*(xdrs)->x_ops->x_destroy)(xdrs); \
- } while (0)
-#define xdr_destroy(xdrs) \
- do { \
- if ((xdrs)->x_ops->x_destroy) \
- (*(xdrs)->x_ops->x_destroy)(xdrs); \
- } while (0)
-
-/*
- * Support struct for discriminated unions.
- * You create an array of xdrdiscrim structures, terminated with
- * a entry with a null procedure pointer. The xdr_union routine gets
- * the discriminant value and then searches the array of structures
- * for a matching value. If a match is found the associated xdr routine
- * is called to handle that part of the union. If there is
- * no match, then a default routine may be called.
- * If there is no match and no default routine it is an error.
- */
-#define NULL_xdrproc_t ((xdrproc_t)0)
-struct xdr_discrim
-{
- int value;
- xdrproc_t proc;
-};
-
-/*
- * Inline routines for fast encode/decode of primitive data types.
- * Caveat emptor: these use single memory cycles to get the
- * data from the underlying buffer, and will fail to operate
- * properly if the data is not aligned. The standard way to use these
- * is to say:
- * if ((buf = XDR_INLINE(xdrs, count)) == NULL)
- * return (FALSE);
- * <<< macro calls >>>
- * where ``count'' is the number of bytes of data occupied
- * by the primitive data types.
- *
- * N.B. and frozen for all time: each data type here uses 4 bytes
- * of external representation.
- */
-
-#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
-#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)(v)))
-#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
-#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32(buf, (int32_t)(v))
-
-/* WARNING: The IXDR_*_LONG defines are removed by Sun for new platforms
- * and shouldn't be used any longer. Code which use this defines or longs
- * in the RPC code will not work on 64bit Solaris platforms !
- */
-#define IXDR_GET_LONG(buf) \
- ((long)ntohl((unsigned long)*__extension__((uint32_t*)(buf))++))
-#define IXDR_PUT_LONG(buf, v) \
- (*__extension__((uint32_t*)(buf))++ = (long)htonl((unsigned long)(v)))
-#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf))
-#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-
-
-#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
-#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
-#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
-#define IXDR_GET_U_SHORT(buf) ((unsigned short)IXDR_GET_LONG(buf))
-
-#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG(buf, (long)(v))
-
-/*
- * These are the "generic" xdr routines.
- * None of these can have const applied because it's not possible to
- * know whether the call is a read or a write to the passed parameter
- * also, the XDR structure is always updated by some of these calls.
- */
-extern bool_t xdr_void (void) __THROW;
-extern bool_t xdr_short (XDR *__xdrs, short *__sp) __THROW;
-extern bool_t xdr_u_short (XDR *__xdrs, unsigned short *__usp) __THROW;
-extern bool_t xdr_int (XDR *__xdrs, int *__ip) __THROW;
-extern bool_t xdr_u_int (XDR *__xdrs, unsigned int *__up) __THROW;
-extern bool_t xdr_long (XDR *__xdrs, long *__lp) __THROW;
-extern bool_t xdr_u_long (XDR *__xdrs, unsigned long *__ulp) __THROW;
-extern bool_t xdr_hyper (XDR *__xdrs, int64_t *__llp) __THROW;
-extern bool_t xdr_u_hyper (XDR *__xdrs, uint64_t *__ullp) __THROW;
-extern bool_t xdr_longlong_t (XDR *__xdrs, int64_t *__llp) __THROW;
-extern bool_t xdr_u_longlong_t (XDR *__xdrs, uint64_t *__ullp) __THROW;
-extern bool_t xdr_int8_t (XDR *__xdrs, int8_t *__ip) __THROW;
-extern bool_t xdr_uint8_t (XDR *__xdrs, uint8_t *__up) __THROW;
-extern bool_t xdr_int16_t (XDR *__xdrs, int16_t *__ip) __THROW;
-extern bool_t xdr_uint16_t (XDR *__xdrs, uint16_t *__up) __THROW;
-extern bool_t xdr_int32_t (XDR *__xdrs, int32_t *__ip) __THROW;
-extern bool_t xdr_uint32_t (XDR *__xdrs, uint32_t *__up) __THROW;
-extern bool_t xdr_int64_t (XDR *__xdrs, int64_t *__ip) __THROW;
-extern bool_t xdr_uint64_t (XDR *__xdrs, uint64_t *__up) __THROW;
-extern bool_t xdr_bool (XDR *__xdrs, bool_t *__bp) __THROW;
-extern bool_t xdr_enum (XDR *__xdrs, enum_t *__ep) __THROW;
-extern bool_t xdr_array (XDR * _xdrs, char* *__addrp, unsigned int *__sizep,
- unsigned int __maxsize, unsigned int __elsize, xdrproc_t __elproc)
- __THROW;
-extern bool_t xdr_bytes (XDR *__xdrs, char **__cpp, unsigned int *__sizep,
- unsigned int __maxsize) __THROW;
-extern bool_t xdr_opaque (XDR *__xdrs, char* __cp, unsigned int __cnt) __THROW;
-extern bool_t xdr_string (XDR *__xdrs, char **__cpp, unsigned int __maxsize) __THROW;
-extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
- const struct xdr_discrim *__choices,
- xdrproc_t dfault) __THROW;
-extern bool_t xdr_char (XDR *__xdrs, char *__cp) __THROW;
-extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp) __THROW;
-extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem,
- unsigned int __elemsize, xdrproc_t __xdr_elem) __THROW;
-extern bool_t xdr_float (XDR *__xdrs, float *__fp) __THROW;
-extern bool_t xdr_double (XDR *__xdrs, double *__dp) __THROW;
-extern bool_t xdr_reference (XDR *__xdrs, char* *__xpp, unsigned int __size,
- xdrproc_t __proc) __THROW;
-extern bool_t xdr_pointer (XDR *__xdrs, char **__objpp,
- unsigned int __obj_size, xdrproc_t __xdr_obj) __THROW;
-extern bool_t xdr_wrapstring (XDR *__xdrs, char **__cpp) __THROW;
-extern unsigned long xdr_sizeof (xdrproc_t, void *) __THROW;
-
-/*
- * Common opaque bytes objects used by many rpc protocols;
- * declared here due to commonality.
- */
-#define MAX_NETOBJ_SZ 1024
-struct netobj
-{
- unsigned int n_len;
- char *n_bytes;
-};
-typedef struct netobj netobj;
-extern bool_t xdr_netobj (XDR *__xdrs, struct netobj *__np) __THROW;
-
-/*
- * These are the public routines for the various implementations of
- * xdr streams.
- */
-
-/* XDR using memory buffers */
-extern void xdrmem_create (XDR *__xdrs, const char* __addr,
- unsigned int __size, enum xdr_op __xop) __THROW;
-
-/* XDR using stdio library */
-extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop)
- __THROW;
-
-/* XDR pseudo records for tcp */
-extern void xdrrec_create (XDR *__xdrs, unsigned int __sendsize,
- unsigned int __recvsize, char* __tcp_handle,
- int (*__readit) (char *, char *, int),
- int (*__writeit) (char *, char *, int)) __THROW;
-
-/* make end of xdr record */
-extern bool_t xdrrec_endofrecord (XDR *__xdrs, bool_t __sendnow) __THROW;
-
-/* move to beginning of next record */
-extern bool_t xdrrec_skiprecord (XDR *__xdrs) __THROW;
-
-/* true if no more input */
-extern bool_t xdrrec_eof (XDR *__xdrs) __THROW;
-
-/* free memory buffers for xdr */
-extern void xdr_free (xdrproc_t __proc, char *__objp) __THROW;
-
-__END_DECLS
-
-#endif /* rpc/xdr.h */
diff --git a/mdk-stage1/dietlibc/include/sched.h b/mdk-stage1/dietlibc/include/sched.h
deleted file mode 100644
index b6442c73b..000000000
--- a/mdk-stage1/dietlibc/include/sched.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _SCHED_H
-#define _SCHED_H 1
-
-#include <time.h>
-
-#include <sys/types.h>
-
-/*
- * cloning flags:
- */
-#define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
-#define CLONE_VM 0x00000100 /* set if VM shared between processes */
-#define CLONE_FS 0x00000200 /* set if fs info shared between processes */
-#define CLONE_FILES 0x00000400 /* set if open files shared between processes */
-#define CLONE_SIGHAND 0x00000800 /* set if signal handlers and blocked signals shared */
-#define CLONE_PID 0x00001000 /* set if pid shared */
-#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
-#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
-#define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
-#define CLONE_THREAD 0x00010000 /* Same thread group? */
-
-#define CLONE_SIGNAL (CLONE_SIGHAND | CLONE_THREAD)
-
-int clone(void*(*fn)(void*),void*stack,int flags,void*arg);
-
-/*
- * Scheduling policies
- */
-#define SCHED_OTHER 0
-#define SCHED_FIFO 1
-#define SCHED_RR 2
-
-/*
- * This is an additional bit set when we want to
- * yield the CPU for one re-schedule..
- */
-#define SCHED_YIELD 0x10
-
-struct sched_param {
- int sched_priority;
-};
-
-/* END OF COPY form kernel-header */
-
-int __sched_setparam(pid_t pid, const struct sched_param *p);
-int sched_setparam(pid_t pid, const struct sched_param *p);
-
-int __sched_getparam(pid_t pid, struct sched_param *p);
-int sched_getparam(pid_t pid, struct sched_param *p);
-
-int __sched_getscheduler(pid_t pid);
-int sched_getscheduler(pid_t pid);
-
-int __sched_setscheduler(pid_t pid, int policy, const struct sched_param *p);
-int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p);
-
-int __sched_yield(void);
-int sched_yield(void);
-
-int __sched_get_priority_max(int policy);
-int sched_get_priority_max(int policy);
-
-int __sched_get_priority_min(int policy);
-int sched_get_priority_min(int policy);
-
-int __sched_rr_get_interval(pid_t pid, struct timespec *tp);
-int sched_rr_get_interval(pid_t pid, struct timespec *tp);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/scsi/scsi.h b/mdk-stage1/dietlibc/include/scsi/scsi.h
deleted file mode 100644
index 652e44ee9..000000000
--- a/mdk-stage1/dietlibc/include/scsi/scsi.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/* Copyright (C) 1998, 1999 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * This header file contains public constants and structures used by
- * the scsi code for linux.
- */
-
-#ifndef _SCSI_SCSI_H
-#define _SCSI_SCSI_H 1
-
-/*
- * SCSI opcodes
- */
-
-#define TEST_UNIT_READY 0x00
-#define REZERO_UNIT 0x01
-#define REQUEST_SENSE 0x03
-#define FORMAT_UNIT 0x04
-#define READ_BLOCK_LIMITS 0x05
-#define REASSIGN_BLOCKS 0x07
-#define READ_6 0x08
-#define WRITE_6 0x0a
-#define SEEK_6 0x0b
-#define READ_REVERSE 0x0f
-#define WRITE_FILEMARKS 0x10
-#define SPACE 0x11
-#define INQUIRY 0x12
-#define RECOVER_BUFFERED_DATA 0x14
-#define MODE_SELECT 0x15
-#define RESERVE 0x16
-#define RELEASE 0x17
-#define COPY 0x18
-#define ERASE 0x19
-#define MODE_SENSE 0x1a
-#define START_STOP 0x1b
-#define RECEIVE_DIAGNOSTIC 0x1c
-#define SEND_DIAGNOSTIC 0x1d
-#define ALLOW_MEDIUM_REMOVAL 0x1e
-
-#define SET_WINDOW 0x24
-#define READ_CAPACITY 0x25
-#define READ_10 0x28
-#define WRITE_10 0x2a
-#define SEEK_10 0x2b
-#define WRITE_VERIFY 0x2e
-#define VERIFY 0x2f
-#define SEARCH_HIGH 0x30
-#define SEARCH_EQUAL 0x31
-#define SEARCH_LOW 0x32
-#define SET_LIMITS 0x33
-#define PRE_FETCH 0x34
-#define READ_POSITION 0x34
-#define SYNCHRONIZE_CACHE 0x35
-#define LOCK_UNLOCK_CACHE 0x36
-#define READ_DEFECT_DATA 0x37
-#define MEDIUM_SCAN 0x38
-#define COMPARE 0x39
-#define COPY_VERIFY 0x3a
-#define WRITE_BUFFER 0x3b
-#define READ_BUFFER 0x3c
-#define UPDATE_BLOCK 0x3d
-#define READ_LONG 0x3e
-#define WRITE_LONG 0x3f
-#define CHANGE_DEFINITION 0x40
-#define WRITE_SAME 0x41
-#define READ_TOC 0x43
-#define LOG_SELECT 0x4c
-#define LOG_SENSE 0x4d
-#define MODE_SELECT_10 0x55
-#define RESERVE_10 0x56
-#define RELEASE_10 0x57
-#define MODE_SENSE_10 0x5a
-#define PERSISTENT_RESERVE_IN 0x5e
-#define PERSISTENT_RESERVE_OUT 0x5f
-#define MOVE_MEDIUM 0xa5
-#define READ_12 0xa8
-#define WRITE_12 0xaa
-#define WRITE_VERIFY_12 0xae
-#define SEARCH_HIGH_12 0xb0
-#define SEARCH_EQUAL_12 0xb1
-#define SEARCH_LOW_12 0xb2
-#define READ_ELEMENT_STATUS 0xb8
-#define SEND_VOLUME_TAG 0xb6
-#define WRITE_LONG_2 0xea
-
-/*
- * Status codes
- */
-
-#define GOOD 0x00
-#define CHECK_CONDITION 0x01
-#define CONDITION_GOOD 0x02
-#define BUSY 0x04
-#define INTERMEDIATE_GOOD 0x08
-#define INTERMEDIATE_C_GOOD 0x0a
-#define RESERVATION_CONFLICT 0x0c
-#define COMMAND_TERMINATED 0x11
-#define QUEUE_FULL 0x14
-
-#define STATUS_MASK 0x3e
-
-/*
- * SENSE KEYS
- */
-
-#define NO_SENSE 0x00
-#define RECOVERED_ERROR 0x01
-#define NOT_READY 0x02
-#define MEDIUM_ERROR 0x03
-#define HARDWARE_ERROR 0x04
-#define ILLEGAL_REQUEST 0x05
-#define UNIT_ATTENTION 0x06
-#define DATA_PROTECT 0x07
-#define BLANK_CHECK 0x08
-#define COPY_ABORTED 0x0a
-#define ABORTED_COMMAND 0x0b
-#define VOLUME_OVERFLOW 0x0d
-#define MISCOMPARE 0x0e
-
-
-/*
- * DEVICE TYPES
- */
-
-#define TYPE_DISK 0x00
-#define TYPE_TAPE 0x01
-#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
-#define TYPE_WORM 0x04 /* Treated as ROM by our system */
-#define TYPE_ROM 0x05
-#define TYPE_SCANNER 0x06
-#define TYPE_MOD 0x07 /* Magneto-optical disk -
- * - treated as TYPE_DISK */
-#define TYPE_MEDIUM_CHANGER 0x08
-#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
-#define TYPE_NO_LUN 0x7f
-
-/*
- * standard mode-select header prepended to all mode-select commands
- *
- * moved here from cdrom.h -- kraxel
- */
-
-struct ccs_modesel_head
- {
- unsigned char _r1; /* reserved. */
- unsigned char medium; /* device-specific medium type. */
- unsigned char _r2; /* reserved. */
- unsigned char block_desc_length; /* block descriptor length. */
- unsigned char density; /* device-specific density code. */
- unsigned char number_blocks_hi; /* number of blocks in this block
- desc. */
- unsigned char number_blocks_med;
- unsigned char number_blocks_lo;
- unsigned char _r3;
- unsigned char block_length_hi; /* block length for blocks in this
- desc. */
- unsigned char block_length_med;
- unsigned char block_length_lo;
- };
-
-/*
- * MESSAGE CODES
- */
-
-#define COMMAND_COMPLETE 0x00
-#define EXTENDED_MESSAGE 0x01
-#define EXTENDED_MODIFY_DATA_POINTER 0x00
-#define EXTENDED_SDTR 0x01
-#define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */
-#define EXTENDED_WDTR 0x03
-#define SAVE_POINTERS 0x02
-#define RESTORE_POINTERS 0x03
-#define DISCONNECT 0x04
-#define INITIATOR_ERROR 0x05
-#define ABORT 0x06
-#define MESSAGE_REJECT 0x07
-#define NOP 0x08
-#define MSG_PARITY_ERROR 0x09
-#define LINKED_CMD_COMPLETE 0x0a
-#define LINKED_FLG_CMD_COMPLETE 0x0b
-#define BUS_DEVICE_RESET 0x0c
-
-#define INITIATE_RECOVERY 0x0f /* SCSI-II only */
-#define RELEASE_RECOVERY 0x10 /* SCSI-II only */
-
-#define SIMPLE_QUEUE_TAG 0x20
-#define HEAD_OF_QUEUE_TAG 0x21
-#define ORDERED_QUEUE_TAG 0x22
-
-/*
- * Here are some scsi specific ioctl commands which are sometimes useful.
- */
-/* These are a few other constants only used by scsi devices. */
-
-#define SCSI_IOCTL_GET_IDLUN 0x5382
-
-/* Used to turn on and off tagged queuing for scsi devices. */
-
-#define SCSI_IOCTL_TAGGED_ENABLE 0x5383
-#define SCSI_IOCTL_TAGGED_DISABLE 0x5384
-
-/* Used to obtain the host number of a device. */
-#define SCSI_IOCTL_PROBE_HOST 0x5385
-
-/* Used to get the bus number for a device. */
-#define SCSI_IOCTL_GET_BUS_NUMBER 0x5386
-
-#endif /* scsi/scsi.h */
diff --git a/mdk-stage1/dietlibc/include/scsi/scsi_ioctl.h b/mdk-stage1/dietlibc/include/scsi/scsi_ioctl.h
deleted file mode 100644
index bc9931838..000000000
--- a/mdk-stage1/dietlibc/include/scsi/scsi_ioctl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1999 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _SCSI_IOCTL_H
-#define _SCSI_IOCTL_H
-
-/* IOCTLs for SCSI. */
-#define SCSI_IOCTL_SEND_COMMAND 1 /* Send a command to the SCSI host. */
-#define SCSI_IOCTL_TEST_UNIT_READY 2 /* Test if unit is ready. */
-#define SCSI_IOCTL_BENCHMARK_COMMAND 3
-#define SCSI_IOCTL_SYNC 4 /* Request synchronous parameters. */
-#define SCSI_IOCTL_START_UNIT 5
-#define SCSI_IOCTL_STOP_UNIT 6
-#define SCSI_IOCTL_DOORLOCK 0x5380 /* Lock the eject mechanism. */
-#define SCSI_IOCTL_DOORUNLOCK 0x5381 /* Unlock the mechanism. */
-
-#endif
-
-
diff --git a/mdk-stage1/dietlibc/include/scsi/sg.h b/mdk-stage1/dietlibc/include/scsi/sg.h
deleted file mode 100644
index 00334654e..000000000
--- a/mdk-stage1/dietlibc/include/scsi/sg.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- History:
- Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
- process control of SCSI devices.
- Development Sponsored by Killy Corp. NY NY
-*/
-
-#ifndef _SCSI_SG_H
-#define _SCSI_SG_H 1
-
-#include <sys/types.h>
-
-/* New interface introduced in the 3.x SG drivers follows */
-
-/* Same structure as used by readv() Linux system call. It defines one
- scatter-gather element. */
-typedef struct sg_iovec
-{
- void * iov_base; /* Starting address */
- size_t iov_len; /* Length in bytes */
-} sg_iovec_t;
-
-
-typedef struct sg_io_hdr
-{
- int interface_id; /* [i] 'S' for SCSI generic (required) */
- int dxfer_direction; /* [i] data transfer direction */
- unsigned char cmd_len; /* [i] SCSI command length ( <= 16 bytes) */
- unsigned char mx_sb_len; /* [i] max length to write to sbp */
- unsigned short int iovec_count; /* [i] 0 implies no scatter gather */
- unsigned int dxfer_len; /* [i] byte count of data transfer */
- void * dxferp; /* [i], [*io] points to data transfer memory
- or scatter gather list */
- unsigned char * cmdp; /* [i], [*i] points to command to perform */
- unsigned char * sbp; /* [i], [*o] points to sense_buffer memory */
- unsigned int timeout; /* [i] MAX_UINT->no timeout (unit: millisec) */
- unsigned int flags; /* [i] 0 -> default, see SG_FLAG... */
- int pack_id; /* [i->o] unused internally (normally) */
- void * usr_ptr; /* [i->o] unused internally */
- unsigned char status; /* [o] scsi status */
- unsigned char masked_status;/* [o] shifted, masked scsi status */
- unsigned char msg_status; /* [o] messaging level data (optional) */
- unsigned char sb_len_wr; /* [o] byte count actually written to sbp */
- unsigned short int host_status; /* [o] errors from host adapter */
- unsigned short int driver_status;/* [o] errors from software driver */
- int resid; /* [o] dxfer_len - actual_transferred */
- unsigned int duration; /* [o] time taken by cmd (unit: millisec) */
- unsigned int info; /* [o] auxiliary information */
-} sg_io_hdr_t;
-
-
-/* Use negative values to flag difference from original sg_header structure. */
-#define SG_DXFER_NONE -1 /* e.g. a SCSI Test Unit Ready command */
-#define SG_DXFER_TO_DEV -2 /* e.g. a SCSI WRITE command */
-#define SG_DXFER_FROM_DEV -3 /* e.g. a SCSI READ command */
-#define SG_DXFER_TO_FROM_DEV -4 /* treated like SG_DXFER_FROM_DEV with the
- additional property than during indirect
- IO the user buffer is copied into the
- kernel buffers before the transfer */
-
-
-/* following flag values can be "or"-ed together */
-#define SG_FLAG_DIRECT_IO 1 /* default is indirect IO */
-#define SG_FLAG_LUN_INHIBIT 2 /* default is to put device's lun into */
- /* the 2nd byte of SCSI command */
-#define SG_FLAG_NO_DXFER 0x10000 /* no transfer of kernel buffers to/from */
- /* user space (debug indirect IO) */
-
-/* The following 'info' values are "or"-ed together. */
-#define SG_INFO_OK_MASK 0x1
-#define SG_INFO_OK 0x0 /* no sense, host nor driver "noise" */
-#define SG_INFO_CHECK 0x1 /* something abnormal happened */
-
-#define SG_INFO_DIRECT_IO_MASK 0x6
-#define SG_INFO_INDIRECT_IO 0x0 /* data xfer via kernel buffers (or no xfer) */
-#define SG_INFO_DIRECT_IO 0x2 /* direct IO requested and performed */
-#define SG_INFO_MIXED_IO 0x4 /* part direct, part indirect IO */
-
-
-/* Request information about a specific SG device, used by
- SG_GET_SCSI_ID ioctl (). */
-struct sg_scsi_id {
- /* Host number as in "scsi<n>" where 'n' is one of 0, 1, 2 etc. */
- int host_no;
- int channel;
- /* SCSI id of target device. */
- int scsi_id;
- int lun;
- /* TYPE_... defined in <scsi/scsi.h>. */
- int scsi_type;
- /* Host (adapter) maximum commands per lun. */
- short int h_cmd_per_lun;
- /* Device (or adapter) maximum queue length. */
- short int d_queue_depth;
- /* Unused, set to 0 for now. */
- int unused[2];
-};
-
-/* Used by SG_GET_REQUEST_TABLE ioctl(). */
-typedef struct sg_req_info {
- char req_state; /* 0 -> not used, 1 -> written, 2 -> ready to read */
- char orphan; /* 0 -> normal request, 1 -> from interruped SG_IO */
- char sg_io_owned; /* 0 -> complete with read(), 1 -> owned by SG_IO */
- char problem; /* 0 -> no problem detected, 1 -> error to report */
- int pack_id; /* pack_id associated with request */
- void * usr_ptr; /* user provided pointer (in new interface) */
- unsigned int duration; /* millisecs elapsed since written (req_state==1)
- or request duration (req_state==2) */
- int unused;
-} sg_req_info_t;
-
-
-/* IOCTLs: Those ioctls that are relevant to the SG 3.x drivers follow.
- [Those that only apply to the SG 2.x drivers are at the end of the file.]
- (_GET_s yield result via 'int *' 3rd argument unless otherwise indicated) */
-
-#define SG_EMULATED_HOST 0x2203 /* true for emulated host adapter (ATAPI) */
-
-/* Used to configure SCSI command transformation layer for ATAPI devices */
-/* Only supported by the ide-scsi driver */
-#define SG_SET_TRANSFORM 0x2204 /* N.B. 3rd arg is not pointer but value: */
- /* 3rd arg = 0 to disable transform, 1 to enable it */
-#define SG_GET_TRANSFORM 0x2205
-
-#define SG_SET_RESERVED_SIZE 0x2275 /* request a new reserved buffer size */
-#define SG_GET_RESERVED_SIZE 0x2272 /* actual size of reserved buffer */
-
-/* The following ioctl has a 'sg_scsi_id_t *' object as its 3rd argument. */
-#define SG_GET_SCSI_ID 0x2276 /* Yields fd's bus, chan, dev, lun + type */
-/* SCSI id information can also be obtained from SCSI_IOCTL_GET_IDLUN */
-
-/* Override host setting and always DMA using low memory ( <16MB on i386) */
-#define SG_SET_FORCE_LOW_DMA 0x2279 /* 0-> use adapter setting, 1-> force */
-#define SG_GET_LOW_DMA 0x227a /* 0-> use all ram for dma; 1-> low dma ram */
-
-/* When SG_SET_FORCE_PACK_ID set to 1, pack_id is input to read() which
- tries to fetch a packet with a matching pack_id, waits, or returns EAGAIN.
- If pack_id is -1 then read oldest waiting. When ...FORCE_PACK_ID set to 0
- then pack_id ignored by read() and oldest readable fetched. */
-#define SG_SET_FORCE_PACK_ID 0x227b
-#define SG_GET_PACK_ID 0x227c /* Yields oldest readable pack_id (or -1) */
-
-#define SG_GET_NUM_WAITING 0x227d /* Number of commands awaiting read() */
-
-/* Yields max scatter gather tablesize allowed by current host adapter */
-#define SG_GET_SG_TABLESIZE 0x227F /* 0 implies can't do scatter gather */
-
-#define SG_GET_VERSION_NUM 0x2282 /* Example: version 2.1.34 yields 20134 */
-
-/* Returns -EBUSY if occupied. 3rd argument pointer to int (see next) */
-#define SG_SCSI_RESET 0x2284
-/* Associated values that can be given to SG_SCSI_RESET follow */
-#define SG_SCSI_RESET_NOTHING 0
-#define SG_SCSI_RESET_DEVICE 1
-#define SG_SCSI_RESET_BUS 2
-#define SG_SCSI_RESET_HOST 3
-
-/* synchronous SCSI command ioctl, (only in version 3 interface) */
-#define SG_IO 0x2285 /* similar effect as write() followed by read() */
-
-#define SG_GET_REQUEST_TABLE 0x2286 /* yields table of active requests */
-
-/* How to treat EINTR during SG_IO ioctl(), only in SG 3.x series */
-#define SG_SET_KEEP_ORPHAN 0x2287 /* 1 -> hold for read(), 0 -> drop (def) */
-#define SG_GET_KEEP_ORPHAN 0x2288
-
-
-#define SG_SCATTER_SZ (8 * 4096) /* PAGE_SIZE not available to user */
-/* Largest size (in bytes) a single scatter-gather list element can have.
- The value must be a power of 2 and <= (PAGE_SIZE * 32) [131072 bytes on
- i386]. The minimum value is PAGE_SIZE. If scatter-gather not supported
- by adapter then this value is the largest data block that can be
- read/written by a single scsi command. The user can find the value of
- PAGE_SIZE by calling getpagesize() defined in unistd.h . */
-
-#define SG_DEFAULT_RETRIES 1
-
-/* Defaults, commented if they differ from original sg driver */
-#define SG_DEF_FORCE_LOW_DMA 0 /* was 1 -> memory below 16MB on i386 */
-#define SG_DEF_FORCE_PACK_ID 0
-#define SG_DEF_KEEP_ORPHAN 0
-#define SG_DEF_RESERVED_SIZE SG_SCATTER_SZ /* load time option */
-
-/* maximum outstanding requests, write() yields EDOM if exceeded */
-#define SG_MAX_QUEUE 16
-
-#define SG_BIG_BUFF SG_DEF_RESERVED_SIZE /* for backward compatibility */
-
-/* Alternate style type names, "..._t" variants preferred */
-typedef struct sg_io_hdr Sg_io_hdr;
-typedef struct sg_io_vec Sg_io_vec;
-typedef struct sg_scsi_id Sg_scsi_id;
-typedef struct sg_req_info Sg_req_info;
-
-
-/* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
-/* The older SG interface based on the 'sg_header' structure follows. */
-/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
-
-#define SG_MAX_SENSE 16 /* this only applies to the sg_header interface */
-
-struct sg_header
- {
- /* Length of incoming packet (including header). */
- int pack_len;
- /* Maximal length of expected reply. */
- int reply_len;
- /* Id number of packet. */
- int pack_id;
- /* 0==ok, otherwise error number. */
- int result;
- /* Force 12 byte command length for group 6 & 7 commands. */
- unsigned int twelve_byte:1;
- /* SCSI status from target. */
- unsigned int target_status:5;
- /* Host status (see "DID" codes). */
- unsigned int host_status:8;
- /* Driver status+suggestion. */
- unsigned int driver_status:8;
- /* Unused. */
- unsigned int other_flags:10;
- /* Output in 3 cases:
- when target_status is CHECK_CONDITION or
- when target_status is COMMAND_TERMINATED or
- when (driver_status & DRIVER_SENSE) is true. */
- unsigned char sense_buffer[SG_MAX_SENSE];
- };
-
-
-/* IOCTLs: The following are not required (or ignored) when the sg_io_hdr_t
- interface is used. They are kept for backward compatibility with
- the original and version 2 drivers. */
-
-#define SG_SET_TIMEOUT 0x2201 /* Set timeout; *(int *)arg==timeout. */
-#define SG_GET_TIMEOUT 0x2202 /* Get timeout; return timeout. */
-
-/* Get/set command queuing state per fd (default is SG_DEF_COMMAND_Q). */
-#define SG_GET_COMMAND_Q 0x2270 /* Yields 0 (queuing off) or 1 (on). */
-#define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1. */
-
-/* Turn on error sense trace (1..8), dump this device to log/console (9)
- or dump all sg device states ( >9 ) to log/console. */
-#define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */
-
-#define SG_NEXT_CMD_LEN 0x2283 /* Override SCSI command length with given
- number on the next write() on this file
- descriptor. */
-
-/* Defaults, commented if they differ from original sg driver */
-#define SG_DEFAULT_TIMEOUT (60*HZ) /* HZ == 'jiffies in 1 second' */
-#define SG_DEF_COMMAND_Q 0 /* command queuing is always on when
- the new interface is used */
-#define SG_DEF_UNDERRUN_FLAG 0
-
-
-#endif /* scsi/sg.h */
diff --git a/mdk-stage1/dietlibc/include/setjmp.h b/mdk-stage1/dietlibc/include/setjmp.h
deleted file mode 100644
index b591936ac..000000000
--- a/mdk-stage1/dietlibc/include/setjmp.h
+++ /dev/null
@@ -1,231 +0,0 @@
-#ifndef _SETJMP_H
-#define _SETJMP_H
-
-#include <sys/cdefs.h>
-
-#ifdef __i386__
-#ifndef __ASSEMBLER__
-typedef int __jmp_buf[6];
-#endif
-# define JB_BX 0
-# define JB_SI 1
-# define JB_DI 2
-# define JB_BP 3
-# define JB_SP 4
-# define JB_PC 5
-# define JB_SIZE 24
-#endif
-
-#ifdef __x86_64__
-#ifndef __ASSEMBLER__
-typedef long __jmp_buf[8];
-#endif
-# define JB_RBX 0
-# define JB_RBP 1
-# define JB_R12 2
-# define JB_R13 3
-# define JB_R14 4
-# define JB_R15 5
-# define JB_RSP 6
-# define JB_PC 7
-# define JB_SIZE 64
-#endif
-
-#ifdef __s390__
-#ifndef __ASSEMBLER__
-typedef struct {
- long int gregs[10];
- long fpregs[4];
-} __jmp_buf[1];
-#endif
-#define __JB_GPR6 0
-#define __JB_GPR7 1
-#define __JB_GPR8 2
-#define __JB_GPR9 3
-#define __JB_GPR10 4
-#define __JB_GPR11 5
-#define __JB_GPR12 6
-#define __JB_GPR13 7
-#define __JB_GPR14 8
-#define __JB_GPR15 9
-
-#define _JMPBUF_UNWINDS(jmpbuf, address) ((int) (address) < (jmpbuf)->gregs[__JB_GPR15])
-#endif
-
-#ifdef __alpha__
-#define JB_S0 0
-#define JB_S1 1
-#define JB_S2 2
-#define JB_S3 3
-#define JB_S4 4
-#define JB_S5 5
-#define JB_PC 6
-#define JB_FP 7
-#define JB_SP 8
-#define JB_F2 9
-#define JB_F3 10
-#define JB_F4 11
-#define JB_F5 12
-#define JB_F6 13
-#define JB_F7 14
-#define JB_F8 15
-#define JB_F9 16
-#ifndef __ASSEMBLER__
-typedef long int __jmp_buf[17];
-#endif
-#endif
-
-#ifdef __mips__
-#ifndef __ASSEMBLER__
-typedef struct
- {
- void * __pc; /* Program counter. */
- void * __sp; /* Stack pointer. */
- int __regs[8]; /* Callee-saved registers s0 through s7. */
- void * __fp; /* The frame pointer. */
- void * __gp; /* The global pointer. */
- int __fpc_csr; /* Floating point status register. */
- double __fpregs[6]; /* Callee-saved floating point registers. */
- } __jmp_buf[1];
-#endif
-#endif
-
-#ifdef __sparc__
-#ifdef __arch64__
-
-#define MC_TSTATE 0
-#define MC_PC 1
-#define MC_NPC 2
-#define MC_Y 3
-#define MC_G1 4
-#define MC_G2 5
-#define MC_G3 6
-#define MC_G4 7
-#define MC_G5 8
-#define MC_G6 9
-#define MC_G7 10
-#define MC_O0 11
-#define MC_O1 12
-#define MC_O2 13
-#define MC_O3 14
-#define MC_O4 15
-#define MC_O5 16
-#define MC_O6 17
-#define MC_O7 18
-#define MC_NGREG 19
-
-#define FLAG_SAVEMASK 512
-#ifndef __ASSEMBLER__
-#include <signal.h>
-
-/* this equal to ucontext from "include/asm-sparc64/uctx.h" */
-typedef struct __sparc64_jmp_buf {
- struct __sparc64_jmp_buf *uc_link;
- unsigned long uc_flags;
- sigset_t uc_sigmask;
- struct {
- unsigned long mc_gregs[MC_NGREG];
- unsigned long mc_fp;
- unsigned long mc_i7;
- struct {
- union {
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fregs;
- unsigned long mcfpu_fsr;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- struct {
- unsigned long *mcfq_addr;
- unsigned int mcfq_insn;
- } *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
- } mc_fpregs;
- } uc_mcontext;
-} __jmp_buf[1];
-
-#endif
-
-#else
-
-#define JB_SP 0
-#define JB_FP 1
-#define JB_PC 2
-#ifndef __ASSEMBLER__
-typedef int __jmp_buf[3];
-#endif
-
-#endif
-#endif
-
-#ifdef __arm__
-#define __JMP_BUF_SP 8
-#ifndef __ASSEMBLER__
-typedef int __jmp_buf[24];
-#endif
-#endif
-
-#ifdef __powerpc__
-# define JB_GPR1 0 /* Also known as the stack pointer */
-# define JB_GPR2 1
-# define JB_LR 2 /* The address we will return to */
-# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */
-# define JB_CR 21 /* Condition code registers. */
-# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */
-# define JB_SIZE (58*4)
-#ifndef __ASSEMBLER__
-typedef long int __jmp_buf[58];
-#endif
-#endif
-
-#ifdef __hppa__
-#ifndef __ASSEMBLER__
-typedef double __jmp_buf[21];
-#endif
-#endif
-
-#ifdef __ia64__
-#ifndef __ASSEMBLER__
-typedef long __jmp_buf[70] __attribute__ ((aligned(16)));
-#endif
-#endif
-
-#ifndef __ASSEMBLER__
-#include <signal.h>
-
-/* typedef int sig_atomic_t; */
-#define __sig_atomic_t sig_atomic_t
-
-/* Calling environment, plus possibly a saved signal mask. */
-typedef struct __jmp_buf_tag { /* C++ doesn't like tagless structs. */
-/* NOTE: The machine-dependent definitions of `__sigsetjmp'
- * assume that a `jmp_buf' begins with a `__jmp_buf'.
- * Do not move this member or add others before it. */
- __jmp_buf __jmpbuf; /* Calling environment. */
- int __mask_was_saved; /* Saved the signal mask? */
- sigset_t __saved_mask; /* Saved signal mask. */
-} jmp_buf[1];
-
-extern int __sigsetjmp(jmp_buf __env,int __savemask) __THROW;
-
-extern void longjmp(jmp_buf __env,int __val)
- __THROW __attribute__((__noreturn__));
-
-typedef jmp_buf sigjmp_buf;
-
-extern void siglongjmp(sigjmp_buf __env,int __val)
- __THROW __attribute__((__noreturn__));
-
-#ifdef _BSD_SOURCE
-#define setjmp(env) __sigsetjmp(env,1)
-#else
-#define setjmp(env) __sigsetjmp(env,0)
-#endif
-#define sigsetjmp(a,b) __sigsetjmp(a,b)
-
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/shadow.h b/mdk-stage1/dietlibc/include/shadow.h
deleted file mode 100644
index 1c84de9e6..000000000
--- a/mdk-stage1/dietlibc/include/shadow.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _SHADOW_H
-#define _SHADOW_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct spwd {
- char *sp_namp; /* user login name */
- char *sp_pwdp; /* encrypted password */
- long sp_lstchg; /* last password change */
- int sp_min; /* days until change allowed. */
- int sp_max; /* days before change required */
- int sp_warn; /* days warning for expiration */
- int sp_inact; /* days before account inactive */
- int sp_expire; /* date when account expires */
- int sp_flag; /* reserved for future use */
-};
-
-extern struct spwd *getspent(void) __THROW;
-extern void setspent(void) __THROW;
-extern void endspent(void) __THROW;
-extern struct spwd *getspnam (const char *__name) __THROW;
-
-int getspent_r(struct spwd *res, char *buf, size_t buflen,
- struct spwd **res_sig) __THROW;
-int getspnam_r(const char* name,
- struct spwd *res, char *buf, size_t buflen,
- struct spwd **res_sig) __THROW;
-
-#endif /* _SHADOW_H */
diff --git a/mdk-stage1/dietlibc/include/signal.h b/mdk-stage1/dietlibc/include/signal.h
deleted file mode 100644
index fdc0518cf..000000000
--- a/mdk-stage1/dietlibc/include/signal.h
+++ /dev/null
@@ -1,500 +0,0 @@
-#ifndef _SIGNAL_H
-#define _SIGNAL_H
-
-#include <sys/cdefs.h>
-
-#define __WANT_POSIX1B_SIGNALS__
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#define NSIG 32
-
-#ifdef __mips__
-#define _NSIG 128
-#else
-#define _NSIG 64
-#endif
-
-#define SIGHUP 1
-#define SIGINT 2
-#define SIGQUIT 3
-#define SIGILL 4
-#define SIGTRAP 5
-#define SIGABRT 6
-#define SIGIOT 6
-#define SIGFPE 8
-#define SIGKILL 9
-#define SIGSEGV 11
-#define SIGPIPE 13
-#define SIGALRM 14
-#define SIGTERM 15
-#define SIGUNUSED 31
-#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__arm__) \
- || defined(__s390__) || defined(__ia64__)
-#define SIGBUS 7
-#define SIGUSR1 10
-#define SIGUSR2 12
-#define SIGSTKFLT 16
-#define SIGCHLD 17
-#define SIGCONT 18
-#define SIGSTOP 19
-#define SIGTSTP 20
-#define SIGTTIN 21
-#define SIGTTOU 22
-#define SIGURG 23
-#define SIGXCPU 24
-#define SIGXFSZ 25
-#define SIGVTALRM 26
-#define SIGPROF 27
-#define SIGWINCH 28
-#define SIGIO 29
-#define SIGPWR 30
-#define SIGSYS 31
-#elif defined(__alpha__) || defined(__sparc__)
-#define SIGEMT 7
-#define SIGBUS 10
-#define SIGSYS 12
-#define SIGURG 16
-#define SIGSTOP 17
-#define SIGTSTP 18
-#define SIGCONT 19
-#define SIGCHLD 20
-#define SIGTTIN 21
-#define SIGTTOU 22
-#define SIGIO 23
-#define SIGXCPU 24
-#define SIGXFSZ 25
-#define SIGVTALRM 26
-#define SIGPROF 27
-#define SIGWINCH 28
-#define SIGPWR 29
-#define SIGUSR1 30
-#define SIGUSR2 31
-#if defined(__alpha__)
-#define SIGINFO SIGPWR
-#endif
-#elif defined(__mips__)
-#define SIGEMT 7
-#define SIGBUS 10
-#define SIGSYS 12
-#define SIGUSR1 16
-#define SIGUSR2 17
-#define SIGCHLD 18
-#define SIGPWR 19
-#define SIGWINCH 20
-#define SIGURG 21
-#define SIGIO 22
-#define SIGSTOP 23
-#define SIGTSTP 24
-#define SIGCONT 25
-#define SIGTTIN 26
-#define SIGTTOU 27
-#define SIGVTALRM 28
-#define SIGPROF 29
-#define SIGXCPU 30
-#define SIGXFSZ 31
-#elif defined(__hppa__)
-#define SIGEMT 7
-#define SIGBUS 10
-#define SIGSYS 12
-#define SIGUSR1 16
-#define SIGUSR2 17
-#define SIGCHLD 18
-#define SIGPWR 19
-#define SIGVTALRM 20
-#define SIGPROF 21
-#define SIGIO 22
-#define SIGWINCH 23
-#define SIGSTOP 24
-#define SIGTSTP 25
-#define SIGCONT 26
-#define SIGTTIN 27
-#define SIGTTOU 28
-#define SIGURG 29
-#define SIGLOST 30
-#define SIGUNUSED 31
-#define SIGRESERVE SIGUNUSE
-#define SIGXCPU 33
-#define SIGXFSZ 34
-#define SIGSTKFLT 36
-
-#else
-#error signal layout not yet known
-#endif
-
-#define SIGCLD SIGCHLD
-#define SIGLOST SIGPWR
-#define SIGPOLL SIGIO
-
-/* These should not be considered constants from userland. */
-#ifdef __hppa__
-#define SIGRTMIN 37
-#else
-#define SIGRTMIN 32
-#endif
-#define SIGRTMAX (_NSIG-1)
-
-/* SA_FLAGS values: */
-#if defined(__alpha__)
-#define SA_ONSTACK 0x00000001
-#define SA_RESTART 0x00000002
-#define SA_NOCLDSTOP 0x00000004
-#define SA_NODEFER 0x00000008
-#define SA_RESETHAND 0x00000010
-#define SA_NOCLDWAIT 0x00000020 /* not supported yet */
-#define SA_SIGINFO 0x00000040
-#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
-#elif defined(__hppa__)
-#define SA_ONSTACK 0x00000001
-#define SA_RESETHAND 0x00000004
-#define SA_NOCLDSTOP 0x00000008
-#define SA_SIGINFO 0x00000010
-#define SA_NODEFER 0x00000020
-#define SA_RESTART 0x00000040
-#define SA_NOCLDWAIT 0x00000080 /* not supported yet */
-#define _SA_SIGGFAULT 0x00000100 /* HPUX */
-#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
-#define SA_RESTORER 0x04000000 /* obsolete -- ignored */
-#elif defined (__sparc__)
-#define SV_SSTACK 1 /* This signal handler should use sig-stack */
-#define SV_INTR 2 /* Sig return should not restart system call */
-#define SV_RESET 4 /* Set handler to SIG_DFL upon taken signal */
-#define SV_IGNCHILD 8 /* Do not send SIGCHLD */
-
-#define SA_NOCLDSTOP SV_IGNCHILD
-#define SA_STACK SV_SSTACK
-#define SA_ONSTACK SV_SSTACK
-#define SA_RESTART SV_INTR
-#define SA_RESETHAND SV_RESET
-#define SA_INTERRUPT 0x10
-#define SA_NODEFER 0x20
-#define SA_SHIRQ 0x40
-#define SA_NOCLDWAIT 0x100 /* not supported yet */
-#define SA_SIGINFO 0x200
-#else
-#if defined (__mips__)
-#define SA_NOCLDSTOP 0x00000001
-#define SA_SIGINFO 0x00000008
-#define SA_NOCLDWAIT 0x00010000 /* Not supported yet */
-#else
-#define SA_NOCLDSTOP 0x00000001
-#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
-#define SA_SIGINFO 0x00000004
-#endif
-#if defined(__arm__)
-#define SA_THIRTYTWO 0x02000000
-#endif
-#define SA_RESTORER 0x04000000
-#define SA_ONSTACK 0x08000000
-#define SA_RESTART 0x10000000
-#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
-#define SA_NODEFER 0x40000000
-#define SA_RESETHAND 0x80000000
-#endif
-
-/* ugh, historic Linux legacy, for gpm :-( */
-#define SA_NOMASK SA_NODEFER
-#define SA_ONESHOT SA_RESETHAND
-
-/* sigaltstack controls */
-#define SS_ONSTACK 1
-#define SS_DISABLE 2
-
-#define MINSIGSTKSZ 2048
-#define SIGSTKSZ 8192
-
-#if defined(__alpha__) || defined(__mips__)
-#define SIG_BLOCK 1 /* for blocking signals */
-#define SIG_UNBLOCK 2 /* for unblocking signals */
-#define SIG_SETMASK 3 /* for setting the signal mask */
-#else
-#define SIG_BLOCK 0 /* for blocking signals */
-#define SIG_UNBLOCK 1 /* for unblocking signals */
-#define SIG_SETMASK 2 /* for setting the signal mask */
-#endif
-
-typedef int sig_atomic_t;
-
-typedef void (*sighandler_t)(int);
-
-#ifdef _BSD_SOURCE
-typedef sighandler_t sig_t;
-#endif
-
-#define SIG_DFL ((sighandler_t)0) /* default signal handling */
-#define SIG_IGN ((sighandler_t)1) /* ignore signal */
-#define SIG_ERR ((sighandler_t)-1) /* error return from signal */
-
-typedef union sigval {
- int sival_int;
- void *sival_ptr;
-} sigval_t;
-
-#define SI_MAX_SIZE 128
-#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
-
-typedef struct siginfo {
- int si_signo;
- int si_errno;
- int si_code;
- union {
- int _pad[SI_PAD_SIZE];
- /* kill() */
- struct {
- pid_t _pid; /* sender's pid */
- uid_t _uid; /* sender's uid */
- } _kill;
- /* POSIX.1b timers */
- struct {
- unsigned int _timer1;
- unsigned int _timer2;
- } _timer;
- /* POSIX.1b signals */
- struct {
- pid_t _pid; /* sender's pid */
- uid_t _uid; /* sender's uid */
- sigval_t _sigval;
- } _rt;
- /* SIGCHLD */
- struct {
- pid_t _pid; /* which child */
- uid_t _uid; /* sender's uid */
- int _status; /* exit code */
- clock_t _utime;
- clock_t _stime;
- } _sigchld;
- /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
- struct {
- void *_addr; /* faulting insn/memory ref. */
- } _sigfault;
- /* SIGPOLL */
- struct {
- int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
- int _fd;
- } _sigpoll;
- } _sifields;
-} siginfo_t;
-
-/*
- * How these fields are to be accessed.
- */
-#define si_pid _sifields._kill._pid
-#define si_uid _sifields._kill._uid
-#define si_status _sifields._sigchld._status
-#define si_utime _sifields._sigchld._utime
-#define si_stime _sifields._sigchld._stime
-#define si_value _sifields._rt._sigval
-#define si_int _sifields._rt._sigval.sival_int
-#define si_ptr _sifields._rt._sigval.sival_ptr
-#define si_addr _sifields._sigfault._addr
-#define si_band _sifields._sigpoll._band
-#define si_fd _sifields._sigpoll._fd
-
-/* Values for `si_code'. Positive values are reserved for kernel-generated
- signals. */
-enum {
- SI_ASYNCNL = -6, /* Sent by asynch name lookup completion. */
-# define SI_ASYNCNL SI_ASYNCNL
- SI_SIGIO, /* Sent by queued SIGIO. */
-# define SI_SIGIO SI_SIGIO
- SI_ASYNCIO, /* Sent by AIO completion. */
-# define SI_ASYNCIO SI_ASYNCIO
- SI_MESGQ, /* Sent by real time mesq state change. */
-# define SI_MESGQ SI_MESGQ
- SI_TIMER, /* Sent by timer expiration. */
-# define SI_TIMER SI_TIMER
- SI_QUEUE, /* Sent by sigqueue. */
-# define SI_QUEUE SI_QUEUE
- SI_USER, /* Sent by kill, sigsend, raise. */
-# define SI_USER SI_USER
- SI_KERNEL = 0x80 /* Send by kernel. */
-#define SI_KERNEL SI_KERNEL
-};
-
-
-/* `si_code' values for SIGILL signal. */
-enum {
- ILL_ILLOPC = 1, /* Illegal opcode. */
-# define ILL_ILLOPC ILL_ILLOPC
- ILL_ILLOPN, /* Illegal operand. */
-# define ILL_ILLOPN ILL_ILLOPN
- ILL_ILLADR, /* Illegal addressing mode. */
-# define ILL_ILLADR ILL_ILLADR
- ILL_ILLTRP, /* Illegal trap. */
-# define ILL_ILLTRP ILL_ILLTRP
- ILL_PRVOPC, /* Privileged opcode. */
-# define ILL_PRVOPC ILL_PRVOPC
- ILL_PRVREG, /* Privileged register. */
-# define ILL_PRVREG ILL_PRVREG
- ILL_COPROC, /* Coprocessor error. */
-# define ILL_COPROC ILL_COPROC
- ILL_BADSTK /* Internal stack error. */
-# define ILL_BADSTK ILL_BADSTK
-};
-
-/* `si_code' values for SIGFPE signal. */
-enum {
- FPE_INTDIV = 1, /* Integer divide by zero. */
-# define FPE_INTDIV FPE_INTDIV
- FPE_INTOVF, /* Integer overflow. */
-# define FPE_INTOVF FPE_INTOVF
- FPE_FLTDIV, /* Floating point divide by zero. */
-# define FPE_FLTDIV FPE_FLTDIV
- FPE_FLTOVF, /* Floating point overflow. */
-# define FPE_FLTOVF FPE_FLTOVF
- FPE_FLTUND, /* Floating point underflow. */
-# define FPE_FLTUND FPE_FLTUND
- FPE_FLTRES, /* Floating point inexact result. */
-# define FPE_FLTRES FPE_FLTRES
- FPE_FLTINV, /* Floating point invalid operation. */
-# define FPE_FLTINV FPE_FLTINV
- FPE_FLTSUB /* Subscript out of range. */
-# define FPE_FLTSUB FPE_FLTSUB
-};
-
-/* `si_code' values for SIGSEGV signal. */
-enum {
- SEGV_MAPERR = 1, /* Address not mapped to object. */
-# define SEGV_MAPERR SEGV_MAPERR
- SEGV_ACCERR /* Invalid permissions for mapped object. */
-# define SEGV_ACCERR SEGV_ACCERR
-};
-
-/* `si_code' values for SIGBUS signal. */
-enum {
- BUS_ADRALN = 1, /* Invalid address alignment. */
-# define BUS_ADRALN BUS_ADRALN
- BUS_ADRERR, /* Non-existant physical address. */
-# define BUS_ADRERR BUS_ADRERR
- BUS_OBJERR /* Object specific hardware error. */
-# define BUS_OBJERR BUS_OBJERR
-};
-
-/* `si_code' values for SIGTRAP signal. */
-enum {
- TRAP_BRKPT = 1, /* Process breakpoint. */
-# define TRAP_BRKPT TRAP_BRKPT
- TRAP_TRACE /* Process trace trap. */
-# define TRAP_TRACE TRAP_TRACE
-};
-
-/* `si_code' values for SIGCHLD signal. */
-enum {
- CLD_EXITED = 1, /* Child has exited. */
-# define CLD_EXITED CLD_EXITED
- CLD_KILLED, /* Child was killed. */
-# define CLD_KILLED CLD_KILLED
- CLD_DUMPED, /* Child terminated abnormally. */
-# define CLD_DUMPED CLD_DUMPED
- CLD_TRAPPED, /* Traced child has trapped. */
-# define CLD_TRAPPED CLD_TRAPPED
- CLD_STOPPED, /* Child has stopped. */
-# define CLD_STOPPED CLD_STOPPED
- CLD_CONTINUED /* Stopped child has continued. */
-# define CLD_CONTINUED CLD_CONTINUED
-};
-
-/* `si_code' values for SIGPOLL signal. */
-enum {
- POLL_IN = 1, /* Data input available. */
-# define POLL_IN POLL_IN
- POLL_OUT, /* Output buffers available. */
-# define POLL_OUT POLL_OUT
- POLL_MSG, /* Input message available. */
-# define POLL_MSG POLL_MSG
- POLL_ERR, /* I/O error. */
-# define POLL_ERR POLL_ERR
- POLL_PRI, /* High priority input available. */
-# define POLL_PRI POLL_PRI
- POLL_HUP /* Device disconnected. */
-# define POLL_HUP POLL_HUP
-};
-
-#define _NSIG_WORDS ((_NSIG/sizeof(long))>>3)
-
-typedef struct {
- unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-struct sigaction {
-#if defined(__alpha__)
- union {
- sighandler_t _sa_handler;
- void (*_sa_sigaction)(int, siginfo_t*, void*);
- } _u;
- sigset_t sa_mask;
- unsigned long sa_flags;
-#elif defined(__ia64__) || defined(__hppa__)
- union {
- sighandler_t _sa_handler;
- void (*_sa_sigaction)(int, siginfo_t*, void*);
- } _u;
- unsigned long sa_flags;
- sigset_t sa_mask;
-#elif defined(__mips__)
- unsigned long sa_flags;
- union {
- sighandler_t _sa_handler;
- void (*_sa_sigaction)(int, siginfo_t*, void*);
- } _u;
- sigset_t sa_mask;
- void (*sa_restorer)(void);
- int sa_resv[1];
-#else /* arm, i386, ppc, s390, sparc, saprc64, x86_64 */
- union {
- sighandler_t _sa_handler;
- void (*_sa_sigaction)(int, siginfo_t*, void*);
- } _u;
- unsigned long sa_flags;
- void (*sa_restorer)(void);
- sigset_t sa_mask;
-#endif
-};
-
-#define sa_handler _u._sa_handler
-#define sa_sigaction _u._sa_sigaction
-
-typedef struct sigaltstack {
-#if defined(__mips__)
- void *ss_sp;
- size_t ss_size;
- int ss_flags;
-#else
- void *ss_sp;
- int ss_flags;
- size_t ss_size;
-#endif
-} stack_t;
-
-int sigaltstack(const struct sigaltstack *newstack, struct sigaltstack *oldstack) __THROW;
-
-int sigemptyset(sigset_t *set) __THROW;
-int sigfillset(sigset_t *set) __THROW;
-int sigaddset(sigset_t *set, int signum) __THROW;
-int sigdelset(sigset_t *set, int signum) __THROW;
-int sigismember(const sigset_t *set, int signo) __THROW;
-int sigsuspend(const sigset_t *mask) __THROW;
-int sigpending(sigset_t *set) __THROW;
-int sigprocmask(int how, const sigset_t *set, sigset_t *oldset) __THROW;
-
-
-sighandler_t signal(int signum, sighandler_t action);
-
-int raise (int sig) __THROW;
-int kill(pid_t pid, int sig) __THROW;
-
-int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) __THROW;
-
-int sigtimedwait(const sigset_t *mask, siginfo_t *info, const struct timespec *ts) __THROW;
-int sigqueueinfo(int pid, int sig, siginfo_t *info) __THROW;
-int siginterrupt(int sig, int flag) __THROW;
-
-int killpg(int pgrp, int sig) __THROW;
-
-/* 0 is OK ! kernel puts in MAX_THREAD_TIMEOUT :) */
-#define sigwaitinfo(m, i) sigtimedwait((m),(i),0)
-
-extern const char *const sys_siglist[];
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/stdarg-cruft.h b/mdk-stage1/dietlibc/include/stdarg-cruft.h
deleted file mode 100644
index fbd9e0ca4..000000000
--- a/mdk-stage1/dietlibc/include/stdarg-cruft.h
+++ /dev/null
@@ -1,299 +0,0 @@
-#if defined(__sparc__) || defined(__alpha__) || defined(__mips__)
-enum {
- __no_type_class = -1,
- __void_type_class,
- __integer_type_class,
- __char_type_class,
- __enumeral_type_class,
- __boolean_type_class,
- __pointer_type_class,
- __reference_type_class,
- __offset_type_class,
- __real_type_class,
- __complex_type_class,
- __function_type_class,
- __method_type_class,
- __record_type_class,
- __union_type_class,
- __array_type_class,
- __string_type_class,
- __set_type_class,
- __file_type_class,
- __lang_type_class
-};
-#endif
-
-#if defined(__sparc__)
-
-typedef char* va_list;
-#define va_end(ap) ap=0
-
-#define va_start(AP, LASTARG) \
- (__builtin_next_arg (LASTARG), AP = (char *) __builtin_saveregs ())
-
-#define __va_rounded_size(TYPE) \
- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-
-/* We don't declare the union member `d' to have type TYPE
- because that would lose in C++ if TYPE has a constructor. */
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement.
- The casts to char * avoid warnings about invalid pointer arithmetic. */
-#define va_arg(pvar,TYPE) \
-__extension__ \
-(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
- || (__builtin_classify_type (*(TYPE*) 0) == __real_type_class \
- && sizeof (TYPE) == 16)) \
- ? ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE *), \
- *(TYPE **) (void *) ((char *)(pvar) - __va_rounded_size (TYPE *))) \
- : __va_rounded_size (TYPE) == 8 \
- ? ({ union {char __d[sizeof (TYPE)]; int __i[2];} __u; \
- __u.__i[0] = ((int *) (void *) (pvar))[0]; \
- __u.__i[1] = ((int *) (void *) (pvar))[1]; \
- (pvar) = (char *)(pvar) + 8; \
- (TYPE *) (void *) __u.__d; }) \
- : ((pvar) = (char *)(pvar) + __va_rounded_size (TYPE), \
- ((TYPE *) (void *) ((char *)(pvar) - __va_rounded_size (TYPE)))));}))
-
-
-#elif defined(__mips__)
-
-typedef char * va_list;
-
-#ifdef __mips64
-#define __va_rounded_size(__TYPE) \
- (((sizeof (__TYPE) + 8 - 1) / 8) * 8)
-#else
-#define __va_rounded_size(__TYPE) \
- (((sizeof (__TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
-#endif
-#ifdef __mips64
-#define __va_reg_size 8
-#else
-#define __va_reg_size 4
-#endif
-
-#define va_start(__AP, __LASTARG) \
- (__AP = (va_list) __builtin_next_arg (__LASTARG))
-
-#ifdef __mips64
-#ifdef __MIPSEB__
-#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) \
- ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
- + __va_rounded_size (__type))))[-1]
-#else
-#define va_arg(__AP, __type) \
- ((__AP = (char *) ((((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8) \
- + __va_rounded_size (__type))), \
- *(__type *) (void *) (__AP - __va_rounded_size (__type)))
-#endif
-
-#else /* not __mips64 */
-
-#ifdef __MIPSEB__
-/* For big-endian machines. */
-#define va_arg(__AP, __type) \
- ((__AP = (char *) ((__alignof__ (__type) > 4 \
- ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
- : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
- + __va_rounded_size (__type))), \
- *(__type *) (void *) (__AP - __va_rounded_size (__type)))
-#else
-/* For little-endian machines. */
-#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) ((__alignof__(__type) > 4 \
- ? ((__PTRDIFF_TYPE__)__AP + 8 - 1) & -8 \
- : ((__PTRDIFF_TYPE__)__AP + 4 - 1) & -4) \
- + __va_rounded_size(__type))))[-1]
-#endif
-#endif
-
-#elif defined(__powerpc__)
-
-typedef struct __va_list_tag {
- unsigned char gpr; /* index into the array of 8 GPRs stored in the
- register save area gpr=0 corresponds to r3,
- gpr=1 to r4, etc. */
- unsigned char fpr; /* index into the array of 8 FPRs stored in the
- register save area fpr=0 corresponds to f1,
- fpr=1 to f2, etc. */
- char *overflow_arg_area; /* location on stack that holds the next
- overflow argument */
- char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
-} va_list[1];
-
-#define __va_overflow(AP) (AP)->overflow_arg_area
-#ifdef __OPTIMIZE__
-extern void __va_arg_type_violation(void) __attribute__((__noreturn__));
-#else
-#define __va_arg_type_violation()
-#endif
-
-typedef struct {
- long __gp_save[8]; /* save area for GP registers */
- double __fp_save[8]; /* save area for FP registers */
-} __va_regsave_t;
-
-/* Macros to access the register save area */
-/* We cast to void * and then to TYPE * because this avoids
- a warning about increasing the alignment requirement. */
-#define __VA_FP_REGSAVE(AP,OFS,TYPE) \
- ((TYPE *) (void *) (&(((__va_regsave_t *) \
- (AP)->reg_save_area)->__fp_save[OFS])))
-
-#define __VA_GP_REGSAVE(AP,OFS,TYPE) \
- ((TYPE *) (void *) (&(((__va_regsave_t *) \
- (AP)->reg_save_area)->__gp_save[OFS])))
-
-#define __va_start_common(AP, FAKE) \
- __builtin_memcpy ((AP), __builtin_saveregs (), sizeof(va_list))
-
-#define va_start(AP,LASTARG) \
- (__builtin_next_arg (LASTARG), __va_start_common (AP, 0))
-
-#ifdef _SOFT_FLOAT
-#define __va_float_p(TYPE) 0
-#else
-#define __va_float_p(TYPE) (__builtin_classify_type(*(TYPE *)0) == 8)
-#endif
-
-#define __va_aggregate_p(TYPE) (__builtin_classify_type(*(TYPE *)0) >= 12)
-#define __va_size(TYPE) ((sizeof(TYPE) + sizeof (long) - 1) / sizeof (long))
-
-#define va_arg(AP,TYPE) \
-__extension__ (*({ \
- register TYPE *__ptr; \
- \
- if (__va_float_p (TYPE) && sizeof (TYPE) < 16) \
- { \
- unsigned char __fpr = (AP)->fpr; \
- if (__fpr < 8) \
- { \
- __ptr = __VA_FP_REGSAVE (AP, __fpr, TYPE); \
- (AP)->fpr = __fpr + 1; \
- } \
- else if (sizeof (TYPE) == 8) \
- { \
- unsigned long __addr = (unsigned long) (__va_overflow (AP)); \
- __ptr = (TYPE *)((__addr + 7) & -8); \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- else \
- { \
- /* float is promoted to double. */ \
- __va_arg_type_violation (); \
- } \
- } \
- \
- /* Aggregates and long doubles are passed by reference. */ \
- else if (__va_aggregate_p (TYPE) || __va_float_p (TYPE)) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 8) \
- { \
- __ptr = * __VA_GP_REGSAVE (AP, __gpr, TYPE *); \
- (AP)->gpr = __gpr + 1; \
- } \
- else \
- { \
- TYPE **__pptr = (TYPE **) (__va_overflow (AP)); \
- __ptr = * __pptr; \
- __va_overflow (AP) = (char *) (__pptr + 1); \
- } \
- } \
- \
- /* Only integrals remaining. */ \
- else \
- { \
- /* longlong is aligned. */ \
- if (sizeof (TYPE) == 8) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 7) \
- { \
- __gpr += __gpr & 1; \
- __ptr = __VA_GP_REGSAVE (AP, __gpr, TYPE); \
- (AP)->gpr = __gpr + 2; \
- } \
- else \
- { \
- unsigned long __addr = (unsigned long) (__va_overflow (AP)); \
- __ptr = (TYPE *)((__addr + 7) & -8); \
- (AP)->gpr = 8; \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- } \
- else if (sizeof (TYPE) == 4) \
- { \
- unsigned char __gpr = (AP)->gpr; \
- if (__gpr < 8) \
- { \
- __ptr = __VA_GP_REGSAVE (AP, __gpr, TYPE); \
- (AP)->gpr = __gpr + 1; \
- } \
- else \
- { \
- __ptr = (TYPE *) __va_overflow (AP); \
- __va_overflow (AP) = (char *)(__ptr + 1); \
- } \
- } \
- else \
- { \
- /* Everything else was promoted to int. */ \
- __va_arg_type_violation (); \
- } \
- } \
- __ptr; \
-}))
-
-#define va_end(AP) ((void)0)
-
-/* Copy va_list into another variable of this type. */
-#define __va_copy(dest, src) *(dest) = *(src)
-
-#elif defined(__alpha__)
-
-typedef struct {
- char *__base; /* Pointer to first integer register. */
- int __offset; /* Byte offset of args so far. */
-} va_list;
-
-#define va_start(pvar, firstarg) \
- (__builtin_next_arg (firstarg), \
- (pvar) = *(va_list *) __builtin_saveregs ())
-#define va_end(__va) ((void) 0)
-
-#define __va_tsize(__type) \
- (((sizeof (__type) + __extension__ sizeof (long long) - 1) \
- / __extension__ sizeof (long long)) * __extension__ sizeof (long long))
-
-#define va_arg(__va, __type) \
-(*(((__va).__offset += __va_tsize (__type)), \
- (__type *)(void *)((__va).__base + (__va).__offset \
- - (((__builtin_classify_type (* (__type *) 0) \
- == __real_type_class) && (__va).__offset <= (6 * 8)) \
- ? (6 * 8) + 8 : __va_tsize (__type)))))
-
-#else /* !__sparc__ && !__powerpc__ && !__mips__ && !__alpha__*/
-
-typedef char* va_list;
-
-/* this only works when everything is passed on the stack (i.e. x86) */
-#if __WORDSIZE == 64
-#define va_start(ap,argn) ap=((char*)&argn)+8
-#else
-#define va_start(ap,argn) ap=((char*)&argn)+4
-#endif
-#define va_arg(ap,type) (ap+=sizeof(type), *(type*)((void*)ap-sizeof(type)))
-
-#endif
-
-#ifndef __va_copy
-#define __va_copy(x,y) x=y
-#endif
-
-#ifndef va_end
-#define va_end(ap) ((void)0)
-#endif
-
diff --git a/mdk-stage1/dietlibc/include/stdarg.h b/mdk-stage1/dietlibc/include/stdarg.h
deleted file mode 100644
index 3a21bdb56..000000000
--- a/mdk-stage1/dietlibc/include/stdarg.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _STDARG_H
-#define _STDARG_H
-
-#include <endian.h>
-
-#if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96))
-
-typedef __builtin_va_list va_list;
-#define va_start(v,l) __builtin_stdarg_start((v),l)
-#define va_end __builtin_va_end
-#define va_arg __builtin_va_arg
-#define __va_copy(d,s) __builtin_va_copy((d),(s))
-
-#endif
-
-#ifndef va_end
-#include <stdarg-cruft.h>
-#endif
-
-#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L
-#define va_copy(d,s) __va_copy(d,s)
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/stddef.h b/mdk-stage1/dietlibc/include/stddef.h
deleted file mode 100644
index cdf54ec1e..000000000
--- a/mdk-stage1/dietlibc/include/stddef.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _STDDEF_H
-#define _STDDEF_H
-
-/* ugh. This is normally provided by gcc. */
-
-#ifdef __GNUC__
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-typedef __SIZE_TYPE__ size_t;
-typedef __WCHAR_TYPE__ wchar_t;
-#else
-typedef signed long ptrdiff_t;
-typedef unsigned long size_t;
-typedef int wchar_t;
-#endif
-
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-#undef offsetof
-#define offsetof(type,member) ((size_t) &((type*)0)->member)
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/stdint.h b/mdk-stage1/dietlibc/include/stdint.h
deleted file mode 100644
index bbc7ddf0c..000000000
--- a/mdk-stage1/dietlibc/include/stdint.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _STDINT_H
-#define _STDINT_H
-
-#include <inttypes.h>
-
-typedef int8_t int_least8_t;
-typedef int16_t int_least16_t;
-typedef int32_t int_least32_t;
-typedef uint8_t uint_least8_t;
-typedef uint16_t uint_least16_t;
-typedef uint32_t uint_least32_t;
-
-#ifndef __STRICT_ANSI__
-typedef int64_t int_least64_t;
-typedef uint64_t uint_least64_t;
-#endif
-
-typedef signed char int_fast8_t;
-typedef signed long int int_fast16_t;
-typedef signed long int int_fast32_t;
-typedef signed long long int int_fast64_t;
-
-typedef unsigned char uint_fast8_t;
-typedef unsigned long int uint_fast16_t;
-typedef unsigned long int uint_fast32_t;
-typedef unsigned long long int uint_fast64_t;
-
-#include <endian.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/stdio.h b/mdk-stage1/dietlibc/include/stdio.h
deleted file mode 100644
index 04783c3b8..000000000
--- a/mdk-stage1/dietlibc/include/stdio.h
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef _STDIO_H
-#define _STDIO_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-typedef struct __stdio_file FILE;
-
-FILE *fopen (const char *path, const char *mode) __THROW;
-FILE *fdopen (int fildes, const char *mode) __THROW;
-FILE *freopen (const char *path, const char *mode, FILE *stream) __THROW;
-
-int printf(const char *format, ...) __THROW __attribute__((format(printf,1,2)));
-int fprintf(FILE *stream, const char *format, ...) __THROW __attribute__((format(printf,2,3)));
-int sprintf(char *str, const char *format, ...) __THROW __attribute__((format(printf,2,3)));
-int snprintf(char *str, size_t size, const char *format, ...) __THROW __attribute__((format(printf,3,4)));
-int asprintf(char **ptr, const char* format, ...) __THROW __attribute_malloc__ __attribute__((format(printf,2,3)));
-
-int scanf(const char *format, ...) __THROW __attribute__((format(scanf,1,2)));
-int fscanf(FILE *stream, const char *format, ...) __THROW __attribute__((format(scanf,2,3)));
-int sscanf(const char *str, const char *format, ...) __THROW __attribute__((format(scanf,2,3)));
-
-#include <stdarg.h>
-
-int vprintf(const char *format, va_list ap) __THROW __attribute__((format(printf,1,0)));
-int vfprintf(FILE *stream, const char *format, va_list ap) __THROW __attribute__((format(printf,2,0)));
-int vsprintf(char *str, const char *format, va_list ap) __THROW __attribute__((format(printf,2,0)));
-int vsnprintf(char *str, size_t size, const char *format, va_list ap) __THROW __attribute__((format(printf,3,0)));
-
-int fdprintf(int fd, const char *format, ...) __THROW __attribute__((format(printf,2,3)));
-int vfdprintf(int fd, const char *format, va_list ap) __THROW __attribute__((format(printf,2,0)));
-
-int vscanf(const char *format, va_list ap) __THROW __attribute__((format(scanf,1,0)));
-int vsscanf(const char *str, const char *format, va_list ap) __THROW __attribute__((format(scanf,2,0)));
-int vfscanf(FILE *stream, const char *format, va_list ap) __THROW __attribute__((format(scanf,2,0)));
-
-int fgetc(FILE *stream) __THROW;
-int fgetc_unlocked(FILE *stream) __THROW;
-char *fgets(char *s, int size, FILE *stream) __THROW;
-int getc(FILE *stream) __THROW;
-int getchar(void) __THROW;
-char *gets(char *s) __THROW;
-int ungetc(int c, FILE *stream) __THROW;
-
-int fputc(int c, FILE *stream) __THROW;
-int fputc_unlocked(int c, FILE *stream) __THROW;
-int fputs(const char *s, FILE *stream) __THROW;
-
-int putchar(int c) __THROW;
-
-#define putc(c,stream) fputc(c,stream)
-#define putchar(c) fputc(c,stdout)
-
-#define getchar() fgetc(stdin)
-#define getc(stream) fgetc(stream)
-#define getc_unlocked(stream) fgetc_unlocked(stream)
-
-int puts(const char *s) __THROW;
-
-int fseek(FILE *stream, long offset, int whence) __THROW;
-long ftell(FILE *stream) __THROW;
-int fseeko(FILE *stream, off_t offset, int whence) __THROW;
-off_t ftello(FILE *stream) __THROW;
-
-#ifndef __NO_STAT64
-int fseeko64(FILE *stream, loff_t offset, int whence) __THROW;
-loff_t ftello64(FILE *stream) __THROW;
-
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-#define off_t loff_t
-#define fseeko(foo,bar,baz) fseeko64(foo,bar,baz)
-#define ftello(foo) ftello64(foo)
-#endif
-
-#endif
-
-void rewind(FILE *stream) __THROW;
-int fgetpos(FILE *stream, fpos_t *pos) __THROW;
-int fsetpos(FILE *stream, fpos_t *pos) __THROW;
-
-size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) __THROW;
-
-size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) __THROW;
-
-int fflush(FILE *stream) __THROW;
-
-int fclose(FILE *stream) __THROW;
-
-int feof (FILE *stream) __THROW;
-int ferror(FILE *stream) __THROW;
-int fileno(FILE *stream) __THROW;
-void clearerr(FILE *stream) __THROW;
-
-int remove(const char *pathname) __THROW;
-
-void perror(const char *s) __THROW;
-
-extern FILE *stdin, *stdout, *stderr;
-
-#define EOF (-1)
-
-#define BUFSIZ 128
-
-#define _IONBF 0
-#define _IOLBF 1
-#define _IOFBF 2
-
-int setvbuf(FILE *stream, char *buf, int mode , size_t size) __THROW;
-
-#define setbuf(stream,buf) setvbuf(stream,buf,buf?_IOFBF:_IONBF,BUFSIZ)
-#define setbuffer(stream,buf,size) setvbuf(stream,buf,buf?_IOFBF:_IONBF,size)
-#define setlinebuf(stream) setvbuf(stream,0,_IOLBF,BUFSIZ)
-
-FILE *popen(const char *command, const char *type) __THROW;
-int pclose(FILE *stream) __THROW;
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-
-#define L_tmpnam 128
-#define P_tmpdir "/tmp"
-char* tmpnam(char *s) __THROW; /* DO NOT USE!!! Use mkstemp instead! */
-char* tempnam(char* dir,char* _template); /* dito */
-FILE* tmpfile(void) __THROW;
-
-#define FILENAME_MAX 4095
-#define FOPEN_MAX 16
-
-#ifdef _POSIX_SOURCE
-#define L_ctermid 9
-#define L_cuserid 9
-#endif
-
-void flockfile(FILE* f) __THROW;
-void funlockfile(FILE* f) __THROW;
-
-#ifdef _GNU_SOURCE
-ssize_t getline(char **lineptr, size_t *n, FILE *stream);
-ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
-#define getline(lineptr,n,stream) getdelim(lineptr,n,'\n',stream)
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/stdlib.h b/mdk-stage1/dietlibc/include/stdlib.h
deleted file mode 100644
index 5824a6ffa..000000000
--- a/mdk-stage1/dietlibc/include/stdlib.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef _STDLIB_H
-#define _STDLIB_H
-
-#ifndef __ASSEMBLER__
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <alloca.h>
-
-void *calloc(size_t nmemb, size_t size) __attribute_malloc__ __THROW;
-void *malloc(size_t size) __attribute_malloc__ __THROW;
-void free(void *ptr) __THROW;
-void *realloc(void *ptr, size_t size) __attribute_malloc__ __THROW;
-
-char *getenv(const char *name) __THROW __pure__;
-int putenv(const char *string) __THROW;
-int setenv(const char *name, const char *value, int overwrite) __THROW;
-void unsetenv(const char *name) __THROW;
-
-int system (const char * string) __THROW;
-int atexit(void (*function)(void)) __THROW;
-
-float strtof(const char *nptr, char **endptr) __THROW;
-double strtod(const char *nptr, char **endptr) __THROW;
-long double strtold(const char *nptr, char **endptr) __THROW;
-long int strtol(const char *nptr, char **endptr, int base) __THROW;
-unsigned long int strtoul(const char *nptr, char **endptr, int base) __THROW;
-
-extern int __ltostr(char *s, unsigned int size, unsigned long i, unsigned int base, int UpCase) __THROW;
-extern int __dtostr(double d,char *buf,unsigned int maxlen,unsigned int prec,unsigned int prec2) __THROW;
-
-#ifndef __STRICT_ANSI__
-__extension__ long long int strtoll(const char *nptr, char **endptr, int base) __THROW;
-__extension__ unsigned long long int strtoull(const char *nptr, char **endptr, int base) __THROW;
-__extension__ int __lltostr(char *s, unsigned int size, unsigned long long i, unsigned int base, int UpCase) __THROW;
-#endif
-
-int atoi(const char *nptr) __THROW;
-long int atol(const char *nptr) __THROW;
-double atof(const char *nptr) __THROW;
-
-void exit(int status) __THROW __attribute__((noreturn));
-void abort(void) __THROW;
-
-extern int rand(void) __THROW;
-extern int rand_r(unsigned int *seed) __THROW;
-extern void srand(unsigned int seed) __THROW;
-#ifdef _BSD_SOURCE
-extern int random(void) __THROW;
-extern void srandom(unsigned int seed) __THROW;
-#endif
-
-typedef unsigned short randbuf[3];
-double drand48(void) __THROW;
-long lrand48(void) __THROW;
-long mrand48(void) __THROW;
-void srand48(long seed) __THROW;
-unsigned short *seed48(randbuf buf) __THROW;
-void lcong48(unsigned short param[7]) __THROW;
-long jrand48(randbuf buf) __THROW;
-long nrand48(randbuf buf) __THROW;
-double erand48(randbuf buf) __THROW;
-
-void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) __THROW;
-void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) __THROW;
-
-extern char **environ;
-
-/* now this function is the greatest bullshit I have ever seen.
- * The ISO people must be out of their minds. */
-typedef struct { int quot,rem; } div_t;
-div_t div(int numer, int denom) __THROW __attribute__((const));
-
-char *realpath(const char *path, char *resolved_path) __THROW;
-
-int mkstemp(char *_template);
-char* mkdtemp(char *_template);
-
-char* mktemp(char *_template);
-
-int abs(int i) __THROW __attribute__((const));
-long int labs(long int i) __THROW __attribute__((const));
-__extension__ long long int llabs(long long int i) __THROW __attribute__((const));
-
-#ifdef _XOPEN_SOURCE
-int grantpt (int fd) __THROW;
-int unlockpt (int fd) __THROW;
-char *ptsname (int fd) __THROW;
-#endif
-
-#endif
-
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-
-#define RAND_MAX ((1<<31) -2)
-
-#define MB_CUR_MAX 1
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/string.h b/mdk-stage1/dietlibc/include/string.h
deleted file mode 100644
index 1c3df8621..000000000
--- a/mdk-stage1/dietlibc/include/string.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef _STRING_H
-#define _STRING_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-char *strcpy(char *dest, const char *src) __THROW;
-
-void *memccpy(void *dest, const void *src, int c, size_t n) __THROW;
-void *memmove(void *dest, const void *src, size_t n) __THROW;
-
-int memccmp(const void *s1, const void *s2, int c, size_t n) __THROW __pure__;
-
-void* memset(void *s, int c, size_t n) __THROW;
-int memcmp(const void *s1, const void *s2, size_t n) __THROW __pure__;
-void* memcpy(void *dest, const void *src, size_t n) __THROW;
-
-char *strncpy(char *dest, const char *src, size_t n) __THROW;
-int strncmp(const char *s1, const char *s2, size_t n) __THROW __pure__;
-char *strncat(char *dest, const char *src, size_t n) __THROW;
-
-int strcmp(const char *s1, const char *s2) __THROW __pure__;
-
-size_t strlen(const char *s) __THROW __pure__;
-
-char *strstr(const char *haystack, const char *needle) __THROW __pure__;
-
-char *strdup(const char *s) __attribute_malloc__ __THROW;
-
-char *strchr(const char *s, int c) __THROW __pure__;
-char *strrchr(const char *s, int c) __THROW __pure__;
-
-char *strcat(char *dest, const char *src) __THROW;
-
-size_t strspn(const char *s, const char *_accept) __THROW;
-size_t strcspn(const char *s, const char *reject) __THROW;
-
-char *strpbrk(const char *s, const char *_accept) __THROW;
-char *strsep(char **stringp, const char *delim) __THROW;
-
-void* memchr(const void *s, int c, size_t n) __THROW __pure__;
-#ifdef _GNU_SOURCE
-void* memrchr(const void *s, int c, size_t n) __THROW __pure__;
-#endif
-
-/* I would like to make this const, but Paul Jarc points out it has to
- * be char* :-( */
-char *strerror(int errnum) __THROW;
-/* work around b0rken GNU crapware like tar 1.13.19 */
-#define strerror strerror
-
-#ifdef _GNU_SOURCE
-const char *strsignal(int signum) __THROW;
-void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) __THROW;
-
-char *strndup(const char *s,size_t n) __attribute_malloc__ __THROW;
-#endif
-
-char *strtok(char *s, const char *delim) __THROW;
-char *strtok_r(char *s, const char *delim, char **ptrptr) __THROW;
-
-size_t strlcpy(char *dst, const char *src, size_t size) __THROW;
-size_t strlcat(char *dst, const char *src, size_t size) __THROW;
-
-int strcoll(const char *s1, const char *s2) __THROW;
-size_t strxfrm(char *dest, const char *src, size_t n) __THROW;
-
-#ifdef _BSD_SOURCE
-#include <strings.h>
-#endif
-
-char *stpcpy(char *dest, const char *src);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/strings.h b/mdk-stage1/dietlibc/include/strings.h
deleted file mode 100644
index fd2616465..000000000
--- a/mdk-stage1/dietlibc/include/strings.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _STRINGS_H
-#define _STRINGS_H
-
-#include <stddef.h>
-#include <sys/cdefs.h>
-
-int strcasecmp(const char *s1, const char *s2) __THROW __pure__;
-int strncasecmp(const char *s1, const char *s2, size_t n) __THROW __pure__;
-int ffs(int i) __THROW __attribute__((__const__));
-
-int bcmp(const void *, const void *, size_t) __THROW __pure__;
-void bcopy(const void *, void *, size_t) __THROW;
-void bzero(void *, size_t) __THROW;
-char *index(const char *, int) __THROW __pure__;
-char *rindex(const char *, int) __THROW __pure__;
-
-#define bzero(s,n) memset(s,0,n)
-#define bcopy(src,dest,n) memmove(dest,src,n)
-#define bcmp(a,b,n) memcmp(a,b,n)
-#define index(a,b) strchr(a,b)
-#define rindex(a,b) strrchr(a,b)
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/alpha-ioctl.h b/mdk-stage1/dietlibc/include/sys/alpha-ioctl.h
deleted file mode 100644
index f1bde3bbb..000000000
--- a/mdk-stage1/dietlibc/include/sys/alpha-ioctl.h
+++ /dev/null
@@ -1,168 +0,0 @@
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 13
-#define _IOC_DIRBITS 3
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
- * And this turns out useful to catch old ioctl numbers in header
- * files for us.
- */
-#define _IOC_NONE 1U
-#define _IOC_READ 2U
-#define _IOC_WRITE 4U
-
-#define _IOC(dir,type,nr,size) \
- ((unsigned int) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT)))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode them.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-#define FIOCLEX _IO('f', 1)
-#define FIONCLEX _IO('f', 2)
-#define FIOASYNC _IOW('f', 125, int)
-#define FIONBIO _IOW('f', 126, int)
-#define FIONREAD _IOR('f', 127, int)
-#define TIOCINQ FIONREAD
-#define FIOQSIZE _IOR('f', 128, loff_t)
-
-#define TIOCGETP _IOR('t', 8, struct sgttyb)
-#define TIOCSETP _IOW('t', 9, struct sgttyb)
-#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
-
-#define TIOCSETC _IOW('t', 17, struct tchars)
-#define TIOCGETC _IOR('t', 18, struct tchars)
-#define TCGETS _IOR('t', 19, struct termios)
-#define TCSETS _IOW('t', 20, struct termios)
-#define TCSETSW _IOW('t', 21, struct termios)
-#define TCSETSF _IOW('t', 22, struct termios)
-
-#define TCGETA _IOR('t', 23, struct termio)
-#define TCSETA _IOW('t', 24, struct termio)
-#define TCSETAW _IOW('t', 25, struct termio)
-#define TCSETAF _IOW('t', 28, struct termio)
-
-#define TCSBRK _IO('t', 29)
-#define TCXONC _IO('t', 30)
-#define TCFLSH _IO('t', 31)
-
-#define TIOCSWINSZ _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ _IOR('t', 104, struct winsize)
-#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
-#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
-#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
-
-#define TIOCGLTC _IOR('t', 116, struct ltchars)
-#define TIOCSLTC _IOW('t', 117, struct ltchars)
-#define TIOCSPGRP _IOW('t', 118, int)
-#define TIOCGPGRP _IOR('t', 119, int)
-
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-
-#define TIOCSTI 0x5412
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-# define TIOCM_LE 0x001
-# define TIOCM_DTR 0x002
-# define TIOCM_RTS 0x004
-# define TIOCM_ST 0x008
-# define TIOCM_SR 0x010
-# define TIOCM_CTS 0x020
-# define TIOCM_CAR 0x040
-# define TIOCM_RNG 0x080
-# define TIOCM_DSR 0x100
-# define TIOCM_CD TIOCM_CAR
-# define TIOCM_RI TIOCM_RNG
-# define TIOCM_OUT1 0x2000
-# define TIOCM_OUT2 0x4000
-# define TIOCM_LOOP 0x8000
-
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-# define TIOCPKT_DATA 0
-# define TIOCPKT_FLUSHREAD 1
-# define TIOCPKT_FLUSHWRITE 2
-# define TIOCPKT_STOP 4
-# define TIOCPKT_START 8
-# define TIOCPKT_NOSTOP 16
-# define TIOCPKT_DOSTOP 32
-
-
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
- /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
-#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
-
-/* Socket-level I/O control calls. */
-
-#define FIOGETOWN _IOR('f', 123, int)
-#define FIOSETOWN _IOW('f', 124, int)
-
-#define SIOCATMARK _IOR('s', 7, int)
-#define SIOCSPGRP _IOW('s', 8, pid_t)
-#define SIOCGPGRP _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */
diff --git a/mdk-stage1/dietlibc/include/sys/arm-ioctl.h b/mdk-stage1/dietlibc/include/sys/arm-ioctl.h
deleted file mode 100644
index ab8b844a5..000000000
--- a/mdk-stage1/dietlibc/include/sys/arm-ioctl.h
+++ /dev/null
@@ -1,149 +0,0 @@
-
-/* ioctl command encoding: 32 bits total, command in lower 16 bits,
- * size of the parameter structure in the lower 14 bits of the
- * upper 16 bits.
- * Encoding the size of the parameter structure in the ioctl request
- * is useful for catching programs compiled with old versions
- * and to avoid overwriting user space outside the user buffer area.
- * The highest 2 bits are reserved for indicating the ``access mode''.
- * NOTE: This limits the max parameter size to 16kB -1 !
- */
-
-/*
- * The following is for compatibility across the various Linux
- * platforms. The i386 ioctl numbering scheme doesn't really enforce
- * a type field. De facto, however, the top 8 bits of the lower 16
- * bits are indeed used as a type field, so we might just as well make
- * this explicit here. Please be sure to use the decoding macros
- * below from now on.
- */
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 14
-#define _IOC_DIRBITS 2
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits.
- */
-#define _IOC_NONE 0U
-#define _IOC_WRITE 1U
-#define _IOC_READ 2U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode ioctl numbers.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS 0x5401
-#define TCSETS 0x5402
-#define TCSETSW 0x5403
-#define TCSETSF 0x5404
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-#define TCSETAW 0x5407
-#define TCSETAF 0x5408
-#define TCSBRK 0x5409
-#define TCXONC 0x540A
-#define TCFLSH 0x540B
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-#define TIOCGPGRP 0x540F
-#define TIOCSPGRP 0x5410
-#define TIOCOUTQ 0x5411
-#define TIOCSTI 0x5412
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define FIONREAD 0x541B
-#define TIOCINQ FIONREAD
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-#define FIONBIO 0x5421
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
-#define FIOCLEX 0x5451
-#define FIOASYNC 0x5452
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-#define FIOQSIZE 0x545E
-
-/* Used for packet mode */
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-
-#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
-
-/* Socket-level I/O control calls. */
-#define FIOSETOWN 0x8901
-#define SIOCSPGRP 0x8902
-#define FIOGETOWN 0x8903
-#define SIOCGPGRP 0x8904
-#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906 /* Get stamp */
diff --git a/mdk-stage1/dietlibc/include/sys/cdefs.h b/mdk-stage1/dietlibc/include/sys/cdefs.h
deleted file mode 100644
index 4ccb0ed2f..000000000
--- a/mdk-stage1/dietlibc/include/sys/cdefs.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef _SYS_CDEFS_H
-#define _SYS_CDEFS_H
-
-/* Suppress kernel-name space pollution unless user expressedly asks
- for it. */
-#ifndef _LOOSE_KERNEL_NAMES
-# define __KERNEL_STRICT_NAMES
-#endif
-
-#ifndef __cplusplus
-#define __THROW
-#define __BEGIN_DECLS
-#define __END_DECLS
-#else
-#define __THROW throw ()
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS }
-#endif
-
-#ifndef __GNUC__
-#define __attribute__(xyz)
-#define __extension__
-#endif
-
-#if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96))
-#define __pure__ __attribute__ ((__pure__))
-#else
-#define __pure__
-#endif
-
-#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
-#define __restrict__
-#endif
-
-#ifndef __STRICT_ANSI__
-#if __GNUC__ < 3
-#define __builtin_expect(foo,bar) (foo)
-#define expect(foo,bar) (foo)
-#else
-#define expect(foo,bar) __builtin_expect(foo,bar)
-#define __attribute_malloc__ __attribute__((malloc))
-#endif
-#endif
-
-#ifndef __attribute_malloc__
-#define __attribute_malloc__
-#endif
-
-#define __P(x) x
-
-#define __ptr_t void*
-
-#ifdef __STRICT_ANSI__
-#define inline
-#endif
-
-#ifndef __i386__
-#define regparm(x)
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/epoll.h b/mdk-stage1/dietlibc/include/sys/epoll.h
deleted file mode 100644
index d65d5465f..000000000
--- a/mdk-stage1/dietlibc/include/sys/epoll.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef _SYS_EPOLL_H
-#define _SYS_EPOLL_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/poll.h>
-
-/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl() */
-#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface */
-#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface */
-#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure */
-
-enum EPOLL_EVENTS {
- EPOLLIN = 0x001,
-#define EPOLLIN EPOLLIN
- EPOLLPRI = 0x002,
-#define EPOLLPRI EPOLLPRI
- EPOLLOUT = 0x004,
-#define EPOLLOUT EPOLLOUT
-
-#ifdef __USE_XOPEN
- EPOLLRDNORM = 0x040,
-#define EPOLLRDNORM EPOLLRDNORM
- EPOLLRDBAND = 0x080,
-#define EPOLLRDBAND EPOLLRDBAND
- EPOLLWRNORM = 0x100,
-#define EPOLLWRNORM EPOLLWRNORM
- EPOLLWRBAND = 0x200,
-#define EPOLLWRBAND EPOLLWRBAND
-#endif /* #ifdef __USE_XOPEN */
-
-#ifdef __USE_GNU
- EPOLLMSG = 0x400,
-#define EPOLLMSG EPOLLMSG
-#endif /* #ifdef __USE_GNU */
-
- EPOLLERR = 0x008,
-#define EPOLLERR EPOLLERR
- EPOLLHUP = 0x010
-#define EPOLLHUP EPOLLHUP
-};
-
-typedef union epoll_data {
- void *ptr;
- int fd;
- uint32_t u32;
- uint64_t u64;
-} epoll_data_t;
-
-struct epoll_event {
- uint32_t events;
- epoll_data_t data;
-};
-
-int epoll_create(int size) __THROW;
-int epoll_ctl(int epfd, int op, int fd, struct epoll_event* event) __THROW;
-int epoll_wait(int epfd, struct epoll_event *events, int maxevents,
- int timeout) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/file.h b/mdk-stage1/dietlibc/include/sys/file.h
deleted file mode 100644
index cf2c74305..000000000
--- a/mdk-stage1/dietlibc/include/sys/file.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _SYS_FILE_H
-#define _SYS_FILE_H
-
-#include <sys/cdefs.h>
-#include <fcntl.h>
-
-extern int fcntl(int fd, int cmd, ...) __THROW;
-extern int flock(int fd, int operation) __THROW;
-
-#endif /* _SYS_FILE_H */
diff --git a/mdk-stage1/dietlibc/include/sys/fsuid.h b/mdk-stage1/dietlibc/include/sys/fsuid.h
deleted file mode 100644
index 538070451..000000000
--- a/mdk-stage1/dietlibc/include/sys/fsuid.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef __FSUID_H
-#define __FSUID_H 1
-
-#include <sys/types.h>
-
-/* Linux only: */
-int setfsuid(uid_t uid);
-int setfsgid(gid_t gid);
-int setfsuid32(uid32_t fsuid) __THROW;
-int setfsgid32(gid32_t fsgid) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/gmon.h b/mdk-stage1/dietlibc/include/sys/gmon.h
deleted file mode 100644
index 50aae3028..000000000
--- a/mdk-stage1/dietlibc/include/sys/gmon.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef __DLC_GMON_H_
-#define __DLC_GMON_H_
-
-# define HISTCOUNTER unsigned short
-# define HISTFRACTION 2
-# define HASHFRACTION 2
-# define ARCDENSITY 2
-# define MINARCS 50
-# define MAXARCS (( 1 << (8 * sizeof(HISTCOUNTER))) - 2)
-
-# define ROUNDDOWN(x,y) (((x)/(y))*y)
-# define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*y)
-
-# define PROF_SECTION __attribute__ ((section (".profile")))
-
-struct tostruct {
- unsigned long selfpc;
- signed long count;
- unsigned short link;
- unsigned short pad;
-};
-
-struct rawarc {
- unsigned long raw_frompc;
- unsigned long raw_selfpc;
- signed long raw_count;
-};
-
-struct monparam {
- unsigned short *kcount;
- unsigned long kcountsize;
- struct rawarc *arcs;
- unsigned long arcnum;
- unsigned long lowpc;
- unsigned long highpc;
- unsigned long textsize;
-};
-
-struct gmonparam {
- long state;
- unsigned short *kcount;
- unsigned long kcountsize;
- unsigned short *froms;
- unsigned long fromsize;
- struct tostruct *tos;
- unsigned long tossize;
- long tolimit;
- unsigned long lowpc;
- unsigned long highpc;
- unsigned long textsize;
- unsigned long hashfraction;
- unsigned long log_hashfraction;
-};
-
-struct gmon_hdr {
- char cookie[4];
- long version;
- char spare[12];
-};
-
-struct gmon_hist_hdr {
- long low_pc;
- long high_pc;
- long hist_size;
- long prof_rate;
- char dimen[15];
- char dimen_abbrev;
-};
-
-struct gmon_cg_arc_record {
- long from_pc;
- long self_pc;
- long count;
-};
-
-struct __bb {
- long zero_word;
- char *filename;
- long *counts;
- long ncounts;
- struct __bb *next;
- unsigned long *addresses;
-};
-
-typedef enum {
- GMON_TAG_TIME_HIST, GMON_TAG_CG_ARC, GMON_TAG_BB_COUNT
-} GMON_Record_Tag;
-
-enum { GMON_PROF_ON, GMON_PROF_BUSY, GMON_PROF_ERROR, GMON_PROF_OFF };
-enum { GPROF_STATE, GPROF_COUNT, GPROF_FROMS, GPROF_TOS, GPROF_GMONPARAM };
-
-extern struct gmonparam gmparam;
-extern struct __bb * __bb_head;
-
-extern void __monstartup(unsigned long, unsigned long);
-extern void monstartup(unsigned long, unsigned long);
-extern void _mcleanup(void);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/gmon_out.h b/mdk-stage1/dietlibc/include/sys/gmon_out.h
deleted file mode 100644
index 31566b999..000000000
--- a/mdk-stage1/dietlibc/include/sys/gmon_out.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sys/gmon.h>
diff --git a/mdk-stage1/dietlibc/include/sys/hppa-ioctl.h b/mdk-stage1/dietlibc/include/sys/hppa-ioctl.h
deleted file mode 100644
index 62b6f1cf9..000000000
--- a/mdk-stage1/dietlibc/include/sys/hppa-ioctl.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef __ARCH_PARISC_IOCTLS_H__
-#define __ARCH_PARISC_IOCTLS_H__
-
-#ifndef _ASM_PARISC_IOCTL_H
-#define _ASM_PARISC_IOCTL_H
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 14
-#define _IOC_DIRBITS 2
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits.
- */
-#define _IOC_NONE 0U
-#define _IOC_WRITE 2U
-#define _IOC_READ 1U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode ioctl numbers.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-#endif /* _ASM_PARISC_IOCTL_H */
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS _IOR('T', 16, struct termios) /* TCGETATTR */
-#define TCSETS _IOW('T', 17, struct termios) /* TCSETATTR */
-#define TCSETSW _IOW('T', 18, struct termios) /* TCSETATTRD */
-#define TCSETSF _IOW('T', 19, struct termios) /* TCSETATTRF */
-#define TCGETA _IOR('T', 1, struct termio)
-#define TCSETA _IOW('T', 2, struct termio)
-#define TCSETAW _IOW('T', 3, struct termio)
-#define TCSETAF _IOW('T', 4, struct termio)
-#define TCSBRK _IO('T', 5)
-#define TCXONC _IO('T', 6)
-#define TCFLSH _IO('T', 7)
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-#define TIOCGPGRP _IOR('T', 30, int)
-#define TIOCSPGRP _IOW('T', 29, int)
-#define TIOCOUTQ 0x5411
-#define TIOCSTI 0x5412
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define FIONREAD 0x541B
-#define TIOCINQ FIONREAD
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-#define FIONBIO 0x5421
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID _IOR('T', 20, int) /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
-#define FIOCLEX 0x5451
-#define FIOASYNC 0x5452
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
-#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
-#define FIOQSIZE 0x5460 /* Get exact space used by quota */
-
-/* Used for packet mode */
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-
-#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
-
-#endif /* _ASM_PARISC_IOCTLS_H */
diff --git a/mdk-stage1/dietlibc/include/sys/i386-ioctl.h b/mdk-stage1/dietlibc/include/sys/i386-ioctl.h
deleted file mode 100644
index c9aa270d6..000000000
--- a/mdk-stage1/dietlibc/include/sys/i386-ioctl.h
+++ /dev/null
@@ -1,141 +0,0 @@
-
-/*
- * The following is for compatibility across the various Linux
- * platforms. The i386 ioctl numbering scheme doesn't really enforce
- * a type field. De facto, however, the top 8 bits of the lower 16
- * bits are indeed used as a type field, so we might just as well make
- * this explicit here. Please be sure to use the decoding macros
- * below from now on.
- */
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 14
-#define _IOC_DIRBITS 2
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits.
- */
-#define _IOC_NONE 0U
-#define _IOC_WRITE 1U
-#define _IOC_READ 2U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode ioctl numbers.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS 0x5401
-#define TCSETS 0x5402
-#define TCSETSW 0x5403
-#define TCSETSF 0x5404
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-#define TCSETAW 0x5407
-#define TCSETAF 0x5408
-#define TCSBRK 0x5409
-#define TCXONC 0x540A
-#define TCFLSH 0x540B
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-#define TIOCGPGRP 0x540F
-#define TIOCSPGRP 0x5410
-#define TIOCOUTQ 0x5411
-#define TIOCSTI 0x5412
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define FIONREAD 0x541B
-#define TIOCINQ FIONREAD
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-#define FIONBIO 0x5421
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
-#define FIOCLEX 0x5451
-#define FIOASYNC 0x5452
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
-#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
-#define FIOQSIZE 0x5460
-
-/* Used for packet mode */
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-
-#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
-
-/* Socket-level I/O control calls. */
-#define FIOSETOWN 0x8901
-#define SIOCSPGRP 0x8902
-#define FIOGETOWN 0x8903
-#define SIOCGPGRP 0x8904
-#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906 /* Get stamp */
diff --git a/mdk-stage1/dietlibc/include/sys/io.h b/mdk-stage1/dietlibc/include/sys/io.h
deleted file mode 100644
index 5edf33a57..000000000
--- a/mdk-stage1/dietlibc/include/sys/io.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _SYS_IO_H
-#define _SYS_IO_H
-
-#include <sys/cdefs.h>
-
-extern int ioperm(unsigned long from, unsigned long num, int turn_on) __THROW;
-extern int iopl(int level) __THROW;
-
-#ifndef __STRICT_ANSI__
-/* anyone have a cleaner solution for this mess? */
-#ifdef __i386__
-static inline unsigned char inb (unsigned short int port) {
- unsigned char _v;
- __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
- return _v;
-}
-
-static inline unsigned short inw (unsigned short int port) {
- unsigned short _v;
- __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
- return _v;
-}
-
-static inline unsigned int inl (unsigned short int port) {
- unsigned int _v;
- __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
- return _v;
-}
-
-static inline void outb (unsigned char value, unsigned short int port) {
- __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
-}
-
-static inline void outw (unsigned short value, unsigned short int port) {
- __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
-}
-
-static inline void outl (unsigned int value, unsigned short int port) {
- __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
-}
-#endif
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/ioctl.h b/mdk-stage1/dietlibc/include/sys/ioctl.h
deleted file mode 100644
index a7890f038..000000000
--- a/mdk-stage1/dietlibc/include/sys/ioctl.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _IOCTL_H
-#define _IOCTL_H
-
-#include <sys/cdefs.h>
-
-#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__)
-#include <sys/i386-ioctl.h>
-#elif defined(__alpha__)
-#include <sys/alpha-ioctl.h>
-#elif defined(__arm__)
-#include <sys/arm-ioctl.h>
-#elif defined(__sparc__)
-#include <sys/sparc-ioctl.h>
-#elif defined(__mips__)
-#include <sys/mips-ioctl.h>
-#elif defined(__powerpc__)
-#include <sys/ppc-ioctl.h>
-#elif defined(__s390__)
-#include <sys/s390-ioctl.h>
-#elif defined(__hppa__)
-#include <sys/hppa-ioctl.h>
-#endif
-
-/* used for /dev/epoll */
-#define EP_ALLOC _IOR('P', 1, int)
-#define EP_POLL _IOWR('P', 2, struct evpoll)
-#define EP_FREE _IO('P', 3)
-#define EP_ISPOLLED _IOWR('P', 4, struct pollfd)
-
-int ioctl(int d, int request, ...) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/ipc.h b/mdk-stage1/dietlibc/include/sys/ipc.h
deleted file mode 100644
index 481d97b62..000000000
--- a/mdk-stage1/dietlibc/include/sys/ipc.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _SYS_IPC_H
-#define _SYS_IPC_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#define SEMOP 1
-#define SEMGET 2
-#define SEMCTL 3
-#define MSGSND 11
-#define MSGRCV 12
-#define MSGGET 13
-#define MSGCTL 14
-#define SHMAT 21
-#define SHMDT 22
-#define SHMGET 23
-#define SHMCTL 24
-
-#define IPC_PRIVATE ((key_t) 0)
-
-#define IPC_CREAT 00001000 /* create if key is nonexistent */
-#define IPC_EXCL 00002000 /* fail if key exists */
-#define IPC_NOWAIT 00004000 /* return error on wait */
-
-#define IPC_RMID 0 /* remove resource */
-#define IPC_SET 1 /* set ipc_perm options */
-#define IPC_STAT 2 /* get ipc_perm options */
-#define IPC_INFO 3 /* see ipcs */
-
-/*
- * Version flags for semctl, msgctl, and shmctl commands
- * These are passed as bitflags or-ed with the actual command
- */
-#define IPC_OLD 0 /* Old version (no 32-bit UID support on many
- architectures) */
-#define IPC_64 0x0100 /* New version (support 32-bit UIDs, bigger
- message sizes, etc. */
-
-struct ipc_perm {
- key_t key;
- uid_t uid;
- gid_t gid;
- uid_t cuid;
- gid_t cgid;
- mode_t mode;
- unsigned short seq;
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/kd.h b/mdk-stage1/dietlibc/include/sys/kd.h
deleted file mode 100644
index 98b337ede..000000000
--- a/mdk-stage1/dietlibc/include/sys/kd.h
+++ /dev/null
@@ -1,183 +0,0 @@
-#ifndef _SYS_KD_H
-#define _SYS_KD_H
-
-/* 0x4B is 'K', to avoid collision with termios and vt */
-
-#define GIO_FONT 0x4B60 /* gets font in expanded form */
-#define PIO_FONT 0x4B61 /* use font in expanded form */
-
-#define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
-#define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
-
-struct consolefontdesc {
- unsigned short charcount; /* characters in font (256 or 512) */
- unsigned short charheight; /* scan lines per character (1-32) */
- char *chardata; /* font data in expanded form */
-};
-
-#define PIO_FONTRESET 0x4B6D /* reset to default font */
-
-#define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
-#define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
-
-#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
-#define KDMKTONE 0x4B30 /* generate tone */
-
-#define KDGETLED 0x4B31 /* return current led state */
-#define KDSETLED 0x4B32 /* set led state [lights, not flags] */
-#define LED_SCR 0x01 /* scroll lock led */
-#define LED_CAP 0x04 /* caps lock led */
-#define LED_NUM 0x02 /* num lock led */
-
-#define KDGKBTYPE 0x4B33 /* get keyboard type */
-#define KB_84 0x01
-#define KB_101 0x02 /* this is what we always answer */
-#define KB_OTHER 0x03
-
-#define KDADDIO 0x4B34 /* add i/o port as valid */
-#define KDDELIO 0x4B35 /* del i/o port as valid */
-#define KDENABIO 0x4B36 /* enable i/o to video board */
-#define KDDISABIO 0x4B37 /* disable i/o to video board */
-
-#define KDSETMODE 0x4B3A /* set text/graphics mode */
-#define KD_TEXT 0x00
-#define KD_GRAPHICS 0x01
-#define KD_TEXT0 0x02 /* obsolete */
-#define KD_TEXT1 0x03 /* obsolete */
-#define KDGETMODE 0x4B3B /* get current mode */
-
-#define KDMAPDISP 0x4B3C /* map display into address space */
-#define KDUNMAPDISP 0x4B3D /* unmap display from address space */
-
-typedef char scrnmap_t;
-
-#define E_TABSZ 256
-#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
-#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
-#define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
-#define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
-
-#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
-
-struct unipair {
- unsigned short unicode;
- unsigned short fontpos;
-};
-
-struct unimapdesc {
- unsigned short entry_ct;
- struct unipair *entries;
-};
-
-#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
-#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
-
-struct unimapinit {
- unsigned short advised_hashsize; /* 0 if no opinion */
- unsigned short advised_hashstep; /* 0 if no opinion */
- unsigned short advised_hashlevel; /* 0 if no opinion */
-};
-
-#define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
-#define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
-
-#define K_RAW 0x00
-#define K_XLATE 0x01
-#define K_MEDIUMRAW 0x02
-#define K_UNICODE 0x03
-#define KDGKBMODE 0x4B44 /* gets current keyboard mode */
-#define KDSKBMODE 0x4B45 /* sets current keyboard mode */
-
-#define K_METABIT 0x03
-#define K_ESCPREFIX 0x04
-#define KDGKBMETA 0x4B62 /* gets meta key handling mode */
-#define KDSKBMETA 0x4B63 /* sets meta key handling mode */
-
-#define K_SCROLLLOCK 0x01
-#define K_CAPSLOCK 0x02
-#define K_NUMLOCK 0x04
-#define KDGKBLED 0x4B64 /* get led flags (not lights) */
-#define KDSKBLED 0x4B65 /* set led flags (not lights) */
-
-struct kbentry {
- unsigned char kb_table;
- unsigned char kb_index;
- unsigned short kb_value;
-};
-
-#define K_NORMTAB 0x00
-#define K_SHIFTTAB 0x01
-#define K_ALTTAB 0x02
-#define K_ALTSHIFTTAB 0x03
-
-#define KDGKBENT 0x4B46 /* gets one entry in translation table */
-#define KDSKBENT 0x4B47 /* sets one entry in translation table */
-
-struct kbsentry {
- unsigned char kb_func;
- unsigned char kb_string[512];
-};
-
-#define KDGKBSENT 0x4B48 /* gets one function key string entry */
-#define KDSKBSENT 0x4B49 /* sets one function key string entry */
-
-struct kbdiacr {
- unsigned char diacr, base, result;
-};
-
-struct kbdiacrs {
- unsigned int kb_cnt; /* number of entries in following array */
- struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
-};
-
-#define KDGKBDIACR 0x4B4A /* read kernel accent table */
-#define KDSKBDIACR 0x4B4B /* write kernel accent table */
-
-struct kbkeycode {
- unsigned int scancode, keycode;
-};
-
-#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
-#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
-
-#define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
-
-struct hwclk_time {
- unsigned int sec; /* 0..59 */
- unsigned int min; /* 0..59 */
- unsigned int hour; /* 0..23 */
- unsigned int day; /* 1..31 */
- unsigned int mon; /* 0..11 */
- unsigned int year; /* 70... */
- int wday; /* 0..6, 0 is Sunday, -1 means unknown/don't set */
-};
-
-#define KDGHWCLK 0x4B50 /* get hardware clock */
-#define KDSHWCLK 0x4B51 /* set hardware clock */
-
-struct kbd_repeat {
- int delay; /* in msec; <= 0: don't change */
- int rate; /* in msec; <= 0: don't change */
-};
-
-#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
- * actually used values are returned */
-
-#define KDFONTOP 0x4B72 /* font operations */
-
-struct console_font_op {
- unsigned int op; /* operation code KD_FONT_OP_* */
- unsigned int flags; /* KD_FONT_FLAG_* */
- unsigned int width, height; /* font size */
- unsigned int charcount;
- unsigned char *data; /* font data with height fixed to 32 */
-};
-
-#define KD_FONT_OP_SET 0 /* Set font */
-#define KD_FONT_OP_GET 1 /* Get font */
-#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
-#define KD_FONT_OP_COPY 3 /* Copy from another console */
-
-#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/klog.h b/mdk-stage1/dietlibc/include/sys/klog.h
deleted file mode 100644
index abacfef9c..000000000
--- a/mdk-stage1/dietlibc/include/sys/klog.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _SYS_KLOG_H
-#define _SYS_KLOG_H
-
-#include <sys/cdefs.h>
-
-extern int klogctl (int __type, char *__bufp, int __len) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/mips-ioctl.h b/mdk-stage1/dietlibc/include/sys/mips-ioctl.h
deleted file mode 100644
index 889ac83ae..000000000
--- a/mdk-stage1/dietlibc/include/sys/mips-ioctl.h
+++ /dev/null
@@ -1,177 +0,0 @@
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 13
-#define _IOC_DIRBITS 3
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * We to additionally limit parameters to a maximum 255 bytes.
- */
-#define _IOC_SLMASK 0xff
-
-/*
- * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
- * And this turns out useful to catch old ioctl numbers in header
- * files for us.
- */
-#define _IOC_NONE 1U
-#define _IOC_READ 2U
-#define _IOC_WRITE 4U
-
-/*
- * The following are included for compatibility
- */
-#define _IOC_VOID 0x20000000
-#define _IOC_OUT 0x40000000
-#define _IOC_IN 0x80000000
-#define _IOC_INOUT (IOC_IN|IOC_OUT)
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- (((size) & _IOC_SLMASK) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode them.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-#if defined(__USE_MISC) || defined (__KERNEL__)
-#define tIOC ('t' << 8)
-#endif
-
-#define TCGETA 0x5401
-#define TCSETA 0x5402
-#define TCSETAW 0x5403
-#define TCSETAF 0x5404
-
-#define TCSBRK 0x5405
-#define TCXONC 0x5406
-#define TCFLSH 0x5407
-
-#define TCGETS 0x540d
-#define TCSETS 0x540e
-#define TCSETSW 0x540f
-#define TCSETSF 0x5410
-
-#define TIOCEXCL 0x740d /* set exclusive use of tty */
-#define TIOCNXCL 0x740e /* reset exclusive use of tty */
-#define TIOCOUTQ 0x7472 /* output queue size */
-#define TIOCSTI 0x5472 /* simulate terminal input */
-#define TIOCMGET 0x741d /* get all modem bits */
-#define TIOCMBIS 0x741b /* bis modem bits */
-#define TIOCMBIC 0x741c /* bic modem bits */
-#define TIOCMSET 0x741a /* set all modem bits */
-#define TIOCPKT 0x5470 /* pty: set/clear packet mode */
-#define TIOCPKT_DATA 0x00 /* data packet */
-#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
-#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
-#define TIOCPKT_STOP 0x04 /* stop output */
-#define TIOCPKT_START 0x08 /* start output */
-#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
-#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
-#if 0
-#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */
-#endif
-#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
-#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
-#define TIOCNOTTY 0x5471 /* void tty association */
-#define TIOCSETD (tIOC | 1)
-#define TIOCGETD (tIOC | 0)
-
-#define FIOCLEX 0x6601
-#define FIONCLEX 0x6602 /* these numbers need to be adjusted. */
-#define FIOASYNC 0x667d
-#define FIONBIO 0x667e
-#define FIOQSIZE 0x667f
-
-#if defined(__USE_MISC) || defined (__KERNEL__)
-#define TIOCGLTC (tIOC | 116) /* get special local chars */
-#define TIOCSLTC (tIOC | 117) /* set special local chars */
-#endif
-#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
-#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
-#define TIOCCONS _IOW('t', 120, int) /* become virtual console */
-
-#define FIONREAD 0x467f
-#define TIOCINQ FIONREAD
-
-#if defined(__USE_MISC) || defined (__KERNEL__)
-#define TIOCGETP (tIOC | 8)
-#define TIOCSETP (tIOC | 9)
-#define TIOCSETN (tIOC | 10) /* TIOCSETP wo flush */
-#endif
-
-#if 0
-#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */
-#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */
-#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */
-#define TIOCGETD _IOR('t', 26, int) /* get line discipline */
-#define TIOCSETD _IOW('t', 27, int) /* set line discipline */
- /* 127-124 compat */
-#endif
-
-/* I hope the range from 0x5480 on is free ... */
-#define TIOCSCTTY 0x5480 /* become controlling tty */
-#define TIOCGSOFTCAR 0x5481
-#define TIOCSSOFTCAR 0x5482
-#define TIOCLINUX 0x5483
-#define TIOCGSERIAL 0x5484
-#define TIOCSSERIAL 0x5485
-
-#define TCSBRKP 0x5486 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5487 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x7416 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define TIOCSERCONFIG 0x5488
-#define TIOCSERGWILD 0x5489
-#define TIOCSERSWILD 0x548a
-#define TIOCGLCKTRMIOS 0x548b
-#define TIOCSLCKTRMIOS 0x548c
-#define TIOCSERGSTRUCT 0x548d /* For debugging only */
-#define TIOCSERGETLSR 0x548e /* Get line status register */
-#define TIOCSERGETMULTI 0x548f /* Get multiport config */
-#define TIOCSERSETMULTI 0x5490 /* Set multiport config */
-#define TIOCMIWAIT 0x5491 /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x5492 /* read serial port inline interrupt counts */
-#define TIOCGHAYESESP 0x5493 /* Get Hayes ESP configuration */
-#define TIOCSHAYESESP 0x5494 /* Set Hayes ESP configuration */
-
-/* Socket-level I/O control calls. */
-#define FIOGETOWN _IOR('f', 123, int)
-#define FIOSETOWN _IOW('f', 124, int)
-
-#define SIOCATMARK _IOR('s', 7, int)
-#define SIOCSPGRP _IOW('s', 8, pid_t)
-#define SIOCGPGRP _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */
diff --git a/mdk-stage1/dietlibc/include/sys/mman.h b/mdk-stage1/dietlibc/include/sys/mman.h
deleted file mode 100644
index 298773a92..000000000
--- a/mdk-stage1/dietlibc/include/sys/mman.h
+++ /dev/null
@@ -1,184 +0,0 @@
-#ifndef _SYS_MMAN_H
-#define _SYS_MMAN_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#define MREMAP_MAYMOVE 1UL
-#define MREMAP_FIXED 2UL
-
-#define PROT_READ 0x1 /* page can be read */
-#define PROT_WRITE 0x2 /* page can be written */
-#define PROT_EXEC 0x4 /* page can be executed */
-#define PROT_NONE 0x0 /* page can not be accessed */
-
-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-
-#ifdef __mips__
-#define MAP_FIXED 0x010 /* Interpret addr exactly */
-#define MAP_NORESERVE 0x0400 /* don't check for reservations */
-#define MAP_ANONYMOUS 0x0800 /* don't use a file */
-#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
-#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
-#define MAP_LOCKED 0x8000 /* pages are locked */
-#define MS_ASYNC 0x0001 /* sync memory asynchronously */
-#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
-#define MS_SYNC 0x0004 /* synchronous memory sync */
-#define MCL_CURRENT 1 /* lock all current mappings */
-#define MCL_FUTURE 2 /* lock all future mappings */
-#define MADV_NORMAL 0x0 /* default page-in behavior */
-#define MADV_RANDOM 0x1 /* page-in minimum required */
-#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
-#define MADV_WILLNEED 0x3 /* pre-fault pages */
-#define MADV_DONTNEED 0x4 /* discard these pages */
-#else
-
-#ifdef __alpha__
-#define MAP_FIXED 0x100 /* Interpret addr exactly */
-#define MAP_ANONYMOUS 0x10 /* don't use a file */
-#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
-#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
-#define MAP_LOCKED 0x8000 /* lock the mapping */
-#define MAP_NORESERVE 0x10000 /* don't check for reservations */
-#define MS_ASYNC 1 /* sync memory asynchronously */
-#define MS_SYNC 2 /* synchronous memory sync */
-#define MS_INVALIDATE 4 /* invalidate the caches */
-#define MCL_CURRENT 8192 /* lock all currently mapped pages */
-#define MCL_FUTURE 16384 /* lock all additions to address space */
-#define MADV_NORMAL 0 /* no further special treatment */
-#define MADV_RANDOM 1 /* expect random page references */
-#define MADV_SEQUENTIAL 2 /* expect sequential page references */
-#define MADV_WILLNEED 3 /* will need these pages */
-#define MADV_SPACEAVAIL 5 /* ensure resources are available */
-#define MADV_DONTNEED 6 /* dont need these pages */
-#else
-#define MAP_FIXED 0x10 /* Interpret addr exactly */
-#define MAP_ANONYMOUS 0x20 /* don't use a file */
-#endif
-
-#if defined(__i386__) || defined(__s390__) || defined(__x86_64__)
-#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
-#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
-#define MAP_LOCKED 0x2000 /* pages are locked */
-#define MAP_NORESERVE 0x4000 /* don't check for reservations */
-#define MS_ASYNC 1 /* sync memory asynchronously */
-#define MS_INVALIDATE 2 /* invalidate the caches */
-#define MS_SYNC 4 /* synchronous memory sync */
-#define MCL_CURRENT 1 /* lock all current mappings */
-#define MCL_FUTURE 2 /* lock all future mappings */
-#define MADV_NORMAL 0x0 /* default page-in behavior */
-#define MADV_RANDOM 0x1 /* page-in minimum required */
-#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
-#define MADV_WILLNEED 0x3 /* pre-fault pages */
-#define MADV_DONTNEED 0x4 /* discard these pages */
-#elif defined(__sparc__) || defined (__powerpc__)
-#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
-#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
-#define MAP_INHERIT 0x80 /* SunOS doesn't do this, but... */
-#define MAP_LOCKED 0x100 /* lock the mapping */
-#define _MAP_NEW 0x80000000 /* Binary compatibility is fun... */
-#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
-#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
-#define MS_ASYNC 1 /* sync memory asynchronously */
-#define MS_INVALIDATE 2 /* invalidate the caches */
-#define MS_SYNC 4 /* synchronous memory sync */
-#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
-#define MCL_FUTURE 0x4000 /* lock all additions to address space */
-#define MADV_NORMAL 0x0 /* default page-in behavior */
-#define MADV_RANDOM 0x1 /* page-in minimum required */
-#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
-#define MADV_WILLNEED 0x3 /* pre-fault pages */
-#define MADV_DONTNEED 0x4 /* discard these pages */
-#define MADV_FREE 0x5 /* (Solaris) contents can be freed */
-#elif defined (__arm__)
-#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
-#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
-#define MAP_LOCKED 0x2000 /* pages are locked */
-#define MAP_NORESERVE 0x4000 /* don't check for reservations */
-#define MS_ASYNC 1 /* sync memory asynchronously */
-#define MS_INVALIDATE 2 /* invalidate the caches */
-#define MS_SYNC 4 /* synchronous memory sync */
-#define MCL_CURRENT 1 /* lock all current mappings */
-#define MCL_FUTURE 2 /* lock all future mappings */
-#define MADV_NORMAL 0x0 /* default page-in behavior */
-#define MADV_RANDOM 0x1 /* page-in minimum required */
-#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
-#define MADV_WILLNEED 0x3 /* pre-fault pages */
-#define MADV_DONTNEED 0x4 /* discard these pages */
-
-#elif defined(__hppa__)
-#define MAP_TYPE 0x03 /* Mask for type of mapping */
-#define MAP_FIXED 0x04 /* Interpret addr exactly */
-#define MAP_ANONYMOUS 0x10 /* don't use a file */
-
-#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
-#define MAP_LOCKED 0x2000 /* pages are locked */
-#define MAP_NORESERVE 0x4000 /* don't check for reservations */
-#define MAP_GROWSDOWN 0x8000 /* stack-like segment */
-
-#define MS_SYNC 1 /* synchronous memory sync */
-#define MS_ASYNC 2 /* sync memory asynchronously */
-#define MS_INVALIDATE 4 /* invalidate the caches */
-
-#define MCL_CURRENT 1 /* lock all current mappings */
-#define MCL_FUTURE 2
-
-#elif defined(__ia64__)
-
-#define MAP_TYPE 0x0f /* Mask for type of mapping */
-#define MAP_FIXED 0x10 /* Interpret addr exactly */
-#define MAP_ANONYMOUS 0x20 /* don't use a file */
-
-#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
-#define MAP_GROWSUP 0x0200 /* register stack-like segment */
-#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
-#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
-#define MAP_LOCKED 0x2000 /* pages are locked */
-#define MAP_NORESERVE 0x4000 /* don't check for reservations */
-#define MAP_WRITECOMBINED 0x10000 /* write-combine the area */
-#define MAP_NONCACHED 0x20000 /* don't cache the memory */
-
-#define MS_ASYNC 1 /* sync memory asynchronously */
-#define MS_INVALIDATE 2 /* invalidate the caches */
-#define MS_SYNC 4 /* synchronous memory sync */
-
-#endif
-
-#endif
-
-/* compatibility flags */
-#define MAP_ANON MAP_ANONYMOUS
-#define MAP_FILE 0
-
-#define MAP_FAILED ((void *) -1)
-
-extern void *mmap (void *__addr, size_t __len, int __prot,
- int __flags, int __fd, off_t __offset);
-
-extern int munmap (void *__addr, size_t __len) __THROW;
-extern int mprotect (void *__addr, size_t __len, int __prot) __THROW;
-extern int msync (void *__addr, size_t __len, int __flags) __THROW;
-extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
- unsigned long __may_move) __THROW;
-extern int mincore (void *__start, size_t __len, unsigned char *__vec);
-
-extern void *mmap64 (void *__addr, size_t __len, int __prot,
- int __flags, int __fd, off64_t __offset) __THROW;
-
-int mlockall(int flags) __THROW;
-int mlock(const void *addr, size_t len) __THROW;
-int munlock(const void *addr, size_t len) __THROW;
-int munlockall(void) __THROW;
-
-int madvise(void *start, size_t length, int advice) __THROW;
-
-#define _POSIX_MAPPED_FILES
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/mount.h b/mdk-stage1/dietlibc/include/sys/mount.h
deleted file mode 100644
index a5170fda9..000000000
--- a/mdk-stage1/dietlibc/include/sys/mount.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef _SYS_MOUNT_H
-#define _SYS_MOUNT_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#define _LINUX_CONFIG_H
-
-#define BLOCK_SIZE 1024
-#define BLOCK_SIZE_BITS 10
-
-
-/* These are the fs-independent mount-flags: up to 16 flags are
- supported */
-enum
-{
- MS_RDONLY = 1, /* Mount read-only. */
-#define MS_RDONLY MS_RDONLY
- MS_NOSUID = 2, /* Ignore suid and sgid bits. */
-#define MS_NOSUID MS_NOSUID
- MS_NODEV = 4, /* Disallow access to device special files. */
-#define MS_NODEV MS_NODEV
- MS_NOEXEC = 8, /* Disallow program execution. */
-#define MS_NOEXEC MS_NOEXEC
- MS_SYNCHRONOUS = 16, /* Writes are synced at once. */
-#define MS_SYNCHRONOUS MS_SYNCHRONOUS
- MS_REMOUNT = 32, /* Alter flags of a mounted FS. */
-#define MS_REMOUNT MS_REMOUNT
- MS_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
-#define MS_MANDLOCK MS_MANDLOCK
- S_WRITE = 128, /* Write on file/directory/symlink. */
-#define S_WRITE S_WRITE
- S_APPEND = 256, /* Append-only file. */
-#define S_APPEND S_APPEND
- S_IMMUTABLE = 512, /* Immutable file. */
-#define S_IMMUTABLE S_IMMUTABLE
- MS_NOATIME = 1024, /* Do not update access times. */
-#define MS_NOATIME MS_NOATIME
- MS_NODIRATIME = 2048, /* Do not update directory access times. */
-#define MS_NODIRATIME MS_NODIRATIME
- MS_BIND = 4096, /* Bind directory at different place. */
-#define MS_BIND MS_BIND
-};
-
-/* Flags that can be altered by MS_REMOUNT */
-#define MS_RMT_MASK (MS_RDONLY | MS_MANDLOCK)
-
-
-/* Magic mount flag number. Has to be or-ed to the flag values. */
-
-#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
-#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
-
-
-/* The read-only stuff doesn't really belong here, but any other place
- is probably as bad and I don't want to create yet another include
- file. */
-
-#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
-#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
-#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
-#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
-#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
-#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
-#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
-
-
-/* Possible value for FLAGS parameter of `umount2'. */
-enum
-{
- MNT_FORCE = 1 /* Force unmounting. */
-#define MNT_FORCE MNT_FORCE
-};
-
-int mount(const char* specialfile, const char* dir, const char* filesystemtype,
- unsigned long rwflag, const void * data) __THROW;
-
-int umount(const char *specialfile) __THROW;
-int umount2(const char *specialfile, int mflag) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/msg.h b/mdk-stage1/dietlibc/include/sys/msg.h
deleted file mode 100644
index 564fd9472..000000000
--- a/mdk-stage1/dietlibc/include/sys/msg.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef _SYS_MSG_H
-#define _SYS_MSG_H
-
-#include <sys/ipc.h>
-
-/* ipcs ctl commands */
-#define MSG_STAT 11
-#define MSG_INFO 12
-
-/* msgrcv options */
-#define MSG_NOERROR 010000 /* no error if message is too big */
-#define MSG_EXCEPT 020000 /* recv any msg except of specified type.*/
-
-struct msqid_ds {
- struct ipc_perm msg_perm;
- struct msg *msg_first; /* first message on queue,unused */
- struct msg *msg_last; /* last message in queue,unused */
- time_t msg_stime; /* last msgsnd time */
- time_t msg_rtime; /* last msgrcv time */
- time_t msg_ctime; /* last change time */
- unsigned long msg_lcbytes; /* Reuse junk fields for 32 bit */
- unsigned long msg_lqbytes; /* ditto */
- unsigned short msg_cbytes; /* current number of bytes on queue */
- unsigned short msg_qnum; /* number of messages in queue */
- unsigned short msg_qbytes; /* max number of bytes on queue */
- pid_t msg_lspid; /* pid of last msgsnd */
- pid_t msg_lrpid; /* last receive pid */
-};
-
-/* message buffer for msgsnd and msgrcv calls */
-struct msgbuf {
- long mtype; /* type of message */
- char mtext[1]; /* message text */
-};
-
-/* buffer for msgctl calls IPC_INFO, MSG_INFO */
-struct msginfo {
- int msgpool;
- int msgmap;
- int msgmax;
- int msgmnb;
- int msgmni;
- int msgssz;
- int msgtql;
- unsigned short msgseg;
-};
-
-#define MSGMNI 16 /* <= IPCMNI */ /* max # of msg queue identifiers */
-#define MSGMAX 8192 /* <= INT_MAX */ /* max size of message (bytes) */
-#define MSGMNB 16384 /* <= INT_MAX */ /* default max size of a message queue */
-
-extern int msgctl (int msqid, int cmd, struct msqid_ds *buf) __THROW;
-extern int msgget (key_t key, int msgflg) __THROW;
-extern int msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg) __THROW;
-extern int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/mtio.h b/mdk-stage1/dietlibc/include/sys/mtio.h
deleted file mode 100644
index 08c735dcc..000000000
--- a/mdk-stage1/dietlibc/include/sys/mtio.h
+++ /dev/null
@@ -1,340 +0,0 @@
-#ifndef _SYS_MTIO_H
-#define _SYS_MTIO_H
-
-#include <sys/ioctl.h>
-
-/* structure for MTIOCTOP - mag tape op command */
-struct mtop {
- short int mt_op; /* operations defined below */
- int mt_count; /* how many of them */
-};
-
-/* Magnetic Tape operations [Not all operations supported by all drivers]: */
-#define MTRESET 0 /* +reset drive in case of problems */
-#define MTFSF 1 /* forward space over FileMark,
- * position at first record of next file
- */
-#define MTBSF 2 /* backward space FileMark (position before FM) */
-#define MTFSR 3 /* forward space record */
-#define MTBSR 4 /* backward space record */
-#define MTWEOF 5 /* write an end-of-file record (mark) */
-#define MTREW 6 /* rewind */
-#define MTOFFL 7 /* rewind and put the drive offline (eject?) */
-#define MTNOP 8 /* no op, set status only (read with MTIOCGET) */
-#define MTRETEN 9 /* retension tape */
-#define MTBSFM 10 /* +backward space FileMark, position at FM */
-#define MTFSFM 11 /* +forward space FileMark, position at FM */
-#define MTEOM 12 /* goto end of recorded media (for appending files).
- * MTEOM positions after the last FM, ready for
- * appending another file.
- */
-#define MTERASE 13 /* erase tape -- be careful! */
-
-#define MTRAS1 14 /* run self test 1 (nondestructive) */
-#define MTRAS2 15 /* run self test 2 (destructive) */
-#define MTRAS3 16 /* reserved for self test 3 */
-
-#define MTSETBLK 20 /* set block length (SCSI) */
-#define MTSETDENSITY 21 /* set tape density (SCSI) */
-#define MTSEEK 22 /* seek to block (Tandberg, etc.) */
-#define MTTELL 23 /* tell block (Tandberg, etc.) */
-#define MTSETDRVBUFFER 24 /* set the drive buffering according to SCSI-2 */
- /* ordinary buffered operation with code 1 */
-#define MTFSS 25 /* space forward over setmarks */
-#define MTBSS 26 /* space backward over setmarks */
-#define MTWSM 27 /* write setmarks */
-
-#define MTLOCK 28 /* lock the drive door */
-#define MTUNLOCK 29 /* unlock the drive door */
-#define MTLOAD 30 /* execute the SCSI load command */
-#define MTUNLOAD 31 /* execute the SCSI unload command */
-#define MTCOMPRESSION 32/* control compression with SCSI mode page 15 */
-#define MTSETPART 33 /* Change the active tape partition */
-#define MTMKPART 34 /* Format the tape with one or two partitions */
-
-/* structure for MTIOCGET - mag tape get status command */
-
-typedef int daddr_t;
-
-struct mtget {
- long int mt_type; /* type of magtape device */
- long int mt_resid; /* residual count: (not sure)
- * number of bytes ignored, or
- * number of files not skipped, or
- * number of records not skipped.
- */
- /* the following registers are device dependent */
- long int mt_dsreg; /* status register */
- long int mt_gstat; /* generic (device independent) status */
- long int mt_erreg; /* error register */
- /* The next two fields are not always used */
- daddr_t mt_fileno; /* number of current file on tape */
- daddr_t mt_blkno; /* current block number */
-};
-
-/*
- * Constants for mt_type. Not all of these are supported,
- * and these are not all of the ones that are supported.
- */
-#define MT_ISUNKNOWN 0x01
-#define MT_ISQIC02 0x02 /* Generic QIC-02 tape streamer */
-#define MT_ISWT5150 0x03 /* Wangtek 5150EQ, QIC-150, QIC-02 */
-#define MT_ISARCHIVE_5945L2 0x04 /* Archive 5945L-2, QIC-24, QIC-02? */
-#define MT_ISCMSJ500 0x05 /* CMS Jumbo 500 (QIC-02?) */
-#define MT_ISTDC3610 0x06 /* Tandberg 6310, QIC-24 */
-#define MT_ISARCHIVE_VP60I 0x07 /* Archive VP60i, QIC-02 */
-#define MT_ISARCHIVE_2150L 0x08 /* Archive Viper 2150L */
-#define MT_ISARCHIVE_2060L 0x09 /* Archive Viper 2060L */
-#define MT_ISARCHIVESC499 0x0A /* Archive SC-499 QIC-36 controller */
-#define MT_ISQIC02_ALL_FEATURES 0x0F /* Generic QIC-02 with all features */
-#define MT_ISWT5099EEN24 0x11 /* Wangtek 5099-een24, 60MB, QIC-24 */
-#define MT_ISTEAC_MT2ST 0x12 /* Teac MT-2ST 155mb drive, Teac DC-1 card (Wangtek type) */
-#define MT_ISEVEREX_FT40A 0x32 /* Everex FT40A (QIC-40) */
-#define MT_ISDDS1 0x51 /* DDS device without partitions */
-#define MT_ISDDS2 0x52 /* DDS device with partitions */
-#define MT_ISONSTREAM_SC 0x61 /* OnStream SCSI tape drives (SC-x0)
- and SCSI emulated (DI, DP, USB) */
-#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
-#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
-
-/* QIC-40/80/3010/3020 ftape supported drives.
- * 20bit vendor ID + 0x800000 (see ftape-vendors.h)
- */
-#define MT_ISFTAPE_UNKNOWN 0x800000 /* obsolete */
-#define MT_ISFTAPE_FLAG 0x800000
-
-struct mt_tape_info {
- long int t_type; /* device type id (mt_type) */
- char* t_name; /* descriptive name */
-};
-
-#define MT_TAPE_INFO { \
- {MT_ISUNKNOWN, "Unknown type of tape device"}, \
- {MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
- {MT_ISWT5150, "Wangtek 5150, QIC-150"}, \
- {MT_ISARCHIVE_5945L2, "Archive 5945L-2"}, \
- {MT_ISCMSJ500, "CMS Jumbo 500"}, \
- {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"}, \
- {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"}, \
- {MT_ISARCHIVE_2150L, "Archive Viper 2150L"}, \
- {MT_ISARCHIVE_2060L, "Archive Viper 2060L"}, \
- {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"}, \
- {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"}, \
- {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
- {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"}, \
- {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
- {MT_ISONSTREAM_SC, "OnStream SC-, DI-, DP-, or USB tape drive"}, \
- {MT_ISSCSI1, "Generic SCSI-1 tape"}, \
- {MT_ISSCSI2, "Generic SCSI-2 tape"}, \
- {0, NULL} \
-}
-
-
-/* structure for MTIOCPOS - mag tape get position command */
-
-struct mtpos {
- long int mt_blkno; /* current block number */
-};
-
-
-/* structure for MTIOCGETCONFIG/MTIOCSETCONFIG primarily intended
- * as an interim solution for QIC-02 until DDI is fully implemented.
- */
-struct mtconfiginfo {
- long int mt_type; /* drive type */
- long int ifc_type; /* interface card type */
- unsigned short int irqnr; /* IRQ number to use */
- unsigned short int dmanr; /* DMA channel to use */
- unsigned short int port; /* IO port base address */
-
- unsigned long int debug; /* debugging flags */
-
- unsigned int have_dens:1;
- unsigned int have_bsf:1;
- unsigned int have_fsr:1;
- unsigned int have_bsr:1;
- unsigned int have_eod:1;
- unsigned int have_seek:1;
- unsigned int have_tell:1;
- unsigned int have_ras1:1;
- unsigned int have_ras2:1;
- unsigned int have_ras3:1;
- unsigned int have_qfa:1;
-
- unsigned int pad1:5;
- char reserved[10];
-};
-
-/* structure for MTIOCVOLINFO, query information about the volume
- * currently positioned at (zftape)
- */
-struct mtvolinfo {
- unsigned int mt_volno; /* vol-number */
- unsigned int mt_blksz; /* blocksize used when recording */
- unsigned int mt_rawsize; /* raw tape space consumed, in kb */
- unsigned int mt_size; /* volume size after decompression, in kb */
- unsigned int mt_cmpr:1; /* this volume has been compressed */
-};
-
-/* raw access to a floppy drive, read and write an arbitrary segment.
- * For ftape/zftape to support formatting etc.
- */
-#define MT_FT_RD_SINGLE 0
-#define MT_FT_RD_AHEAD 1
-#define MT_FT_WR_ASYNC 0 /* start tape only when all buffers are full */
-#define MT_FT_WR_MULTI 1 /* start tape, continue until buffers are empty */
-#define MT_FT_WR_SINGLE 2 /* write a single segment and stop afterwards */
-#define MT_FT_WR_DELETE 3 /* write deleted data marks, one segment at time */
-
-struct mtftseg {
- unsigned int mt_segno; /* the segment to read or write */
- unsigned int mt_mode; /* modes for read/write (sync/async etc.) */
- int mt_result; /* result of r/w request, not of the ioctl */
- void *mt_data; /* User space buffer: must be 29kb */
-};
-
-/* get tape capacity (ftape/zftape)
- */
-struct mttapesize {
- unsigned long mt_capacity; /* entire, uncompressed capacity of a cartridge */
- unsigned long mt_used; /* what has been used so far, raw uncompressed amount */
-};
-
-/* possible values of the ftfmt_op field
- */
-#define FTFMT_SET_PARMS 1 /* set software parms */
-#define FTFMT_GET_PARMS 2 /* get software parms */
-#define FTFMT_FORMAT_TRACK 3 /* start formatting a tape track */
-#define FTFMT_STATUS 4 /* monitor formatting a tape track */
-#define FTFMT_VERIFY 5 /* verify the given segment */
-
-struct ftfmtparms {
- unsigned char ft_qicstd; /* QIC-40/QIC-80/QIC-3010/QIC-3020 */
- unsigned char ft_fmtcode; /* Refer to the QIC specs */
- unsigned char ft_fhm; /* floppy head max */
- unsigned char ft_ftm; /* floppy track max */
- unsigned short ft_spt; /* segments per track */
- unsigned short ft_tpc; /* tracks per cartridge */
-};
-
-struct ftfmttrack {
- unsigned int ft_track; /* track to format */
- unsigned char ft_gap3; /* size of gap3, for FORMAT_TRK */
-};
-
-struct ftfmtstatus {
- unsigned int ft_segment; /* segment currently being formatted */
-};
-
-struct ftfmtverify {
- unsigned int ft_segment; /* segment to verify */
- unsigned long ft_bsm; /* bsm as result of VERIFY cmd */
-};
-
-struct mtftformat {
- unsigned int fmt_op; /* operation to perform */
- union fmt_arg {
- struct ftfmtparms fmt_parms; /* format parameters */
- struct ftfmttrack fmt_track; /* ctrl while formatting */
- struct ftfmtstatus fmt_status;
- struct ftfmtverify fmt_verify; /* for verifying */
- } fmt_arg;
-};
-
-/* mag tape io control commands */
-#define MTIOCTOP _IOW('m', 1, struct mtop) /* do a mag tape op */
-#define MTIOCGET _IOR('m', 2, struct mtget) /* get tape status */
-#define MTIOCPOS _IOR('m', 3, struct mtpos) /* get tape position */
-
-/* The next two are used by the QIC-02 driver for runtime reconfiguration.
- * See tpqic02.h for struct mtconfiginfo.
- */
-#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo) /* get tape config */
-#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo) /* set tape config */
-
-/* the next six are used by the floppy ftape drivers and its frontends
- * sorry, but MTIOCTOP commands are write only.
- */
-#define MTIOCRDFTSEG _IOWR('m', 6, struct mtftseg) /* read a segment */
-#define MTIOCWRFTSEG _IOWR('m', 7, struct mtftseg) /* write a segment */
-#define MTIOCVOLINFO _IOR('m', 8, struct mtvolinfo) /* info about volume */
-#define MTIOCGETSIZE _IOR('m', 9, struct mttapesize)/* get cartridge size*/
-#define MTIOCFTFORMAT _IOWR('m', 10, struct mtftformat) /* format ftape */
-#define MTIOCFTCMD _IOWR('m', 11, struct mtftcmd) /* send QIC-117 cmd */
-
-/* Generic Mag Tape (device independent) status macros for examining
- * mt_gstat -- HP-UX compatible.
- * There is room for more generic status bits here, but I don't
- * know which of them are reserved. At least three or so should
- * be added to make this really useful.
- */
-#define GMT_EOF(x) ((x) & 0x80000000)
-#define GMT_BOT(x) ((x) & 0x40000000)
-#define GMT_EOT(x) ((x) & 0x20000000)
-#define GMT_SM(x) ((x) & 0x10000000) /* DDS setmark */
-#define GMT_EOD(x) ((x) & 0x08000000) /* DDS EOD */
-#define GMT_WR_PROT(x) ((x) & 0x04000000)
-/* #define GMT_ ? ((x) & 0x02000000) */
-#define GMT_ONLINE(x) ((x) & 0x01000000)
-#define GMT_D_6250(x) ((x) & 0x00800000)
-#define GMT_D_1600(x) ((x) & 0x00400000)
-#define GMT_D_800(x) ((x) & 0x00200000)
-/* #define GMT_ ? ((x) & 0x00100000) */
-/* #define GMT_ ? ((x) & 0x00080000) */
-#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */
-/* #define GMT_ ? ((x) & 0x00020000) */
-#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */
-/* 16 generic status bits unused */
-
-
-/* SCSI-tape specific definitions */
-/* Bitfield shifts in the status */
-#define MT_ST_BLKSIZE_SHIFT 0
-#define MT_ST_BLKSIZE_MASK 0xffffff
-#define MT_ST_DENSITY_SHIFT 24
-#define MT_ST_DENSITY_MASK 0xff000000
-
-#define MT_ST_SOFTERR_SHIFT 0
-#define MT_ST_SOFTERR_MASK 0xffff
-
-/* Bitfields for the MTSETDRVBUFFER ioctl */
-#define MT_ST_OPTIONS 0xf0000000
-#define MT_ST_BOOLEANS 0x10000000
-#define MT_ST_SETBOOLEANS 0x30000000
-#define MT_ST_CLEARBOOLEANS 0x40000000
-#define MT_ST_WRITE_THRESHOLD 0x20000000
-#define MT_ST_DEF_BLKSIZE 0x50000000
-#define MT_ST_DEF_OPTIONS 0x60000000
-#define MT_ST_TIMEOUTS 0x70000000
-#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
-#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
-
-#define MT_ST_BUFFER_WRITES 0x1
-#define MT_ST_ASYNC_WRITES 0x2
-#define MT_ST_READ_AHEAD 0x4
-#define MT_ST_DEBUGGING 0x8
-#define MT_ST_TWO_FM 0x10
-#define MT_ST_FAST_MTEOM 0x20
-#define MT_ST_AUTO_LOCK 0x40
-#define MT_ST_DEF_WRITES 0x80
-#define MT_ST_CAN_BSR 0x100
-#define MT_ST_NO_BLKLIMS 0x200
-#define MT_ST_CAN_PARTITIONS 0x400
-#define MT_ST_SCSI2LOGICAL 0x800
-#define MT_ST_SYSV 0x1000
-
-/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
-#define MT_ST_CLEAR_DEFAULT 0xfffff
-#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
-#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
-#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
-
-/* The offset for the arguments for the special HP changer load command. */
-#define MT_ST_HPLOADER_OFFSET 10000
-
-/* Specify default tape device. */
-#ifndef DEFTAPE
-#define DEFTAPE "/dev/tape/0"
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/param.h b/mdk-stage1/dietlibc/include/sys/param.h
deleted file mode 100644
index 0744dccdb..000000000
--- a/mdk-stage1/dietlibc/include/sys/param.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _SYS_PARAM_H
-#define _SYS_PARAM_H
-
-#include <limits.h>
-
-#define MAXPATHLEN PATH_MAX
-#define MAXHOSTNAMELEN 64
-#define NGROUPS 32
-#define NOGROUP (-1)
-
-#undef MIN
-#undef MAX
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
-#ifdef __alpha__
-#define HZ 1024
-#else
-#define HZ 100
-#endif
-
-#ifndef howmany
-# define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/poll.h b/mdk-stage1/dietlibc/include/sys/poll.h
deleted file mode 100644
index fe36df79d..000000000
--- a/mdk-stage1/dietlibc/include/sys/poll.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _SYS_POLL_H
-#define _SYS_POLL_H
-
-#include <sys/cdefs.h>
-
-enum {
- POLLIN = 0x0001,
-#define POLLIN POLLIN
- POLLPRI = 0x0002,
-#define POLLPRI POLLPRI
- POLLOUT = 0x0004,
-#define POLLOUT POLLOUT
- POLLERR = 0x0008,
-#define POLLERR POLLERR
- POLLHUP = 0x0010,
-#define POLLHUP POLLHUP
- POLLNVAL = 0x0020,
-#define POLLNVAL POLLNVAL
- POLLRDNORM = 0x0040,
-#define POLLRDNORM POLLRDNORM
- POLLRDBAND = 0x0080,
-#define POLLRDBAND POLLRDBAND
- POLLWRBAND = 0x0200,
-#define POLLWRBAND POLLWRBAND
- POLLMSG = 0x0400,
-#define POLLMSG POLLMSG
-/* POLLREMOVE is for /dev/epoll (/dev/misc/eventpoll),
- * a new event notification mechanism for 2.6 */
- POLLREMOVE = 0x1000,
-#define POLLREMOVE POLLREMOVE
-};
-
-#if defined(__sparc__) || defined (__mips__)
-#define POLLWRNORM POLLOUT
-#else
-#define POLLWRNORM 0x0100
-#endif
-
-struct pollfd {
- int fd;
- short events;
- short revents;
-};
-
-extern int poll(struct pollfd *ufds, unsigned int nfds, int timeout) __THROW;
-
-#endif /* _SYS_POLL_H */
diff --git a/mdk-stage1/dietlibc/include/sys/ppc-ioctl.h b/mdk-stage1/dietlibc/include/sys/ppc-ioctl.h
deleted file mode 100644
index c3de6d254..000000000
--- a/mdk-stage1/dietlibc/include/sys/ppc-ioctl.h
+++ /dev/null
@@ -1,164 +0,0 @@
-
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 13
-#define _IOC_DIRBITS 3
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
- * And this turns out useful to catch old ioctl numbers in header
- * files for us.
- */
-#define _IOC_NONE 1U
-#define _IOC_READ 2U
-#define _IOC_WRITE 4U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode them.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* various drivers, such as the pcmcia stuff, need these... */
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-#define FIOCLEX _IO('f', 1)
-#define FIONCLEX _IO('f', 2)
-#define FIOASYNC _IOW('f', 125, int)
-#define FIONBIO _IOW('f', 126, int)
-#define FIONREAD _IOR('f', 127, int)
-#define TIOCINQ FIONREAD
-#define FIOQSIZE _IOR('f', 128, loff_t)
-
-#define TIOCGETP _IOR('t', 8, struct sgttyb)
-#define TIOCSETP _IOW('t', 9, struct sgttyb)
-#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
-
-#define TIOCSETC _IOW('t', 17, struct tchars)
-#define TIOCGETC _IOR('t', 18, struct tchars)
-#define TCGETS _IOR('t', 19, struct termios)
-#define TCSETS _IOW('t', 20, struct termios)
-#define TCSETSW _IOW('t', 21, struct termios)
-#define TCSETSF _IOW('t', 22, struct termios)
-
-#define TCGETA _IOR('t', 23, struct termio)
-#define TCSETA _IOW('t', 24, struct termio)
-#define TCSETAW _IOW('t', 25, struct termio)
-#define TCSETAF _IOW('t', 28, struct termio)
-
-#define TCSBRK _IO('t', 29)
-#define TCXONC _IO('t', 30)
-#define TCFLSH _IO('t', 31)
-
-#define TIOCSWINSZ _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ _IOR('t', 104, struct winsize)
-#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
-#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
-#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
-
-#define TIOCGLTC _IOR('t', 116, struct ltchars)
-#define TIOCSLTC _IOW('t', 117, struct ltchars)
-#define TIOCSPGRP _IOW('t', 118, int)
-#define TIOCGPGRP _IOR('t', 119, int)
-
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-
-#define TIOCSTI 0x5412
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-# define TIOCM_LE 0x001
-# define TIOCM_DTR 0x002
-# define TIOCM_RTS 0x004
-# define TIOCM_ST 0x008
-# define TIOCM_SR 0x010
-# define TIOCM_CTS 0x020
-# define TIOCM_CAR 0x040
-# define TIOCM_RNG 0x080
-# define TIOCM_DSR 0x100
-# define TIOCM_CD TIOCM_CAR
-# define TIOCM_RI TIOCM_RNG
-
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-# define TIOCPKT_DATA 0
-# define TIOCPKT_FLUSHREAD 1
-# define TIOCPKT_FLUSHWRITE 2
-# define TIOCPKT_STOP 4
-# define TIOCPKT_START 8
-# define TIOCPKT_NOSTOP 16
-# define TIOCPKT_DOSTOP 32
-
-
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
- /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-
-#if 0 /* These are defined this way on Alpha - maybe later. */
-/* Socket-level I/O control calls. */
-
-#define FIOGETOWN _IOR('f', 123, int)
-#define FIOSETOWN _IOW('f', 124, int)
-
-#define SIOCATMARK _IOR('s', 7, int)
-#define SIOCSPGRP _IOW('s', 8, pid_t)
-#define SIOCGPGRP _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/prctl.h b/mdk-stage1/dietlibc/include/sys/prctl.h
deleted file mode 100644
index 26749cbd4..000000000
--- a/mdk-stage1/dietlibc/include/sys/prctl.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _SYS_PRCTL_H
-#define _SYS_PRCTL_H
-
-#include <sys/cdefs.h>
-
-int prctl(int option, unsigned long arg2, unsigned long arg3 , unsigned long arg4, unsigned long arg5) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/ptrace.h b/mdk-stage1/dietlibc/include/sys/ptrace.h
deleted file mode 100644
index b09d3ac3a..000000000
--- a/mdk-stage1/dietlibc/include/sys/ptrace.h
+++ /dev/null
@@ -1,846 +0,0 @@
-#ifndef _SYS_PTRACE_H
-#define _SYS_PTRACE_H
-
-#include <sys/cdefs.h>
-
-#define PTRACE_TRACEME 0
-#define PTRACE_PEEKTEXT 1
-#define PTRACE_PEEKDATA 2
-#define PTRACE_PEEKUSR 3
-#define PTRACE_PEEKUSER PTRACE_PEEKUSR
-#define PTRACE_POKETEXT 4
-#define PTRACE_POKEDATA 5
-#define PTRACE_POKEUSR 6
-#define PTRACE_POKEUSER PTRACE_POKEUSR
-#define PTRACE_CONT 7
-#define PTRACE_KILL 8
-#define PTRACE_SINGLESTEP 9
-
-#define PTRACE_ATTACH 0x10
-#define PTRACE_DETACH 0x11
-
-#define PTRACE_SYSCALL 24
-
-#define PT_TRACE_ME PTRACE_TRACEME
-#define PT_READ_I PTRACE_PEEKTEXT
-#define PT_READ_D PTRACE_PEEKDATA
-#define PT_READ_U PTRACE_READ_U
-#define PT_WRITE_I PTRACE_POKETEXT
-#define PT_WRITE_D PTRACE_POKEDATA
-#define PT_WRITE_U PTRACE_POKEUSER
-#define PT_CONTINUE PTRACE_CONT
-#define PT_KILL PTRACE_KILL
-#define PT_STEP PTRACE_SINGLESTEP
-#define PT_GETREGS PTRACE_GETREGS
-#define PT_SETREGS PTRACE_SETREGS
-#define PT_GETFPREGS PTRACE_GETFPREGS
-#define PT_SETFPREGS PTRACE_SETFPREGS
-#define PT_ATTACH PTRACE_ATTACH
-#define PT_DETACH PTRACE_DETACH
-
-#if defined(__i386__)
-#define EBX 0
-#define ECX 1
-#define EDX 2
-#define ESI 3
-#define EDI 4
-#define EBP 5
-#define EAX 6
-#define DS 7
-#define ES 8
-#define FS 9
-#define GS 10
-#define ORIG_EAX 11
-#define EIP 12
-#define CS 13
-#define EFL 14
-#define UESP 15
-#define SS 16
-#define FRAME_SIZE 17
-
-/* this struct defines the way the registers are stored on the
- stack during a system call. */
-
-struct pt_regs {
- long ebx;
- long ecx;
- long edx;
- long esi;
- long edi;
- long ebp;
- long eax;
- int xds;
- int xes;
- long orig_eax;
- long eip;
- int xcs;
- long eflags;
- long esp;
- int xss;
-};
-
-/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-#define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
-#define PTRACE_GETFPREGS 14
-#define PTRACE_SETFPREGS 15
-#define PTRACE_GETFPXREGS 18
-#define PTRACE_SETFPXREGS 19
-
-#define PTRACE_SETOPTIONS 21
-
-/* options set using PTRACE_SETOPTIONS */
-#define PTRACE_O_TRACESYSGOOD 0x00000001
-
-#elif defined(__s390__)
-
-#define PT_PSWMASK 0x00
-#define PT_PSWADDR 0x04
-#define PT_GPR0 0x08
-#define PT_GPR1 0x0C
-#define PT_GPR2 0x10
-#define PT_GPR3 0x14
-#define PT_GPR4 0x18
-#define PT_GPR5 0x1C
-#define PT_GPR6 0x20
-#define PT_GPR7 0x24
-#define PT_GPR8 0x28
-#define PT_GPR9 0x2C
-#define PT_GPR10 0x30
-#define PT_GPR11 0x34
-#define PT_GPR12 0x38
-#define PT_GPR13 0x3C
-#define PT_GPR14 0x40
-#define PT_GPR15 0x44
-#define PT_ACR0 0x48
-#define PT_ACR1 0x4C
-#define PT_ACR2 0x50
-#define PT_ACR3 0x54
-#define PT_ACR4 0x58
-#define PT_ACR5 0x5C
-#define PT_ACR6 0x60
-#define PT_ACR7 0x64
-#define PT_ACR8 0x68
-#define PT_ACR9 0x6C
-#define PT_ACR10 0x70
-#define PT_ACR11 0x74
-#define PT_ACR12 0x78
-#define PT_ACR13 0x7C
-#define PT_ACR14 0x80
-#define PT_ACR15 0x84
-#define PT_ORIGGPR2 0x88
-#define PT_FPC 0x90
-#define PT_FPR0_HI 0x98
-#define PT_FPR0_LO 0x9C
-#define PT_FPR1_HI 0xA0
-#define PT_FPR1_LO 0xA4
-#define PT_FPR2_HI 0xA8
-#define PT_FPR2_LO 0xAC
-#define PT_FPR3_HI 0xB0
-#define PT_FPR3_LO 0xB4
-#define PT_FPR4_HI 0xB8
-#define PT_FPR4_LO 0xBC
-#define PT_FPR5_HI 0xC0
-#define PT_FPR5_LO 0xC4
-#define PT_FPR6_HI 0xC8
-#define PT_FPR6_LO 0xCC
-#define PT_FPR7_HI 0xD0
-#define PT_FPR7_LO 0xD4
-#define PT_FPR8_HI 0xD8
-#define PT_FPR8_LO 0XDC
-#define PT_FPR9_HI 0xE0
-#define PT_FPR9_LO 0xE4
-#define PT_FPR10_HI 0xE8
-#define PT_FPR10_LO 0xEC
-#define PT_FPR11_HI 0xF0
-#define PT_FPR11_LO 0xF4
-#define PT_FPR12_HI 0xF8
-#define PT_FPR12_LO 0xFC
-#define PT_FPR13_HI 0x100
-#define PT_FPR13_LO 0x104
-#define PT_FPR14_HI 0x108
-#define PT_FPR14_LO 0x10C
-#define PT_FPR15_HI 0x110
-#define PT_FPR15_LO 0x114
-#define PT_CR_9 0x118
-#define PT_CR_10 0x11C
-#define PT_CR_11 0x120
-#define PT_IEEE_IP 0x13C
-#define PT_LASTOFF PT_IEEE_IP
-#define PT_ENDREGS 0x140-1
-
-#define NUM_GPRS 16
-#define NUM_FPRS 16
-#define NUM_CRS 16
-#define NUM_ACRS 16
-#define GPR_SIZE 4
-#define FPR_SIZE 8
-#define FPC_SIZE 4
-#define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */
-#define CR_SIZE 4
-#define ACR_SIZE 4
-
-#define STACK_FRAME_OVERHEAD 96 /* size of minimum stack frame */
-
-#include <inttypes.h>
-
-/* this typedef defines how a Program Status Word looks like */
-typedef struct {
- uint32_t mask;
- uint32_t addr;
-} psw_t __attribute__ ((aligned(8)));
-
-typedef union
-{
- float f;
- double d;
- uint64_t ui;
- struct
- {
- uint32_t hi;
- uint32_t lo;
- } fp;
-} freg_t;
-
-typedef struct
-{
- uint32_t fpc;
- freg_t fprs[NUM_FPRS];
-} s390_fp_regs;
-
-#define FPC_EXCEPTION_MASK 0xF8000000
-#define FPC_FLAGS_MASK 0x00F80000
-#define FPC_DXC_MASK 0x0000FF00
-#define FPC_RM_MASK 0x00000003
-#define FPC_VALID_MASK 0xF8F8FF03
-
-typedef struct
-{
- psw_t psw;
- uint32_t gprs[NUM_GPRS];
- uint32_t acrs[NUM_ACRS];
- uint32_t orig_gpr2;
-} s390_regs;
-
-struct pt_regs
-{
- psw_t psw;
- uint32_t gprs[NUM_GPRS];
- uint32_t acrs[NUM_ACRS];
- uint32_t orig_gpr2;
- uint32_t trap;
- uint32_t old_ilc;
-};
-
-typedef struct
-{
- uint32_t cr[3];
-} per_cr_words __attribute__((packed));
-
-#define PER_EM_MASK 0xE8000000
-
-typedef uint32_t addr_t;
-
-typedef struct
-{
- unsigned em_branching : 1;
- unsigned em_instruction_fetch : 1;
- /*
- * Switching on storage alteration automatically fixes
- * the storage alteration event bit in the users std.
- */
- unsigned em_storage_alteration : 1;
- unsigned em_gpr_alt_unused : 1;
- unsigned em_store_real_address : 1;
- unsigned : 3;
- unsigned branch_addr_ctl : 1;
- unsigned : 1;
- unsigned storage_alt_space_ctl : 1;
- unsigned : 21;
- addr_t starting_addr;
- addr_t ending_addr;
-} per_cr_bits __attribute__((packed));
-
-typedef struct
-{
- uint16_t perc_atmid; /* 0x096 */
- uint32_t address; /* 0x098 */
- uint8_t access_id; /* 0x0a1 */
-} per_lowcore_words __attribute__((packed));
-
-typedef struct
-{
- unsigned perc_branching : 1; /* 0x096 */
- unsigned perc_instruction_fetch : 1;
- unsigned perc_storage_alteration : 1;
- unsigned perc_gpr_alt_unused : 1;
- unsigned perc_store_real_address : 1;
- unsigned : 4;
- unsigned atmid_validity_bit : 1;
- unsigned atmid_psw_bit_32 : 1;
- unsigned atmid_psw_bit_5 : 1;
- unsigned atmid_psw_bit_16 : 1;
- unsigned atmid_psw_bit_17 : 1;
- unsigned si : 2;
- addr_t address; /* 0x098 */
- unsigned : 4; /* 0x0a1 */
- unsigned access_id : 4;
-} per_lowcore_bits __attribute__((packed));
-
-typedef struct
-{
- union {
- per_cr_words words;
- per_cr_bits bits;
- } control_regs __attribute__((packed));
- /*
- * Use these flags instead of setting em_instruction_fetch
- * directly they are used so that single stepping can be
- * switched on & off while not affecting other tracing
- */
- unsigned single_step : 1;
- unsigned instruction_fetch : 1;
- unsigned : 30;
- /*
- * These addresses are copied into cr10 & cr11 if single
- * stepping is switched off
- */
- uint32_t starting_addr;
- uint32_t ending_addr;
- union {
- per_lowcore_words words;
- per_lowcore_bits bits;
- } lowcore;
-} per_struct __attribute__((packed));
-
-typedef struct
-{
- uint32_t len;
- addr_t kernel_addr;
- addr_t process_addr;
-} ptrace_area;
-
-/*
- * S/390 specific non posix ptrace requests. I chose unusual values so
- * they are unlikely to clash with future ptrace definitions.
- */
-#define PTRACE_PEEKUSR_AREA 0x5000
-#define PTRACE_POKEUSR_AREA 0x5001
-#define PTRACE_PEEKTEXT_AREA 0x5002
-#define PTRACE_PEEKDATA_AREA 0x5003
-#define PTRACE_POKETEXT_AREA 0x5004
-#define PTRACE_POKEDATA_AREA 0x5005
-/*
- * PT_PROT definition is loosely based on hppa bsd definition in
- * gdb/hppab-nat.c
- */
-#define PTRACE_PROT 21
-
-typedef enum
-{
- ptprot_set_access_watchpoint,
- ptprot_set_write_watchpoint,
- ptprot_disable_watchpoint
-} ptprot_flags;
-
-typedef struct
-{
- addr_t lowaddr;
- addr_t hiaddr;
- ptprot_flags prot;
-} ptprot_area;
-
-/* Sequence of bytes for breakpoint illegal instruction. */
-#define S390_BREAKPOINT {0x0,0x1}
-#define S390_BREAKPOINT_U16 ((uint16_t)0x0001)
-#define S390_SYSCALL_OPCODE ((uint16_t)0x0a00)
-#define S390_SYSCALL_SIZE 2
-
-/*
- * The user_regs_struct defines the way the user registers are
- * store on the stack for signal handling.
- */
-struct user_regs_struct
-{
- psw_t psw;
- uint32_t gprs[NUM_GPRS];
- uint32_t acrs[NUM_ACRS];
- uint32_t orig_gpr2;
- s390_fp_regs fp_regs;
- /*
- * These per registers are in here so that gdb can modify them
- * itself as there is no "official" ptrace interface for hardware
- * watchpoints. This is the way intel does it.
- */
- per_struct per_info;
- addr_t ieee_instruction_pointer;
- /* Used to give failing instruction back to user for ieee exceptions */
-};
-
-#elif defined(__arm__)
-
-/* this assumes armv */
-#define USR26_MODE 0x00
-#define FIQ26_MODE 0x01
-#define IRQ26_MODE 0x02
-#define SVC26_MODE 0x03
-#define USR_MODE 0x10
-#define FIQ_MODE 0x11
-#define IRQ_MODE 0x12
-#define SVC_MODE 0x13
-#define ABT_MODE 0x17
-#define UND_MODE 0x1b
-#define SYSTEM_MODE 0x1f
-#define MODE_MASK 0x1f
-#define T_BIT 0x20
-#define F_BIT 0x40
-#define I_BIT 0x80
-#define CC_V_BIT (1 << 28)
-#define CC_C_BIT (1 << 29)
-#define CC_Z_BIT (1 << 30)
-#define CC_N_BIT (1 << 31)
-#define PCMASK 0
-
-struct pt_regs {
- long uregs[18];
-};
-
-#define ARM_cpsr uregs[16]
-#define ARM_pc uregs[15]
-#define ARM_lr uregs[14]
-#define ARM_sp uregs[13]
-#define ARM_ip uregs[12]
-#define ARM_fp uregs[11]
-#define ARM_r10 uregs[10]
-#define ARM_r9 uregs[9]
-#define ARM_r8 uregs[8]
-#define ARM_r7 uregs[7]
-#define ARM_r6 uregs[6]
-#define ARM_r5 uregs[5]
-#define ARM_r4 uregs[4]
-#define ARM_r3 uregs[3]
-#define ARM_r2 uregs[2]
-#define ARM_r1 uregs[1]
-#define ARM_r0 uregs[0]
-#define ARM_ORIG_r0 uregs[17]
-
-#elif defined(__alpha__)
-
-struct pt_regs {
- unsigned long r0;
- unsigned long r1;
- unsigned long r2;
- unsigned long r3;
- unsigned long r4;
- unsigned long r5;
- unsigned long r6;
- unsigned long r7;
- unsigned long r8;
- unsigned long r19;
- unsigned long r20;
- unsigned long r21;
- unsigned long r22;
- unsigned long r23;
- unsigned long r24;
- unsigned long r25;
- unsigned long r26;
- unsigned long r27;
- unsigned long r28;
- unsigned long hae;
-/* JRP - These are the values provided to a0-a2 by PALcode */
- unsigned long trap_a0;
- unsigned long trap_a1;
- unsigned long trap_a2;
-/* These are saved by PAL-code: */
- unsigned long ps;
- unsigned long pc;
- unsigned long gp;
- unsigned long r16;
- unsigned long r17;
- unsigned long r18;
-};
-
-struct switch_stack {
- unsigned long r9;
- unsigned long r10;
- unsigned long r11;
- unsigned long r12;
- unsigned long r13;
- unsigned long r14;
- unsigned long r15;
- unsigned long r26;
- unsigned long fp[32]; /* fp[31] is fpcr */
-};
-
-#elif defined(__mips__)
-
-/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
-#define FPR_BASE 32
-#define PC 64
-#define CAUSE 65
-#define BADVADDR 66
-#define MMHI 67
-#define MMLO 68
-#define FPC_CSR 69
-#define FPC_EIR 70
-
-struct pt_regs {
- /* Pad bytes for argument save space on the stack. */
- unsigned long pad0[6];
- /* Saved main processor registers. */
- unsigned long regs[32];
- /* Other saved registers. */
- unsigned long lo;
- unsigned long hi;
- /* saved cp0 registers */
- unsigned long cp0_epc;
- unsigned long cp0_badvaddr;
- unsigned long cp0_status;
- unsigned long cp0_cause;
-};
-
-#elif defined(__sparc__)
-
-struct pt_regs {
- unsigned long psr;
- unsigned long pc;
- unsigned long npc;
- unsigned long y;
- unsigned long u_regs[16]; /* globals and ins */
-};
-
-#define UREG_G0 0
-#define UREG_G1 1
-#define UREG_G2 2
-#define UREG_G3 3
-#define UREG_G4 4
-#define UREG_G5 5
-#define UREG_G6 6
-#define UREG_G7 7
-#define UREG_I0 8
-#define UREG_I1 9
-#define UREG_I2 10
-#define UREG_I3 11
-#define UREG_I4 12
-#define UREG_I5 13
-#define UREG_I6 14
-#define UREG_I7 15
-#define UREG_WIM UREG_G0
-#define UREG_FADDR UREG_G0
-#define UREG_FP UREG_I6
-#define UREG_RETPC UREG_I7
-
-/* A register window */
-struct reg_window {
- unsigned long locals[8];
- unsigned long ins[8];
-};
-
-/* A Sparc stack frame */
-struct sparc_stackf {
- unsigned long locals[8];
- unsigned long ins[6];
- struct sparc_stackf *fp;
- unsigned long callers_pc;
- char *structptr;
- unsigned long xargs[6];
- unsigned long xxargs[1];
-};
-
-#define TRACEREG_SZ sizeof(struct pt_regs)
-#define STACKFRAME_SZ sizeof(struct sparc_stackf)
-#define REGWIN_SZ sizeof(struct reg_window)
-
-/* These are for pt_regs. */
-#define PT_PSR 0x0
-#define PT_PC 0x4
-#define PT_NPC 0x8
-#define PT_Y 0xc
-#define PT_G0 0x10
-#define PT_WIM PT_G0
-#define PT_G1 0x14
-#define PT_G2 0x18
-#define PT_G3 0x1c
-#define PT_G4 0x20
-#define PT_G5 0x24
-#define PT_G6 0x28
-#define PT_G7 0x2c
-#define PT_I0 0x30
-#define PT_I1 0x34
-#define PT_I2 0x38
-#define PT_I3 0x3c
-#define PT_I4 0x40
-#define PT_I5 0x44
-#define PT_I6 0x48
-#define PT_FP PT_I6
-#define PT_I7 0x4c
-
-/* Reg_window offsets */
-#define RW_L0 0x00
-#define RW_L1 0x04
-#define RW_L2 0x08
-#define RW_L3 0x0c
-#define RW_L4 0x10
-#define RW_L5 0x14
-#define RW_L6 0x18
-#define RW_L7 0x1c
-#define RW_I0 0x20
-#define RW_I1 0x24
-#define RW_I2 0x28
-#define RW_I3 0x2c
-#define RW_I4 0x30
-#define RW_I5 0x34
-#define RW_I6 0x38
-#define RW_I7 0x3c
-
-/* Stack_frame offsets */
-#define SF_L0 0x00
-#define SF_L1 0x04
-#define SF_L2 0x08
-#define SF_L3 0x0c
-#define SF_L4 0x10
-#define SF_L5 0x14
-#define SF_L6 0x18
-#define SF_L7 0x1c
-#define SF_I0 0x20
-#define SF_I1 0x24
-#define SF_I2 0x28
-#define SF_I3 0x2c
-#define SF_I4 0x30
-#define SF_I5 0x34
-#define SF_FP 0x38
-#define SF_PC 0x3c
-#define SF_RETP 0x40
-#define SF_XARG0 0x44
-#define SF_XARG1 0x48
-#define SF_XARG2 0x4c
-#define SF_XARG3 0x50
-#define SF_XARG4 0x54
-#define SF_XARG5 0x58
-#define SF_XXARG 0x5c
-
-/* Stuff for the ptrace system call */
-#define PTRACE_SUNATTACH 10
-#define PTRACE_SUNDETACH 11
-#define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
-#define PTRACE_GETFPREGS 14
-#define PTRACE_SETFPREGS 15
-#define PTRACE_READDATA 16
-#define PTRACE_WRITEDATA 17
-#define PTRACE_READTEXT 18
-#define PTRACE_WRITETEXT 19
-#define PTRACE_GETFPAREGS 20
-#define PTRACE_SETFPAREGS 21
-
-#define PTRACE_GETUCODE 29 /* stupid bsd-ism */
-
-#elif defined(__powerpc__)
-
-struct pt_regs {
- unsigned long gpr[32];
- unsigned long nip;
- unsigned long msr;
- unsigned long orig_gpr3; /* Used for restarting system calls */
- unsigned long ctr;
- unsigned long link;
- unsigned long xer;
- unsigned long ccr;
- unsigned long mq; /* 601 only (not used at present) */
- /* Used on APUS to hold IPL value. */
- unsigned long trap; /* Reason for being here */
- unsigned long dar; /* Fault registers */
- unsigned long dsisr;
- unsigned long result; /* Result of a system call */
-};
-
-/*
- * Offsets used by 'ptrace' system call interface.
- * These can't be changed without breaking binary compatibility
- * with MkLinux, etc.
- */
-#define PT_R0 0
-#define PT_R1 1
-#define PT_R2 2
-#define PT_R3 3
-#define PT_R4 4
-#define PT_R5 5
-#define PT_R6 6
-#define PT_R7 7
-#define PT_R8 8
-#define PT_R9 9
-#define PT_R10 10
-#define PT_R11 11
-#define PT_R12 12
-#define PT_R13 13
-#define PT_R14 14
-#define PT_R15 15
-#define PT_R16 16
-#define PT_R17 17
-#define PT_R18 18
-#define PT_R19 19
-#define PT_R20 20
-#define PT_R21 21
-#define PT_R22 22
-#define PT_R23 23
-#define PT_R24 24
-#define PT_R25 25
-#define PT_R26 26
-#define PT_R27 27
-#define PT_R28 28
-#define PT_R29 29
-#define PT_R30 30
-#define PT_R31 31
-
-#define PT_NIP 32
-#define PT_MSR 33
-#define PT_CTR 35
-#define PT_LNK 36
-#define PT_XER 37
-#define PT_CCR 38
-#define PT_MQ 39
-
-#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
-#define PT_FPR31 (PT_FPR0 + 2*31)
-#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
-
-#elif defined(__hppa__)
-
-#include <inttypes.h>
-
-struct pt_regs {
- unsigned long gr[32]; /* PSW is in gr[0] */
- uint64_t fr[32];
- unsigned long sr[ 8];
- unsigned long iasq[2];
- unsigned long iaoq[2];
- unsigned long cr27;
- unsigned long pad0; /* available for other uses */
- unsigned long orig_r28;
- unsigned long ksp;
- unsigned long kpc;
- unsigned long sar; /* CR11 */
- unsigned long iir; /* CR19 */
- unsigned long isr; /* CR20 */
- unsigned long ior; /* CR21 */
- unsigned long ipsw; /* CR22 */
-};
-
-#define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
-#define PTRACE_GETSIGINFO 13 /* get child's siginfo structure */
-#define PTRACE_SETSIGINFO 14 /* set child's siginfo structure */
-
-#elif defined(__ia64__)
-
-struct ia64_fpreg {
- union {
- unsigned long bits[2];
- } u;
-} __attribute__ ((aligned (16)));
-
-struct pt_regs {
- unsigned long cr_ipsr; /* interrupted task's psr */
- unsigned long cr_iip; /* interrupted task's instruction pointer */
- unsigned long cr_ifs; /* interrupted task's function state */
- unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
- unsigned long ar_pfs; /* prev function state */
- unsigned long ar_rsc; /* RSE configuration */
- unsigned long ar_rnat; /* RSE NaT */
- unsigned long ar_bspstore; /* RSE bspstore */
- unsigned long pr; /* 64 predicate registers (1 bit each) */
- unsigned long b6; /* scratch */
- unsigned long loadrs; /* size of dirty partition << 16 */
- unsigned long r1; /* the gp pointer */
- unsigned long r2; /* scratch */
- unsigned long r3; /* scratch */
- unsigned long r12; /* interrupted task's memory stack pointer */
- unsigned long r13; /* thread pointer */
- unsigned long r14; /* scratch */
- unsigned long r15; /* scratch */
- unsigned long r8; /* scratch (return value register 0) */
- unsigned long r9; /* scratch (return value register 1) */
- unsigned long r10; /* scratch (return value register 2) */
- unsigned long r11; /* scratch (return value register 3) */
- unsigned long r16; /* scratch */
- unsigned long r17; /* scratch */
- unsigned long r18; /* scratch */
- unsigned long r19; /* scratch */
- unsigned long r20; /* scratch */
- unsigned long r21; /* scratch */
- unsigned long r22; /* scratch */
- unsigned long r23; /* scratch */
- unsigned long r24; /* scratch */
- unsigned long r25; /* scratch */
- unsigned long r26; /* scratch */
- unsigned long r27; /* scratch */
- unsigned long r28; /* scratch */
- unsigned long r29; /* scratch */
- unsigned long r30; /* scratch */
- unsigned long r31; /* scratch */
- unsigned long ar_ccv; /* compare/exchange value (scratch) */
- unsigned long ar_fpsr; /* floating point status (preserved) */
- unsigned long b0; /* return pointer (bp) */
- unsigned long b7; /* scratch */
- struct ia64_fpreg f6; /* scratch */
- struct ia64_fpreg f7; /* scratch */
- struct ia64_fpreg f8; /* scratch */
- struct ia64_fpreg f9; /* scratch */
-};
-
-struct switch_stack {
- unsigned long caller_unat; /* user NaT collection register (preserved) */
- unsigned long ar_fpsr; /* floating-point status register */
-
- struct ia64_fpreg f2; /* preserved */
- struct ia64_fpreg f3; /* preserved */
- struct ia64_fpreg f4; /* preserved */
- struct ia64_fpreg f5; /* preserved */
-
- struct ia64_fpreg f10; /* scratch, but untouched by kernel */
- struct ia64_fpreg f11; /* scratch, but untouched by kernel */
- struct ia64_fpreg f12; /* scratch, but untouched by kernel */
- struct ia64_fpreg f13; /* scratch, but untouched by kernel */
- struct ia64_fpreg f14; /* scratch, but untouched by kernel */
- struct ia64_fpreg f15; /* scratch, but untouched by kernel */
- struct ia64_fpreg f16; /* preserved */
- struct ia64_fpreg f17; /* preserved */
- struct ia64_fpreg f18; /* preserved */
- struct ia64_fpreg f19; /* preserved */
- struct ia64_fpreg f20; /* preserved */
- struct ia64_fpreg f21; /* preserved */
- struct ia64_fpreg f22; /* preserved */
- struct ia64_fpreg f23; /* preserved */
- struct ia64_fpreg f24; /* preserved */
- struct ia64_fpreg f25; /* preserved */
- struct ia64_fpreg f26; /* preserved */
- struct ia64_fpreg f27; /* preserved */
- struct ia64_fpreg f28; /* preserved */
- struct ia64_fpreg f29; /* preserved */
- struct ia64_fpreg f30; /* preserved */
- struct ia64_fpreg f31; /* preserved */
-
- unsigned long r4; /* preserved */
- unsigned long r5; /* preserved */
- unsigned long r6; /* preserved */
- unsigned long r7; /* preserved */
-
- unsigned long b0; /* so we can force a direct return in copy_thread */
- unsigned long b1;
- unsigned long b2;
- unsigned long b3;
- unsigned long b4;
- unsigned long b5;
-
- unsigned long ar_pfs; /* previous function state */
- unsigned long ar_lc; /* loop counter (preserved) */
- unsigned long ar_unat; /* NaT bits for r4-r7 */
- unsigned long ar_rnat; /* RSE NaT collection register */
- unsigned long ar_bspstore; /* RSE dirty base (preserved) */
- unsigned long pr; /* 64 predicate registers (1 bit each) */
-};
-
-#endif
-
-extern long int ptrace(int request, ...) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/reboot.h b/mdk-stage1/dietlibc/include/sys/reboot.h
deleted file mode 100644
index b17a556e5..000000000
--- a/mdk-stage1/dietlibc/include/sys/reboot.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _SYS_REBOOT_H
-#define _SYS_REBOOT_H
-
-#define LINUX_REBOOT_MAGIC1 0xfee1dead
-#define LINUX_REBOOT_MAGIC2 672274793
-#define LINUX_REBOOT_MAGIC2A 85072278
-#define LINUX_REBOOT_MAGIC2B 369367448
-
-#define LINUX_REBOOT_CMD_RESTART 0x01234567
-#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
-#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
-#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
-#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
-#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
-
-/* Reboot or halt the system. */
-int reboot (int flag);
-
-/* the glibc people changed their macro names :-/ */
-#define RB_AUTOBOOT 0x01234567
-#define RB_HALT_SYSTEM 0xcdef0123
-#define RB_ENABLE_CAD 0x89abcdef
-#define RB_DISABLE_CAD 0
-#define RB_POWER_OFF 0x4321fedc
-
-#endif /* _SYS_REBOOT_H */
diff --git a/mdk-stage1/dietlibc/include/sys/resource.h b/mdk-stage1/dietlibc/include/sys/resource.h
deleted file mode 100644
index df31b82ab..000000000
--- a/mdk-stage1/dietlibc/include/sys/resource.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _SYS_RESOURCE_H
-#define _SYS_RESOURCE_H
-
-#include <time.h>
-#include <sys/cdefs.h>
-
-#define RUSAGE_SELF 0
-#define RUSAGE_CHILDREN (-1)
-#define RUSAGE_BOTH (-2) /* sys_wait4() uses this */
-
-struct rusage {
- struct timeval ru_utime; /* user time used */
- struct timeval ru_stime; /* system time used */
- long ru_maxrss; /* maximum resident set size */
- long ru_ixrss; /* integral shared memory size */
- long ru_idrss; /* integral unshared data size */
- long ru_isrss; /* integral unshared stack size */
- long ru_minflt; /* page reclaims */
- long ru_majflt; /* page faults */
- long ru_nswap; /* swaps */
- long ru_inblock; /* block input operations */
- long ru_oublock; /* block output operations */
- long ru_msgsnd; /* messages sent */
- long ru_msgrcv; /* messages received */
- long ru_nsignals; /* signals received */
- long ru_nvcsw; /* voluntary context switches */
- long ru_nivcsw; /* involuntary " */
-};
-
-struct rlimit {
- unsigned long rlim_cur;
- unsigned long rlim_max;
-};
-
-#define PRIO_MIN (-20)
-#define PRIO_MAX 20
-
-#define PRIO_PROCESS 0
-#define PRIO_PGRP 1
-#define PRIO_USER 2
-
-#define RLIMIT_CPU 0 /* CPU time in ms */
-#define RLIMIT_FSIZE 1 /* Maximum filesize */
-#define RLIMIT_DATA 2 /* max data size */
-#define RLIMIT_STACK 3 /* max stack size */
-#define RLIMIT_CORE 4 /* max core file size */
-#define RLIMIT_RSS 5 /* max resident set size */
-#define RLIMIT_NPROC 6 /* max number of processes */
-#define RLIMIT_NOFILE 7 /* max number of open files */
-#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
-#define RLIMIT_AS 9 /* address space limit */
-#define RLIMIT_LOCKS 10 /* maximum file locks held */
-
-#define RLIM_NLIMITS 11
-
-#define RLIM_INFINITY ((long)(~0UL>>1))
-
-int getpriority(int which, int who) __THROW;
-int setpriority(int which, int who, int prio) __THROW;
-
-int getrlimit (int resource, struct rlimit *rlim);
-int getrusage (int who, struct rusage *usage);
-int setrlimit (int resource, const struct rlimit *rlim);
-
-typedef unsigned long rlim_t;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/s390-ioctl.h b/mdk-stage1/dietlibc/include/sys/s390-ioctl.h
deleted file mode 100644
index 4682a0fda..000000000
--- a/mdk-stage1/dietlibc/include/sys/s390-ioctl.h
+++ /dev/null
@@ -1,141 +0,0 @@
-
-/* ioctl command encoding: 32 bits total, command in lower 16 bits,
- * size of the parameter structure in the lower 14 bits of the
- * upper 16 bits.
- * Encoding the size of the parameter structure in the ioctl request
- * is useful for catching programs compiled with old versions
- * and to avoid overwriting user space outside the user buffer area.
- * The highest 2 bits are reserved for indicating the ``access mode''.
- * NOTE: This limits the max parameter size to 16kB -1 !
- */
-
-/*
- * The following is for compatibility across the various Linux
- * platforms. The i386 ioctl numbering scheme doesn't really enforce
- * a type field. De facto, however, the top 8 bits of the lower 16
- * bits are indeed used as a type field, so we might just as well make
- * this explicit here. Please be sure to use the decoding macros
- * below from now on.
- */
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 14
-#define _IOC_DIRBITS 2
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits.
- */
-#define _IOC_NONE 0U
-#define _IOC_WRITE 1U
-#define _IOC_READ 2U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-/* used to create numbers */
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode ioctl numbers.. */
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-/* 0x54 is just a magic number to make these relatively unique ('T') */
-
-#define TCGETS 0x5401
-#define TCSETS 0x5402
-#define TCSETSW 0x5403
-#define TCSETSF 0x5404
-#define TCGETA 0x5405
-#define TCSETA 0x5406
-#define TCSETAW 0x5407
-#define TCSETAF 0x5408
-#define TCSBRK 0x5409
-#define TCXONC 0x540A
-#define TCFLSH 0x540B
-#define TIOCEXCL 0x540C
-#define TIOCNXCL 0x540D
-#define TIOCSCTTY 0x540E
-#define TIOCGPGRP 0x540F
-#define TIOCSPGRP 0x5410
-#define TIOCOUTQ 0x5411
-#define TIOCSTI 0x5412
-#define TIOCGWINSZ 0x5413
-#define TIOCSWINSZ 0x5414
-#define TIOCMGET 0x5415
-#define TIOCMBIS 0x5416
-#define TIOCMBIC 0x5417
-#define TIOCMSET 0x5418
-#define TIOCGSOFTCAR 0x5419
-#define TIOCSSOFTCAR 0x541A
-#define FIONREAD 0x541B
-#define TIOCINQ FIONREAD
-#define TIOCLINUX 0x541C
-#define TIOCCONS 0x541D
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TIOCPKT 0x5420
-#define FIONBIO 0x5421
-#define TIOCNOTTY 0x5422
-#define TIOCSETD 0x5423
-#define TIOCGETD 0x5424
-#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
-#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
-#define TIOCSBRK 0x5427 /* BSD compatibility */
-#define TIOCCBRK 0x5428 /* BSD compatibility */
-#define TIOCGSID 0x5429 /* Return the session ID of FD */
-#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
-
-#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
-#define FIOCLEX 0x5451
-#define FIOASYNC 0x5452
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
-#define FIOQSIZE 0x545E
-
-/* Used for packet mode */
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-
-#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
diff --git a/mdk-stage1/dietlibc/include/sys/select.h b/mdk-stage1/dietlibc/include/sys/select.h
deleted file mode 100644
index ce67b8bee..000000000
--- a/mdk-stage1/dietlibc/include/sys/select.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _SYS_SELECT_H
-#define _SYS_SELECT_H
-
-typedef long int fd_mask;
-
-#define NFDBITS (8 * sizeof(unsigned long))
-#define FD_SETSIZE 1024
-#define __FDSET_LONGS (FD_SETSIZE/NFDBITS)
-#define __FDELT(d) ((d) / NFDBITS)
-#define __FDMASK(d) (1UL << ((d) % NFDBITS))
-
-typedef struct {
- unsigned long fds_bits [__FDSET_LONGS];
-} fd_set;
-
-#define FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
-#define FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
-#define FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
-#define FD_ZERO(set) \
- ((void) memset ((void*) (set), 0, sizeof (fd_set)))
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/sem.h b/mdk-stage1/dietlibc/include/sys/sem.h
deleted file mode 100644
index ad16b5f53..000000000
--- a/mdk-stage1/dietlibc/include/sys/sem.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef _SYS_SEM_H
-#define _SYS_SEM_H
-
-#include <sys/ipc.h>
-
-/* semop flags */
-#define SEM_UNDO 0x1000 /* undo the operation on exit */
-
-/* semctl Command Definitions. */
-#define GETPID 11 /* get sempid */
-#define GETVAL 12 /* get semval */
-#define GETALL 13 /* get all semval's */
-#define GETNCNT 14 /* get semncnt */
-#define GETZCNT 15 /* get semzcnt */
-#define SETVAL 16 /* set semval */
-#define SETALL 17 /* set all semval's */
-
-/* ipcs ctl cmds */
-#define SEM_STAT 18
-#define SEM_INFO 19
-
-struct semid_ds {
- struct ipc_perm sem_perm; /* permissions .. see ipc.h */
- time_t sem_otime; /* last semop time */
- time_t sem_ctime; /* last change time */
- struct sem *sem_base; /* ptr to first semaphore in array */
- struct sem_queue *sem_pending; /* pending operations to be processed */
- struct sem_queue **sem_pending_last; /* last pending operation */
- struct sem_undo *undo; /* undo requests on this array */
- unsigned short sem_nsems; /* no. of semaphores in array */
-};
-
-/* semop system calls takes an array of these. */
-struct sembuf {
- unsigned short sem_num; /* semaphore index in array */
- short sem_op; /* semaphore operation */
- short sem_flg; /* operation flags */
-};
-
-/* please complain to the glibc goons for the following misbehaviour */
-#if 0
-/* arg for semctl system calls. */
-union semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
- void *__pad;
-};
-#endif
-#define _SEM_SEMUN_UNDEFINED
-
-struct seminfo {
- int semmap;
- int semmni;
- int semmns;
- int semmnu;
- int semmsl;
- int semopm;
- int semume;
- int semusz;
- int semvmx;
- int semaem;
-};
-
-#define SEMMNI 128 /* <= IPCMNI max # of semaphore identifiers */
-#define SEMMSL 250 /* <= 8 000 max num of semaphores per id */
-#define SEMMNS (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
-#define SEMOPM 32 /* <= 1 000 max num of ops per semop call */
-#define SEMVMX 32767 /* <= 32767 semaphore maximum value */
-
-extern int semget( key_t key, int nsems, int semflg) __THROW;
-
-/* The prototype really is:
- * extern int semctl(int semid, int semnum, int cmd, union semun arg) __THROW;
- * glibc bug compatibility forces us to write it like this: */
-extern int semctl(int semid, int semnum, int cmd, ...) __THROW;
-
-extern int semop(int semid, struct sembuf *sops, unsigned nsops) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/sendfile.h b/mdk-stage1/dietlibc/include/sys/sendfile.h
deleted file mode 100644
index ce6630676..000000000
--- a/mdk-stage1/dietlibc/include/sys/sendfile.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _SYS_SENDFILE_H
-#define _SYS_SENDFILE_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-extern ssize_t sendfile (int out_fd, int in_fd, off_t* offset,
- size_t count) __THROW;
-
-extern ssize_t sendfile64 (int out_fd, int in_fd, loff_t* offset,
- size_t count) __THROW;
-
-#endif /* sys/sendfile.h */
diff --git a/mdk-stage1/dietlibc/include/sys/shm.h b/mdk-stage1/dietlibc/include/sys/shm.h
deleted file mode 100644
index 879a8786e..000000000
--- a/mdk-stage1/dietlibc/include/sys/shm.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _SYS_SHM_H
-#define _SYS_SHM_H
-
-#include <sys/ipc.h>
-
-#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
-#define SHMMIN 1 /* min shared seg size (bytes) */
-#define SHMMNI 4096 /* max num of segs system wide */
-#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
-#define SHMSEG SHMMNI /* max shared segs per process */
-
-struct shmid_ds {
- struct ipc_perm shm_perm; /* operation perms */
- int shm_segsz; /* size of segment (bytes) */
- time_t shm_atime; /* last attach time */
- time_t shm_dtime; /* last detach time */
- time_t shm_ctime; /* last change time */
- pid_t shm_cpid; /* pid of creator */
- pid_t shm_lpid; /* pid of last operator */
- unsigned short shm_nattch; /* no. of current attaches */
- unsigned short shm_unused; /* compatibility */
- void *shm_unused2; /* ditto - used by DIPC */
- void *shm_unused3; /* unused */
-};
-
-/* permission flag for shmget */
-#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
-#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
-
-/* mode for attach */
-#define SHM_RDONLY 010000 /* read-only access */
-#define SHM_RND 020000 /* round attach address to SHMLBA boundary */
-#define SHM_REMAP 040000 /* take-over region on attach */
-
-/* super user shmctl commands */
-#define SHM_LOCK 11
-#define SHM_UNLOCK 12
-
-/* ipcs ctl commands */
-#define SHM_STAT 13
-#define SHM_INFO 14
-
-/* Obsolete, used only for backwards compatibility */
-struct shminfo {
- int shmmax;
- int shmmin;
- int shmmni;
- int shmseg;
- int shmall;
-};
-
-struct shm_info {
- int used_ids;
- unsigned long shm_tot; /* total allocated shm */
- unsigned long shm_rss; /* total resident shm */
- unsigned long shm_swp; /* total swapped shm */
- unsigned long swap_attempts;
- unsigned long swap_successes;
-};
-
-#if defined(__i386__) || defined(__mips__) || defined(__arm__) || defined(__powerpc__) || defined(__s390__) || defined(__hppa__) || defined(__x86_64__) || defined(__ia64__)
-#define PAGE_SIZE 4096UL
-#define PAGE_SHIFT 12
-#elif defined(__alpha__) || defined(__sparc__)
-/* sun4* has 4k except sun4 architecture, sparc64 has 8k */
-#define PAGE_SIZE 8192UL
-#define PAGE_SHIFT 13
-#endif
-
-extern int shmget(key_t key, int size, int shmflg) __THROW;
-extern void *shmat(int shmid, const void *shmaddr, int shmflg) __THROW;
-extern int shmdt (const void *shmaddr) __THROW;
-extern int shmctl(int shmid, int cmd, struct shmid_ds *buf) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/signal.h b/mdk-stage1/dietlibc/include/sys/signal.h
deleted file mode 100644
index 2e602dad8..000000000
--- a/mdk-stage1/dietlibc/include/sys/signal.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <signal.h>
diff --git a/mdk-stage1/dietlibc/include/sys/socket.h b/mdk-stage1/dietlibc/include/sys/socket.h
deleted file mode 100644
index a1130c4f6..000000000
--- a/mdk-stage1/dietlibc/include/sys/socket.h
+++ /dev/null
@@ -1,526 +0,0 @@
-#ifndef _SYS_SOCKET_H
-#define _SYS_SOCKET_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-/* For setsockoptions(2) */
-#if defined(__alpha__) || defined(__mips__)
-#define SOL_SOCKET 0xffff
-
-#define SO_DEBUG 0x0001
-#define SO_REUSEADDR 0x0004
-#define SO_TYPE 0x1008
-#define SO_ERROR 0x1007
-#define SO_DONTROUTE 0x0010
-#define SO_BROADCAST 0x0020
-#define SO_SNDBUF 0x1001
-#define SO_RCVBUF 0x1002
-#define SO_KEEPALIVE 0x0008
-#define SO_OOBINLINE 0x0100
-#define SO_NO_CHECK 11
-#define SO_PRIORITY 12
-#define SO_LINGER 0x0080
-#define SO_BSDCOMPAT 14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED 17
-#define SO_PEERCRED 18
-#define SO_RCVLOWAT 0x1004
-#define SO_SNDLOWAT 0x1003
-#define SO_RCVTIMEO 0x1006
-#define SO_SNDTIMEO 0x1005
-#define SO_ACCEPTCONN 0x1009
-
-#define SO_STYLE SO_TYPE /* Synonym */
-
-#elif defined(__hppa__)
-#define SOL_SOCKET 0xffff
-
-#define SO_DEBUG 0x0001
-#define SO_REUSEADDR 0x0004
-#define SO_KEEPALIVE 0x0008
-#define SO_DONTROUTE 0x0010
-#define SO_BROADCAST 0x0020
-#define SO_LINGER 0x0080
-#define SO_OOBINLINE 0x0100
-/* To add :#define SO_REUSEPORT 0x0200 */
-#define SO_SNDBUF 0x1001
-#define SO_RCVBUF 0x1002
-#define SO_SNDLOWAT 0x1003
-#define SO_RCVLOWAT 0x1004
-#define SO_SNDTIMEO 0x1005
-#define SO_RCVTIMEO 0x1006
-#define SO_ERROR 0x1007
-#define SO_TYPE 0x1008
-#define SO_PEERNAME 0x2000
-
-#define SO_NO_CHECK 0x400b
-#define SO_PRIORITY 0x400c
-#define SO_BSDCOMPAT 0x400e
-#define SO_PASSCRED 0x4010
-#define SO_PEERCRED 0x4011
-#define SO_TIMESTAMP 0x4012
-#define SCM_TIMESTAMP SO_TIMESTAMP
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION 0x4016
-#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x4017
-#define SO_SECURITY_ENCRYPTION_NETWORK 0x4018
-
-#define SO_BINDTODEVICE 0x4019
-
-/* Socket filtering */
-#define SO_ATTACH_FILTER 0x401a
-#define SO_DETACH_FILTER 0x401b
-
-#define SO_ACCEPTCONN 0x401c
-
-#elif defined(__sparc__)
-#define SOL_SOCKET 0xffff
-
-#define SO_DEBUG 0x0001
-#define SO_PASSCRED 0x0002
-#define SO_REUSEADDR 0x0004
-#define SO_KEEPALIVE 0x0008
-#define SO_DONTROUTE 0x0010
-#define SO_BROADCAST 0x0020
-#define SO_PEERCRED 0x0040
-#define SO_LINGER 0x0080
-#define SO_OOBINLINE 0x0100
-/* To add :#define SO_REUSEPORT 0x0200 */
-#define SO_BSDCOMPAT 0x0400
-#define SO_RCVLOWAT 0x0800
-#define SO_SNDLOWAT 0x1000
-#define SO_RCVTIMEO 0x2000
-#define SO_SNDTIMEO 0x4000
-#define SO_ACCEPTCONN 0x8000
-
-#define SO_DONTLINGER (~SO_LINGER) /* Older SunOS compat. hack */
-
-#define SO_SNDBUF 0x1001
-#define SO_RCVBUF 0x1002
-#define SO_ERROR 0x1007
-#define SO_TYPE 0x1008
-
-#define SO_ATTACH_FILTER 0x001a
-#define SO_DETACH_FILTER 0x001b
-
-#define SO_PEERNAME 0x001c
-#define SO_TIMESTAMP 0x001d
-#define SCM_TIMESTAMP SO_TIMESTAMP
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION 0x5001
-#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
-#define SO_SECURITY_ENCRYPTION_NETWORK 0x5004
-
-#else
-
-#define SOL_SOCKET 1
-
-#define SO_DEBUG 1
-#define SO_REUSEADDR 2
-#define SO_TYPE 3
-#define SO_ERROR 4
-#define SO_DONTROUTE 5
-#define SO_BROADCAST 6
-#define SO_SNDBUF 7
-#define SO_RCVBUF 8
-#define SO_KEEPALIVE 9
-#define SO_OOBINLINE 10
-#define SO_NO_CHECK 11
-#define SO_PRIORITY 12
-#define SO_LINGER 13
-#define SO_BSDCOMPAT 14
-/* To add :#define SO_REUSEPORT 15 */
-#define SO_PASSCRED 16
-#define SO_PEERCRED 17
-#define SO_RCVLOWAT 18
-#define SO_SNDLOWAT 19
-#define SO_RCVTIMEO 20
-#define SO_SNDTIMEO 21
-#define SO_ACCEPTCONN 30
-
-#endif
-
-#if !defined(__hppa__) && !defined(__sparc__)
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION 22
-#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
-#define SO_SECURITY_ENCRYPTION_NETWORK 24
-
-#define SO_BINDTODEVICE 25
-
-/* Socket filtering */
-#define SO_ATTACH_FILTER 26
-#define SO_DETACH_FILTER 27
-
-#define SO_PEERNAME 28
-#define SO_TIMESTAMP 29
-#define SCM_TIMESTAMP SO_TIMESTAMP
-#endif
-
-/* Socket types. */
-#ifdef __mips__
-#define SOCK_DGRAM 1 /* datagram (conn.less) socket */
-#define SOCK_STREAM 2 /* stream (connection) socket */
-#else
-#define SOCK_STREAM 1 /* stream (connection) socket */
-#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
-#endif
-#define SOCK_RAW 3 /* raw socket */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequential packet socket */
-#define SOCK_PACKET 10 /* linux specific way of */
- /* getting packets at the dev */
- /* level. For writing rarp and */
- /* other similar things on the */
- /* user level. */
-
-struct sockaddr {
- sa_family_t sa_family;
- char sa_data[14];
-};
-
-struct linger {
- int l_onoff;
- int l_linger;
-};
-
-struct iovec {
- void* iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
- size_t iov_len; /* Must be size_t (1003.1g) */
-};
-
-struct msghdr {
- void* msg_name; /* Socket name */
- int msg_namelen; /* Length of name */
- struct iovec* msg_iov; /* Data blocks */
- size_t msg_iovlen; /* Number of blocks */
- void* msg_control; /* Per protocol magic (eg BSD file descriptor passing) */
- size_t msg_controllen; /* Length of cmsg list */
- unsigned msg_flags;
-};
-
-struct cmsghdr {
- size_t cmsg_len; /* data byte count, including hdr */
- int cmsg_level; /* originating protocol */
- int cmsg_type; /* protocol-specific type */
-};
-
-#define UIO_FASTIOV 8
-#define UIO_MAXIOV 1024
-
-/* "Socket"-level control message types: */
-
-#define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */
-#define SCM_CREDENTIALS 0x02 /* rw: struct ucred */
-#define SCM_CONNECT 0x03 /* rw: struct scm_connect */
-
-struct ucred {
- unsigned int pid;
- unsigned int uid;
- unsigned int gid;
-};
-
-/* Supported address families. */
-#define AF_UNSPEC 0
-#define AF_UNIX 1 /* Unix domain sockets */
-#define AF_LOCAL 1 /* POSIX name for AF_UNIX */
-#define AF_INET 2 /* Internet IP Protocol */
-#define AF_AX25 3 /* Amateur Radio AX.25 */
-#define AF_IPX 4 /* Novell IPX */
-#define AF_APPLETALK 5 /* AppleTalk DDP */
-#define AF_NETROM 6 /* Amateur Radio NET/ROM */
-#define AF_BRIDGE 7 /* Multiprotocol bridge */
-#define AF_ATMPVC 8 /* ATM PVCs */
-#define AF_X25 9 /* Reserved for X.25 project */
-#define AF_INET6 10 /* IP version 6 */
-#define AF_ROSE 11 /* Amateur Radio X.25 PLP */
-#define AF_DECnet 12 /* Reserved for DECnet project */
-#define AF_NETBEUI 13 /* Reserved for 802.2LLC project*/
-#define AF_SECURITY 14 /* Security callback pseudo AF */
-#define AF_KEY 15 /* PF_KEY key management API */
-#define AF_NETLINK 16
-#define AF_ROUTE AF_NETLINK /* Alias to emulate 4.4BSD */
-#define AF_PACKET 17 /* Packet family */
-#define AF_ASH 18 /* Ash */
-#define AF_ECONET 19 /* Acorn Econet */
-#define AF_ATMSVC 20 /* ATM SVCs */
-#define AF_SNA 22 /* Linux SNA Project (nutters!) */
-#define AF_IRDA 23 /* IRDA sockets */
-#define AF_PPPOX 24 /* PPPoX sockets */
-#define AF_WANPIPE 25 /* Wanpipe API Sockets */
-#define AF_MAX 32 /* For now.. */
-
-/* Protocol families, same as address families. */
-#define PF_UNSPEC AF_UNSPEC
-#define PF_UNIX AF_UNIX
-#define PF_LOCAL AF_LOCAL
-#define PF_INET AF_INET
-#define PF_AX25 AF_AX25
-#define PF_IPX AF_IPX
-#define PF_APPLETALK AF_APPLETALK
-#define PF_NETROM AF_NETROM
-#define PF_BRIDGE AF_BRIDGE
-#define PF_ATMPVC AF_ATMPVC
-#define PF_X25 AF_X25
-#define PF_INET6 AF_INET6
-#define PF_ROSE AF_ROSE
-#define PF_DECnet AF_DECnet
-#define PF_NETBEUI AF_NETBEUI
-#define PF_SECURITY AF_SECURITY
-#define PF_KEY AF_KEY
-#define PF_NETLINK AF_NETLINK
-#define PF_ROUTE AF_ROUTE
-#define PF_PACKET AF_PACKET
-#define PF_ASH AF_ASH
-#define PF_ECONET AF_ECONET
-#define PF_ATMSVC AF_ATMSVC
-#define PF_SNA AF_SNA
-#define PF_IRDA AF_IRDA
-#define PF_PPPOX AF_PPPOX
-#define PF_WANPIPE AF_WANPIPE
-#define PF_MAX AF_MAX
-
-/* Maximum queue length specifiable by listen. */
-#define SOMAXCONN 128
-
-/* Flags we can use with send/ and recv.
- Added those for 1003.1g not all are supported yet */
-#define MSG_OOB 1
-#define MSG_PEEK 2
-#define MSG_DONTROUTE 4
-#define MSG_TRYHARD 4 /* Synonym for MSG_DONTROUTE for DECnet */
-#define MSG_CTRUNC 8
-#define MSG_PROBE 0x10 /* Do not send. Only probe path f.e. for MTU */
-#define MSG_TRUNC 0x20
-#define MSG_DONTWAIT 0x40 /* Nonblocking io */
-#define MSG_EOR 0x80 /* End of record */
-#define MSG_WAITALL 0x100 /* Wait for a full request */
-#define MSG_FIN 0x200
-#define MSG_EOF MSG_FIN
-#define MSG_SYN 0x400
-#define MSG_CONFIRM 0x800 /* Confirm path validity */
-#define MSG_RST 0x1000
-#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
-#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
-#define MSG_MORE 0x8000 /* Sender will send more */
-
-/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
-#define SOL_IP 0
-/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use SOL_ICMP=1 */
-#define SOL_TCP 6
-#define SOL_UDP 17
-#define SOL_IPV6 41
-#define SOL_ICMPV6 58
-#define SOL_RAW 255
-#define SOL_IPX 256
-#define SOL_AX25 257
-#define SOL_ATALK 258
-#define SOL_NETROM 259
-#define SOL_ROSE 260
-#define SOL_DECNET 261
-#define SOL_X25 262
-#define SOL_PACKET 263
-#define SOL_ATM 264 /* ATM layer (cell level) */
-#define SOL_AAL 265 /* ATM Adaption Layer (packet level) */
-#define SOL_IRDA 266
-
-/* IPX options */
-#define IPX_TYPE 1
-
-#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
-#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
-#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
-
-static inline struct cmsghdr* __cmsg_nxthdr(void *__ctl, size_t __size, struct cmsghdr *__cmsg)
-{
- struct cmsghdr * __ptr;
- __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
- if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
- return (struct cmsghdr *)0;
- return __ptr;
-}
-
-static inline struct cmsghdr* cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
-{
- return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
-}
-
-#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
-#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
-#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
-
-#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
- (struct cmsghdr *)(ctl) : \
- (struct cmsghdr *)NULL)
-#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
-
-struct sockaddr_storage {
- sa_family_t ss_family;
- uint32_t __ss_align;
- char __ss_padding[(128 - (2 * sizeof (uint32_t ))) ];
-};
-
-#ifndef SOCK_DGRAM
-/* the Linux kernel headers suck really badly on non-x86 */
-#define SOCK_STREAM 1 /* stream (connection) socket */
-#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
-#define SOCK_RAW 3 /* raw socket */
-#define SOCK_RDM 4 /* reliably-delivered message */
-#define SOCK_SEQPACKET 5 /* sequential packet socket */
-#define SOCK_PACKET 10 /* linux specific way of */
-#endif
-
-int socket(int domain, int type, int protocol) __THROW;
-int accept(int s, struct sockaddr *addr, socklen_t *addrlen) __THROW;
-int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) __THROW;
-int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) __THROW;
-int recv(int s, void *buf, size_t len, int flags) __THROW;
-int recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) __THROW;
-int recvmsg(int s, struct msghdr *msg, int flags) __THROW;
-int send(int s, const void *msg, size_t len, int flags) __THROW;
-int sendto(int s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) __THROW;
-int sendmsg(int s, const struct msghdr *msg, int flags) __THROW;
-
-int getpeername(int s, struct sockaddr *name, socklen_t *namelen) __THROW;
-int getsockname(int s , struct sockaddr * name , socklen_t * namelen) __THROW;
-
-int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen) __THROW;
-int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen) __THROW;
-
-int listen(int s, int backlog) __THROW;
-
-#define SHUT_RD 0
-#define SHUT_WR 1
-#define SHUT_RDWR 2
-int shutdown(int s, int how) __THROW;
-
-int socketpair(int d, int type, int protocol, int sv[2]);
-
-/* currently not supported: */
-#define NI_NOFQDN 1
-
-#define NI_NUMERICHOST 2
-#define NI_NAMEREQD 4
-#define NI_NUMERICSERV 8
-#define NI_DGRAM 16
-
-struct addrinfo {
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- size_t ai_addrlen;
- struct sockaddr *ai_addr;
- char *ai_canonname;
- struct addrinfo *ai_next;
-};
-
-int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
- size_t hostlen, char *serv, size_t servlen, int flags) __THROW;
-int getaddrinfo(const char *node, const char *service, const struct
- addrinfo *hints, struct addrinfo **res) __THROW;
-void freeaddrinfo(struct addrinfo *res) __THROW;
-const char *gai_strerror(int errcode) __THROW;
-
-#define EAI_FAMILY -1
-#define EAI_SOCKTYPE -2
-#define EAI_BADFLAGS -3
-#define EAI_NONAME -4
-#define EAI_SERVICE -5
-#define EAI_ADDRFAMILY -6
-#define EAI_NODATA -7
-#define EAI_MEMORY -8
-#define EAI_FAIL -9
-#define EAI_AGAIN -10
-#define EAI_SYSTEM -11
-
-#define AI_NUMERICHOST 1
-#define AI_CANONNAME 2
-#define AI_PASSIVE 4
-
-/* Linux-specific socket ioctls */
-#define SIOCINQ FIONREAD
-#define SIOCOUTQ TIOCOUTQ
-
-/* Routing table calls. */
-#define SIOCADDRT 0x890B /* add routing table entry */
-#define SIOCDELRT 0x890C /* delete routing table entry */
-#define SIOCRTMSG 0x890D /* call to routing system */
-
-/* Socket configuration controls. */
-#define SIOCGIFNAME 0x8910 /* get iface name */
-#define SIOCSIFLINK 0x8911 /* set iface channel */
-#define SIOCGIFCONF 0x8912 /* get iface list */
-#define SIOCGIFFLAGS 0x8913 /* get flags */
-#define SIOCSIFFLAGS 0x8914 /* set flags */
-#define SIOCGIFADDR 0x8915 /* get PA address */
-#define SIOCSIFADDR 0x8916 /* set PA address */
-#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
-#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
-#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
-#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
-#define SIOCGIFNETMASK 0x891b /* get network PA mask */
-#define SIOCSIFNETMASK 0x891c /* set network PA mask */
-#define SIOCGIFMETRIC 0x891d /* get metric */
-#define SIOCSIFMETRIC 0x891e /* set metric */
-#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
-#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
-#define SIOCGIFMTU 0x8921 /* get MTU size */
-#define SIOCSIFMTU 0x8922 /* set MTU size */
-#define SIOCSIFNAME 0x8923 /* set interface name */
-#define SIOCSIFHWADDR 0x8924 /* set hardware address */
-#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
-#define SIOCSIFENCAP 0x8926
-#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
-#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
-#define SIOCSIFSLAVE 0x8930
-#define SIOCADDMULTI 0x8931 /* Multicast address lists */
-#define SIOCDELMULTI 0x8932
-#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
-#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
-#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
-#define SIOCGIFPFLAGS 0x8935
-#define SIOCDIFADDR 0x8936 /* delete PA address */
-#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
-#define SIOCGIFCOUNT 0x8938 /* get number of devices */
-
-#define SIOCGIFBR 0x8940 /* Bridging support */
-#define SIOCSIFBR 0x8941 /* Set bridging options */
-
-#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
-#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
-
-#define SIOCGIFDIVERT 0x8944 /* Frame diversion support */
-#define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */
-
-#define SIOCETHTOOL 0x8946 /* Ethtool interface */
-
-/* ARP cache control calls. */
- /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
-#define SIOCDARP 0x8953 /* delete ARP table entry */
-#define SIOCGARP 0x8954 /* get ARP table entry */
-#define SIOCSARP 0x8955 /* set ARP table entry */
-
-/* RARP cache control calls. */
-#define SIOCDRARP 0x8960 /* delete RARP table entry */
-#define SIOCGRARP 0x8961 /* get RARP table entry */
-#define SIOCSRARP 0x8962 /* set RARP table entry */
-
-/* Driver configuration calls */
-
-#define SIOCGIFMAP 0x8970 /* Get device parameters */
-#define SIOCSIFMAP 0x8971 /* Set device parameters */
-
-/* DLCI configuration calls */
-
-#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
-#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
-
-#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
-
-#define _LINUX_SOCKET_H
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/soundcard.h b/mdk-stage1/dietlibc/include/sys/soundcard.h
deleted file mode 100644
index e8766499a..000000000
--- a/mdk-stage1/dietlibc/include/sys/soundcard.h
+++ /dev/null
@@ -1,1300 +0,0 @@
-#ifndef _SYS_SOUNDCARD_H
-#define _SYS_SOUNDCARD_H
-
-/*
- * Copyright by Hannu Savolainen 1993-1997
- *
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
- */
-
-
-/*
- * OSS interface version. With versions earlier than 3.6 this value is
- * an integer with value less than 361. In versions 3.6 and later
- * it's a six digit hexadecimal value. For example value
- * of 0x030600 represents OSS version 3.6.0.
- * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
- * the currently active driver.
- */
-#define SOUND_VERSION 0x030802
-#define OPEN_SOUND_SYSTEM
-
-/* In Linux we need to be prepared for cross compiling */
-#include <sys/ioctl.h>
-
-/*
- * Supported card ID numbers (Should be somewhere else?)
- */
-
-#define SNDCARD_ADLIB 1
-#define SNDCARD_SB 2
-#define SNDCARD_PAS 3
-#define SNDCARD_GUS 4
-#define SNDCARD_MPU401 5
-#define SNDCARD_SB16 6
-#define SNDCARD_SB16MIDI 7
-#define SNDCARD_UART6850 8
-#define SNDCARD_GUS16 9
-#define SNDCARD_MSS 10
-#define SNDCARD_PSS 11
-#define SNDCARD_SSCAPE 12
-#define SNDCARD_PSS_MPU 13
-#define SNDCARD_PSS_MSS 14
-#define SNDCARD_SSCAPE_MSS 15
-#define SNDCARD_TRXPRO 16
-#define SNDCARD_TRXPRO_SB 17
-#define SNDCARD_TRXPRO_MPU 18
-#define SNDCARD_MAD16 19
-#define SNDCARD_MAD16_MPU 20
-#define SNDCARD_CS4232 21
-#define SNDCARD_CS4232_MPU 22
-#define SNDCARD_MAUI 23
-#define SNDCARD_PSEUDO_MSS 24
-#define SNDCARD_GUSPNP 25
-#define SNDCARD_UART401 26
-/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
-
-/***********************************
- * IOCTL Commands for /dev/sequencer
- */
-
-#ifndef _SIOWR
-#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
-/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
-#define SIOCPARM_MASK IOCPARM_MASK
-#define SIOC_VOID IOC_VOID
-#define SIOC_OUT IOC_OUT
-#define SIOC_IN IOC_IN
-#define SIOC_INOUT IOC_INOUT
-#define _SIOC_SIZE _IOC_SIZE
-#define _SIOC_DIR _IOC_DIR
-#define _SIOC_NONE _IOC_NONE
-#define _SIOC_READ _IOC_READ
-#define _SIOC_WRITE _IOC_WRITE
-#define _SIO _IO
-#define _SIOR _IOR
-#define _SIOW _IOW
-#define _SIOWR _IOWR
-#else
-
-/* Ioctl's have the command encoded in the lower word,
- * and the size of any in or out parameters in the upper
- * word. The high 2 bits of the upper word are used
- * to encode the in/out status of the parameter; for now
- * we restrict parameters to at most 8191 bytes.
- */
-/* #define SIOCTYPE (0xff<<8) */
-#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
-#define SIOC_VOID 0x00000000 /* no parameters */
-#define SIOC_OUT 0x20000000 /* copy out parameters */
-#define SIOC_IN 0x40000000 /* copy in parameters */
-#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
-/* the 0x20000000 is so we can distinguish new ioctl's from old */
-#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
-#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-/* this should be _SIORW, but stdio got there first */
-#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
-#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
-#define _SIOC_DIR(x) (x & 0xf0000000)
-#define _SIOC_NONE SIOC_VOID
-#define _SIOC_READ SIOC_OUT
-#define _SIOC_WRITE SIOC_IN
-# endif /* _IOWR */
-#endif /* !_SIOWR */
-
-#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
-#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
-#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
-#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
-#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
-#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
-#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
-#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
-#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
-#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
-#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
-#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
-#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
-#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
-#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
-#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
-#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
-#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
-#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
-#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
-#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
-#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
-
-typedef struct synth_control
-{
- int devno; /* Synthesizer # */
- char data[4000]; /* Device spesific command/data record */
-}synth_control;
-
-typedef struct remove_sample
-{
- int devno; /* Synthesizer # */
- int bankno; /* MIDI bank # (0=General MIDI) */
- int instrno; /* MIDI instrument number */
-} remove_sample;
-
-typedef struct seq_event_rec {
- unsigned char arr[8];
-} seq_event_rec;
-
-#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
-#define SNDCTL_TMR_START _SIO ('T', 2)
-#define SNDCTL_TMR_STOP _SIO ('T', 3)
-#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
-#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
-#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
-# define TMR_INTERNAL 0x00000001
-# define TMR_EXTERNAL 0x00000002
-# define TMR_MODE_MIDI 0x00000010
-# define TMR_MODE_FSK 0x00000020
-# define TMR_MODE_CLS 0x00000040
-# define TMR_MODE_SMPTE 0x00000080
-#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
-#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
-
-/*
- * Some big endian/little endian handling macros
- */
-
-#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC)
-/* Big endian machines */
-# define _PATCHKEY(id) (0xfd00|id)
-# define AFMT_S16_NE AFMT_S16_BE
-#else
-# define _PATCHKEY(id) ((id<<8)|0xfd)
-# define AFMT_S16_NE AFMT_S16_LE
-#endif
-
-/*
- * Sample loading mechanism for internal synthesizers (/dev/sequencer)
- * The following patch_info structure has been designed to support
- * Gravis UltraSound. It tries to be universal format for uploading
- * sample based patches but is probably too limited.
- *
- * (PBD) As Hannu guessed, the GUS structure is too limited for
- * the WaveFront, but this is the right place for a constant definition.
- */
-
-struct patch_info {
- unsigned short key; /* Use WAVE_PATCH here */
-#define WAVE_PATCH _PATCHKEY(0x04)
-#define GUS_PATCH WAVE_PATCH
-#define WAVEFRONT_PATCH _PATCHKEY(0x06)
-
- short device_no; /* Synthesizer number */
- short instr_no; /* Midi pgm# */
-
- unsigned int mode;
-/*
- * The least significant byte has the same format than the GUS .PAT
- * files
- */
-#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
-#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
-#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
-#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
-#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
-#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
-#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
-#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
- /* (use the env_rate/env_offs fields). */
-/* Linux specific bits */
-#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
-#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
-#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
-#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
-/* Reserved bits */
-#define WAVE_ROM 0x40000000 /* For future use */
-#define WAVE_MULAW 0x20000000 /* For future use */
-/* Other bits must be zeroed */
-
- int len; /* Size of the wave data in bytes */
- int loop_start, loop_end; /* Byte offsets from the beginning */
-
-/*
- * The base_freq and base_note fields are used when computing the
- * playback speed for a note. The base_note defines the tone frequency
- * which is heard if the sample is played using the base_freq as the
- * playback speed.
- *
- * The low_note and high_note fields define the minimum and maximum note
- * frequencies for which this sample is valid. It is possible to define
- * more than one samples for an instrument number at the same time. The
- * low_note and high_note fields are used to select the most suitable one.
- *
- * The fields base_note, high_note and low_note should contain
- * the note frequency multiplied by 1000. For example value for the
- * middle A is 440*1000.
- */
-
- unsigned int base_freq;
- unsigned int base_note;
- unsigned int high_note;
- unsigned int low_note;
- int panning; /* -128=left, 127=right */
- int detuning;
-
-/* New fields introduced in version 1.99.5 */
-
- /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
- unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
- unsigned char env_offset[ 6 ]; /* 255 == 100% */
-
- /*
- * The tremolo, vibrato and scale info are not supported yet.
- * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
- * WAVE_SCALE
- */
-
- unsigned char tremolo_sweep;
- unsigned char tremolo_rate;
- unsigned char tremolo_depth;
-
- unsigned char vibrato_sweep;
- unsigned char vibrato_rate;
- unsigned char vibrato_depth;
-
- int scale_frequency;
- unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
-
- int volume;
- int fractions;
- int reserved1;
- int spare[2];
- char data[1]; /* The waveform data starts here */
- };
-
-struct sysex_info {
- short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
-#define SYSEX_PATCH _PATCHKEY(0x05)
-#define MAUI_PATCH _PATCHKEY(0x06)
- short device_no; /* Synthesizer number */
- int len; /* Size of the sysex data in bytes */
- unsigned char data[1]; /* Sysex data starts here */
- };
-
-/*
- * /dev/sequencer input events.
- *
- * The data written to the /dev/sequencer is a stream of events. Events
- * are records of 4 or 8 bytes. The first byte defines the size.
- * Any number of events can be written with a write call. There
- * is a set of macros for sending these events. Use these macros if you
- * want to maximize portability of your program.
- *
- * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
- * (All input events are currently 4 bytes long. Be prepared to support
- * 8 byte events also. If you receive any event having first byte >= 128,
- * it's a 8 byte event.
- *
- * The events are documented at the end of this file.
- *
- * Normal events (4 bytes)
- * There is also a 8 byte version of most of the 4 byte events. The
- * 8 byte one is recommended.
- */
-#define SEQ_NOTEOFF 0
-#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
-#define SEQ_NOTEON 1
-#define SEQ_FMNOTEON SEQ_NOTEON
-#define SEQ_WAIT TMR_WAIT_ABS
-#define SEQ_PGMCHANGE 3
-#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
-#define SEQ_SYNCTIMER TMR_START
-#define SEQ_MIDIPUTC 5
-#define SEQ_DRUMON 6 /*** OBSOLETE ***/
-#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
-#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
-#define SEQ_AFTERTOUCH 9
-#define SEQ_CONTROLLER 10
-
-/*******************************************
- * Midi controller numbers
- *******************************************
- * Controllers 0 to 31 (0x00 to 0x1f) and
- * 32 to 63 (0x20 to 0x3f) are continuous
- * controllers.
- * In the MIDI 1.0 these controllers are sent using
- * two messages. Controller numbers 0 to 31 are used
- * to send the MSB and the controller numbers 32 to 63
- * are for the LSB. Note that just 7 bits are used in MIDI bytes.
- */
-
-#define CTL_BANK_SELECT 0x00
-#define CTL_MODWHEEL 0x01
-#define CTL_BREATH 0x02
-/* undefined 0x03 */
-#define CTL_FOOT 0x04
-#define CTL_PORTAMENTO_TIME 0x05
-#define CTL_DATA_ENTRY 0x06
-#define CTL_MAIN_VOLUME 0x07
-#define CTL_BALANCE 0x08
-/* undefined 0x09 */
-#define CTL_PAN 0x0a
-#define CTL_EXPRESSION 0x0b
-/* undefined 0x0c */
-/* undefined 0x0d */
-/* undefined 0x0e */
-/* undefined 0x0f */
-#define CTL_GENERAL_PURPOSE1 0x10
-#define CTL_GENERAL_PURPOSE2 0x11
-#define CTL_GENERAL_PURPOSE3 0x12
-#define CTL_GENERAL_PURPOSE4 0x13
-/* undefined 0x14 - 0x1f */
-
-/* undefined 0x20 */
-/* The controller numbers 0x21 to 0x3f are reserved for the */
-/* least significant bytes of the controllers 0x00 to 0x1f. */
-/* These controllers are not recognised by the driver. */
-
-/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
-/* 0=OFF and 127=ON (intermediate values are possible) */
-#define CTL_DAMPER_PEDAL 0x40
-#define CTL_SUSTAIN 0x40 /* Alias */
-#define CTL_HOLD 0x40 /* Alias */
-#define CTL_PORTAMENTO 0x41
-#define CTL_SOSTENUTO 0x42
-#define CTL_SOFT_PEDAL 0x43
-/* undefined 0x44 */
-#define CTL_HOLD2 0x45
-/* undefined 0x46 - 0x4f */
-
-#define CTL_GENERAL_PURPOSE5 0x50
-#define CTL_GENERAL_PURPOSE6 0x51
-#define CTL_GENERAL_PURPOSE7 0x52
-#define CTL_GENERAL_PURPOSE8 0x53
-/* undefined 0x54 - 0x5a */
-#define CTL_EXT_EFF_DEPTH 0x5b
-#define CTL_TREMOLO_DEPTH 0x5c
-#define CTL_CHORUS_DEPTH 0x5d
-#define CTL_DETUNE_DEPTH 0x5e
-#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
-#define CTL_PHASER_DEPTH 0x5f
-#define CTL_DATA_INCREMENT 0x60
-#define CTL_DATA_DECREMENT 0x61
-#define CTL_NONREG_PARM_NUM_LSB 0x62
-#define CTL_NONREG_PARM_NUM_MSB 0x63
-#define CTL_REGIST_PARM_NUM_LSB 0x64
-#define CTL_REGIST_PARM_NUM_MSB 0x65
-/* undefined 0x66 - 0x78 */
-/* reserved 0x79 - 0x7f */
-
-/* Pseudo controllers (not midi compatible) */
-#define CTRL_PITCH_BENDER 255
-#define CTRL_PITCH_BENDER_RANGE 254
-#define CTRL_EXPRESSION 253 /* Obsolete */
-#define CTRL_MAIN_VOLUME 252 /* Obsolete */
-#define SEQ_BALANCE 11
-#define SEQ_VOLMODE 12
-
-/*
- * Volume mode decides how volumes are used
- */
-
-#define VOL_METHOD_ADAGIO 1
-#define VOL_METHOD_LINEAR 2
-
-/*
- * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
- * input events.
- */
-
-/*
- * Event codes 0xf0 to 0xfc are reserved for future extensions.
- */
-
-#define SEQ_FULLSIZE 0xfd /* Long events */
-/*
- * SEQ_FULLSIZE events are used for loading patches/samples to the
- * synthesizer devices. These events are passed directly to the driver
- * of the associated synthesizer device. There is no limit to the size
- * of the extended events. These events are not queued but executed
- * immediately when the write() is called (execution can take several
- * seconds of time).
- *
- * When a SEQ_FULLSIZE message is written to the device, it must
- * be written using exactly one write() call. Other events cannot
- * be mixed to the same write.
- *
- * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
- * /dev/sequencer. Don't write other data together with the instrument structure
- * Set the key field of the structure to FM_PATCH. The device field is used to
- * route the patch to the corresponding device.
- *
- * For wave table use struct patch_info. Initialize the key field
- * to WAVE_PATCH.
- */
-#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
-#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
-
-/*
- * Record for FM patches
- */
-
-typedef unsigned char sbi_instr_data[32];
-
-struct sbi_instrument {
- unsigned short key; /* FM_PATCH or OPL3_PATCH */
-#define FM_PATCH _PATCHKEY(0x01)
-#define OPL3_PATCH _PATCHKEY(0x03)
- short device; /* Synth# (0-4) */
- int channel; /* Program# to be initialized */
- sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
- };
-
-struct synth_info { /* Read only */
- char name[30];
- int device; /* 0-N. INITIALIZE BEFORE CALLING */
- int synth_type;
-#define SYNTH_TYPE_FM 0
-#define SYNTH_TYPE_SAMPLE 1
-#define SYNTH_TYPE_MIDI 2 /* Midi interface */
-
- int synth_subtype;
-#define FM_TYPE_ADLIB 0x00
-#define FM_TYPE_OPL3 0x01
-#define MIDI_TYPE_MPU401 0x401
-
-#define SAMPLE_TYPE_BASIC 0x10
-#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
-#define SAMPLE_TYPE_WAVEFRONT 0x11
-
- int perc_mode; /* No longer supported */
- int nr_voices;
- int nr_drums; /* Obsolete field */
- int instr_bank_size;
- unsigned int capabilities;
-#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
-#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
-#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
- int dummies[19]; /* Reserve space */
- };
-
-struct sound_timer_info {
- char name[32];
- int caps;
- };
-
-#define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
-
-struct midi_info {
- char name[30];
- int device; /* 0-N. INITIALIZE BEFORE CALLING */
- unsigned int capabilities; /* To be defined later */
- int dev_type;
- int dummies[18]; /* Reserve space */
- };
-
-/********************************************
- * ioctl commands for the /dev/midi##
- */
-typedef struct {
- unsigned char cmd;
- char nr_args, nr_returns;
- unsigned char data[30];
- } mpu_command_rec;
-
-#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
-#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
-#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
-
-/********************************************
- * IOCTL commands for /dev/dsp and /dev/audio
- */
-
-#define SNDCTL_DSP_RESET _SIO ('P', 0)
-#define SNDCTL_DSP_SYNC _SIO ('P', 1)
-#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
-#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
-#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
-#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
-#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
-#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
-#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
-#define SNDCTL_DSP_POST _SIO ('P', 8)
-#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
-#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
-
-/* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
-#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int) /* Returns a mask */
-#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int) /* Selects ONE fmt*/
-# define AFMT_QUERY 0x00000000 /* Return current fmt */
-# define AFMT_MU_LAW 0x00000001
-# define AFMT_A_LAW 0x00000002
-# define AFMT_IMA_ADPCM 0x00000004
-# define AFMT_U8 0x00000008
-# define AFMT_S16_LE 0x00000010 /* Little endian signed 16*/
-# define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
-# define AFMT_S8 0x00000040
-# define AFMT_U16_LE 0x00000080 /* Little endian U16 */
-# define AFMT_U16_BE 0x00000100 /* Big endian U16 */
-# define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
-# define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
-
-/*
- * Buffer status queries.
- */
-typedef struct audio_buf_info {
- int fragments; /* # of available fragments (partially usend ones not counted) */
- int fragstotal; /* Total # of fragments allocated */
- int fragsize; /* Size of a fragment in bytes */
-
- int bytes; /* Available space in bytes (includes partially used fragments) */
- /* Note! 'bytes' could be more than fragments*fragsize */
- } audio_buf_info;
-
-#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
-#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
-#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
-#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
-# define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
-# define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
-# define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
-# define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
- /* internal buffers which may */
- /* cause some delays and */
- /* decrease precision of timing */
-# define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
- /* Sometimes it's a DSP */
- /* but usually not */
-# define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
-# define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
-# define DSP_CAP_MULTI 0x00004000 /* support multiple open */
-# define DSP_CAP_BIND 0x00008000 /* channel binding to front/rear/cneter/lfe */
-
-
-#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
-#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
-# define PCM_ENABLE_INPUT 0x00000001
-# define PCM_ENABLE_OUTPUT 0x00000002
-
-typedef struct count_info {
- int bytes; /* Total # of bytes processed */
- int blocks; /* # of fragment transitions since last time */
- int ptr; /* Current DMA pointer value */
- } count_info;
-
-#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
-#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
-
-typedef struct buffmem_desc {
- unsigned *buffer;
- int size;
- } buffmem_desc;
-#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
-#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
-#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
-#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
-#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
-
-#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
-#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
-# define DSP_BIND_QUERY 0x00000000
-# define DSP_BIND_FRONT 0x00000001
-# define DSP_BIND_SURR 0x00000002
-# define DSP_BIND_CENTER_LFE 0x00000004
-# define DSP_BIND_HANDSET 0x00000008
-# define DSP_BIND_MIC 0x00000010
-# define DSP_BIND_MODEM1 0x00000020
-# define DSP_BIND_MODEM2 0x00000040
-# define DSP_BIND_I2S 0x00000080
-# define DSP_BIND_SPDIF 0x00000100
-
-#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
-#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
-# define SPDIF_PRO 0x0001
-# define SPDIF_N_AUD 0x0002
-# define SPDIF_COPY 0x0004
-# define SPDIF_PRE 0x0008
-# define SPDIF_CC 0x07f0
-# define SPDIF_L 0x0800
-# define SPDIF_DRS 0x4000
-# define SPDIF_V 0x8000
-
-/*
- * Application's profile defines the way how playback underrun situations should be handled.
- *
- * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
- * playback buffer whenever an underrun occurs. This consumes some time
- * prevents looping the existing buffer.
- * APF_CPUINTENS is intended to be set by CPU intensive applications which
- * are likely to run out of time occasionally. In this mode the buffer cleanup is
- * disabled which saves CPU time but also let's the previous buffer content to
- * be played during the "pause" after the underrun.
- */
-#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
-#define APF_NORMAL 0 /* Normal applications */
-#define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
-#define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
-
-#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
-#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
-#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
-#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
-
-/* Some alias names */
-#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
-#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
-#define SOUND_PCM_POST SNDCTL_DSP_POST
-#define SOUND_PCM_RESET SNDCTL_DSP_RESET
-#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
-#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
-#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
-#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
-#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
-#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
-#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
-#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
-#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
-#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
-#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
-#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
-#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
-#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
-#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
-#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
-
-/*
- * ioctl calls to be used in communication with coprocessors and
- * DSP chips.
- */
-
-typedef struct copr_buffer {
- int command; /* Set to 0 if not used */
- int flags;
-#define CPF_NONE 0x0000
-#define CPF_FIRST 0x0001 /* First block */
-#define CPF_LAST 0x0002 /* Last block */
- int len;
- int offs; /* If required by the device (0 if not used) */
-
- unsigned char data[4000]; /* NOTE! 4000 is not 4k */
- } copr_buffer;
-
-typedef struct copr_debug_buf {
- int command; /* Used internally. Set to 0 */
- int parm1;
- int parm2;
- int flags;
- int len; /* Length of data in bytes */
- } copr_debug_buf;
-
-typedef struct copr_msg {
- int len;
- unsigned char data[4000];
- } copr_msg;
-
-#define SNDCTL_COPR_RESET _SIO ('C', 0)
-#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
-#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
-#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
-#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
-#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
-#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
-#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
-#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
-#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
-
-/*********************************************
- * IOCTL commands for /dev/mixer
- */
-
-/*
- * Mixer devices
- *
- * There can be up to 20 different analog mixer channels. The
- * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
- * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
- * the devices supported by the particular mixer.
- */
-
-#define SOUND_MIXER_NRDEVICES 25
-#define SOUND_MIXER_VOLUME 0
-#define SOUND_MIXER_BASS 1
-#define SOUND_MIXER_TREBLE 2
-#define SOUND_MIXER_SYNTH 3
-#define SOUND_MIXER_PCM 4
-#define SOUND_MIXER_SPEAKER 5
-#define SOUND_MIXER_LINE 6
-#define SOUND_MIXER_MIC 7
-#define SOUND_MIXER_CD 8
-#define SOUND_MIXER_IMIX 9 /* Recording monitor */
-#define SOUND_MIXER_ALTPCM 10
-#define SOUND_MIXER_RECLEV 11 /* Recording level */
-#define SOUND_MIXER_IGAIN 12 /* Input gain */
-#define SOUND_MIXER_OGAIN 13 /* Output gain */
-/*
- * The AD1848 codec and compatibles have three line level inputs
- * (line, aux1 and aux2). Since each card manufacturer have assigned
- * different meanings to these inputs, it's inpractical to assign
- * specific meanings (line, cd, synth etc.) to them.
- */
-#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
-#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
-#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
-#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
-#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
-#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
-#define SOUND_MIXER_PHONEIN 20 /* Phone input */
-#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
-#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
-#define SOUND_MIXER_RADIO 23 /* Radio in */
-#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
-
-/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
-/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
-#define SOUND_ONOFF_MIN 28
-#define SOUND_ONOFF_MAX 30
-
-/* Note! Number 31 cannot be used since the sign bit is reserved */
-#define SOUND_MIXER_NONE 31
-
-/*
- * The following unsupported macros are no longer functional.
- * Use SOUND_MIXER_PRIVATE# macros in future.
- */
-#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
-#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
-#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
-
-
-#define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
- "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
- "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
- "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
-
-#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
- "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
- "line1", "line2", "line3", "dig1", "dig2", "dig3", \
- "phin", "phout", "video", "radio", "monitor"}
-
-/* Device bitmask identifiers */
-
-#define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
-#define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
-#define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
-#define SOUND_MIXER_CAPS 0xfc
-# define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
-#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
-#define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
-#define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
-
-/* Device mask bits */
-
-#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
-#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
-#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
-#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
-#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
-#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
-#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
-#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
-#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
-#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
-#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
-#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
-#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
-#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
-#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
-#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
-#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
-#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
-#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
-#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
-#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
-#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
-#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
-#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
-#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
-
-/* Obsolete macros */
-#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
-#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
-#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
-
-#define MIXER_READ(dev) _SIOR('M', dev, int)
-#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
-#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
-#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
-#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
-#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
-#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
-#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
-#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
-#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
-#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
-
-#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
-#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
-#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
-#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
-#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
-#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
-#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
-#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
-#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
-#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
-#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
-#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
-#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
-#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
-#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
-#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
-#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
-#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
-
-/* Obsolete macros */
-#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
-#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
-#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
-
-#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
-
-typedef struct mixer_info
-{
- char id[16];
- char name[32];
- int modify_counter;
- int fillers[10];
-} mixer_info;
-
-typedef struct _old_mixer_info /* Obsolete */
-{
- char id[16];
- char name[32];
-} _old_mixer_info;
-
-#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
-#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
-
-/*
- * A mechanism for accessing "proprietary" mixer features. This method
- * permits passing 128 bytes of arbitrary data between a mixer application
- * and the mixer driver. Interpretation of the record is defined by
- * the particular mixer driver.
- */
-typedef unsigned char mixer_record[128];
-
-#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
-
-/*
- * Two ioctls for special souncard function
- */
-#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
-#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
-
-/*
- * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
- * These features can be used when accessing device specific features.
- */
-#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
-#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
-#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
-#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
-#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
-
-/*
- * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
- * for querying current mixer settings from the driver and for loading
- * default volume settings _prior_ activating the mixer (loading
- * doesn't affect current state of the mixer hardware). These calls
- * are for internal use only.
- */
-
-typedef struct mixer_vol_table {
- int num; /* Index to volume table */
- char name[32];
- int levels[32];
-} mixer_vol_table;
-
-#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
-#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
-
-/*
- * An ioctl for identifying the driver version. It will return value
- * of the SOUND_VERSION macro used when compiling the driver.
- * This call was introduced in OSS version 3.6 and it will not work
- * with earlier versions (returns EINVAL).
- */
-#define OSS_GETVERSION _SIOR ('M', 118, int)
-
-/*
- * Level 2 event types for /dev/sequencer
- */
-
-/*
- * The 4 most significant bits of byte 0 specify the class of
- * the event:
- *
- * 0x8X = system level events,
- * 0x9X = device/port specific events, event[1] = device/port,
- * The last 4 bits give the subtype:
- * 0x02 = Channel event (event[3] = chn).
- * 0x01 = note event (event[4] = note).
- * (0x01 is not used alone but always with bit 0x02).
- * event[2] = MIDI message code (0x80=note off etc.)
- *
- */
-
-#define EV_SEQ_LOCAL 0x80
-#define EV_TIMING 0x81
-#define EV_CHN_COMMON 0x92
-#define EV_CHN_VOICE 0x93
-#define EV_SYSEX 0x94
-/*
- * Event types 200 to 220 are reserved for application use.
- * These numbers will not be used by the driver.
- */
-
-/*
- * Events for event type EV_CHN_VOICE
- */
-
-#define MIDI_NOTEOFF 0x80
-#define MIDI_NOTEON 0x90
-#define MIDI_KEY_PRESSURE 0xA0
-
-/*
- * Events for event type EV_CHN_COMMON
- */
-
-#define MIDI_CTL_CHANGE 0xB0
-#define MIDI_PGM_CHANGE 0xC0
-#define MIDI_CHN_PRESSURE 0xD0
-#define MIDI_PITCH_BEND 0xE0
-
-#define MIDI_SYSTEM_PREFIX 0xF0
-
-/*
- * Timer event types
- */
-#define TMR_WAIT_REL 1 /* Time relative to the prev time */
-#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
-#define TMR_STOP 3
-#define TMR_START 4
-#define TMR_CONTINUE 5
-#define TMR_TEMPO 6
-#define TMR_ECHO 8
-#define TMR_CLOCK 9 /* MIDI clock */
-#define TMR_SPP 10 /* Song position pointer */
-#define TMR_TIMESIG 11 /* Time signature */
-
-/*
- * Local event types
- */
-#define LOCL_STARTAUDIO 1
-
-#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
-/*
- * Some convenience macros to simplify programming of the
- * /dev/sequencer interface
- *
- * These macros define the API which should be used when possible.
- */
-#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
-
-void seqbuf_dump(void); /* This function must be provided by programs */
-
-extern int OSS_init(int seqfd, int buflen);
-extern void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen);
-extern void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen);
-extern void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen);
-extern void OSS_patch_caching(int dev, int chn, int patch,
- int fd, unsigned char *buf, int buflen);
-extern void OSS_drum_caching(int dev, int chn, int patch,
- int fd, unsigned char *buf, int buflen);
-extern void OSS_write_patch(int fd, unsigned char *buf, int len);
-extern int OSS_write_patch2(int fd, unsigned char *buf, int len);
-
-#define SEQ_PM_DEFINES int __foo_bar___
-#ifdef OSSLIB
-# define SEQ_USE_EXTBUF() \
- extern unsigned char *_seqbuf; \
- extern int _seqbuflen;extern int _seqbufptr
-# define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
-# define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
-# define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
-# define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
-
-# define SEQ_LOAD_GMINSTR(dev, instr) \
- OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
-# define SEQ_LOAD_GMDRUM(dev, drum) \
- OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
-#else /* !OSSLIB */
-
-# define SEQ_LOAD_GMINSTR(dev, instr)
-# define SEQ_LOAD_GMDRUM(dev, drum)
-
-# define SEQ_USE_EXTBUF() \
- extern unsigned char _seqbuf[]; \
- extern int _seqbuflen;extern int _seqbufptr
-
-#ifndef USE_SIMPLE_MACROS
-/* Sample seqbuf_dump() implementation:
- *
- * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
- *
- * int seqfd; -- The file descriptor for /dev/sequencer.
- *
- * void
- * seqbuf_dump ()
- * {
- * if (_seqbufptr)
- * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
- * {
- * perror ("write /dev/sequencer");
- * exit (-1);
- * }
- * _seqbufptr = 0;
- * }
- */
-
-#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
-#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
-#define _SEQ_ADVBUF(len) _seqbufptr += len
-#define SEQ_DUMPBUF seqbuf_dump
-#else
-/*
- * This variation of the sequencer macros is used just to format one event
- * using fixed buffer.
- *
- * The program using the macro library must define the following macros before
- * using this library.
- *
- * #define _seqbuf name of the buffer (unsigned char[])
- * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
- * size of the event, this macro can be used.
- * Otherwise this must be defined as empty.
- * #define _seqbufptr Define the name of index variable or 0 if
- * not required.
- */
-#define _SEQ_NEEDBUF(len) /* empty */
-#endif
-#endif /* !OSSLIB */
-
-#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
- _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
- _seqbuf[_seqbufptr+2] = (dev);\
- _seqbuf[_seqbufptr+3] = (mode);\
- _seqbuf[_seqbufptr+4] = 0;\
- _seqbuf[_seqbufptr+5] = 0;\
- _seqbuf[_seqbufptr+6] = 0;\
- _seqbuf[_seqbufptr+7] = 0;\
- _SEQ_ADVBUF(8);}
-
-/*
- * Midi voice messages
- */
-
-#define _CHN_VOICE(dev, event, chn, note, parm) \
- {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
- _seqbuf[_seqbufptr+1] = (dev);\
- _seqbuf[_seqbufptr+2] = (event);\
- _seqbuf[_seqbufptr+3] = (chn);\
- _seqbuf[_seqbufptr+4] = (note);\
- _seqbuf[_seqbufptr+5] = (parm);\
- _seqbuf[_seqbufptr+6] = (0);\
- _seqbuf[_seqbufptr+7] = 0;\
- _SEQ_ADVBUF(8);}
-
-#define SEQ_START_NOTE(dev, chn, note, vol) \
- _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
-
-#define SEQ_STOP_NOTE(dev, chn, note, vol) \
- _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
-
-#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
- _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
-
-/*
- * Midi channel messages
- */
-
-#define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
- {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
- _seqbuf[_seqbufptr+1] = (dev);\
- _seqbuf[_seqbufptr+2] = (event);\
- _seqbuf[_seqbufptr+3] = (chn);\
- _seqbuf[_seqbufptr+4] = (p1);\
- _seqbuf[_seqbufptr+5] = (p2);\
- *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
- _SEQ_ADVBUF(8);}
-/*
- * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
- * sending any MIDI bytes but it's absolutely not possible. Trying to do
- * so _will_ cause problems with MPU401 intelligent mode).
- *
- * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
- * sent by calling SEQ_SYSEX() several times (there must be no other events
- * between them). First sysex fragment must have 0xf0 in the first byte
- * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
- * between these sysex start and end markers cannot be larger than 0x7f. Also
- * lengths of each fragments (except the last one) must be 6.
- *
- * Breaking the above rules may work with some MIDI ports but is likely to
- * cause fatal problems with some other devices (such as MPU401).
- */
-#define SEQ_SYSEX(dev, buf, len) \
- {int ii, ll=(len); \
- unsigned char *bufp=buf;\
- if (ll>6)ll=6;\
- _SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr] = EV_SYSEX;\
- _seqbuf[_seqbufptr+1] = (dev);\
- for(ii=0;ii<ll;ii++)\
- _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
- for(ii=ll;ii<6;ii++)\
- _seqbuf[_seqbufptr+ii+2] = 0xff;\
- _SEQ_ADVBUF(8);}
-
-#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
- _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
-
-#define SEQ_SET_PATCH SEQ_PGM_CHANGE
-#ifdef OSSLIB
-# define SEQ_PGM_CHANGE(dev, chn, patch) \
- {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
- _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
-#else
-# define SEQ_PGM_CHANGE(dev, chn, patch) \
- _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
-#endif
-
-#define SEQ_CONTROL(dev, chn, controller, value) \
- _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
-
-#define SEQ_BENDER(dev, chn, value) \
- _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
-
-
-#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
- _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
- _seqbuf[_seqbufptr+2] = (dev);\
- _seqbuf[_seqbufptr+3] = (voice);\
- _seqbuf[_seqbufptr+4] = (controller);\
- _seqbuf[_seqbufptr+5] = ((value)&0xff);\
- _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
- _seqbuf[_seqbufptr+7] = 0;\
- _SEQ_ADVBUF(8);}
-/*
- * The following 5 macros are incorrectly implemented and obsolete.
- * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
- */
-#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
-#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
-#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
-#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
-#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
-
-/*
- * Timing and syncronization macros
- */
-
-#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr+0] = EV_TIMING; \
- _seqbuf[_seqbufptr+1] = (ev); \
- _seqbuf[_seqbufptr+2] = 0;\
- _seqbuf[_seqbufptr+3] = 0;\
- *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
- _SEQ_ADVBUF(8);}
-
-#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
-#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
-#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
-#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
-#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
-#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
-#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
-#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
-#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
-
-/*
- * Local control events
- */
-
-#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
- _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
- _seqbuf[_seqbufptr+1] = (ev); \
- _seqbuf[_seqbufptr+2] = 0;\
- _seqbuf[_seqbufptr+3] = 0;\
- *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
- _SEQ_ADVBUF(8);}
-
-#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
-/*
- * Events for the level 1 interface only
- */
-
-#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
- _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
- _seqbuf[_seqbufptr+1] = (byte);\
- _seqbuf[_seqbufptr+2] = (device);\
- _seqbuf[_seqbufptr+3] = 0;\
- _SEQ_ADVBUF(4);}
-
-/*
- * Patch loading.
- */
-#ifdef OSSLIB
-# define SEQ_WRPATCH(patchx, len) \
- OSS_write_patch(seqfd, (char*)(patchx), len)
-# define SEQ_WRPATCH2(patchx, len) \
- OSS_write_patch2(seqfd, (char*)(patchx), len)
-#else
-# define SEQ_WRPATCH(patchx, len) \
- {if (_seqbufptr) SEQ_DUMPBUF();\
- if (write(seqfd, (char*)(patchx), len)==-1) \
- perror("Write patch: /dev/sequencer");}
-# define SEQ_WRPATCH2(patchx, len) \
- (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
-#endif
-
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/sparc-ioctl.h b/mdk-stage1/dietlibc/include/sys/sparc-ioctl.h
deleted file mode 100644
index 07b502465..000000000
--- a/mdk-stage1/dietlibc/include/sys/sparc-ioctl.h
+++ /dev/null
@@ -1,172 +0,0 @@
-#define _IOC_NRBITS 8
-#define _IOC_TYPEBITS 8
-#define _IOC_SIZEBITS 8
-#define _IOC_RESVBITS 5
-#define _IOC_DIRBITS 3
-
-#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_RESVMASK ((1 << _IOC_RESVBITS)-1)
-#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT 0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
-#define _IOC_RESVSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
-#define _IOC_DIRSHIFT (_IOC_RESVSHIFT + _IOC_RESVBITS)
-
-#define _IOC_NONE 1U
-#define _IOC_READ 2U
-#define _IOC_WRITE 4U
-
-#define _IOC(dir,type,nr,size) \
- (((dir) << _IOC_DIRSHIFT) | \
- ((type) << _IOC_TYPESHIFT) | \
- ((nr) << _IOC_NRSHIFT) | \
- ((size) << _IOC_SIZESHIFT))
-
-#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the PCMCIA... */
-
-#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
-
-/* Big T */
-#define TCGETA _IOR('T', 1, struct termio)
-#define TCSETA _IOW('T', 2, struct termio)
-#define TCSETAW _IOW('T', 3, struct termio)
-#define TCSETAF _IOW('T', 4, struct termio)
-#define TCSBRK _IO('T', 5)
-#define TCXONC _IO('T', 6)
-#define TCFLSH _IO('T', 7)
-#define TCGETS _IOR('T', 8, struct termios)
-#define TCSETS _IOW('T', 9, struct termios)
-#define TCSETSW _IOW('T', 10, struct termios)
-#define TCSETSF _IOW('T', 11, struct termios)
-
-/* Note that all the ioctls that are not available in Linux have a
- * double underscore on the front to: a) avoid some programs to
- * thing we support some ioctls under Linux (autoconfiguration stuff)
- */
-/* Little t */
-#define TIOCGETD _IOR('t', 0, int)
-#define TIOCSETD _IOW('t', 1, int)
-#define __TIOCHPCL _IO('t', 2) /* SunOS Specific */
-#define __TIOCMODG _IOR('t', 3, int) /* SunOS Specific */
-#define __TIOCMODS _IOW('t', 4, int) /* SunOS Specific */
-#define __TIOCGETP _IOR('t', 8, struct sgttyb) /* SunOS Specific */
-#define __TIOCSETP _IOW('t', 9, struct sgttyb) /* SunOS Specific */
-#define __TIOCSETN _IOW('t', 10, struct sgttyb) /* SunOS Specific */
-#define TIOCEXCL _IO('t', 13)
-#define TIOCNXCL _IO('t', 14)
-#define __TIOCFLUSH _IOW('t', 16, int) /* SunOS Specific */
-#define __TIOCSETC _IOW('t', 17, struct tchars) /* SunOS Specific */
-#define __TIOCGETC _IOR('t', 18, struct tchars) /* SunOS Specific */
-#define __TIOCTCNTL _IOW('t', 32, int) /* SunOS Specific */
-#define __TIOCSIGNAL _IOW('t', 33, int) /* SunOS Specific */
-#define __TIOCSETX _IOW('t', 34, int) /* SunOS Specific */
-#define __TIOCGETX _IOR('t', 35, int) /* SunOS Specific */
-#define TIOCCONS _IO('t', 36)
-#define __TIOCSSIZE _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
-#define __TIOCGSIZE _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
-#define TIOCGSOFTCAR _IOR('t', 100, int)
-#define TIOCSSOFTCAR _IOW('t', 101, int)
-#define __TIOCUCNTL _IOW('t', 102, int) /* SunOS Specific */
-#define TIOCSWINSZ _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ _IOR('t', 104, struct winsize)
-#define __TIOCREMOTE _IOW('t', 105, int) /* SunOS Specific */
-#define TIOCMGET _IOR('t', 106, int)
-#define TIOCMBIC _IOW('t', 107, int)
-#define TIOCMBIS _IOW('t', 108, int)
-#define TIOCMSET _IOW('t', 109, int)
-#define __TIOCSTART _IO('t', 110) /* SunOS Specific */
-#define __TIOCSTOP _IO('t', 111) /* SunOS Specific */
-#define TIOCPKT _IOW('t', 112, int)
-#define TIOCNOTTY _IO('t', 113)
-#define TIOCSTI _IOW('t', 114, char)
-#define TIOCOUTQ _IOR('t', 115, int)
-#define __TIOCGLTC _IOR('t', 116, struct ltchars) /* SunOS Specific */
-#define __TIOCSLTC _IOW('t', 117, struct ltchars) /* SunOS Specific */
-/* 118 is the non-posix setpgrp tty ioctl */
-/* 119 is the non-posix getpgrp tty ioctl */
-#define __TIOCCDTR _IO('t', 120) /* SunOS Specific */
-#define __TIOCSDTR _IO('t', 121) /* SunOS Specific */
-#define TIOCCBRK _IO('t', 122)
-#define TIOCSBRK _IO('t', 123)
-#define __TIOCLGET _IOW('t', 124, int) /* SunOS Specific */
-#define __TIOCLSET _IOW('t', 125, int) /* SunOS Specific */
-#define __TIOCLBIC _IOW('t', 126, int) /* SunOS Specific */
-#define __TIOCLBIS _IOW('t', 127, int) /* SunOS Specific */
-#define __TIOCISPACE _IOR('t', 128, int) /* SunOS Specific */
-#define __TIOCISIZE _IOR('t', 129, int) /* SunOS Specific */
-#define TIOCSPGRP _IOW('t', 130, int)
-#define TIOCGPGRP _IOR('t', 131, int)
-#define TIOCSCTTY _IO('t', 132)
-#define TIOCGSID _IOR('t', 133, int)
-/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
-#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
-#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
-
-/* Little f */
-#define FIOCLEX _IO('f', 1)
-#define FIONCLEX _IO('f', 2)
-#define FIOASYNC _IOW('f', 125, int)
-#define FIONBIO _IOW('f', 126, int)
-#define FIONREAD _IOR('f', 127, int)
-#define TIOCINQ FIONREAD
-#define FIOQSIZE _IOR('f', 128, loff_t)
-
-/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
- * someday. This is completely bogus, I know...
- */
-#define __TCGETSTAT _IO('T', 200) /* Rutgers specific */
-#define __TCSETSTAT _IO('T', 201) /* Rutgers specific */
-
-/* Linux specific, no SunOS equivalent. */
-#define TIOCLINUX 0x541C
-#define TIOCGSERIAL 0x541E
-#define TIOCSSERIAL 0x541F
-#define TCSBRKP 0x5425
-#define TIOCTTYGSTRUCT 0x5426
-#define TIOCSERCONFIG 0x5453
-#define TIOCSERGWILD 0x5454
-#define TIOCSERSWILD 0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR 0x5459 /* Get line status register */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-#define TIOCMIWAIT 0x545C /* Wait input */
-#define TIOCGICOUNT 0x545D /* Read serial port inline interrupt counts */
-
-/* Used for packet mode */
-#define TIOCPKT_DATA 0
-#define TIOCPKT_FLUSHREAD 1
-#define TIOCPKT_FLUSHWRITE 2
-#define TIOCPKT_STOP 4
-#define TIOCPKT_START 8
-#define TIOCPKT_NOSTOP 16
-#define TIOCPKT_DOSTOP 32
-
-/* Socket-level I/O control calls. */
-#define FIOSETOWN 0x8901
-#define SIOCSPGRP 0x8902
-#define FIOGETOWN 0x8903
-#define SIOCGPGRP 0x8904
-#define SIOCATMARK 0x8905
-#define SIOCGSTAMP 0x8906 /* Get stamp */
-
diff --git a/mdk-stage1/dietlibc/include/sys/stat.h b/mdk-stage1/dietlibc/include/sys/stat.h
deleted file mode 100644
index d31cbd1f2..000000000
--- a/mdk-stage1/dietlibc/include/sys/stat.h
+++ /dev/null
@@ -1,516 +0,0 @@
-#ifndef _SYS_STAT_H
-#define _SYS_STAT_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <endian.h>
-
-#if defined(__i386__)
-struct stat {
- unsigned short st_dev;
- unsigned short __pad1;
- unsigned long st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned short __pad2;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- signed long st_atime;
- unsigned long __unused1;
- signed long st_mtime;
- unsigned long __unused2;
- signed long st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-
-struct stat64 {
- unsigned short st_dev;
- unsigned char __pad0[10];
-
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
-
- unsigned int st_mode;
- unsigned int st_nlink;
-
- unsigned long st_uid;
- unsigned long st_gid;
-
- unsigned short st_rdev;
- unsigned char __pad3[10];
-
-__extension__ long long st_size;
- unsigned long st_blksize;
-
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __pad4; /* future possible st_blocks high bits */
-
- unsigned long st_atime;
- unsigned long __pad5;
-
- signed long st_mtime;
- unsigned long __pad6;
-
- unsigned long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
-
-__extension__ unsigned long long st_ino;
-};
-#elif defined(__sparc__)
-struct stat {
- unsigned short st_dev;
- unsigned long st_ino;
- unsigned short st_mode;
- short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- long st_size;
- long st_atime;
- unsigned long __unused1;
- long st_mtime;
- unsigned long __unused2;
- long st_ctime;
- unsigned long __unused3;
- long st_blksize;
- long st_blocks;
- unsigned long __unused4[2];
-};
-
-struct stat64 {
- unsigned char __pad0[6];
- unsigned short st_dev;
-
-__extension__ unsigned long long st_ino;
-
- unsigned int st_mode;
- unsigned int st_nlink;
-
- unsigned int st_uid;
- unsigned int st_gid;
-
- unsigned char __pad2[6];
- unsigned short st_rdev;
-
- unsigned char __pad3[8];
-
-__extension__ long long st_size;
- unsigned int st_blksize;
-
- unsigned char __pad4[8];
- unsigned int st_blocks;
-
- signed int st_atime;
- unsigned int __unused1;
-
- signed int st_mtime;
- unsigned int __unused2;
-
- signed int st_ctime;
- unsigned int __unused3;
-
- unsigned int __unused4;
- unsigned int __unused5;
-};
-#elif defined(__alpha__)
-struct stat {
- unsigned int st_dev;
- unsigned int st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int st_rdev;
- long st_size;
- signed long st_atime;
- signed long st_mtime;
- signed long st_ctime;
- unsigned int st_blksize;
- int st_blocks;
- unsigned int st_flags;
- unsigned int st_gen;
-};
-#elif defined(__mips__)
-struct stat {
- unsigned int st_dev;
- long st_pad1[3]; /* Reserved for network id */
- ino_t st_ino;
- unsigned int st_mode;
- int st_nlink;
- int st_uid;
- int st_gid;
- unsigned int st_rdev;
- long st_pad2[2];
- long st_size;
- long st_pad3;
- /*
- * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
- * but we don't have it under Linux.
- */
- time_t st_atime;
- long reserved0;
- time_t st_mtime;
- long reserved1;
- time_t st_ctime;
- long reserved2;
- long st_blksize;
- long st_blocks;
- char st_fstype[16]; /* Filesystem type name */
- long st_pad4[8];
- /* Linux specific fields */
- unsigned int st_flags;
- unsigned int st_gen;
-};
-
-struct stat64 {
- unsigned long st_dev;
- unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
-__extension__ unsigned long long st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned long st_rdev;
- unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
-__extension__ long long st_size;
- /*
- * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
- * but we don't have it under Linux.
- */
- time_t st_atime;
- unsigned long reserved0; /* Reserved for st_atime expansion */
- time_t st_mtime;
- unsigned long reserved1; /* Reserved for st_atime expansion */
- time_t st_ctime;
- unsigned long reserved2; /* Reserved for st_atime expansion */
- unsigned long st_blksize;
- unsigned long st_pad2;
-__extension__ long long st_blocks;
-};
-#elif defined(__powerpc__)
-struct stat {
- dev_t st_dev;
- ino_t st_ino;
- mode_t st_mode;
- nlink_t st_nlink;
- uid_t st_uid;
- gid_t st_gid;
- dev_t st_rdev;
- off_t st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- signed long st_atime;
- unsigned long __unused1;
- signed long st_mtime;
- unsigned long __unused2;
- signed long st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1.
- */
-struct stat64 {
-__extension__ unsigned long long st_dev; /* Device. */
-__extension__ unsigned long long st_ino; /* File serial number. */
- unsigned int st_mode; /* File mode. */
- unsigned int st_nlink; /* Link count. */
- unsigned int st_uid; /* User ID of the file's owner. */
- unsigned int st_gid; /* Group ID of the file's group. */
-__extension__ unsigned long long st_rdev; /* Device number, if device. */
- unsigned short int __pad2;
-__extension__ long long st_size; /* Size of file, in bytes. */
- long st_blksize; /* Optimal block size for I/O. */
-
-__extension__ long long st_blocks; /* Number 512-byte blocks allocated. */
- long st_atime; /* Time of last access. */
- unsigned long int __unused1;
- long st_mtime; /* Time of last modification. */
- unsigned long int __unused2;
- long st_ctime; /* Time of last status change. */
- unsigned long int __unused3;
- unsigned long int __unused4;
- unsigned long int __unused5;
-};
-#elif defined(__arm__)
-struct stat {
- unsigned short st_dev;
- unsigned short __pad1;
- unsigned long st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned short __pad2;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- signed long st_atime;
- unsigned long __unused1;
- signed long st_mtime;
- unsigned long __unused2;
- signed long st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
- unsigned short st_dev;
- unsigned char __pad0[10];
-
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
-
- unsigned long st_uid;
- unsigned long st_gid;
-
- unsigned short st_rdev;
- unsigned char __pad3[10];
-
-__extension__ long long st_size;
- unsigned long st_blksize;
-
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __pad4; /* future possible st_blocks high bits */
-
- signed long st_atime;
- unsigned long __pad5;
-
- signed long st_mtime;
- unsigned long __pad6;
-
- signed long st_ctime;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
-
-__extension__ unsigned long long st_ino;
-};
-#elif defined(__s390__)
-struct stat {
- unsigned short st_dev;
- unsigned short __pad1;
- unsigned long st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned short __pad2;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __unused1;
- unsigned long st_mtime;
- unsigned long __unused2;
- unsigned long st_ctime;
- unsigned long __unused3;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-struct stat64 {
- unsigned char __pad0[6];
- unsigned short st_dev;
- unsigned int __pad1;
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
- unsigned long st_uid;
- unsigned long st_gid;
- unsigned char __pad2[6];
- unsigned short st_rdev;
- unsigned int __pad3;
-__extension__ long long st_size;
- unsigned long st_blksize;
- unsigned char __pad4[4];
- unsigned long __pad5; /* future possible st_blocks high bits */
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long st_atime;
- unsigned long __pad6;
- unsigned long st_mtime;
- unsigned long __pad7;
- unsigned long st_ctime;
- unsigned long __pad8; /* will be high 32 bits of ctime someday */
-__extension__ unsigned long long st_ino;
-};
-
-#elif defined(__hppa__)
-
-struct stat {
- unsigned long long st_dev;
- unsigned short int _pad1;
- unsigned long st_ino;
- unsigned long st_mode;
- unsigned long st_nlink;
- unsigned long st_uid;
- unsigned long st_gid;
- unsigned long long st_rdev;
- unsigned short int _pad2;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long int unused1;
- unsigned long st_mtime;
- unsigned long int unused2;
- unsigned long st_ctime;
- unsigned long int unused3;
- unsigned long long unused4;
-};
-
-struct stat64 {
- unsigned long long st_dev;
- unsigned int __pad1;
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
- unsigned long st_mode;
- unsigned long st_nlink;
- unsigned long st_uid;
- unsigned long st_gid;
- unsigned long long st_rdev;
- unsigned int __pad2;
- unsigned long long st_size;
- unsigned long long st_blksize;
-
- unsigned long long st_blocks;
- unsigned long st_atime;
- unsigned long int __unused1;
- unsigned long st_mtime;
- unsigned long int __unused2;
- unsigned long st_ctime;
- unsigned long int __unused3;
- unsigned long long st_ino;
-};
-
-#elif defined(__x86_64__)
-struct stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned long st_nlink;
- unsigned int st_mode;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int __pad0;
- unsigned long st_rdev;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime;
- unsigned long __reserved0;
- unsigned long st_mtime;
- unsigned long __reserved1;
- unsigned long st_ctime;
- unsigned long __reserved2;
- long __unused[3];
-};
-
-#elif defined(__ia64__)
-
-struct stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned long st_nlink;
- unsigned int st_mode;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int __pad;
- unsigned long st_rdev;
- unsigned long st_size;
- unsigned long st_atime;
- unsigned long reserved;
- unsigned long st_mtime;
- unsigned long reserved2;
- unsigned long st_ctime;
- unsigned long reserved3;
- unsigned long st_blksize;
- long st_blocks;
- unsigned long pad[3];
-};
-
-#endif
-
-#define S_IFMT 00170000
-#define S_IFSOCK 0140000
-#define S_IFLNK 0120000
-#define S_IFREG 0100000
-#define S_IFBLK 0060000
-#define S_IFDIR 0040000
-#define S_IFCHR 0020000
-#define S_IFIFO 0010000
-#define S_ISUID 0004000
-#define S_ISGID 0002000
-#define S_ISVTX 0001000
-
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
-#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
-#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
-
-#define S_IRWXU 00700
-#define S_IRUSR 00400
-#define S_IWUSR 00200
-#define S_IXUSR 00100
-
-#define S_IRWXG 00070
-#define S_IRGRP 00040
-#define S_IWGRP 00020
-#define S_IXGRP 00010
-
-#define S_IRWXO 00007
-#define S_IROTH 00004
-#define S_IWOTH 00002
-#define S_IXOTH 00001
-
-extern int stat(const char *__file, struct stat *__buf) __THROW;
-extern int fstat(int __fd, struct stat *__buf) __THROW;
-extern int lstat(const char *__file, struct stat *__buf) __THROW;
-
-#if __WORDSIZE == 64
-#define __NO_STAT64
-#else
-extern int stat64(const char *__file, struct stat64 *__buf) __THROW;
-extern int fstat64(int __fd, struct stat64 *__buf) __THROW;
-extern int lstat64(const char *__file, struct stat64 *__buf) __THROW;
-
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-#define lstat lstat64
-#define fstat fstat64
-#define stat stat64
-#define pread pread64
-#define pwrite pwrite64
-#endif
-#endif
-
-#define major(dev) (((dev)>>8) & 0xff)
-#define minor(dev) ((dev) & 0xff)
-#define makedev(major, minor) ((((unsigned int) (major)) << 8) | ((unsigned int) (minor)))
-
-extern int chmod (const char *__file, mode_t __mode) __THROW;
-extern int fchmod (int __fd, mode_t __mode) __THROW;
-extern mode_t umask (mode_t __mask) __THROW;
-extern int mkdir (const char *__path, mode_t __mode) __THROW;
-extern int mknod (const char *__path, mode_t __mode, dev_t __dev) __THROW;
-extern int mkfifo (const char *__path, mode_t __mode) __THROW;
-
-#define S_IREAD S_IRUSR
-#define S_IWRITE S_IWUSR
-#define S_IEXEC S_IXUSR
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/syscall.h b/mdk-stage1/dietlibc/include/sys/syscall.h
deleted file mode 100644
index 5d6b5a4ad..000000000
--- a/mdk-stage1/dietlibc/include/sys/syscall.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _SYSCALL_H
-#define _SYSCALL_H
-
-#include <asm/unistd.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/sysinfo.h b/mdk-stage1/dietlibc/include/sys/sysinfo.h
deleted file mode 100644
index cf88be34c..000000000
--- a/mdk-stage1/dietlibc/include/sys/sysinfo.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _SYS_SYSINFO_H
-#define _SYS_SYSINFO_H
-
-#include <sys/cdefs.h>
-
-#define SI_LOAD_SHIFT 16
-struct sysinfo {
- long uptime; /* Seconds since boot */
- unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
- unsigned long totalram; /* Total usable main memory size */
- unsigned long freeram; /* Available memory size */
- unsigned long sharedram; /* Amount of shared memory */
- unsigned long bufferram; /* Memory used by buffers */
- unsigned long totalswap; /* Total swap space size */
- unsigned long freeswap; /* swap space still available */
- unsigned short procs; /* Number of current processes */
- unsigned short pad; /* explicit padding */
- unsigned long totalhigh; /* Total high memory size */
- unsigned long freehigh; /* Available high memory size */
- unsigned int mem_unit; /* Memory unit size in bytes */
- char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
-};
-
-
-int sysinfo(struct sysinfo *info) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/syslog.h b/mdk-stage1/dietlibc/include/sys/syslog.h
deleted file mode 100644
index 8722038a5..000000000
--- a/mdk-stage1/dietlibc/include/sys/syslog.h
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef _SYS_SYSLOG_H
-#define _SYS_SYSLOG_H 1
-
-#include <sys/cdefs.h>
-#include <stdarg.h>
-
-#define _PATH_LOG "/dev/log"
-
-/*
- * priorities/facilities are encoded into a single 32-bit quantity, where the
- * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility
- * (0-big number). Both the priorities and the facilities map roughly
- * one-to-one to strings in the syslogd(8) source code. This mapping is
- * included in this file.
- *
- * priorities (these are ordered)
- */
-#define LOG_EMERG 0 /* system is unusable */
-#define LOG_ALERT 1 /* action must be taken immediately */
-#define LOG_CRIT 2 /* critical conditions */
-#define LOG_ERR 3 /* error conditions */
-#define LOG_WARNING 4 /* warning conditions */
-#define LOG_NOTICE 5 /* normal but significant condition */
-#define LOG_INFO 6 /* informational */
-#define LOG_DEBUG 7 /* debug-level messages */
-
-#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
- /* extract priority */
-#define LOG_PRI(p) ((p) & LOG_PRIMASK)
-#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
-
-/* facility codes */
-#define LOG_KERN (0<<3) /* kernel messages */
-#define LOG_USER (1<<3) /* random user-level messages */
-#define LOG_MAIL (2<<3) /* mail system */
-#define LOG_DAEMON (3<<3) /* system daemons */
-#define LOG_AUTH (4<<3) /* security/authorization messages */
-#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
-#define LOG_LPR (6<<3) /* line printer subsystem */
-#define LOG_NEWS (7<<3) /* network news subsystem */
-#define LOG_UUCP (8<<3) /* UUCP subsystem */
-#define LOG_CRON (9<<3) /* clock daemon */
-#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
-#define LOG_FTP (11<<3) /* ftp daemon */
-
- /* other codes through 15 reserved for system use */
-#define LOG_LOCAL0 (16<<3) /* reserved for local use */
-#define LOG_LOCAL1 (17<<3) /* reserved for local use */
-#define LOG_LOCAL2 (18<<3) /* reserved for local use */
-#define LOG_LOCAL3 (19<<3) /* reserved for local use */
-#define LOG_LOCAL4 (20<<3) /* reserved for local use */
-#define LOG_LOCAL5 (21<<3) /* reserved for local use */
-#define LOG_LOCAL6 (22<<3) /* reserved for local use */
-#define LOG_LOCAL7 (23<<3) /* reserved for local use */
-
-#define LOG_NFACILITIES 24 /* current number of facilities */
-#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
- /* facility of pri */
-#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
-
-/*
- * arguments to setlogmask.
- */
-#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
-#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
-
-/*
- * Option flags for openlog.
- *
- * LOG_ODELAY no longer does anything.
- * LOG_NDELAY is the inverse of what it used to be.
- */
-#define LOG_PID 0x01 /* log the pid with each message */
-#define LOG_CONS 0x02 /* log on the console if errors in sending */
-#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
-#define LOG_NDELAY 0x08 /* don't delay open */
-#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
-#define LOG_PERROR 0x20 /* log to stderr as well */
-
-/* Open connection to system logger. */
-/* against the glibc-routine ident has not to be const ! */
-/* instead ident is limited to 80 characters ! */
-void openlog (const char *ident, int option, int facility);
-
-void closelog (void) __THROW;
-
-int setlogmask (int mask) __THROW;
-
-void syslog (int priority, const char *format, ...) __THROW;
-
-void vsyslog (int priority, const char *format, va_list arg_ptr) __THROW;
-
-/* yuck yuck yuck, only needed for syslogd. */
-typedef struct _code {
- const char *const c_name;
- int c_val;
-} CODE;
-
-extern CODE prioritynames[];
-extern CODE facilitynames[];
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/sysmacros.h b/mdk-stage1/dietlibc/include/sys/sysmacros.h
deleted file mode 100644
index 8a8124131..000000000
--- a/mdk-stage1/dietlibc/include/sys/sysmacros.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _SYSMACROS_H
-#define _SYSMACROS_H
-
-#include <sys/stat.h>
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/time.h b/mdk-stage1/dietlibc/include/sys/time.h
deleted file mode 100644
index 9fc40089f..000000000
--- a/mdk-stage1/dietlibc/include/sys/time.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef _SYS_TIME_H
-#define _SYS_TIME_H 1
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/select.h>
-
-struct timespec {
- time_t tv_sec; /* seconds */
- long tv_nsec; /* nanoseconds */
-};
-
-struct timeval {
- time_t tv_sec; /* seconds */
- suseconds_t tv_usec; /* microseconds */
-};
-
-struct timezone {
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-
-#define ITIMER_REAL 0
-#define ITIMER_VIRTUAL 1
-#define ITIMER_PROF 2
-
-struct itimerspec {
- struct timespec it_interval; /* timer period */
- struct timespec it_value; /* timer expiration */
-};
-
-struct itimerval {
- struct timeval it_interval; /* timer interval */
- struct timeval it_value; /* current value */
-};
-
-#if defined _GNU_SOURCE || defined _BSD_SOURCE
-typedef struct timezone *__timezone_ptr_t;
-#else
-typedef void *__timezone_ptr_t;
-#endif
-
-int getitimer(int which, struct itimerval *value) __THROW;
-int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) __THROW;
-
-int gettimeofday(struct timeval *tv, struct timezone *tz) __THROW;
-int settimeofday(const struct timeval *tv , const struct timezone *tz) __THROW;
-
-extern int utimes (const char *__file, const struct timeval __tvp[2]) __THROW;
-
-extern int adjtime (const struct timeval *delta, struct timeval *olddelta) __THROW;
-
-struct tm {
- int tm_sec; /* Seconds. [0-60] (1 leap second) */
- int tm_min; /* Minutes. [0-59] */
- int tm_hour; /* Hours. [0-23] */
- int tm_mday; /* Day. [1-31] */
- int tm_mon; /* Month. [0-11] */
- int tm_year; /* Year - 1900. */
- int tm_wday; /* Day of week. [0-6] */
- int tm_yday; /* Days in year.[0-365] */
- int tm_isdst; /* DST. [-1/0/1]*/
-
- long int tm_gmtoff; /* Seconds east of UTC. */
- const char *tm_zone; /* Timezone abbreviation. */
-};
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/timeb.h b/mdk-stage1/dietlibc/include/sys/timeb.h
deleted file mode 100644
index ceed377e7..000000000
--- a/mdk-stage1/dietlibc/include/sys/timeb.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __SYS_TIMEB_H
-#define __SYS_TIMEB_H 1
-
-struct timeb {
- time_t time;
- unsigned short millitm;
- short timezone;
- short dstflag;
-};
-
-int ftime(struct timeb *tp);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/times.h b/mdk-stage1/dietlibc/include/sys/times.h
deleted file mode 100644
index 27f75cdc5..000000000
--- a/mdk-stage1/dietlibc/include/sys/times.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _SYS_TIMES_H
-#define _SYS_TIMES_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct tms {
- clock_t tms_utime;
- clock_t tms_stime;
- clock_t tms_cutime;
- clock_t tms_cstime;
-};
-
-clock_t times(struct tms *buf) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/timex.h b/mdk-stage1/dietlibc/include/sys/timex.h
deleted file mode 100644
index cf024e009..000000000
--- a/mdk-stage1/dietlibc/include/sys/timex.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _SYS_TIMEX_H
-#define _SYS_TIMEX_H
-
-struct timex {
- unsigned int modes; /* mode selector */
- long int offset; /* time offset (usec) */
- long int freq; /* frequency offset (scaled ppm) */
- long int maxerror; /* maximum error (usec) */
- long int esterror; /* estimated error (usec) */
- int status; /* clock command/status */
- long int constant; /* pll time constant */
- long int precision; /* clock precision (usec) (read only) */
- long int tolerance; /* clock frequency tolerance (ppm) (read only) */
- struct timeval time; /* (read only) */
- long int tick; /* (modified) usecs between clock ticks */
-
- long int ppsfreq; /* pps frequency (scaled ppm) (ro) */
- long int jitter; /* pps jitter (us) (ro) */
- int shift; /* interval duration (s) (shift) (ro) */
- long int stabil; /* pps stability (scaled ppm) (ro) */
- long int jitcnt; /* jitter limit exceeded (ro) */
- long int calcnt; /* calibration intervals (ro) */
- long int errcnt; /* calibration errors (ro) */
- long int stbcnt; /* stability limit exceeded (ro) */
-
- /* ??? */
- int :32; int :32; int :32; int :32;
- int :32; int :32; int :32; int :32;
- int :32; int :32; int :32; int :32;
-};
-
-#define ADJ_OFFSET 0x0001 /* time offset */
-#define ADJ_FREQUENCY 0x0002 /* frequency offset */
-#define ADJ_MAXERROR 0x0004 /* maximum time error */
-#define ADJ_ESTERROR 0x0008 /* estimated time error */
-#define ADJ_STATUS 0x0010 /* clock status */
-#define ADJ_TIMECONST 0x0020 /* pll time constant */
-#define ADJ_TICK 0x4000 /* tick value */
-#define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */
-
-#define TIME_OK 0 /* clock synchronized */
-#define TIME_INS 1 /* insert leap second */
-#define TIME_DEL 2 /* delete leap second */
-#define TIME_OOP 3 /* leap second in progress */
-#define TIME_WAIT 4 /* leap second has occurred */
-#define TIME_BAD 5 /* clock not synchronized */
-
-int adjtimex(struct timex *buf);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/types.h b/mdk-stage1/dietlibc/include/sys/types.h
deleted file mode 100644
index a3d2bf4be..000000000
--- a/mdk-stage1/dietlibc/include/sys/types.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef _SYS_TYPES_H
-#define _SYS_TYPES_H
-
-#include <inttypes.h>
-#include <stddef.h>
-
-typedef unsigned long int blkcnt_t; /* Used for file block counts */
-typedef unsigned long int blksize_t; /* Used for block sizes */
-typedef unsigned long int clock_t; /* Used for system times in
- clock ticks or CLOCKS_PER_SEC
- (see <time.h>). */
-
-/* TODO:
- clockid_t
- Used for clock ID type in the clock and timer functions.
- fsblkcnt_t
- Used for file system block counts
- fsfilcnt_t
- Used for file system file counts
- pthread_attr_t
- Used to identify a thread attribute object.
- pthread_cond_t
- Used for condition variables.
- pthread_condattr_t
- Used to identify a condition attribute object.
- pthread_key_t
- Used for thread-specific data keys.
- pthread_mutex_t
- Used for mutexes.
- pthread_mutexattr_t
- Used to identify a mutex attribute object.
- pthread_once_t
- Used for dynamic package initialisation.
- pthread_rwlock_t
- Used for read-write locks.
- pthread_rwlockattr_t
- Used for read-write lock attributes.
- pthread_t
- Used to identify a thread.
- timer_t
- Used for timer ID returned by timer_create().
-*/
-
-#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__hppa__) || defined(__sparc64__) \
- || defined(__x86_64__) || defined(__ia64__)
-typedef unsigned int uid_t; /* Used for user IDs. */
-typedef unsigned int gid_t; /* Used for group IDs. */
-typedef unsigned int dev_t; /* Used for device IDs. */
-#else
-typedef unsigned short uid_t; /* Used for user IDs. */
-typedef unsigned short gid_t; /* Used for group IDs. */
-typedef unsigned short dev_t; /* Used for device IDs. */
-#endif
-
-#if defined(__alpha__) || defined(__mips__) || defined(__powerpc__) || defined(__sparc64__) \
- || defined(__x86_64__) || defined(__ia64__)
-typedef unsigned int mode_t; /* Used for some file attributes. */
-#else
-typedef unsigned short mode_t; /* Used for some file attributes. */
-#endif
-
-#if defined(__alpha__) || defined(__mips__) || defined(__sparc64__) \
- || defined(__x86_64__) || defined(__ia64__)
-typedef unsigned int nlink_t; /* Used for link counts. */
-#else
-typedef unsigned short nlink_t; /* Used for link counts. */
-#endif
-
-typedef signed int id_t; /* Used as a general identifier; can be
- used to contain at least a pid_t,
- uid_t or a gid_t. */
-typedef unsigned long ino_t; /* Used for file serial numbers. */
-typedef signed int key_t; /* Used for interprocess communication. */
-typedef signed int pid_t; /* Used for process IDs and process group IDs. */
-typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */
-typedef signed long suseconds_t; /* Used for time in microseconds. */
-typedef signed long time_t; /* Used for time in seconds. */
-typedef signed long useconds_t; /* Used for time in microseconds. */
-
-/* non-susv2 types: */
-__extension__ typedef signed long long loff_t; /* 64-bit offset */
-
-__extension__ typedef signed long long off64_t;
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-typedef off64_t off_t;
-#else
-typedef signed long off_t; /* Used for file sizes. */
-#endif
-
-__extension__ typedef unsigned long long ino64_t;
-__extension__ typedef signed long long blkcnt64_t;
-
-typedef uint32_t uid32_t;
-typedef uint32_t gid32_t;
-
-typedef long int fpos_t;
-
-#define __socklen_t_defined
-typedef unsigned int socklen_t;
-typedef unsigned short sa_family_t;
-
-#ifdef _BSD_SOURCE
-/* die, BSD, die! */
-typedef uint16_t nshort;
-typedef uint32_t ntime;
-typedef uint32_t nlong;
-typedef uint32_t ulong;
-typedef uint16_t n_short;
-typedef uint32_t n_time;
-typedef uint32_t n_long;
-# ifndef __dietlibc_u_char_defined
-typedef char* caddr_t;
-typedef uint32_t u_long;
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-typedef unsigned int u_int;
-# define __dietlibc_u_char_defined
-# endif
-typedef unsigned char uchar;
-typedef unsigned short ushort;
-typedef unsigned int uint;
-#endif
-
-#ifdef _GNU_SOURCE
-typedef uint8_t u_int8_t;
-typedef uint16_t u_int16_t;
-typedef uint32_t u_int32_t;
-#ifndef __STRICT_ANSI__
-typedef uint64_t u_int64_t;
-#endif
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/ucontext.h b/mdk-stage1/dietlibc/include/sys/ucontext.h
deleted file mode 100644
index 573c6c7fb..000000000
--- a/mdk-stage1/dietlibc/include/sys/ucontext.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H
-
-#include <asm/sigcontext.h>
-#include <signal.h>
-
-typedef struct sigcontext mcontext_t;
-
-#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__mips64__) || defined(__powerpc__) || defined(__hppa__)
-struct ucontext {
- unsigned long uc_flags;
- struct ucontext *uc_link;
- stack_t uc_stack;
- struct sigcontext uc_mcontext;
- sigset_t uc_sigmask; /* mask last for extensibility */
-};
-#elif defined(__alpha__)
-struct ucontext {
- unsigned long uc_flags;
- struct ucontext *uc_link;
- unsigned long uc_osf_sigmask;
- stack_t uc_stack;
- struct sigcontext uc_mcontext;
- sigset_t uc_sigmask; /* mask last for extensibility */
-};
-#elif defined(__sparc__) || defined(__sparc64__)
-
-#define MC_TSTATE 0
-#define MC_PC 1
-#define MC_NPC 2
-#define MC_Y 3
-#define MC_G1 4
-#define MC_G2 5
-#define MC_G3 6
-#define MC_G4 7
-#define MC_G5 8
-#define MC_G6 9
-#define MC_G7 10
-#define MC_O0 11
-#define MC_O1 12
-#define MC_O2 13
-#define MC_O3 14
-#define MC_O4 15
-#define MC_O5 16
-#define MC_O6 17
-#define MC_O7 18
-#define MC_NGREG 19
-
-typedef unsigned long mc_greg_t;
-typedef mc_greg_t mc_gregset_t[MC_NGREG];
-
-#define MC_MAXFPQ 16
-struct mc_fq {
- unsigned long *mcfq_addr;
- unsigned int mcfq_insn;
-};
-
-typedef struct mc_fpu {
- union {
- unsigned int sregs[32];
- unsigned long dregs[32];
- long double qregs[16];
- } mcfpu_fregs;
- unsigned long mcfpu_fsr;
- unsigned long mcfpu_fprs;
- unsigned long mcfpu_gsr;
- struct mc_fq *mcfpu_fq;
- unsigned char mcfpu_qcnt;
- unsigned char mcfpu_qentsz;
- unsigned char mcfpu_enab;
-} mc_fpu_t;
-
-typedef struct {
- mc_gregset_t mc_gregs;
- mc_greg_t mc_fp;
- mc_greg_t mc_i7;
- mc_fpu_t mc_fpregs;
-} mcontext_t;
-
-struct ucontext {
- struct ucontext *uc_link;
- unsigned long uc_flags;
- sigset_t uc_sigmask;
- mcontext_t uc_mcontext;
-};
-#elif defined(__s390__)
-struct ucontext {
- unsigned long uc_flags;
- struct ucontext *uc_link;
- stack_t uc_stack;
- _sigregs uc_mcontext;
- sigset_t uc_sigmask; /* mask last for extensibility */
-};
-#elif defined(__ia64__)
-
-/* oh my god is this ugly! --fefe*/
-struct ucontext {
- struct sigcontext uc_mcontext;
-};
-
-#define uc_link uc_mcontext.sc_gr[0] /* wrong type; nobody cares */
-#define uc_sigmask uc_mcontext.sc_sigmask
-#define uc_stack uc_mcontext.sc_stack
-#else
-#error NEED TO PORT <sys/sigcontext.h>!
-#endif
-
-typedef struct ucontext ucontext_t;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/uio.h b/mdk-stage1/dietlibc/include/sys/uio.h
deleted file mode 100644
index 5edbdc8b2..000000000
--- a/mdk-stage1/dietlibc/include/sys/uio.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _SYS_UIO
-#define _SYS_UIO 1
-
-#include <sys/socket.h>
-
-int readv(int filedes, const struct iovec *vector, size_t count);
-int writev(int filedes, const struct iovec *vector, size_t count);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/un.h b/mdk-stage1/dietlibc/include/sys/un.h
deleted file mode 100644
index 000a937c1..000000000
--- a/mdk-stage1/dietlibc/include/sys/un.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _SYS_UN_H
-#define _SYS_UN_H
-
-#include <sys/cdefs.h>
-
-#define UNIX_PATH_MAX 108
-
-struct sockaddr_un {
- sa_family_t sun_family; /* AF_UNIX */
- char sun_path[UNIX_PATH_MAX]; /* pathname */
-};
-
-#endif /* sys/un.h */
diff --git a/mdk-stage1/dietlibc/include/sys/utsname.h b/mdk-stage1/dietlibc/include/sys/utsname.h
deleted file mode 100644
index 37bf6c811..000000000
--- a/mdk-stage1/dietlibc/include/sys/utsname.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _SYS_UTSNAME_H
-#define _SYS_UTSNAME_H 1
-
-#include <sys/cdefs.h>
-
-/* Length of the entries in `struct utsname' is 65. */
-#define _UTSNAME_LENGTH 65
-#define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
-
-/* Linux provides as additional information in the `struct utsname'
- the name of the current domain. Define _UTSNAME_DOMAIN_LENGTH
- to a value != 0 to activate this entry. */
-#define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
-
-struct utsname {
- /* Name of the implementation of the operating system. */
- char sysname[_UTSNAME_LENGTH];
-
- /* Name of this node on the network. */
- char nodename[_UTSNAME_NODENAME_LENGTH];
-
- /* Current release level of this implementation. */
- char release[_UTSNAME_LENGTH];
- /* Current version level of this release. */
- char version[_UTSNAME_LENGTH];
-
- /* Name of the hardware type the system is running on. */
- char machine[_UTSNAME_LENGTH];
-
- /* Name of the domain of this node on the network. */
- char domainname[_UTSNAME_DOMAIN_LENGTH];
-};
-
-extern int uname (struct utsname *__name) __THROW;
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/vfs.h b/mdk-stage1/dietlibc/include/sys/vfs.h
deleted file mode 100644
index 19b3242bb..000000000
--- a/mdk-stage1/dietlibc/include/sys/vfs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _SYS_VFS_H
-#define _SYS_VFS_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-typedef struct {
- int __val[2];
-} __kernel_fsid_t;
-
-struct statfs {
- long f_type;
- long f_bsize;
-#ifdef __mips__
- long f_frsize;
-#endif
- long f_blocks;
- long f_bfree;
-#ifndef __mips__
- long f_bavail;
-#endif
- long f_files;
- long f_ffree;
-#ifdef __mips__
- long f_bavail;
-#endif
- __kernel_fsid_t f_fsid;
- long f_namelen;
- long f_spare[6];
-};
-
-int statfs(const char *path, struct statfs *buf) __THROW;
-int fstatfs(int fd, struct statfs *buf) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sys/wait.h b/mdk-stage1/dietlibc/include/sys/wait.h
deleted file mode 100644
index 0ba55499e..000000000
--- a/mdk-stage1/dietlibc/include/sys/wait.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _SYS_WAIT_H
-#define _SYS_WAIT_H
-
-#include <sys/cdefs.h>
-#include <sys/resource.h>
-
-#define WNOHANG 0x00000001
-#define WUNTRACED 0x00000002
-
-#define __WNOTHREAD 0x20000000 /* Don't wait on children of other threads in this group */
-#define __WALL 0x40000000 /* Wait on all children, regardless of type */
-#define __WCLONE 0x80000000 /* Wait only on non-SIGCHLD children */
-
-/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
-#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
-#define WEXITSTATUS __WEXITSTATUS
-
-/* If WIFSIGNALED(STATUS), the terminating signal. */
-#define __WTERMSIG(status) ((status) & 0x7f)
-#define WTERMSIG __WTERMSIG
-
-/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
-#define __WSTOPSIG(status) __WEXITSTATUS(status)
-#define WSTOPSIG __WSTOPSIG
-
-/* Nonzero if STATUS indicates normal termination. */
-#define WIFEXITED(status) (__WTERMSIG(status) == 0)
-
-/* Nonzero if STATUS indicates termination by a signal. */
-#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status))
-
-/* Nonzero if STATUS indicates the child is stopped. */
-#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
-
-/* Nonzero if STATUS indicates the child dumped core. */
-#define WCOREDUMP(status) ((status) & 0x80)
-
-pid_t wait(int *status) __THROW;
-pid_t waitpid(pid_t pid, int *status, int options) __THROW;
-
-pid_t wait3(int *status, int options, struct rusage *rusage) __THROW;
-
-pid_t wait4(pid_t pid, int *status, int options, struct rusage *rusage) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/sysexits.h b/mdk-stage1/dietlibc/include/sysexits.h
deleted file mode 100644
index 5540795ff..000000000
--- a/mdk-stage1/dietlibc/include/sysexits.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _SYSEXITS_H
-#define _SYSEXITS_H 1
-
-#define EX_OK 0
-
-#define EX__BASE 64
-
-#define EX_USAGE 64
-#define EX_DATAERR 65
-#define EX_NOINPUT 66
-#define EX_NOUSER 67
-#define EX_NOHOST 68
-#define EX_UNAVAILABLE 69
-#define EX_SOFTWARE 70
-#define EX_OSERR 71
-#define EX_OSFILE 72
-#define EX_CANTCREAT 73
-#define EX_IOERR 74
-#define EX_TEMPFAIL 75
-#define EX_PROTOCOL 76
-#define EX_NOPERM 77
-#define EX_CONFIG 78
-
-#define EX__MAX 78
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/syslog.h b/mdk-stage1/dietlibc/include/syslog.h
deleted file mode 100644
index 830b4928a..000000000
--- a/mdk-stage1/dietlibc/include/syslog.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <sys/syslog.h>
diff --git a/mdk-stage1/dietlibc/include/tar.h b/mdk-stage1/dietlibc/include/tar.h
deleted file mode 100644
index a78bbce54..000000000
--- a/mdk-stage1/dietlibc/include/tar.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _TAR_H_
-#define _TAR_H_
-
-#define TMAGIC "ustar"
-#define TVERSION "00"
-
-#define TMAGLEN 6
-#define TVERSLEN 2
-
-#define REGTYPE '0'
-#define AREGTYPE '\0'
-#define LNKTYPE '1'
-#define SYMTYPE '2'
-#define CHRTYPE '3'
-#define BLKTYPE '4'
-#define DIRTYPE '5'
-#define FIFOTYPE '6'
-#define CONTTYPE '7'
-
-#define TSUID 04000
-#define TSGID 02000
-#define TSVTX 01000
-
-#define TUREAD 00400
-#define TUWRITE 00200
-#define TUEXEC 00100
-
-#define TGREAD 00040
-#define TGWRITE 00020
-#define TGEXEC 00010
-
-#define TOREAD 00004
-#define TOWRITE 00002
-#define TOEXEC 00001
-
-#endif /* _TAR_H_ */
diff --git a/mdk-stage1/dietlibc/include/termio.h b/mdk-stage1/dietlibc/include/termio.h
deleted file mode 100644
index 55d1f242b..000000000
--- a/mdk-stage1/dietlibc/include/termio.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* this looks horribly wrong, but glibc does it like that */
-
-#include <termios.h>
-#include <sys/ioctl.h>
diff --git a/mdk-stage1/dietlibc/include/termios.h b/mdk-stage1/dietlibc/include/termios.h
deleted file mode 100644
index 12e02c5d7..000000000
--- a/mdk-stage1/dietlibc/include/termios.h
+++ /dev/null
@@ -1,383 +0,0 @@
-#ifndef _TERMIOS_H
-#define _TERMIOS_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-struct winsize {
- unsigned short ws_row;
- unsigned short ws_col;
- unsigned short ws_xpixel;
- unsigned short ws_ypixel;
-};
-
-#define NCC 8
-struct termio {
- unsigned short c_iflag; /* input mode flags */
- unsigned short c_oflag; /* output mode flags */
- unsigned short c_cflag; /* control mode flags */
- unsigned short c_lflag; /* local mode flags */
- unsigned char c_line; /* line discipline */
- unsigned char c_cc[NCC]; /* control characters */
-};
-
-/* modem lines */
-#ifdef __mips__
-#define TIOCM_LE 0x001
-#define TIOCM_DTR 0x002
-#define TIOCM_RTS 0x004
-#define TIOCM_ST 0x010
-#define TIOCM_SR 0x020
-#define TIOCM_CTS 0x040
-#define TIOCM_CAR 0x100
-#define TIOCM_RNG 0x200
-#define TIOCM_DSR 0x400
-#define TIOCM_CD TIOCM_CAR
-#define TIOCM_RI TIOCM_RNG
-#define TIOCM_OUT1 0x2000
-#define TIOCM_OUT2 0x4000
-#define TIOCM_LOOP 0x8000
-#else
-#define TIOCM_LE 0x001
-#define TIOCM_DTR 0x002
-#define TIOCM_RTS 0x004
-#define TIOCM_ST 0x008
-#define TIOCM_SR 0x010
-#define TIOCM_CTS 0x020
-#define TIOCM_CAR 0x040
-#define TIOCM_RNG 0x080
-#define TIOCM_DSR 0x100
-#define TIOCM_CD TIOCM_CAR
-#define TIOCM_RI TIOCM_RNG
-#define TIOCM_OUT1 0x2000
-#define TIOCM_OUT2 0x4000
-#define TIOCM_LOOP 0x8000
-#endif
-
-/* line disciplines */
-#define N_TTY 0
-#define N_SLIP 1
-#define N_MOUSE 2
-#define N_PPP 3
-#define N_STRIP 4
-#define N_AX25 5
-#define N_X25 6 /* X.25 async */
-#define N_6PACK 7
-#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
-#define N_R3964 9 /* Reserved for Simatic R3964 module */
-#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
-#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
-#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
-#define N_HDLC 13 /* synchronous HDLC */
-#define N_SYNC_PPP 14 /* synchronous PPP */
-#define N_HCI 15 /* Bluetooth HCI UART */
-
-typedef unsigned char cc_t;
-typedef unsigned int speed_t;
-typedef unsigned int tcflag_t;
-
-#define _POSIX_VDISABLE '\0'
-
-#if defined(__i386__) || defined(__arm__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__) || defined(__s390x__) || defined(__x86_64__)
-#define NCCS 19
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-#elif defined(__mips__) || defined(__mips64__)
-#define NCCS 23
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- /*
- * Seems nonexistent in the ABI, but Linux assumes existence ...
- */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-#elif defined(powerpc) || defined(__alpha__)
-#define NCCS 19
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_cc[NCCS]; /* control characters */
- cc_t c_line; /* line discipline (== c_cc[19]) */
- speed_t c_ispeed; /* input speed */
- speed_t c_ospeed; /* output speed */
-};
-#elif defined(__sparc__)
-#define NCCS 17
-struct termios {
- tcflag_t c_iflag; /* input mode flags */
- tcflag_t c_oflag; /* output mode flags */
- tcflag_t c_cflag; /* control mode flags */
- tcflag_t c_lflag; /* local mode flags */
- cc_t c_line; /* line discipline */
- cc_t c_cc[NCCS]; /* control characters */
-};
-#else
-# error "Struct termios undefined on your architecture"
-#endif
-
-/* c_cc characters */
-#if defined(__alpha__)
-#define VEOF 0
-#define VEOL 1
-#define VEOL2 2
-#define VERASE 3
-#define VWERASE 4
-#define VKILL 5
-#define VREPRINT 6
-#define VSWTC 7
-#define VINTR 8
-#define VQUIT 9
-#define VSUSP 10
-#define VSTART 12
-#define VSTOP 13
-#define VLNEXT 14
-#define VDISCARD 15
-#define VMIN 16
-#define VTIME 17
-#elif defined(__mips__)
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VMIN 4
-#define VTIME 5
-#define VEOL2 6
-#define VSWTC 7
-#define VSWTCH VSWTC
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOF 16
-#define VEOL 17
-#elif defined(__powerpc__)
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VMIN 5
-#define VEOL 6
-#define VTIME 7
-#define VEOL2 8
-#define VSWTC 9
-#define VWERASE 10
-#define VREPRINT 11
-#define VSUSP 12
-#define VSTART 13
-#define VSTOP 14
-#define VLNEXT 15
-#define VDISCARD 16
-#elif defined(__sparc__)
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VEOL 5
-#define VEOL2 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VDSUSP 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VMIN 16
-#define VTIME 17
-#else /* arm, i386, parisc, s390, x86_64 */
-#define VINTR 0
-#define VQUIT 1
-#define VERASE 2
-#define VKILL 3
-#define VEOF 4
-#define VTIME 5
-#define VMIN 6
-#define VSWTC 7
-#define VSTART 8
-#define VSTOP 9
-#define VSUSP 10
-#define VEOL 11
-#define VREPRINT 12
-#define VDISCARD 13
-#define VWERASE 14
-#define VLNEXT 15
-#define VEOL2 16
-#endif
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK 0000020
-#define ISTRIP 0000040
-#define INLCR 0000100
-#define IGNCR 0000200
-#define ICRNL 0000400
-#define IUCLC 0001000
-#define IXON 0002000
-#define IXANY 0004000
-#define IXOFF 0010000
-#define IMAXBEL 0020000
-
-/* c_oflag bits */
-#define OPOST 0000001
-#define OLCUC 0000002
-#define ONLCR 0000004
-#define OCRNL 0000010
-#define ONOCR 0000020
-#define ONLRET 0000040
-#define OFILL 0000100
-#define OFDEL 0000200
-#define NLDLY 0000400
-#define NL0 0000000
-#define NL1 0000400
-#define CRDLY 0003000
-#define CR0 0000000
-#define CR1 0001000
-#define CR2 0002000
-#define CR3 0003000
-#define TABDLY 0014000
-#define TAB0 0000000
-#define TAB1 0004000
-#define TAB2 0010000
-#define TAB3 0014000
-#define XTABS 0014000
-#define BSDLY 0020000
-#define BS0 0000000
-#define BS1 0020000
-#define VTDLY 0040000
-#define VT0 0000000
-#define VT1 0040000
-#define FFDLY 0100000
-#define FF0 0000000
-#define FF1 0100000
-
-/* c_cflag bit meaning */
-#define CBAUD 0010017
-#define B0 0000000 /* hang up */
-#define B50 0000001
-#define B75 0000002
-#define B110 0000003
-#define B134 0000004
-#define B150 0000005
-#define B200 0000006
-#define B300 0000007
-#define B600 0000010
-#define B1200 0000011
-#define B1800 0000012
-#define B2400 0000013
-#define B4800 0000014
-#define B9600 0000015
-#define B19200 0000016
-#define B38400 0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CSIZE 0000060
-#define CS5 0000000
-#define CS6 0000020
-#define CS7 0000040
-#define CS8 0000060
-#define CSTOPB 0000100
-#define CREAD 0000200
-#define PARENB 0000400
-#define PARODD 0001000
-#define HUPCL 0002000
-#define CLOCAL 0004000
-#define CBAUDEX 0010000
-#define B57600 0010001
-#define B115200 0010002
-#define B230400 0010003
-#define B460800 0010004
-#define B500000 0010005
-#define B576000 0010006
-#define B921600 0010007
-#define B1000000 0010010
-#define B1152000 0010011
-#define B1500000 0010012
-#define B2000000 0010013
-#define B2500000 0010014
-#define B3000000 0010015
-#define B3500000 0010016
-#define B4000000 0010017
-#define CIBAUD 002003600000 /* input baud rate (not used) */
-#define CMSPAR 010000000000 /* mark or space (stick) parity */
-#define CRTSCTS 020000000000 /* flow control */
-
-/* c_lflag bits */
-#define ISIG 0000001
-#define ICANON 0000002
-#define XCASE 0000004
-#define ECHO 0000010
-#define ECHOE 0000020
-#define ECHOK 0000040
-#define ECHONL 0000100
-#define NOFLSH 0000200
-#define ECHOCTL 0001000
-#define ECHOPRT 0002000
-#define ECHOKE 0004000
-#ifdef __mips__
-#define IEXTEN 0000400
-#define FLUSHO 0020000
-#define TOSTOP 0100000
-#else
-#define TOSTOP 0000400
-#define FLUSHO 0010000
-#define IEXTEN 0100000
-#endif
-#define PENDIN 0040000
-
-/* tcflow() and TCXONC use these */
-#define TCOOFF 0
-#define TCOON 1
-#define TCIOFF 2
-#define TCION 3
-
-/* tcflush() and TCFLSH use these */
-#define TCIFLUSH 0
-#define TCOFLUSH 1
-#define TCIOFLUSH 2
-
-/* tcsetattr uses these */
-#ifdef __mips__
-#define TCSANOW 0x540e
-#define TCSADRAIN 0x540f
-#define TCSAFLUSH 0x5410
-#else
-#define TCSANOW 0
-#define TCSADRAIN 1
-#define TCSAFLUSH 2
-#endif
-
-int tcgetattr(int fd, struct termios *termios_p) __THROW;
-int tcsetattr(int fd, int optional_actions, struct termios *termios_p) __THROW;
-speed_t cfgetospeed(struct termios *termios_p) __THROW;
-int cfsetospeed(struct termios *termios_p, speed_t speed) __THROW;
-speed_t cfgetispeed(struct termios *termios_p) __THROW;
-int cfsetispeed(struct termios *termios_p, speed_t speed) __THROW;
-void cfmakeraw(struct termios *t) __THROW;
-
-int tcflush(int fd, int queue_selector) __THROW;
-int tcdrain(int fd) __THROW;
-int tcflow (int fd,int action) __THROW;
-int tcsendbreak (int fd,int duration) __THROW;
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/time.h b/mdk-stage1/dietlibc/include/time.h
deleted file mode 100644
index 29681fa3d..000000000
--- a/mdk-stage1/dietlibc/include/time.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _TIME_H
-#define _TIME_H
-
-#include <sys/cdefs.h>
-#include <sys/time.h>
-
-extern int __isleap(int year);
-
-int nanosleep(const struct timespec *req, struct timespec *rem) __THROW;
-
-time_t mktime(struct tm *timeptr) __THROW __pure__;
-
-char *asctime(const struct tm *timeptr) __THROW;
-char *asctime_r(const struct tm *timeptr, char *buf) __THROW;
-
-char *ctime(const time_t *timep) __THROW;
-
-size_t strftime(char *s, size_t max, const char *format, const struct tm *tm) __THROW __attribute__((format(strftime,3,0)));
-time_t time(time_t *t) __THROW;
-
-int stime(time_t *t) __THROW;
-
-double difftime(time_t time1, time_t time0) __THROW __attribute__((const));
-
-#define CLOCKS_PER_SEC 1000000l
-
-extern long int timezone;
-extern int daylight;
-extern char* tzname[2];
-
-void tzset (void) __THROW;
-
-struct tm* localtime(const time_t* t) __THROW;
-struct tm* gmtime(const time_t* t) __THROW;
-struct tm* localtime_r(const time_t* t, struct tm* r) __THROW;
-struct tm* gmtime_r(const time_t* t, struct tm* r) __THROW;
-
-clock_t clock(void);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/unistd.h b/mdk-stage1/dietlibc/include/unistd.h
deleted file mode 100644
index 2fba5d584..000000000
--- a/mdk-stage1/dietlibc/include/unistd.h
+++ /dev/null
@@ -1,233 +0,0 @@
-#ifndef _UNISTD_H
-#define _UNISTD_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-#include <sys/fsuid.h>
-
-extern int optind,opterr;
-extern char *optarg;
-int getopt(int argc, char *const argv[], const char *options);
-
-/* Values for the second argument to access.
- These may be OR'd together. */
-#define R_OK 4 /* Test for read permission. */
-#define W_OK 2 /* Test for write permission. */
-#define X_OK 1 /* Test for execute permission. */
-#define F_OK 0 /* Test for existence. */
-
-/* Test for access to NAME using the real UID and real GID. */
-extern int access (const char *__name, int __type) __THROW;
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
-
-#define STDIN_FILENO 0
-#define STDOUT_FILENO 1
-#define STDERR_FILENO 2
-
-off_t lseek(int fildes, off_t offset, int whence) __THROW;
-#ifndef __NO_STAT64
-loff_t lseek64(int fildes, loff_t offset, int whence) __THROW;
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-#define lseek(fildes,offset,whence) lseek64(fildes,offset,whence)
-#endif
-#endif
-
-int chdir(const char *path) __THROW;
-int fchdir(int fd) __THROW;
-int rmdir(const char *pathname) __THROW;
-char *getcwd(char *buf, size_t size) __THROW;
-
-int open(const char* pathname,int flags, ...) __THROW;
-int open64(const char* pathname,int flags, ...) __THROW;
-int creat(const char* pathname,mode_t mode) __THROW;
-int creat64(const char* pathname,mode_t mode) __THROW;
-int write(int fd,const void* buf,size_t len) __THROW;
-int read(int fd,void* buf,size_t len) __THROW;
-int close(int fd) __THROW;
-
-int unlink(const char *pathname) __THROW;
-
-int pread(int fd, void *buf, size_t count, off_t offset);
-int pwrite(int fd, const void *buf, size_t count, off_t offset);
-
-int execve(const char *filename, char *const argv [], char *const envp[]) __THROW;
-int execlp(const char *file, const char *arg, ...) __THROW;
-int execv(const char *path, char *const argv[]) __THROW;
-int execvp(const char *file, char *const argv[]) __THROW;
-int execl(const char *path, ...) __THROW;
-int execle(const char *path, ...) __THROW;
-
-pid_t getpid(void) __THROW;
-pid_t getppid(void) __THROW;
-
-int setpgid (pid_t pid,pid_t pgid) __THROW;
-pid_t getpgid (pid_t pid) __THROW;
-int setpgrp (void) __THROW;
-pid_t getpgrp (void) __THROW;
-pid_t getsid(pid_t pid) __THROW;
-pid_t setsid (void) __THROW;
-int dup (int oldfd) __THROW;
-int dup2 (int oldfd,int newfd) __THROW;
-
-struct dirent;
-struct dirent64;
-int getdents(int fd, struct dirent *dirp, unsigned int count) __THROW;
-int getdents64(int fd, struct dirent64 *dirp, unsigned int count) __THROW;
-
-pid_t fork(void) __THROW;
-pid_t vfork(void) __THROW;
-
-int readlink(const char *path, char *buf, size_t bufsiz) __THROW;
-int symlink(const char *oldpath, const char *newpath) __THROW;
-int link(const char *oldpath, const char *newpath) __THROW;
-
-int chown(const char *path, uid_t owner, gid_t group) __THROW;
-int fchown(int fd, uid_t owner, gid_t group) __THROW;
-int lchown(const char *path, uid_t owner, gid_t group) __THROW;
-
-int fsync(int fd) __THROW;
-#define _POSIX_SYNCHRONIZED_IO
-int fdatasync(int fd) __THROW;
-
-int pipe(int filedes[2]) __THROW;
-
-char *ttyname (int desc) __THROW;
-
-int brk(void *end_data_segment) __THROW;
-void *sbrk(ptrdiff_t increment) __THROW;
-
-int gethostname(char *name, size_t len) __THROW;
-int sethostname(const char *name, size_t len) __THROW;
-
-int usleep(unsigned long useconds) __THROW;
-unsigned int sleep(unsigned int seconds) __THROW;
-
-unsigned int alarm(unsigned int seconds) __THROW;
-int sync(void) __THROW;
-
-int isatty(int desc) __THROW;
-
-void _exit(int status) __THROW __attribute__((noreturn));
-
-extern int daemon(int nochdir,int noclose) __THROW;
-
-int pause(void) __THROW;
-
-#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
-#define open open64
-#define creat creat64
-#define truncate truncate64
-#define ftruncate ftruncate64
-#define getdents getdents64
-#endif
-
-extern char* getlogin(void) __THROW;
-/* warning: the diet libc getlogin() simply returns getenv("LOGNAME") */
-
-int chroot(const char *path) __THROW;
-
-uid_t getuid(void) __THROW;
-uid_t geteuid(void) __THROW;
-gid_t getgid(void) __THROW;
-gid_t getegid(void) __THROW;
-int setuid(uid_t uid) __THROW;
-/* int seteuid(uid_t uid) __THROW; */
-int setgid(gid_t gid) __THROW;
-/* int setegid(gid_t gid) __THROW; */
-int setregid(gid_t rgid, gid_t egid) __THROW;
-int setreuid(uid_t ruid, uid_t euid) __THROW;
-#define seteuid(euid) setreuid(-1,euid)
-#define setegid(egid) setregid(-1,egid)
-
-int rename(const char *oldpath, const char *newpath) __THROW;
-int truncate(const char *path, off_t length) __THROW;
-int ftruncate(int fd, off_t length) __THROW;
-#ifndef __NO_STAT64
-int truncate64(const char *path, loff_t length) __THROW;
-int ftruncate64(int fd, loff_t length) __THROW;
-#endif
-
-int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) __THROW;
-
-int nice(int inc) __THROW;
-
-extern char **__environ;
-
-char *crypt(const char *key, const char *salt) __THROW;
-void encrypt(char block[64], int edflag) __THROW;
-void setkey(const char *key) __THROW;
-
-size_t getpagesize(void) __THROW __attribute__((__const__));
-
-int getdomainname(char *name, size_t len) __THROW;
-int setdomainname(const char *name, size_t len) __THROW;
-
-int getgroups(int size, gid_t list[]) __THROW;
-int getdtablesize(void) __THROW;
-char *getpass(const char * prompt) __THROW;
-
-/* warning: linux specific: */
-int llseek(int fildes, unsigned long hi, unsigned long lo, loff_t* result,int whence) __THROW;
-
-/* include <linux/sysctl.h> to get all the definitions! */
-struct __sysctl_args;
-int _sysctl(struct __sysctl_args *args) __THROW;
-
-#define _SC_CLK_TCK 1
-#define _SC_ARG_MAX 2
-#define _SC_NGROUPS_MAX 3
-#define _SC_OPEN_MAX 4
-#define _SC_PAGESIZE 5
-#define _SC_NPROCESSORS_ONLN 6
-#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_ONLN
-long sysconf(int name) __THROW;
-#define _PC_PATH_MAX 1
-#define _PC_VDISABLE 2
-
-pid_t tcgetpgrp(int fd) __THROW;
-int tcsetpgrp(int fd, pid_t pgrpid) __THROW;
-
-int profil(unsigned short *buf, size_t bufsiz, size_t offset, unsigned int scale);
-
-/* Linux only: */
-int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) __THROW;
-int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) __THROW;
-int setresuid(uid_t ruid, uid_t euid, uid_t suid) __THROW;
-int setresgid(gid_t rgid, gid_t egid, gid_t sgid) __THROW;
-
-/* 32-bit uid support */
-int chown32(const char *path, uid32_t owner, gid32_t group) __THROW;
-int fchown32(int fd, uid32_t owner, gid32_t group) __THROW;
-int lchown32(const char *path, uid32_t owner, gid32_t group) __THROW;
-uid32_t getuid32(void) __THROW;
-uid32_t geteuid32(void) __THROW;
-gid32_t getgid32(void) __THROW;
-gid32_t getegid32(void) __THROW;
-int setuid32(uid32_t uid) __THROW;
-int setgid32(gid32_t gid) __THROW;
-int setreuid32(uid32_t ruid, uid32_t euid) __THROW;
-int setregid32(gid32_t rgid, gid32_t egid) __THROW;
-#define seteuid32(euid) setreuid32(-1,euid)
-#define setegid32(egid) setregid32(-1,egid)
-int getgroups32(int size, gid32_t list[]) __THROW;
-int getresuid32(uid32_t *ruid, uid32_t *euid, uid32_t *suid);
-int getresgid32(gid32_t *rgid, gid32_t *egid, gid32_t *sgid);
-int setresuid32(uid32_t ruid, uid32_t euid, uid32_t suid) __THROW;
-int setresgid32(gid32_t rgid, gid32_t egid, gid32_t sgid) __THROW;
-
-#ifdef _BSD_SOURCE
-char *getusershell(void);
-void setusershell(void);
-void endusershell(void);
-#endif
-
-#define _POSIX_VERSION 199506L
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/utime.h b/mdk-stage1/dietlibc/include/utime.h
deleted file mode 100644
index 41674f379..000000000
--- a/mdk-stage1/dietlibc/include/utime.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _UTIME_H
-#define _UTIME_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <time.h>
-
-struct utimbuf {
- time_t actime; /* access time */
- time_t modtime; /* modification time */
-};
-
-int utime(const char *filename, struct utimbuf *buf) __THROW;
-
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/utmp.h b/mdk-stage1/dietlibc/include/utmp.h
deleted file mode 100644
index cc2adc9f6..000000000
--- a/mdk-stage1/dietlibc/include/utmp.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef _UTMP_H
-#define _UTMP_H
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <time.h>
-
-#define UT_LINESIZE 32
-#define UT_NAMESIZE 32
-#define UT_HOSTSIZE 256
-
-#define _PATH_UTMP "/var/run/utmp"
-#define _PATH_WTMP "/var/log/wtmp"
-#ifdef _BSD_SOURCE
-/* die, BSD, die!!! */
-#define UTMP_FILE _PATH_UTMP
-#define WTMP_FILE _PATH_WTMP
-#endif
-
-/* The structure describing an entry in the database of
- previous logins. */
-struct lastlog
- {
- time_t ll_time;
- char ll_line[UT_LINESIZE];
- char ll_host[UT_HOSTSIZE];
- };
-
-/* The structure describing the status of a terminated process. This
- type is used in `struct utmp' below. */
-struct exit_status
- {
- short int e_termination; /* Process termination status. */
- short int e_exit; /* Process exit status. */
- };
-
-/* The structure describing an entry in the user accounting database. */
-struct utmp
-{
- short int ut_type; /* Type of login. */
- pid_t ut_pid; /* Process ID of login process. */
- char ut_line[UT_LINESIZE]; /* Devicename. */
- char ut_id[4]; /* Inittab ID. */
- char ut_user[UT_NAMESIZE]; /* Username. */
- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
-#define ut_name ut_user
- struct exit_status ut_exit; /* Exit status of a process marked
- as DEAD_PROCESS. */
- long int ut_session; /* Session ID, used for windowing. */
-#define ut_time ut_tv.tv_sec
- struct timeval ut_tv; /* Time entry was made. */
-#define ut_addr ut_addr_v6[0]
- int32_t ut_addr_v6[4]; /* Internet address of remote host. */
- char __unused[20]; /* Reserved for future use. */
-};
-
-/* Values for the `ut_type' field of a `struct utmp'. */
-#define EMPTY 0 /* No valid user accounting information. */
-
-#define RUN_LVL 1 /* The system's runlevel. */
-#define BOOT_TIME 2 /* Time of system boot. */
-#define NEW_TIME 3 /* Time after system clock changed. */
-#define OLD_TIME 4 /* Time when system clock changed. */
-
-#define INIT_PROCESS 5 /* Process spawned by the init process. */
-#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
-#define USER_PROCESS 7 /* Normal process. */
-#define DEAD_PROCESS 8 /* Terminated process. */
-
-#define ACCOUNTING 9
-
-/* Tell the user that we have a modern system with UT_HOST, UT_PID,
- UT_TYPE, UT_ID and UT_TV fields. */
-#define _HAVE_UT_TYPE 1
-#define _HAVE_UT_PID 1
-#define _HAVE_UT_ID 1
-#define _HAVE_UT_TV 1
-#define _HAVE_UT_HOST 1
-
-struct utmp *getutent(void) __THROW;
-struct utmp *getutid(struct utmp *ut) __THROW;
-struct utmp *getutline(struct utmp *ut) __THROW;
-
-void pututline(struct utmp *ut) __THROW;
-
-void setutent(void) __THROW;
-void endutent(void) __THROW;
-
-void utmpname(const char *file) __THROW;
-
-void updwtmp(const char *wtmp_file, const struct utmp *ut);
-void logwtmp(const char *line, const char *name, const char *host);
-
-#endif
diff --git a/mdk-stage1/dietlibc/include/write12.h b/mdk-stage1/dietlibc/include/write12.h
deleted file mode 100644
index 960b4b722..000000000
--- a/mdk-stage1/dietlibc/include/write12.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <sys/cdefs.h>
-
-int __write1 ( const char* s ) __attribute__ (( regparm(1) ));
-int __write2 ( const char* s ) __attribute__ (( regparm(1) ));
diff --git a/mdk-stage1/dietlibc/lib/__dtostr.c b/mdk-stage1/dietlibc/lib/__dtostr.c
deleted file mode 100644
index 580258936..000000000
--- a/mdk-stage1/dietlibc/lib/__dtostr.c
+++ /dev/null
@@ -1,140 +0,0 @@
-#include <stdlib.h>
-#include <endian.h>
-#include <math.h>
-/* convert double to string. Helper for sprintf. */
-
-static int copystring(char* buf,int maxlen, const char* s) {
- int i;
- for (i=0; i<3&&i<maxlen; ++i)
- buf[i]=s[i];
- if (i<maxlen) { buf[i]=0; ++i; }
- return i;
-}
-
-int __dtostr(double d,char *buf,unsigned int maxlen,unsigned int prec,unsigned int prec2) {
-#if 1
- unsigned long long *x=(unsigned long long *)&d;
- /* step 1: extract sign, mantissa and exponent */
- signed long e=((*x>>52)&((1<<11)-1))-1023;
-#else
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- signed long e=(((((unsigned long*)&d)[1])>>20)&((1<<11)-1))-1023;
-#else
- signed long e=(((*((unsigned long*)&d))>>20)&((1<<11)-1))-1023;
-#endif
-#endif
-/* unsigned long long m=*x & ((1ull<<52)-1); */
- /* step 2: exponent is base 2, compute exponent for base 10 */
- signed long e10;
- /* step 3: calculate 10^e10 */
- unsigned int i;
- double backup=d;
- double tmp;
- char *oldbuf=buf;
-
- if (isnan(d)) return copystring(buf,maxlen,"nan");
- if ((i=isinf(d))) return copystring(buf,maxlen,i>0?"inf":"-inf");
- e10=1+(long)(e*0.30102999566398119802); /* log10(2) */
- /* Wir iterieren von Links bis wir bei 0 sind oder maxlen erreicht
- * ist. Wenn maxlen erreicht ist, machen wir das nochmal in
- * scientific notation. Wenn dann von prec noch was übrig ist, geben
- * wir einen Dezimalpunkt aus und geben prec2 Nachkommastellen aus.
- * Wenn prec2 Null ist, geben wir so viel Stellen aus, wie von prec
- * noch übrig ist. */
- if (d==0.0) {
- prec2=prec2==0?1:prec2+2;
- prec2=prec2>maxlen?8:prec2;
- for (i=0; i<prec2; ++i) buf[i]='0';
- buf[1]='.'; buf[i]=0;
- return i;
- }
-
- if (d < 0.0) { d=-d; *buf='-'; --maxlen; ++buf; }
-
- /*
- Perform rounding. It needs to be done before we generate any
- digits as the carry could propagate through the whole number.
- */
-
- tmp = 0.5;
- for (i = 0; i < prec2; i++) { tmp *= 0.1; }
- d += tmp;
-
- if (d < 1.0) { *buf='0'; --maxlen; ++buf; }
-/* printf("e=%d e10=%d prec=%d\n",e,e10,prec); */
- if (e10>0) {
- int first=1; /* are we about to write the first digit? */
- tmp = 10.0;
- i=e10;
- while (i>10) { tmp=tmp*1e10; i-=10; }
- while (i>1) { tmp=tmp*10; --i; }
- /* the number is greater than 1. Iterate through digits before the
- * decimal point until we reach the decimal point or maxlen is
- * reached (in which case we switch to scientific notation). */
- while (tmp>0.9) {
- char digit;
- double fraction=d/tmp;
- digit=(int)(fraction); /* floor() */
- if (!first || digit) {
- first=0;
- *buf=digit+'0'; ++buf;
- if (!maxlen) {
- /* use scientific notation */
- int len=__dtostr(backup/tmp,oldbuf,maxlen,prec,prec2);
- int initial=1;
- if (len==0) return 0;
- maxlen-=len; buf+=len;
- if (maxlen>0) {
- *buf='e';
- ++buf;
- }
- --maxlen;
- for (len=1000; len>0; len/=10) {
- if (e10>=len || !initial) {
- if (maxlen>0) {
- *buf=(e10/len)+'0';
- ++buf;
- }
- --maxlen;
- initial=0;
- e10=e10%len;
- }
- }
- if (maxlen>0) goto fini;
- return 0;
- }
- d-=digit*tmp;
- --maxlen;
- }
- tmp/=10.0;
- }
- }
- else
- {
- tmp = 0.1;
- }
-
- if (buf==oldbuf) {
- if (!maxlen) return 0; --maxlen;
- *buf='0'; ++buf;
- }
- if (prec2 || prec>(unsigned int)(buf-oldbuf)+1) { /* more digits wanted */
- if (!maxlen) return 0; --maxlen;
- *buf='.'; ++buf;
- prec-=buf-oldbuf-1;
- if (prec2) prec=prec2;
- if (prec>maxlen) return 0;
- while (prec>0) {
- char digit;
- double fraction=d/tmp;
- digit=(int)(fraction); /* floor() */
- *buf=digit+'0'; ++buf;
- d-=digit*tmp;
- tmp/=10.0;
- --prec;
- }
- }
-fini:
- *buf=0;
- return buf-oldbuf;
-}
diff --git a/mdk-stage1/dietlibc/lib/__fstat64.c b/mdk-stage1/dietlibc/lib/__fstat64.c
deleted file mode 100644
index f2f9858ea..000000000
--- a/mdk-stage1/dietlibc/lib/__fstat64.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-#ifdef WANT_LARGEFILE_BACKCOMPAT
-#include <sys/stat.h>
-#ifndef __NO_STAT64
-
-extern int __dietlibc_fstat64(int __fd, struct stat64 *__buf);
-extern void __stat64_cvt(const struct stat *src,struct stat64 *dest);
-
-int fstat64(int __fd, struct stat64 *__buf) {
- if (__dietlibc_fstat64(__fd,__buf)) {
- struct stat temp;
- if (errno!=ENOSYS) return -1;
- if (fstat(__fd,&temp)) return -1;
- __stat64_cvt(&temp,__buf);
- }
- return 0;
-}
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__ftruncate64.c b/mdk-stage1/dietlibc/lib/__ftruncate64.c
deleted file mode 100644
index e0ea8c98a..000000000
--- a/mdk-stage1/dietlibc/lib/__ftruncate64.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-#ifdef WANT_LARGEFILE_BACKCOMPAT
-#include <sys/stat.h>
-#include "syscalls.h"
-#include <unistd.h>
-#ifndef __NO_STAT64
-#ifdef __NR_ftruncate64
-
-extern int __dietlibc_ftruncate64(int fd, loff_t o);
-
-int ftruncate64(int fd, loff_t o) {
- int tmp;
- if ((tmp=__dietlibc_ftruncate64(fd,o))==-1) {
- if (errno!=ENOSYS) return -1;
- if (o>0x7fffffff) { errno=EOVERFLOW; return -1; }
- return ftruncate(fd,o);
- }
- return tmp;
-}
-#endif
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__getcwd.c b/mdk-stage1/dietlibc/lib/__getcwd.c
deleted file mode 100644
index 8616704ec..000000000
--- a/mdk-stage1/dietlibc/lib/__getcwd.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-
-extern int __syscall_getcwd(char* buf, size_t size);
-
-char *getcwd(char *buf, size_t size) {
- int tmp;
- if ((tmp=__syscall_getcwd(buf,size))<0) return 0;
- buf[tmp]=0;
- return buf;
-}
diff --git a/mdk-stage1/dietlibc/lib/__isinf.c b/mdk-stage1/dietlibc/lib/__isinf.c
deleted file mode 100644
index 359bd2709..000000000
--- a/mdk-stage1/dietlibc/lib/__isinf.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <math.h>
-
-int isinf(double d) {
- unsigned long long *x=(unsigned long long *)&d;
- return (*x==0x7FF0000000000000ll?1:*x==0xFFF0000000000000?-1:0);
-}
-int __isinf(double d) __attribute__((alias("isinf")));
-
-#if 0
-TestFromIeeeExtended("7FFF0000000000000000"); /* +infinity */
-TestFromIeeeExtended("FFFF0000000000000000"); /* -infinity */
-TestFromIeeeExtended("7FFF8001000000000000"); /* Quiet NaN(1) */
-TestFromIeeeExtended("7FFF0001000000000000"); /* Signalling NaN(1) */
-TestFromIeeeExtended("3FFFFEDCBA9876543210"); /* accuracy test */
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__isnan.c b/mdk-stage1/dietlibc/lib/__isnan.c
deleted file mode 100644
index de74b8a9f..000000000
--- a/mdk-stage1/dietlibc/lib/__isnan.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <math.h>
-
-int isnan(double d) {
- unsigned long long *x=(unsigned long long *)&d;
- return (*x==0x7FF8000000000000ll || *x==0x7FF0000000000000 || *x==0xfff8000000000000);
-}
-int __isnan(double d) __attribute__((alias("isnan")));
-
-#if 0
-TestFromIeeeExtended("7FFF0000000000000000"); /* +infinity */
-TestFromIeeeExtended("FFFF0000000000000000"); /* -infinity */
-TestFromIeeeExtended("7FFF8001000000000000"); /* Quiet NaN(1) */
-TestFromIeeeExtended("7FFF0001000000000000"); /* Signalling NaN(1) */
-TestFromIeeeExtended("3FFFFEDCBA9876543210"); /* accuracy test */
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__lltostr.c b/mdk-stage1/dietlibc/lib/__lltostr.c
deleted file mode 100644
index fe4701f29..000000000
--- a/mdk-stage1/dietlibc/lib/__lltostr.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <string.h>
-
-int __lltostr(char *s, int size, unsigned long long i, int base, char UpCase);
-
-int __lltostr(char *s, int size, unsigned long long i, int base, char UpCase)
-{
- char *tmp;
- unsigned int j=0;
-
- s[--size]=0;
-
- tmp=s+size;
-
- if ((base==0)||(base>36)) base=10;
-
- j=0;
- if (!i)
- {
- *(--tmp)='0';
- j=1;
- }
-
- while((tmp>s)&&(i))
- {
- tmp--;
- if ((*tmp=i%base+'0')>'9') *tmp+=(UpCase?'A':'a')-'9'-1;
- i=i/base;
- j++;
- }
- memmove(s,tmp,j+1);
-
- return j;
-}
diff --git a/mdk-stage1/dietlibc/lib/__lstat64.c b/mdk-stage1/dietlibc/lib/__lstat64.c
deleted file mode 100644
index 0eab6a94b..000000000
--- a/mdk-stage1/dietlibc/lib/__lstat64.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-#ifdef WANT_LARGEFILE_BACKCOMPAT
-#include <sys/stat.h>
-#ifndef __NO_STAT64
-
-extern int __dietlibc_lstat64(const char *__file, struct stat64 *__buf);
-extern void __stat64_cvt(const struct stat *src,struct stat64 *dest);
-
-int lstat64(const char *__file, struct stat64 *__buf) {
- if (__dietlibc_lstat64(__file,__buf)) {
- struct stat temp;
- if (errno!=ENOSYS) return -1;
- if (lstat(__file,&temp)) return -1;
- __stat64_cvt(&temp,__buf);
- }
- return 0;
-}
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__ltostr.c b/mdk-stage1/dietlibc/lib/__ltostr.c
deleted file mode 100644
index fa71be9ab..000000000
--- a/mdk-stage1/dietlibc/lib/__ltostr.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-
-int __ltostr(char *s, unsigned int size, unsigned long i, unsigned int base, int UpCase)
-{
- char *tmp;
- unsigned int j=0;
-
- s[--size]=0;
-
- tmp=s+size;
-
- if ((base==0)||(base>36)) base=10;
-
- j=0;
- if (!i)
- {
- *(--tmp)='0';
- j=1;
- }
-
- while((tmp>s)&&(i))
- {
- tmp--;
- if ((*tmp=i%base+'0')>'9') *tmp+=(UpCase?'A':'a')-'9'-1;
- i=i/base;
- j++;
- }
- memmove(s,tmp,j+1);
-
- return j;
-}
diff --git a/mdk-stage1/dietlibc/lib/__ptrace.c b/mdk-stage1/dietlibc/lib/__ptrace.c
deleted file mode 100644
index bd14a0351..000000000
--- a/mdk-stage1/dietlibc/lib/__ptrace.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* we need this because we need to use the glibc prototype which uses
- * varargs :-( */
-#define ptrace fnord
-#include <sys/ptrace.h>
-#undef ptrace
-#include <sys/types.h>
-#include <unistd.h>
-
-extern int __diet_ptrace(int request, pid_t pid, void *addr, void *data);
-int ptrace(int request, pid_t pid, void *addr, void *data);
-
-int ptrace(int request, pid_t pid, void *addr, void *data) {
- switch (request) {
- case PTRACE_TRACEME: case PTRACE_KILL: case PTRACE_ATTACH:
- case PTRACE_DETACH:
- return (__diet_ptrace (request, pid, NULL, NULL));
- case PTRACE_PEEKDATA: case PTRACE_PEEKUSER: case PTRACE_PEEKTEXT:
- {
- long result;
- if (__diet_ptrace (request, pid, addr, &result) == -1)
- return (-1);
- return (result);
- }
- default:
- return (__diet_ptrace (request, pid, addr, data));
- }
-}
diff --git a/mdk-stage1/dietlibc/lib/__stat64.c b/mdk-stage1/dietlibc/lib/__stat64.c
deleted file mode 100644
index fcbdfef2d..000000000
--- a/mdk-stage1/dietlibc/lib/__stat64.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-#ifdef WANT_LARGEFILE_BACKCOMPAT
-#include <sys/stat.h>
-#ifndef __NO_STAT64
-
-extern int __dietlibc_stat64(const char *__file, struct stat64 *__buf);
-extern void __stat64_cvt(const struct stat *src,struct stat64 *dest);
-
-int stat64(const char *__file, struct stat64 *__buf) {
- if (__dietlibc_stat64(__file,__buf)) {
- struct stat temp;
- if (errno!=ENOSYS) return -1;
- if (stat(__file,&temp)) return -1;
- __stat64_cvt(&temp,__buf);
- }
- return 0;
-}
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__stat64_cvt.c b/mdk-stage1/dietlibc/lib/__stat64_cvt.c
deleted file mode 100644
index c4ce8bea4..000000000
--- a/mdk-stage1/dietlibc/lib/__stat64_cvt.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <sys/stat.h>
-#ifndef __NO_STAT64
-
-void __stat64_cvt(const struct stat *src,struct stat64 *dest);
-
-void __stat64_cvt(const struct stat *src,struct stat64 *dest) {
- dest->st_dev=src->st_dev;
- dest->st_ino=src->st_ino;
- dest->st_mode=src->st_mode;
- dest->st_nlink=src->st_nlink;
- dest->st_uid=src->st_gid;
- dest->st_rdev=src->st_rdev;
- dest->st_size=src->st_size;
- dest->st_blksize=src->st_blksize;
- dest->st_blocks=src->st_blocks;
- dest->st_atime=src->st_atime;
- dest->st_mtime=src->st_mtime;
- dest->st_ctime=src->st_ctime;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__stime.c b/mdk-stage1/dietlibc/lib/__stime.c
deleted file mode 100644
index 7b2c77729..000000000
--- a/mdk-stage1/dietlibc/lib/__stime.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <errno.h>
-#include <sys/time.h>
-#include <time.h>
-#include <syscalls.h>
-
-#ifndef __NR_stime
-int stime(time_t *when)
-{
- struct timeval tv;
- tv.tv_sec = *when;
- tv.tv_usec = 0;
- return settimeofday(&tv, (struct timezone *)0);
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__truncate64.c b/mdk-stage1/dietlibc/lib/__truncate64.c
deleted file mode 100644
index ccb3e7f64..000000000
--- a/mdk-stage1/dietlibc/lib/__truncate64.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "dietfeatures.h"
-#include <errno.h>
-#ifdef WANT_LARGEFILE_BACKCOMPAT
-#include <sys/stat.h>
-#include "syscalls.h"
-#include <unistd.h>
-#ifndef __NO_STAT64
-#ifdef __NR_truncate64
-
-extern int __dietlibc_truncate64(const char* f, loff_t o);
-
-int truncate64(const char* f, loff_t o) {
- int tmp;
- if ((tmp=__dietlibc_truncate64(f,o))==-1) {
- if (errno!=ENOSYS) return -1;
- if (o>0x7fffffff) { errno=EOVERFLOW; return -1; }
- return truncate(f,o);
- }
- return tmp;
-}
-#endif
-#endif
-#endif
diff --git a/mdk-stage1/dietlibc/lib/__v_printf.c b/mdk-stage1/dietlibc/lib/__v_printf.c
deleted file mode 100644
index 1ff63bec1..000000000
--- a/mdk-stage1/dietlibc/lib/__v_printf.c
+++ /dev/null
@@ -1,301 +0,0 @@
-#include "dietfeatures.h"
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include "dietstdio.h"
-#include "dietwarning.h"
-
-static inline unsigned int skip_to(const unsigned char *format) {
- unsigned int nr;
- for (nr=0; format[nr] && (format[nr]!='%'); ++nr);
- return nr;
-}
-
-#define A_WRITE(fn,buf,sz) ((fn)->put((void*)(buf),(sz),(fn)->data))
-
-static const char pad_line[2][16]= { " ", "0000000000000000", };
-static inline int write_pad(struct arg_printf* fn, int len, int padwith) {
- int nr=0;
- for (;len>15;len-=16,nr+=16) {
- A_WRITE(fn,pad_line[(padwith=='0')?1:0],16);
- }
- if (len>0) {
- A_WRITE(fn,pad_line[(padwith=='0')?1:0],(unsigned int)len); nr+=len;
- }
- return nr;
-}
-
-int __v_printf(struct arg_printf* fn, const unsigned char *format, va_list arg_ptr)
-{
- int len=0;
-
- if (format)
- while (*format) {
- unsigned int sz = skip_to(format);
- if (sz) {
- A_WRITE(fn,format,sz); len+=sz;
- format+=sz;
- }
- if (*format=='%') {
- char buf[128];
-
- unsigned char ch, *s, padwith=' ';
-
- char flag_in_sign=0;
- char flag_upcase=0;
- char flag_hash=0;
- char flag_left=0;
- char flag_space=0;
- char flag_sign=0;
- char flag_dot=0;
- signed char flag_long=0;
-
- unsigned int base;
- unsigned int width=0, preci=0;
-
- long number=0;
-#ifdef WANT_LONGLONG_PRINTF
- long long llnumber=0;
-#endif
-
- ++format;
-inn_printf:
- switch(ch=*format++) {
- case 0:
- return -1;
- break;
-
- /* FLAGS */
- case '#':
- flag_hash=-1;
- case 'z':
- goto inn_printf;
-
- case 'h':
- --flag_long;
- goto inn_printf;
- case 'L':
- ++flag_long; /* fall through */
- case 'l':
- ++flag_long;
- goto inn_printf;
-
- case '0':
- padwith='0';
- goto inn_printf;
-
- case '-':
- flag_left=1;
- goto inn_printf;
-
- case ' ':
- flag_space=1;
- goto inn_printf;
-
- case '+':
- flag_sign=1;
- goto inn_printf;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if(flag_dot) return -1;
- width=strtoul(format-1,(char**)&s,10);
- format=s;
- goto inn_printf;
-
- case '*':
- width=va_arg(arg_ptr,int);
- goto inn_printf;
-
- case '.':
- flag_dot=1;
- if (*format=='*') {
- preci=va_arg(arg_ptr,int);
- ++format;
- } else {
- long int tmp=strtol(format,(char**)&s,10);
- preci=tmp<0?0:tmp;
- format=s;
- }
- goto inn_printf;
-
- /* print a char or % */
- case 'c':
- ch=(char)va_arg(arg_ptr,int);
- case '%':
- A_WRITE(fn,&ch,1); ++len;
- break;
-
- /* print a string */
- case 's':
- s=va_arg(arg_ptr,char *);
-#ifdef WANT_NULL_PRINTF
- if (!s) s="(null)";
-#endif
- sz = strlen(s);
- if (flag_dot && sz>preci) sz=preci;
- flag_dot^=flag_dot;
-
-print_out:
- if (width && (!flag_left)) {
- if (flag_in_sign) {
- A_WRITE(fn,s,1); ++len;
- ++s; --sz;
- --width;
- }
- if (flag_hash>0) {
- A_WRITE(fn,s,flag_hash); len+=flag_hash;
- s+=flag_hash; sz-=flag_hash;
- width-=flag_hash;
- }
-// len+=write_pad(fn,(signed int)width-(signed int)sz,padwith);
- if (flag_dot) {
- len+=write_pad(fn,(signed int)width-(signed int)preci,padwith);
- len+=write_pad(fn,(signed int)preci-(signed int)sz,'0');
- } else
- len+=write_pad(fn,(signed int)width-(signed int)sz,padwith);
- }
- A_WRITE(fn,s,sz); len+=sz;
- if (width && (flag_left)) {
- len+=write_pad(fn,(signed int)width-(signed int)sz,' ');
- }
- break;
-
- /* print an integer value */
- case 'b':
- base=2;
- sz=0;
- goto num_printf;
- case 'p':
- flag_hash=2;
- flag_long=1;
- ch='x';
- case 'X':
- flag_upcase=(ch=='X');
- case 'x':
- base=16;
- sz=0;
- if (flag_dot) width=preci;
- if (flag_hash) {
- buf[1]='0';
- buf[2]=ch;
- flag_hash=2;
- sz=2;
- }
- goto num_printf;
- case 'd':
- case 'i':
- flag_in_sign=1;
- case 'u':
- base=10;
- sz=0;
- goto num_printf;
- case 'o':
- base=8;
- sz=0;
- if (flag_hash) {
- buf[1]='0';
- flag_hash=1;
- ++sz;
- }
-
-num_printf:
- s=buf+1;
-
- if (flag_long>0) {
-#ifdef WANT_LONGLONG_PRINTF
- if (flag_long>1)
- llnumber=va_arg(arg_ptr,long long);
- else
-#endif
- number=va_arg(arg_ptr,long);
- }
- else
- number=va_arg(arg_ptr,int);
-
- if (flag_in_sign) {
-#ifdef WANT_LONGLONG_PRINTF
- if ((flag_long>1)&&(llnumber<0)) {
- llnumber=-llnumber;
- flag_in_sign=2;
- } else
-#endif
- if (number<0) {
- number=-number;
- flag_in_sign=2;
- }
- }
- if (flag_long<0) number&=0xffff;
- if (flag_long<-1) number&=0xff;
-#ifdef WANT_LONGLONG_PRINTF
- if (flag_long>1)
- sz += __lltostr(s+sz,sizeof(buf)-5,(unsigned long long) llnumber,base,flag_upcase);
- else
-#endif
- sz += __ltostr(s+sz,sizeof(buf)-5,(unsigned long) number,base,flag_upcase);
-
- if (flag_in_sign==2) {
- *(--s)='-';
- ++sz;
- } else if ((flag_in_sign)&&(flag_sign || flag_space)) {
- *(--s)=(flag_sign)?'+':' ';
- ++sz;
- } else flag_in_sign=0;
-
- goto print_out;
-
-#ifdef WANT_FLOATING_POINT_IN_PRINTF
- /* print a floating point value */
- case 'f':
- case 'g':
- {
- int g=(ch=='g');
- double d=va_arg(arg_ptr,double);
- if (width==0) width=1;
- if (!flag_dot) preci=6;
- sz=__dtostr(d,buf,sizeof(buf),width,preci);
- if (flag_dot) {
- char *tmp;
- if ((tmp=strchr(buf,'.'))) {
- ++tmp;
- while (preci>0 && *++tmp) --preci;
- *tmp=0;
- }
- }
- if (g) {
- char *tmp,*tmp1; /* boy, is _this_ ugly! */
- if ((tmp=strchr(buf,'.'))) {
- tmp1=strchr(tmp,'e');
- while (*tmp) ++tmp;
- if (tmp1) tmp=tmp1;
- while (*--tmp=='0') ;
- if (*tmp!='.') ++tmp;
- *tmp=0;
- if (tmp1) strcpy(tmp,tmp1);
- }
- }
- preci=strlen(buf);
- s=buf;
-
- goto print_out;
- }
-#endif
-
- default:
- break;
- }
- }
- }
- return len;
-}
-
-link_warning("__v_printf","warning: the printf functions add several kilobytes of bloat.")
-
diff --git a/mdk-stage1/dietlibc/lib/__v_scanf.c b/mdk-stage1/dietlibc/lib/__v_scanf.c
deleted file mode 100644
index 6db51db59..000000000
--- a/mdk-stage1/dietlibc/lib/__v_scanf.c
+++ /dev/null
@@ -1,391 +0,0 @@
-#include "dietfeatures.h"
-#include <stdarg.h>
-#include <sys/types.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-#include "dietstdio.h"
-#include "dietwarning.h"
-
-#define A_GETC(fn) (++consumed,(fn)->getch((fn)->data))
-#define A_PUTC(c,fn) (--consumed,(fn)->putch((c),(fn)->data))
-
-int __v_scanf(struct arg_scanf* fn, const unsigned char *format, va_list arg_ptr)
-{
- unsigned int ch; /* format act. char */
- int n=0;
-
- /* arg_ptr tmps */
-#ifdef WANT_FLOATING_POINT_IN_SCANF
- double *pd;
- float *pf;
-#endif
-#ifdef WANT_LONGLONG_SCANF
- long long *pll;
-#endif
- long *pl;
- short *ph;
- int *pi;
- char *s;
-
- unsigned int consumed=0;
-
- /* get one char */
- int tpch= A_GETC(fn);
-
- //while ((tpch!=-1)&&(*format))
- while (*format)
- {
-// const unsigned char *prev_fmt=format;
- ch=*format++;
- switch (ch) {
- /* end of format string ?!? */
- case 0: return 0;
-
- /* skip spaces ... */
- case ' ':
- case '\f':
- case '\t':
- case '\v':
- case '\n':
- case '\r':
- while((*format)&&(isspace(*format))) ++format;
- while(isspace(tpch)) tpch=A_GETC(fn);
- break;
-
- /* format string ... */
- case '%':
- {
- unsigned int _div=0;
- int width=-1;
- char flag_width=0;
- char flag_discard=0;
- char flag_half=0;
- char flag_long=0;
- char flag_longlong=0;
-
-in_scan:
- ch=*format++;
- if(ch!='n' && tpch==-1) goto err_out;
- switch (ch) {
- /* end of format string ?!? */
- case 0: return 0;
-
- /* check for % */
- case '%':
- if ((unsigned char)tpch != ch) goto err_out;
- tpch=A_GETC(fn);
- break;
-
- /* FLAGS */
- case '*':
- flag_discard=1;
- goto in_scan;
- case 'h':
- flag_half=1;
- goto in_scan;
- case 'l':
- if (flag_long) flag_longlong=1;
- flag_long=1;
- goto in_scan;
- case 'q':
- case 'L':
- flag_longlong=1;
- goto in_scan;
-
- /* WIDTH */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- width=strtol(format-1,&s,10);
- format=s;
- flag_width=1;
- goto in_scan;
-
- /* scan for integer / strtol reimplementation ... */
- case 'p':
- case 'X':
- case 'x':
- _div+=6;
- case 'd':
- _div+=2;
- case 'o':
- _div+=8;
- case 'u':
- case 'i':
- {
-#ifdef WANT_LONGLONG_SCANF
- unsigned long long v=0;
-#else
- unsigned long v=0;
-#endif
- unsigned int consumedsofar=consumed;
- int neg=0;
- while(isspace(tpch)) tpch=A_GETC(fn);
- if (tpch=='-') {
- tpch=A_GETC(fn);
- neg=1;
- }
-
- if (tpch=='+') tpch=A_GETC(fn);
-
- if (!flag_width) {
- if ((_div==16) && (tpch=='0')) goto scan_hex;
- if (!_div) {
- _div=10;
- if (tpch=='0') {
- _div=8;
-scan_hex:
- tpch=A_GETC(fn);
- if ((tpch|32)=='x') {
- tpch=A_GETC(fn);
- _div=16;
- }
- }
- }
- }
- while ((width)&&(tpch!=-1)) {
- register unsigned long c=tpch&0xff;
-#ifdef WANT_LONGLONG_SCANF
- register unsigned long long d=c|0x20;
-#else
- register unsigned long d=c|0x20;
-#endif
- c=(d>='a'?d-'a'+10:c<='9'?c-'0':0xff);
- if (c>=_div) break;
- d=v*_div;
-#ifdef WANT_LONGLONG_SCANF
- v=(d<v)?ULLONG_MAX:d+c;
-#else
- v=(d<v)?ULONG_MAX:d+c;
-#endif
- --width;
- tpch=A_GETC(fn);
- }
- if ((ch|0x20)<'p') {
-#ifdef WANT_LONGLONG_SCANF
- register long long l=v;
- if (v>=-((unsigned long long)LLONG_MIN)) {
- l=(neg)?LLONG_MIN:LLONG_MAX;
- }
- else {
- if (neg) v*=-1;
- }
-#else
- register long l=v;
- if (v>=-((unsigned long)LONG_MIN)) {
- l=(neg)?LONG_MIN:LONG_MAX;
- }
- else {
- if (neg) v*=-1;
- }
-#endif
- }
- if (!flag_discard) {
-#ifdef WANT_LONGLONG_SCANF
- if (flag_longlong) {
- pll=(long long *)va_arg(arg_ptr,long long*);
- *pll=v;
- } else
-#endif
- if (flag_long) {
- pl=(long *)va_arg(arg_ptr,long*);
- *pl=v;
- } else if (flag_half) {
- ph=(short*)va_arg(arg_ptr,short*);
- *ph=v;
- } else {
- pi=(int *)va_arg(arg_ptr,int*);
- *pi=v;
- }
- if(consumedsofar<consumed)
- ++n;
- }
- }
- break;
-
-#ifdef WANT_FLOATING_POINT_IN_SCANF
- /* floating point numbers */
- case 'e':
- case 'E':
- case 'f':
- case 'g':
- {
- double d=0.0;
- int neg=0;
-
- while(isspace(tpch)) tpch=A_GETC(fn);
-
- if (tpch=='-') {
- tpch=A_GETC(fn);
- neg=1;
- }
- if (tpch=='+') tpch=A_GETC(fn);
-
- while (isdigit(tpch)) {
- d=d*10+(tpch-'0');
- tpch=A_GETC(fn);
- }
- if (tpch=='.') {
- double factor=.1;
- tpch=A_GETC(fn);
- while (isdigit(tpch)) {
- d=d+(factor*(tpch-'0'));
- factor/=10;
- tpch=A_GETC(fn);
- }
- }
- if ((tpch|0x20)=='e') {
- int exp=0, prec=tpch;
- double factor=10;
- tpch=A_GETC(fn);
- if (tpch=='-') {
- factor=0.1;
- tpch=A_GETC(fn);
- } else if (tpch=='+') {
- tpch=A_GETC(fn);
- } else {
- d=0;
- if (tpch!=-1) A_PUTC(tpch,fn);
- tpch=prec;
- goto exp_out;
- }
- while (isdigit(tpch)) {
- exp=exp*10+(tpch-'0');
- tpch=A_GETC(fn);
- }
- while (exp) { /* as in strtod: XXX: this introduces rounding errors */
- d*=factor; --exp;
- }
- }
-exp_out:
- if (!flag_discard) {
- if (flag_long) {
- pd=(double *)va_arg(arg_ptr,double*);
- *pd=d;
- } else {
- pf=(float *)va_arg(arg_ptr,float*);
- *pf=d;
- }
- }
- ++n;
- }
- break;
-#endif
-
- /* char-sequences */
- case 'c':
- if (!flag_discard) {
- s=(char *)va_arg(arg_ptr,char*);
- ++n;
- }
- if (!flag_width) width=1;
- while (width && (tpch!=-1)) {
- if (!flag_discard) *(s++)=tpch;
- --width;
- tpch=A_GETC(fn);
- }
- break;
-
- /* c-string */
- case 's':
- if (!flag_discard) s=(char *)va_arg(arg_ptr,char*);
- while(isspace(tpch)) tpch=A_GETC(fn);
- while (width && (tpch!=-1) && (!isspace(tpch))) {
- if (!flag_discard) *s=tpch;
- if (tpch) ++s; else break;
- --width;
- tpch=A_GETC(fn);
- }
- if (!flag_discard) { *s=0; n++; }
- break;
-
- /* consumed-count */
- case 'n':
- if (!flag_discard) {
- s=(char *)va_arg(arg_ptr,char*);
-// ++n; /* in accordance to ANSI C we don't count this conversion */
- }
- if (!flag_discard) *(s++)=consumed-1;
- break;
-
-#ifdef WANT_CHARACTER_CLASSES_IN_SCANF
- case '[':
- {
- char cset[256];
- int flag_not=0;
- int flag_dash=0;
- memset(cset,0,sizeof(cset));
- ch=*format++;
- /* first char specials */
- if (ch=='^') {
- flag_not=1;
- ch=*format++;
- }
- if ((ch=='-')||(ch==']')) {
- cset[ch]=1;
- ch=*format++;
- }
- /* almost all non special chars */
- for (;(*format) && (*format!=']');++format) {
- if (flag_dash) {
- register unsigned char tmp=*format;
- for (;ch<=tmp;++ch) cset[ch]=1;
- flag_dash=0;
- ch=*format;
- }
- else if (*format=='-') flag_dash=1;
- else {
- cset[ch]=1;
- ch=*format;
- }
- }
- /* last char specials */
- if (flag_dash) cset['-']=1;
- else cset[ch]=1;
-
- /* like %c or %s */
- if (!flag_discard) {
- s=(char *)va_arg(arg_ptr,char*);
- ++n;
- }
- while (width && (tpch>=0) && (cset[tpch]^flag_not)) {
- if (!flag_discard) *s=tpch;
- if (tpch) ++s; else break;
- --width;
- tpch=A_GETC(fn);
- }
- if (!flag_discard) *s=0;
- ++format;
- }
- break;
-#endif
- default:
- goto err_out;
- }
- }
- break;
-
- /* check if equal format string... */
- default:
- if ((unsigned char)tpch != ch) goto err_out;
- tpch=A_GETC(fn);
- break;
- }
- }
-err_out:
- if (tpch<0 && n==0) return EOF;
- A_PUTC(tpch,fn);
- return n;
-}
-
-link_warning("__v_scanf","warning: the scanf functions add several kilobytes of bloat.");
diff --git a/mdk-stage1/dietlibc/lib/_brk.c b/mdk-stage1/dietlibc/lib/_brk.c
deleted file mode 100644
index e73d7b621..000000000
--- a/mdk-stage1/dietlibc/lib/_brk.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-
-extern void* __diet_brk(void *end_data_segment);
-
-void* __curbrk=0;
-
-int __libc_brk(void *end_data_segment);
-
-int __libc_brk(void *end_data_segment) {
- return ((__curbrk=__diet_brk(end_data_segment))==(void*)-1?-1:0);
-}
-
-int brk(void *end_data_segment) __attribute__((weak,alias("__libc_brk")));
diff --git a/mdk-stage1/dietlibc/lib/abort.c b/mdk-stage1/dietlibc/lib/abort.c
deleted file mode 100644
index 7c49a32ef..000000000
--- a/mdk-stage1/dietlibc/lib/abort.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sys/types.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifndef __PIC__
-void __stdio_flushall(void) __attribute__((weak));
-void __stdio_flushall(void) { }
-#endif
-
-void abort() {
- sigset_t t;
- __stdio_flushall();
- if (!sigemptyset(&t) && !sigaddset(&t, SIGABRT))
- sigprocmask(SIG_UNBLOCK, &t, 0);
- while (1)
- if (raise(SIGABRT))
- exit(127);
-}
diff --git a/mdk-stage1/dietlibc/lib/abs.c b/mdk-stage1/dietlibc/lib/abs.c
deleted file mode 100644
index d3b75f202..000000000
--- a/mdk-stage1/dietlibc/lib/abs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <endian.h>
-
-int abs(int i) { return i>=0?i:-i; }
-#if __WORDSIZE == 32
-long labs(long i) __attribute__((alias("abs")));
-#endif
diff --git a/mdk-stage1/dietlibc/lib/accept.c b/mdk-stage1/dietlibc/lib/accept.c
deleted file mode 100644
index 08359b894..000000000
--- a/mdk-stage1/dietlibc/lib/accept.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_accept(int a, void * addr, void * addr2);
-
-int __libc_accept(int a, void * addr, void * addr2) {
- unsigned long args[] = { a, (long) addr, (long) addr2 };
- return socketcall(SYS_ACCEPT, args);
-}
-
-int accept(int a, void * addr, void * addr2) __attribute__((weak,alias("__libc_accept")));
diff --git a/mdk-stage1/dietlibc/lib/adjtime.c b/mdk-stage1/dietlibc/lib/adjtime.c
deleted file mode 100644
index b8986be57..000000000
--- a/mdk-stage1/dietlibc/lib/adjtime.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <time.h>
-#include <sys/timex.h>
-
-int adjtime (const struct timeval *itv, struct timeval *otv) {
- struct timex tmp;
- if (itv) {
- tmp.offset = (itv->tv_usec % 1000000L) + (itv->tv_sec + itv->tv_usec / 1000000L) * 1000000L;
- tmp.modes = ADJ_OFFSET_SINGLESHOT;
- } else
- tmp.modes = 0;
- if (adjtimex(&tmp)==-1)
- return -1;
- if (otv) {
- otv->tv_usec = tmp.offset % 1000000;
- otv->tv_sec = tmp.offset / 1000000;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/alloc.c b/mdk-stage1/dietlibc/lib/alloc.c
deleted file mode 100644
index a2b3b73a1..000000000
--- a/mdk-stage1/dietlibc/lib/alloc.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * malloc/free by O.Dreesen
- *
- * first TRY:
- * lists w/magics
- * and now the second TRY
- * let the kernel map all the stuff (if there is something to do)
- */
-
-#include <unistd.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sys/shm.h> /* for PAGE_SIZE */
-
-
-/* -- HELPER CODE --------------------------------------------------------- */
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void*)-1)
-#endif
-
-#ifndef NULL
-#define NULL ((void*)0)
-#endif
-
-typedef union {
- void* next;
- size_t size;
-} __alloc_t;
-
-#define BLOCK_START(b) (((void*)(b))-sizeof(__alloc_t))
-#define BLOCK_RET(b) (((void*)(b))+sizeof(__alloc_t))
-
-#define MEM_BLOCK_SIZE PAGE_SIZE
-#define PAGE_ALIGN(s) (((s)+MEM_BLOCK_SIZE-1)&(unsigned long)(~(MEM_BLOCK_SIZE-1)))
-
-/* a simple mmap :) */
-
-#ifdef __i386__
-/* regparm exists only on i386 */
-static void *do_mmap(size_t size) __attribute__((regparm(1)));
-static size_t get_index(size_t _size) __attribute__((regparm(1)));
-static void* __small_malloc(size_t _size) __attribute__((regparm(1)));
-#endif
-
-static void *do_mmap(size_t size) {
- return mmap(0, size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, (size_t)0);
-}
-
-/* -- SMALL MEM ----------------------------------------------------------- */
-
-static __alloc_t* __small_mem[8];
-
-#define __SMALL_NR(i) (MEM_BLOCK_SIZE/(i))
-
-#define __MIN_SMALL_SIZE __SMALL_NR(256) /* 16 / 32 */
-#define __MAX_SMALL_SIZE __SMALL_NR(2) /* 2048 / 4096 */
-
-#define GET_SIZE(s) (__MIN_SMALL_SIZE<<get_index((s)))
-
-#define FIRST_SMALL(p) (((unsigned long)(p))&(~(MEM_BLOCK_SIZE-1)))
-
-static inline int __ind_shift() { return (MEM_BLOCK_SIZE==4096)?4:5; }
-
-static size_t get_index(size_t _size) {
- register size_t idx=0;
- if (_size) {
- register size_t size=((_size-1)&(MEM_BLOCK_SIZE-1))>>__ind_shift();
- while(size) { size>>=1; ++idx; }
- }
- return idx;
-}
-
-/* small mem */
-static void __small_free(void*_ptr,size_t _size) __attribute__((regparm(2)));
-
-static void __small_free(void*_ptr,size_t _size) {
- __alloc_t* ptr=BLOCK_START(_ptr);
- size_t size=_size;
- size_t idx=get_index(size);
-
- memset(ptr,0,size); /* allways zero out small mem */
-
- ptr->next=__small_mem[idx];
- __small_mem[idx]=ptr;
-}
-
-static void* __small_malloc(size_t _size) {
- __alloc_t *ptr;
- size_t size=_size;
- size_t idx;
-
- idx=get_index(size);
- ptr=__small_mem[idx];
-
- if (ptr==0) { /* no free blocks ? */
- register int i,nr;
- ptr=do_mmap(MEM_BLOCK_SIZE);
- if (ptr==MAP_FAILED) return MAP_FAILED;
-
- __small_mem[idx]=ptr;
-
- nr=__SMALL_NR(size)-1;
- for (i=0;i<nr;i++) {
- ptr->next=(((void*)ptr)+size);
- ptr=ptr->next;
- }
- ptr->next=0;
-
- ptr=__small_mem[idx];
- }
-
- /* get a free block */
- __small_mem[idx]=ptr->next;
- ptr->next=0;
-
- return ptr;
-}
-
-/* -- PUBLIC FUNCTIONS ---------------------------------------------------- */
-
-static void _alloc_libc_free(void *ptr) {
- register size_t size;
- if (ptr) {
- size=((__alloc_t*)BLOCK_START(ptr))->size;
- if (size) {
- if (size<=__MAX_SMALL_SIZE)
- __small_free(ptr,size);
- else
- munmap(BLOCK_START(ptr),size);
- }
- }
-}
-void __libc_free(void *ptr) __attribute__((alias("_alloc_libc_free")));
-void free(void *ptr) __attribute__((weak,alias("_alloc_libc_free")));
-void if_freenameindex(void* ptr) __attribute__((alias("free")));
-
-#ifdef WANT_MALLOC_ZERO
-static __alloc_t zeromem[2]={{0},{0}};
-#endif
-
-static void* _alloc_libc_malloc(size_t size) {
- __alloc_t* ptr;
- size_t need;
-#ifdef WANT_MALLOC_ZERO
- if (!size) return BLOCK_RET(zeromem);
-#else
- if (!size) goto retzero;
-#endif
- size+=sizeof(__alloc_t);
- if (size<sizeof(__alloc_t)) goto retzero;
- if (size<=__MAX_SMALL_SIZE) {
- need=GET_SIZE(size);
- ptr=__small_malloc(need);
- }
- else {
- need=PAGE_ALIGN(size);
- if (!need) ptr=MAP_FAILED; else ptr=do_mmap(need);
- }
- if (ptr==MAP_FAILED) goto err_out;
- ptr->size=need;
- return BLOCK_RET(ptr);
-err_out:
- (*__errno_location())=ENOMEM;
-retzero:
- return 0;
-}
-void* __libc_malloc(size_t size) __attribute__((alias("_alloc_libc_malloc")));
-void* malloc(size_t size) __attribute__((weak,alias("_alloc_libc_malloc")));
-
-void *calloc(size_t nmemb, size_t _size) {
- register size_t size=_size*nmemb;
- if (nmemb && size/nmemb!=_size) {
- (*__errno_location())=ENOMEM;
- return 0;
- }
- return malloc(size);
-}
-
-void* __libc_realloc(void* ptr, size_t _size);
-void* __libc_realloc(void* ptr, size_t _size) {
- register size_t size=_size;
- if (ptr) {
- if (size) {
- __alloc_t* tmp=BLOCK_START(ptr);
- size+=sizeof(__alloc_t);
- if (size<sizeof(__alloc_t)) goto retzero;
- size=(size<=__MAX_SMALL_SIZE)?GET_SIZE(size):PAGE_ALIGN(size);
- if (tmp->size!=size) {
- if ((tmp->size<=__MAX_SMALL_SIZE)) {
- void *new=_alloc_libc_malloc(_size);
- if (new) {
- register __alloc_t* foo=BLOCK_START(new);
- size=foo->size;
- if (size>tmp->size) size=tmp->size;
- if (size) memcpy(new,ptr,size-sizeof(__alloc_t));
- _alloc_libc_free(ptr);
- }
- ptr=new;
- }
- else {
- register __alloc_t* foo;
- size=PAGE_ALIGN(size);
- foo=mremap(tmp,tmp->size,size,MREMAP_MAYMOVE);
- if (foo==MAP_FAILED) {
-retzero:
- (*__errno_location())=ENOMEM;
- ptr=0;
- }
- else {
- foo->size=size;
- ptr=BLOCK_RET(foo);
- }
- }
- }
- }
- else { /* size==0 */
- _alloc_libc_free(ptr);
- }
- }
- else { /* ptr==0 */
- if (size) {
- ptr=_alloc_libc_malloc(size);
- }
- }
- return ptr;
-}
-void* realloc(void* ptr, size_t size) __attribute__((weak,alias("__libc_realloc")));
-
diff --git a/mdk-stage1/dietlibc/lib/assert_fail.c b/mdk-stage1/dietlibc/lib/assert_fail.c
deleted file mode 100644
index 35b8b186a..000000000
--- a/mdk-stage1/dietlibc/lib/assert_fail.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "dietwarning.h"
-#include <write12.h>
-
-void __assert_fail (const char *assertion, const char *file, unsigned int line, const char *function);
-
-void __assert_fail (const char *assertion, const char *file, unsigned int line, const char *function)
-{
- unsigned int alen=strlen(assertion);
- unsigned int flen=strlen(file);
- unsigned int fulen=function?strlen(function):0;
- char *buf=(char*)alloca(alen+flen+fulen+50);
- if (buf) {
- char *tmp;
- *buf=0;
- if (file) strcat(strcat(buf,file),":");
- tmp=buf+strlen(buf);
- __ltostr(tmp,10,line,10,0);
- strcat(buf,": ");
- if (function) strcat(strcat(buf,function),": ");
- strcat(buf,"Assertion `");
- strcat(buf,assertion);
- strcat(buf,"' failed.\n");
- __write2(buf);
- }
- abort();
-}
-
-link_warning("__assert_fail","warning: your code still has assertions enabled!")
diff --git a/mdk-stage1/dietlibc/lib/atexit.c b/mdk-stage1/dietlibc/lib/atexit.c
deleted file mode 100644
index e0eef19c6..000000000
--- a/mdk-stage1/dietlibc/lib/atexit.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdlib.h>
-
-typedef void (*function)(void);
-
-#define NUM_ATEXIT 32
-
-static function __atexitlist[NUM_ATEXIT];
-static int atexit_counter = 0;
-
-int atexit(function t) {
- if (atexit_counter<NUM_ATEXIT) {
- __atexitlist[atexit_counter]=t;
- ++atexit_counter;
- return 0;
- }
- return -1;
-}
-
-extern void _exit(int code) __attribute__((noreturn));
-extern void __thread_doexit();
-
-void __libc_exit(int code);
-void __libc_exit(int code) {
- register int i=atexit_counter;
- __thread_doexit();
- while(i) {
- __atexitlist[--i]();
- }
- _exit(code);
-}
-void exit(int code) __attribute__((alias("__libc_exit")));
diff --git a/mdk-stage1/dietlibc/lib/atof.c b/mdk-stage1/dietlibc/lib/atof.c
deleted file mode 100644
index 54221390e..000000000
--- a/mdk-stage1/dietlibc/lib/atof.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdlib.h>
-
-double atof(const char *nptr) {
-#if 0
- return strtod(nptr,0);
-#else
- double tmp=strtod(nptr,0);
- return tmp;
-#endif
-}
diff --git a/mdk-stage1/dietlibc/lib/atoi.c b/mdk-stage1/dietlibc/lib/atoi.c
deleted file mode 100644
index 10b618950..000000000
--- a/mdk-stage1/dietlibc/lib/atoi.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <endian.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#if __WORDSIZE == 64
-int atoi(const char* s) {
- long int v=0;
- int sign=1;
- while ( *s == ' ' || (unsigned int)(*s - 9) < 5u) s++;
- switch (*s) {
- case '-': sign=-1;
- case '+': ++s;
- }
- while ((unsigned int) (*s - '0') < 10u) {
- v=v*10+*s-'0'; ++s;
- }
- return sign==-1?-v:v;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/atol.c b/mdk-stage1/dietlibc/lib/atol.c
deleted file mode 100644
index 5961a1881..000000000
--- a/mdk-stage1/dietlibc/lib/atol.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <endian.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-long int atol(const char* s) {
- long int v=0;
- int sign=0;
- while ( *s == ' ' || (unsigned int)(*s - 9) < 5u) ++s;
- switch (*s) {
- case '-': sign=-1;
- case '+': ++s;
- }
- while ((unsigned int) (*s - '0') < 10u) {
- v=v*10+*s-'0'; ++s;
- }
- return sign?-v:v;
-}
-
-#if __WORDSIZE == 64
-long long int atoll(const char* s) __attribute__((alias("atol")));
-#else
-int atoi(const char* s) __attribute__((alias("atol")));
-#endif
diff --git a/mdk-stage1/dietlibc/lib/atoll.c b/mdk-stage1/dietlibc/lib/atoll.c
deleted file mode 100644
index 7bf2b2fd6..000000000
--- a/mdk-stage1/dietlibc/lib/atoll.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <endian.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#if __WORDSIZE != 64
-long long int atoll(const char* s) {
- long long int v=0;
- int sign=1;
- while ( *s == ' ' || (unsigned int)(*s - 9) < 5u) ++s;
- switch (*s) {
- case '-': sign=-1;
- case '+': ++s;
- }
- while ((unsigned int) (*s - '0') < 10u) {
- v=v*10+*s-'0'; ++s;
- }
- return sign==-1?-v:v;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/bcd.c b/mdk-stage1/dietlibc/lib/bcd.c
deleted file mode 100644
index 1936b82f6..000000000
--- a/mdk-stage1/dietlibc/lib/bcd.c
+++ /dev/null
@@ -1,185 +0,0 @@
-
-static long double powers [] = {
- 1.e+1, 1.e+2, 1.e+4, 1.e+8, 1.e+16, 1.e+32, 1.e+64, 1.e+128, 1.e+256
-};
-
-/*
- * So, die ist zum Zerlegen von Gleitkommazahlen am besten geeignet.
- *
- * Die nichtnegative übergebende Gleitkommazahl number wird in einen
- * Exponenten e und eine Mantisse m zerlegt mit:
- *
- * 1 <= m < 10
- * number = m * 10^e
- *
- * Die Mantisse wird in precision Dezimalstellen zerlegt, die nach digits
- * geschrieben werden. digits[0] ist die Vorkommastelle, digits [1 ...
- * precision-1] die Nachkommastellen der Mantisse Zurückgeliefert wird der
- * Exponent.
- *
- * Für precision ist ein Wert von 0 erlaubt, Sinn machen allerdings erst
- * Werte ab 1.
- */
-
-int __decompose_floatp ( long double number,
- unsigned char* digits, unsigned int precision );
-
-int __decompose_floatp ( long double number,
- unsigned char* digits, unsigned int precision )
-{
- int ret = 0;
- int i;
- double tmp;
-
- if ( number > 0.L ) {
-
- // Exponent abtrennen
- if ( number >= 10.L ) {
- for ( i = sizeof(powers)/sizeof(*powers)-1; i >= 0; i--)
- if ( number >= powers [i] ) {
- number /= powers [i];
- ret += 1 << i;
- }
- } else if ( number < 1.L )
- for ( i = sizeof(powers)/sizeof(*powers)-1; i >= 0; i--)
- if ( number * powers [i] < 10.L ) {
- number *= powers [i];
- ret -= 1 << i;
- }
-
- // Runden (ohne Geradezahlregel => Bug)
- tmp = 5.;
- {
- unsigned int j;
- for ( j = 0; j < precision; j++ )
- tmp *= 0.1;
- }
-
- number += tmp;
-
- // Dabei kann die Zahl in die nächste Dekade reinrutschen ...
- if ( number >= 10.L ) {
- number = 1.L;
- ret++;
- }
- }
-
- // Mantisse in ASCII konvertieren
- while ( precision-- ) {
- i = (int) number;
- number = (number - i) * 10.L;
- *digits++ = '0' + i;
- }
-
- // Exponent zurück
- return ret;
-}
-
-
-/*
- * So, die ist zum Zerlegen von Festkommazahlen am besten geeignet.
- *
- * Die nichtnegative übergebende Festkomma wird in einen Integeranteil und
- * einen Bruchanteil zerlegt.
- *
- * Der Bruchanteil wird in digits_frac[0...precision_frac-1] gespeichert,
- * falls precision_frac != 0 ist.
- *
- * Der Integeranteil wird ab digits_int + precision_int - 1 rückwrts
- * geschrieben. Zurückgeliefert wird ein Zeiger auf das erste Zeichen, das
- * bei der Konvertierung != '0' ist (Ausnahme ist die 0.0 selbst). Zeichen
- * zwischen digits_int und diesem Zeiger (exklusive des Zeichens unter dem
- * Zeiger) sind unbestimmt. Wünscht man dort Nullen oder Leerzeichen,
- * sollte man mittels memset() dieses vorher initialsieren.
- */
-
-char* __decompose_fixp ( long double number,
- unsigned char* digits_int , unsigned int precision_int,
- unsigned char* digits_frac, unsigned int precision_frac );
-
-char* __decompose_fixp ( long double number,
- unsigned char* digits_int , unsigned int precision_int,
- unsigned char* digits_frac, unsigned int precision_frac )
-{
- long long int integer;
- double tmp;
- int i;
-
- // Runden (ohne Geradezahlregel => Bug)
- tmp = 0.5;
- {
- unsigned int j;
- for ( j = 0; j < precision_frac; j++ )
- tmp *= 0.1;
- }
-
- number += tmp;
-
- integer = number;
- number -= integer;
-
- // Nachkommastellen
- while ( precision_frac-- ) {
- number *= 10.L;
- i = (int) number;
- number -= i;
- *digits_frac++
- = '0' + i;
- }
-
- // Vorkommastellen
- while ( precision_int ) {
- i = (int) (integer % 10);
- integer /= 10;
- digits_int [--precision_int]
- = '0' + i;
- if ( integer == 0 )
- break;
- }
-
- return digits_int + precision_int;
-}
-
-
-#if 0
-
-#include <stdio.h>
-#include <math.h>
-
-long double test [] = {
- 1, M_PI, 123, 123456789, 12345678901234567, 1e300, 0.00123456789, 1.234567890123456e-300, 0
-};
-
-int main ( void )
-{
- int i;
- int j;
- int k;
- char buff1 [32];
- char buff2 [32];
- char* retp;
- int ret;
-
- for ( i = 0; i < sizeof(test)/sizeof(*test); i++ ) {
- printf ("\n*** %30.20Lf ***\n\n", test[i] );
-
- for ( j = 0; j <= 20; j++ ) {
- memset ( buff1, 0, sizeof(buff1) );
- ret = __decompose_floatp ( test[i], buff1, j );
- printf ( "floatp(%2u) = <%sE%+d>\n", j, buff1, ret );
- }
- for ( j = 0; j <= 20; j++ ) {
- for ( k = 0; k <= 20; k++ ) {
- memset ( buff1, 0, sizeof(buff1) );
- memset ( buff2, 0, sizeof(buff2) );
- retp = __decompose_fixp ( test[i], buff1, j, buff2, k );
- printf ( "fixp(%2u,%2u) = <%s.%s>\n", j, k, retp, buff2 );
- }
- }
-
- }
-
- return 0;
-}
-
-#endif
diff --git a/mdk-stage1/dietlibc/lib/bind.c b/mdk-stage1/dietlibc/lib/bind.c
deleted file mode 100644
index dae80f491..000000000
--- a/mdk-stage1/dietlibc/lib/bind.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_bind(int a, void * b, int c);
-int __libc_bind(int a, void * b, int c) {
- unsigned long args[] = { a, (long) b, c };
- return socketcall(SYS_BIND, args);
-}
-
-int bind(int a, void * b, int c) __attribute__((weak,alias("__libc_bind")));
diff --git a/mdk-stage1/dietlibc/lib/binshstr.c b/mdk-stage1/dietlibc/lib/binshstr.c
deleted file mode 100644
index 814297e3d..000000000
--- a/mdk-stage1/dietlibc/lib/binshstr.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "binshstr.h"
-
-const char __binsh [] = "/bin/sh";
-
-/* end of binshstr.c */
diff --git a/mdk-stage1/dietlibc/lib/bsearch.c b/mdk-stage1/dietlibc/lib/bsearch.c
deleted file mode 100644
index 14605f1f6..000000000
--- a/mdk-stage1/dietlibc/lib/bsearch.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <assert.h>
-#include <stdlib.h>
-
-void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
- size_t m;
- while (nmemb) {
- int tmp;
- void *p;
- m=nmemb/2;
- p=(void *) (((const char *) base) + (m * size));
- if ((tmp=(*compar)(key,p))<0) {
- nmemb=m;
- } else if (tmp>0) {
- base=p+size;
- nmemb-=m+1;
- } else
- return p;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/cfgetospeed.c b/mdk-stage1/dietlibc/lib/cfgetospeed.c
deleted file mode 100644
index c330352b2..000000000
--- a/mdk-stage1/dietlibc/lib/cfgetospeed.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <termios.h>
-#include <sys/types.h>
-
-speed_t cfgetospeed(struct termios *termios_p) {
- return ((termios_p->c_cflag & (CBAUD|CBAUDEX)));
-}
-
-speed_t cfgetispeed(struct termios *termios_p) __attribute__((weak,alias("cfgetospeed")));
diff --git a/mdk-stage1/dietlibc/lib/cfmakeraw.c b/mdk-stage1/dietlibc/lib/cfmakeraw.c
deleted file mode 100644
index e33c783c9..000000000
--- a/mdk-stage1/dietlibc/lib/cfmakeraw.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
-
-void cfmakeraw(struct termios *t) {
- t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
- t->c_oflag &= ~OPOST;
- t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
- t->c_cflag &= ~(CSIZE|PARENB);
- t->c_cflag |= CS8;
- t->c_cc[VMIN] = 1;
- t->c_cc[VTIME] = 0;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/cfsetispeed.c b/mdk-stage1/dietlibc/lib/cfsetispeed.c
deleted file mode 100644
index ab0333853..000000000
--- a/mdk-stage1/dietlibc/lib/cfsetispeed.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <termios.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-#define IBAUD0 020000000000
-
-int cfsetispeed(struct termios *termios_p, speed_t speed)
-{
- if ((speed & (speed_t)~CBAUD) != 0 && (speed < B57600 || speed > B460800)) {
- errno=EINVAL;
- return -1;
- }
- if (speed == 0)
- termios_p->c_iflag |= IBAUD0;
- else {
- termios_p->c_iflag &= ~IBAUD0;
- termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
- termios_p->c_cflag |= speed;
- }
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/cfsetospeed.c b/mdk-stage1/dietlibc/lib/cfsetospeed.c
deleted file mode 100644
index d1aee3595..000000000
--- a/mdk-stage1/dietlibc/lib/cfsetospeed.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <termios.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-int cfsetospeed(struct termios *termios_p, speed_t speed) {
- if ((speed & (speed_t)~CBAUD) != 0 && (speed < B57600 || speed > B460800)) {
- errno=EINVAL;
- return -1;
- }
- termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
- termios_p->c_cflag |= speed;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/closedir.c b/mdk-stage1/dietlibc/lib/closedir.c
deleted file mode 100644
index 3aade81b3..000000000
--- a/mdk-stage1/dietlibc/lib/closedir.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "dietdirent.h"
-#include <sys/mman.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <stdlib.h>
-
-int closedir (DIR* d) {
- int res=close(d->fd);
- munmap (d, PAGE_SIZE);
- return res;
-}
diff --git a/mdk-stage1/dietlibc/lib/connect.c b/mdk-stage1/dietlibc/lib/connect.c
deleted file mode 100644
index 642303ef3..000000000
--- a/mdk-stage1/dietlibc/lib/connect.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_connect(int a, void * b, int c);
-int __libc_connect(int a, void * b, int c) {
- unsigned long args[] = { a, (long) b, c };
- return socketcall(SYS_CONNECT, args);
-}
-
-int connect(int a, void * b, int c) __attribute__((weak,alias("__libc_connect")));
diff --git a/mdk-stage1/dietlibc/lib/creat.c b/mdk-stage1/dietlibc/lib/creat.c
deleted file mode 100644
index 41d8236aa..000000000
--- a/mdk-stage1/dietlibc/lib/creat.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <fcntl.h>
-
-int __libc_creat(const char *file,mode_t mode);
-int __libc_creat(const char *file,mode_t mode) {
- return open(file,O_WRONLY|O_CREAT|O_TRUNC,mode);
-}
-int creat(const char *file,mode_t mode) __attribute__((weak,alias("__libc_creat")));
diff --git a/mdk-stage1/dietlibc/lib/creat64.c b/mdk-stage1/dietlibc/lib/creat64.c
deleted file mode 100644
index 8cf897b57..000000000
--- a/mdk-stage1/dietlibc/lib/creat64.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <fcntl.h>
-
-#ifndef O_LARGEFILE
-#define O_LARGEFILE 0
-#endif
-
-int creat64(const char *file,mode_t mode) {
- return open(file,O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE,mode);
-}
diff --git a/mdk-stage1/dietlibc/lib/errlistu.c b/mdk-stage1/dietlibc/lib/errlistu.c
deleted file mode 100644
index 15e38807b..000000000
--- a/mdk-stage1/dietlibc/lib/errlistu.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/*
- * used by perror() and strerror()
- */
-
-const char __sys_err_unknown [] = "[unknown error]";
-
diff --git a/mdk-stage1/dietlibc/lib/errno_location.c b/mdk-stage1/dietlibc/lib/errno_location.c
deleted file mode 100644
index 298c9c3cf..000000000
--- a/mdk-stage1/dietlibc/lib/errno_location.c
+++ /dev/null
@@ -1,5 +0,0 @@
-extern int errno;
-
-int *__errno_location(void) __attribute__((weak));
-int *__errno_location() { return &errno; }
-
diff --git a/mdk-stage1/dietlibc/lib/exec_lib.c b/mdk-stage1/dietlibc/lib/exec_lib.c
deleted file mode 100644
index 575c03d6d..000000000
--- a/mdk-stage1/dietlibc/lib/exec_lib.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <unistd.h>
-#include <paths.h>
-
-extern char **environ;
-
-int __exec_shell(const char *file, char *const argv[]);
-int __exec_shell(const char *file, char *const argv[]) {
- int i;
-
- for (i = 0; argv[i]; i++);
-
- {
- const char *shell_argv[i + 1];
- shell_argv[0] = _PATH_BSHELL;
- shell_argv[1] = file;
- for (; i > 1; i--)
- shell_argv[i] = argv[i - 1];
- return execve(_PATH_BSHELL, (char*const*)shell_argv, environ);
- }
-}
-
diff --git a/mdk-stage1/dietlibc/lib/exec_lib.h b/mdk-stage1/dietlibc/lib/exec_lib.h
deleted file mode 100644
index 0971bd1fb..000000000
--- a/mdk-stage1/dietlibc/lib/exec_lib.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __EXEC_LIB_H
-#define __EXEC_LIB_H
-
-#include <paths.h>
-
-extern int __exec_shell(const char *file, char *const argv[]);
-
-#endif /* __EXEC_LIB_H */
-
diff --git a/mdk-stage1/dietlibc/lib/execl.c b/mdk-stage1/dietlibc/lib/execl.c
deleted file mode 100644
index 360bd3908..000000000
--- a/mdk-stage1/dietlibc/lib/execl.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include "dietfeatures.h"
-
-int execl( const char *path,...) {
- va_list ap;
- int n,i;
- char **argv,*tmp;
- va_start(ap, path);
- n=1;
- while ((tmp=va_arg(ap,char *)))
- ++n;
- va_end (ap);
- if ((argv=(char **)alloca(n*sizeof(char*)))) {
- va_start(ap, path);
- for (i=0; i<n; ++i)
- argv[i]=va_arg(ap,char *);
- va_end (ap);
- return execve(path,argv,environ);
- }
- errno=ENOMEM;
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/lib/execle.c b/mdk-stage1/dietlibc/lib/execle.c
deleted file mode 100644
index 6d05c48a0..000000000
--- a/mdk-stage1/dietlibc/lib/execle.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include "dietfeatures.h"
-
-int execle( const char *path,...) {
- va_list ap;
- int n,i;
- char **argv,*tmp, **env;
- va_start(ap, path);
- n=1;
- while ((tmp=va_arg(ap,char *)))
- ++n;
- va_end (ap);
- if ((argv=(char **)alloca(n*sizeof(char*)))) {
- va_start(ap, path);
- for (i=0; i<n; ++i)
- argv[i]=va_arg(ap,char *);
- env=va_arg(ap, char **);
- va_end (ap);
- return execve(path,argv,env);
- }
- errno=ENOMEM;
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/lib/execlp.c b/mdk-stage1/dietlibc/lib/execlp.c
deleted file mode 100644
index 27dc0bb95..000000000
--- a/mdk-stage1/dietlibc/lib/execlp.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include "dietfeatures.h"
-
-int execlp(const char* file, const char *arg,...) {
- va_list ap,bak;
- int n,i;
- char **argv,*tmp;
- va_start(ap, arg);
- va_copy(bak,ap);
- n=2;
- while ((tmp=va_arg(ap,char *)))
- ++n;
- va_end (ap);
- if ((argv=(char **)alloca(n*sizeof(char*)))) {
- argv[0]=(char*)arg;
- for (i=0; i<n; ++i)
- argv[i+1]=va_arg(bak,char *);
- va_end (bak);
- return execvp(file,argv);
- }
- errno=ENOMEM;
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/lib/execv.c b/mdk-stage1/dietlibc/lib/execv.c
deleted file mode 100644
index d7acfa29f..000000000
--- a/mdk-stage1/dietlibc/lib/execv.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include "exec_lib.h"
-#include "dietfeatures.h"
-
-int execv(const char *file, char *const argv[]) {
- if (execve(file,argv,environ)==-1) {
- if (errno==ENOEXEC)
- __exec_shell(file,argv);
- }
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/lib/execvp.c b/mdk-stage1/dietlibc/lib/execvp.c
deleted file mode 100644
index 72447af7a..000000000
--- a/mdk-stage1/dietlibc/lib/execvp.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include "exec_lib.h"
-#include "dietfeatures.h"
-
-int execvp(const char *file, char *const argv[]) {
- const char *path=getenv("PATH");
- char *cur,*next;
- char buf[PATH_MAX];
- if (strchr((char*)file,'/')) {
- if (execve(file,argv,environ)==-1) {
- if (errno==ENOEXEC)
- __exec_shell(file,argv);
- return -1;
- }
- }
- if (!path) path=_PATH_DEFPATH;
- for (cur=(char*)path; cur; cur=next) {
- next=strchr(cur,':');
- if (!next)
- next=cur+strlen(cur);
- if (next==cur) {
- buf[0]='.';
- cur--;
- } else {
- if (next-cur>=PATH_MAX-3) { error: errno=EINVAL; return -1; }
- memmove(buf,cur,(size_t)(next-cur));
- }
- buf[next-cur]='/';
- {
- int len=strlen(file);
- if (len+(next-cur)>=PATH_MAX-2) goto error;
- memmove(&buf[next-cur+1],file,strlen(file)+1);
- }
- if (execve(buf,argv,environ)==-1) {
- if (errno==ENOEXEC)
- return __exec_shell(buf,argv);
- if ((errno!=EACCES) && (errno!=ENOENT)) return -1;
- }
- if (*next==0) break;
- next++;
- }
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/lib/ftw.c b/mdk-stage1/dietlibc/lib/ftw.c
deleted file mode 100644
index af13a7f86..000000000
--- a/mdk-stage1/dietlibc/lib/ftw.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <sys/stat.h>
-#include <unistd.h>
-#include <limits.h>
-#include <ftw.h>
-#include <dirent.h>
-#include <string.h>
-#include <stdlib.h>
-#include "dietdirent.h"
-
-int ftw(const char*dir,int(*f)(const char*file,const struct stat*sb,int flag),int dpth){
- char* cd;
- size_t cdl;
- DIR* d;
- struct dirent* de;
- struct stat sb;
- int r;
- unsigned int oldlen=0;
- char* filename; /* the warning gcc issues here is bogus */
- if(chdir(dir))return-1;
- cd=alloca(PATH_MAX+1);
- if(!getcwd(cd,PATH_MAX))return-1;
- cd[PATH_MAX]='\0';
- cdl=strlen(cd);
- if(!(d=opendir(".")))return-1;
- while((de=readdir(d))){
- int flg;
- size_t nl;
- if(de->d_name[0]=='.'){if(!de->d_name[1])continue;if(de->d_name[1]=='.'&&!de->d_name[2])continue;}
- nl=strlen(de->d_name);
- if (nl+cdl+2>oldlen)
- filename=alloca(oldlen=nl+cdl+2);
- memmove(filename,cd,cdl);
- filename[cdl]='/';
- memmove(filename+cdl+1,de->d_name,nl+1);
- if(!lstat(de->d_name,&sb)){
- if(S_ISLNK(sb.st_mode))flg=FTW_SL;else if(S_ISDIR(sb.st_mode))flg=FTW_D;else flg=FTW_F;
- }else flg=FTW_NS;
- r=f(filename,&sb,flg);
- if(r){closedir(d);return r;}
- if(flg==FTW_D&&dpth){
- r=ftw(filename,f,dpth-1);
- fchdir(d->fd);
- if (r){closedir(d);return r;}
- }
- }
- return closedir(d);
-}
diff --git a/mdk-stage1/dietlibc/lib/getdomainname.c b/mdk-stage1/dietlibc/lib/getdomainname.c
deleted file mode 100644
index 75486b010..000000000
--- a/mdk-stage1/dietlibc/lib/getdomainname.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#define _GNU_SOURCE
-
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <unistd.h>
-
-int getdomainname(char *name,size_t len) {
- struct utsname u;
- int res=uname(&u);
- if (res==0) {
- size_t i;
- if (len>=_UTSNAME_DOMAIN_LENGTH)
- len=_UTSNAME_DOMAIN_LENGTH;
- for (i=0; i<len; i++)
- name[i]=u.domainname[i];
- }
- return res;
-}
diff --git a/mdk-stage1/dietlibc/lib/getenv.c b/mdk-stage1/dietlibc/lib/getenv.c
deleted file mode 100644
index 5b529c17f..000000000
--- a/mdk-stage1/dietlibc/lib/getenv.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-
-extern char *getenv(const char *s)
-{
- int i;
- unsigned int len;
-
- if (!environ || !s) return 0;
- len = strlen(s);
- for (i = 0;environ[i];++i)
- if ((memcmp(environ[i],s,len)==0) && (environ[i][len] == '='))
- return environ[i] + len + 1;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/gethostname.c b/mdk-stage1/dietlibc/lib/gethostname.c
deleted file mode 100644
index c3d2f3d5e..000000000
--- a/mdk-stage1/dietlibc/lib/gethostname.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#define _GNU_SOURCE
-
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <unistd.h>
-
-int gethostname(char *name,size_t len) {
- struct utsname u;
- int res=uname(&u);
- if (res==0) {
- size_t i;
- if (len>=_UTSNAME_NODENAME_LENGTH)
- len=_UTSNAME_NODENAME_LENGTH;
- for (i=0; i<len; i++)
- name[i]=u.nodename[i];
- }
- return res;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/getopt.c b/mdk-stage1/dietlibc/lib/getopt.c
deleted file mode 100644
index aa1988f8d..000000000
--- a/mdk-stage1/dietlibc/lib/getopt.c
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <string.h>
-#include <getopt.h>
-
-static void getopterror(int which) {
- static char error1[]="Unknown option `-x'.\n";
- static char error2[]="Missing argument for `-x'.\n";
- if (opterr) {
- if (which) {
- error2[23]=optopt;
- write(2,error2,28);
- } else {
- error1[17]=optopt;
- write(2,error1,22);
- }
- }
-}
-
-int getopt(int argc, char * const argv[], const char *optstring) {
- static int lastidx=0,lastofs=0;
- char *tmp;
- if (optind==0) optind=1; /* whoever started setting optind to 0 should be shot */
-again:
- if (optind>argc || !argv[optind] || *argv[optind]!='-' || argv[optind][1]==0)
- return -1;
- if (argv[optind][1]=='-' && argv[optind][2]==0) {
- ++optind;
- return -1;
- }
- if (lastidx!=optind) {
- lastidx=optind; lastofs=0;
- }
- optopt=argv[optind][lastofs+1];
- if ((tmp=strchr(optstring,optopt))) {
- if (*tmp==0) { /* apparently, we looked for \0, i.e. end of argument */
- ++optind;
- goto again;
- }
- if (tmp[1]==':') { /* argument expected */
- if (tmp[2]==':' || argv[optind][lastofs+2]) { /* "-foo", return "oo" as optarg */
- if (!*(optarg=argv[optind]+lastofs+2)) optarg=0;
- goto found;
- }
- optarg=argv[optind+1];
- if (!optarg) { /* missing argument */
- ++optind;
- if (*optstring==':') return ':';
- getopterror(1);
- return ':';
- }
- ++optind;
- } else {
- ++lastofs;
- return optopt;
- }
-found:
- ++optind;
- return optopt;
- } else { /* not found */
- getopterror(0);
- ++optind;
- return '?';
- }
-}
diff --git a/mdk-stage1/dietlibc/lib/getpeername.c b/mdk-stage1/dietlibc/lib/getpeername.c
deleted file mode 100644
index c806c720d..000000000
--- a/mdk-stage1/dietlibc/lib/getpeername.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_getpeername(int a, void * b, int *c);
-int __libc_getpeername(int a, void * b, int *c) {
- unsigned long args[] = { a, (long) b, (long) c };
- return socketcall(SYS_GETPEERNAME, args);
-}
-
-int getpeername(int a, struct sockaddr* b, socklen_t *c) __attribute__((weak,alias("__libc_getpeername")));
diff --git a/mdk-stage1/dietlibc/lib/getpgrp.c b/mdk-stage1/dietlibc/lib/getpgrp.c
deleted file mode 100644
index ee2ab0257..000000000
--- a/mdk-stage1/dietlibc/lib/getpgrp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <unistd.h>
-
-int getpgrp()
-{
- return getpgid(0);
-}
diff --git a/mdk-stage1/dietlibc/lib/getsockname.c b/mdk-stage1/dietlibc/lib/getsockname.c
deleted file mode 100644
index 6c81e317d..000000000
--- a/mdk-stage1/dietlibc/lib/getsockname.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_getsockname(int a, void * b, int c);
-int __libc_getsockname(int a, void * b, int c) {
- unsigned long args[] = { a, (long) b, c };
- return socketcall(SYS_GETSOCKNAME, args);
-}
-
-int getsockname(int a, struct sockaddr* b, socklen_t* c) __attribute__((weak,alias("__libc_getsockname")));
diff --git a/mdk-stage1/dietlibc/lib/getsockopt.c b/mdk-stage1/dietlibc/lib/getsockopt.c
deleted file mode 100644
index 05b71d77d..000000000
--- a/mdk-stage1/dietlibc/lib/getsockopt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_getsockopt(int a, int b, int c, void *d, int e);
-int __libc_getsockopt(int a, int b, int c, void *d, int e) {
- unsigned long args[] = { a, b, c, (long)d, e };
- return socketcall(SYS_GETSOCKOPT, args);
-}
-
-int getsockopt(int s, int level, int optname, void * optval, socklen_t *optlen) __attribute__((weak,alias("__libc_getsockopt")));
diff --git a/mdk-stage1/dietlibc/lib/htonl.c b/mdk-stage1/dietlibc/lib/htonl.c
deleted file mode 100644
index 4096d04f5..000000000
--- a/mdk-stage1/dietlibc/lib/htonl.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <endian.h>
-#include <netinet/in.h>
-
-uint32_t htonl(uint32_t hostlong) {
-#if __BYTE_ORDER==__LITTLE_ENDIAN
- return (hostlong>>24) | ((hostlong&0xff0000)>>8) |
- ((hostlong&0xff00)<<8) | (hostlong<<24);
-#else
- return hostlong;
-#endif
-}
-
-uint32_t ntohl(uint32_t hostlong) __attribute__((weak,alias("htonl")));
diff --git a/mdk-stage1/dietlibc/lib/htons.c b/mdk-stage1/dietlibc/lib/htons.c
deleted file mode 100644
index a64483174..000000000
--- a/mdk-stage1/dietlibc/lib/htons.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <endian.h>
-#include <netinet/in.h>
-
-uint16_t htons(uint16_t hostshort) {
-#if __BYTE_ORDER==__LITTLE_ENDIAN
- return ((hostshort>>8)&0xff) | (hostshort<<8);
-#else
- return hostshort;
-#endif
-}
-
-uint16_t ntohs(uint16_t hostshort) __attribute__((weak,alias("htons")));
diff --git a/mdk-stage1/dietlibc/lib/if_indextoname.c b/mdk-stage1/dietlibc/lib/if_indextoname.c
deleted file mode 100644
index cc3111ed8..000000000
--- a/mdk-stage1/dietlibc/lib/if_indextoname.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <sys/socket.h>
-
-#ifndef SOCK_DGRAM
-#define SOCK_DGRAM 2
-#endif
-
-char* if_indextoname(unsigned int interface,char* blub) {
- struct ifreq ifr;
- int fd;
-
- fd=socket(AF_INET6,SOCK_DGRAM,0);
- if (fd<0) fd=socket(AF_INET,SOCK_DGRAM,0);
- ifr.ifr_ifindex=interface;
- if (ioctl(fd,SIOCGIFNAME,&ifr)==0) {
- int i;
- close(fd);
- for (i=0; i<IFNAMSIZ-1; i++)
- if (!(blub[i]=ifr.ifr_name[i]))
- return blub;
- blub[i]=0;
- return blub;
- }
- close(fd);
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/if_nameindex.c b/mdk-stage1/dietlibc/lib/if_nameindex.c
deleted file mode 100644
index fc0e1c0ff..000000000
--- a/mdk-stage1/dietlibc/lib/if_nameindex.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <net/if.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-
-struct if_nameindex* if_nameindex(void) {
- struct ifconf ic;
- int fd,len,i;
- struct if_nameindex* x,* y;
- char *dest;
- fd=socket(AF_INET6,SOCK_DGRAM,0);
- if (fd<0) fd=socket(AF_INET,SOCK_DGRAM,0);
- ic.ifc_buf=0;
- ic.ifc_len=0;
- if (ioctl(fd,SIOCGIFCONF,&ic)<0) {
-b0rken:
- close(fd);
- return 0;
- }
- ic.ifc_buf=alloca((size_t)ic.ifc_len);
- if (ioctl(fd,SIOCGIFCONF,&ic)<0) goto b0rken;
- len=(ic.ifc_len/sizeof(struct ifreq));
- x=(struct if_nameindex*)malloc((len+1)*sizeof(struct if_nameindex)+len*IFNAMSIZ);
- if (!x) goto b0rken;
- dest=(char*)(x+len+1);
- y=x;
- for (i=0; i<len; ++i) {
- struct ifreq* ir=(struct ifreq*)&ic.ifc_req[i];
- y->if_name=dest;
- memcpy(dest,ir->ifr_name,IFNAMSIZ);
- if (ioctl(fd,SIOCGIFINDEX,ir)==-1) continue;
- y->if_index=ir->ifr_ifindex;
- dest+=IFNAMSIZ;
- ++y;
- }
- y->if_name=0; y->if_index=0;
- return x;
-}
diff --git a/mdk-stage1/dietlibc/lib/if_nametoindex.c b/mdk-stage1/dietlibc/lib/if_nametoindex.c
deleted file mode 100644
index c9dd1b051..000000000
--- a/mdk-stage1/dietlibc/lib/if_nametoindex.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <sys/socket.h>
-
-#ifndef SOCK_DGRAM
-#define SOCK_DGRAM 2
-#endif
-
-unsigned int if_nametoindex(const char* blub) {
- struct ifreq ifr;
- int fd;
- char *tmp;
- int len=sizeof(ifr.ifr_name);
- fd=socket(AF_INET6,SOCK_DGRAM,0);
- if (fd<0) fd=socket(AF_INET,SOCK_DGRAM,0);
- for (tmp=ifr.ifr_name; len>0; --len) {
- if ((*tmp++=*blub++)==0) break;
- }
- if (ioctl(fd,SIOCGIFINDEX,&ifr)==0) {
- close(fd);
- return ifr.ifr_ifindex;
- }
- close(fd);
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/ipv6constants.c b/mdk-stage1/dietlibc/lib/ipv6constants.c
deleted file mode 100644
index 1d5cb1f08..000000000
--- a/mdk-stage1/dietlibc/lib/ipv6constants.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "netinet/in.h"
-
-const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
-const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
diff --git a/mdk-stage1/dietlibc/lib/isalnum.c b/mdk-stage1/dietlibc/lib/isalnum.c
deleted file mode 100644
index 3192cc20d..000000000
--- a/mdk-stage1/dietlibc/lib/isalnum.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <ctype.h>
-
-int __isalnum_ascii ( int ch );
-int __isalnum_ascii ( int ch ) {
- return (unsigned int)((ch | 0x20) - 'a') < 26u ||
- (unsigned int)( ch - '0') < 10u;
-}
-
-int isalnum ( int ch ) __attribute__((weak,alias("__isalnum_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isalpha.c b/mdk-stage1/dietlibc/lib/isalpha.c
deleted file mode 100644
index efd8b1940..000000000
--- a/mdk-stage1/dietlibc/lib/isalpha.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-int __isalpha_ascii ( int ch );
-int __isalpha_ascii ( int ch ) {
- return (unsigned int)((ch | 0x20) - 'a') < 26u;
-}
-
-int isalpha ( int ch ) __attribute__((weak,alias("__isalpha_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isascii.c b/mdk-stage1/dietlibc/lib/isascii.c
deleted file mode 100644
index 57a23ba44..000000000
--- a/mdk-stage1/dietlibc/lib/isascii.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int isascii ( int ch )
-{
- return (unsigned int)ch < 128u;
-}
diff --git a/mdk-stage1/dietlibc/lib/isatty.c b/mdk-stage1/dietlibc/lib/isatty.c
deleted file mode 100644
index 4858a364d..000000000
--- a/mdk-stage1/dietlibc/lib/isatty.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#define ioctl libc_ioctl
-#include <termios.h>
-#undef ioctl
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-int isatty(int fd) {
- int save;
- int is_tty;
- struct termios term;
-
- save = errno;
- is_tty = ioctl(fd, TCGETS, &term) == 0;
- errno = save;
-
- return is_tty;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/isblank.c b/mdk-stage1/dietlibc/lib/isblank.c
deleted file mode 100644
index f13ca304a..000000000
--- a/mdk-stage1/dietlibc/lib/isblank.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int isblank ( int ch )
-{
- return ch == ' ' || ch == '\t';
-}
diff --git a/mdk-stage1/dietlibc/lib/iscntrl.c b/mdk-stage1/dietlibc/lib/iscntrl.c
deleted file mode 100644
index 98dbae6f3..000000000
--- a/mdk-stage1/dietlibc/lib/iscntrl.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-int __iscntrl_ascii ( int ch );
-int __iscntrl_ascii ( int ch ) {
- return (unsigned int)ch < 32u || ch == 127;
-}
-
-int iscntrl ( int ch ) __attribute__((weak,alias("__iscntrl_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isdigit.c b/mdk-stage1/dietlibc/lib/isdigit.c
deleted file mode 100644
index d04d281a8..000000000
--- a/mdk-stage1/dietlibc/lib/isdigit.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-int __isdigit_ascii ( int ch );
-int __isdigit_ascii ( int ch ) {
- return (unsigned int)(ch - '0') < 10u;
-}
-
-int isdigit ( int ch ) __attribute__((weak,alias("__isdigit_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isgraph.c b/mdk-stage1/dietlibc/lib/isgraph.c
deleted file mode 100644
index 83419e788..000000000
--- a/mdk-stage1/dietlibc/lib/isgraph.c
+++ /dev/null
@@ -1,6 +0,0 @@
-int __isgraph_ascii ( int ch );
-int __isgraph_ascii ( int ch ) {
- return (unsigned int)(ch - '!') < 127u - '!';
-}
-
-int isgraph ( int ch ) __attribute__((weak,alias("__isgraph_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/islower.c b/mdk-stage1/dietlibc/lib/islower.c
deleted file mode 100644
index 8d219c43a..000000000
--- a/mdk-stage1/dietlibc/lib/islower.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-int __islower_ascii ( int ch );
-int __islower_ascii ( int ch ) {
- return (unsigned int) (ch - 'a') < 26u;
-}
-
-int islower ( int ch ) __attribute__((weak,alias("__islower_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isprint.c b/mdk-stage1/dietlibc/lib/isprint.c
deleted file mode 100644
index 51ff5b6ee..000000000
--- a/mdk-stage1/dietlibc/lib/isprint.c
+++ /dev/null
@@ -1,7 +0,0 @@
-
-int __isprint_ascii ( int ch );
-int __isprint_ascii ( int ch ) {
- return (unsigned int)(ch - ' ') < 127u - ' ';
-}
-
-int isprint ( int ch ) __attribute__((weak,alias("__isprint_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/ispunct.c b/mdk-stage1/dietlibc/lib/ispunct.c
deleted file mode 100644
index 8bbfcdb5a..000000000
--- a/mdk-stage1/dietlibc/lib/ispunct.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <ctype.h>
-
-int __ispunct_ascii ( int ch );
-int __ispunct_ascii ( int ch )
-{
- return isprint (ch) && !isalnum (ch) && !isspace (ch);
-}
-
-int ispunct ( int ch ) __attribute__((weak,alias("__ispunct_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isspace.c b/mdk-stage1/dietlibc/lib/isspace.c
deleted file mode 100644
index bfa46648b..000000000
--- a/mdk-stage1/dietlibc/lib/isspace.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <ctype.h>
-
-int __isspace_ascii ( int ch );
-int __isspace_ascii ( int ch )
-{
- return (unsigned int)(ch - 9) < 5u || ch == ' ';
-}
-
-int isspace ( int ch ) __attribute__((weak,alias("__isspace_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isupper.c b/mdk-stage1/dietlibc/lib/isupper.c
deleted file mode 100644
index 048d4fd6c..000000000
--- a/mdk-stage1/dietlibc/lib/isupper.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <ctype.h>
-
-int __isupper_ascii ( int ch );
-int __isupper_ascii ( int ch )
-{
- return (unsigned int)(ch - 'A') < 26u;
-}
-
-int isupper ( int ch ) __attribute__((weak,alias("__isupper_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/isxdigit.c b/mdk-stage1/dietlibc/lib/isxdigit.c
deleted file mode 100644
index bca8e74ac..000000000
--- a/mdk-stage1/dietlibc/lib/isxdigit.c
+++ /dev/null
@@ -1,8 +0,0 @@
-int __isxdigit_ascii ( int ch );
-int __isxdigit_ascii ( int ch )
-{
- return (unsigned int)( ch - '0') < 10u ||
- (unsigned int)((ch | 0x20) - 'a') < 6u;
-}
-
-int isxdigit ( int ch ) __attribute__((weak,alias("__isxdigit_ascii")));
diff --git a/mdk-stage1/dietlibc/lib/labs.c b/mdk-stage1/dietlibc/lib/labs.c
deleted file mode 100644
index 364557f40..000000000
--- a/mdk-stage1/dietlibc/lib/labs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <endian.h>
-
-#if __WORDSIZE == 64
-long int labs(long int i) { return i>=0?i:-i; }
-long long int llabs(long long int i) __attribute__((alias("labs")));
-#endif
diff --git a/mdk-stage1/dietlibc/lib/listen.c b/mdk-stage1/dietlibc/lib/listen.c
deleted file mode 100644
index 661b86a63..000000000
--- a/mdk-stage1/dietlibc/lib/listen.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_listen(int a, int b);
-int __libc_listen(int a, int b) {
- unsigned long args[] = { a, b, 0 };
- return socketcall(SYS_LISTEN, args);
-}
-
-int listen(int s, int backlog) __attribute__((weak,alias("__libc_listen")));
diff --git a/mdk-stage1/dietlibc/lib/llabs.c b/mdk-stage1/dietlibc/lib/llabs.c
deleted file mode 100644
index bcbd3dc78..000000000
--- a/mdk-stage1/dietlibc/lib/llabs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <endian.h>
-#include <stdlib.h>
-
-#if __WORDSIZE != 64
-long long int llabs(long long int i) { if (i<0) i=-i; return i; }
-#endif
diff --git a/mdk-stage1/dietlibc/lib/lockf.c b/mdk-stage1/dietlibc/lib/lockf.c
deleted file mode 100644
index 1b6fcb80c..000000000
--- a/mdk-stage1/dietlibc/lib/lockf.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-int lockf(int fd, int cmd, off_t len) {
- struct flock fl;
- fl.l_whence=SEEK_CUR;
- fl.l_start=0;
- fl.l_len=len;
- fl.l_pid=0;
- switch (cmd) {
- case F_TEST:
- if (fcntl(fd,F_GETLK,&fl)<0)
- return -1;
- if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
- return 0;
- errno=EACCES;
- return -1;
- case F_ULOCK:
- fl.l_type=F_UNLCK;
- cmd=F_SETLK;
- break;
- case F_LOCK:
- fl.l_type = F_WRLCK;
- cmd = F_SETLKW;
- break;
- case F_TLOCK:
- fl.l_type = F_WRLCK;
- cmd = F_SETLK;
- break;
- default:
- errno=EINVAL;
- return -1;
- }
- return fcntl(fd,cmd,&fl);
-}
diff --git a/mdk-stage1/dietlibc/lib/longjmp.c b/mdk-stage1/dietlibc/lib/longjmp.c
deleted file mode 100644
index 6f1afb4b1..000000000
--- a/mdk-stage1/dietlibc/lib/longjmp.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <setjmp.h>
-#include <signal.h>
-
-void __longjmp(void*env,int val);
-
-void __libc_longjmp(sigjmp_buf env,int val);
-void __libc_longjmp(sigjmp_buf env,int val) {
- if (env[0].__mask_was_saved) {
- sigprocmask(SIG_SETMASK,(sigset_t*)&env[0].__saved_mask,0);
- }
- if (val==0) val=1;
- __longjmp(env[0].__jmpbuf,val);
-}
-void __siglongjmp(sigjmp_buf env,int val) __attribute__((alias("__libc_longjmp")));
-void longjmp(sigjmp_buf env,int val) __attribute__((weak,alias("__libc_longjmp")));
-void siglongjmp(sigjmp_buf env,int val) __attribute__((weak,alias("__libc_longjmp")));
diff --git a/mdk-stage1/dietlibc/lib/lseek64.c b/mdk-stage1/dietlibc/lib/lseek64.c
deleted file mode 100644
index 62acf4a2b..000000000
--- a/mdk-stage1/dietlibc/lib/lseek64.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-
-#include <sys/stat.h>
-#ifndef __NO_STAT64
-#include <unistd.h>
-
-loff_t lseek64(int fildes, loff_t offset, int whence) {
- loff_t tmp;
- if (llseek(fildes,(unsigned long)(offset>>32),(unsigned long)offset&0xffffffff,&tmp,whence)) {
- if (errno!=ENOSYS) return -1;
- return (loff_t)lseek(fildes,(off_t)offset,whence);
- }
- return tmp;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/memccpy.c b/mdk-stage1/dietlibc/lib/memccpy.c
deleted file mode 100644
index 3208cfabb..000000000
--- a/mdk-stage1/dietlibc/lib/memccpy.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE
-#include <sys/types.h>
-#include <string.h>
-
-void *memccpy(void *dst, const void *src, int c, size_t count)
-{
- char *a = dst;
- const char *b = src;
- while (count--)
- {
- *a++ = *b;
- if (*b==c)
- {
- return (void *)a;
- }
- b++;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/memchr.c b/mdk-stage1/dietlibc/lib/memchr.c
deleted file mode 100644
index ae76bb150..000000000
--- a/mdk-stage1/dietlibc/lib/memchr.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-void* memchr(const void *s, int c, size_t n) {
- register const char* t=s;
- int i;
- for (i=n; i; --i) {
- if (*t==c)
- return (char*)t;
- ++t;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/memcmp.c b/mdk-stage1/dietlibc/lib/memcmp.c
deleted file mode 100644
index 4c8f77142..000000000
--- a/mdk-stage1/dietlibc/lib/memcmp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <sys/types.h>
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-int memcmp(const void *dst, const void *src, size_t count) {
- register int r;
- register const char *d=dst;
- register const char *s=src;
- while (count--) {
- if ((r=(*d - *s)))
- return r;
- ++d;
- ++s;
- }
- return 0;
-}
-
-int bcmp(const char *a,const char *b,size_t c) __attribute__((weak,alias("memcmp")));
diff --git a/mdk-stage1/dietlibc/lib/memcpy.c b/mdk-stage1/dietlibc/lib/memcpy.c
deleted file mode 100644
index ebfd1e60a..000000000
--- a/mdk-stage1/dietlibc/lib/memcpy.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <sys/types.h>
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-void* memcpy(void* dst, const void* src, size_t count) {
- register char *d=dst;
- register const char *s=src;
- ++count; /* this actually produces better code than using count-- */
- while (--count) {
- *d = *s;
- ++d; ++s;
- }
- return dst;
-}
diff --git a/mdk-stage1/dietlibc/lib/memmem.c b/mdk-stage1/dietlibc/lib/memmem.c
deleted file mode 100644
index 5c88a29e7..000000000
--- a/mdk-stage1/dietlibc/lib/memmem.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#define _GNU_SOURCE 23
-#include <sys/types.h>
-#include <string.h>
-
-void *memmem(const void* haystack, size_t hl, const void* needle, size_t nl) {
- int i;
- if (nl>hl) return 0;
- for (i=hl-nl+1; i; --i) {
- if (!memcmp(haystack,needle,nl))
- return (char*)haystack;
- ++haystack;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/memmove.c b/mdk-stage1/dietlibc/lib/memmove.c
deleted file mode 100644
index 58414d503..000000000
--- a/mdk-stage1/dietlibc/lib/memmove.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE
-#include <sys/types.h>
-#include <string.h>
-
-void *memmove(void *dst, const void *src, size_t count)
-{
- char *a = dst;
- const char *b = src;
- if (src!=dst)
- {
- if (src>dst)
- {
- while (count--) *a++ = *b++;
- }
- else
- {
- a+=count-1;
- b+=count-1;
- while (count--) *a-- = *b--;
- }
- }
- return dst;
-}
diff --git a/mdk-stage1/dietlibc/lib/memrchr.c b/mdk-stage1/dietlibc/lib/memrchr.c
deleted file mode 100644
index f7750d2d7..000000000
--- a/mdk-stage1/dietlibc/lib/memrchr.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <string.h>
-
-void* memrchr(const void *s, int c, size_t n) {
- register const char* t=s;
- register const char* last=0;
- int i;
- for (i=n; i; --i) {
- if (*t==c)
- last=t;
- ++t;
- }
- return (void*)last; /* man, what an utterly b0rken prototype */
-}
diff --git a/mdk-stage1/dietlibc/lib/memset.c b/mdk-stage1/dietlibc/lib/memset.c
deleted file mode 100644
index a019eca44..000000000
--- a/mdk-stage1/dietlibc/lib/memset.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-void* memset(void * dst, int s, size_t count) {
- register char * a = dst;
- count++; /* this actually creates smaller code than using count-- */
- while (--count)
- *a++ = s;
- return dst;
-}
diff --git a/mdk-stage1/dietlibc/lib/mkfifo.c b/mdk-stage1/dietlibc/lib/mkfifo.c
deleted file mode 100644
index 1bd132e65..000000000
--- a/mdk-stage1/dietlibc/lib/mkfifo.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <sys/stat.h>
-#include <unistd.h>
-
-int mkfifo(const char *fn,mode_t mode) {
- return mknod(fn,(mode_t)(mode|S_IFIFO),0);
-}
diff --git a/mdk-stage1/dietlibc/lib/msgctl.c b/mdk-stage1/dietlibc/lib/msgctl.c
deleted file mode 100644
index 51cffdef0..000000000
--- a/mdk-stage1/dietlibc/lib/msgctl.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-
-extern int __ipc(int,int,int,int,void*);
-
-int msgctl(int msqid, int cmd, struct msqid_ds *buf) {
- return __ipc(MSGCTL,msqid,cmd,0,buf);
-}
diff --git a/mdk-stage1/dietlibc/lib/msgget.c b/mdk-stage1/dietlibc/lib/msgget.c
deleted file mode 100644
index 6023c1786..000000000
--- a/mdk-stage1/dietlibc/lib/msgget.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-
-extern int __ipc(int,key_t,int,int,int);
-
-int msgget(key_t key,int flag) {
- return __ipc(MSGGET,key,flag,0,0);
-}
diff --git a/mdk-stage1/dietlibc/lib/msgrcv.c b/mdk-stage1/dietlibc/lib/msgrcv.c
deleted file mode 100644
index 8168187a5..000000000
--- a/mdk-stage1/dietlibc/lib/msgrcv.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-
-extern int __ipc(int,int,size_t,int,void*);
-
-struct ipc_kludge {
- struct msgbuf *msgp;
- long msgtyp;
-};
-
-int msgrcv(int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg) {
- struct ipc_kludge tmp;
- tmp.msgp = msgp;
- tmp.msgtyp = msgtyp;
- return __ipc(MSGRCV,msqid, msgsz, msgflg, &tmp);
-}
diff --git a/mdk-stage1/dietlibc/lib/msgsnd.c b/mdk-stage1/dietlibc/lib/msgsnd.c
deleted file mode 100644
index 6e9ef445e..000000000
--- a/mdk-stage1/dietlibc/lib/msgsnd.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-
-extern int __ipc(int,int,size_t,int,const void*);
-
-int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) {
- return __ipc(MSGSND,msqid, msgsz, msgflg, msgp);
-}
diff --git a/mdk-stage1/dietlibc/lib/open64.c b/mdk-stage1/dietlibc/lib/open64.c
deleted file mode 100644
index 2599e2259..000000000
--- a/mdk-stage1/dietlibc/lib/open64.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/types.h>
-#include <fcntl.h>
-
-#ifndef O_LARGEFILE
-#define O_LARGEFILE 0
-#endif
-
-int __libc_open64(const char* file,int oflag,int mode);
-int __libc_open64(const char* file,int oflag,int mode) {
- return open(file,oflag|O_LARGEFILE,mode);
-}
-
-int open64(const char* file,int oflag,...) __attribute__((weak,alias("__libc_open64")));
diff --git a/mdk-stage1/dietlibc/lib/opendir.c b/mdk-stage1/dietlibc/lib/opendir.c
deleted file mode 100644
index 2530d1ac9..000000000
--- a/mdk-stage1/dietlibc/lib/opendir.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "dietdirent.h"
-#include <sys/mman.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <fcntl.h>
-
-DIR* opendir ( const char* name ) {
- int fd = open (name, O_RDONLY | O_DIRECTORY);
- DIR* t = NULL;
-
- if ( fd >= 0 ) {
- if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
- goto lose;
- t = (DIR *) mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (t == MAP_FAILED)
-lose:
- close (fd);
- else
- t->fd = fd;
- }
-
-
- return t;
-}
diff --git a/mdk-stage1/dietlibc/lib/perror.c b/mdk-stage1/dietlibc/lib/perror.c
deleted file mode 100644
index 0a45fb9d6..000000000
--- a/mdk-stage1/dietlibc/lib/perror.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "dietfeatures.h"
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#define _BSD_SOURCE
-#include <errno.h>
-
-extern const char __sys_err_unknown [];
-
-void perror ( const char* prepend )
-{
- register const char* message = __sys_err_unknown;
-
- if ( (unsigned int) errno < (unsigned int) __SYS_NERR )
- message = sys_errlist [errno];
-
- if (prepend) {
- write ( 2, prepend, strlen(prepend) );
- write ( 2, ": ", 2 );
- }
- write ( 2, message, strlen(message) );
- write ( 2, "\n", 1 );
-}
diff --git a/mdk-stage1/dietlibc/lib/pread.c b/mdk-stage1/dietlibc/lib/pread.c
deleted file mode 100644
index fd6c49149..000000000
--- a/mdk-stage1/dietlibc/lib/pread.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <endian.h>
-#include <sys/types.h>
-
-extern size_t __pread(int fd, void *buf, size_t count, off_t a,off_t b);
-
-size_t __libc_pread(int fd, void *buf, size_t count, off_t offset);
-size_t __libc_pread(int fd, void *buf, size_t count, off_t offset) {
- return __pread(fd,buf,count,offset,0);
-}
-
-int pread(int fd, void *buf, size_t count, off_t offset) __attribute__((weak,alias("__libc_pread")));
diff --git a/mdk-stage1/dietlibc/lib/pread64.c b/mdk-stage1/dietlibc/lib/pread64.c
deleted file mode 100644
index 6dc93cefa..000000000
--- a/mdk-stage1/dietlibc/lib/pread64.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <endian.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifndef __NO_STAT64
-extern size_t __pread(int fd, void *buf, size_t count, off_t a,off_t b);
-
-size_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset);
-size_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) {
- return __pread(fd,buf,count,__LONG_LONG_PAIR ((off_t)(offset&0xffffffff),(off_t)(offset>>32)));
-}
-
-int pread64(int fd, void *buf, size_t count, off_t offset) __attribute__((weak,alias("__libc_pread64")));
-#endif
diff --git a/mdk-stage1/dietlibc/lib/putenv.c b/mdk-stage1/dietlibc/lib/putenv.c
deleted file mode 100644
index 448d59840..000000000
--- a/mdk-stage1/dietlibc/lib/putenv.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-int putenv(const char *string) {
- size_t len;
- int envc;
- int remove=0;
- char *tmp;
- const char **ep;
- char **newenv;
- static char **origenv;
- if (!origenv) origenv=environ;
- if (!(tmp=strchr(string,'='))) {
- len=strlen(string);
- remove=1;
- } else
- len=tmp-string+1;
- for (envc=0, ep=(const char**)environ; *ep; ++ep) {
- if (*string == **ep && !memcmp(string,*ep,len)) {
- if (remove) {
- for (; ep[1]; ++ep) ep[0]=ep[1];
- ep[0]=0;
- return 0;
- }
- *ep=string;
- return 0;
- }
- ++envc;
- }
- if (tmp) {
- newenv = (char**) realloc(environ==origenv?0:origenv,
- (envc+2)*sizeof(char*));
- if (!newenv) return -1;
- newenv[0]=(char*)string;
- memcpy(newenv+1,environ,(envc+1)*sizeof(char*));
- environ=newenv;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/pwrite.c b/mdk-stage1/dietlibc/lib/pwrite.c
deleted file mode 100644
index 1e9fde545..000000000
--- a/mdk-stage1/dietlibc/lib/pwrite.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <endian.h>
-#include <sys/types.h>
-
-extern size_t __pwrite(int fd, void *buf, size_t count, off_t a,off_t b);
-
-size_t __libc_pwrite(int fd, void *buf, size_t count, off_t offset);
-size_t __libc_pwrite(int fd, void *buf, size_t count, off_t offset) {
- return __pwrite(fd,buf,count,offset,0);
-}
-
-int pwrite(int fd, void *buf, size_t count, off_t offset) __attribute__((weak,alias("__libc_pwrite")));
diff --git a/mdk-stage1/dietlibc/lib/pwrite64.c b/mdk-stage1/dietlibc/lib/pwrite64.c
deleted file mode 100644
index cac46024a..000000000
--- a/mdk-stage1/dietlibc/lib/pwrite64.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <endian.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifndef __NO_STAT64
-extern size_t __pwrite(int fd, void *buf, size_t count, off_t a,off_t b);
-
-size_t __libc_pwrite64(int fd, void *buf, size_t count, off64_t offset);
-size_t __libc_pwrite64(int fd, void *buf, size_t count, off64_t offset) {
- return __pwrite(fd,buf,count,__LONG_LONG_PAIR ((off_t)(offset&0xffffffff),(off_t)(offset>>32)));
-}
-
-int pwrite64(int fd, void *buf, size_t count, off_t offset) __attribute__((weak,alias("__libc_pwrite64")));
-#endif
diff --git a/mdk-stage1/dietlibc/lib/qsort.c b/mdk-stage1/dietlibc/lib/qsort.c
deleted file mode 100644
index 62217e142..000000000
--- a/mdk-stage1/dietlibc/lib/qsort.c
+++ /dev/null
@@ -1,127 +0,0 @@
-#include <sys/cdefs.h>
-#include <stdlib.h>
-#include <assert.h>
-
-/* comments:
- 1. insertion sort sofort, nicht nachträglich
- 2. threshold = 16
- */
-
-static inline void iswap(void *a,void *b,size_t size) {
- register char *x=a;
- register char *y=b;
- register char *z=x+size;
- while (x<z) {
- register char tmp=*x;
- *x=*y;
- *y=tmp;
- ++x; ++y;
- }
-}
-
-static inline void swap(void *base,size_t size,size_t a,size_t b) {
- iswap((char*)base+a*size,(char*)base+b*size,size);
-}
-
-#if 0
-extern int array[];
-
-void dumparray() {
- printf("array now {%d,%d,%d,%d,%d}\n",array[0],array[1],array[2],array[3],array[4]);
-}
-#endif
-
-void isort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
-void isort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
- size_t i;
- while (expect(nmemb>1,1)) {
- char *min=base;
- char *tmp=min+size;
- for (i=1; i<nmemb; ++i) {
- if (expect(compar(tmp,min)<0,0))
- min=tmp;
- tmp+=size;
- }
- iswap(min,base,size);
- (char*)base+=size;
- nmemb-=1;
- }
-}
-
-void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
-#ifdef DEBUG
- char *dbase=base;
- char *dmax=base+(nmemb-1)*size;
- char dmemb=nmemb;
-#endif
- static int level=0;
- char* v; /* pivot */
- char* mid, *max, *min;
- size_t lmemb;
-
-#if 0
- int left,right;
- left=(int*)base-array;
- right=left+nmemb-1;
- ++level;
- { int i; for (i=0; i<level; ++i) printf(" "); }
- printf("qsort: level %d; base=%p, %dx%d; array[%d..%d]\n",level,base,nmemb,size,left,right);
- assert(left>=0 && right<=1000);
-#endif
- if (nmemb<=8) {
- --level;
- return isort(base,nmemb,size,compar);
- }
- {
- mid=(char*)base+(nmemb/2)*size;
- max=(char*)base+(nmemb-1)*size;
-
- if (compar(base,max)<0) /* a[left] < a[right] */
- if (compar(base,mid)<0) /* a[left] < a[med] */
- if (compar(max,mid)<0) /* a[left] < a[right] < a[med] */
- v=max;
- else /* a[left] < a[med] < a[right] */
- v=mid;
- else /* a[med] < a[left] < a[right] */
- v=base;
- else /* a[right] < a[left] */
- if (compar(base,mid)<0) /* a[right] < a[left] < a[med] */
- v=base;
- else /* a[right] < a[left] && a[med] < a[left] */
- if (compar(max,mid)<0) /* a[right] < a[med] < a[left] */
- v=mid;
- else
- v=max;
-// printf("%d %d %d -> median %d\n",*(int*)base,*(int*)mid,*(int*)max,*(int*)v);
- }
- if (v != max)
- iswap(v,max,size);
- v=max;
- min=base; lmemb=0;
- for (;;) {
- while (expect(compar(min,v)<0,1)) { min+=size; ++lmemb; }
- while (expect(compar(max-=size,v)>0,1)) ;
- if (min>=max) break;
- iswap(min,max,size);
- }
- iswap(min,v,size);
-#ifdef DEBUG
-// { int i; for (i=0; i<level; ++i) printf(" "); }
-// printf("-=< base=%p, min=%p, nmemb=%d, lmemb=%d (%d)\n",base,min,nmemb,lmemb,(min-(char*)base)/size);
- assert(lmemb==((min-(char*)base)/size));
-#endif
- if (min>(char*)base+size) {
-#ifdef DEBUG
- assert(base==dbase);
-#endif
-// { int i; for (i=0; i<level; ++i) printf(" "); }
-// printf("+-left %d [%d..%d] of [%d..%d]\n",level+1,left,left+lmemb,left,right);
- qsort(base,lmemb,size,compar);
- }
- if (nmemb>lmemb+1) {
-// { int i; for (i=0; i<level; ++i) printf(" "); }
-// printf("+-right %d [%d..%d] of [%d..%d]\n",level+1,left+lmemb,right,left,right);
- qsort(min+size,nmemb-lmemb-1,size,compar);
- }
- --level;
-}
diff --git a/mdk-stage1/dietlibc/lib/raise.c b/mdk-stage1/dietlibc/lib/raise.c
deleted file mode 100644
index 0f548fc3b..000000000
--- a/mdk-stage1/dietlibc/lib/raise.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-
-int raise(int sig) {
- return kill(getpid(),sig);
-}
diff --git a/mdk-stage1/dietlibc/lib/rand.c b/mdk-stage1/dietlibc/lib/rand.c
deleted file mode 100644
index beb2d2717..000000000
--- a/mdk-stage1/dietlibc/lib/rand.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdlib.h>
-
-static unsigned int seed=1;
-
-int rand(void) {
- return rand_r(&seed);
-}
-
-void srand(unsigned int i) { seed=i; }
-
-int random(void) __attribute__((alias("rand")));
-void srandom(unsigned int i) __attribute__((alias("srand")));
diff --git a/mdk-stage1/dietlibc/lib/rand48.c b/mdk-stage1/dietlibc/lib/rand48.c
deleted file mode 100644
index 9c6cfcda2..000000000
--- a/mdk-stage1/dietlibc/lib/rand48.c
+++ /dev/null
@@ -1,89 +0,0 @@
-#include <stdlib.h>
-
-static randbuf rand48buf;
-#define A_0 0xE66D
-#define A_1 0xDEEC
-#define A_2 0x5
-#define C 0xB
-static randbuf a = { A_0, A_1, A_2 };
-static unsigned short c = C;
-
-static void calc_next(randbuf buf) {
- randbuf tmp;
- long t;
- t = buf[0] * a[0] + c;
- tmp[0] = t & 0xffff;
- tmp[1] = (t >> 16) & 0xffff;
- t = buf[1] * a[0] + buf[0] * a[1] + tmp[1];
- tmp[1] = t & 0xffff;
- tmp[2] = (t >> 16) & 0xffff;
- t = buf[2] * a[0] + buf[1] * a[1] + buf[0] * a[2] + tmp[2];
- tmp[2] = t & 0xffff;
- buf[0] = tmp[0];
- buf[1] = tmp[1];
- buf[2] = tmp[2];
-}
-
-double drand48(void) {
- return erand48(rand48buf);
-}
-
-long lrand48(void) {
- return nrand48(rand48buf);
-}
-
-long mrand48(void) {
- return jrand48(rand48buf);
-}
-
-void srand48(long seed) {
- rand48buf[1] = (seed >> 16) & 0xffff;
- rand48buf[2] = seed & 0xffff;
- rand48buf[0] = 0x330e;
- a[0] = A_0;
- a[1] = A_1;
- a[2] = A_2;
- c = C;
-}
-
-unsigned short *seed48(randbuf buf) {
- static randbuf oldx;
- int i;
- for (i = 0; i < 3; i++) {
- oldx[i] = rand48buf[i];
- rand48buf[i] = buf[i];
- }
- a[0] = A_0;
- a[1] = A_1;
- a[2] = A_2;
- c = C;
- return (unsigned short *)&oldx;
-}
-
-void lcong48(unsigned short param[7]) {
- int i;
- for (i = 0; i < 3; i++) {
- rand48buf[i] = param[i];
- a[i] = param[i + 3];
- }
- c = param[6];
-}
-
-long jrand48(randbuf buf) {
- long ret;
- ret = buf[2] << 16 | buf[1];
- calc_next(buf);
- return ret;
-}
-
-long nrand48(randbuf buf) {
- return jrand48(buf) & 0x7FFFFFFFL;
-}
-
-double erand48(randbuf buf) {
- double ret;
- ret = ((buf[0] / 65536.0 + buf[1]) / 65536.0 + buf[2]) / 65536.0;
- calc_next(buf);
- return ret;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/rand_r.c b/mdk-stage1/dietlibc/lib/rand_r.c
deleted file mode 100644
index 55f8303bc..000000000
--- a/mdk-stage1/dietlibc/lib/rand_r.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (C) 2002 Luc Van Oostenryck
-
- This is free software. You can redistribute and
- modify it under the terms of the GNU General Public
- Public License.
-*/
-
-#include <stdlib.h>
-#include <stdint.h>
-
-/* Knuth's TAOCP section 3.6 */
-#define M ((1U<<31) -1)
-#define A 48271
-#define Q 44488 // M/A
-#define R 3399 // M%A; R < Q !!!
-
-// FIXME: ISO C/SuS want a longer period
-
-int rand_r(unsigned int* seed)
-{ int32_t X;
-
- X = *seed;
- X = A*(X%Q) - R * (int32_t) (X/Q);
- if (X < 0)
- X += M;
-
- *seed = X;
- return X;
-}
diff --git a/mdk-stage1/dietlibc/lib/readdir.c b/mdk-stage1/dietlibc/lib/readdir.c
deleted file mode 100644
index ed885a5f0..000000000
--- a/mdk-stage1/dietlibc/lib/readdir.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "dietdirent.h"
-#include <unistd.h>
-#include <dirent.h>
-#include <stdlib.h>
-
-struct dirent* readdir(DIR *d) {
- if (!d->num || (d->cur += ((struct dirent*)(d->buf+d->cur))->d_reclen)>=d->num) {
- int res=getdents(d->fd,(struct dirent*)d->buf,sizeof (d->buf)-1);
- if (res<=0) return 0;
- d->num=res; d->cur=0;
- }
- return (struct dirent*)(d->buf+d->cur);
-}
diff --git a/mdk-stage1/dietlibc/lib/readdir64.c b/mdk-stage1/dietlibc/lib/readdir64.c
deleted file mode 100644
index b9b0aafcc..000000000
--- a/mdk-stage1/dietlibc/lib/readdir64.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "dietfeatures.h"
-#include "dietdirent.h"
-#include <unistd.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include "syscalls.h"
-
-#ifndef __NR_getdents64
-#define WANT_LARGEFILE_BACKCOMPAT
-#endif
-
-#ifndef WANT_LARGEFILE_BACKCOMPAT
-struct dirent64* readdir64(DIR *d) {
- if (!d->num || (d->cur += ((struct dirent64*)(d->buf+d->cur))->d_reclen)>=d->num) {
- int res=getdents64(d->fd,(struct dirent64*)d->buf, sizeof (d->buf)-1);
- if (res<=0) return 0;
- d->num=res; d->cur=0;
- }
- return (struct dirent64*)(d->buf+d->cur);
-}
-#else
-struct dirent64* readdir64(DIR *d) {
-#ifdef __NR_getdents64
- static int trygetdents64=1;
-#endif
- struct dirent* o;
- static struct dirent64 d64;
-again:
-#ifdef __NR_getdents64
- if (!trygetdents64) {
-#endif
- if (!d->num || (d->cur += ((struct dirent*)(d->buf+d->cur))->d_reclen)>=d->num) {
- int res=getdents(d->fd,(struct dirent*)d->buf, sizeof (d->buf)-1);
- if (res<=0) return 0;
- d->num=res; d->cur=0;
- }
- o=(struct dirent*)(d->buf+d->cur);
- d64.d_ino=o->d_ino;
- d64.d_off=o->d_off;
- d64.d_reclen=o->d_reclen;
- strcpy(d64.d_name,o->d_name);
- d64.d_type=0; /* is this correct? */
- return &d64;
-#ifdef __NR_getdents64
- }
- if (!d->num || (d->cur += ((struct dirent64*)(d->buf+d->cur))->d_reclen)>=d->num) {
- int res=getdents64(d->fd,(struct dirent64*)d->buf,sizeof (d->buf));
- if (res<=0) {
- if (errno==ENOSYS) {
- trygetdents64=0;
- goto again;
- }
- return 0;
- }
- d->num=res; d->cur=0;
- }
- return (struct dirent64*)(d->buf+d->cur);
-#endif
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/reboot.c b/mdk-stage1/dietlibc/lib/reboot.c
deleted file mode 100644
index 421068504..000000000
--- a/mdk-stage1/dietlibc/lib/reboot.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/reboot.h>
-
-int __reboot(unsigned int magic1, unsigned int magic2, int cmd);
-
-int reboot(int cmd)
-{
- return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd);
-}
diff --git a/mdk-stage1/dietlibc/lib/recv.c b/mdk-stage1/dietlibc/lib/recv.c
deleted file mode 100644
index c6bab4fb1..000000000
--- a/mdk-stage1/dietlibc/lib/recv.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/types.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_recv(int a, const void * b, size_t c, int flags);
-int __libc_recv(int a, const void * b, size_t c, int flags) {
- unsigned long args[] = { a, (long) b, c, flags };
- return socketcall(SYS_RECV, args);
-}
-
-int recv(int a, const void * b, size_t c, int flags)
- __attribute__ ((weak, alias("__libc_recv")));
diff --git a/mdk-stage1/dietlibc/lib/recvfrom.c b/mdk-stage1/dietlibc/lib/recvfrom.c
deleted file mode 100644
index b66ce3813..000000000
--- a/mdk-stage1/dietlibc/lib/recvfrom.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/types.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_recvfrom(int a, const void * b, size_t c, int flags, void *to, void *tolen);
-int __libc_recvfrom(int a, const void * b, size_t c, int flags, void *to, void *tolen) {
- unsigned long args[] = { a, (long) b, c, flags, (long) to, (long) tolen };
- return socketcall(SYS_RECVFROM, args);
-}
-
-int recvfrom(int a, const void * b, size_t c, int flags, void *to, void *tolen)
- __attribute__ ((weak,alias("__libc_recvfrom"))) ;
diff --git a/mdk-stage1/dietlibc/lib/recvmsg.c b/mdk-stage1/dietlibc/lib/recvmsg.c
deleted file mode 100644
index d843ce9c0..000000000
--- a/mdk-stage1/dietlibc/lib/recvmsg.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/socket.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_recvmsg(int a, struct msghdr* msg, int flags);
-int __libc_recvmsg(int a, struct msghdr* msg, int flags) {
- unsigned long args[] = { a, (long) msg, flags };
- return socketcall(SYS_RECVMSG, args);
-}
-
-int recvmsg(int a, struct msghdr *msg, int flags)
- __attribute__ ((weak,alias("__libc_recvmsg"))) ;
diff --git a/mdk-stage1/dietlibc/lib/remove.c b/mdk-stage1/dietlibc/lib/remove.c
deleted file mode 100644
index 06f686356..000000000
--- a/mdk-stage1/dietlibc/lib/remove.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-#include "dietfeatures.h"
-#include <stdio.h>
-
-int remove(const char* filename) {
- if (unlink(filename)) {
- if (errno==EISDIR)
- return rmdir(filename);
- return -1;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/rewind.c b/mdk-stage1/dietlibc/lib/rewind.c
deleted file mode 100644
index 48434a316..000000000
--- a/mdk-stage1/dietlibc/lib/rewind.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-void rewind( FILE *stream) {
- fseek(stream, 0L, SEEK_SET);
-}
diff --git a/mdk-stage1/dietlibc/lib/rewinddir.c b/mdk-stage1/dietlibc/lib/rewinddir.c
deleted file mode 100644
index addc7bde9..000000000
--- a/mdk-stage1/dietlibc/lib/rewinddir.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "dietdirent.h"
-#include <unistd.h>
-#include <dirent.h>
-
-void rewinddir(DIR *d) {
- if (lseek(d->fd,0,SEEK_SET) != (off_t)-1)
- d->num=d->cur=0;
-}
diff --git a/mdk-stage1/dietlibc/lib/sbrk.c b/mdk-stage1/dietlibc/lib/sbrk.c
deleted file mode 100644
index 799ce7428..000000000
--- a/mdk-stage1/dietlibc/lib/sbrk.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <unistd.h>
-
-extern int __libc_brk(void *end_data_segment);
-
-extern void* __curbrk;
-
-void* __libc_sbrk(ptrdiff_t increment);
-void* __libc_sbrk(ptrdiff_t increment) {
- void* oldbrk;
- if (__curbrk==0)
- if (__libc_brk(0) < 0)
- return (void*)-1;
- if (increment==0)
- return __curbrk;
- oldbrk=__curbrk;
- if (__libc_brk((char*)oldbrk+increment)<0)
- return (void*)-1;
- return oldbrk;
-}
-
-void* sbrk (ptrdiff_t increment) __attribute__((weak,alias("__libc_sbrk")));
diff --git a/mdk-stage1/dietlibc/lib/seekdir.c b/mdk-stage1/dietlibc/lib/seekdir.c
deleted file mode 100644
index cf111fbc8..000000000
--- a/mdk-stage1/dietlibc/lib/seekdir.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "dietdirent.h"
-#include <unistd.h>
-#include <dirent.h>
-
-void seekdir(DIR *d,off_t offset) {
- if (lseek(d->fd,offset,SEEK_SET) != (off_t)-1)
- d->num=d->cur=0;
-}
diff --git a/mdk-stage1/dietlibc/lib/semctl.c b/mdk-stage1/dietlibc/lib/semctl.c
deleted file mode 100644
index cec0b7535..000000000
--- a/mdk-stage1/dietlibc/lib/semctl.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-
-extern int __ipc(int,int,int,int,void*);
-
-union semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
- unsigned short *array; /* array for GETALL & SETALL */
- struct seminfo *__buf; /* buffer for IPC_INFO */
- void *__pad;
-};
-
-int semctl(int semid, int semnum, int cmd, union semun arg);
-int semctl(int semid, int semnum, int cmd, union semun arg) {
- return __ipc(SEMCTL,semid,semnum,cmd,&arg);
-}
diff --git a/mdk-stage1/dietlibc/lib/semget.c b/mdk-stage1/dietlibc/lib/semget.c
deleted file mode 100644
index c3649eea1..000000000
--- a/mdk-stage1/dietlibc/lib/semget.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-
-extern int __ipc(int,key_t,int,int,int);
-
-int semget(key_t key, int nsems, int semflg) {
- return __ipc(SEMGET,key,nsems,semflg,0);
-}
diff --git a/mdk-stage1/dietlibc/lib/semop.c b/mdk-stage1/dietlibc/lib/semop.c
deleted file mode 100644
index 4d2e748cc..000000000
--- a/mdk-stage1/dietlibc/lib/semop.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-
-extern int __ipc(int,int,unsigned,int,void*);
-
-int semop(int semid,struct sembuf *sops,unsigned nsops) {
- return __ipc(SEMOP,semid,nsops,0,sops);
-}
diff --git a/mdk-stage1/dietlibc/lib/send.c b/mdk-stage1/dietlibc/lib/send.c
deleted file mode 100644
index 783ecaf89..000000000
--- a/mdk-stage1/dietlibc/lib/send.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/types.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_send(int a, const void * b, size_t c, int flags);
-int __libc_send(int a, const void * b, size_t c, int flags) {
- unsigned long args[] = { a, (long) b, c, flags };
- return socketcall(SYS_SEND, args);
-}
-
-int send(int a, const void * b, size_t c, int flags)
- __attribute__ ((weak, alias("__libc_send")));
diff --git a/mdk-stage1/dietlibc/lib/sendmsg.c b/mdk-stage1/dietlibc/lib/sendmsg.c
deleted file mode 100644
index bb5d1711a..000000000
--- a/mdk-stage1/dietlibc/lib/sendmsg.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/socket.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_sendmsg(int a, const struct msghdr* msg, int flags);
-int __libc_sendmsg(int a, const struct msghdr* msg, int flags) {
- unsigned long args[] = { a, (long) msg, flags };
- return socketcall(SYS_SENDMSG, args);
-}
-
-int sendmsg(int a, const struct msghdr *msg, int flags)
- __attribute__ ((weak,alias("__libc_sendmsg"))) ;
diff --git a/mdk-stage1/dietlibc/lib/sendto.c b/mdk-stage1/dietlibc/lib/sendto.c
deleted file mode 100644
index d3239932b..000000000
--- a/mdk-stage1/dietlibc/lib/sendto.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/socket.h>
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_sendto(int a, const void * b, size_t c, int flags, void *to, int tolen);
-int __libc_sendto(int a, const void * b, size_t c, int flags, void *to, int tolen) {
- unsigned long args[] = { a, (long) b, c, flags, (long) to, tolen };
- return socketcall(SYS_SENDTO, args);
-}
-
-int sendto(int a, const void * b, size_t c, int flags, const struct sockaddr* to, socklen_t tolen)
- __attribute__ ((weak, alias("__libc_sendto")));
diff --git a/mdk-stage1/dietlibc/lib/setlinebuf.c b/mdk-stage1/dietlibc/lib/setlinebuf.c
deleted file mode 100644
index 1f30e183a..000000000
--- a/mdk-stage1/dietlibc/lib/setlinebuf.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdio.h>
-#include "dietwarning.h"
-#undef setlinebuf
-
-/* there is no previous prototype because it is a #define */
-void setlinebuf(FILE* stream);
-
-void setlinebuf(FILE* stream) {
- setvbuf(stream,0,_IOLBF,BUFSIZ);
-}
-
-link_warning("setlinebuf","warning: you used setlinebuf without including <stdio.h>")
diff --git a/mdk-stage1/dietlibc/lib/setpgrp.c b/mdk-stage1/dietlibc/lib/setpgrp.c
deleted file mode 100644
index 825ca3725..000000000
--- a/mdk-stage1/dietlibc/lib/setpgrp.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <unistd.h>
-
-int setpgrp()
-{
- return setpgid(0,0);
-}
diff --git a/mdk-stage1/dietlibc/lib/setsockopt.c b/mdk-stage1/dietlibc/lib/setsockopt.c
deleted file mode 100644
index e4bab349f..000000000
--- a/mdk-stage1/dietlibc/lib/setsockopt.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_setsockopt(int a, int b, int c, void *d, void *e);
-int __libc_setsockopt(int a, int b, int c, void *d, void *e) {
- unsigned long args[] = { a, b, c, (long)d, (long) e };
- return socketcall(SYS_SETSOCKOPT, args);
-}
-
-int setsockopt(int s, int level, int optname, const void* optval, socklen_t optlen) __attribute__((weak,alias("__libc_setsockopt")));
diff --git a/mdk-stage1/dietlibc/lib/shmat.c b/mdk-stage1/dietlibc/lib/shmat.c
deleted file mode 100644
index d4b34c120..000000000
--- a/mdk-stage1/dietlibc/lib/shmat.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-extern void* __ipc(int,int,int,void*,const void*);
-
-void* shmat(int shmid,const void* shmaddr,int shmflg) {
- void* raddr;
- register void* result;
- result=__ipc(SHMAT,shmid,shmflg,&raddr,shmaddr);
- if ((unsigned long)result <= -(unsigned long)8196)
- result=raddr;
- return result;
-}
diff --git a/mdk-stage1/dietlibc/lib/shmctl.c b/mdk-stage1/dietlibc/lib/shmctl.c
deleted file mode 100644
index 92b9d1fbb..000000000
--- a/mdk-stage1/dietlibc/lib/shmctl.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-extern int __ipc(int,int,int,int,void*);
-
-int shmctl(int shmid, int cmd, struct shmid_ds *buf) {
- return __ipc(SHMCTL,shmid,cmd,0,buf);
-}
diff --git a/mdk-stage1/dietlibc/lib/shmdt.c b/mdk-stage1/dietlibc/lib/shmdt.c
deleted file mode 100644
index 54dc6f41b..000000000
--- a/mdk-stage1/dietlibc/lib/shmdt.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-extern int __ipc(int,int,int,int,const void*);
-
-int shmdt(const void* shmaddr) {
- return __ipc(SHMDT,0,0,0,shmaddr);
-}
diff --git a/mdk-stage1/dietlibc/lib/shmget.c b/mdk-stage1/dietlibc/lib/shmget.c
deleted file mode 100644
index bf1dc2030..000000000
--- a/mdk-stage1/dietlibc/lib/shmget.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-extern int __ipc(int,key_t,int,int,int);
-
-int shmget(key_t key, int size, int shmflg) {
- return __ipc(SHMGET,key,size,shmflg,0);
-}
diff --git a/mdk-stage1/dietlibc/lib/shutdown.c b/mdk-stage1/dietlibc/lib/shutdown.c
deleted file mode 100644
index 0e7b8755c..000000000
--- a/mdk-stage1/dietlibc/lib/shutdown.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-#include <sys/socket.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_shutdown(int s, int how);
-int __libc_shutdown(int s, int how) {
- unsigned long args[] = { s, (long) how, 0 };
- return socketcall(SYS_SHUTDOWN, args);
-}
-
-int shutdown(int s, int how) __attribute__((weak,alias("__libc_shutdown")));
diff --git a/mdk-stage1/dietlibc/lib/sigaction.c b/mdk-stage1/dietlibc/lib/sigaction.c
deleted file mode 100644
index fe1351f0f..000000000
--- a/mdk-stage1/dietlibc/lib/sigaction.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <signal.h>
-
-int __rt_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact, long nr);
-
-int __libc_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
-int __libc_sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
- return __rt_sigaction(signum, act, oldact, _NSIG/8);
-}
-
-int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
-__attribute__((weak,alias("__libc_sigaction")));
diff --git a/mdk-stage1/dietlibc/lib/sigaddset.c b/mdk-stage1/dietlibc/lib/sigaddset.c
deleted file mode 100644
index 1c2632e67..000000000
--- a/mdk-stage1/dietlibc/lib/sigaddset.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <signal.h>
-#include <errno.h>
-
-#define __sigmask(sig) ( ((unsigned long)1) << (((sig)-1) % (8*sizeof(unsigned long))) )
-#define __sigword(sig) ( ((sig)-1) / (8*sizeof(unsigned long)) )
-
-int sigaddset(sigset_t *set, int signo) {
- if ((signo<1)||(signo>SIGRTMAX)) {
- (*__errno_location())=EINVAL;
- return -1;
- } else {
- unsigned long __mask = __sigmask (signo);
- unsigned long __word = __sigword (signo);
- set->sig[__word]|=__mask;
- return 0;
- }
-}
diff --git a/mdk-stage1/dietlibc/lib/sigdelset.c b/mdk-stage1/dietlibc/lib/sigdelset.c
deleted file mode 100644
index 0c47ce348..000000000
--- a/mdk-stage1/dietlibc/lib/sigdelset.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <signal.h>
-#include <errno.h>
-
-#define __sigmask(sig) ( ((unsigned long)1) << (((sig)-1) % (8*sizeof(unsigned long))) )
-#define __sigword(sig) ( ((sig)-1) / (8*sizeof(unsigned long)) )
-
-int sigdelset(sigset_t *set, int signo) {
- if ((signo<1)||(signo>SIGRTMAX)) {
- (*__errno_location())=EINVAL;
- return -1;
- } else {
- unsigned long __mask = __sigmask (signo);
- unsigned long __word = __sigword (signo);
- set->sig[__word]&=~__mask;
- return 0;
- }
-}
diff --git a/mdk-stage1/dietlibc/lib/sigemptyset.c b/mdk-stage1/dietlibc/lib/sigemptyset.c
deleted file mode 100644
index 4efee2550..000000000
--- a/mdk-stage1/dietlibc/lib/sigemptyset.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <signal.h>
-
-int sigemptyset(sigset_t *set) {
- set->sig[0]=0;
- if (_NSIG_WORDS>1) set->sig[1]=0;
- if (_NSIG_WORDS>2) {
- set->sig[2]=0;
- set->sig[3]=0;
- }
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/sigfillset.c b/mdk-stage1/dietlibc/lib/sigfillset.c
deleted file mode 100644
index b4e369fe4..000000000
--- a/mdk-stage1/dietlibc/lib/sigfillset.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <signal.h>
-
-int sigfillset(sigset_t *set) {
- set->sig[0]=(unsigned long)-1;
- if (_NSIG_WORDS>1) set->sig[1]=(unsigned long)-1;
- if (_NSIG_WORDS>2) {
- set->sig[2]=(unsigned long)-1;
- set->sig[3]=(unsigned long)-1;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/siginterrupt.c b/mdk-stage1/dietlibc/lib/siginterrupt.c
deleted file mode 100644
index 8926f09ed..000000000
--- a/mdk-stage1/dietlibc/lib/siginterrupt.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <signal.h>
-
-int siginterrupt(int sig, int flag) {
- int ret;
- struct sigaction act;
-
- sigaction(sig, 0, &act);
-
- if (flag)
- act.sa_flags &= ~SA_RESTART;
- else
- act.sa_flags |= SA_RESTART;
-
- ret = sigaction(sig, &act, 0);
-
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/lib/sigismember.c b/mdk-stage1/dietlibc/lib/sigismember.c
deleted file mode 100644
index 8ffe9762a..000000000
--- a/mdk-stage1/dietlibc/lib/sigismember.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <signal.h>
-#include <errno.h>
-
-#define __sigmask(sig) ( ((unsigned long)1) << (((sig)-1) % (8*sizeof(unsigned long))) )
-#define __sigword(sig) ( ((sig)-1) / (8*sizeof(unsigned long)) )
-
-int sigismember(const sigset_t *set, int signo) {
- if ((signo<1)||(signo>SIGRTMAX)) {
- (*__errno_location())=EINVAL;
- return -1;
- } else {
- unsigned long __mask = __sigmask (signo);
- unsigned long __word = __sigword (signo);
- return (set->sig[__word] & __mask)?1:0;
- }
-}
diff --git a/mdk-stage1/dietlibc/lib/sigjmp.c b/mdk-stage1/dietlibc/lib/sigjmp.c
deleted file mode 100644
index 73c8baa8e..000000000
--- a/mdk-stage1/dietlibc/lib/sigjmp.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <setjmp.h>
-#include <signal.h>
-
-int __sigjmp_save(sigjmp_buf env,int savemask);
-int __sigjmp_save(sigjmp_buf env,int savemask) {
- if (savemask) {
- env[0].__mask_was_saved=(sigprocmask(SIG_BLOCK,(sigset_t*)0,(sigset_t*)&env[0].__saved_mask)==0);
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/signal.c b/mdk-stage1/dietlibc/lib/signal.c
deleted file mode 100644
index 51441558e..000000000
--- a/mdk-stage1/dietlibc/lib/signal.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <signal.h>
-
-sighandler_t signal(int signum, sighandler_t action) {
- struct sigaction sa,oa;
- sa.sa_handler=action;
- sigemptyset(&sa.sa_mask);
- sigaddset(&sa.sa_mask,signum);
- sa.sa_flags=SA_NODEFER;
- if (sigaction(signum,&sa,&oa))
- return SIG_ERR;
- return oa.sa_handler;
-}
diff --git a/mdk-stage1/dietlibc/lib/sigpending.c b/mdk-stage1/dietlibc/lib/sigpending.c
deleted file mode 100644
index 62a4761c6..000000000
--- a/mdk-stage1/dietlibc/lib/sigpending.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <signal.h>
-
-int __rt_sigpending(sigset_t *set, long nr);
-
-int sigpending(sigset_t *set) {
- return __rt_sigpending(set, _NSIG/8);
-}
diff --git a/mdk-stage1/dietlibc/lib/sigprocmask.c b/mdk-stage1/dietlibc/lib/sigprocmask.c
deleted file mode 100644
index 6d770c3d3..000000000
--- a/mdk-stage1/dietlibc/lib/sigprocmask.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <signal.h>
-
-int __rt_sigprocmask(int how, const sigset_t *set, sigset_t *oldsetm, long nr);
-
-int sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
- return __rt_sigprocmask(how, set, oldset, _NSIG/8);
-}
diff --git a/mdk-stage1/dietlibc/lib/sigqueueinfo.c b/mdk-stage1/dietlibc/lib/sigqueueinfo.c
deleted file mode 100644
index adb7349f4..000000000
--- a/mdk-stage1/dietlibc/lib/sigqueueinfo.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <signal.h>
-
-int __rt_sigqueueinfo(int pid, int sig, siginfo_t *info);
-
-int sigqueueinfo(int pid, int sig, siginfo_t *info) {
- return __rt_sigqueueinfo(pid, sig, info);
-}
diff --git a/mdk-stage1/dietlibc/lib/sigsuspend.c b/mdk-stage1/dietlibc/lib/sigsuspend.c
deleted file mode 100644
index a020789e9..000000000
--- a/mdk-stage1/dietlibc/lib/sigsuspend.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <signal.h>
-
-int __rt_sigsuspend(const sigset_t *mask, long nr);
-
-int __libc_sigsuspend(const sigset_t *mask);
-int __libc_sigsuspend(const sigset_t *mask) {
- return __rt_sigsuspend(mask, _NSIG/8);
-}
-
-int sigsuspend(const sigset_t *mask) __attribute__((weak,alias("__libc_sigsuspend")));
diff --git a/mdk-stage1/dietlibc/lib/sigtimedwait.c b/mdk-stage1/dietlibc/lib/sigtimedwait.c
deleted file mode 100644
index 864e433c3..000000000
--- a/mdk-stage1/dietlibc/lib/sigtimedwait.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <signal.h>
-
-int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts, long nr);
-
-int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts) {
- return __rt_sigtimedwait(set,info,ts,_NSIG/8);
-}
diff --git a/mdk-stage1/dietlibc/lib/sleep.c b/mdk-stage1/dietlibc/lib/sleep.c
deleted file mode 100644
index 45c51f1b6..000000000
--- a/mdk-stage1/dietlibc/lib/sleep.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <unistd.h>
-#include <time.h>
-
-unsigned int sleep(unsigned int secs) {
- struct timespec t;
- t.tv_sec=secs;
- t.tv_nsec=0;
- nanosleep(&t,&t);
- return secs-t.tv_sec;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/snprintf.c b/mdk-stage1/dietlibc/lib/snprintf.c
deleted file mode 100644
index 141b4ec13..000000000
--- a/mdk-stage1/dietlibc/lib/snprintf.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdio.h>
-
-int snprintf(char *str,size_t size,const char *format,...)
-{
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vsnprintf(str,size,format,arg_ptr);
- va_end (arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/lib/socket.c b/mdk-stage1/dietlibc/lib/socket.c
deleted file mode 100644
index c18df5123..000000000
--- a/mdk-stage1/dietlibc/lib/socket.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_socket(int a, int b, int c);
-int __libc_socket(int a, int b, int c) {
- unsigned long args[] = { a, b, c };
- return socketcall(SYS_SOCKET, args);
-}
-
-int socket(int a,int b,int c) __attribute__((weak,alias("__libc_socket")));
diff --git a/mdk-stage1/dietlibc/lib/socketpair.c b/mdk-stage1/dietlibc/lib/socketpair.c
deleted file mode 100644
index e6f1fd822..000000000
--- a/mdk-stage1/dietlibc/lib/socketpair.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <linuxnet.h>
-
-extern int socketcall(int callno,long* args);
-
-int __libc_socketpair(int a, int type, int protocol, int sv[2]);
-int __libc_socketpair(int a, int type, int protocol, int sv[2]) {
- unsigned long args[] = { a, type, protocol, (long)sv };
- return socketcall(SYS_SOCKETPAIR, args);
-}
-
-int socketpair(int d, int type, int protocol, int sv[2])
- __attribute__((weak,alias("__libc_socketpair")));
diff --git a/mdk-stage1/dietlibc/lib/sprintf.c b/mdk-stage1/dietlibc/lib/sprintf.c
deleted file mode 100644
index 37fd831d9..000000000
--- a/mdk-stage1/dietlibc/lib/sprintf.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-int sprintf(char *dest,const char *format,...)
-{
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vsprintf(dest,format,arg_ptr);
- va_end (arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/lib/sscanf.c b/mdk-stage1/dietlibc/lib/sscanf.c
deleted file mode 100644
index e608878ef..000000000
--- a/mdk-stage1/dietlibc/lib/sscanf.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdarg.h>
-#include <stdio.h>
-
-int sscanf(const char *str, const char *format, ...)
-{
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vsscanf(str,format,arg_ptr);
- va_end (arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/lib/strcasecmp.c b/mdk-stage1/dietlibc/lib/strcasecmp.c
deleted file mode 100644
index cf1592567..000000000
--- a/mdk-stage1/dietlibc/lib/strcasecmp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <strings.h>
-
-int strcasecmp ( const char* s1, const char* s2 )
-{
- register unsigned int x2;
- register unsigned int x1;
-
- while (1) {
- x2 = *s2++ - 'A'; if (x2 < 26u) x2 += 32;
- x1 = *s1++ - 'A'; if (x1 < 26u) x1 += 32;
- if ( x2 != x1 )
- break;
- if ( x1 == (unsigned int)-'A' )
- break;
- }
-
- return x1 - x2;
-}
diff --git a/mdk-stage1/dietlibc/lib/strcat.c b/mdk-stage1/dietlibc/lib/strcat.c
deleted file mode 100644
index 8a755afea..000000000
--- a/mdk-stage1/dietlibc/lib/strcat.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "dietfeatures.h"
-#include <string.h>
-
-char* strcat(register char* s,register const char* t)
-{
- char *dest=s;
- s+=strlen(s);
- for (;;) {
- if (!(*s = *t)) break; ++s; ++t;
-#ifndef WANT_SMALL_STRING_ROUTINES
- if (!(*s = *t)) break; ++s; ++t;
- if (!(*s = *t)) break; ++s; ++t;
- if (!(*s = *t)) break; ++s; ++t;
-#endif
- }
- return dest;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/strchr.c b/mdk-stage1/dietlibc/lib/strchr.c
deleted file mode 100644
index 3a4c9b5b4..000000000
--- a/mdk-stage1/dietlibc/lib/strchr.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "dietfeatures.h"
-#include <string.h>
-
-char *strchr(register const char *t, int c) {
- register char ch;
-
- ch = c;
- for (;;) {
- if (*t == ch) break; if (!*t) return 0; ++t;
-#ifndef WANT_SMALL_STRING_ROUTINES
- if (*t == ch) break; if (!*t) return 0; ++t;
- if (*t == ch) break; if (!*t) return 0; ++t;
- if (*t == ch) break; if (!*t) return 0; ++t;
-#endif
- }
- return (char*)t;
-}
-
-char *index(char *t,int c) __attribute__((weak,alias("strchr")));
diff --git a/mdk-stage1/dietlibc/lib/strcmp.c b/mdk-stage1/dietlibc/lib/strcmp.c
deleted file mode 100644
index 3892379e5..000000000
--- a/mdk-stage1/dietlibc/lib/strcmp.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "dietfeatures.h"
-
-int strcmp(register const char *s,register const char *t) {
- register char x;
-
- for (;;) {
- x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
-#ifndef WANT_SMALL_STRING_ROUTINES
- x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
- x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
- x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
-#endif
- }
- return ((int)(unsigned int)(unsigned char) x)
- - ((int)(unsigned int)(unsigned char) *t);
-}
-
-int strcoll(const char *s,const char* t) __attribute__((weak,alias("strcmp")));
diff --git a/mdk-stage1/dietlibc/lib/strcpy.c b/mdk-stage1/dietlibc/lib/strcpy.c
deleted file mode 100644
index 444054e71..000000000
--- a/mdk-stage1/dietlibc/lib/strcpy.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "dietfeatures.h"
-
-char* strcpy(register char* s,register const char* t)
-{
- char *dest=s;
-#ifndef WANT_SMALL_STRING_ROUTINES
- for (;;) {
- if (!(*s = *t)) return dest; ++s; ++t;
- if (!(*s = *t)) return dest; ++s; ++t;
- if (!(*s = *t)) return dest; ++s; ++t;
- if (!(*s = *t)) return dest; ++s; ++t;
- }
-#else
- while ((*dest++=*t++));
- return s;
-#endif
-}
-
diff --git a/mdk-stage1/dietlibc/lib/strcspn.c b/mdk-stage1/dietlibc/lib/strcspn.c
deleted file mode 100644
index 37053c72c..000000000
--- a/mdk-stage1/dietlibc/lib/strcspn.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-size_t strcspn(const char *s, const char *reject)
-{
- size_t l=0;
- int a=1,i,al=strlen(reject);
-
- while((a)&&(*s))
- {
- for(i=0;(a)&&(i<al);i++)
- if (*s==reject[i]) a=0;
- if (a) l++;
- s++;
- }
- return l;
-}
diff --git a/mdk-stage1/dietlibc/lib/strdup.c b/mdk-stage1/dietlibc/lib/strdup.c
deleted file mode 100644
index 6a2ea5f95..000000000
--- a/mdk-stage1/dietlibc/lib/strdup.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-
-char *strdup(const char *s) {
- char *tmp=(char *)malloc(strlen(s)+1);
- if (!tmp) return 0;
- strcpy(tmp,s);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/lib/strerror.c b/mdk-stage1/dietlibc/lib/strerror.c
deleted file mode 100644
index 7cb79d988..000000000
--- a/mdk-stage1/dietlibc/lib/strerror.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "dietfeatures.h"
-#include <unistd.h>
-#include <string.h>
-
-#define _BSD_SOURCE
-#include <errno.h>
-
-extern const char __sys_err_unknown[];
-
-char*strerror(int errnum) {
- register const char*message=__sys_err_unknown;
-
- if ( (unsigned int)errnum < (unsigned int)__SYS_NERR )
- message=sys_errlist[errnum];
-#if defined(__mips__)
- if ( errnum == 1133 )
- message="Quota exceeded";
-#endif
- return (char*)message;
-}
diff --git a/mdk-stage1/dietlibc/lib/strlcat.c b/mdk-stage1/dietlibc/lib/strlcat.c
deleted file mode 100644
index fd35ec8af..000000000
--- a/mdk-stage1/dietlibc/lib/strlcat.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* $OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $ */
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(initial dst) + strlen(src); if retval >= siz,
- * truncation occurred.
- */
-size_t strlcat(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
- size_t dlen;
-
- /* Find the end of dst and adjust bytes left but don't go past end */
- while (*d != '\0' && n-- != 0)
- d++;
- dlen = d - dst;
- n = siz - dlen;
-
- if (n == 0)
- return(dlen + strlen(s));
- while (*s != '\0') {
- if (n != 1) {
- *d++ = *s;
- n--;
- }
- s++;
- }
- *d = '\0';
-
- return(dlen + (s - src)); /* count does not include NUL */
-}
diff --git a/mdk-stage1/dietlibc/lib/strlcpy.3 b/mdk-stage1/dietlibc/lib/strlcpy.3
deleted file mode 100644
index e00af8d6b..000000000
--- a/mdk-stage1/dietlibc/lib/strlcpy.3
+++ /dev/null
@@ -1,169 +0,0 @@
-.\" $OpenBSD: strlcpy.3,v 1.10 2000/11/06 01:03:25 aaron Exp $
-.\"
-.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
-.\"
-.Dd June 22, 1998
-.Dt STRLCPY 3
-.Os
-.Sh NAME
-.Nm strlcpy ,
-.Nm strlcat
-.Nd size-bounded string copying and concatenation
-.Sh SYNOPSIS
-.Fd #include <string.h>
-.Ft size_t
-.Fn strlcpy "char *dst" "const char *src" "size_t size"
-.Ft size_t
-.Fn strlcat "char *dst" "const char *src" "size_t size"
-.Sh DESCRIPTION
-The
-.Fn strlcpy
-and
-.Fn strlcat
-functions copy and concatenate strings respectively.
-They are designed
-to be safer, more consistent, and less error prone replacements for
-.Xr strncpy 3
-and
-.Xr strncat 3 .
-Unlike those functions,
-.Fn strlcpy
-and
-.Fn strlcat
-take the full size of the buffer (not just the length) and guarantee to
-NUL-terminate the result (as long as
-.Fa size
-is larger than 0 or, in the case of
-.Fn strlcat ,
-as long as there is at least one byte free in
-.Fa dst ) .
-Note that you should include a byte for the NUL in
-.Fa size .
-Also note that
-.Fn strlcpy
-and
-.Fn strlcat
-only operate on true
-.Dq C
-strings.
-This means that for
-.Fn strlcpy
-.Fa src
-must be NUL-terminated and for
-.Fn strlcat
-both
-.Fa src
-and
-.Fa dst
-must be NUL-terminated.
-.Pp
-The
-.Fn strlcpy
-function copies up to
-.Fa size
-- 1 characters from the NUL-terminated string
-.Fa src
-to
-.Fa dst ,
-NUL-terminating the result.
-.Pp
-The
-.Fn strlcat
-function appends the NUL-terminated string
-.Fa src
-to the end of
-.Fa dst .
-It will append at most
-.Fa size
-- strlen(dst) - 1 bytes, NUL-terminating the result.
-.Sh RETURN VALUES
-The
-.Fn strlcpy
-and
-.Fn strlcat
-functions return the total length of the string they tried to create.
-For
-.Fn strlcpy
-that means the length of
-.Fa src .
-For
-.Fn strlcat
-that means the initial length of
-.Fa dst
-plus
-the length of
-.Fa src .
-While this may seem somewhat confusing it was done to make
-truncation detection simple.
-.Sh EXAMPLES
-The following code fragment illustrates the simple case:
-.Bd -literal -offset indent
-char *s, *p, buf[BUFSIZ];
-
-\&...
-
-(void)strlcpy(buf, s, sizeof(buf));
-(void)strlcat(buf, p, sizeof(buf));
-.Ed
-.Pp
-To detect truncation, perhaps while building a pathname, something
-like the following might be used:
-.Bd -literal -offset indent
-char *dir, *file, pname[MAXPATHLEN];
-
-\&...
-
-if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname))
- goto toolong;
-if (strlcat(pname, file, sizeof(pname)) >= sizeof(pname))
- goto toolong;
-.Ed
-.Pp
-Since we know how many characters we copied the first time, we can
-speed things up a bit by using a copy instead of an append:
-.Bd -literal -offset indent
-char *dir, *file, pname[MAXPATHLEN];
-size_t n;
-
-\&...
-
-n = strlcpy(pname, dir, sizeof(pname));
-if (n >= sizeof(pname))
- goto toolong;
-if (strlcpy(pname + n, file, sizeof(pname) - n) >= sizeof(pname) - n)
- goto toolong;
-.Ed
-.Pp
-However, one may question the validity of such optimizations, as they
-defeat the whole purpose of
-.Fn strlcpy
-and
-.Fn strlcat .
-As a matter of fact, the first version of this manual page got it wrong.
-.Sh SEE ALSO
-.Xr snprintf 3 ,
-.Xr strncat 3 ,
-.Xr strncpy 3
diff --git a/mdk-stage1/dietlibc/lib/strlcpy.c b/mdk-stage1/dietlibc/lib/strlcpy.c
deleted file mode 100644
index b935b9527..000000000
--- a/mdk-stage1/dietlibc/lib/strlcpy.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* $OpenBSD: strlcpy.c,v 1.3 1999/04/24 01:17:37 millert Exp $ */
-
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcpy.c,v 1.3 1999/04/24 01:17:37 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
-size_t strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
-{
- register char *d = dst;
- register const char *s = src;
- register size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
diff --git a/mdk-stage1/dietlibc/lib/strlen.c b/mdk-stage1/dietlibc/lib/strlen.c
deleted file mode 100644
index 96da5a540..000000000
--- a/mdk-stage1/dietlibc/lib/strlen.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <endian.h>
-#include "dietfeatures.h"
-#include <string.h>
-
-#ifdef WANT_SMALL_STRING_ROUTINES
-size_t strlen(const char *s) {
- register size_t i;
- if (!s) return 0;
- for (i=0; *s; ++s) ++i;
- return i;
-}
-#else
-static const unsigned long magic = 0x01010101;
-
-size_t strlen(const char *s)
-{
- const char *t = s;
- unsigned long word;
-
- if (!s) return 0;
-
- /* Byte compare up until word boundary */
- for (; ((unsigned long) t & 3); t++)
- if (!*t) return t - s;
-
- /* Word compare */
- do {
- word = *((unsigned long *) t); t += 4;
- word = (word - magic) &~ word;
- word &= (magic << 7);
- } while (word == 0);
-
-#if BYTE_ORDER == LITTLE_ENDIAN
- /* word & 0x80808080 == word */
- word = (word - 1) & (magic << 10);
- word += (word << 8) + (word << 16);
- t += word >> 26;
-#else
- if ((word & 0x80800000) == 0) {
- word <<= 16;
- t += 2;
- }
- if ((word & 0x80000000) == 0) t += 1;
-#endif
- return ((const char *) t) - 4 - s;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/lib/strncasecmp.c b/mdk-stage1/dietlibc/lib/strncasecmp.c
deleted file mode 100644
index 543fe56ba..000000000
--- a/mdk-stage1/dietlibc/lib/strncasecmp.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <sys/types.h>
-#include <strings.h>
-
-int strncasecmp ( const char* s1, const char* s2, size_t len )
-{
- register unsigned int x2;
- register unsigned int x1;
- register const char* end = s1 + len;
-
- while (1) {
- if ( s1 >= end )
- return 0;
- x2 = *s2++ - 'A'; if (x2 < 26u) x2 += 32;
- x1 = *s1++ - 'A'; if (x1 < 26u) x1 += 32;
- if ( x2 != x1 )
- break;
- if ( x1 == (unsigned int)-'A' )
- break;
- }
-
- return x1 - x2;
-}
diff --git a/mdk-stage1/dietlibc/lib/strncat.c b/mdk-stage1/dietlibc/lib/strncat.c
deleted file mode 100644
index 9802d5678..000000000
--- a/mdk-stage1/dietlibc/lib/strncat.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "dietfeatures.h"
-#include <string.h>
-
-#ifdef WANT_NON_COMPLIANT_STRNCAT
-/* this implementation is not standards compliant.
- * the standard says that strncat(dest,"foobar",3) should write 'f', 'o'
- * and 'o'. The programmer is then expected to overwrite the last byte
- * with '\0', which is often forgotten. This implementation makes sure
- * the last written bytes is always '\0'. */
-#endif
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-char *strncat(char *s, const char *t, size_t n) {
- char *dest=s;
- register char *max;
- s+=strlen(s);
-#ifdef WANT_NON_COMPLIANT_STRNCAT
- if ((max=s+n-1)<=s) goto fini;
-#else
- if ((max=s+n)==s) goto fini;
-#endif
- for (;;) {
- if (!(*s = *t)) break; if (++s==max) break; ++t;
-#ifndef WANT_SMALL_STRING_ROUTINES
- if (!(*s = *t)) break; if (++s==max) break; ++t;
- if (!(*s = *t)) break; if (++s==max) break; ++t;
- if (!(*s = *t)) break; if (++s==max) break; ++t;
-#endif
- }
- *s=0;
-fini:
- return dest;
-}
diff --git a/mdk-stage1/dietlibc/lib/strncmp.c b/mdk-stage1/dietlibc/lib/strncmp.c
deleted file mode 100644
index b3b56cfbb..000000000
--- a/mdk-stage1/dietlibc/lib/strncmp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-int strncmp(const char *s1, const char *s2, size_t n) {
- register const char* a=s1;
- register const char* b=s2;
- register const char* fini=a+n;
- while (a<fini) {
- register int res=*a-*b;
- if (res) return res;
- if (!*a) return 0;
- ++a; ++b;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/strncpy.c b/mdk-stage1/dietlibc/lib/strncpy.c
deleted file mode 100644
index 31b682a1e..000000000
--- a/mdk-stage1/dietlibc/lib/strncpy.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE
-#include <sys/types.h>
-#include <string.h>
-#include "dietfeatures.h"
-
-/* gcc is broken and has a non-SUSv2 compliant internal prototype.
- * This causes it to warn about a type mismatch here. Ignore it. */
-char *strncpy(char *dest, const char *src, size_t n) {
-#ifdef WANT_FULL_POSIX_COMPAT
- memset(dest,0,n);
-#endif
- memccpy(dest,src,0,n);
- return dest;
-}
diff --git a/mdk-stage1/dietlibc/lib/strpbrk.c b/mdk-stage1/dietlibc/lib/strpbrk.c
deleted file mode 100644
index e18fd2a2d..000000000
--- a/mdk-stage1/dietlibc/lib/strpbrk.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-char *strpbrk(const char *s, const char *accept) {
- register int i,l=strlen(accept);
- for (; *s; s++)
- for (i=0; i<l; i++)
- if (*s == accept[i])
- return (char*)s;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/strrchr.c b/mdk-stage1/dietlibc/lib/strrchr.c
deleted file mode 100644
index 1abb655e2..000000000
--- a/mdk-stage1/dietlibc/lib/strrchr.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <string.h>
-#include "dietfeatures.h"
-
-char *strrchr(const char *t, int c) {
- register char ch;
- register const char *l=0;
-
- ch = c;
- for (;;) {
- if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
-#ifndef WANT_SMALL_STRING_ROUTINES
- if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
- if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
- if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
-#endif
- }
- return (char*)l;
-}
-
-char *rindex(const char *t,int c) __attribute__((weak,alias("strrchr")));
diff --git a/mdk-stage1/dietlibc/lib/strsep.c b/mdk-stage1/dietlibc/lib/strsep.c
deleted file mode 100644
index db76f89b5..000000000
--- a/mdk-stage1/dietlibc/lib/strsep.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <string.h>
-
-char *strsep(char **stringp, const char *delim) {
- register char *tmp=*stringp;
- register char *tmp2=tmp;
- register const char *tmp3;
- if (!*stringp) return 0;
- for (tmp2=tmp; *tmp2; ++tmp2) {
- for (tmp3=delim; *tmp3; ++tmp3)
- if (*tmp2==*tmp3) { /* delimiter found */
- *tmp2=0;
- *stringp=tmp2+1;
- return tmp;
- }
- }
- *stringp=0;
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/lib/strspn.c b/mdk-stage1/dietlibc/lib/strspn.c
deleted file mode 100644
index 2b3a4c116..000000000
--- a/mdk-stage1/dietlibc/lib/strspn.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-size_t strspn(const char *s, const char *accept)
-{
- size_t l=0;
- int a=1,i,al=strlen(accept);
-
- while((a)&&(*s))
- {
- for(a=i=0;(!a)&&(i<al);i++)
- if (*s==accept[i]) a=1;
- if (a) l++;
- s++;
- }
- return l;
-}
diff --git a/mdk-stage1/dietlibc/lib/strstr.c b/mdk-stage1/dietlibc/lib/strstr.c
deleted file mode 100644
index 0632cc28a..000000000
--- a/mdk-stage1/dietlibc/lib/strstr.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-
-char *strstr(const char *haystack, const char *needle) {
- size_t nl=strlen(needle);
- size_t hl=strlen(haystack);
- int i;
- if (!nl) goto found;
- if (nl>hl) return 0;
- for (i=hl-nl+1; i; --i) {
- if (*haystack==*needle && !memcmp(haystack,needle,nl))
-found:
- return (char*)haystack;
- ++haystack;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/strtod.c b/mdk-stage1/dietlibc/lib/strtod.c
deleted file mode 100644
index 5d50cc535..000000000
--- a/mdk-stage1/dietlibc/lib/strtod.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-double strtod(const char* s, char** endptr) {
- register const char* p = s;
- register long double value = 0.L;
- int sign = +1;
- long double factor;
- unsigned int expo;
-
- while ( isspace(*p) )
- p++;
-
- switch (*p) {
- case '-': sign = -1;
- case '+': p++;
- default : break;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- value = value*10 + (*p++ - '0');
-
- if ( *p == '.' ) {
- factor = 1.;
-
- p++;
- while ( (unsigned int)(*p - '0') < 10u ) {
- factor *= 0.1;
- value += (*p++ - '0') * factor;
- }
- }
-
- if ( (*p | 32) == 'e' ) {
- expo = 0;
- factor = 10.L;
-
- switch (*++p) { // ja hier weiß ich nicht, was mindestens nach einem 'E' folgenden MUSS.
- case '-': factor = 0.1;
- case '+': p++;
- break;
- case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- break;
- default : value = 0.L;
- p = s;
- goto done;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- expo = 10 * expo + (*p++ - '0');
-
- while ( 1 ) {
- if ( expo & 1 )
- value *= factor;
- if ( (expo >>= 1) == 0 )
- break;
- factor *= factor;
- }
- }
-
-done:
- if ( endptr != NULL )
- *endptr = (char*)p;
-
- return value * sign;
-}
diff --git a/mdk-stage1/dietlibc/lib/strtof.c b/mdk-stage1/dietlibc/lib/strtof.c
deleted file mode 100644
index acb081e51..000000000
--- a/mdk-stage1/dietlibc/lib/strtof.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-float strtof(const char* s, char** endptr) {
- register const char* p = s;
- register float value = 0.;
- int sign = +1;
- float factor;
- unsigned int expo;
-
- while ( isspace(*p) )
- p++;
-
- switch (*p) {
- case '-': sign = -1;
- case '+': p++;
- default : break;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- value = value*10 + (*p++ - '0');
-
- if ( *p == '.' ) {
- factor = 1.;
-
- p++;
- while ( (unsigned int)(*p - '0') < 10u ) {
- factor *= 0.1;
- value += (*p++ - '0') * factor;
- }
- }
-
- if ( (*p | 32) == 'e' ) {
- expo = 0;
- factor = 10.L;
-
- switch (*++p) { // ja hier weiß ich nicht, was mindestens nach einem 'E' folgenden MUSS.
- case '-': factor = 0.1;
- case '+': p++;
- break;
- case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- break;
- default : value = 0.L;
- p = s;
- goto done;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- expo = 10 * expo + (*p++ - '0');
-
- while ( 1 ) {
- if ( expo & 1 )
- value *= factor;
- if ( (expo >>= 1) == 0 )
- break;
- factor *= factor;
- }
- }
-
-done:
- if ( endptr != NULL )
- *endptr = (char*)p;
-
- return value * sign;
-}
diff --git a/mdk-stage1/dietlibc/lib/strtok.c b/mdk-stage1/dietlibc/lib/strtok.c
deleted file mode 100644
index e041703e3..000000000
--- a/mdk-stage1/dietlibc/lib/strtok.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <string.h>
-
-static char *strtok_pos;
-
-char *strtok(char *s, const char *delim)
-{
- return strtok_r(s,delim,&strtok_pos);
-}
diff --git a/mdk-stage1/dietlibc/lib/strtok_r.c b/mdk-stage1/dietlibc/lib/strtok_r.c
deleted file mode 100644
index 93f9401de..000000000
--- a/mdk-stage1/dietlibc/lib/strtok_r.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <string.h>
-
-char *strtok_r(char *s, const char *delim, char **ptrptr)
-{
- int i;
- char *tmp=0;
-
- if (s) (*ptrptr)=s;
-
- if (**ptrptr)
- {
- while(!(i=strcspn(*ptrptr,delim))) (*ptrptr)++;
- if (**ptrptr)
- {
- tmp=(*ptrptr);
- (*ptrptr)+=i;
- if (**ptrptr) *(*ptrptr)++=0;
- }
- }
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/lib/strtol.c b/mdk-stage1/dietlibc/lib/strtol.c
deleted file mode 100644
index 2624aca0e..000000000
--- a/mdk-stage1/dietlibc/lib/strtol.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <ctype.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#define ABS_LONG_MIN 2147483648UL
-long int strtol(const char *nptr, char **endptr, int base)
-{
- int neg=0;
- unsigned long int v;
-
- while(isspace(*nptr)) nptr++;
-
- if (*nptr == '-') { neg=-1; ++nptr; }
- v=strtoul(nptr,endptr,base);
- if (v>=ABS_LONG_MIN) {
- if (v==ABS_LONG_MIN && neg) {
- errno=0;
- return v;
- }
- errno=ERANGE;
- return (neg?LONG_MIN:LONG_MAX);
- }
- return (neg?-v:v);
-}
diff --git a/mdk-stage1/dietlibc/lib/strtold.c b/mdk-stage1/dietlibc/lib/strtold.c
deleted file mode 100644
index ae5f0fa48..000000000
--- a/mdk-stage1/dietlibc/lib/strtold.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-long double strtold(const char* s, char** endptr) {
- register const char* p = s;
- register long double value = 0.L;
- int sign = +1;
- long double factor;
- unsigned int expo;
-
- while ( isspace(*p) )
- p++;
-
- switch (*p) {
- case '-': sign = -1;
- case '+': p++;
- default : break;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- value = value*10 + (*p++ - '0');
-
- if ( *p == '.' ) {
- factor = 1.;
-
- p++;
- while ( (unsigned int)(*p - '0') < 10u ) {
- factor *= 0.1;
- value += (*p++ - '0') * factor;
- }
- }
-
- if ( (*p | 32) == 'e' ) {
- expo = 0;
- factor = 10.L;
-
- switch (*++p) { // ja hier weiß ich nicht, was mindestens nach einem 'E' folgenden MUSS.
- case '-': factor = 0.1;
- case '+': p++;
- break;
- case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- break;
- default : value = 0.L;
- p = s;
- goto done;
- }
-
- while ( (unsigned int)(*p - '0') < 10u )
- expo = 10 * expo + (*p++ - '0');
-
- while ( 1 ) {
- if ( expo & 1 )
- value *= factor;
- if ( (expo >>= 1) == 0 )
- break;
- factor *= factor;
- }
- }
-
-done:
- if ( endptr != NULL )
- *endptr = (char*)p;
-
- return value * sign;
-}
diff --git a/mdk-stage1/dietlibc/lib/strtoll.c b/mdk-stage1/dietlibc/lib/strtoll.c
deleted file mode 100644
index 9e05e740e..000000000
--- a/mdk-stage1/dietlibc/lib/strtoll.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <ctype.h>
-#include <stdlib.h>
-
-long long int strtoll(const char *nptr, char **endptr, int base)
-{
- int neg=0;
- unsigned long long int v;
-
- while(isspace(*nptr)) nptr++;
-
- if (*nptr == '-' && isdigit(nptr[1])) { neg=-1; nptr++; }
- v=strtoull(nptr,endptr,base);
- return (neg?-v:v);
-}
diff --git a/mdk-stage1/dietlibc/lib/strtoul.c b/mdk-stage1/dietlibc/lib/strtoul.c
deleted file mode 100644
index e9c09fb59..000000000
--- a/mdk-stage1/dietlibc/lib/strtoul.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <ctype.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-unsigned long int strtoul(const char *nptr, char **endptr, int base)
-{
- int neg = 0;
- unsigned long int v=0;
-
- while(isspace(*nptr)) ++nptr;
- if (*nptr == '-') { neg=1; nptr++; }
- if (*nptr == '+') ++nptr;
- if (base==16 && nptr[0]=='0') goto skip0x;
- if (!base) {
- if (*nptr=='0') {
- base=8;
-skip0x:
- if (nptr[1]=='x'||nptr[1]=='X') {
- nptr+=2;
- base=16;
- }
- } else
- base=10;
- }
- while(*nptr) {
- register unsigned char c=*nptr;
- c=(c>='a'?c-'a'+10:c>='A'?c-'A'+10:c<='9'?c-'0':0xff);
- if (c>=base) break;
- {
- register unsigned long int w=v*base;
- if (w<v) {
- errno=ERANGE;
- return ULONG_MAX;
- }
- v=w+c;
- }
- ++nptr;
- }
- if (endptr) *endptr=(char *)nptr;
- errno=0; /* in case v==ULONG_MAX, ugh! */
- return (neg?-v:v);
-}
diff --git a/mdk-stage1/dietlibc/lib/strtoull.c b/mdk-stage1/dietlibc/lib/strtoull.c
deleted file mode 100644
index d6073e32a..000000000
--- a/mdk-stage1/dietlibc/lib/strtoull.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <ctype.h>
-#include <stdlib.h>
-
-unsigned long long int strtoull(const char *nptr, char **endptr, int base)
-{
- long long int v=0;
-
- while(isspace(*nptr)) ++nptr;
-
- if (*nptr == '+') ++nptr;
- if (!base) {
- if (*nptr=='0') {
- base=8;
- if ((*(nptr+1)=='x')||(*(nptr+1)=='X')) {
- nptr+=2;
- base=16;
- }
- }
- else
- base=10;
- }
- while(*nptr) {
- register unsigned char c=*nptr;
- c=(c>='a'?c-'a'+10:c>='A'?c-'A'+10:c-'0');
- if (c>=base) break;
- v=v*base+c;
- ++nptr;
- }
- if (endptr) *endptr=(char *)nptr;
- return v;
-}
diff --git a/mdk-stage1/dietlibc/lib/strxfrm.c b/mdk-stage1/dietlibc/lib/strxfrm.c
deleted file mode 100644
index 5075ff0b5..000000000
--- a/mdk-stage1/dietlibc/lib/strxfrm.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-#include "dietfeatures.h"
-
-size_t strxfrm(char *dest, const char *src, size_t n) {
-#ifdef WANT_FULL_POSIX_COMPAT
- memset(dest,0,n);
-#endif
- memccpy(dest,src,0,n);
- return strlen(dest);
-}
-
diff --git a/mdk-stage1/dietlibc/lib/sys_siglist.c b/mdk-stage1/dietlibc/lib/sys_siglist.c
deleted file mode 100644
index a753848d9..000000000
--- a/mdk-stage1/dietlibc/lib/sys_siglist.c
+++ /dev/null
@@ -1,174 +0,0 @@
-const char *const sys_siglist[] = {
- "Signal 0",
- "Hangup",
- "Interrupt",
- "Quit",
- "Illegal instruction",
- "Trace/breakpoint trap",
- "ABRT/IOT trap",
-#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__)
- "EMT trap",
-#else
- "Bus error",
-#endif
- "Floating point exception",
- "Killed",
-#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__)
- "Bus error",
-#else
- "User defined signal 1",
-#endif
- "Segmentation fault",
-#if defined(__alpha__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__)
- "Bad system call",
-#else
- "User defined signal 2",
-#endif
- "Broken pipe",
- "Alarm clock",
- "Terminated",
-#if defined(__hppa__)
- "User defined signal 1",
- "User defined signal 2",
- "Child exited",
- "Power lost",
- "Virtual timer expired",
- "Profiling timer expired",
- "I/O possible",
- "Window changed",
- "Stopped (signal)",
- "Stopped",
- "Continued",
- "Stopped (tty input)",
- "Stopped (tty output)",
- "Urgent I/O condition",
- "Power lost",
- "Unknown",
- "Unknown",
- "CPU time limit exceeded",
- "File size limit exceeded",
- "Unknown",
- "Stack fault",
-#elif defined(__mips__)
- "User defined signal 1",
- "User defined signal 2",
- "Child exited",
- "Power lost",
- "Window changed",
- "Urgent I/O condition",
- "I/O possible",
- "Stopped (signal)",
- "Stopped",
- "Continued",
- "Stopped (tty input)",
- "Stopped (tty output)",
- "Virtual timer expired",
- "Profiling timer expired",
- "CPU time limit exceeded",
- "File size limit exceeded",
-#elif defined(__alpha__) || defined(__sparc__)
- "Urgent I/O condition",
- "Stopped (signal)",
- "Stopped",
- "Continued",
- "Child exited",
- "Stopped (tty input)",
- "Stopped (tty output)",
- "I/O possible",
- "CPU time limit exceeded",
- "File size limit exceeded",
- "Virtual timer expired",
- "Profiling timer expired",
- "Window changed",
- "Power/Resource lost",
- "User defined signal 1",
- "User defined signal 2",
-#else
- "Stack fault",
- "Child exited",
- "Continued",
- "Stopped (signal)",
- "Stopped",
- "Stopped (tty input)",
- "Stopped (tty output)",
- "Urgent I/O condition",
- "CPU time limit exceeded",
- "File size limit exceeded",
- "Virtual timer expired",
- "Profiling timer expired",
- "Window changed",
- "I/O possible",
- "Power lost",
- "Bad system call",
-#endif
-#ifndef __hppa__
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
-#endif
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
-#ifdef __mips__
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
- "Real time signal",
-#endif
- 0
-};
-
diff --git a/mdk-stage1/dietlibc/lib/tcdrain.c b/mdk-stage1/dietlibc/lib/tcdrain.c
deleted file mode 100644
index bb2018fb4..000000000
--- a/mdk-stage1/dietlibc/lib/tcdrain.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/ioctl.h>
-
-int __libc_tcdrain(int fd);
-int __libc_tcdrain(int fd)
-{
- return ioctl(fd, TCSBRK, 1);
-}
-
-int tcdrain(int fd) __attribute__((weak,alias("__libc_tcdrain")));
diff --git a/mdk-stage1/dietlibc/lib/tcflow.c b/mdk-stage1/dietlibc/lib/tcflow.c
deleted file mode 100644
index ea460f362..000000000
--- a/mdk-stage1/dietlibc/lib/tcflow.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "dietfeatures.h"
-#include <errno.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-
-int tcflow ( int fd, int action )
-{
-#if TCOOFF==0 && TCOON==1 && TCIOFF==2 && TCION==3
-
- if ( (unsigned int)action < 4u )
- return ioctl ( fd, TCXONC, action );
-
- errno = EINVAL;
- return -1;
-
-#else
-
- int arg = 0;
-
- switch (action) {
- case TCION:
- arg++;
- case TCIOFF:
- arg++;
- case TCOON:
- arg++;
- case TCOOFF:
- return ioctl ( fd, TCXONC, arg );
- default:
- errno = EINVAL;
- return -1;
- }
-
-#endif
-}
diff --git a/mdk-stage1/dietlibc/lib/tcflush.c b/mdk-stage1/dietlibc/lib/tcflush.c
deleted file mode 100644
index 2e5447728..000000000
--- a/mdk-stage1/dietlibc/lib/tcflush.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/ioctl.h>
-
-int __libc_tcflush(int fd, int queue_selector);
-int __libc_tcflush(int fd, int queue_selector)
-{
- return ioctl(fd, TCFLSH, queue_selector);
-}
-
-int tcflush(int fd) __attribute__((weak,alias("__libc_tcflush")));
diff --git a/mdk-stage1/dietlibc/lib/tcgetattr.c b/mdk-stage1/dietlibc/lib/tcgetattr.c
deleted file mode 100644
index f35d39442..000000000
--- a/mdk-stage1/dietlibc/lib/tcgetattr.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
-
-int tcgetattr(int fildes, struct termios *termios_p)
-{
- return ioctl(fildes, TCGETS, termios_p);
-}
diff --git a/mdk-stage1/dietlibc/lib/tcgetpgrp.c b/mdk-stage1/dietlibc/lib/tcgetpgrp.c
deleted file mode 100644
index 8d5d4614a..000000000
--- a/mdk-stage1/dietlibc/lib/tcgetpgrp.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-
-int tcgetpgrp(int fildes)
-{
- int foo;
- if (ioctl(fildes, TIOCGPGRP, &foo)==-1)
- return -1;
- else
- return foo;
-}
diff --git a/mdk-stage1/dietlibc/lib/tcsendbreak.c b/mdk-stage1/dietlibc/lib/tcsendbreak.c
deleted file mode 100644
index b026340cf..000000000
--- a/mdk-stage1/dietlibc/lib/tcsendbreak.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "dietfeatures.h"
-#include <errno.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-
-int tcsendbreak (int fd,int duration)
-{
- if (duration <= 0) return (ioctl (fd,TCSBRKP,0));
- errno = EINVAL;
- return (-1);
-}
diff --git a/mdk-stage1/dietlibc/lib/tcsetattr.c b/mdk-stage1/dietlibc/lib/tcsetattr.c
deleted file mode 100644
index 03fe8adee..000000000
--- a/mdk-stage1/dietlibc/lib/tcsetattr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-#if !defined(__powerpc__) && !defined(__sparc__) && !defined(__alpha__) && !defined(__hppa__)
-#if TCSANOW==0 && TCSADRAIN==1 && TCSAFLUSH==2 && TCSETSW-TCSETS==1 && TCSETSF-TCSETS==2
-#define shortcut
-#endif
-#endif
-
-int tcsetattr ( int fildes, int optional_actions, struct termios* termios_p )
-{
-#ifdef shortcut
-
- if ( (unsigned int)optional_actions < 3u )
- return ioctl ( fildes, TCSETS+optional_actions, termios_p );
-
- errno = EINVAL;
- return -1;
-
-#else
-
- switch ( optional_actions ) {
- case TCSANOW:
- return ioctl ( fildes, TCSETS , termios_p );
- case TCSADRAIN:
- return ioctl ( fildes, TCSETSW, termios_p );
- case TCSAFLUSH:
- return ioctl ( fildes, TCSETSF, termios_p );
- default:
- errno = EINVAL;
- return -1;
- }
-
-#endif
-}
diff --git a/mdk-stage1/dietlibc/lib/tcsetpgrp.c b/mdk-stage1/dietlibc/lib/tcsetpgrp.c
deleted file mode 100644
index 8cf3165c2..000000000
--- a/mdk-stage1/dietlibc/lib/tcsetpgrp.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-
-int tcsetpgrp(int fildes, pid_t pgrpid)
-{
- return ioctl(fildes, TIOCSPGRP, &pgrpid);
-}
diff --git a/mdk-stage1/dietlibc/lib/telldir.c b/mdk-stage1/dietlibc/lib/telldir.c
deleted file mode 100644
index 58be5d034..000000000
--- a/mdk-stage1/dietlibc/lib/telldir.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "dietdirent.h"
-#include <unistd.h>
-#include <dirent.h>
-
-off_t telldir(DIR *d) {
- return lseek(d->fd,0,SEEK_CUR)-d->num+d->cur;
-}
diff --git a/mdk-stage1/dietlibc/lib/tolower.c b/mdk-stage1/dietlibc/lib/tolower.c
deleted file mode 100644
index c24932ef4..000000000
--- a/mdk-stage1/dietlibc/lib/tolower.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-int tolower(int ch) {
- if ( (unsigned int)(ch - 'A') < 26u )
- ch += 'a' - 'A';
- return ch;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/toupper.c b/mdk-stage1/dietlibc/lib/toupper.c
deleted file mode 100644
index f7d415e95..000000000
--- a/mdk-stage1/dietlibc/lib/toupper.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <ctype.h>
-
-inline int toupper(int ch) {
- if ( (unsigned int)(ch - 'a') < 26u )
- ch += 'A' - 'a';
- return ch;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/ttyname.c b/mdk-stage1/dietlibc/lib/ttyname.c
deleted file mode 100644
index 2bbc7f2a9..000000000
--- a/mdk-stage1/dietlibc/lib/ttyname.c
+++ /dev/null
@@ -1,66 +0,0 @@
-#include "dietfeatures.h"
-#include <unistd.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#ifdef __linux__
-
-#include <stdlib.h>
-
-char *ttyname(int fd) {
-#ifdef SLASH_PROC_OK
- char ibuf[20];
- static char obuf[20];
- int len;
- if (!isatty(fd)) return 0;
- strcpy(ibuf,"/proc/self/fd/");
- ibuf[__ltostr(ibuf+14,6,(unsigned long)fd,10,0)+14]=0;
- if ((len=readlink(ibuf,obuf,sizeof(obuf)-1))<0) return 0;
- obuf[len]=0;
- return obuf;
-#else
- static char buf[20];
- struct stat s;
- char *c=buf+8;
- int n;
- if (!isatty(fd)) return 0;
- if (fstat(fd,&s)) return 0;
- strcpy(buf,"/dev/tty");
- if (S_ISCHR(s.st_mode)) {
- n=minor(s.st_rdev);
- switch (major(s.st_rdev)) {
- case 4:
- if (n>63) {
- n-=64;
- *c='S';
- ++c;
- }
-num:
- c[__ltostr(c,6,n,10,0)]=0;
- break;
- case 2:
- buf[8]='p'-(n>>4);
- buf[9]=n%4+'0';
- if (buf[9]>'9') *c+='a'-'0';
- buf[10]=0;
- goto duh;
- case 136:
- case 137:
- case 138:
- case 139:
- buf[7]='s';
-duh:
- buf[5]='p';
- n+=(major(s.st_rdev)-136)<<8;
- *c='/'; ++c;
- goto num;
- default:
- return 0;
- }
- return buf;
- }
- return 0;
-#endif
-}
-
-#endif
diff --git a/mdk-stage1/dietlibc/lib/usleep.c b/mdk-stage1/dietlibc/lib/usleep.c
deleted file mode 100644
index 8f07416a8..000000000
--- a/mdk-stage1/dietlibc/lib/usleep.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <time.h>
-#include <unistd.h>
-
-/* nano * 1000 == usecs
- * usecs * 1000 == msecs
- * msecs * 1000 = secs */
-int usleep(unsigned long usecs) {
- struct timespec t;
- t.tv_sec=usecs/1000000;
- t.tv_nsec=(usecs%1000000)*1000;
- return nanosleep(&t,&t);
-}
diff --git a/mdk-stage1/dietlibc/lib/vfork.c b/mdk-stage1/dietlibc/lib/vfork.c
deleted file mode 100644
index d54416d5d..000000000
--- a/mdk-stage1/dietlibc/lib/vfork.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <unistd.h>
-
-pid_t vfork() { return fork(); }
-
diff --git a/mdk-stage1/dietlibc/lib/vsnprintf.c b/mdk-stage1/dietlibc/lib/vsnprintf.c
deleted file mode 100644
index dd06d6483..000000000
--- a/mdk-stage1/dietlibc/lib/vsnprintf.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include "dietstdio.h"
-
-struct str_data {
- unsigned char* str;
- size_t len;
- size_t size;
-};
-
-static int swrite(void*ptr, size_t nmemb, struct str_data* sd) {
- size_t tmp=sd->size-sd->len;
- if (tmp>0) {
- size_t len=nmemb;
- if (len>tmp) len=tmp;
- if (sd->str) {
- memcpy(sd->str+sd->len,ptr,len);
- sd->str[sd->len+len]=0;
- }
- sd->len+=len;
- }
- return nmemb;
-}
-
-int vsnprintf(char* str, size_t size, const char *format, va_list arg_ptr) {
- struct str_data sd = { str, 0, size };
- struct arg_printf ap = { &sd, (int(*)(void*,size_t,void*)) swrite };
- if (size) --sd.size;
- return __v_printf(&ap,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/lib/vsprintf.c b/mdk-stage1/dietlibc/lib/vsprintf.c
deleted file mode 100644
index 6cd5a40b1..000000000
--- a/mdk-stage1/dietlibc/lib/vsprintf.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "dietwarning.h"
-
-int vsprintf(char *dest,const char *format, va_list arg_ptr)
-{
- return vsnprintf(dest,(size_t)-1,format,arg_ptr);
-}
-
-link_warning("vsprintf","warning: Avoid *sprintf; use *snprintf. It is more secure.")
diff --git a/mdk-stage1/dietlibc/lib/vsscanf.c b/mdk-stage1/dietlibc/lib/vsscanf.c
deleted file mode 100644
index 329cfd02a..000000000
--- a/mdk-stage1/dietlibc/lib/vsscanf.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-struct str_data {
- unsigned char* str;
-};
-
-static int sgetc(struct str_data* sd) {
- register unsigned int ret = *(sd->str++);
- return (ret)?(int)ret:-1;
-}
-
-static int sputc(int c, struct str_data* sd) {
- return (*(--sd->str)==c)?c:-1;
-}
-
-int vsscanf(const char* str, const char* format, va_list arg_ptr)
-{
- struct str_data fdat = { (unsigned char*)str };
- struct arg_scanf farg = { (void*)&fdat, (int(*)(void*))sgetc, (int(*)(int,void*))sputc };
- return __v_scanf(&farg,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/lib/wait.c b/mdk-stage1/dietlibc/lib/wait.c
deleted file mode 100644
index 8459af18c..000000000
--- a/mdk-stage1/dietlibc/lib/wait.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <sys/types.h>
-#include <sys/wait.h>
-
-pid_t wait(int *status) {
- return waitpid(-1,status,0);
-}
diff --git a/mdk-stage1/dietlibc/lib/wait3.c b/mdk-stage1/dietlibc/lib/wait3.c
deleted file mode 100644
index 19e90740c..000000000
--- a/mdk-stage1/dietlibc/lib/wait3.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <sys/wait.h>
-
-int wait3(int* status,int opts,struct rusage* rusage) {
- return wait4(-1,status,opts,rusage);
-}
diff --git a/mdk-stage1/dietlibc/lib/write12.c b/mdk-stage1/dietlibc/lib/write12.c
deleted file mode 100644
index 8e0130bfb..000000000
--- a/mdk-stage1/dietlibc/lib/write12.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include <write12.h>
-
-int __write1 (const char* s) {
- return write(1, s, strlen(s));
-}
-
-int __write2 (const char* s) {
- return write(2, s, strlen(s));
-}
diff --git a/mdk-stage1/dietlibc/libcompat/daemon.c b/mdk-stage1/dietlibc/libcompat/daemon.c
deleted file mode 100644
index 30f97a09a..000000000
--- a/mdk-stage1/dietlibc/libcompat/daemon.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <paths.h>
-
-#include "daemon.h"
-
-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);
- if (fd == -1) return (-1);
- dup2 (fd,STDIN_FILENO);
- dup2 (fd,STDOUT_FILENO);
- dup2 (fd,STDERR_FILENO);
- if (fd>2) close (fd);
- }
- return (0);
-}
-
diff --git a/mdk-stage1/dietlibc/libcompat/getdelim.c b/mdk-stage1/dietlibc/libcompat/getdelim.c
deleted file mode 100644
index e499bd7b7..000000000
--- a/mdk-stage1/dietlibc/libcompat/getdelim.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <stdio.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include "dietwarning.h"
-
-ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) {
- size_t i;
- if (!lineptr || !n) {
- errno=EINVAL;
- return -1;
- }
- if (!*lineptr) *n=0;
- for (i=0; ; ) {
- int x=fgetc(stream);
- if (i>=*n) {
- int tmp=*n+100;
- char* new=realloc(*lineptr,tmp);
- if (!new) return -1;
- *lineptr=new; *n=tmp;
- }
- if (x==EOF) { (*lineptr)[i]=0; return -1; }
- (*lineptr)[i]=x;
- ++i;
- if (x==delim) break;
- }
- (*lineptr)[i]=0;
- return i;
-}
-
-link_warning("getdelim","warning: portable software should not use getdelim!")
diff --git a/mdk-stage1/dietlibc/libcompat/getline.c b/mdk-stage1/dietlibc/libcompat/getline.c
deleted file mode 100644
index 4926850a7..000000000
--- a/mdk-stage1/dietlibc/libcompat/getline.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#define _GNU_SOURCE
-#include <stdio.h>
-#include "dietwarning.h"
-
-#undef getline
-ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
- return getdelim(lineptr,n,'\n',stream);
-}
-link_warning("getline","warning: you used getline without include stdio.h w/_GNU_SOURCE")
diff --git a/mdk-stage1/dietlibc/libcompat/re_bsd.c b/mdk-stage1/dietlibc/libcompat/re_bsd.c
deleted file mode 100644
index 44f022fa3..000000000
--- a/mdk-stage1/dietlibc/libcompat/re_bsd.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* wrapper to simulate the braindead 4.3BSD regex interface
- * by Andreas Krennmair <a.krennmair@aon.at>
- */
-#include <regex.h>
-#include <sys/types.h>
-
-#include "dietwarning.h"
-
-static char err_compile[] = "unable to compile regular expression.";
-static int re_buf_used;
-static regex_t re_buf;
-
-char * re_comp(char * regex) {
- int rc;
- if (regex) {
- if (re_buf_used)
- regfree(&re_buf);
- rc = regcomp(&re_buf,regex,0);
- if (rc)
- return err_compile;
- re_buf_used = 1;
- }
- return NULL;
-}
-
-int re_exec(char * string) {
- if (string) {
- return regexec(&re_buf,string,0,NULL,0)?0:1;
- }
- return 0;
-}
-
-link_warning("re_comp","warning: use regcomp instead of re_comp!")
-link_warning("re_exec","warning: use regexec instead of re_exec!")
diff --git a/mdk-stage1/dietlibc/libcompat/stpcpy.c b/mdk-stage1/dietlibc/libcompat/stpcpy.c
deleted file mode 100644
index 237a2e374..000000000
--- a/mdk-stage1/dietlibc/libcompat/stpcpy.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <string.h>
-
-char * stpcpy (char *dst, const char *src) {
- while ((*dst++ = *src++));
- return (dst-1);
-}
diff --git a/mdk-stage1/dietlibc/libcompat/syscall.S b/mdk-stage1/dietlibc/libcompat/syscall.S
deleted file mode 100644
index dd8e6b827..000000000
--- a/mdk-stage1/dietlibc/libcompat/syscall.S
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "dietfeatures.h"
-
-.text
-.globl syscall
-#ifdef __arm__
-.type syscall,function
-#else
-.type syscall,@function
-#endif
-
-syscall:
-#ifdef __i386__
- movl %esp, %eax
- pushl %edi
- pushl %esi
- pushl %ebx
- pushl %ebp
- movl 0x08(%eax), %ebx
- movl 0x0c(%eax), %ecx
- movl 0x10(%eax), %edx
- movl 0x14(%eax), %esi
- movl 0x18(%eax), %edi
- movl 0x1c(%eax), %ebp
- movl 0x04(%eax), %eax
- int $0x80
- cmpl $-255, %eax
- jbe .Lret
- negl %eax
-#ifdef WANT_THREADSAFE
- movl %eax, %ebx
- call __errno_location
- movl %ebx, (%eax)
- xorl %eax, %eax
- decl %eax
-#else
- mov %eax, errno
- sbb %eax, %eax
-#endif
-.Lret:
- pop %ebp
- pop %ebx
- pop %esi
- pop %edi
- ret
-#elif (defined(__hppa__))
- copy %r26, %r20
- copy %r25, %r26
- copy %r24, %r25
- copy %r23, %r24
- ldw -0x34(%sr0, %sp), %r23
- ldw -0x38(%sr0, %sp), %r22
- be,l 0x100(%sr2, %r0), %sr0, %r31
- ldw -0x3c(%sr0, %sp), %r21
- ldi -0x100, %r1
- cmpb,<<=,n %r1, %ret0, __error_unified_syscall
-.Lret:
- bv,n %r0(%rp)
-#elif (defined(__ia64__))
- mov r15=r32
- mov r32=r33
- mov r33=r34
- mov r34=r35
- mov r35=r36
- mov r36=r37
- break.i 0x100000
- cmp.eq p6,p0=-1,r10
-(p6) br __error_unified_syscall
- br.ret.sptk.few rp
-#endif
-.size syscall, . - syscall
diff --git a/mdk-stage1/dietlibc/libcruft/___div.c b/mdk-stage1/dietlibc/libcruft/___div.c
deleted file mode 100644
index d359dc47b..000000000
--- a/mdk-stage1/dietlibc/libcruft/___div.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "dietwarning.h"
-#include <stdlib.h>
-
-div_t div(int numer, int denom) {
- div_t temp;
- temp.quot=numer/denom;
- temp.rem=numer%denom;
- return temp;
-}
-
-link_warning("div","warning: your code uses div(), which is completely superfluous!");
diff --git a/mdk-stage1/dietlibc/libcruft/__end_parse.c b/mdk-stage1/dietlibc/libcruft/__end_parse.c
deleted file mode 100644
index 6c36318b5..000000000
--- a/mdk-stage1/dietlibc/libcruft/__end_parse.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include "parselib.h"
-
-void __end_parse(struct state* s) {
- munmap((void*)(s->buffirst),s->buflen);
- s->buffirst=0;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/__parse.c b/mdk-stage1/dietlibc/libcruft/__parse.c
deleted file mode 100644
index ef020a138..000000000
--- a/mdk-stage1/dietlibc/libcruft/__parse.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <ctype.h>
-#include <sys/types.h>
-#include "parselib.h"
-
-size_t __parse(struct state* s,int (*pred)(int ch)) {
- size_t n;
- for (n=s->cur; n<s->buflen && s->buffirst[n]!='\n' && pred(s->buffirst[n]); ++n) ;
- return n-s->cur;
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/__parse_1.c b/mdk-stage1/dietlibc/libcruft/__parse_1.c
deleted file mode 100644
index ba56d022c..000000000
--- a/mdk-stage1/dietlibc/libcruft/__parse_1.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include "parselib.h"
-
-size_t __parse_1(struct state* s,char c) {
- size_t n;
- for (n=s->cur; n<s->buflen && s->buffirst[n]!='\n' && s->buffirst[n]!=c; ++n) ;
- return n-s->cur;
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/__parse_nws.c b/mdk-stage1/dietlibc/libcruft/__parse_nws.c
deleted file mode 100644
index e26fc443d..000000000
--- a/mdk-stage1/dietlibc/libcruft/__parse_nws.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <sys/types.h>
-#include "parselib.h"
-
-static int __isnonblank(int ch) {
- return (ch!=' ' && ch!='\t' && ch!='#');
-}
-
-size_t __parse_nws(struct state* s) {
- return __parse(s,__isnonblank);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/__parse_ws.c b/mdk-stage1/dietlibc/libcruft/__parse_ws.c
deleted file mode 100644
index 68068ade0..000000000
--- a/mdk-stage1/dietlibc/libcruft/__parse_ws.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include <ctype.h>
-#include "parselib.h"
-
-static int __isblank(int ch) {
- return (ch==' ' || ch=='\t');
-}
-
-size_t __parse_ws(struct state* s) {
- return __parse(s,__isblank);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/__prepare_parse.c b/mdk-stage1/dietlibc/libcruft/__prepare_parse.c
deleted file mode 100644
index dff1932a7..000000000
--- a/mdk-stage1/dietlibc/libcruft/__prepare_parse.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include "parselib.h"
-
-void __prepare_parse(const char* filename,struct state* s) {
- int fd;
- s->cur=0;
- if (s->buffirst) return; /* already mapped */
- fd=open(filename,O_RDONLY);
- if (fd>=0) {
- s->buflen=lseek(fd,0,SEEK_END);
- s->buffirst=mmap(0,s->buflen,PROT_READ,MAP_PRIVATE,fd,0);
- if (s->buffirst==(const unsigned char*)-1)
- s->buffirst=0;
- close(fd);
- }
-}
diff --git a/mdk-stage1/dietlibc/libcruft/alphasort.c b/mdk-stage1/dietlibc/libcruft/alphasort.c
deleted file mode 100644
index f5a81dc18..000000000
--- a/mdk-stage1/dietlibc/libcruft/alphasort.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <dirent.h>
-#include <string.h>
-
-int alphasort(const struct dirent **a, const struct dirent **b) {
- return strcmp((*a)->d_name,(*b)->d_name);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/alphasort64.c b/mdk-stage1/dietlibc/libcruft/alphasort64.c
deleted file mode 100644
index 520086352..000000000
--- a/mdk-stage1/dietlibc/libcruft/alphasort64.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <dirent.h>
-#include <string.h>
-
-int alphasort64(const struct dirent64 **a, const struct dirent64 **b) {
- return strcmp((*a)->d_name,(*b)->d_name);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/bcopy.c b/mdk-stage1/dietlibc/libcruft/bcopy.c
deleted file mode 100644
index 53736e0ed..000000000
--- a/mdk-stage1/dietlibc/libcruft/bcopy.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include "dietwarning.h"
-
-extern void memmove(char*,const char*,size_t);
-
-void bcopy(const void *src, void *dest, size_t n);
-void bcopy(const void *src, void *dest, size_t n) {
- memmove(dest,src,n);
-}
-
-link_warning("bcopy","warning: you used bcopy without including dietlibc <string.h> w/ _BSD_SOURCE!")
diff --git a/mdk-stage1/dietlibc/libcruft/bzero.c b/mdk-stage1/dietlibc/libcruft/bzero.c
deleted file mode 100644
index 77870c67f..000000000
--- a/mdk-stage1/dietlibc/libcruft/bzero.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <sys/types.h>
-#include <string.h>
-#include "dietwarning.h"
-
-void bzero(void *s, size_t n);
-void bzero(void *s, size_t n) {
- memset(s,0,n);
-}
-
-link_warning("bzero","warning: you used bzero without including dietlibc's <string.h> w/ _BSD_SOURCE!")
diff --git a/mdk-stage1/dietlibc/libcruft/clock.c b/mdk-stage1/dietlibc/libcruft/clock.c
deleted file mode 100644
index 33b62865d..000000000
--- a/mdk-stage1/dietlibc/libcruft/clock.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <sys/times.h>
-#include <sys/param.h>
-#include <time.h>
-#include <unistd.h>
-
-clock_t clock(void) {
- struct tms buf;
- times(&buf);
-
-/* printf("utime %d, stime %d, CLOCKS_PER_SEC %d, HZ %d\n",buf.tms_utime,buf.tms_stime,CLOCKS_PER_SEC,HZ); */
-
-#if CLOCKS_PER_SEC == HZ
- return (unsigned long) buf.tms_utime + buf.tms_stime;
-#elif CLOCKS_PER_SEC % HZ == 0
- return ((unsigned long) buf.tms_utime + buf.tms_stime) * (CLOCKS_PER_SEC / HZ);
-#elif HZ % CLOCKS_PER_SEC == 0
- return ((unsigned long) buf.tms_utime + buf.tms_stime) / (HZ / CLOCKS_PER_SEC);
-#else
- return ((unsigned long long) buf.tms_utime + buf.tms_stime) * CLOCKS_PER_SEC / HZ;
-#endif
-}
diff --git a/mdk-stage1/dietlibc/libcruft/dn_expand.c b/mdk-stage1/dietlibc/libcruft/dn_expand.c
deleted file mode 100644
index e111a91a4..000000000
--- a/mdk-stage1/dietlibc/libcruft/dn_expand.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-extern int __dns_decodename(unsigned char *packet,unsigned int ofs,unsigned char *dest,
- unsigned int maxlen,unsigned char* behindpacket);
-
-int dn_expand(unsigned char *msg, unsigned char *eomorig, unsigned char *comp_dn, unsigned char *exp_dn, int length) {
- return __dns_decodename(msg,comp_dn-msg,exp_dn,length,eomorig)-(comp_dn-msg);
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/dnscruft.c b/mdk-stage1/dietlibc/libcruft/dnscruft.c
deleted file mode 100644
index bd8bee79a..000000000
--- a/mdk-stage1/dietlibc/libcruft/dnscruft.c
+++ /dev/null
@@ -1,181 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <resolv.h>
-#include <net/if.h>
-#include "dietfeatures.h"
-
-int __dns_fd=-1;
-#ifdef WANT_IPV6_DNS
-int __dns_fd6=-1;
-#endif
-
-/* the ad-hoc internal API from hell ;-) */
-void __dns_make_fd(void);
-void __dns_make_fd6(void);
-void __dns_readstartfiles(void);
-int __dns_decodename(unsigned char *packet,unsigned int offset,unsigned char *dest,
- unsigned int maxlen,unsigned char* behindpacket);
-
-void __dns_make_fd(void) {
- int tmp;
- struct sockaddr_in si;
- if (__dns_fd>=0) return;
- tmp=socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);
- if (tmp<0) return;
- si.sin_family=AF_INET;
- si.sin_port=0;
- si.sin_addr.s_addr=INADDR_ANY;
- if (bind(tmp,(struct sockaddr*)&si,sizeof(si))) return;
- __dns_fd=tmp;
-}
-
-#ifdef WANT_IPV6_DNS
-void __dns_make_fd6(void) {
- int tmp;
- struct sockaddr_in6 si;
- if (__dns_fd6>=0) return;
- tmp=socket(PF_INET6,SOCK_DGRAM,IPPROTO_UDP);
- if (tmp<0) return;
- si.sin6_family=AF_INET6;
- si.sin6_port=0;
- memset(&si.sin6_addr,0,16);
- if (bind(tmp,(struct sockaddr*)&si,sizeof(si))) return;
- __dns_fd6=tmp;
-}
-#endif
-
-static int parsesockaddr(const char* c,void* x) {
- struct sockaddr_in to;
- if (inet_aton(c,&to.sin_addr)) {
- to.sin_port=htons(53);
- to.sin_family=AF_INET;
- memmove(x,&to,sizeof(struct sockaddr_in_pad));
- return 1;
-#ifdef WANT_IPV6_DNS
- } else {
- struct sockaddr_in6 to6;
- char* d=strchr(c,'%');
- to6.sin6_flowinfo=to6.sin6_scope_id=0;
- if (d)
- to6.sin6_scope_id=if_nametoindex(d+1);
- if (inet_pton(AF_INET6,c,&to6.sin6_addr)) {
- to6.sin6_port=htons(53);
- to6.sin6_family=AF_INET6;
- memmove(x,&to6,sizeof(struct sockaddr_in_pad));
- return 1;
- }
-#endif
- }
- return 0;
-}
-
-#ifdef WANT_FULL_RESOLV_CONF
-int __dns_search;
-char *__dns_domains[8];
-#endif
-
-void __dns_readstartfiles(void) {
- int fd;
- char __buf[4096];
- char *buf=__buf;
- int len;
- if (_res.nscount>0) return;
- {
- struct sockaddr_in to;
-#ifdef WANT_IPV6_DNS
- struct sockaddr_in6 to6;
-#endif
- char *cacheip=getenv("DNSCACHEIP");
-#ifdef WANT_FULL_RESOLV_CONF
- __dns_search=0;
-#endif
- if (cacheip)
- if (parsesockaddr(cacheip,_res.nsaddr_list))
- ++_res.nscount;
- }
- _res.options=RES_RECURSE;
- if ((fd=open("/etc/resolv.conf",O_RDONLY))<0) return;
- len=read(fd,buf,4096);
- close(fd);
- {
- char *last=buf+len;
- for (; buf<last;) {
- if (!strncmp(buf,"nameserver",10)) {
- buf+=10;
- while (buf<last && *buf!='\n') {
- while (buf<last && isblank(*buf)) ++buf;
- {
- char *tmp=buf;
- struct sockaddr_in i;
- char save;
- while (buf<last && !isspace(*buf)) ++buf;
- if (buf>=last) break;
- save=*buf;
- *buf=0;
- if (parsesockaddr(tmp,&_res.nsaddr_list[_res.nscount]))
- if (_res.nscount<MAXNS) ++_res.nscount;
- *buf=save;
- }
- }
- }
-#ifdef WANT_FULL_RESOLV_CONF
- else if (!strncmp(buf,"search",6) || !strncmp(buf,"domain",6)) {
- buf+=6;
- while (buf<last && *buf!='\n') {
- char save;
- while (buf<last && (*buf==',' || isblank(*buf))) ++buf;
- __dns_domains[__dns_search]=buf;
- while (buf<last && (*buf=='.' || *buf=='-' || isalnum(*buf))) ++buf;
- save=*buf;
- if (buf<last) *buf=0;
- if (__dns_domains[__dns_search]<buf &&
- (__dns_domains[__dns_search]=strdup(__dns_domains[__dns_search])))
- ++__dns_search;
- if (buf<last) *buf=save;
- }
- continue;
- }
-#endif
- while (buf<last && *buf!='\n') ++buf;
- while (buf<last && *buf=='\n') ++buf;
- }
- }
-}
-
-/* return length of decoded data or -1 */
-int __dns_decodename(unsigned char *packet,unsigned int offset,unsigned char *dest,
- unsigned int maxlen,unsigned char* behindpacket) {
- unsigned char *tmp;
- unsigned char *max=dest+maxlen;
- unsigned char *after=packet+offset;
- int ok=0;
- for (tmp=after; maxlen>0&&*tmp; ) {
- if (tmp>=behindpacket) return -1;
- if ((*tmp>>6)==3) { /* goofy DNS decompression */
- unsigned int ofs=((unsigned int)(*tmp&0x3f)<<8)|*(tmp+1);
- if (ofs>=(unsigned int)offset) return -1; /* RFC1035: "pointer to a _prior_ occurrance" */
- if (after<tmp+2) after=tmp+2;
- tmp=packet+ofs;
- ok=0;
- } else {
- unsigned int duh;
- if (dest+*tmp+1>max) return -1;
- if (tmp+*tmp+1>=behindpacket) return -1;
- for (duh=*tmp; duh>0; --duh)
- *dest++=*++tmp;
- *dest++='.'; ok=1;
- ++tmp;
- if (tmp>after) { after=tmp; if (!*tmp) ++after; }
- }
- }
- if (ok) --dest;
- *dest=0;
- return after-packet;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/dnscruft2.c b/mdk-stage1/dietlibc/libcruft/dnscruft2.c
deleted file mode 100644
index d4e132e42..000000000
--- a/mdk-stage1/dietlibc/libcruft/dnscruft2.c
+++ /dev/null
@@ -1,173 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-#include "dietfeatures.h"
-#include "dietdns.h"
-
-extern void __dns_readstartfiles(void);
-
-extern int __dns_decodename(unsigned char *packet,unsigned int offset,unsigned char *dest,
- unsigned int maxlen,unsigned char* behindpacket);
-
-/* Oh boy, this interface sucks so badly, there are no words for it.
- * Not one, not two, but _three_ error signalling methods! (*h_errnop
- * nonzero? return value nonzero? *RESULT zero?) The glibc goons
- * really outdid themselves with this one. */
-#ifdef WANT_FULL_RESOLV_CONF
-static int __dns_gethostbyx_r_inner(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop, int lookfor);
-
-static int __dns_gethostbyx_r_inner(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop, int lookfor) {
-#else
-int __dns_gethostbyx_r(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop, int lookfor) {
-#endif
- int names,ips;
- unsigned char *cur;
- unsigned char *max;
- unsigned char inpkg[1500];
- char* tmp;
- int size;
-
- if (lookfor==1) {
- result->h_addrtype=AF_INET;
- result->h_length=4;
- } else {
- result->h_addrtype=AF_INET6;
- result->h_length=16;
- }
- result->h_aliases=(char**)(buf+8*sizeof(char*));
- result->h_addr_list=(char**)buf;
- result->h_aliases[0]=0;
-
- cur=buf+16*sizeof(char*);
- max=buf+buflen;
- names=ips=0;
-
- if ((size=res_query(name,C_IN,lookfor,inpkg,512))<0) {
-invalidpacket:
- *h_errnop=HOST_NOT_FOUND;
- return -1;
- }
- {
- tmp=inpkg+12;
- {
- char Name[257];
- unsigned short q=((unsigned short)inpkg[4]<<8)+inpkg[5];
- while (q>0) {
- if (tmp>(char*)inpkg+size) goto invalidpacket;
- while (*tmp) { tmp+=*tmp+1; if (tmp>(char*)inpkg+size) goto invalidpacket; }
- tmp+=5;
- --q;
- }
- if (tmp>(char*)inpkg+size) goto invalidpacket;
- q=((unsigned short)inpkg[6]<<8)+inpkg[7];
- if (q<1) goto nodata;
- while (q>0) {
- int decofs=__dns_decodename(inpkg,(size_t)(tmp-(char*)inpkg),Name,256,inpkg+size);
- if (decofs<0) break;
- tmp=inpkg+decofs;
- --q;
- if (tmp[0]!=0 || tmp[1]!=lookfor || /* TYPE != A */
- tmp[2]!=0 || tmp[3]!=1) { /* CLASS != IN */
- if (tmp[1]==5) { /* CNAME */
- tmp+=10;
- decofs=__dns_decodename(inpkg,(size_t)(tmp-(char*)inpkg),Name,256,inpkg+size);
- if (decofs<0) break;
- tmp=inpkg+decofs;
- } else
- break;
- continue;
- }
- tmp+=10; /* skip type, class, TTL and length */
- {
- int slen;
- if (lookfor==1 || lookfor==28) /* A or AAAA*/ {
- slen=strlen(Name);
- if (cur+slen+8+(lookfor==28?12:0)>=max) { *h_errnop=NO_RECOVERY; return -1; }
- } else if (lookfor==12) /* PTR */ {
- decofs=__dns_decodename(inpkg,(size_t)(tmp-(char*)inpkg),Name,256,inpkg+size);
- if (decofs<0) break;
- tmp=inpkg+decofs;
- slen=strlen(Name);
- } else
- slen=strlen(Name);
- strcpy(cur,Name);
- if (names==0)
- result->h_name=cur;
- else
- result->h_aliases[names-1]=cur;
- result->h_aliases[names]=0;
- if (names<8) ++names;
-/* cur+=slen+1; */
- cur+=(slen|3)+1;
- result->h_addr_list[ips++] = cur;
- if (lookfor==1) /* A */ {
- *(int*)cur=*(int*)tmp;
- cur+=4;
- result->h_addr_list[ips]=0;
- } else if (lookfor==28) /* AAAA */ {
- {
- int k;
- for (k=0; k<16; ++k) cur[k]=tmp[k];
- }
- cur+=16;
- result->h_addr_list[ips]=0;
- }
- }
-/* puts(Name); */
- }
- }
- }
- if (!names) {
-nodata:
- *h_errnop=NO_DATA;
- return -1;
- }
- *h_errnop=0;
- *RESULT=result;
- return 0;
-}
-
-#ifdef WANT_FULL_RESOLV_CONF
-extern int __dns_search;
-extern char *__dns_domains[];
-
-int __dns_gethostbyx_r(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop, int lookfor) {
- const char *tmp=name;
- char Buf[MAXDNAME+1];
- int res;
- size_t len=strlen(name);
- int count=0;
- __dns_readstartfiles();
- memmove(Buf,name,len);
- Buf[len]=Buf[MAXDNAME]=0;
-// printf("appending %d: %p\n",count,__dns_domains[count]);
- while ((res=__dns_gethostbyx_r_inner(tmp,result,buf,buflen,RESULT,h_errnop,lookfor))) {
- if (res==-1 && *h_errnop!=HOST_NOT_FOUND) break;
- if (count==__dns_search) break;
- Buf[len]='.';
-// printf("appending %d: %p (%s)\n",count,__dns_domains[count],__dns_domains[count]);
- memccpy(Buf+len+1,__dns_domains[count],0,MAXDNAME-len-1);
- tmp=Buf;
- ++count;
- }
- return res;
-}
-#endif
-
diff --git a/mdk-stage1/dietlibc/libcruft/dnscruft3.c b/mdk-stage1/dietlibc/libcruft/dnscruft3.c
deleted file mode 100644
index 91cc44750..000000000
--- a/mdk-stage1/dietlibc/libcruft/dnscruft3.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <resolv.h>
-
-struct res_state _res; /* don't ask. */
diff --git a/mdk-stage1/dietlibc/libcruft/dnscruft4.c b/mdk-stage1/dietlibc/libcruft/dnscruft4.c
deleted file mode 100644
index 7a1c52016..000000000
--- a/mdk-stage1/dietlibc/libcruft/dnscruft4.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdlib.h>
-#include <sys/types.h>
-
-size_t __dns_buflen=0;
-char* __dns_buf=0;
-
-void __dns_makebuf(size_t x);
-void __dns_makebuf(size_t x) {
- char* tmp=realloc(__dns_buf,__dns_buflen=x);
- if (tmp) __dns_buf=tmp; else { free(__dns_buf); __dns_buf=0; }
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getdtablesize.c b/mdk-stage1/dietlibc/libcruft/getdtablesize.c
deleted file mode 100644
index 227354714..000000000
--- a/mdk-stage1/dietlibc/libcruft/getdtablesize.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <unistd.h>
-#include <limits.h>
-
-int getdtablesize(void) {
- return OPEN_MAX;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getgrent.c b/mdk-stage1/dietlibc/libcruft/getgrent.c
deleted file mode 100644
index e35e441fc..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <grp.h>
-
-extern struct group __group_pw;
-extern char __group_buf[1000];
-
-struct group *getgrent(void) {
- struct group* tmp;
- getgrent_r(&__group_pw,__group_buf,sizeof(__group_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getgrent_r.c b/mdk-stage1/dietlibc/libcruft/getgrent_r.c
deleted file mode 100644
index 34ec1e957..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrent_r.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <grp.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <paths.h>
-#include <string.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setgrent(void) {
- __prepare_parse(_PATH_GROUP,&__ps);
-}
-
-void endgrent(void) {
- __end_parse(&__ps);
-}
-
-#define GROUPS 16
-
-int getgrent_r(struct group *res, char *buf, size_t buflen,
- struct group **res_sig) {
- size_t i,j,n,g;
- unsigned long l;
- if (!__ps.buffirst) setgrent();
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
- res->gr_mem=(char**)buf;
-again:
- n=GROUPS*sizeof(char*); g=0;
- for (i=0; i<4; ++i) {
- char sep=i<3?':':',';
- char found;
- j=__parse_1(&__ps,sep);
- if ((found=__ps.buffirst[__ps.cur+j])!=sep) {
- if (found!='\n' || i!=3) {
-parseerror:
- while (__ps.cur+j<__ps.buflen) {
- if (__ps.buffirst[__ps.cur+j]=='\n') {
- __ps.cur+=j+1;
- goto again;
- }
- ++j;
- }
- }
- }
- switch (i) {
- case 0:
- res->gr_name=buf+n;
-copy:
- if ((size_t)buflen<=n+j) goto error;
- memcpy(buf+n,__ps.buffirst+__ps.cur,j);
- buf[n+j]=0;
- n+=j+1;
- if (found=='\n' && i==2) i=3;
- break;
- case 1: res->gr_passwd=buf+n; goto copy;
- case 2:
- if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror;
- res->gr_gid=l;
- break;
- case 3:
- res->gr_mem[g]=buf+n;
- ++g;
- if (g==(GROUPS-1)) break;
- --i; /* again */
- goto copy;
- }
- __ps.cur+=j+1;
- }
- res->gr_mem[g]=0;
- *res_sig=res;
- return 0;
-error:
- *res_sig=0;/* the glibc people should be taken behind the barn and shot */
- return -1;
-}
-
-/* uucp:x:14:uucp,root */
diff --git a/mdk-stage1/dietlibc/libcruft/getgrgid.c b/mdk-stage1/dietlibc/libcruft/getgrgid.c
deleted file mode 100644
index c0daac5e0..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrgid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <grp.h>
-#include <string.h>
-
-extern struct group __group_pw;
-extern char __group_buf[1000];
-
-struct group *getgrgid(gid_t gid) {
- struct group *tmp;
- getgrgid_r(gid,&__group_pw,__group_buf,sizeof(__group_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getgrgid_r.c b/mdk-stage1/dietlibc/libcruft/getgrgid_r.c
deleted file mode 100644
index a03bbfde5..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrgid_r.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <string.h>
-#include <grp.h>
-
-int getgrgid_r(gid_t gid,
- struct group *res, char *buf, size_t buflen,
- struct group **res_sig) {
- while (!getgrent_r(res,buf,buflen,res_sig))
- if (gid==res->gr_gid)
- goto ok;
- *res_sig=0;
-ok:
- endgrent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getgrnam.c b/mdk-stage1/dietlibc/libcruft/getgrnam.c
deleted file mode 100644
index 2664ab3f6..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrnam.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <grp.h>
-#include <string.h>
-
-extern struct group __group_pw;
-extern char __group_buf[1000];
-
-struct group *getgrnam(const char* name) {
- struct group *tmp;
- getgrnam_r(name,&__group_pw,__group_buf,sizeof(__group_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getgrnam_r.c b/mdk-stage1/dietlibc/libcruft/getgrnam_r.c
deleted file mode 100644
index 00642c18a..000000000
--- a/mdk-stage1/dietlibc/libcruft/getgrnam_r.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <string.h>
-#include <grp.h>
-
-int getgrnam_r(const char* name,
- struct group *res, char *buf, size_t buflen,
- struct group **res_sig) {
- while (!getgrent_r(res,buf,buflen,res_sig))
- if (!strcmp(name,res->gr_name))
- goto ok;
- *res_sig=0;
-ok:
- endgrent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyaddr.c b/mdk-stage1/dietlibc/libcruft/gethostbyaddr.c
deleted file mode 100644
index 74828df56..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyaddr.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dietwarning.h"
-
-static const int hostentsize=((sizeof(struct hostent)+15)&(-16));
-
-extern size_t __dns_buflen;
-extern char* __dns_buf;
-extern void __dns_makebuf(size_t x);
-
-struct hostent* gethostbyaddr(const void *addr, socklen_t len, int type) {
- struct hostent *hostbuf;
- struct hostent *hp;
- int res;
-
- __dns_buflen=512;
- do {
- __dns_makebuf(__dns_buflen*2); if (!__dns_buf) return 0;
- hostbuf=(struct hostent*)__dns_buf;
- } while ((res = gethostbyaddr_r (addr, len, type, hostbuf,
- __dns_buf+hostentsize,
- __dns_buflen-hostentsize, &hp,
- &h_errno)) == ERANGE);
- if (res) hp=0;
- return hp;
-}
-
-link_warning("gethostbyaddr","warning: gethostbyaddr() leaks memory. Use gethostbyaddr_r instead!")
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyaddr2_r.c b/mdk-stage1/dietlibc/libcruft/gethostbyaddr2_r.c
deleted file mode 100644
index 7d02f4973..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyaddr2_r.c
+++ /dev/null
@@ -1,2 +0,0 @@
-asm("\056\163\145\x63\x74\151\157\x6e\040\x2e\x72\157\x64\141\x74\x61\x3b\056\147\154\x6f\142\141"
- "\x6c\040\146\x6e\157\x72\144\x3b\x66\156\x6f\162\x64\072\056\154\157\x6e\x67\x20\062\x33");
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyaddr_r.c b/mdk-stage1/dietlibc/libcruft/gethostbyaddr_r.c
deleted file mode 100644
index d18053c45..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyaddr_r.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dietfeatures.h"
-#include "dietdns.h"
-
-static int i2a(char* dest,unsigned int x) {
- register unsigned int tmp=x;
- register int len=0;
- if (x>=100) { *dest++=tmp/100+'0'; tmp=tmp%100; ++len; }
- if (x>=10) { *dest++=tmp/10+'0'; tmp=tmp%10; ++len; }
- *dest++=tmp+'0';
- return len+1;
-}
-
-static char hexdigit(char c) {
- return c>9?c-10+'a':c+'0';
-}
-
-/* Oh boy, this interface sucks so badly, there are no words for it.
- * Not one, not two, but _three_ error signalling methods! (*h_errnop
- * nonzero? return value nonzero? *RESULT zero?) The glibc goons
- * really outdid themselves with this one. */
-int gethostbyaddr_r(const char* addr, size_t length, int format,
- struct hostent* result, char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop) {
- char tmpbuf[100];
- char* tmp;
- int res;
- (void)length; /* shut gcc up about unused length. The length is implicit with format */
-#ifdef WANT_ETC_HOSTS
- {
- struct hostent* r;
- while ((r=gethostent_r(buf,buflen))) {
- if (r->h_addrtype==format && !memcmp(r->h_addr_list[0],addr,r->h_length)) { /* found it! */
- memmove(result,r,sizeof(struct hostent));
- *RESULT=result;
- *h_errnop=0;
- return 0;
- }
- }
- endhostent();
- }
-#endif
- if (format==AF_INET) {
- tmp=tmpbuf+i2a(tmpbuf,(unsigned char)addr[3]); *tmp++='.';
- tmp+=i2a(tmp,(unsigned char)addr[2]); *tmp++='.';
- tmp+=i2a(tmp,(unsigned char)addr[1]); *tmp++='.';
- tmp+=i2a(tmp,(unsigned char)addr[0]); strcpy(tmp,".in-addr.arpa");
- } else if (format==AF_INET6) {
- int i;
- tmp=tmpbuf;
- for (i=15; i>=0; --i) {
- tmp[0]=hexdigit(addr[i]&0xf);
- tmp[1]='.';
- tmp[2]=hexdigit((addr[i]>>4)&0xf);
- tmp[3]='.';
- tmp+=4;
- }
- strcpy(tmp,".ip6.int");
- } else return 1;
- if (buflen<sizeof(struct hostent)+16) {
- errno=ENOMEM;
- *h_errnop=NO_RECOVERY;
- return 1;
- }
- res= __dns_gethostbyx_r(tmpbuf,result,buf+16,buflen-16,RESULT,h_errnop,12); /* 12 == ns_t_ptr */
- if (res==0) {
- if (format==AF_INET) {
- result->h_length=4;
- result->h_addrtype=format;
- }
- memcpy(buf,addr,result->h_length);
- result->h_addr_list[0]=buf;
- result->h_addr_list[1]=0;
- }
- return res;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyname.c b/mdk-stage1/dietlibc/libcruft/gethostbyname.c
deleted file mode 100644
index b4849be96..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyname.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dietwarning.h"
-
-static const int hostentsize=((sizeof(struct hostent)+15)&(-16));
-
-extern size_t __dns_buflen;
-extern char* __dns_buf;
-extern void __dns_makebuf(size_t x);
-
-struct hostent* gethostbyname (const char *host) {
- struct hostent *hostbuf;
- struct hostent *hp;
- int res;
-
- __dns_buflen=512;
- do {
- __dns_makebuf(__dns_buflen*2); if (!__dns_buf) return 0;
- hostbuf=(struct hostent*)__dns_buf;
- } while ((res = gethostbyname_r (host, hostbuf, __dns_buf+hostentsize,
- __dns_buflen-hostentsize, &hp,
- &h_errno)) == ERANGE);
- if (res) hp=0;
- return hp;
-}
-
-link_warning("gethostbyname","warning: gethostbyname() leaks memory. Use gethostbyname_r instead!")
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyname2.c b/mdk-stage1/dietlibc/libcruft/gethostbyname2.c
deleted file mode 100644
index 1ca140dbe..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyname2.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include "dietwarning.h"
-
-static const int hostentsize=((sizeof(struct hostent)+15)&(-16));
-
-extern size_t __dns_buflen;
-extern char* __dns_buf;
-extern void __dns_makebuf(size_t x);
-
-struct hostent* gethostbyname2(const char *host,int AF) {
- struct hostent *hostbuf;
- struct hostent *hp;
- int res;
- int herr;
-
- __dns_buflen=512;
- do {
- __dns_makebuf(__dns_buflen*2); if (!__dns_buf) return 0;
- hostbuf=(struct hostent*)__dns_buf;
- } while ((res = gethostbyname2_r (host, AF, hostbuf,
- __dns_buf+hostentsize,
- __dns_buflen-hostentsize, &hp,
- &herr)) == ERANGE);
- if (res) hp=0;
- return hp;
-}
-
-link_warning("gethostbyname2","warning: gethostbyname2() leaks memory. Use gethostbyname2_r instead!")
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyname2_r.c b/mdk-stage1/dietlibc/libcruft/gethostbyname2_r.c
deleted file mode 100644
index 75da5e320..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyname2_r.c
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include "dietdns.h"
-
-/* Oh boy, this interface sucks so badly, there are no words for it.
- * Not one, not two, but _three_ error signalling methods! (*h_errnop
- * nonzero? return value nonzero? *RESULT zero?) The glibc goons
- * really outdid themselves with this one. */
-int gethostbyname2_r(const char* name, int AF, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop) {
- size_t L=strlen(name);
- int lookfor=0;
- switch (AF) {
- case AF_INET: lookfor=1; break;
- case AF_INET6: lookfor=28; break;
- default: *h_errnop=EINVAL; return 1;
- }
- result->h_name=buf;
- if (buflen<L) { *h_errnop=ERANGE; return 1; }
-#ifdef WANT_ETC_HOSTS
- {
- struct hostent* r;
- while ((r=gethostent_r(buf,buflen))) {
- if (r->h_addrtype==AF) {
- int i;
- if (!strcmp(r->h_name,name)) { /* found it! */
-found:
- memmove(result,r,sizeof(struct hostent));
- *RESULT=result;
- *h_errnop=0;
- endhostent();
- return 0;
- }
- for (i=0; i<16; ++i) {
- if (r->h_aliases[i]) {
- if (!strcmp(r->h_aliases[i],name)) goto found;
- } else break;
- }
- }
- }
- endhostent();
- }
-#endif
- strcpy(buf,name);
- return __dns_gethostbyx_r(name,result,buf+L,buflen-L,RESULT,h_errnop,lookfor);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/gethostbyname_r.c b/mdk-stage1/dietlibc/libcruft/gethostbyname_r.c
deleted file mode 100644
index d7a713e20..000000000
--- a/mdk-stage1/dietlibc/libcruft/gethostbyname_r.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <string.h>
-#include <strings.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include "dietdns.h"
-
-/* Oh boy, this interface sucks so badly, there are no words for it.
- * Not one, not two, but _three_ error signalling methods! (*h_errnop
- * nonzero? return value nonzero? *RESULT zero?) The glibc goons
- * really outdid themselves with this one. */
-int gethostbyname_r(const char* name, struct hostent* result,
- char *buf, size_t buflen,
- struct hostent **RESULT, int *h_errnop) {
- size_t L=strlen(name);
- result->h_name=buf;
- if (buflen<L) { *h_errnop=ERANGE; return 1; }
- strcpy(buf,name);
-#ifdef WANT_INET_ADDR_DNS
- result->h_addr_list=(char**)(buf+strlen(name)+1);
- result->h_addr_list+=sizeof(unsigned long)-((unsigned long)(result->h_addr_list)&(sizeof(unsigned long)-1));
- result->h_addr_list[0]=(char*)&result->h_addr_list[2];
- if (inet_pton(AF_INET,name,result->h_addr_list[0])) {
- result->h_addrtype=AF_INET;
- result->h_length=4;
-commonip:
- result->h_aliases=result->h_addr_list+2*sizeof(char**);
- result->h_aliases[0]=0;
- result->h_addr_list[1]=0;
- *RESULT=result;
- *h_errnop=0;
- return 0;
- } else if (inet_pton(AF_INET6,name,result->h_addr_list[0])) {
- result->h_addrtype=AF_INET6;
- result->h_length=16;
- goto commonip;
- }
-#endif
-#ifdef WANT_ETC_HOSTS
- {
- struct hostent* r;
- while ((r=gethostent_r(buf,buflen))) {
- int i;
- if (r->h_addrtype==AF_INET && !strcasecmp(r->h_name,name)) { /* found it! */
-found:
- memmove(result,r,sizeof(struct hostent));
- *RESULT=result;
- *h_errnop=0;
- endhostent();
- return 0;
- }
- for (i=0; i<16; ++i) {
- if (r->h_aliases[i]) {
- if (!strcasecmp(r->h_aliases[i],name)) goto found;
- } else break;
- }
- }
- endhostent();
- }
-#endif
- return __dns_gethostbyx_r(name,result,buf+L,buflen-L,RESULT,h_errnop,1);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getlogin.c b/mdk-stage1/dietlibc/libcruft/getlogin.c
deleted file mode 100644
index 844d68c70..000000000
--- a/mdk-stage1/dietlibc/libcruft/getlogin.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-
-char* getlogin(void) {
- return getenv("LOGNAME");
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getopt_data.c b/mdk-stage1/dietlibc/libcruft/getopt_data.c
deleted file mode 100644
index 514e8f7f8..000000000
--- a/mdk-stage1/dietlibc/libcruft/getopt_data.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <getopt.h>
-#include <unistd.h>
-#include <string.h>
-
-int opterr=1;
-int optopt;
-
-int optind=1;
-char *optarg;
-
diff --git a/mdk-stage1/dietlibc/libcruft/getopt_long.c b/mdk-stage1/dietlibc/libcruft/getopt_long.c
deleted file mode 100644
index 713da6579..000000000
--- a/mdk-stage1/dietlibc/libcruft/getopt_long.c
+++ /dev/null
@@ -1,103 +0,0 @@
-#include <string.h>
-#include <getopt.h>
-
-static void getopterror(int which) {
- static char error1[]="Unknown option `-x'.\n";
- static char error2[]="Missing argument for `-x'.\n";
- if (opterr) {
- if (which) {
- error2[23]=optopt;
- write(2,error2,28);
- } else {
- error1[17]=optopt;
- write(2,error1,22);
- }
- }
-}
-
-int getopt_long(int argc, char * const argv[], const char *optstring,
- const struct option *longopts, int *longindex) {
- static int lastidx=0,lastofs=0;
- char *tmp;
- if (optind==0) optind=1; /* whoever started setting optind to 0 should be shot */
-again:
- if (optind>argc || !argv[optind] || *argv[optind]!='-' || argv[optind][1]==0)
- return -1;
- if (argv[optind][1]=='-' && argv[optind][2]==0) {
- ++optind;
- return -1;
- }
- if (argv[optind][1]=='-') { /* long option */
- char* arg=argv[optind]+2;
- char* max=strchr(arg,'=');
- const struct option* o;
- if (!max) max=arg+strlen(arg);
- for (o=longopts; o->name; ++o) {
- if (!strncmp(o->name,arg,(size_t)(max-arg))) { /* match */
- if (longindex) *longindex=o-longopts;
- if (o->has_arg>0) {
- if (*max=='=')
- optarg=max+1;
- else {
- optarg=argv[optind+1];
- if (!optarg && o->has_arg==1) { /* no argument there */
- if (*optstring==':') return ':';
- write(2,"argument required: `",20);
- write(2,arg,(size_t)(max-arg));
- write(2,"'.\n",3);
- ++optind;
- return '?';
- }
- ++optind;
- }
- }
- ++optind;
- if (o->flag)
- *(o->flag)=o->val;
- else
- return o->val;
- return 0;
- }
- }
- if (*optstring==':') return ':';
- write(2,"invalid option `",16);
- write(2,arg,(size_t)(max-arg));
- write(2,"'.\n",3);
- ++optind;
- return '?';
- }
- if (lastidx!=optind) {
- lastidx=optind; lastofs=0;
- }
- optopt=argv[optind][lastofs+1];
- if ((tmp=strchr(optstring,optopt))) {
- if (*tmp==0) { /* apparently, we looked for \0, i.e. end of argument */
- ++optind;
- goto again;
- }
- if (tmp[1]==':') { /* argument expected */
- if (tmp[2]==':' || argv[optind][lastofs+2]) { /* "-foo", return "oo" as optarg */
- if (!*(optarg=argv[optind]+lastofs+2)) optarg=0;
- goto found;
- }
- optarg=argv[optind+1];
- if (!optarg) { /* missing argument */
- ++optind;
- if (*optstring==':') return ':';
- getopterror(1);
- return ':';
- }
- ++optind;
- } else {
- ++lastofs;
- return optopt;
- }
-found:
- ++optind;
- return optopt;
- } else { /* not found */
- getopterror(0);
- ++optind;
- return '?';
- }
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getopt_long_only.c b/mdk-stage1/dietlibc/libcruft/getopt_long_only.c
deleted file mode 100644
index f12f9f184..000000000
--- a/mdk-stage1/dietlibc/libcruft/getopt_long_only.c
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <string.h>
-#include <getopt.h>
-
-static void getopterror(int which) {
- static char error1[]="Unknown option `-x'.\n";
- static char error2[]="Missing argument for `-x'.\n";
- if (opterr) {
- if (which) {
- error2[23]=optopt;
- write(2,error2,28);
- } else {
- error1[17]=optopt;
- write(2,error1,22);
- }
- }
-}
-
-int getopt_long_only(int argc, char * const argv[], const char *optstring,
- const struct option *longopts, int *longindex) {
- static int lastidx=0,lastofs=0;
- char *tmp,*arg;
- if (optind==0) optind=1; /* whoever started setting optind to 0 should be shot */
-again:
- if (optind>argc || !argv[optind] || *argv[optind]!='-' || argv[optind][1]==0)
- return -1;
- if (argv[optind][1]=='-' && argv[optind][2]==0) {
- ++optind;
- return -1;
- }
- if (argv[optind][1]=='-')
- arg=argv[optind]+2;
- else
- arg=argv[optind]+1;
- {
- char* max=strchr(arg,'=');
- const struct option* o;
- if (!max) max=arg+strlen(arg);
- for (o=longopts; o->name; ++o) {
- if (!strncmp(o->name,arg,(size_t)(max-arg))) { /* match */
- if (longindex) *longindex=o-longopts;
- if (o->has_arg>0) {
- if (*max=='=')
- optarg=max+1;
- else {
- optarg=argv[optind+1];
- if (!optarg && o->has_arg==1) { /* no argument there */
- if (*optstring==':') return ':';
- write(2,"argument required: `",20);
- write(2,arg,(size_t)(max-arg));
- write(2,"'.\n",3);
- ++optind;
- return '?';
- }
- ++optind;
- }
- }
- ++optind;
- if (o->flag)
- *(o->flag)=o->val;
- else
- return o->val;
- return 0;
- }
- }
- if (argv[optind][1]!='-') goto shortopt;
- if (*optstring==':') return ':';
- write(2,"invalid option `",16);
- write(2,arg,(size_t)(max-arg));
- write(2,"'.\n",3);
- ++optind;
- return '?';
- }
-shortopt:
- if (lastidx!=optind) {
- lastidx=optind; lastofs=0;
- }
- optopt=argv[optind][lastofs+1];
- if ((tmp=strchr(optstring,optopt))) {
- if (*tmp==0) { /* apparently, we looked for \0, i.e. end of argument */
- ++optind;
- goto again;
- }
- if (tmp[1]==':') { /* argument expected */
- if (tmp[2]==':' || argv[optind][lastofs+2]) { /* "-foo", return "oo" as optarg */
- if (!*(optarg=argv[optind]+lastofs+2)) optarg=0;
- goto found;
- }
- optarg=argv[optind+1];
- if (!optarg) { /* missing argument */
- ++optind;
- if (*optstring==':') return ':';
- getopterror(1);
- return ':';
- }
- ++optind;
- } else {
- ++lastofs;
- return optopt;
- }
-found:
- ++optind;
- return optopt;
- } else { /* not found */
- getopterror(0);
- ++optind;
- return '?';
- }
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpagesize.c b/mdk-stage1/dietlibc/libcruft/getpagesize.c
deleted file mode 100644
index 536d3dcef..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpagesize.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-#ifndef PAGE_SIZE
-#define PAGE_SIZE 4096
-#endif
-
-size_t __libc_getpagesize(void);
-size_t __libc_getpagesize(void) {
- return PAGE_SIZE;
-}
-
-size_t getpagesize(void) __attribute__((weak,alias("__libc_getpagesize")));
-
diff --git a/mdk-stage1/dietlibc/libcruft/getpass.c b/mdk-stage1/dietlibc/libcruft/getpass.c
deleted file mode 100644
index 2183284b3..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpass.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <termios.h>
-#include <unistd.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-
-static inline int _tcsetattr(int fd,int optional,struct termios *termios_p) {
- int tmp;
- for (;;) {
- if ((tmp=tcsetattr(fd,optional,termios_p)))
- if (errno==EINTR) continue;
- break;
- }
- return tmp;
-}
-
-char *getpass(const char* prompt) {
- struct termios old,tmp;
- int out,in=open("/dev/tty",O_RDWR);
- int doclose=(in>=0);
- static char buf[PASS_MAX];
- if (!doclose) { in=0; out=2; } else out=in;
- if (!tcgetattr(in,&old)) {
- tmp=old;
- tmp.c_lflag &= ~(ECHO|ISIG);
- _tcsetattr(in,TCSAFLUSH,&tmp);
- }
- write(out,prompt,strlen(prompt));
- {
- int nread,ofs=0;
- for (;;) {
- nread=read(in,buf+ofs,1);
- if (nread<=0) {
- if (errno==EINTR) continue;
- buf[ofs]=0;
- break;
- } else if (ofs+nread>=PASS_MAX) {
- buf[PASS_MAX-1]=0;
- break;
- } else if (buf[ofs]=='\n') {
- buf[ofs+nread-1]=0;
- break;
- }
- ofs+=nread;
- }
- write(out,"\n",1);
- }
- _tcsetattr(in,TCSAFLUSH,&old);
- if (doclose) close(in);
- return buf;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwent.c b/mdk-stage1/dietlibc/libcruft/getpwent.c
deleted file mode 100644
index c206d5dcf..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <pwd.h>
-
-extern struct passwd __passwd_pw;
-extern char __passwd_buf[1000];
-
-struct passwd *getpwent(void) {
- struct passwd* tmp;
- getpwent_r(&__passwd_pw,__passwd_buf,sizeof(__passwd_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwent_r.c b/mdk-stage1/dietlibc/libcruft/getpwent_r.c
deleted file mode 100644
index e887975c9..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwent_r.c
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <paths.h>
-#include <string.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setpwent(void) {
- __prepare_parse(_PATH_PASSWD,&__ps);
-}
-
-void endpwent(void) {
- __end_parse(&__ps);
-}
-
-int getpwent_r(struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) {
- size_t i,j,n;
- unsigned long l;
- if (!__ps.buffirst) setpwent();
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
-again:
- n=0;
- for (i=0; i<7; ++i) {
- j=__parse_1(&__ps,':');
- if (__ps.buffirst[__ps.cur+j]!=':' && i<6) {
-parseerror:
- while (__ps.cur+j<__ps.buflen) {
- if (__ps.buffirst[__ps.cur+j]=='\n') {
- __ps.cur+=j+1;
- goto again;
- }
- ++j;
- }
- }
- switch (i) {
- case 0:
- res->pw_name=buf+n;
-copy:
- if ((size_t)buflen<=n+j) goto error;
- memcpy(buf+n,__ps.buffirst+__ps.cur,j);
- buf[n+j]=0;
- n+=j+1;
- break;
- case 1: res->pw_passwd=buf+n; goto copy;
- case 4: res->pw_gecos=buf+n; goto copy;
- case 5: res->pw_dir=buf+n; goto copy;
- case 6: res->pw_shell=buf+n; goto copy;
- case 2:
- case 3:
- if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror;
- if (i==2) res->pw_uid=l; else res->pw_gid=l;
- break;
- }
- __ps.cur+=j+1;
- }
- *res_sig=res;
- return 0;
-error:
- *res_sig=0;/* the glibc people should be taken behind the barn and shot */
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwnam.c b/mdk-stage1/dietlibc/libcruft/getpwnam.c
deleted file mode 100644
index d2e204150..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwnam.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <pwd.h>
-#include <string.h>
-
-extern struct passwd __passwd_pw;
-extern char __passwd_buf[1000];
-
-struct passwd *getpwnam(const char* name) {
- struct passwd *tmp;
- getpwnam_r(name,&__passwd_pw,__passwd_buf,sizeof(__passwd_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwnam_r.c b/mdk-stage1/dietlibc/libcruft/getpwnam_r.c
deleted file mode 100644
index 55f0bf634..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwnam_r.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <string.h>
-#include <pwd.h>
-
-int getpwnam_r(const char* name,
- struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) {
- while (!getpwent_r(res,buf,buflen,res_sig))
- if (!strcmp(name,res->pw_name))
- goto ok;
- *res_sig=0;
-ok:
- endpwent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwuid.c b/mdk-stage1/dietlibc/libcruft/getpwuid.c
deleted file mode 100644
index bca6a8a0c..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwuid.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <pwd.h>
-#include <string.h>
-#include <stdlib.h>
-
-extern struct passwd __passwd_pw;
-extern char __passwd_buf[1000];
-
-struct passwd *getpwuid(uid_t uid) {
- struct passwd *tmp;
- getpwuid_r(uid,&__passwd_pw,__passwd_buf,sizeof(__passwd_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getpwuid_r.c b/mdk-stage1/dietlibc/libcruft/getpwuid_r.c
deleted file mode 100644
index 64ebfbde8..000000000
--- a/mdk-stage1/dietlibc/libcruft/getpwuid_r.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <pwd.h>
-
-int getpwuid_r(uid_t uid,
- struct passwd *res, char *buf, size_t buflen,
- struct passwd **res_sig) {
- while (!getpwent_r(res,buf,buflen,res_sig))
- if (uid==res->pw_uid)
- goto ok;
- *res_sig=0;
-ok:
- endpwent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getspent.c b/mdk-stage1/dietlibc/libcruft/getspent.c
deleted file mode 100644
index 2e14c8659..000000000
--- a/mdk-stage1/dietlibc/libcruft/getspent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <shadow.h>
-
-extern struct spwd __shadow_pw;
-extern char __shadow_buf[1000];
-
-struct spwd *getspent(void) {
- struct spwd* tmp;
- getspent_r(&__shadow_pw,__shadow_buf,sizeof(__shadow_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getspent_r.c b/mdk-stage1/dietlibc/libcruft/getspent_r.c
deleted file mode 100644
index 7b8d19ac1..000000000
--- a/mdk-stage1/dietlibc/libcruft/getspent_r.c
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <shadow.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <paths.h>
-#include <string.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setspent(void) {
- __prepare_parse(_PATH_SHADOW,&__ps);
-}
-
-void endspent(void) {
- __end_parse(&__ps);
-}
-
-int getspent_r(struct spwd *res, char *buf, size_t buflen,
- struct spwd **res_sig) {
- size_t i,j,n;
- unsigned long l;
- if (!__ps.buffirst) setspent();
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
-again:
- n=0;
- for (i=0; i<9; ++i) {
- j=__parse_1(&__ps,':');
- if (__ps.buffirst[__ps.cur+j]!=':' && i<6) {
-parseerror:
- while (__ps.cur+j<__ps.buflen) {
- if (__ps.buffirst[__ps.cur+j]=='\n') {
- __ps.cur+=j+1;
- goto again;
- }
- ++j;
- }
- }
- if (i>1) {
- if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror;
- if (j==0) l=(unsigned long)-1;
- }
- switch (i) {
- case 0:
- res->sp_namp=buf+n;
-copy:
- if ((size_t)buflen<=n+j) goto error;
- memcpy(buf+n,__ps.buffirst+__ps.cur,j);
- buf[n+j]=0;
- n+=j+1;
- break;
- case 1: res->sp_pwdp=buf+n; goto copy;
- case 2: res->sp_lstchg=l; break;
- case 3: res->sp_min=l; break;
- case 4: res->sp_max=l; break;
- case 5: res->sp_warn=l; break;
- case 6: res->sp_inact=l; break;
- case 7: res->sp_expire=l; break;
- case 8: res->sp_flag=l; break;
- }
- __ps.cur+=j+1;
- }
- *res_sig=res;
- return 0;
-error:
- *res_sig=0;/* the glibc people should be taken behind the barn and shot */
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getspnam.c b/mdk-stage1/dietlibc/libcruft/getspnam.c
deleted file mode 100644
index a4eafbfb2..000000000
--- a/mdk-stage1/dietlibc/libcruft/getspnam.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <shadow.h>
-#include <string.h>
-
-extern struct spwd __shadow_pw;
-extern char __shadow_buf[1000];
-
-struct spwd *getspnam(const char* name) {
- struct spwd *tmp;
- getspnam_r(name,&__shadow_pw,__shadow_buf,sizeof(__shadow_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getspnam_r.c b/mdk-stage1/dietlibc/libcruft/getspnam_r.c
deleted file mode 100644
index 084751d16..000000000
--- a/mdk-stage1/dietlibc/libcruft/getspnam_r.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <string.h>
-#include <shadow.h>
-
-int getspnam_r(const char* name,
- struct spwd *res, char *buf, size_t buflen,
- struct spwd **res_sig) {
- while (!getspent_r(res,buf,buflen,res_sig))
- if (!strcmp(name,res->sp_namp))
- goto ok;
- *res_sig=0;
-ok:
- endspent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/getusershell.c b/mdk-stage1/dietlibc/libcruft/getusershell.c
deleted file mode 100644
index 4c99aa4d4..000000000
--- a/mdk-stage1/dietlibc/libcruft/getusershell.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#define _BSD_SOURCE
-#include <unistd.h>
-#include <paths.h>
-#include <string.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setusershell(void) {
- __prepare_parse(_PATH_SHELLS,&__ps);
-}
-
-void endusershell(void) {
- __end_parse(&__ps);
-}
-
-#define MAXSHELL 128
-
-char *getusershell(void) {
- static char line[MAXSHELL+1];
- size_t i;
- if (!__ps.buffirst) setusershell();
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
- i=__parse_1(&__ps,'\n');
- if (i>=MAXSHELL) i=MAXSHELL-1;
- memcpy(line,__ps.buffirst+__ps.cur,i);
- line[i]=0;
- __ps.cur+=i+1;
- return line;
-error:
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/grbuf.c b/mdk-stage1/dietlibc/libcruft/grbuf.c
deleted file mode 100644
index a1b9440ce..000000000
--- a/mdk-stage1/dietlibc/libcruft/grbuf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <grp.h>
-
-struct group __group_pw;
-char __group_buf[1000];
-
diff --git a/mdk-stage1/dietlibc/libcruft/h_errno.c b/mdk-stage1/dietlibc/libcruft/h_errno.c
deleted file mode 100644
index 73ead0469..000000000
--- a/mdk-stage1/dietlibc/libcruft/h_errno.c
+++ /dev/null
@@ -1 +0,0 @@
-int h_errno;
diff --git a/mdk-stage1/dietlibc/libcruft/herrno_location.c b/mdk-stage1/dietlibc/libcruft/herrno_location.c
deleted file mode 100644
index 5908fe212..000000000
--- a/mdk-stage1/dietlibc/libcruft/herrno_location.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <errno.h>
-#include <resolv.h>
-#include <netdb.h>
-
-int *__h_errno_location(void);
-int *__h_errno_location(void) { return &h_errno; }
-
-int *h_errno_location(void) __attribute__((weak,alias("__h_errno_location")));
diff --git a/mdk-stage1/dietlibc/libcruft/herror.c b/mdk-stage1/dietlibc/libcruft/herror.c
deleted file mode 100644
index 619dd9ce5..000000000
--- a/mdk-stage1/dietlibc/libcruft/herror.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <netdb.h>
-
-void herror(const char* s) {
- write(2,s,strlen(s));
- write(2,": DNS error.\n",13);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/hstrerror.c b/mdk-stage1/dietlibc/libcruft/hstrerror.c
deleted file mode 100644
index fb8902f67..000000000
--- a/mdk-stage1/dietlibc/libcruft/hstrerror.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <netdb.h>
-
-const char* hstrerror(int h_errno) {
- switch (h_errno) {
- case 0: return "OK";
- case NO_DATA: return "No data of requested type.";
- case TRY_AGAIN: return "Temporary failure.";
- case HOST_NOT_FOUND:
- default: return "Unknown host.";
- }
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_addr.c b/mdk-stage1/dietlibc/libcruft/inet_addr.c
deleted file mode 100644
index 0b8531ab1..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_addr.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-unsigned long int inet_addr(const char *cp) {
- struct in_addr foo;
- if (inet_aton(cp,&foo))
- return foo.s_addr;
- else
- return (unsigned long int)-1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_aton.c b/mdk-stage1/dietlibc/libcruft/inet_aton.c
deleted file mode 100644
index 01adb341e..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_aton.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdlib.h>
-
-/* inet_aton() converts the Internet host address cp from the standard
- * numbers-and-dots notation into binary data and stores it in the
- * structure that inp points to. inet_aton returns nonzero if the
- * address is valid, zero if not. */
-
-/* problem is, inet_aton is historically quite, uh, lenient.
- * the following are all acceptable:
- * 0x7f000001 == 127.1 == 127.0.0.1.0 == 127.0.0.1
- * btw: 127.0.0.x.y == 127.0.0.(x|y)
- * and: 10.1.1 == 10.1.0.1 (huh?!)
- * and: 10 == 0.0.0.10 (?!?!?)
- * The Berkeley people must have been so stoned that they are still high.
- */
-
-/* I hereby disclaim that I wrote this code. */
-int inet_aton(const char *cp, struct in_addr *inp) {
- int i;
- unsigned int ip=0;
- char *tmp=(char*)cp;
- for (i=24; ;) {
- long j;
- j=strtoul(tmp,&tmp,0);
- if (*tmp==0) {
- ip|=j;
- break;
- }
- if (*tmp=='.') {
- if (j>255) return 0;
- ip|=(j<<i);
- if (i>0) i-=8;
- ++tmp;
- continue;
- }
- return 0;
- }
- inp->s_addr=htonl(ip);
- return 1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_ntoa.c b/mdk-stage1/dietlibc/libcruft/inet_ntoa.c
deleted file mode 100644
index 632d81424..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_ntoa.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-char *inet_ntoa(struct in_addr in) {
- static char buf[20];
- return inet_ntoa_r(in,buf);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_ntoa_r.c b/mdk-stage1/dietlibc/libcruft/inet_ntoa_r.c
deleted file mode 100644
index dcf0eab7b..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_ntoa_r.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-static unsigned int i2a(char* dest,unsigned int x) {
- register unsigned int tmp=x;
- register unsigned int len=0;
- if (x>=100) { *dest++=tmp/100+'0'; tmp=tmp%100; ++len; }
- if (x>=10) { *dest++=tmp/10+'0'; tmp=tmp%10; ++len; }
- *dest++=tmp+'0';
- return len+1;
-}
-
-char *inet_ntoa_r(struct in_addr in,char* buf) {
- unsigned int len;
- unsigned char *ip=(unsigned char*)&in;
- len=i2a(buf,ip[0]); buf[len]='.'; ++len;
- len+=i2a(buf+ len,ip[1]); buf[len]='.'; ++len;
- len+=i2a(buf+ len,ip[2]); buf[len]='.'; ++len;
- len+=i2a(buf+ len,ip[3]); buf[len]=0;
- return buf;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_ntop.c b/mdk-stage1/dietlibc/libcruft/inet_ntop.c
deleted file mode 100644
index 81bee0a90..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_ntop.c
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <string.h>
-
-static const unsigned char V4mappedprefix[12]={0,0,0,0,0,0,0,0,0,0,0xff,0xff};
-
-static char tohex(char hexdigit) {
- return hexdigit>9?hexdigit+'a'-10:hexdigit+'0';
-}
-
-static int fmt_xlong(char* s,unsigned int i) {
- char* bak=s;
- *s=tohex((i>>12)&0xf); if (s!=bak || *s!='0') ++s;
- *s=tohex((i>>8)&0xf); if (s!=bak || *s!='0') ++s;
- *s=tohex((i>>4)&0xf); if (s!=bak || *s!='0') ++s;
- *s=tohex(i&0xf);
- return s-bak+1;
-}
-
-static unsigned int fmt_ip6(char *s,const char ip[16]) {
- unsigned int len;
- unsigned int i;
- unsigned int temp;
- unsigned int compressing;
- int j;
-
- len = 0; compressing = 0;
- for (j=0; j<16; j+=2) {
- if (j==12 && !memcmp(ip,V4mappedprefix,12)) {
- inet_ntoa_r(*(struct in_addr*)(ip+12),s);
- temp=strlen(s);
- return len+temp;
- }
- temp = ((unsigned long) (unsigned char) ip[j] << 8) +
- (unsigned long) (unsigned char) ip[j+1];
- if (temp == 0) {
- if (!compressing) {
- compressing=1;
- if (j==0) {
- *s++=':'; ++len;
- }
- }
- } else {
- if (compressing) {
- compressing=0;
- *s++=':'; ++len;
- }
- i = fmt_xlong(s,temp); len += i; s += i;
- if (j<14) {
- *s++ = ':';
- ++len;
- }
- }
- }
- if (compressing) {
- *s++=':'; ++len;
- }
- *s=0;
- return len;
-}
-
-const char* inet_ntop(int AF, const void *CP, char *BUF, size_t LEN) {
- char buf[100];
- size_t len;
- if (AF==AF_INET) {
- inet_ntoa_r(*(struct in_addr*)CP,buf);
- len=strlen(buf);
- } else if (AF==AF_INET6) {
- len=fmt_ip6(buf,CP);
- } else
- return 0;
- if (len<LEN) {
- strcpy(BUF,buf);
- return BUF;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/inet_pton.c b/mdk-stage1/dietlibc/libcruft/inet_pton.c
deleted file mode 100644
index a62785d5f..000000000
--- a/mdk-stage1/dietlibc/libcruft/inet_pton.c
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <string.h>
-#include "dietfeatures.h"
-
-static unsigned int scan_ip6(const char *s,char ip[16])
-{
- unsigned int i;
- unsigned int len=0;
- unsigned long u;
-
- char suffix[16];
- unsigned int prefixlen=0;
- unsigned int suffixlen=0;
-
- for (i=0; i<16; i++) ip[i]=0;
-
- for (;;) {
- if (*s == ':') {
- len++;
- if (s[1] == ':') { /* Found "::", skip to part 2 */
- s+=2;
- len++;
- break;
- }
- s++;
- }
- {
- char *tmp;
- u=strtoul(s,&tmp,16);
- i=tmp-s;
- }
-
- if (!i) return 0;
- if (prefixlen==12 && s[i]=='.') {
- /* the last 4 bytes may be written as IPv4 address */
- if (inet_aton(s,(struct in_addr*)(ip+12)))
- return i+len;
- else
- return 0;
- }
- ip[prefixlen++] = (u >> 8);
- ip[prefixlen++] = (u & 255);
- s += i; len += i;
- if (prefixlen==16)
- return len;
- }
-
-/* part 2, after "::" */
- for (;;) {
- if (*s == ':') {
- if (suffixlen==0)
- break;
- s++;
- len++;
- } else if (suffixlen!=0)
- break;
- {
- char *tmp;
- u=strtol(s,&tmp,16);
- i=tmp-s;
- }
- if (!i) {
- if (*s) len--;
- break;
- }
- if (suffixlen+prefixlen<=12 && s[i]=='.') {
- if (inet_aton(s,(struct in_addr*)(suffix+suffixlen))) {
- suffixlen+=4;
- len+=strlen(s);
- break;
- } else
- prefixlen=12-suffixlen; /* make end-of-loop test true */
- }
- suffix[suffixlen++] = (u >> 8);
- suffix[suffixlen++] = (u & 255);
- s += i; len += i;
- if (prefixlen+suffixlen==16)
- break;
- }
- for (i=0; i<suffixlen; i++)
- ip[16-suffixlen+i] = suffix[i];
- return len;
-}
-
-int inet_pton(int AF, const char *CP, void *BUF) {
- int len;
- if (AF==AF_INET) {
- if (!inet_aton(CP,(struct in_addr*)BUF))
- return 0;
- } else if (AF==AF_INET6) {
- if (CP[len=scan_ip6(CP,BUF)])
- if (CP[len]!='%') /* allow "fe80::220:e0ff:fe69:ad92%eth0" */
- return 0;
- } else {
- errno=EAFNOSUPPORT;
- return -1;
- }
- return 1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/initgroups.c b/mdk-stage1/dietlibc/libcruft/initgroups.c
deleted file mode 100644
index 932fddfd6..000000000
--- a/mdk-stage1/dietlibc/libcruft/initgroups.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <grp.h>
-#include <sys/types.h>
-#include <string.h>
-
-int initgroups(const char *user, gid_t group) {
- int n=1;
- gid_t grouplist[32];
- struct group *g;
- grouplist[0]=group;
- setgrent();
- while ((g=getgrent())) {
- char **duh=g->gr_mem;
- while (*duh) {
- if (!strcmp(*duh,user)) {
- grouplist[n]=g->gr_gid;
- if (++n>=32)
- break;
- }
- duh++;
- }
- }
- return setgroups(n,grouplist);
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/killpg.c b/mdk-stage1/dietlibc/libcruft/killpg.c
deleted file mode 100644
index c03bb6330..000000000
--- a/mdk-stage1/dietlibc/libcruft/killpg.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <signal.h>
-
-int killpg(pid_t pgrp, int signal) {
- return kill(-pgrp,signal);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/localeconv.c b/mdk-stage1/dietlibc/libcruft/localeconv.c
deleted file mode 100644
index d2c5ff82c..000000000
--- a/mdk-stage1/dietlibc/libcruft/localeconv.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <limits.h>
-#include <locale.h>
-
-/* these answers are what glibc says */
-
-static struct lconv l =
- {".","","","","","", /* decimal_point - mon_decimal_point */
- "","","","",127,127, /* mon_thousands_sep - frac_digits */
- 127,127,127,127,127,127, /* p_cs_precedes - n_sign_posn */
- 127,127,127,127,127,127 }; /* __int_p_cs_precedes - __int_n_sign_posn */
-
-
-struct lconv* localeconv() {
- return &l;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/mkdtemp.c b/mdk-stage1/dietlibc/libcruft/mkdtemp.c
deleted file mode 100644
index 1c388938c..000000000
--- a/mdk-stage1/dietlibc/libcruft/mkdtemp.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-char* mkdtemp(char* template) {
- char *tmp=template+strlen(template)-6;
- int randfd,i;
- unsigned int random;
- if (tmp<template) goto error;
- for (i=0; i<6; ++i) if (tmp[i]!='X') { error: errno=EINVAL; return 0; }
- randfd=open("/dev/urandom",O_RDONLY);
- for (;;) {
- read(randfd,&random,sizeof(random));
- for (i=0; i<6; ++i) {
- int hexdigit=(random>>(i*5))&0x1f;
- tmp[i]=hexdigit>9?hexdigit+'a'-10:hexdigit+'0';
- }
- if (mkdir(template,0700)==0) break;
- if (errno==EEXIST) continue;
- close(randfd);
- return 0;
- }
- close(randfd);
- return template;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/mkstemp.c b/mdk-stage1/dietlibc/libcruft/mkstemp.c
deleted file mode 100644
index 7dc19d4ed..000000000
--- a/mdk-stage1/dietlibc/libcruft/mkstemp.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-#ifndef O_NOFOLLOW
-#define O_NOFOLLOW 0
-#endif
-
-int mkstemp(char* template) {
- char *tmp=template+strlen(template)-6;
- int randfd;
- int i,res;
- unsigned int random;
- if (tmp<template) goto error;
- for (i=0; i<6; ++i) if (tmp[i]!='X') { error: errno=EINVAL; return -1; }
- randfd=open("/dev/urandom",O_RDONLY);
- for (;;) {
- read(randfd,&random,sizeof(random));
- for (i=0; i<6; ++i) {
- int hexdigit=(random>>(i*5))&0x1f;
- tmp[i]=hexdigit>9?hexdigit+'a'-10:hexdigit+'0';
- }
- res=open(template,O_CREAT|O_RDWR|O_EXCL|O_NOFOLLOW,0600);
- if (res>=0 || errno!=EEXIST) break;
- }
- close(randfd);
- return res;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/mktemp.c b/mdk-stage1/dietlibc/libcruft/mktemp.c
deleted file mode 100644
index d1908a9ac..000000000
--- a/mdk-stage1/dietlibc/libcruft/mktemp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <dietwarning.h>
-
-link_warning("mktemp","\e[1;33;41m>>> mktemp stinks! DON'T USE IT ! <<<\e[0m");
-
-char* mktemp(char* template) {
- int fd;
- if ((fd=mkstemp(template))<0) return 0;
- close(fd);
- unlink(template);
- return template;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/pwbuf.c b/mdk-stage1/dietlibc/libcruft/pwbuf.c
deleted file mode 100644
index aa0ad7001..000000000
--- a/mdk-stage1/dietlibc/libcruft/pwbuf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <pwd.h>
-
-struct passwd __passwd_pw;
-char __passwd_buf[1000];
-
diff --git a/mdk-stage1/dietlibc/libcruft/res_init.c b/mdk-stage1/dietlibc/libcruft/res_init.c
deleted file mode 100644
index 78baa2b30..000000000
--- a/mdk-stage1/dietlibc/libcruft/res_init.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <resolv.h>
-
-extern void __dns_readstartfiles(void);
-
-int res_init(void) {
- _res.nscount=0;
- __dns_readstartfiles();
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/res_mkquery.c b/mdk-stage1/dietlibc/libcruft/res_mkquery.c
deleted file mode 100644
index cf5693668..000000000
--- a/mdk-stage1/dietlibc/libcruft/res_mkquery.c
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <resolv.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include "dietfeatures.h"
-
-static char dnspacket[]="\xfe\xfe\001\000\000\001\000\000\000\000\000\000";
-
-/*
- 1 1 1 1 1 1
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | ID |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- |QR| Opcode |AA|TC|RD|RA| Z | RCODE |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | QDCOUNT |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | ANCOUNT |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | NSCOUNT |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
- | ARCOUNT |
- +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
-*/
-
-extern void __dns_make_fd(void);
-extern int __dns_fd;
-
-extern int __dns_servers;
-extern struct sockaddr __dns_server_ips[];
-
-extern void __dns_readstartfiles(void);
-
-int res_mkquery(int op, const char *dname, int class, int type, char* data,
- int datalen, const unsigned char* newrr, char* buf, int buflen) {
- unsigned char packet[512];
- memmove(packet,dnspacket,12);
- if ((_res.options&RES_RECURSE)==0) packet[2]=0;
- *(unsigned short*)packet=rand();
- {
- unsigned char* x;
- const char* y,* tmp;
- x=packet+12; y=dname;
- while (*y) {
- while (*y=='.') ++y;
- for (tmp=y; *tmp && *tmp!='.'; ++tmp) ;
- *x=tmp-y;
- if (!(tmp-y)) break;
- ++x;
- if (x>=packet+510-(tmp-y)) { return -1; }
- memmove(x,y,tmp-y);
- x+=tmp-y;
- if (!*tmp) {
- *x=0;
- break;
- }
- y=tmp;
- }
- *++x= 0; *++x= type; /* A */
- *++x= 0; *++x= class; /* IN */
- ++x;
- if (x-packet>buflen) return -1;
- memmove(buf,packet,x-packet);
- return x-packet;
- }
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/res_query.c b/mdk-stage1/dietlibc/libcruft/res_query.c
deleted file mode 100644
index 28b5c3ac8..000000000
--- a/mdk-stage1/dietlibc/libcruft/res_query.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <resolv.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <sys/poll.h>
-#include <unistd.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include "dietfeatures.h"
-
-extern void __dns_make_fd(void);
-extern int __dns_fd;
-#ifdef WANT_IPV6_DNS
-extern void __dns_make_fd6(void);
-extern int __dns_fd6;
-#endif
-
-extern void __dns_readstartfiles(void);
-
-int res_query(const char *dname, int class, int type, unsigned char *answer, int anslen) {
- unsigned char packet[512];
- int size;
-#ifndef WANT_IPV6_DNS
- __dns_make_fd();
-#endif
-
- __dns_readstartfiles();
- if ((size=res_mkquery(QUERY,dname,class,type,0,0,0,packet,512))<0) { h_errno=NO_RECOVERY; return -1; }
- {
- {
- int i; /* current server */
- int j; /* timeout count down */
- struct pollfd duh;
- struct timeval last,now;
-#ifdef WANT_IPV6_DNS
- int tmpfd; /* the warning gcc issues here is bogus */
-#else
- duh.fd=__dns_fd;
-#endif
- i=0;
- duh.events=POLLIN;
- last.tv_sec=0;
- for (j=120; j>0; --j) {
- gettimeofday(&now,0);
- if (now.tv_sec-last.tv_sec>10) {
-#ifdef WANT_IPV6_DNS
- struct sockaddr* s=(struct sockaddr*)&(_res.nsaddr_list[i]);
- if (s->sa_family==AF_INET6) {
- __dns_make_fd6();
- tmpfd=__dns_fd6;
- } else {
- __dns_make_fd();
- tmpfd=__dns_fd;
- }
- duh.fd=tmpfd;
- if (sendto(tmpfd,packet,size,0,s,sizeof(struct sockaddr_in6))==0)
- gettimeofday(&last,0);
-#else
- if (sendto(__dns_fd,packet,size,0,(struct sockaddr*)&(_res.nsaddr_list[i]),sizeof(struct sockaddr))==0)
- gettimeofday(&last,0);
-#endif
- last=now;
- }
- if (++i >= _res.nscount) i=0;
- if (poll(&duh,1,1000) == 1) {
- /* read and parse answer */
- unsigned char inpkg[1500];
-#ifdef WANT_IPV6_DNS
- int len=read(tmpfd,inpkg,1500);
-#else
- int len=read(__dns_fd,inpkg,1500);
-#endif
- /* header, question, answer, authority, additional */
- if (inpkg[0]!=packet[0] || inpkg[1]!=packet[1]) continue; /* wrong ID */
- if ((inpkg[2]&0xf9) != (_res.options&RES_RECURSE?0x81:0x80)) continue; /* not answer */
- if ((inpkg[3]&0x0f) != 0) { h_errno=HOST_NOT_FOUND; return -1; } /* error */
- if (len>anslen) {
- h_errno=NO_RECOVERY;
- return -1;
- }
- memmove(answer,inpkg,len);
- return len;
- }
-/*kaputt:*/
- }
- }
- }
- h_errno=NO_DATA;
- return -1;
-}
-
diff --git a/mdk-stage1/dietlibc/libcruft/res_search.c b/mdk-stage1/dietlibc/libcruft/res_search.c
deleted file mode 100644
index a8b9257bc..000000000
--- a/mdk-stage1/dietlibc/libcruft/res_search.c
+++ /dev/null
@@ -1,35 +0,0 @@
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <errno.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
-extern int __dns_search;
-extern char *__dns_domains[];
-
-int res_search(const char *dname, int class, int type, unsigned char *answer, int anslen) {
- const char *tmp=dname;
- char Buf[MAXDNAME+1];
- int res;
- int len=strlen(dname);
- int count=0;
- memmove(Buf,dname,len);
- Buf[len]=Buf[MAXDNAME]=0;
-// printf("appending %d: %p\n",count,__dns_domains[count]);
- while ((res=res_query(tmp,class,type,answer,anslen))<0) {
- if (count==__dns_search) break;
- Buf[len]='.';
-// printf("appending %d: %p (%s)\n",count,__dns_domains[count],__dns_domains[count]);
- memccpy(Buf+len+1,__dns_domains[count],0,MAXDNAME-len-1);
- tmp=Buf;
- ++count;
- }
- return res;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/scan_ulong.c b/mdk-stage1/dietlibc/libcruft/scan_ulong.c
deleted file mode 100644
index dfbec5c55..000000000
--- a/mdk-stage1/dietlibc/libcruft/scan_ulong.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <ctype.h>
-#include <sys/types.h>
-#include "parselib.h"
-
-size_t scan_ulong(const char* s,unsigned long* l) {
- size_t n;
- unsigned long x;
- unsigned int digit;
- for (x=n=0; (digit=(s[n]-'0'))<10u; ++n)
- x=x*10+digit;
- *l=x;
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/scandir.c b/mdk-stage1/dietlibc/libcruft/scandir.c
deleted file mode 100644
index fac7eaa7f..000000000
--- a/mdk-stage1/dietlibc/libcruft/scandir.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdlib.h>
-#include <dirent.h>
-#include <string.h>
-
-int scandir(const char *dir, struct dirent ***namelist,
- int (*select)(const struct dirent *),
- int (*compar)(const struct dirent **, const struct dirent **)) {
- DIR* d;
- struct dirent *D;
- int num=0;
- if (!(d=opendir(dir)))
- return -1;
- *namelist=0;
- while ((D=readdir(d))) {
- if (select==0 || select(D)) {
- struct dirent **tmp;
- ++num;
-/* printf("realloc %p,%d -> ",*namelist,num*sizeof(struct dirent**)); */
- if (!(tmp=realloc(*namelist,num*sizeof(struct dirent**))) ||
- !(tmp[num-1]=malloc(sizeof(struct dirent)))) {
- int i;
- for (i=0; i<num-1; ++i) free(tmp[i]);
- free(*namelist);
- closedir(d);
- return -1;
- }
- memccpy(tmp[num-1]->d_name,D->d_name,0,NAME_MAX);
- *namelist=tmp;
-/* printf("%p; tmp[num-1(%d)]=%p\n",*namelist,num-1,tmp[num-1]); */
- }
- }
- closedir(d);
-#if 0
- {
- int i;
- puts("pre-qsort:\n");
- for (i=0; i<num-1; ++i) {
- puts((*namelist)[i]->d_name);
- }
- puts("post-qsort:\n");
- }
-#endif
-// qsort(&(*namelist)[0],num,sizeof(struct dirent*),(int (*)(const void*,const void*))(compar));
- if (compar)
- qsort(*namelist,num,sizeof(struct dirent*),(int (*)(const void*,const void*))(compar));
- return num;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/scandir64.c b/mdk-stage1/dietlibc/libcruft/scandir64.c
deleted file mode 100644
index c1bdc3415..000000000
--- a/mdk-stage1/dietlibc/libcruft/scandir64.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdlib.h>
-#include <dirent.h>
-#include <string.h>
-
-int scandir64(const char *dir, struct dirent64 ***namelist,
- int (*select)(const struct dirent64 *),
- int (*compar)(const struct dirent64 **, const struct dirent64 **)) {
- DIR* d;
- struct dirent64 *D;
- int num=0;
- if (!(d=opendir(dir)))
- return -1;
- *namelist=0;
- while ((D=readdir64(d))) {
- if (select==0 || select(D)) {
- struct dirent64 **tmp;
- ++num;
-/* printf("realloc %p,%d -> ",*namelist,num*sizeof(struct dirent**)); */
- if (!(tmp=realloc(*namelist,num*sizeof(struct dirent64**))) ||
- !(tmp[num-1]=malloc(sizeof(struct dirent64)))) {
- int i;
- for (i=0; i<num-1; ++i) free(tmp[i]);
- free(*namelist);
- closedir(d);
- return -1;
- }
- memccpy(tmp[num-1]->d_name,D->d_name,0,NAME_MAX);
- *namelist=tmp;
-/* printf("%p; tmp[num-1(%d)]=%p\n",*namelist,num-1,tmp[num-1]); */
- }
- }
- closedir(d);
-#if 0
- {
- int i;
- puts("pre-qsort:\n");
- for (i=0; i<num-1; ++i) {
- puts((*namelist)[i]->d_name);
- }
- puts("post-qsort:\n");
- }
-#endif
-// qsort(&(*namelist)[0],num,sizeof(struct dirent*),(int (*)(const void*,const void*))(compar));
- if (compar)
- qsort(*namelist,num,sizeof(struct dirent64*),(int (*)(const void*,const void*))(compar));
- return num;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/setegid.c b/mdk-stage1/dietlibc/libcruft/setegid.c
deleted file mode 100644
index 6e891952b..000000000
--- a/mdk-stage1/dietlibc/libcruft/setegid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include "dietwarning.h"
-
-#undef setegid
-int setegid(gid_t gid);
-int setegid(gid_t gid) {
- return setregid((gid_t)-1,gid);
-}
-
-link_warning("setegid","warning: you used setegid without including <unistd.h>")
diff --git a/mdk-stage1/dietlibc/libcruft/seteuid.c b/mdk-stage1/dietlibc/libcruft/seteuid.c
deleted file mode 100644
index 8145f20d7..000000000
--- a/mdk-stage1/dietlibc/libcruft/seteuid.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include "dietwarning.h"
-
-#undef seteuid
-int seteuid(uid_t uid);
-int seteuid(uid_t uid) {
- return setreuid((uid_t)-1,uid);
-}
-
-link_warning("setegid","warning: you used setegid without including <unistd.h>")
diff --git a/mdk-stage1/dietlibc/libcruft/setlocale.c b/mdk-stage1/dietlibc/libcruft/setlocale.c
deleted file mode 100644
index e0e8f647d..000000000
--- a/mdk-stage1/dietlibc/libcruft/setlocale.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <locale.h>
-
-char *setlocale (int category, const char *locale) {
- (void)category;
- (void)locale;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/spbuf.c b/mdk-stage1/dietlibc/libcruft/spbuf.c
deleted file mode 100644
index ab880bbcf..000000000
--- a/mdk-stage1/dietlibc/libcruft/spbuf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <shadow.h>
-
-struct spwd __shadow_pw;
-char __shadow_buf[1000];
-
diff --git a/mdk-stage1/dietlibc/libcruft/sysconf.c b/mdk-stage1/dietlibc/libcruft/sysconf.c
deleted file mode 100644
index e9c15cb66..000000000
--- a/mdk-stage1/dietlibc/libcruft/sysconf.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-#include <limits.h>
-#include <sys/resource.h>
-
-extern int __sc_nr_cpus();
-
-long sysconf(int name)
-{
- switch(name)
- {
- case _SC_OPEN_MAX:
- {
- struct rlimit limit;
- getrlimit(RLIMIT_NOFILE, &limit);
- return limit.rlim_cur;
- }
- case _SC_CLK_TCK:
-#ifdef __alpha__
- return 1024;
-#else
- return 100;
-#endif
-
- case _SC_PAGESIZE:
-#if ( defined(__alpha__) || defined(__sparc__) )
- return 8192;
-#else
- return 4096;
-#endif
-
- case _SC_ARG_MAX:
- return ARG_MAX;
-
- case _SC_NGROUPS_MAX:
- return NGROUPS_MAX;
-
- case _SC_NPROCESSORS_ONLN:
- return __sc_nr_cpus();
-
- }
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c b/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c
deleted file mode 100644
index b5361d0a4..000000000
--- a/mdk-stage1/dietlibc/libcruft/sysconf_cpus.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "dietfeatures.h"
-
-/*
- * by Olaf Dreesen
- *
- * arm NO SMP ?!? (return 1)
- *
- * alpha -> cpus detected\t\t: <nr>\n
- * sparc -> ncpus active\t: <nr>\n
- *
- * default -> processor\t: <cpunr>\n (one per cpu)
- */
-
-#ifdef SLASH_PROC_OK
-int __sc_nr_cpus(void);
-int __sc_nr_cpus() {
-#if defined(__arm__)
- return 1;
-#else
- int fd;
- fd = open("/proc/cpuinfo", O_RDONLY);
- if (fd==-1) return 1; /* fallback if no proc-fs mounted */
- else {
- int n,nr=0;
- char buf[2048]; /* holds ~6 cpuinfos */
-
- while((n=read(fd,buf,sizeof(buf)))>0) {
- register int i=0;
- while (i<n) {
-#if defined(__alpha__)
- if ((buf[i]=='c')&&(!memcmp(buf+i,"cpus detected",13))) {
- i+=17;
- nr=atoi(buf+i);
- break;
- }
-#elif defined(__sparc__)
- if ((buf[i]=='n')&&(!memcmp(buf+i,"ncpus active",12))) {
- i+=15;
- nr=atoi(buf+i);
- break;
- }
-#else /* DEFAULT */
- if ((buf[i]=='p')&&(!memcmp(buf+i,"processor",9))) {
- ++nr;
- i+=9;
- }
-#endif
- while(buf[i++]!='\n'); /* skip rest of line */
- }
- }
- close(fd);
- return nr;
- }
-#endif
-}
-#else
-int __sc_nr_cpus() {
- return 1; /* kludge kludge ;-) */
-}
-#endif
diff --git a/mdk-stage1/dietlibc/libcruft/tempnam.c b/mdk-stage1/dietlibc/libcruft/tempnam.c
deleted file mode 100644
index 01c20b490..000000000
--- a/mdk-stage1/dietlibc/libcruft/tempnam.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <dietwarning.h>
-
-link_warning("tempnam","\e[1;33;41m>>> tempnam stinks! NEVER ! NEVER USE IT ! <<<\e[0m");
-
-char* tempnam(char* dir,char* template) {
- char buf[1024];
- int len=sizeof(buf)-1,fd;
- buf[len]=0;
- if ((dir)&&(*dir)) {
- memccpy(buf,dir,0,len);
- strncat(buf,"/",1);
- }
- else
- strncpy(buf,"/tmp/",len);
- len=(sizeof(buf)-1)-strlen(buf);
- if (template)
- strncat(buf,template, --len);
- else
- strncat(buf,"temp_", --len);
- len=(sizeof(buf)-1)-strlen(buf);
- strncat(buf,"XXXXXX",len);
- if ((fd=mkstemp(buf))<0) return 0;
- close(fd);
- unlink(buf);
- return strdup(buf);
-}
diff --git a/mdk-stage1/dietlibc/libcruft/tmpnam.c b/mdk-stage1/dietlibc/libcruft/tmpnam.c
deleted file mode 100644
index 707730616..000000000
--- a/mdk-stage1/dietlibc/libcruft/tmpnam.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include <sys/stat.h>
-#include <dietwarning.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-link_warning("tmpnam","\e[1;33;41m>>> tmpnam stinks! NEVER ! NEVER USE IT ! <<<\e[0m");
-
-char* tmpnam(char* s) {
- static char buf[100];
- char *tmp;
- if (s) tmp=s; else tmp=buf;
- strcpy(tmp,"/tmp/temp_");
- for (;;) {
- struct stat s;
- int i,j;
- i=rand();
- for (j=0; j<8; ++j) {
- char c=i&0xf;
- tmp[9+j]=c>9?c+'a'-10:c+'0';
- i>>=4;
- }
- tmp[17]=0;
- if (lstat(tmp,&s)==-1 && errno==ENOENT) break;
- }
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libcrypt/crypt.c b/mdk-stage1/dietlibc/libcrypt/crypt.c
deleted file mode 100644
index 3c162d513..000000000
--- a/mdk-stage1/dietlibc/libcrypt/crypt.c
+++ /dev/null
@@ -1,314 +0,0 @@
-#include "dietfeatures.h"
-#include <unistd.h>
-#include <md5.h>
-
-/* Initial permutation, */
-static const char IP[] = {
- 57,49,41,33,25,17, 9, 1,
- 59,51,43,35,27,19,11, 3,
- 61,53,45,37,29,21,13, 5,
- 63,55,47,39,31,23,15, 7,
- 56,48,40,32,24,16, 8, 0,
- 58,50,42,34,26,18,10, 2,
- 60,52,44,36,28,20,12, 4,
- 62,54,46,38,30,22,14, 6
-};
-
-/* Final permutation, FP = IP^(-1) */
-static const char FP[] = {
- 39, 7,47,15,55,23,63,31,
- 38, 6,46,14,54,22,62,30,
- 37, 5,45,13,53,21,61,29,
- 36, 4,44,12,52,20,60,28,
- 35, 3,43,11,51,19,59,27,
- 34, 2,42,10,50,18,58,26,
- 33, 1,41, 9,49,17,57,25,
- 32, 0,40, 8,48,16,56,24
-};
-
-/* Permuted-choice 1 from the key bits to yield C and D.
- * Note that bits 8,16... are left out: They are intended for a parity check.
- */
-static const char PC1_C[] = {
- 56,48,40,32,24,16, 8,
- 0,57,49,41,33,25,17,
- 9, 1,58,50,42,34,26,
- 18,10, 2,59,51,43,35
-};
-
-static const char PC1_D[] = {
- 62,54,46,38,30,22,14,
- 6,61,53,45,37,29,21,
- 13, 5,60,52,44,36,28,
- 20,12, 4,27,19,11, 3
-};
-
-/* Sequence of shifts used for the key schedule. */
-static const char shifts[] = { 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1 };
-
-/*
- * Permuted-choice 2, to pick out the bits from the CD array that generate
- * the key schedule.
- */
-static const char PC2_C[] = {
- 13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9,
- 22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1
-};
-
-static const char PC2_D[] = {
- 12, 23, 2, 8, 18, 26, 1, 11, 22, 16, 4, 19,
- 15, 20, 10, 27, 5, 24, 17, 13, 21, 7, 0, 3
-};
-
-/* The C and D arrays used to calculate the key schedule. */
-
-static char C[28];
-static char D[28];
-/* The key schedule. Generated from the key. */
-static char KS[16][48];
-
-/* The E bit-selection table. */
-static char E[48];
-static const char e2[] = {
- 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9,
- 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17,
- 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25,
- 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1
-};
-
-/* Set up the key schedule from the key. */
-void setkey(const char *key)
-{
- register int i, j, k;
- int t;
- int s;
-
- /* First, generate C and D by permuting the key. The low order bit of each
- * 8-bit char is not used, so C and D are only 28 bits apiece.
- */
- for(i=0; i < 28; i++) {
- C[i] = key[(int)PC1_C[i]];
- D[i] = key[(int)PC1_D[i]];
- }
- /* To generate Ki, rotate C and D according to schedule and pick up a
- * permutation using PC2.
- */
- for(i=0; i < 16; i++) {
- /* rotate. */
- s = shifts[i];
- for(k=0; k < s; k++) {
- t = C[0];
- for(j=0; j < 27; j++)
- C[j] = C[j+1];
- C[27] = t;
- t = D[0];
- for(j=0; j < 27; j++)
- D[j] = D[j+1];
- D[27] = t;
- }
- /* get Ki. Note C and D are concatenated. */
- for(j=0; j < 24; j++) {
- KS[i][j] = C[(int)PC2_C[j]];
- KS[i][j+24] = D[(int)PC2_D[j]];
- }
- }
-
- for(i=0; i < 48; i++)
- E[i] = e2[i];
-}
-
-/* The 8 selection functions. For some reason, they give a 0-origin index,
- * unlike everything else.
- */
-static const char S[8][64] = {
- {
- 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
- 0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8,
- 4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0,
- 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13
- },
-
- {
- 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
- 3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5,
- 0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15,
- 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9
- },
-
- {
- 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
- 13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1,
- 13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7,
- 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12
- },
-
- {
- 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
- 13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9,
- 10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4,
- 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14
- },
-
- {
- 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
- 14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6,
- 4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14,
- 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3
- },
-
- {
- 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
- 10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8,
- 9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6,
- 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13
- },
-
- {
- 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
- 13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6,
- 1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2,
- 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12
- },
-
- {
- 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
- 1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2,
- 7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8,
- 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11
- }
-};
-
-/* P is a permutation on the selected combination of the current L and key. */
-static const char P[] = {
- 15, 6,19,20, 28,11,27,16, 0,14,22,25, 4,17,30, 9,
- 1, 7,23,13, 31,26, 2, 8, 18,12,29, 5, 21,10, 3,24
-};
-
-/* The current block, divided into 2 halves. */
-static char L[32], R[32];
-static char tempL[32];
-static char f[32];
-
-/* The combination of the key and the input, before selection. */
-static char preS[48];
-
-/* The payoff: encrypt a block. */
-void encrypt(char block[64],int edflag)
-{
- int i, ii;
- register int t, j, k;
-
- (void)edflag;
- /* First, permute the bits in the input */
- for(j=0; j < 64; j++)
- L[j] = block[(int)IP[j]];
- /* Perform an encryption operation 16 times. */
- for(ii=0; ii < 16; ii++) {
- i = ii;
- /* Save the R array, which will be the new L. */
- for(j=0; j < 32; j++)
- tempL[j] = R[j];
- /* Expand R to 48 bits using the E selector;
- * exclusive-or with the current key bits.
- */
- for(j=0; j < 48; j++)
- preS[j] = R[E[j]-1] ^ KS[i][j];
- /* The pre-select bits are now considered in 8 groups of 6 bits each.
- * The 8 selection functions map these 6-bit quantities into 4-bit
- * quantities and the results permuted to make an f(R, K).
- * The indexing into the selection functions is peculiar;
- * it could be simplified by rewriting the tables.
- */
- for(j=0; j < 8; j++) {
- t = ((j<<1)+j)<<1;
- k = S[j][(preS[t]<<5)+
- (preS[t+1]<<3)+
- (preS[t+2]<<2)+
- (preS[t+3]<<1)+
- (preS[t+4] )+
- (preS[t+5]<<4)];
- t = j << 2;
- f[t ] = (k>>3)&01;
- f[t+1] = (k>>2)&01;
- f[t+2] = (k>>1)&01;
- f[t+3] = (k )&01;
- }
- /* The new R is L ^ f(R, K). The f here has to be permuted first, though. */
- for(j=0; j < 32; j++)
- R[j] = L[j] ^ f[(int)P[j]];
- /* Finally, the new L (the original R) is copied back. */
- for(j=0; j < 32; j++)
- L[j] = tempL[j];
- }
- /* The output L and R are reversed. */
- for(j=0; j < 32; j++) {
- L[j] ^= R[j];
- R[j] ^= L[j];
- L[j] ^= R[j];
- }
- /* The final output gets the inverse permutation of the very original. */
- for(j=0; j < 64; j++)
- block[j] = L[(int)FP[j]];
-}
-
-char * crypt(const char *pw, const char *salt)
-{
- register int i, j, c;
- static char block[66], iobuf[16];
-#ifdef WANT_CRYPT_MD5
- if (salt[0]=='$' && salt[1]=='1' && salt[2]=='$')
- return md5crypt(pw,salt);
-#endif
- for(i=0; i < 66; i++)
- block[i] = 0;
- for(i=0; (c= *pw) && i < 64; pw++) {
- for(j=0; j < 7; j++, i++)
- block[i] = (c>>(6-j)) & 01;
- i++;
- }
-
- setkey(block);
-
- for(i=0; i < 66; i++)
- block[i] = 0;
-
- for(i=0; i < 2; i++) {
- c = *salt++;
- iobuf[i] = c;
- if(c > 'Z')
- c -= 6;
- if(c > '9')
- c -= 7;
- c -= '.';
- for(j=0; j < 6; j++) {
- if((c>>j) & 01) {
- int ind1 = (((i<<1)+i)<< 1) + j;
- int ind2 = ind1 + 24;
- E[ind1] ^= E[ind2];
- E[ind2] ^= E[ind1];
- E[ind1] ^= E[ind2];
- }
- }
- }
-
- for(i=0; i < 25; i++)
- encrypt(block,0);
-
- for(i=0; i < 11; i++) {
- c = 0;
- for(j=0; j < 6; j++) {
- c <<= 1;
- c |= block[(((i<<1)+i)<<1)+j];
- }
- c += '.';
- if(c > '9')
- c += 7;
- if(c > 'Z')
- c += 6;
- iobuf[i+2] = c;
- }
- iobuf[i+2] = 0;
- if(iobuf[1] == 0)
- iobuf[1] = iobuf[0];
- return(iobuf);
-}
diff --git a/mdk-stage1/dietlibc/libcrypt/md5.c b/mdk-stage1/dietlibc/libcrypt/md5.c
deleted file mode 100644
index ede9a067e..000000000
--- a/mdk-stage1/dietlibc/libcrypt/md5.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*****************************************************************************
-*
-* "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm".
-*
-* 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
-*
-*****************************************************************************/
-
-#include <endian.h>
-#include <md5.h>
-#include <string.h>
-
-#if (__BYTE_ORDER == __BIG_ENDIAN)
-/*
- Block copy and convert byte order to little-endian.
- dst must be 32bit aligned.
- Length is the number of 32bit words
-*/
-static void CopyToLittleEndian (uint32_t *dst, const uint8_t *src, int length) {
- while (length--) {
- *dst=(((uint32_t)src[3])<<24) |
- (((uint32_t)src[2])<<16) |
- (((uint32_t)src[1])<< 8) |
- (uint32_t)src[0];
- src+=4;
- dst++;
- }
-}
-#endif
-
-
-/*
- Assembler versions of __MD5Transform, MD5Init and MD5Update
- currently exist for x86 and little-endian ARM.
- For other targets, we need to use the C versions below.
-*/
-
-#if !(defined (__i386__) || ((defined (__arm__) && (__BYTE_ORDER == __LITTLE_ENDIAN))))
-
-/*
- Initialise the MD5 context.
-*/
-void MD5Init (MD5_CTX* context) {
- context->count[0] = 0;
- context->count[1] = 0;
-
- context->state[0] = 0x67452301; /* Load magic constants. */
- context->state[1] = 0xefcdab89;
- context->state[2] = 0x98badcfe;
- context->state[3] = 0x10325476;
-}
-
-#define ROTATE_LEFT(x, n) ((x << n) | (x >> (32-n)))
-
-#define F(x, y, z) (z ^ (x & (y ^ z)))
-#define G(x, y, z) (y ^ (z & (x ^ y)))
-#define H(x, y, z) (x ^ y ^ z)
-#define I(x, y, z) (y ^ (x | ~z))
-
-#define FF(a, b, c, d, x, s, ac) { (a) += F (b, c, d) + (x) + (uint32_t)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-#define GG(a, b, c, d, x, s, ac) { (a) += G (b, c, d) + (x) + (uint32_t)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-#define HH(a, b, c, d, x, s, ac) { (a) += H (b, c, d) + (x) + (uint32_t)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-#define II(a, b, c, d, x, s, ac) { (a) += I (b, c, d) + (x) + (uint32_t)(ac); (a) = ROTATE_LEFT (a, s); (a) += (b); }
-
-static void __MD5Transform (uint32_t state[4], const uint8_t *in, int repeat) {
- const uint32_t *x;
-
- uint32_t a = state[0];
- uint32_t b = state[1];
- uint32_t c = state[2];
- uint32_t d = state[3];
-
- for ( ; repeat; repeat--) {
- uint32_t tempBuffer[16];
-#if (__BYTE_ORDER == __BIG_ENDIAN)
-
- CopyToLittleEndian (tempBuffer, in, 16);
- x = tempBuffer;
-#else
- if ((long)in & 3) {
- memcpy(tempBuffer, in, 64);
- x = tempBuffer;
- } else
- x = (const uint32_t *) in;
-#endif
-
- FF (a, b, c, d, x[ 0], 7, 0xd76aa478); /* 1 */ /* Round 1 */
- FF (d, a, b, c, x[ 1], 12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, x[ 2], 17, 0x242070db); /* 3 */
- FF (b, c, d, a, x[ 3], 22, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, x[ 4], 7, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, x[ 5], 12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, x[ 6], 17, 0xa8304613); /* 7 */
- FF (b, c, d, a, x[ 7], 22, 0xfd469501); /* 8 */
- FF (a, b, c, d, x[ 8], 7, 0x698098d8); /* 9 */
- FF (d, a, b, c, x[ 9], 12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, x[10], 17, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, x[11], 22, 0x895cd7be); /* 12 */
- FF (a, b, c, d, x[12], 7, 0x6b901122); /* 13 */
- FF (d, a, b, c, x[13], 12, 0xfd987193); /* 14 */
- FF (c, d, a, b, x[14], 17, 0xa679438e); /* 15 */
- FF (b, c, d, a, x[15], 22, 0x49b40821); /* 16 */
-
- GG (a, b, c, d, x[ 1], 5, 0xf61e2562); /* 17 */ /* Round 2 */
- GG (d, a, b, c, x[ 6], 9, 0xc040b340); /* 18 */
- GG (c, d, a, b, x[11], 14, 0x265e5a51); /* 19 */
- GG (b, c, d, a, x[ 0], 20, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, x[ 5], 5, 0xd62f105d); /* 21 */
- GG (d, a, b, c, x[10], 9, 0x02441453); /* 22 */
- GG (c, d, a, b, x[15], 14, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, x[ 4], 20, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, x[ 9], 5, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, x[14], 9, 0xc33707d6); /* 26 */
- GG (c, d, a, b, x[ 3], 14, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, x[ 8], 20, 0x455a14ed); /* 28 */
- GG (a, b, c, d, x[13], 5, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, x[ 2], 9, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, x[ 7], 14, 0x676f02d9); /* 31 */
- GG (b, c, d, a, x[12], 20, 0x8d2a4c8a); /* 32 */
-
- HH (a, b, c, d, x[ 5], 4, 0xfffa3942); /* 33 */ /* Round 3 */
- HH (d, a, b, c, x[ 8], 11, 0x8771f681); /* 34 */
- HH (c, d, a, b, x[11], 16, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, x[14], 23, 0xfde5380c); /* 36 */
- HH (a, b, c, d, x[ 1], 4, 0xa4beea44); /* 37 */
- HH (d, a, b, c, x[ 4], 11, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, x[ 7], 16, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, x[10], 23, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, x[13], 4, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, x[ 0], 11, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, x[ 3], 16, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, x[ 6], 23, 0x04881d05); /* 44 */
- HH (a, b, c, d, x[ 9], 4, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, x[12], 11, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, x[15], 16, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, x[ 2], 23, 0xc4ac5665); /* 48 */
-
- II (a, b, c, d, x[ 0], 6, 0xf4292244); /* 49 */ /* Round 4 */
- II (d, a, b, c, x[ 7], 10, 0x432aff97); /* 50 */
- II (c, d, a, b, x[14], 15, 0xab9423a7); /* 51 */
- II (b, c, d, a, x[ 5], 21, 0xfc93a039); /* 52 */
- II (a, b, c, d, x[12], 6, 0x655b59c3); /* 53 */
- II (d, a, b, c, x[ 3], 10, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, x[10], 15, 0xffeff47d); /* 55 */
- II (b, c, d, a, x[ 1], 21, 0x85845dd1); /* 56 */
- II (a, b, c, d, x[ 8], 6, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, x[15], 10, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, x[ 6], 15, 0xa3014314); /* 59 */
- II (b, c, d, a, x[13], 21, 0x4e0811a1); /* 60 */
- II (a, b, c, d, x[ 4], 6, 0xf7537e82); /* 61 */
- II (d, a, b, c, x[11], 10, 0xbd3af235); /* 62 */
- II (c, d, a, b, x[ 2], 15, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, x[ 9], 21, 0xeb86d391); /* 64 */
-
- state[0] = a = a + state[0];
- state[1] = b = b + state[1];
- state[2] = c = c + state[2];
- state[3] = d = d + state[3];
-
- in += 64;
- }
-}
-
-
-/*
- MD5 block update operation:
- Process another sub-string of the message and update the context.
-*/
-void MD5Update (MD5_CTX *context, const uint8_t *input, size_t inputBytes) {
- int i;
- int byteIndex;
- unsigned int partLen;
- int len;
-
- /* Compute number of bytes mod 64 */
- byteIndex = (context->count[0] >> 3) & 0x3F;
-
- /* Update number of bits: count += 8 * inputBytes */
- if ((context->count[0] += inputBytes << 3) < (inputBytes << 3))
- context->count[1]++;
- context->count[1] += (inputBytes >> (32-3));
-
- partLen = (64 - byteIndex);
-
- /* Transform as many times as possible. */
- if (inputBytes >= partLen) {
- memcpy (context->buffer + byteIndex, input, partLen);
- __MD5Transform (context->state, (const uint8_t *) context->buffer, 1);
- len = (inputBytes - partLen) / 64;
- __MD5Transform (context->state, &input[partLen], len);
- i = partLen + 64 * len;
- byteIndex = 0;
- } else
- i = 0;
-
- /* Buffer remaining input */
- memcpy (&context->buffer[byteIndex], &input[i], inputBytes - i);
-}
-
-#endif
-
-
-void MD5Final (uint8_t digest[16], MD5_CTX* context) {
- static uint8_t finalBlock[64];
-
- uint32_t bits[2];
- int byteIndex;
- int finalBlockLength;
-
- byteIndex = (context->count[0] >> 3) & 0x3F;
- finalBlockLength = ((byteIndex < 56) ? 56 : 120) - byteIndex;
- finalBlock[0] = 0x80;
-
-#if (__BYTE_ORDER == __BIG_ENDIAN)
- CopyToLittleEndian (bits, (const uint8_t *) context->count, 2);
-#else
- memcpy(bits, context->count, 8);
-#endif
-
- MD5Update (context, finalBlock, finalBlockLength);
- MD5Update (context, (const uint8_t *) bits, 8);
-
-#if (__BYTE_ORDER == __BIG_ENDIAN)
- CopyToLittleEndian ((uint32_t *) digest, (const uint8_t *) context->state, 4);
-#else
- memcpy (digest, context->state, 16);
-#endif
-
- memset(context, 0, sizeof(*context));
-}
-
diff --git a/mdk-stage1/dietlibc/libcrypt/md5crypt.c b/mdk-stage1/dietlibc/libcrypt/md5crypt.c
deleted file mode 100644
index ebbb4be44..000000000
--- a/mdk-stage1/dietlibc/libcrypt/md5crypt.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* $OpenBSD: md5crypt.c,v 1.9 1997/07/23 20:58:27 kstailey Exp $ */
-
-/*
- * ----------------------------------------------------------------------------
- * "THE BEER-WARE LICENSE" (Revision 42):
- * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
- * can do whatever you want with this stuff. If we meet some day, and you think
- * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
- * ----------------------------------------------------------------------------
- *
- * $FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp $
- *
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.9 1997/07/23 20:58:27 kstailey Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <md5.h>
-
-static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
- "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
-
-static void to64 (char *, uint32_t, int);
-
-static void
-to64(s, v, n)
- char *s;
- uint32_t v;
- int n;
-{
- while (--n >= 0) {
- *s++ = itoa64[v&0x3f];
- v >>= 6;
- }
-}
-
-/*
- * UNIX password
- *
- * Use MD5 for what it is best at...
- */
-
-char *
-md5crypt(pw, salt)
- register const char *pw;
- register const char *salt;
-{
- /*
- * This string is magic for this algorithm. Having
- * it this way, we can get get better later on
- */
- static unsigned char *magic = (unsigned char *)"$1$";
-
- static char passwd[120], *p;
- static const unsigned char *sp,*ep;
- unsigned char final[16];
- int sl,pl,i;
- MD5_CTX ctx,ctx1;
- uint32_t l;
-
- /* Refine the Salt first */
- sp = (const unsigned char *)salt;
-
- /* If it starts with the magic string, then skip that */
- if(!strncmp((const char *)sp,(const char *)magic,strlen((const char *)magic)))
- sp += strlen((const char *)magic);
-
- /* It stops at the first '$', max 8 chars */
- for(ep=sp;*ep && *ep != '$' && ep < (sp+8);ep++)
- continue;
-
- /* get the length of the true salt */
- sl = ep - sp;
-
- MD5Init(&ctx);
-
- /* The password first, since that is what is most unknown */
- MD5Update(&ctx,(const unsigned char *)pw,strlen(pw));
-
- /* Then our magic string */
- MD5Update(&ctx,magic,strlen((const char *)magic));
-
- /* Then the raw salt */
- MD5Update(&ctx,sp,sl);
-
- /* Then just as many characters of the MD5(pw,salt,pw) */
- MD5Init(&ctx1);
- MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
- MD5Update(&ctx1,sp,sl);
- MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
- MD5Final(final,&ctx1);
- for(pl = strlen(pw); pl > 0; pl -= 16)
- MD5Update(&ctx,final,pl>16 ? 16 : pl);
-
- /* Don't leave anything around in vm they could use. */
- memset(final,0,sizeof final);
-
- /* Then something really weird... */
- for (i = strlen(pw); i ; i >>= 1)
- if(i&1)
- MD5Update(&ctx, final, 1);
- else
- MD5Update(&ctx, (const unsigned char *)pw, 1);
-
- /* Now make the output string */
- strcpy(passwd,(const char *)magic);
- memcpy(passwd+3,sp,sl);
- passwd[sl+3]='$';
- passwd[sl+4]=0;
-
- MD5Final(final,&ctx);
-
- /*
- * and now, just to make sure things don't run too fast
- * On a 60 Mhz Pentium this takes 34 msec, so you would
- * need 30 seconds to build a 1000 entry dictionary...
- */
- for(i=0;i<1000;i++) {
- MD5Init(&ctx1);
- if(i & 1)
- MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
- else
- MD5Update(&ctx1,final,16);
-
- if(i % 3)
- MD5Update(&ctx1,sp,sl);
-
- if(i % 7)
- MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
-
- if(i & 1)
- MD5Update(&ctx1,final,16);
- else
- MD5Update(&ctx1,(const unsigned char *)pw,strlen(pw));
- MD5Final(final,&ctx1);
- }
-
- p = passwd + strlen(passwd);
-
- l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4;
- l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4;
- l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4;
- l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4;
- l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4;
- l = final[11] ; to64(p,l,2); p += 2;
- *p = '\0';
-
- /* Don't leave anything around in vm they could use. */
- memset(final,0,sizeof final);
-
- return passwd;
-}
-
diff --git a/mdk-stage1/dietlibc/libdl/Makefile b/mdk-stage1/dietlibc/libdl/Makefile
deleted file mode 100644
index 29164f105..000000000
--- a/mdk-stage1/dietlibc/libdl/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-# local "test" make file
-
-CC = gcc
-DCC = diet $(CC)
-
-SRC = $(wildcard *.c) # test/test.c
-OBJ = _dl_jump.o $(SRC:.c=.o)
-
-#CFLAGS = -Wall -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -g -O
-CFLAGS = -Wall -O2 -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -frerun-loop-opt -fschedule-insns2 $(DEB) # -fomit-frame-pointer
-
-%.o : %.S
- $(DCC) $(CFLAGS) -c -o $@ $^
-
-%.o : %.c
- $(DCC) $(CFLAGS) -c -o $@ $^
-
-it: t.out
-
-a.out: t.out
- gcc -O -g test/a.c t.out -L/opt/diet/lib-i386 -lc -lgcc -o $@ -Wl,-dynamic-linker=`pwd`/t.out -nostdlib
-
-t.out: _dl_main.o
- ld -shared -o $@ $? -soname=libdl.so
-
-all: test.out libdl.a
-
-libdl.a: $(OBJ)
- ar cru $@ $^
-
-test.g: test/test.c
- gcc -o $@ $^ -ldl
-
-test.out: $(OBJ) test/test.o
- diet gcc -o $@ $^
-
-clean:
- $(RM) *.o *.a *.out *~ # *.so
diff --git a/mdk-stage1/dietlibc/libdl/README b/mdk-stage1/dietlibc/libdl/README
deleted file mode 100644
index 6f1d0e46e..000000000
--- a/mdk-stage1/dietlibc/libdl/README
+++ /dev/null
@@ -1,82 +0,0 @@
-this is the experimental libdl
-
-written by Olaf Dreesen
-
-Fri Nov 15 16:23:28 CET 2002
-
- fixing the copy-relocation bug.
-
- TODO as last time.... plus
- - dlsym with RTLD_NEXT
-
-Wed Nov 6 19:08:00 CET 2002
-
- Ups.. misunderstood the manual-page of dlopen.
- now dlopen(0,...) works the way it is described in the susv2, BUT still not
- complete.
-
- TODO:
- - gdb support
-
- - RTLD_GLOBAL/RTLD_LOCAL
- at the moment ALL are GLOBAL.
-
- - open of a shared object ONCE
- there is no library hard-, symlink detection yet.
-
- - code for other archs then i386 and arm
-
-
-Fri Sep 13 16:28:42 CEST 2002
-
- this unified libdl/dynlinker is now the default.
-
-
-Mon Mar 11 19:44:20 CET 2002
-
- the unified libdl/dynlinker now seems to stand the NORMAL usage so I think
- it should be tested outside my CLEANROOM :)
-
- TODO: code for other archs than i386 and arm
-
-
-Thu Nov 1 18:41:36 MET 2001
-
- ufffff.... now the libdl code can be used in the libdl.so :)
- Status: it works in my clean room on i386, arm-code started
-
- TODO: see below :)
-
-
-Wed Jul 4 11:55:00 MEST 2001
-
- Uwe Ohse pointed to some flaws in my code, I have started to fix them....
-
- TODO: rebuild the code in a more readable and consistent way.
- TODO: code for other archs than i386
-
-
-Thu Jun 21 15:32:45 MEST 2001
-
- It work good enough to make a libdietc.so possible.
-
- TODO: rebuild the code in a more readable and consistent way.
- TODO: code for other archs than i386
-
-
-Thu Jun 7 14:10:03 MEST 2001
-
- Status: test-pre-alpha code
- the code is now "testable" ...
- I need a dyn-dietlibc specific ld.so. (in work)
-
- TODO: rebuild the code in a more readable and consistent way.
-
-
-INITIAL May ? :
-
- Status: test-pre-pre-alpha code
-
- Shouldn't work yet. Had and have some problems with the elf specs...
- and more inconsistencies...
-
diff --git a/mdk-stage1/dietlibc/libdl/_dl_alloc.c b/mdk-stage1/dietlibc/libdl/_dl_alloc.c
deleted file mode 100644
index 41d0d4671..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_alloc.c
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include "_dl_int.h"
-
-#ifdef __DIET_LD_SO__
-static struct _dl_handle*_dl_root_handle=(struct _dl_handle*)0;
-static struct _dl_handle*_dl_top_handle=(struct _dl_handle*)0;
-static struct _dl_handle*_dl_free_list=(struct _dl_handle*)0;
-#else
-struct _dl_handle*_dl_root_handle=(struct _dl_handle*)0;
-struct _dl_handle*_dl_top_handle=(struct _dl_handle*)0;
-struct _dl_handle*_dl_free_list=(struct _dl_handle*)0;
-#endif
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void _dl_free_handle(struct _dl_handle*dh) {
- if (_dl_root_handle==dh) _dl_root_handle=dh->next;
- if (_dl_top_handle ==dh) _dl_top_handle=dh->prev;
-
- if (dh->next) dh->next->prev=dh->prev;
- if (dh->prev) dh->prev->next=dh->next;
-
- if ((dh->flags&RTLD_NOSONAME) && dh->name) free(dh->name);
- memset(dh,0,sizeof(struct _dl_handle));
- dh->next=_dl_free_list;
- _dl_free_list=dh;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-struct _dl_handle*_dl_get_handle() {
- struct _dl_handle*tmp;
-
- if (_dl_free_list==0) {
- register int i,m;
-#ifdef __DIET_LD_SO__
- tmp = (struct _dl_handle*)_dl_sys_mmap(0,at_pagesize,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
- m=at_pagesize/sizeof(struct _dl_handle);
-#else
- int ps=getpagesize();
- tmp = (struct _dl_handle*)mmap(0,ps,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
- m=ps/sizeof(struct _dl_handle);
-#endif
- for (i=m;i;) _dl_free_handle(tmp+(--i));
- }
-
- tmp = _dl_free_list;
- _dl_free_list = tmp->next;
-
- tmp->next=0;
- if (_dl_root_handle) {
- _dl_top_handle->next=tmp;
- tmp->prev=_dl_top_handle;
- } else
- _dl_root_handle = tmp;
-
- _dl_top_handle=tmp;
-
- return tmp;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-struct _dl_handle*_dl_find_lib(const char* name) {
- if (name) {
- if (_dl_root_handle) {
- struct _dl_handle*tmp;
- for (tmp=_dl_root_handle;tmp;tmp=tmp->next) {
- if (!tmp->name) continue;
- if (!strcmp(tmp->name,name)) return tmp;
- }
- }
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libdl/_dl_int.h b/mdk-stage1/dietlibc/libdl/_dl_int.h
deleted file mode 100644
index 1bab10a92..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_int.h
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef ___DL_INT_H__
-#define ___DL_INT_H__
-
-#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__)
-#define ELF_CLASS ELFCLASS64
-#else
-#define ELF_CLASS ELFCLASS32
-#endif
-
-#include <elf.h>
-#include <dlfcn.h>
-
-#include "_dl_rel.h"
-
-#if ELF_CLASS == ELFCLASS32
-
-#define Elf_Addr Elf32_Addr
-
-#define Elf_Dyn Elf32_Dyn
-#define Elf_Ehdr Elf32_Ehdr
-#define Elf_Phdr Elf32_Phdr
-#define Elf_Rel Elf32_Rel
-#define Elf_Rela Elf32_Rela
-#define Elf_Sym Elf32_Sym
-
-#define ELF_R_SYM(x) ELF32_R_SYM((x))
-#define ELF_R_TYPE(x) ELF32_R_TYPE((x))
-
-#define ELF_ST_BIND(x) ELF32_ST_BIND((x))
-#define ELF_ST_TYPE(x) ELF32_ST_TYPE((x))
-
-#else
-
-#define Elf_Addr Elf64_Addr
-
-#define Elf_Dyn Elf64_Dyn
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Phdr Elf64_Phdr
-#define Elf_Rel Elf64_Rel
-#define Elf_Rela Elf64_Rela
-#define Elf_Sym Elf64_Sym
-
-#define ELF_R_SYM(x) ELF64_R_SYM((x))
-#define ELF_R_TYPE(x) ELF64_R_TYPE((x))
-
-#define ELF_ST_BIND(x) ELF64_ST_BIND((x))
-#define ELF_ST_TYPE(x) ELF64_ST_TYPE((x))
-
-#endif
-
-//#define DEBUG
-#ifdef DEBUG
-#ifndef __DIET_LD_SO__
-#include <stdio.h>
-#define pf(s) write(2,s,strlen(s))
-#define ph(l) fdprintf(2,"%08lx",(l))
-#endif
-#endif
-
-#define RTLD_USER 0x10000000
-#define RTLD_NOSONAME 0x20000000
-#define LDSO_FLAGS (RTLD_LAZY|RTLD_GLOBAL|RTLD_NOSONAME)
-
-struct _dl_handle {
- char * mem_base; /* base address of maped *.so / or zero if program | Elf_Addr l_addr */
- char * l_name; /* Abloslute filename of this object */
- Elf_Dyn* dynamic; /* _DYNAMIC */
-
- struct _dl_handle *next;
- struct _dl_handle *prev;
-
- unsigned int flags; /* FLAGS */
-
- char * name; /* name of shared object */
-
- /* basic */
- unsigned long mem_size; /* len of mem block */
- unsigned long lnk_count; /* reference count (other libraries) */
-
- /* lazy evaluator data */
- unsigned long*pltgot; /* PLT/GOT */
-
- /* symbol resolve helper */
- unsigned long*hash_tab; /* hash table */
- char * dyn_str_tab; /* dyn_name table */
- Elf_Sym * dyn_sym_tab; /* dynamic symbol table */
- _dl_rel_t* plt_rel; /* PLT relocation table */
-
- /* INIT / FINI */
- void (*fini)(void);
-};
-
-/* debug communication (GDB) (dyn-linker only) */
-struct r_debug {
- int r_version;
- struct _dl_handle* r_map;
- unsigned long r_brk;
- enum {
- RT_CONSISTENT, /* mapping complete */
- RT_ADD, /* begin add object */
- RT_DELETE, /* begin del object */
- } r_state;
- unsigned long r_ldbase;
-};
-
-#define HASH_BUCKET_LEN(p) (*((p)))
-#define HASH_BUCKET(p) ((p)+2)
-
-#define HASH_CHAIN_LEN(p) (*((p)+1))
-#define HASH_CHAIN(p) ((p)+2+HASH_BUCKET_LEN(p))
-
-/* _dl_alloc.c */
-extern struct _dl_handle* _dl_root_handle;
-extern struct _dl_handle* _dl_top_handle;
-extern struct _dl_handle* _dl_free_list;
-#ifndef __DIET_LD_SO__
-void _dl_free_handle(struct _dl_handle* dh);
-struct _dl_handle* _dl_get_handle();
-struct _dl_handle* _dl_find_lib(const char* name);
-
-/* _dl_open.c */
-void *_dl_open(const char* filename, int flags);
-
-/* _dl_load.c */
-void *_dl_load(const char* filename, const char*pathname, int fd, int flags);
-struct _dl_handle* _dl_dyn_scan(struct _dl_handle* dh, void* dyn_addr, int flags);
-
-/* _dl_search.c */
-void _dl_set_rpath(const char *path);
-const char* _dl_get_rpath();
-int _dl_search(char *buf, int len, const char *filename);
-
-/* dlsym.c */
-void *_dlsym(void*dh,char*symbol);
-void *_dl_sym_search_str(struct _dl_handle*h,char*name);
-void *_dl_sym(struct _dl_handle * h, int symbol);
-
-/* _dl_queue.c */
-int _dl_queue_lib(const char* name, int flags);
-int _dl_open_dep();
-
-/* _dl_relocate.c */
-int _dl_relocate(struct _dl_handle* dh, _dl_rel_t *rel, int num);
-
-/* dlerror.c */
-extern unsigned int _dl_error;
-extern const char* _dl_error_location;
-extern const char* _dl_error_data;
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/libdl/_dl_jump.S b/mdk-stage1/dietlibc/libdl/_dl_jump.S
deleted file mode 100644
index bd7115258..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_jump.S
+++ /dev/null
@@ -1,55 +0,0 @@
-.text
-.global _dl_jump
-_dl_jump:
-
-#ifdef __i386__
-.type _dl_jump,@function
-
- pushl %eax # save register args...
- pushl %ecx
- pushl %edx
-
- pushl %ebx
-
- pushl 20(%esp) # 2. arg from plt
- pushl 20(%esp) # 1. arg from plt
-
-#ifdef __DYN_LIB
- call 1f
-1: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b],%ebx
- call do_rel@PLT
-#else
- call do_rel
-#endif
- addl $8, %esp
-
- popl %ebx
-
- popl %edx # restore register args...
- popl %ecx
-
- xchgl %eax, (%esp) # restore eax and save function pointer (for return)
-
- ret $8 # remove arguments from plt and jump to REAL function
-
-#endif
-
-#ifdef __arm__
-.type _dl_jump,function
-
- stmdb sp!, {r0, r1, r2, r3}
- sub r1, ip, lr
- sub r1, r1, #4
- add r1, r1, r1 /* dyntab entry */
- ldr r0, [lr, #-4] /* dynlib handle */
-#ifdef __DYN_LIB
- bl do_rel(PLT)
-#else
- bl do_rel
-#endif
- mov r12, r0
- ldmia sp!, {r0, r1, r2, r3, lr}
- mov pc, r12
-
-#endif
diff --git a/mdk-stage1/dietlibc/libdl/_dl_load.c b/mdk-stage1/dietlibc/libdl/_dl_load.c
deleted file mode 100644
index 49e8db0be..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_load.c
+++ /dev/null
@@ -1,401 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <dlfcn.h>
-#include <elf.h>
-
-#include "_dl_int.h"
-
-#define _ELF_DWN_ROUND(ps,n) ((n)&(~((ps)-1)))
-#define _ELF_UP_ROUND(ps,n) ((((n)&((ps)-1))?(ps):0)+ _ELF_DWN_ROUND((ps),(n)))
-#define _ELF_RST_ROUND(ps,n) ((n)&((ps)-1))
-
-/* this is an arch specific "return jump" for the relocation */
-void _dl_jump();
-
-/*
- * this file is a Q. & D. hack ... don't think this is bug free or meaningfull
- */
-
-static inline int map_flags(int flags)
-{
- int perm = 0;
- if (flags & PF_X) perm|=PROT_EXEC;
- if (flags & PF_R) perm|=PROT_READ;
- if (flags & PF_W) perm|=PROT_WRITE;
- return perm;
-}
-
-static inline void *do_map_in(void *base, unsigned long length, int flags, int fd, unsigned long offset)
-{
- register int op = MAP_PRIVATE;
- if (base) op|=MAP_FIXED;
- return mmap(base, length, map_flags(flags), op, fd, offset);
-}
-
-static struct _dl_handle *_dl_map_lib(const char*fn, const char*pathname, int fd, int flags)
-{
- struct _dl_handle* ret=0;
- int ps=getpagesize();
- int i;
- unsigned char buf[1024];
- char *m=0,*d=0;
-
- unsigned long l;
- struct stat st;
-
- Elf_Ehdr *eh;
- Elf_Phdr *ph;
-
- int ld_nr=0;
- Elf_Phdr **ld=0;
- Elf_Phdr *dyn=0;
-
- if (fd==-1) return 0;
-
-#ifdef DEBUG
- pf(__func__": "); pf(pathname); pf("\n");
-#endif
-
- if (fstat(fd,&st)<0) {
- close(fd);
- _dl_error=2;
- return 0;
- }
- else {
- // use st_dev and st_ino for identification
- }
-
- if (read(fd, buf, 1024)<128) {
- close(fd);
- _dl_error=2;
- return 0;
- }
-
- eh=(Elf_Ehdr*)buf;
- ph=(Elf_Phdr*)&buf[eh->e_phoff];
-
- for (i=0; i<eh->e_phnum; i++) {
- if (ph[i].p_type==PT_LOAD) ++ld_nr;
- }
- ld=alloca(ld_nr*sizeof(Elf_Phdr));
-
- for (ld_nr=i=0; i<eh->e_phnum; i++) {
- if (ph[i].p_type==PT_LOAD) {
- ld[ld_nr++]=ph+i;
- }
- if (ph[i].p_type==PT_DYNAMIC) {
- dyn=ph+i;
- }
- }
-
- if (ld_nr==1) {
- unsigned long offset = _ELF_DWN_ROUND(ps,ld[0]->p_offset);
- unsigned long off = _ELF_RST_ROUND(ps,ld[0]->p_offset);
- unsigned long length = _ELF_UP_ROUND(ps,ld[0]->p_memsz+off);
- ret = _dl_get_handle();
-
- m = (char*)do_map_in(0, length, ld[0]->p_flags, fd, offset);
- if (m==MAP_FAILED) { _dl_free_handle(ret); close(fd); return 0; }
-
- /* zero pad bss */
- l = ld[0]->p_offset+ld[0]->p_filesz;
- memset(m+l,0,length-l);
-
- ret->mem_base=m;
- ret->mem_size=length;
- }
- else if (ld_nr==2) { /* aem... yes Quick & Really Dirty / for the avarage 99% */
-// unsigned long text_addr = _ELF_DWN_ROUND(ps,ld[0]->p_vaddr); /* do we need this ? */
- unsigned long text_offset = _ELF_DWN_ROUND(ps,ld[0]->p_offset);
- unsigned long text_off = _ELF_RST_ROUND(ps,ld[0]->p_offset);
- unsigned long text_size = _ELF_UP_ROUND(ps,ld[0]->p_memsz+text_off);
-
- unsigned long data_addr = _ELF_DWN_ROUND(ps,ld[1]->p_vaddr);
- unsigned long data_offset = _ELF_DWN_ROUND(ps,ld[1]->p_offset);
- unsigned long data_off = _ELF_RST_ROUND(ps,ld[1]->p_offset);
- unsigned long data_size = _ELF_UP_ROUND(ps,ld[1]->p_memsz+data_off);
- unsigned long data_fsize = _ELF_UP_ROUND(ps,ld[1]->p_filesz+data_off);
-
- ret = _dl_get_handle();
- /* mmap all mem_blocks for *.so */
- m = (char*) do_map_in(0,text_size+data_size,ld[0]->p_flags,fd,text_offset);
- if (m==MAP_FAILED) { _dl_free_handle(ret); close(fd); return 0; }
-
- /* release data,bss part */
- mprotect(m+data_addr, data_size, PROT_NONE);
-
- /* mmap data,bss part */
- d = (char*) do_map_in(m+data_addr,data_fsize,ld[1]->p_flags,fd,data_offset);
-
- /* zero pad bss */
- l = data_off+ld[1]->p_filesz;
- memset(d+l,0,data_fsize-l);
-
- /* more bss ? */
- if (data_size>data_fsize) {
- l = data_size-data_fsize;
- mmap(d+data_fsize, l, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0);
- }
-
- ret->mem_base=m;
- ret->mem_size=text_size+data_size;
- }
-
- if (ret) {
- ret->lnk_count=1;
- ret->name=strdup(fn);
- ret->dyn_str_tab=(char*)m+dyn->p_vaddr; /* missuse of field */
- }
-
- close(fd);
- return ret;
-}
-
-/* local alias */
-static struct _dl_handle* __dl_dyn_scan(struct _dl_handle* dh, void* dyn_addr, int flags)
-__attribute__ ((alias("_dl_dyn_scan")));
-
-struct _dl_handle* _dl_dyn_scan(struct _dl_handle* dh, void* dyn_addr, int flags)
-{
- Elf_Dyn* dyn_tab = dyn_addr;
-
- void (*init)()=0;
- unsigned long* got=0;
- void* jmprel=0;
- int pltreltype=0;
- int pltrelsize=0;
- unsigned long rel=0;
- int relent=0;
- int relsize=0;
-
- int i;
-
-#ifdef DEBUG
- pf(__func__": pre dynamic scan "); ph((unsigned long)dh); pf("\n");
-#endif
- dh->dyn_str_tab=0;
- dh->flags=flags;
-
- for(i=0;dyn_tab[i].d_tag;i++) {
-// DEBUG(printf("_dl_load dyn %d, %08lx\n",dyn_tab[i].d_tag, dyn_tab[i].d_un.d_val);)
- if (dyn_tab[i].d_tag==DT_HASH) {
- dh->hash_tab = (unsigned long*)(dh->mem_base+dyn_tab[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__func__": have hash @ "); ph((long)dh->hash_tab); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_SYMTAB) {
- dh->dyn_sym_tab = (Elf_Sym*)(dh->mem_base+dyn_tab[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__func__": have dyn_sym_tab @ "); ph((long)dh->dyn_sym_tab); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_STRTAB) {
- dh->dyn_str_tab = (char*)(dh->mem_base+dyn_tab[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__func__": have dyn_str_tab @ "); ph((long)dh->dyn_str_tab); pf("\n");
-#endif
- }
-
- /* INIT / FINI */
- else if (dyn_tab[i].d_tag==DT_FINI) {
- dh->fini = (void(*)(void))(dh->mem_base+dyn_tab[i].d_un.d_val);
-#ifdef DEBUG
- pf(__func__": have fini @ "); ph((long)dh->fini); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_INIT) {
- init = (void(*)(void))(dh->mem_base+dyn_tab[i].d_un.d_val);
-#ifdef DEBUG
- pf(__func__": have init @ "); ph((long)init); pf("\n");
-#endif
- }
-
- /* PLT / Relocation entries for PLT in GOT */
- else if (dyn_tab[i].d_tag==DT_PLTGOT) {
- got=(unsigned long*)(dh->mem_base+dyn_tab[i].d_un.d_val);
- dh->pltgot=got;
-#ifdef DEBUG
- pf(__func__": have plt got @ "); ph((long)dh->pltgot); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_PLTREL) {
- pltreltype=dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__func__": have pltreltype @ "); ph((long)pltreltype); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_PLTRELSZ) {
- pltrelsize=dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__func__": have pltrelsize @ "); ph((long)pltrelsize); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_JMPREL) {
- jmprel=(dh->mem_base+dyn_tab[i].d_un.d_val);
- dh->plt_rel=jmprel;
-#ifdef DEBUG
- pf(__func__": have jmprel @ "); ph((long)jmprel); pf("\n");
-#endif
- }
-
- /* Relocation */
- else if (dyn_tab[i].d_tag==DT_REL) {
- rel=(unsigned long)(dh->mem_base+dyn_tab[i].d_un.d_val);
-#ifdef DEBUG
- pf(__func__": have rel @ "); ph((long)rel); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_RELENT) {
- relent=dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__func__": have relent @ "); ph((long)relent); pf("\n");
-#endif
- }
- else if (dyn_tab[i].d_tag==DT_RELSZ) {
- relsize=dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__func__": have relsize @ "); ph((long)relsize); pf("\n");
-#endif
- }
-
- else if (dyn_tab[i].d_tag==DT_TEXTREL) {
- _dl_free_handle(dh);
- _dl_error = 3;
- return 0;
- }
- }
- /* extra scan for rpath (if program) ... */
- if (dh->name==0) {
- for(i=0;dyn_tab[i].d_tag;i++) {
- if (dyn_tab[i].d_tag==DT_RPATH) {
- char *rpath=dh->dyn_str_tab+dyn_tab[i].d_un.d_val;
- _dl_set_rpath(rpath);
-#ifdef DEBUG
- pf(__func__": have runpath: "); pf(rpath); pf("\n");
-#endif
- }
- }
- }
-
-#ifdef DEBUG
- pf(__func__": post dynamic scan "); ph((unsigned long)dh); pf("\n");
-#endif
-
- if ((got=_dlsym(dh,"_GLOBAL_OFFSET_TABLE_"))) {
-#ifdef DEBUG
- pf(__func__": found a GOT @ "); ph((unsigned long)got); pf("\n");
-#endif
- /* GOT */
- got[0]+=(unsigned long)dh->mem_base; /* reloc dynamic pointer */
- got[1] =(unsigned long)dh;
- got[2] =(unsigned long)(_dl_jump); /* sysdep jump to _dl_rel */
- /* */
- }
- else {
- if (dh) {
- munmap(dh->mem_base,dh->mem_size);
- _dl_free_handle(dh);
- }
- _dl_error = 3;
- return 0;
- }
-
- /* load other libs */
- for(i=0;dyn_tab[i].d_tag;i++) {
- if (dyn_tab[i].d_tag==DT_NEEDED) {
- char *lib_name=dh->dyn_str_tab+dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__func__": needed for this lib: "); pf(lib_name); pf("\n");
-#endif
- _dl_queue_lib(lib_name,flags);
- }
- }
-
- if (_dl_open_dep()) {
- _dl_error = 1;
- return 0;
- }
-
- /* relocate */
- if (rel) {
-#ifdef DEBUG
- pf(__func__": try to relocate some values\n");
-#endif
- if (_dl_relocate(dh,(Elf_Rel*)rel,relsize/relent)) {
- munmap(dh->mem_base,dh->mem_size);
- _dl_free_handle(dh);
- return 0;
- }
- }
-
- /* do PTL / GOT relocation */
- if (pltreltype == DT_REL) {
- Elf_Rel *tmp = jmprel;
-#ifdef DEBUG
- pf(__func__": rel got\n");
-#endif
- for (;(char*)tmp<(((char*)jmprel)+pltrelsize);(char*)tmp=((char*)tmp)+sizeof(Elf_Rel)) {
- if ((flags&RTLD_NOW)) {
- unsigned long sym=(unsigned long)_dl_sym(dh,ELF_R_SYM(tmp->r_info));
- if (sym) *((unsigned long*)(dh->mem_base+tmp->r_offset))=sym;
- else {
- _dl_free_handle(dh);
- _dl_error = 4;
- return 0;
- }
- }
- else
- *((unsigned long*)(dh->mem_base+tmp->r_offset))+=(unsigned long)dh->mem_base;
-#if 0
- DEBUG("_dl_load rel @ %08lx with type %d -> %d\n",(long)dh->mem_base+tmp->r_offset,ELF_R_TYPE(tmp->r_info),ELF_R_SYM(tmp->r_info));
- DEBUG("_dl_load -> %08lx\n",*((unsigned long*)(dh->mem_base+tmp->r_offset)));
-#endif
- }
- }
- if (pltreltype == DT_RELA) {
- Elf_Rela *tmp = jmprel;
-#ifdef DEBUG
- pf(__func__": rela got\n");
-#endif
- for (;(char*)tmp<(((char*)jmprel)+pltrelsize);(char*)tmp=((char*)tmp)+sizeof(Elf_Rela)) {
- if ((flags&RTLD_NOW)) {
- unsigned long sym=(unsigned long)_dl_sym(dh,ELF_R_SYM(tmp->r_info));
- if (sym) *((unsigned long*)(dh->mem_base+tmp->r_offset))=sym;
- else {
- _dl_free_handle(dh);
- _dl_error = 4;
- return 0;
- }
- }
- else
- *((unsigned long*)(dh->mem_base+tmp->r_offset))=(unsigned long)(dh->mem_base+tmp->r_addend);
-#if 0
- DEBUG("_dl_load rela @ %08lx with type %d -> %d\n",(long)dh->mem_base+tmp->r_offset,ELF_R_TYPE(tmp->r_info),ELF_R_SYM(tmp->r_info));
- DEBUG("_dl_load -> %08lx\n",*((unsigned long*)(dh->mem_base+tmp->r_offset)));
-#endif
- }
- }
-
- /* _dl_load depending libs ... */
-#ifdef DEBUG
- pf(__func__": post resolve, pre init\n");
-#endif
- if (init) init();
-#ifdef DEBUG
- pf(__func__": post init\n");
-#endif
-
- return dh;
-}
-
-void *_dl_load(const char*fn, const char*pathname, int fd, int flags)
-{
- struct _dl_handle* ret=0;
- if ((ret=_dl_map_lib(fn,pathname,fd,flags))) {
- ret=__dl_dyn_scan(ret,(void*)(ret->dyn_str_tab),flags);
- }
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/libdl/_dl_main.c b/mdk-stage1/dietlibc/libdl/_dl_main.c
deleted file mode 100644
index 8ecf44f0b..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_main.c
+++ /dev/null
@@ -1,1059 +0,0 @@
-#ifdef __OD_CLEAN_ROOM
-
-#define __DIET_LD_SO__
-
-/*
- * this is the dietlibc libdl & dynamic-linker
- *
- * NEED to be compiled with -fPIC ...
- */
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include "_dl_int.h"
-#include "_dl_rel.h"
-
-void _start(void); /* entry of lib... */
-
-static void (*fini_entry)(void)=0;
-static char **_dl_environ=0;
-static unsigned long loadaddr=0;
-static unsigned long prog_entry=0;
-
-static Elf_Phdr*prog_ph;
-static unsigned long prog_ph_size;
-static unsigned long prog_ph_num;
-
-static unsigned long at_uid;
-static unsigned long at_euid;
-static unsigned long at_gid;
-static unsigned long at_egid;
-static unsigned long at_pagesize;
-
-/* this are the "local syscalls" */
-void _dl_sys_exit(int val);
-int _dl_sys_read(int fd,char*buf,unsigned long len);
-int _dl_sys_write(int fd,char*buf,unsigned long len);
-int _dl_sys_open(const char*filename,int flags,int mode);
-int _dl_sys_close(int fd);
-void*_dl_sys_mmap(void*start,unsigned long length,int prot,int flags,int fd,unsigned long offset);
-int _dl_sys_munmap(void*start,unsigned long length);
-int _dl_sys_mprotect(const void*addr,unsigned long len,int prot);
-int _dl_sys_fstat(int filedes, struct stat *buf);
-
-extern char*strdup(const char*s);
-
-#ifdef __i386__
-
-asm(".text \n"
-".type _start,@function \n"
-"_start: \n"
-" movl %esp, %ebp # save stack \n"
-" movl (%ebp), %ecx # argc \n"
-" leal 4(%ebp), %esi # argv \n"
-" leal 4(%esi,%ecx,4), %eax # envp \n"
-
-"# PIC code \n"
-" call getpic \n"
-" addl $_GLOBAL_OFFSET_TABLE_, %ebx \n"
-
-"# for calculation of load addr, get 'relocated' address of _DYNAMIC \n"
-" leal _DYNAMIC@GOTOFF(%ebx), %edx \n"
-
-"# put parameter on stack and call _dl_main \n"
-" pushl %edx \n"
-" pushl %eax \n"
-" pushl %esi \n"
-" pushl %ecx \n"
-" call _dl_main \n"
-
-"# restore stack \n"
-" movl %ebp, %esp \n"
-
-"# get fini pointer \n"
-" movl fini_entry@GOTOFF(%ebx), %edx \n"
-
-"# clear callee-save-register like kernel \n"
-" xorl %ebx, %ebx \n"
-" xorl %ebp, %ebp \n"
-" xorl %edi, %edi \n"
-" xorl %esi, %esi \n"
-
-"# jump to program entry point \n"
-" jmp *%eax \n"
-
-"_dl_sys_read: \n"
-" movb $3,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_write: \n"
-" movb $4,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_open: \n"
-" movb $5,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_close: \n"
-" movb $6,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_mmap: \n"
-" movb $90,%al \n"
-" leal 4(%esp),%edx \n"
-" pushl %edx \n"
-" call _dl_sys_call3 \n"
-" popl %ecx \n"
-" ret \n"
-"_dl_sys_munmap: \n"
-" movb $91,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_fstat: \n"
-" movb $108,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_mprotect: \n"
-" movb $125,%al \n"
-" jmp _dl_sys_call3 \n"
-"_dl_sys_exit: \n"
-" movb $1,%al \n"
-"_dl_sys_call3: \n"
-" movzbl %al,%eax \n"
-" pushl %ebx \n"
-" movl %esp,%ebx \n"
-" movl 16(%ebx),%edx \n"
-" movl 12(%ebx),%ecx \n"
-" movl 8(%ebx),%ebx \n"
-" int $0x80 \n"
-" popl %ebx \n"
-" ret \n"
-
-".type _dl_jump,@function \n"
-"_dl_jump: \n"
-" pushl %eax # save register args... \n"
-" pushl %ecx \n"
-" pushl %edx \n"
-
-" push 16(%esp) # 2. arg from plt \n"
-" push 16(%esp) # 1. arg from plt \n"
-" call do_resolve \n"
-" add $8, %esp \n"
-
-" popl %edx # restore register args... \n"
-" popl %ecx \n"
-" xchgl %eax, (%esp) # restore eax and save function pointer (for return) \n"
-" ret $8 # remove arguments from plt and jump to REAL function \n"
-
-"# GET Position In Code :) \n"
-"getpic: movl (%esp), %ebx \n"
-" ret");
-
-static inline unsigned long* get_got(void) {
- register unsigned long *got asm ("%ebx");
- return got;
-}
-
-static inline int work_on_pltgot(struct _dl_handle*dh) {
- /* declare _dl_jump static otherwise we have a GOT access BEFOR we have the resolver */
- static void _dl_jump(void);
- if ((dh->plt_rel)&&(!(dh->flags&RTLD_NOW))) {
- unsigned long*tmp=dh->pltgot;
- /* GOT */
- tmp[0]+=(unsigned long)dh->mem_base; /* reloc dynamic pointer */
- tmp[1] =(unsigned long)dh; /* the handle */
- tmp[2] =(unsigned long)(_dl_jump); /* sysdep jump to do_resolve */
- }
- return 0;
-}
-
-#elif __arm__
-
-asm(".text \n"
-".type _start,function \n"
-"_start: \n"
-" mov r4, sp \n"
-" mov fp, #0 @ start new stack frame \n"
-
-" ldr a1, [sp], #4 @ argc \n"
-" mov a2, sp @ argv \n"
-
-" add a3, a2, a1, lsl #2 @ envp \n"
-" add a3, a3, #4 \n"
-
-" ldr sl, .L_got @ PIC code \n"
-"1: add sl, pc, sl \n"
-
-" ldr a4, .L_la @ get 'relocated' address of _DYNAMIC \n"
-" add a4, a4, sl \n"
-
-" bl _dl_main @ call _dl_main \n"
-
-" mov sp, r4 \n"
-
-" mov lr, a1 @ save program entry point \n"
-
-" ldr a1, [pc, #.L_fe-(.+8)] @ agrument 1: global fini entry \n"
-" ldr a1, [sl, a1] \n"
-
-" mov pc, lr \n"
-
-".L_got: .long _GLOBAL_OFFSET_TABLE_-(1b+8) \n"
-".L_la: .long _DYNAMIC(GOTOFF) \n"
-".L_fe: .long fini_entry(GOTOFF) \n"
-
-"_dl_sys_exit: \n"
-" swi #0x900001 @ exit \n"
-" eor pc, lr, lr @ OR DIE ! \n"
-" mov pc, lr \n"
-
-"_dl_sys_read: \n"
-" swi #0x900003 @ read \n"
-" mov pc, lr \n"
-"_dl_sys_write: \n"
-" swi #0x900004 @ write \n"
-" mov pc, lr \n"
-"_dl_sys_open: \n"
-" swi #0x900005 @ open \n"
-" mov pc, lr \n"
-"_dl_sys_close: \n"
-" swi #0x900006 @ close \n"
-" mov pc, lr \n"
-"_dl_sys_mmap: \n"
-" stmdb sp!,{r0,r1,r2,r3} \n"
-" mov r0, sp \n"
-" swi #0x900090 @ mmap \n"
-" add sp, sp, #16 \n"
-" mov pc, lr \n"
-"_dl_sys_munmap: \n"
-" swi #0x900091 @ munmap \n"
-" mov pc, lr \n"
-"_dl_sys_fstat: \n"
-" swi #0x900108 @ fstat \n"
-" mov pc, lr \n"
-"_dl_sys_mprotect: \n"
-" swi #0x900125 @ mprotect \n"
-" mov pc, lr \n"
-
-".type _dl_jump,function \n"
-"_dl_jump: \n"
-" stmdb sp!, {r0, r1, r2, r3} @ save arguments \n"
-
-" sub r1, ip, lr @ dyntab entry \n"
-" sub r1, r1, #4 \n"
-" add r1, r1, r1 \n"
-
-" ldr r0, [lr, #-4] @ dynlib handle \n"
-
-" bl do_resolve \n"
-
-" mov r12, r0 \n"
-" ldmia sp!, {r0, r1, r2, r3, lr} @ restore arguments \n"
-" mov pc, r12");
-
-static inline unsigned long* get_got(void) {
- register unsigned long *got asm ("sl");
- return got;
-}
-
-static inline int work_on_pltgot(struct _dl_handle*dh) {
- /* declare _dl_jump static otherwise we have a GOT access BEFOR we have the resolver */
- static void _dl_jump(void);
- if ((dh->plt_rel)&&(!(dh->flags&RTLD_NOW))) {
- unsigned long*tmp=dh->pltgot;
- /* GOT */
- tmp[0]+=(unsigned long)dh->mem_base; /* reloc dynamic pointer */
- tmp[1] =(unsigned long)dh; /* the handle */
- tmp[2] =(unsigned long)(_dl_jump); /* sysdep jump to do_resolve */
- }
- return 0;
-}
-
-#else
-#error "libdl: arch not supported"
-#endif
-
-static void*_dl_load(const char*fn,const char*pathname,int fd,int flags);
-
-/* here do the code includes */
-
-/* strncpy */
-static char*strncpy(register char*s,register const char*t,register unsigned long n) {
- char *dest=s;
- for(;n;--n) {
- char ch=*t;
- *s=ch;
- if (ch==0) return dest;
- ++s; ++t;
- }
- return 0;
-}
-
-/* strlen.c */
-static unsigned long strlen(register const char*s) {
- register unsigned long i;
- if (!s) return 0;
- for (i=0; *s; ++s) ++i;
- return i;
-}
-
-/* strcmp.c */
-static int strcmp(register const unsigned char*s,register const unsigned char*t) {
- register char x;
- for (;;) {
- x = *s; if (x != *t) break; if (!x) break; ++s; ++t;
- }
- return ((int)(unsigned int)x) - ((int)(unsigned int)*t);
-}
-
-/* strcspn.c */
-static unsigned long strcspn(const char*s,const char*reject) {
- unsigned long l=0;
- int a=1,i,al=strlen(reject);
- while((a)&&(*s)) {
- for(i=0;(a)&&(i<al);++i) if (*s==reject[i]) a=0;
- if (a) ++l;
- ++s;
- }
- return l;
-}
-
-/* memcpy.c */
-static void*memcpy(void*dst,const void*src,unsigned long count) {
- register char *d=dst;
- register const char *s=src;
- ++count;
- while (--count) {
- *d = *s;
- ++d; ++s;
- }
- return dst;
-}
-
-/* memset.c */
-static void*memset(void*dst,int ch,unsigned long count) {
- register char *d=dst;
- ++count;
- while (--count) {
- *d=ch;
- ++d;
- }
- return dst;
-}
-
-/* memcmp.c */
-static int memcmp(register const unsigned char*s,register const unsigned char*t,unsigned long count) {
- register int r;
- ++count;
- while(--count) {
- if ((r=(*s-*t))) return r;
- ++s;
- ++t;
- }
- return 0;
-}
-
-/* getenv.c */
-static char*getenv(const char*env) {
- unsigned int i,len=strlen(env);
- for (i=0;_dl_environ[i];++i) {
- if ((memcmp(_dl_environ[i],env,len)==0) && (_dl_environ[i][len]=='='))
- return _dl_environ[i]+len+1;
- }
- return 0;
-}
-
-/* basic debug output functions */
-static void pf(const char*s) { _dl_sys_write(2,(void*)s,strlen(s)); }
-static void ph(unsigned long l) {
- const int max=(sizeof(unsigned long)<<1);
- unsigned char buf[16];
- int i;
- for (i=max;i;l>>=4) {
- register unsigned long v='0'|(l&15);
- if (v>'9') v+=0x27;
- buf[--i]=v;
- }
- _dl_sys_write(2,buf,max);
-}
-
-/* the never free strdup (internal) */
-static unsigned long _dl_lib_strdup_len=0;
-static char*_dl_lib_strdup_str;
-static char*_dl_lib_strdup(const char*s) {
- char*ret=_dl_lib_strdup_str;
- unsigned long l=strlen(s)+1;
- if (_dl_lib_strdup_len<l) {
- ret=(char*)_dl_sys_mmap(0,at_pagesize,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0);
- _dl_lib_strdup_len=at_pagesize;
- }
- _dl_lib_strdup_str=ret+l;
- _dl_lib_strdup_len-=l;
- memcpy(ret,s,l);
- return ret;
-}
-
-#ifdef __GDB_SUPPORT__
-volatile void _dl_debug_state(void);
-/* gdb debug break point */
-void _dl_debug_state() {}
-
-/* gdb debug init stuff */
-struct r_debug _r_debug;
-static struct r_debug* _dl_debug_init(Elf_Addr dl_base) {
- if (_r_debug.r_brk==0) {
- _r_debug.r_version = 1;
- _r_debug.r_ldbase = dl_base;
- _r_debug.r_map = _dl_root_handle; /* this my be wrong */
- _r_debug.r_brk = (Elf_Addr)&_dl_debug_state;
- }
- return &_r_debug;
-}
-#endif
-
-/* now reuse some unchanged sources */
-#include "dlerror.c"
-#include "_dl_alloc.c"
-
-#include "dlsym.c"
-
-#include "_dl_search.c"
-
-#include "_dl_open.c"
-#include "dlopen.c"
-
-#include "_dl_relocate.c"
-#include "_dl_queue.c"
-
-#include "dlclose.c"
-
-/* back to the "new" implementation */
-static void tt_fini(void) {
- struct _dl_handle*tmp;
-#ifdef DEBUG
- pf("dyn fini\n");
-#endif
- for(tmp=_dl_root_handle;tmp;tmp=tmp->next)
- if (tmp->fini) tmp->fini();
-}
-
-/* exit ! */
-static void _DIE_() { _dl_sys_exit(213); }
-
-/* lazy function resolver */
-static unsigned long do_resolve(struct _dl_handle*dh,unsigned long off) {
- _dl_rel_t *tmp = ((void*)dh->plt_rel)+off;
- int sym=ELF_R_SYM(tmp->r_info);
- register unsigned long sym_val;
-
- if (0) sym_val=(unsigned long)do_resolve; /* TRICK: no warning */
-
- /* modify GOT for REAL symbol */
- sym_val=(unsigned long)_dl_sym(dh,sym);
- *((unsigned long*)(dh->mem_base+tmp->r_offset))=sym_val;
-
- /* JUMP (arg sysdep...) */
- if (sym_val) return sym_val;
- /* can't find symbol */
- return (unsigned long)_DIE_;
-}
-
-/* library loader */
-
-/* ELF -> MMAP permissions */
-static inline int map_flags(int flags) {
- int perm = 0;
- if (flags & PF_X) perm|=PROT_EXEC;
- if (flags & PF_R) perm|=PROT_READ;
- if (flags & PF_W) perm|=PROT_WRITE;
- return perm;
-}
-
-/* a simple mmap wrapper */
-static inline void*do_map_in(void*base,unsigned long length,int flags,int fd,unsigned long offset) {
- register int op = MAP_PRIVATE;
- if (base) op|=MAP_FIXED;
- return _dl_sys_mmap(base, length, map_flags(flags), op, fd, offset);
-}
-
-/* map a library into memory */
-#define _ELF_DWN_ROUND(ps,n) ((n)&(~((ps)-1)))
-#define _ELF_UP_ROUND(ps,n) ((((n)&((ps)-1))?(ps):0)+_ELF_DWN_ROUND((ps),(n)))
-#define _ELF_RST_ROUND(ps,n) ((n)&((ps)-1))
-static struct _dl_handle*_dl_map_lib(const char*fn,const char*pathname,int fd,int flags) {
- struct _dl_handle*ret=0;
- int i;
- unsigned char buf[1024];
- char *m=0,*d=0;
-
- unsigned long l;
- struct stat st;
-
- Elf_Ehdr*eeh;
- Elf_Phdr*eph;
-
- int ld_nr=0;
- Elf_Phdr*ld[4]={0,0,0,0};
- Elf_Phdr*dyn=0;
-
- if (0) { pathname=0; } /* no unused parameter */
- if (fd==-1) return 0;
-
- if (_dl_sys_fstat(fd,&st)<0) {
-err_out_close:
- _dl_sys_close(fd);
- _dl_error_data=fn;
- _dl_error=2;
- return 0;
- } else {
- /* use st_dev and st_ino for identification */
- }
-
- if (_dl_sys_read(fd,buf,1024)<128) goto err_out_close;
-
- eeh=(Elf_Ehdr*)buf;
- eph=(Elf_Phdr*)&buf[eeh->e_phoff];
-
- for (i=0;i<eeh->e_phnum;++i) {
- if (eph[i].p_type==PT_LOAD) {
- if (ld_nr>3) goto err_out_close;
- ld[ld_nr++]=eph+i;
- }
- if (eph[i].p_type==PT_DYNAMIC) {
- dyn=eph+i;
- }
- }
-
- if (ld_nr==1) {
- unsigned long offset=_ELF_DWN_ROUND(at_pagesize,ld[0]->p_offset);
- unsigned long off =_ELF_RST_ROUND(at_pagesize,ld[0]->p_offset);
- unsigned long length=_ELF_UP_ROUND(at_pagesize,ld[0]->p_memsz+off);
- ret=_dl_get_handle();
- m=(char*)do_map_in(0,length,ld[0]->p_flags,fd,offset);
- if (m==MAP_FAILED) goto err_out_free;
- /* zero pad bss */
- l=ld[0]->p_offset+ld[0]->p_filesz;
- memset(m+l,0,length-l);
-
- ret->mem_base=m;
- ret->mem_size=length;
- }
- else if (ld_nr==2) { /* aem... yes Quick & Really Dirty / for the avarage 99% */
-// unsigned long text_addr = _ELF_DWN_ROUND(at_pagesize,ld[0]->p_vaddr); /* do we need this ? */
- unsigned long text_offset=_ELF_DWN_ROUND(at_pagesize,ld[0]->p_offset);
- unsigned long text_off =_ELF_RST_ROUND(at_pagesize,ld[0]->p_offset);
- unsigned long text_size =_ELF_UP_ROUND(at_pagesize,ld[0]->p_memsz+text_off);
-
- unsigned long data_addr =_ELF_DWN_ROUND(at_pagesize,ld[1]->p_vaddr);
- unsigned long data_offset=_ELF_DWN_ROUND(at_pagesize,ld[1]->p_offset);
- unsigned long data_off =_ELF_RST_ROUND(at_pagesize,ld[1]->p_offset);
- unsigned long data_size =_ELF_UP_ROUND(at_pagesize,ld[1]->p_memsz+data_off);
- unsigned long data_fsize =_ELF_UP_ROUND(at_pagesize,ld[1]->p_filesz+data_off);
-
- ret=_dl_get_handle();
- /* mmap all mem_blocks for *.so */
- m=(char*)do_map_in(0,text_size+data_size,ld[0]->p_flags,fd,text_offset);
- if (m==MAP_FAILED) {
-err_out_free:
- _dl_free_handle(ret);
- _dl_sys_close(fd);
- return 0;
- }
-
- /* release data,bss part */
- _dl_sys_mprotect(m+data_addr,data_size,PROT_NONE);
-
- /* mmap data,bss part */
- d=(char*)do_map_in(m+data_addr,data_fsize,ld[1]->p_flags,fd,data_offset);
-
- /* zero pad bss */
- l=data_off+ld[1]->p_filesz;
- memset(d+l,0,data_fsize-l);
- /* more bss ? */
- if (data_size>data_fsize) {
- l=data_size-data_fsize;
- _dl_sys_mmap(d+data_fsize,l,PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS,-1,0);
- }
-
- ret->mem_base=m;
- ret->mem_size=text_size+data_size;
- }
- else {
- _dl_error_data=fn;
- _dl_error=7;
- }
-
- if (ret) {
- ++ret->lnk_count;
- if (flags&RTLD_USER)
- ret->name=strdup(fn);
- else
- ret->name=_dl_lib_strdup(fn);
- ret->flags=flags;
- ret->dynamic=(Elf_Dyn*)(m+dyn->p_vaddr);
- }
-
- _dl_sys_close(fd);
- return ret;
-}
-
-/* dynamic section parser */
-static struct _dl_handle* _dl_dyn_scan(struct _dl_handle*dh,Elf_Dyn*_dynamic) {
- void(*init)(void)=0;
-
- _dl_rel_t* plt_rel=0;
- unsigned long plt_relsz=0;
-
- _dl_rel_t* rel=0;
- unsigned long relent=0;
- unsigned long relsize=0;
-
- int i;
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": pre dynamic scan "); ph((unsigned long)dh); pf("\n");
-#endif
- for(i=0;_dynamic[i].d_tag;++i) {
- switch(_dynamic[i].d_tag) {
- /* this depends on dyn_str_tab -> second run */
- case DT_NEEDED:
- case DT_SONAME:
- break;
-
- /* BASIC DYNAMIC STUFF */
- case DT_HASH:
- dh->hash_tab = (unsigned long*)(dh->mem_base+_dynamic[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have hash @ "); ph((long)dh->hash_tab); pf("\n");
-#endif
- break;
- case DT_SYMTAB:
- dh->dyn_sym_tab = (Elf_Sym*)(dh->mem_base+_dynamic[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have dyn_sym_tab @ "); ph((long)dh->dyn_sym_tab); pf("\n");
-#endif
- break;
- case DT_STRTAB:
- dh->dyn_str_tab = (char*)(dh->mem_base+_dynamic[i].d_un.d_ptr);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have dyn_str_tab @ "); ph((long)dh->dyn_str_tab); pf("\n");
-#endif
- break;
-
- /* DYNAMIC INIT/FINI (constructors/destructors) */
- case DT_FINI:
- dh->fini = (void(*)(void))(dh->mem_base+_dynamic[i].d_un.d_val);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have fini @ "); ph((long)dh->fini); pf("\n");
-#endif
- break;
- case DT_INIT:
- init = (void(*)(void))(dh->mem_base+_dynamic[i].d_un.d_val);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have init @ "); ph((long)init); pf("\n");
-#endif
- break;
-
- /* PLT RELOCATION */
- case DT_PLTGOT:
- dh->pltgot = (unsigned long*)(dh->mem_base+_dynamic[i].d_un.d_val);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have plt/got @ "); ph((long)dh->pltgot); pf("\n");
-#endif
- break;
- case DT_PLTREL:
- if (_dynamic[i].d_un.d_val!=_DL_REL_T) {
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have incompatible relocation type\n");
-#endif
- _dl_error_data=dh->name;
- _dl_error=6;
- return 0;
- }
- break;
- case DT_JMPREL:
- plt_rel = (_dl_rel_t*)(dh->mem_base+_dynamic[i].d_un.d_val);
- dh->plt_rel = plt_rel;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have jmprel @ "); ph((long)plt_rel); pf("\n");
-#endif
- break;
- case DT_PLTRELSZ:
- plt_relsz = _dynamic[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have pltrelsize @ "); ph((long)plt_relsz); pf("\n");
-#endif
- break;
-
- /* BASIC RELOCATION */
- case DT_REL:
- rel = (_dl_rel_t*)(dh->mem_base+_dynamic[i].d_un.d_val);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have rel @ "); ph((long)rel); pf("\n");
-#endif
- break;
- case DT_RELENT:
- relent=_dynamic[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have relent @ "); ph((long)relent); pf("\n");
-#endif
- break;
- case DT_RELSZ:
- relsize=_dynamic[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have relsize @ "); ph((long)relsize); pf("\n");
-#endif
- break;
-
-
- /* TEXT RELOCATIONS POSSIBLE -> NO SHARED OBJECT */
- case DT_TEXTREL:
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": found possible textrelocation -> "); pf(dh->name); pf(" is not compiled as a shared library\n");
-#endif
- _dl_error_data=dh->name;
- _dl_error=3;
- return 0;
- break;
-
- /* OTHERS */
- default:
-#ifdef DEBUG
-#if 0
- pf(__FUNCTION__); pf(": unknown "); ph(_dynamic[i].d_tag); pf(", "); ph(_dynamic[i].d_un.d_val); pf("\n");
-#endif
-#endif
- break;
- }
- }
-
- for(i=0;_dynamic[i].d_tag;i++) {
- if (dh->name) { /* librabry can have a SONAME */
- if (_dynamic[i].d_tag==DT_SONAME) {
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": pre soname: "); pf(dh->name); pf("\n");
-#endif
- if (dh->flags&RTLD_USER) free(dh->name);
- dh->flags&=~RTLD_NOSONAME;
- dh->name = dh->dyn_str_tab+_dynamic[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have soname: "); pf(dh->name); pf("\n");
-#endif
- }
- }
- else { /* programs can have a LD_RUN_PATH */
- if (_dynamic[i].d_tag==DT_RPATH) {
- register char *rpath=dh->dyn_str_tab+_dynamic[i].d_un.d_val;
- _dl_search_rpath=rpath;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": have runpath: "); pf(rpath); pf("\n");
-#endif
- }
- }
- }
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": post dynamic scan "); ph((unsigned long)dh); pf("\n");
-#endif
-
- if (work_on_pltgot(dh)) {
- _dl_error_data=dh->name;
- _dl_error=3;
- return 0;
- }
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": pre load depending libraries "); ph((unsigned long)dh); pf("\n");
-#endif
- /* load depending libs */
- for(i=0;_dynamic[i].d_tag;++i) {
- if (_dynamic[i].d_tag==DT_NEEDED) {
- char *lib_name=dh->dyn_str_tab+_dynamic[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": needed for this lib: "); pf(lib_name); pf("\n");
-#endif
- _dl_queue_lib(lib_name,dh->flags);
- }
- }
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": pre open depending libraries 2 "); ph((unsigned long)dh); pf("\n");
-#endif
- if (_dl_open_dep()) {
- return 0;
- }
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": post load depending libraries, pre resolve "); ph((unsigned long)dh); pf("\n");
-#endif
-
- /* relocation */
- if (rel) {
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": try to relocate some values\n");
-#endif
- if (_dl_relocate(dh,rel,relsize/relent)) return 0;
- }
-
- /* do PTL / GOT relocation */
- if (plt_rel) {
- _dl_rel_t *tmp,*max=((void*)plt_rel)+plt_relsz;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": rel plt/got\n");
-#endif
- for(tmp=plt_rel;tmp<max;(char*)tmp=((char*)tmp)+sizeof(_dl_rel_t)) {
- if ((dh->flags&RTLD_NOW)) {
- unsigned long sym=(unsigned long)_dl_sym(dh,ELF_R_SYM(tmp->r_info));
- if (sym) *((unsigned long*)(dh->mem_base+tmp->r_offset))=sym;
- else {
- _dl_error_data=dh->name;
- _dl_error=4;
- return 0;
- }
- }
- else
- _DL_REL_PLT(dh->mem_base,tmp);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": rel @ "); ph((long)dh->mem_base+tmp->r_offset); pf(" with type ");
- ph(ELF_R_TYPE(tmp->r_info)); pf(" and sym "); ph(ELF_R_SYM(tmp->r_info));
- pf(" -> "); ph(*((unsigned long*)(dh->mem_base+tmp->r_offset))); pf("\n");
-#endif
- }
- }
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": post resolve, pre init "); ph((unsigned long)dh); pf("\n");
-#endif
- if (init) init();
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": post init "); ph((unsigned long)dh); pf("\n");
-#endif
-
- return dh;
-}
-
-static void*_dl_load(const char*fn,const char*pathname,int fd,int flags) {
- struct _dl_handle*ret=0;
- if ((ret=_dl_map_lib(fn,pathname,fd,flags))) {
- ret=_dl_dyn_scan(ret,ret->dynamic);
- }
- return ret;
-}
-
-
-/* ELF AUX parser */
-static void _dl_elfaux(register unsigned long*ui) {
- register struct elf_aux {
- unsigned long type;
- unsigned long val;
- } *ea;
-
- while (*ui) ++ui;
- /* now *ui points to the tailing NULL-pointer of the envirioment */
-
- /* walk the elf_aux table */
- for (ea=(struct elf_aux*)(ui+1); ea->type; ++ea) {
- switch (ea->type) {
- case AT_EXECFD: /* 2 */
- /* DIE! DIE! DIE! */
- pf("kernel gives us an unsupported binary load type...\n");
- _dl_sys_exit(42);
- break;
-
- case AT_PHDR: /* 3 */
- prog_ph=(Elf_Phdr*)ea->val;
-#ifdef DEBUG
- pf("program header @ "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_PHENT: /* 4 */
- prog_ph_size=ea->val;
-#ifdef DEBUG
- pf("program header size "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_PHNUM: /* 5 */
- prog_ph_num=ea->val;
-#ifdef DEBUG
- pf("program header # "); ph(ea->val); pf("\n");
-#endif
- break;
-
- case AT_PAGESZ: /* 6 */
- at_pagesize=ea->val;
-#ifdef DEBUG
- pf("page size "); ph(ea->val); pf("\n");
-#endif
- break;
-
- case AT_BASE: /* 7 */
- loadaddr=ea->val;
-#ifdef DEBUG
- pf("interpreter base: "); ph(ea->val); pf("\n");
-#endif
- break;
-
-#if 0
- case AT_FLAGS: /* 8 */
-#ifdef DEBUG
- pf("flags "); ph(ea->val); pf("\n");
-#endif
- break;
-#endif
-
- case AT_ENTRY: /* 9 */
- prog_entry=ea->val;
-#ifdef DEBUG
- pf("start program @ "); ph(ea->val); pf("\n");
-#endif
- break;
-
- case AT_NOTELF: /* 10 */
- pf("this is an ELF-loader... and therefor can't handle anything else.\n");
- _dl_sys_exit(42);
- break;
-
- case AT_UID: /* 11 */
- at_uid=ea->val;
-#ifdef DEBUG
- pf(" UID: "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_EUID: /* 12 */
- at_euid=ea->val;
-#ifdef DEBUG
- pf("EUID: "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_GID: /* 13 */
- at_gid=ea->val;
-#ifdef DEBUG
- pf(" GID: "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_EGID: /* 14 */
- at_egid=ea->val;
-#ifdef DEBUG
- pf("EGID: "); ph(ea->val); pf("\n");
-#endif
- break;
-
-#if 0
- case AT_PLATFORM: /* 15 */
-#ifdef DEBUG
- pf("CPU: "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_HWCAP: /* 16 */
-#ifdef DEBUG
- pf("CPU capabilities: "); ph(ea->val); pf("\n");
-#endif
- break;
- case AT_CLKTCK: /* 17 */
-#ifdef DEBUG
- pf("CLK per sec "); ph( ea->val); pf("\n");
-#endif
- break;
- case AT_FPUCW: /* 18 */
-#ifdef DEBUG
- pf("FPU control word "); ph( ea->val); pf("\n");
-#endif
- break;
-#endif
-
- default:
- break;
- }
- }
-}
-
-
-/* start of libdl dynamic linker */
-static unsigned long _dl_main(int argc,char*argv[],char*envp[],unsigned long _dynamic) {
- unsigned long*got;
- struct _dl_handle*prog,*mydh;
- struct _dl_handle my_dh;
- Elf_Dyn*prog_dynamic=0;
- unsigned int i;
-
- if (0) _dl_main(argc,argv,envp,_dynamic); /* TRICK: no warning */
-
- /* prepare to bootstarp the relocations */
- got=get_got();
- _dl_environ=envp;
-
- /* run elf_aux (kernel provided misc data) */
- _dl_elfaux((unsigned long*)envp);
-
- if (loadaddr==0) {
- pf("\ndiet libdl.so/dynamic-linker can't be started as a program !\n\n SORRY...\n\n");
- return (unsigned long)_DIE_;
- }
-
- memset(&my_dh,0,sizeof(my_dh));
- my_dh.mem_base=(char*)loadaddr;
- my_dh.mem_size=0;
- my_dh.lnk_count=1024;
- my_dh.name="libdl.so";
- my_dh.flags=LDSO_FLAGS;
-
- got[1]=0; /* NOT YET (my_dh) */
- got[2]=(unsigned long)_DIE_; /* NO lazy symbol resolver as long as we are not ready */
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": pre scan\n");
-#endif
- /* bootstrap relocation */
- if (_dl_dyn_scan(&my_dh,(Elf_Dyn*)_dynamic)==0) {
- pf("error with dyn_scan myself\n");
- return (unsigned long)_DIE_;
- }
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": post scan\n");
-#endif
-
- /* now we are save to use anything :) (hopefully) */
-
- fini_entry=tt_fini;
-
- prog=_dl_get_handle();
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": ugly, ugly, COPY pregenerated handle to real handle\n");
-#endif
- mydh=_dl_get_handle();
- {
- register struct _dl_handle*tmp=mydh->prev;
- memcpy(mydh,&my_dh,sizeof(struct _dl_handle));
- mydh->prev=tmp;
- }
- got[1]=(unsigned long)mydh;
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": MORE ugly: prepare program...\n");
-#endif
- for(i=0;(i<prog_ph_num);++i) {
- if (prog_ph[i].p_type==PT_DYNAMIC) {
- prog_dynamic=(Elf_Dyn*)prog_ph[i].p_vaddr;
- break;
- }
- }
- if (prog_dynamic==0) {
- ph(0xe0000001);
- pf(" error with program: no dynamic section ?\n");
- return (unsigned long)_DIE_;
- }
- prog->name=0;
- prog->lnk_count=1024;
- prog->dynamic=prog_dynamic;
- prog->flags=LDSO_FLAGS;
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": dyn_scan program...\n");
-#endif
- if (_dl_dyn_scan(prog,(Elf_Dyn*)prog_dynamic)==0) {
- _dl_error_location="error in dyn_scan the program";
- pf(dlerror()); pf("\n");
- return (unsigned long)_DIE_;
- }
-
- /* now start the program */
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": now jump to program entrypoint\n");
-#endif
- return prog_entry;
-}
-
-#endif
diff --git a/mdk-stage1/dietlibc/libdl/_dl_open.c b/mdk-stage1/dietlibc/libdl/_dl_open.c
deleted file mode 100644
index f7bd0af95..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_open.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <fcntl.h>
-#include <dlfcn.h>
-#include <limits.h>
-#ifndef __DIET_LD_SO__
-#include <string.h>
-#endif
-
-#include "_dl_int.h"
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void*_dl_open(const char*filename,int flags) {
- int fd;
- char buf[PATH_MAX];
- const char*p=0;
-
- for (fd=0;filename[fd] && (p==0);++fd) if (filename[fd]=='/') p=filename;
- if (p) {
-#ifdef __DIET_LD_SO__
- if ((fd=_dl_sys_open(p,O_RDONLY,0))<0) fd=-1;
-#else
- fd=open(p,O_RDONLY);
-#endif
- } else {
- p=buf;
- fd=_dl_search(buf,sizeof(buf)-1,filename);
- }
- if (fd==-1) {
- _dl_error_data=filename;
- _dl_error=1;
- return 0;
- }
- return _dl_load(filename,p,fd,flags);
-}
diff --git a/mdk-stage1/dietlibc/libdl/_dl_queue.c b/mdk-stage1/dietlibc/libdl/_dl_queue.c
deleted file mode 100644
index 5e08020d5..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_queue.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <dlfcn.h>
-#include "_dl_int.h"
-
-#define MAX_QUEUE 64
-
-static int _dl_queue_start=0;
-static int _dl_queue_stop=0;
-
-static struct {
- const char*name;
- int flags;
-} _dl_queue[MAX_QUEUE];
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-int _dl_queue_lib(const char*name,int flags) {
- if (_dl_find_lib(name)==0) {
- register int tmp;
- if ((tmp=_dl_queue_stop+1)>=MAX_QUEUE) tmp=0;
- if (tmp==_dl_queue_start) return -1;
- _dl_queue[_dl_queue_stop].name=name;
- _dl_queue[_dl_queue_stop].flags=flags;
- _dl_queue_stop=tmp;
- }
- return 0;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-int _dl_open_dep() {
- while (_dl_queue_start!=_dl_queue_stop) {
- register int tmp=_dl_queue_start;
- (++_dl_queue_start>=MAX_QUEUE)?_dl_queue_start=0:0;
- if (!_dlopen(_dl_queue[tmp].name,_dl_queue[tmp].flags)) return 1;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libdl/_dl_rel.c b/mdk-stage1/dietlibc/libdl/_dl_rel.c
deleted file mode 100644
index bc8717dc2..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_rel.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <dlfcn.h>
-
-#include "_dl_int.h"
-
-static void exit_now(void) {
-#ifdef DEBUG
- pf(__func__": symbol not found\n");
-#endif
- _exit(213);
-}
-
-unsigned long do_rel(struct _dl_handle * tmp_dl, unsigned long off)
-{
- Elf_Rel *tmp = ((void*)tmp_dl->plt_rel)+off;
-
- int sym=ELF_R_SYM(tmp->r_info);
-
- register unsigned long sym_val;
-
-#ifdef DEBUG
- pf(__func__": "); ph((unsigned long)tmp_dl); pf(" "); ph(off); pf(" on ");
- ph((long)tmp_dl->plt_rel); pf("\n");
- pf(__func__": @ "); ph((long)tmp->r_offset); pf(" with type ");
- ph(ELF_R_TYPE(tmp->r_info)); pf(" and sym "); ph(sym);
- pf(" symval "); ph(tmp_dl->dyn_sym_tab[sym].st_value); pf("\n");
-#endif
-
- /* modify GOT for REAL symbol */
- //sym_val=((unsigned long)(tmp_dl->mem_base+tmp_dl->dyn_sym_tab[sym].st_value));
- sym_val=(unsigned long)_dl_sym(tmp_dl,sym);
- *((unsigned long*)(tmp_dl->mem_base+tmp->r_offset))=sym_val;
-
-#ifdef DEBUG
- pf(__func__": sym "); ph(sym_val); pf("\n");
-#endif
- /* JUMP (arg sysdep...) */
- if (sym_val) return sym_val;
- /* can't find symbol -> die now */
- return (unsigned long)exit_now;
-}
-
-
diff --git a/mdk-stage1/dietlibc/libdl/_dl_rel.h b/mdk-stage1/dietlibc/libdl/_dl_rel.h
deleted file mode 100644
index 948aa5b79..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_rel.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef ___DL_REL_H__
-#define ___DL_REL_H__
-
-#if defined(__arm__) || defined(__i386__) || defined(__mips__)
-/* this are REL only archs: arm, i386, mips */
-
-#define _dl_rel_t Elf_Rel
-#define _DL_REL_T DT_REL
-
-#define _DL_REL_PLT(b,r) (*(unsigned long*)((b)+(r)->r_offset)+=(unsigned long)(b))
-
-#elif defined(__alpha__) || defined(__hppa__) || defined(__ppc__) || defined(__sparc__) || defined(__s390__)
-/* this are RELA only archs: alpha, chris, hppa, ia64, m68k, ppc, sparc, sparc64, sh, s390 */
-
-#define _dl_rel_t Elf_Rela
-#define _DL_REL_T DT_RELA
-
-#define _DL_REL_PLT(b,r) (*(unsigned long*)((b)+(r)->r_offset)=(unsigned long)((b)+(r)->r_addend))
-
-#else
-/* there are no known linux supported arch with mixed relocation types ... */
-#error "_dl_rel.h: NOT SUPPORTED"
-#endif
-
-#endif
diff --git a/mdk-stage1/dietlibc/libdl/_dl_relocate.c b/mdk-stage1/dietlibc/libdl/_dl_relocate.c
deleted file mode 100644
index e91e48ccf..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_relocate.c
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "_dl_int.h"
-
-#include "_dl_rel.h"
-
-#if 0
-/*--- are other relocation types vital to shared objects ? ---*/
-
- R_386_NONE 0 /* No reloc */
- R_386_32 1 /* Direct 32 bit */
- R_386_COPY 5 /* Copy symbol at runtime ?!? */
- R_386_GLOB_DAT 6 /* Create GOT entry */
- R_386_JMP_SLOT 7 /* Create PLT entry */
- R_386_RELATIVE 8 /* Adjust by program base */
-
- R_ARM_NONE 0 /* No reloc */
- R_ARM_ABS32 2 /* Direct 32 bit */
- R_ARM_COPY 20 /* Copy symbol at runtime */
- R_ARM_GLOB_DAT 21 /* Create GOT entry */
- R_ARM_JUMP_SLOT 22 /* Create PLT entry */
- R_ARM_RELATIVE 23 /* Adjust by program base */
-
-#endif
-
-static int _dl_apply_relocate(struct _dl_handle*dh,_dl_rel_t*rel) {
- int typ,ret=0;
- Elf_Addr*loc;
-
- loc=(Elf_Addr *)(dh->mem_base+rel->r_offset);
-
-#ifdef DEBUG
-#if 0
- pf(__FUNCTION__); pf(": "); ph(ELF_R_TYPE(rel->r_info)); pf(" @ "); ph((unsigned long)loc);
- pf(" preval "); ph(*(unsigned long*)loc); pf("\n");
-#endif
-#endif
-
- typ=ELF_R_TYPE(rel->r_info);
-
-#ifdef __i386__
- if (typ==R_386_32) { /* 1 */
- *loc=(unsigned long)(dh->mem_base+dh->dyn_sym_tab[ELF_R_SYM(rel->r_info)].st_value);
- } else if (typ==R_386_COPY) { /* 5 */
- int len=dh->dyn_sym_tab[ELF_R_SYM(rel->r_info)].st_size;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": R_386_COPY !\n");
-#endif
- memcpy(loc,(void*)(unsigned long)_dl_sym(dh,ELF_R_SYM(rel->r_info)),len);
- } else if (typ==R_386_GLOB_DAT) { /* 6 */
- *loc=(unsigned long)_dl_sym(dh,ELF_R_SYM(rel->r_info));
- } else if (typ==R_386_JMP_SLOT) { /* 7 */
- *loc+=(unsigned long)dh->mem_base;
- } else if (typ==R_386_RELATIVE) { /* 8 */
- *loc+=(unsigned long)dh->mem_base;
- } else if (typ==R_386_NONE) { /* 0 */
- } else
- ret=1;
-#endif
-#ifdef __arm__
- if (typ==R_ARM_ABS32) { /* 2 */
- *loc=(unsigned long)(dh->mem_base+dh->dyn_sym_tab[ELF_R_SYM(rel->r_info)].st_value);
- } else if (typ==R_ARM_COPY) { /* 20 */
- int len=dh->dyn_sym_tab[ELF_R_SYM(rel->r_info)].st_size;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": R_ARM_COPY !\n");
-#endif
- memcpy(loc,(void*)(unsigned long)_dl_sym(dh,ELF_R_SYM(rel->r_info)),len);
- } else if (typ==R_ARM_GLOB_DAT) { /* 21 */
- *loc=(unsigned long)_dl_sym(dh,ELF_R_SYM(rel->r_info));
- } else if (typ==R_ARM_JUMP_SLOT) { /* 22 */
- *loc+=(unsigned long)dh->mem_base;
- } else if (typ==R_ARM_RELATIVE) { /* 23 */
- *loc+=(unsigned long)dh->mem_base;
- } else if (typ==R_ARM_NONE) { /* 0 */
- } else
- ret=1;
-#endif
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": @ "); ph((unsigned long)loc); pf(" val "); ph(*(unsigned long*)loc); pf("\n");
-#endif
- return ret;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-int _dl_relocate(struct _dl_handle*dh,_dl_rel_t *rel,int num) {
- int i;
- for (i=0;i<num;i++) {
- if (_dl_apply_relocate(dh,rel+i)) {
- _dl_error=4;
- return 1;
- }
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libdl/_dl_search.c b/mdk-stage1/dietlibc/libdl/_dl_search.c
deleted file mode 100644
index ccf9c51c5..000000000
--- a/mdk-stage1/dietlibc/libdl/_dl_search.c
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <stdlib.h>
-#include <dlfcn.h>
-
-#include <fcntl.h>
-
-#include "_dl_int.h"
-
-#define WANT_LD_SO_CONF_SEARCH
-
-static const char *_dl_search_rpath=0;
-
-#ifndef __DIET_LD_SO__
-#include <unistd.h>
-#include <string.h>
-void _dl_set_rpath(const char *path) { _dl_search_rpath=path; }
-const char* _dl_get_rpath() { return _dl_search_rpath; }
-#endif
-
-/* search a colon (semicolon) seperated path for the libraray "filename" */
-static int _dl_search_path(char*buf,int len,const char*path,const int pathlen,const char*filename) {
- int fd,i=1,fl=strlen(filename),ml=len-fl;
- const char*c,*pe=path+pathlen;
-
- if (path) {
- for (c=path;c<pe;c+=i) {
- int l=len-1;
- if ((*c==':')||(*c==';')) ++c;
- i=strcspn(c,":;");
- if (i) {
- if (i>ml) continue; /* if len(path-entry)+len(filename)+2 is greater than the buffer ? SKIP */
- memcpy(buf,c,i);
- buf[i]='/';
- l-=++i;
- }
- memcpy(buf+i,filename,fl);
- buf[i+fl]=0;
-#ifdef DEBUG
-// pf(__func__": "); pf(buf); pf("\n");
-#endif
-#ifdef __DIET_LD_SO__
- if ((fd=_dl_sys_open(buf,O_RDONLY,0))>-1) return fd;
-#else
- if ((fd=open(buf,O_RDONLY))!=-1) return fd;
-#endif
- }
- }
- return -1;
-}
-
-/* parse the SMALL file "conf" for lib directories (aem... hang me if you can :) ) */
-static int _dl_search_conf(char*buf,int len,const char*conf,const char*filename) {
- char ld_so_conf[1024];
- int i,l,fd;
-#ifdef __DIET_LD_SO__
- if ((fd=_dl_sys_open(conf,O_RDONLY,0))>-1) {
- l=_dl_sys_read(fd,ld_so_conf,sizeof(ld_so_conf)-1);
-#else
- if ((fd=open(conf,O_RDONLY))!=-1) {
- l=read(fd,ld_so_conf,sizeof(ld_so_conf)-1);
-#endif
- ld_so_conf[sizeof(ld_so_conf)-1]=0;
-#ifdef __DIET_LD_SO__
- _dl_sys_close(fd);
-#else
- close(fd);
-#endif
- if (l>0) {
- if (ld_so_conf[l-1]=='\n') ld_so_conf[--l]=0;
- for (i=0;i<l;i++) if (ld_so_conf[i]=='\n') ld_so_conf[i]=':';
- if ((fd=_dl_search_path(buf,len,ld_so_conf,l,filename))!=-1) return fd;
- }
- }
- return -1;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-int _dl_search(char*buf,int len,const char*filename) {
- int fd;
-
- /* 1. search the LD_RUN_PATH (from the executable) */
- if (_dl_search_rpath) {
- if ((fd=_dl_search_path(buf,len,_dl_search_rpath,strlen(_dl_search_rpath),filename))!=-1) return fd;
- }
-
- /* 2. IF we have a "secure" enviroment THEN search LD_LIBRARY_PATH */
-#ifdef __DIET_LD_SO__
- if ((at_uid==at_euid)&&(at_gid==at_egid)) {
-#else
- if ((getuid()==geteuid())&&(getgid()==getegid())) {
-#endif
- char *p=getenv("LD_LIBRARY_PATH");
- if (p)
- if ((fd=_dl_search_path(buf,len,p,strlen(p),filename))!=-1) return fd;
- }
-
- /* 3. search all pathes in the the /etc/diet.ld.conf, a dietlibc extension :) */
- if ((fd=_dl_search_conf(buf,len,"/etc/diet.ld.conf",filename))!=-1) return fd;
-
-#ifdef WANT_LD_SO_CONF_SEARCH
- /* 4. search all pathes in the the /etc/ld.so.conf / can't handle this ...=lib?? crap */
- if ((fd=_dl_search_conf(buf,len,"/etc/ld.so.conf",filename))!=-1) return fd;
-#endif
-
- /* default path search */
- {
- const char def_path[]="/usr/lib:/lib";
- return _dl_search_path(buf,len,def_path,strlen(def_path),filename);
- }
-}
diff --git a/mdk-stage1/dietlibc/libdl/dlclose.c b/mdk-stage1/dietlibc/libdl/dlclose.c
deleted file mode 100644
index 6fafedcf5..000000000
--- a/mdk-stage1/dietlibc/libdl/dlclose.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <sys/mman.h>
-
-#include "_dl_int.h"
-
-static void dec_referenced_libs(struct _dl_handle*dh) {
- Elf_Dyn* dyn_tab=dh->dynamic;
- int i;
- for(i=0;dyn_tab[i].d_tag;i++) {
- if (dyn_tab[i].d_tag==DT_NEEDED) {
- char *lib_name=dh->dyn_str_tab+dyn_tab[i].d_un.d_val;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": lib: "); pf(lib_name); pf("\n");
-#endif
- dlclose(_dl_find_lib(lib_name));
- }
- }
-}
-
-int dlclose(void*handle) {
- _dl_error_location="dlclose";
- if (handle) {
- struct _dl_handle*dh=handle;
- if (--(dh->lnk_count)) return 0; /* not yet unreferenced */
-
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": "); pf(dh->name); pf("\n");
-#endif
- if (dh->fini) dh->fini();
- dec_referenced_libs(dh);
-#ifdef __DIET_LD_SO__
- if (_dl_sys_munmap(dh->mem_base,dh->mem_size)<0) return -1;
-#else
- if (munmap(dh->mem_base,dh->mem_size)==-1) return -1;
-#endif
- _dl_free_handle(handle);
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libdl/dlerror.c b/mdk-stage1/dietlibc/libdl/dlerror.c
deleted file mode 100644
index 3fea0b75c..000000000
--- a/mdk-stage1/dietlibc/libdl/dlerror.c
+++ /dev/null
@@ -1,55 +0,0 @@
-
-#include "_dl_int.h"
-
-#ifdef __DIET_LD_SO__
-static unsigned int _dl_error;
-static const char*_dl_error_location;
-static const char*_dl_error_data;
-#else
-#include <string.h>
-unsigned int _dl_error;
-const char*_dl_error_location;
-const char*_dl_error_data;
-#endif
-
-static struct _dl_err_msg {
- char*msg;
- int len;
-} _dl_error_msg[]={
-#define MSG(n) { (n), sizeof((n))-1 }
- MSG("can't open: "), /* 1 */
- MSG("can't stat: "), /* 2 */
- MSG("shared object is not position independent: "), /* 3 */
- MSG("can't resolve all symbols in: "), /* 4 */
- MSG("can't find symbol: "), /* 5 */
- MSG("invalid relocation type in: "), /* 6 */
- MSG("internal error: layout not yet supported: "), /* 7 */
-};
-
-const char *dlerror(void) {
- static char buf[1024],*p=buf;
- register int l,len=sizeof(buf)-1;
- if (_dl_error==0) return 0;
-
- buf[0]=0;
- buf[len]=0;
- --_dl_error;
-
- if (_dl_error>=(sizeof(_dl_error_msg)/sizeof(struct _dl_err_msg)))
- return "HAE ?!?";
-
- if (_dl_error_location) {
- l=strlen(_dl_error_location);
- strncpy(p,_dl_error_location,len); len-=l; p+=l;
- strncpy(p,": ",len); len-=2; p+=2;
- }
- l=_dl_error_msg[_dl_error].len;
- strncpy(p,_dl_error_msg[_dl_error].msg,len); len-=l; p+=l;
- strncpy(p,_dl_error_data,len);
-
- _dl_error_location=0;
- _dl_error_data="";
- _dl_error=0;
-
- return buf;
-}
diff --git a/mdk-stage1/dietlibc/libdl/dlopen.c b/mdk-stage1/dietlibc/libdl/dlopen.c
deleted file mode 100644
index 79fa7903c..000000000
--- a/mdk-stage1/dietlibc/libdl/dlopen.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <fcntl.h>
-#include <dlfcn.h>
-#include <limits.h>
-
-#include "_dl_int.h"
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void*_dlopen(const char *filename, int flags) {
- struct _dl_handle* ret;
- if (filename) {
- if ((ret=_dl_find_lib(filename))) {
- ++(ret->lnk_count); /* add a reference */
- return ret;
- }
- return _dl_open(filename,flags);
- }
- /* return 1 as an indicator for dlsym to search ALL global objects */
- return RTLD_DEFAULT;
-}
-
-void*dlopen(const char *filename, int flags) {
- _dl_error_location="dlopen";
- return _dlopen(filename,flags|RTLD_USER|RTLD_NOSONAME);
-}
diff --git a/mdk-stage1/dietlibc/libdl/dlsym.c b/mdk-stage1/dietlibc/libdl/dlsym.c
deleted file mode 100644
index c58bb4d11..000000000
--- a/mdk-stage1/dietlibc/libdl/dlsym.c
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "_dl_int.h"
-
-#include "elf_hash.h"
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void *_dlsym(void*handle,char*symbol) {
- unsigned long*sym=0;
- if (handle) {
- struct _dl_handle*dh=(struct _dl_handle*)handle;
- unsigned long hash =elf_hash(symbol);
- unsigned long bhash=hash%HASH_BUCKET_LEN(dh->hash_tab);
- unsigned long*chain=HASH_CHAIN(dh->hash_tab);
- unsigned long ind;
- char *name=dh->dyn_str_tab;
-
-#ifdef DEBUG
-// pf(__FUNCTION__); pf(": bucket("); ph(bhash); pf(",\""); pf(symbol); pf("\")\n");
-#endif
-
- ind=HASH_BUCKET(dh->hash_tab)[bhash];
-#ifdef DEBUG
-// pf(__FUNCTION__); pf(": chain ("); ph(ind); pf(",\""); pf(symbol); pf("\")\n");
-#endif
-
- while(ind) {
- int ptr=dh->dyn_sym_tab[ind].st_name;
-#ifdef DEBUG
-// pf(__FUNCTION__); pf(": symbol(\""); pf(name+ptr); pf("\",\"); pf(symbol); pf("\")\n");
-#endif
- if (strcmp(name+ptr,symbol)==0) {
- if (ELF_ST_TYPE(dh->dyn_sym_tab[ind].st_shndx)!=0) {
- sym=(long*)(dh->mem_base+dh->dyn_sym_tab[ind].st_value);
- break; /* ok found ... */
- }
- }
- ind=chain[ind];
- }
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": symbol \""); pf(symbol); pf("\" @ "); ph((long)sym); pf("\n");
-#endif
- }
- return sym;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void*_dl_sym_search_str(struct _dl_handle*dh,char*name) {
- void *sym=0;
- struct _dl_handle*tmp;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": search for: "); pf(name); pf("\n");
-#endif
- for (tmp=_dl_root_handle;tmp && (!sym);tmp=tmp->next) {
-// if (!(tmp->flags&RTLD_GLOBAL)) continue;
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": searching in "); pf(tmp->name); pf("\n");
-#endif
- sym=_dlsym((void*)tmp,name);
-#ifdef DEBUG
- if (sym) { pf(__FUNCTION__); pf(": found: "); pf(name); pf(" @ "); ph((long)sym); pf("\n"); }
-#endif
- }
- return sym;
-}
-
-#ifdef __DIET_LD_SO__
-static
-#endif
-void*_dl_sym(struct _dl_handle*dh,int symbol) {
- char *name=dh->dyn_str_tab+dh->dyn_sym_tab[symbol].st_name;
- void*sym=_dl_sym_search_str(dh,name);
-#ifdef DEBUG
- pf(__FUNCTION__); pf(": "); ph(symbol); pf(" -> "); ph((long)sym); pf("\n");
-#endif
- return sym;
-}
-
-void*dlsym(void*handle,char*symbol) {
- void*h;
- if (handle==RTLD_DEFAULT || !handle /* RTLD_DEFAULT is NULL on glibc */ )
- h=_dl_sym_search_str(0,symbol);
- else h=_dlsym(handle,symbol);
- if (h==0) {
- _dl_error_location="dlsym";
- _dl_error_data=symbol;
- _dl_error=5;
- }
- return h;
-}
diff --git a/mdk-stage1/dietlibc/libdl/elf_hash.h b/mdk-stage1/dietlibc/libdl/elf_hash.h
deleted file mode 100644
index be55982ea..000000000
--- a/mdk-stage1/dietlibc/libdl/elf_hash.h
+++ /dev/null
@@ -1,10 +0,0 @@
-static unsigned long elf_hash(const unsigned char *name) {
- unsigned long h=0, g;
-
- while (*name) {
- h = (h<<4) + *(name++);
- if ((g = h&0xf0000000)) h ^= g>>24;
- h &= ~g;
- }
- return h;
-}
diff --git a/mdk-stage1/dietlibc/libdl/test/test.c b/mdk-stage1/dietlibc/libdl/test/test.c
deleted file mode 100644
index d467134ba..000000000
--- a/mdk-stage1/dietlibc/libdl/test/test.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <dlfcn.h>
-
-int main(int argc, char **argv)
-{
- void *Hlib;
-
-// if (Hlib=dlopen("libtest.so", RTLD_LAZY)) {
- if (Hlib=dlopen("libtest.so", RTLD_NOW)) {
- void (*t)(void) = dlsym(Hlib,"test");
- if (t) {
- printf("test @ %08lx\n",(long)t);
- t();
- }
- dlclose(Hlib);
- }
- else {
- printf("%s\n",dlerror());
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libdl/test/test_so.c b/mdk-stage1/dietlibc/libdl/test/test_so.c
deleted file mode 100644
index 09d243c56..000000000
--- a/mdk-stage1/dietlibc/libdl/test/test_so.c
+++ /dev/null
@@ -1,11 +0,0 @@
-
-int* test();
-
-int err
-=(int)test
-;
-
-int* test() {
- write(1,"helo\n",5);
- return &err;
-}
diff --git a/mdk-stage1/dietlibc/liblatin1/latin1-iscntrl.c b/mdk-stage1/dietlibc/liblatin1/latin1-iscntrl.c
deleted file mode 100644
index 5a6361442..000000000
--- a/mdk-stage1/dietlibc/liblatin1/latin1-iscntrl.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int iscntrl(int x) {
- unsigned char c=x&0xff;
- return (c<32) || (c>=127 && c<=160);
-}
diff --git a/mdk-stage1/dietlibc/liblatin1/latin1-isgraph.c b/mdk-stage1/dietlibc/liblatin1/latin1-isgraph.c
deleted file mode 100644
index e79a19e52..000000000
--- a/mdk-stage1/dietlibc/liblatin1/latin1-isgraph.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <ctype.h>
-
-int isgraph(int x) {
- unsigned char c=x&0xff;
- return (c>=33 && c<=126) || (c>=161 && c<=255);
-}
-
diff --git a/mdk-stage1/dietlibc/liblatin1/latin1-islower.c b/mdk-stage1/dietlibc/liblatin1/latin1-islower.c
deleted file mode 100644
index c5ad18d1e..000000000
--- a/mdk-stage1/dietlibc/liblatin1/latin1-islower.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int islower(int c) {
- unsigned char x=c&0xff;
- return (x>='a' && x<='z') || (x>=223 && x<=255 && x!=247);
-}
diff --git a/mdk-stage1/dietlibc/liblatin1/latin1-isprint.c b/mdk-stage1/dietlibc/liblatin1/latin1-isprint.c
deleted file mode 100644
index 9493892b1..000000000
--- a/mdk-stage1/dietlibc/liblatin1/latin1-isprint.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int isprint(int x) {
- unsigned char c=x&0xff;
- return (c>=32 && c<=126) || (c>=160 && c<=255);
-}
diff --git a/mdk-stage1/dietlibc/liblatin1/latin1-isupper.c b/mdk-stage1/dietlibc/liblatin1/latin1-isupper.c
deleted file mode 100644
index a024548fd..000000000
--- a/mdk-stage1/dietlibc/liblatin1/latin1-isupper.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <ctype.h>
-
-int isupper(int c) {
- unsigned char x=c&0xff;
- return (x>='A' && x<='Z') || (x>=192 && x<=222 && x!=215);
-}
diff --git a/mdk-stage1/dietlibc/libm/acosh.c b/mdk-stage1/dietlibc/libm/acosh.c
deleted file mode 100644
index a09a4c9f0..000000000
--- a/mdk-stage1/dietlibc/libm/acosh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math.h>
-
-double acosh ( double x )
-{
- return log ( x + sqrt (x*x - 1.) );
-}
diff --git a/mdk-stage1/dietlibc/libm/asinh.c b/mdk-stage1/dietlibc/libm/asinh.c
deleted file mode 100644
index 49c6b467f..000000000
--- a/mdk-stage1/dietlibc/libm/asinh.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <math.h>
-
-double asinh ( double x )
-{
- return log ( x + sqrt (x*x + 1.) );
-}
diff --git a/mdk-stage1/dietlibc/libm/atanh.c b/mdk-stage1/dietlibc/libm/atanh.c
deleted file mode 100644
index bdb3367be..000000000
--- a/mdk-stage1/dietlibc/libm/atanh.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <math.h>
-
-extern const float __half;
-
-double atanh ( double x )
-{
- return __half * log ( (1.+x) / (1.-x) );
-}
diff --git a/mdk-stage1/dietlibc/libm/bessel.c b/mdk-stage1/dietlibc/libm/bessel.c
deleted file mode 100644
index ba8a1afcb..000000000
--- a/mdk-stage1/dietlibc/libm/bessel.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*--------------------------------------------------------------------------*
-
-Name j0, j1, jn - Bessel functions
- y0, y1, yn - Weber functions
-
-Usage double j0 (double x);
- double j1 (double x);
- double jn (int n, double x);
- double y0 (double x);
- double y1 (double x);
- double yn (int n, double x);
-
-Prototype in math.h
-
-Description j0, j1 and jn calculate the Bessel function.
- y0, y1 and yn calcualte the Weber function.
-
-Return value return their return values as doubles.
-
-*---------------------------------------------------------------------------*/
-
-#include <math.h>
-
-#define M_C 0.5772156649015328
-#if 0
-#define M_1_PI 0.318309886183790671538
-#define M_2_PI 0.636619772367581343076
-#define M_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148
-#endif
-
-
-#define EXPL(x) ((((short *)&x)[4] & 0x7FFF) >> 0)
-#define EXPD(x) ((((short *)&x)[3] & 0x7FF0) >> 4)
-#define EXPF(x) ((((short *)&x)[1] & 0x7F80) >> 7)
-
-#define SQUARE(x) (long) (My - (x) * (x) )
-
-
-static long double P ( int My, double* x )
-{
- long double Sum = 0.;
- long double Fact = 1.;
- long double z182 = -0.015625 / (x[0] * x[0]);
- register int i;
-
- for ( i = 1; ; i += 2 ) {
- Fact *= SQUARE(i+i-1) * SQUARE(i+i+1) * z182 / (i*(i+1));
- if ( EXPL (Fact) < 0x3FFF-53 )
- break;
- Sum += Fact;
- }
- return 1. + Sum;
-}
-
-static long double Q ( int My, double* x )
-{
- long double Fact = (My-1) / x[0] * 0.125;
- long double Sum = Fact;
- long double z182 = -0.015625 / (x[0]*x[0]);
- register int i;
-
- for ( i = 2; ; i += 2 ) {
- Fact *= SQUARE(i+i-1) * SQUARE(i+i+1) * z182 / (i*(i+1));
- if ( EXPL (Fact) < 0x3FFF-53 )
- break;
- Sum += Fact;
- }
- return Sum;
-}
-
-
-static long double ___jn ( int n, double* x )
-{
- long double Sum;
- long double Fact;
- long double y;
- register int i;
- double xx;
- long double Xi;
- int My;
-
- if ( n < 0 )
- return n & 1 ? ___jn (-n, x) : -___jn (-n, x);
-
- if ((x[0] >= 17.7+0.0144*(n*n))) {
- Xi = x[0] - M_PI * (n*0.5 + 0.25);
- My = n*n << 2;
-
- return sqrt ( M_2_PI/x[0] ) * ( P(My,x) * cos(Xi) - Q(My,x) * sin(Xi) );
- }
- xx = x[0] * 0.5;
- Sum = 0.;
- Fact = 1.;
- y = -xx * xx;
-
- for ( i = 1; i <= n; i++ )
- Fact *= xx/i;
- for ( i = 1; ; i++ ) {
- Sum += Fact;
- Fact *= y / (i*(n+i));
- if ( EXPL (Sum) - EXPL(Fact) > 53 || !EXPL(Fact) )
- break;
- }
- return Sum;
-}
-
-
-static long double ___yn ( int n, double* x )
-{
- long double Sum1;
- long double Sum2;
- long double Fact1;
- long double Fact2;
- long double F1;
- long double F2;
- long double y;
- register int i;
- double xx;
- long double Xi;
- unsigned int My;
-
- if ( EXPD (x[0]) == 0 )
- return -1./0.; /* ignore the gcc warning, this is intentional */
-
- if ( (x[0] >= (n>=32 ? 25.8 : (n<8 ? 17.4+0.1*n : 16.2+0.3*n))) ) {
- Xi = x[0] - M_PI * (n*0.5+0.25);
- My = n*n << 2;
-
- return sqrt ( M_2_PI / x[0] ) * ( P(My,x) * sin(Xi) + Q(My,x) * cos(Xi) );
- }
-
- Sum1 = Sum2 = F1 = F2 = 0;
- Fact1 = 1. / (xx = x[0] * 0.5 );
- Fact2 = 1.;
- y = xx*xx;
-
- for ( i = 1; i < n; i++ )
- Fact1 *= (n-i) / xx;
-
- for ( i = 1; i <= n; i++ ) {
- Sum1 += Fact1;
- if ( i == n )
- break;
- Fact1 *= y/(i*(n-i));
- }
-
- for (i=1; i<=n; i++) {
- Fact2 *= xx / i;
- F1 += 1. / i;
- }
-
- for ( i = 1; ; i++ ) {
- Sum2 += Fact2 * (F1+F2);
- Fact2 *= -y / (i*(n+i));
- if ( EXPL (Sum2) - EXPL (Fact2) > 53 || !EXPL (Fact2) )
- break;
- F1 += 1. / (n+i);
- F2 += 1. / i;
- }
-
- return M_1_PI * (2. * (M_C + log(xx)) * ___jn (n, x) - Sum1 - Sum2);
-}
-
-
-double j0 ( double x ) { return ___jn ( 0,&x ); }
-double j1 ( double x ) { return ___jn ( 1,&x ); }
-double jn ( int n, double x ) { return ___jn ( n,&x ); }
-double y0 ( double x ) { return ___yn ( 0,&x ); }
-double y1 ( double x ) { return ___yn ( 1,&x ); }
-double yn ( int n, double x ) { return ___yn ( n,&x ); }
-
diff --git a/mdk-stage1/dietlibc/libm/cosh.c b/mdk-stage1/dietlibc/libm/cosh.c
deleted file mode 100644
index f64d59106..000000000
--- a/mdk-stage1/dietlibc/libm/cosh.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math.h>
-
-extern const float __half;
-
-double cosh ( double x )
-{
- long double y = exp (x);
- return (y + 1./y) * __half;
-}
diff --git a/mdk-stage1/dietlibc/libm/erf.c b/mdk-stage1/dietlibc/libm/erf.c
deleted file mode 100644
index 63f52d81f..000000000
--- a/mdk-stage1/dietlibc/libm/erf.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "dietlibm.h"
-
-/*--------------------------------------------------------------------------*
- z
- 1 | -x²/2
-Name erf(z) = --------- | e dx
- sqrt(2pi) |
- 0
-
- oo
- 1 | -x²/2
- erfc(z) = -------- | e dx
- sqrt(2pi) |
- z
-
-Usage double erf (double x);
- double erfc(double x);
-
-Prototype in math.h
-
-Description erf(x) is the probability a normal distributed event occures
- within the range [0,x]. erfc(x) is the probability a normal
- distributed event occures within the range [x,oo].
-
-Return value return their respective function value.
-
-*---------------------------------------------------------------------------*/
-
-
-/* even function in (0): Coefficients for gamma(0) */
-
-static const double tab1 [9 + 1] = {
- 0.398942280401432677926, -0.066490380066905446321, 9.97355701003581694794E-3, -1.18732821548045439878E-3, 1.15434687616155288764E-4, -9.44465625950361453450E-6, 6.65969351631665127484E-7, -4.12266741486268888409E-8, 2.27352982437280636972E-9, -1.13011716416192129505E-10
-};
-
-/* non even or odd function in (x), x>0: Coefficients for gamma(x), x>0 */
-
-static const double tab2 [] [31 + 1] = {
- { -0.158655253931457051468, +0.241970724519143349823, -0.120985362259571674911, 0, +0.0201642270432619458197, -4.03284540865238916394E-3, -2.01642270432619458197E-3, +7.68161030219502697887E-4, +1.20025160971797296538E-4, -8.80184513793180174807E-5, -1.86705805956129127862E-6, +7.37124220917704609315E-6, -4.72826391707080259142E-7, -4.83395817951682973566E-7, +6.57036391970156141055E-8, +2.5544260402922190768E-8, -5.4292285616752144141E-9, -1.08932444506260820153E-9, +3.44399256708718202774E-10, +3.6021429664641554881E-11, -1.81147204852239925966E-11, -7.66935128389784976374E-13, +8.19047721646461768154E-13, -3.78144699611990981391E-15, -3.24856460059989147863E-14, +1.44438130842455313227E-15, +1.14391687912824634892E-15, -9.38053726039148625184E-17, -3.59908648108845288945E-17, +4.36020846676166022246E-18, +1.01298640134330880603E-18, -1.68640470512244526894E-19 },
- { -0.0227501319481792072104, +0.0539909665131880519553, -0.0539909665131880519553, +0.0269954832565940259776, -4.49924720943233766301E-3, -2.24962360471616883129E-3, +1.34977416282970129877E-3, -1.17837426913704081544E-4, -1.15159303574756261652E-4, +3.70473728554448438507E-5, +2.82690796888936559912E-6, -3.54513195524355369855E-6, +3.76695631261094890352E-7, +1.92024079214184701051E-7, -5.22690859049557191018E-8, -4.91799344974114749666E-9, +3.66377919234006038965E-9, -1.5981997209104676352E-10, -1.73812379171063320997E-10, +2.62403075313043113473E-11, +5.60918720760414713346E-12, -1.72126983666416144614E-12, -8.63428809787622525331E-14, +7.89441765474563834480E-14, -3.13747960081562321348E-15, -2.77519506625391157547E-15, +3.29321944203493138076E-16, +7.44375150395529134369E-17, -1.66428523299294690222E-17, -1.32735612757620496568E-18, +6.24122437514304644794E-19, +1.12471123532438919306E-21 },
- { -1.3498980316300945272E-3, +4.43184841193800717687E-3, -6.64777261790701076574E-3, +5.90913121591734290293E-3, -3.32388630895350538287E-3, +1.10796210298450179421E-3, -1.10796210298450179595E-4, -8.44161602273906129349E-5, +4.35270826172482847927E-5, -6.30190085030867423515E-6, -1.9785037553294674925E-6, +1.05520200284238266374E-6, -1.13913852579575399458E-7, -4.81174572974454799623E-8, +1.78216871733806513653E-8, -5.85637697215219690327E-10, -9.29791350219350980904E-10, +1.96377023046901260016E-10, +1.58870373467897094393E-11, -1.22699105512396660364E-11, +1.08794270836433192571E-12, +3.99646995170699427940E-13, -1.01594404465456044793E-13, -3.33469605506835759271E-15, +4.46588935876766499879E-15, -4.08076707607833277747E-16, -1.17808602368979218862E-16, +2.76224909899945482352E-17, +1.09206599392049874162E-18, -1.03145418746203977253E-18, +6.79984672177279963209E-20, +2.55831283729070534712E-20 },
- { -3.16712418331199212695E-5, +1.33830225764885351832E-4, -2.67660451529770703664E-4, +3.34575564412213379613E-4, -2.89965489157251595673E-4, +1.8178605666396926958E-4, -8.25286392216793003064E-5, +2.55180251904870680833E-5, -3.91665839292075186649E-6, -7.40182052221464123606E-7, +6.44220233592652481453E-7, -1.73701553397390201613E-7, +9.09595464817154590424E-9, +9.44943118114780783705E-9, -3.29957075383376125942E-9, +2.94920746951281580686E-10, +1.18744773902482360274E-10, -4.42039585809856402486E-11, +3.61422484008923382324E-12, +1.43638335494248833511E-12, -4.58476794992724591068E-13, +2.23496663226445199624E-14, +1.57839046076890756440E-14, -3.67258220998453293248E-15, -1.69716269032291432153E-17, +1.43497778353923791279E-16, -2.14499365995613073838E-17, -1.93255135682867953692E-18, +1.01377499752128183701E-18, -7.55713215369572830154E-20, -2.25510650946079103289E-20, +5.26633993110171917109E-21 },
- { -2.86651571879193912033E-7, +1.48671951473429770924E-6, -3.7167987868357442731E-6, +5.9468780589371908374E-6, -6.81413110919886450076E-6, +5.92209940035828587496E-6, -4.02653201907205629582E-6, +2.17108246596119665457E-6, -9.25512396325170449452E-7, +3.03096091545533908077E-7, -6.92802772105295808398E-8, +6.69226396924248971087E-9, +2.46006252876483997508E-9, -1.41806830376639605249E-9, +3.44251040657349801884E-10, -2.6965166176434937652E-11, -1.16546962748761528049E-11, +4.91490145086991326748E-12, -7.55854519365765424197E-13, -4.53988828124843593484E-14, +4.71533558309731405623E-14, -9.17323049919073092370E-15, +4.35542982587998484108E-17, +3.71238868922011013332E-16, -7.90772907386322623053E-17, +1.58463483904927528072E-18, +2.61503941976309571331E-18, -5.40699423853895351239E-19, +6.61825040533797444037E-21, +1.68378440730394776550E-20, -3.01930850797704474581E-21, -3.80658085177617928332E-23 },
- { -9.8658764503769814198E-10, +6.07588284982328549581E-9, -1.82276485494698564874E-8, +3.54426499573024987263E-8, -5.01260335110421053478E-8, +5.48348427196551516061E-8, -4.81513715848495375522E-8, +3.47446467489597046263E-8, -2.08994095347716137282E-8, +1.0554987922587771203E-8, -4.4752674615729637229E-9, +1.57746505810079893253E-9, -4.49697115294871911476E-10, +9.63210042443717269402E-11, -1.16300711402336909847E-11, -1.31070037808191623761E-12, +1.16993345829435057496E-12, -3.40636420312606285351E-13, +5.23724821541706939045E-14, +3.93541148139975862961E-16, -2.59886413069218394637E-15, +7.24729556829529838503E-16, -8.51485747763574768020E-17, -7.86503719948806184368E-18, +5.35986191777031053618E-18, -9.84873767617830925356E-19, +2.93759678710573738811E-20, +2.85458592629073152182E-20, -7.12725445137377009753E-21, +5.25419393758902871947E-22, +1.24299023131490990316E-22, -4.04419210566489645405E-23 },
- { -1.27981254388583500631E-12, +9.1347204083645933588E-12, -3.19715214292760767584E-11, +7.30777632669167468738E-11, -1.22557498812224960902E-10, +1.60618833847077433236E-10, -1.71047639646627010648E-10, +1.51926349902927316213E-10, -1.14609023345779936276E-10, +7.43697341394886835864E-11, -4.18713451557949730558E-11, +2.05606050331840905587E-11, -8.82161466664564577599E-12, +3.30031395277698236679E-12, -1.06851205331295409813E-12, +2.94333808755089195146E-13, -6.64411715537625335642E-14, +1.11264855981436243262E-14, -8.52918435682649455145E-16, -2.38837813662069487819E-16, +1.23994634366691956599E-16, -3.05269770279941723219E-17, +4.34539596489459676621E-18, -5.55819387468189608390E-20, -1.56974672263484202926E-19, +4.60835492190702561464E-20, -6.61112150617493330405E-21, +7.28424268476803924831E-23, +2.09156005934313228089E-22, -5.29080328670107625978E-23, +5.61375000671507211726E-24, +3.82199410465700894394E-25 },
- { -6.22096057427178413283E-16, +5.05227108353689229741E-15, -2.02090843341475691883E-14, +5.30488463771373691202E-14, -1.02729512031916810045E-13, +1.56409892294496290711E-13, -1.94849254788406146283E-13, +2.04064637342166989709E-13, -1.83187931471980616892E-13, +1.42994099344605424348E-13, -9.8111907789286062426E-14, +5.96545975367403288587E-14, -3.23370114040930933005E-14, +1.56932853967230342257E-14, -6.83548101324218922896E-15, +2.67410077774155118457E-15, -9.38313996431647887562E-16, +2.94090734842381109313E-16, -8.16448235152204729921E-17, +1.9758222496699617607E-17, -4.03590262164308783690E-18, +6.43662361965717426956E-19, -5.93446415094778572090E-20, -6.07164564350191039536E-21, +4.38906686886388095825E-21, -1.17175498170220204828E-21, +1.98482140750318604418E-22, -1.70803571702439545981E-23, -1.94600332107885234554E-24, +1.10477141319981582738E-24, -2.31975718243847439962E-25, +2.54148402104633283670E-26 },
- { -1.12858840595384064928E-19, +1.02797735716689148111E-18, -4.62589810725101166456E-18, +1.37063647622252197466E-17, -3.0068337697131575822E-17, +5.2067053140503053517E-17, -7.40914680178037035E-17, +8.9062000172830588611E-17, -9.22563786210983011008E-17, +8.35975730487397716492E-17, -6.70372487553237232779E-17, +4.80088566412770650047E-17, -3.09280630297969106245E-17, +1.8026496052333452774E-17, -9.54924880090907168481E-18, +4.61362333444861021959E-18, -2.03812361224098073479E-18, +8.24578860830779678155E-19, -3.0572087552697254564E-19, +1.03827313453936543577E-19, -3.22407758977306397999E-20, +9.12052549039695437376E-21, -2.33541947993595580264E-21, +5.35339963891271164659E-22, -1.07674173853083520575E-22, +1.82413373046113374293E-23, -2.33864726317468746329E-24, +1.29928813344150027051E-25, +3.86668349205203745336E-26, -1.63203452712600670685E-26, +3.65165372186699607411E-27, -5.51243539825332137371E-28 },
- { -7.61985302416052609616E-24, +7.69459862670641937159E-23, -3.84729931335320968601E-22, +1.26960877340655919637E-21, -3.10990027829384449637E-21, +6.02935924057670511377E-21, -9.6342786971886625897E-21, +1.30454744197246721374E-20, -1.52745988785284834672E-20, +1.57034665186695273938E-20, -1.43457243961336621961E-20, +1.17567385540485497556E-20, -8.7104848256363928121E-21, +5.87137214731944288587E-21, -3.61951956727412561213E-21, +2.04954715001535632502E-21, -1.06982832733527370879E-21, +5.1628428354196120786E-22, -2.30885865897937993512E-22, +9.58556229281154921137E-23, -3.69911125531027884646E-23, +1.32784897023484841369E-23, -4.43433027366044567275E-24, +1.37688611947822111040E-24, -3.96971995397574368025E-25, +1.06008163579031271153E-25, -2.61149430849477426613E-26, +5.89698164189548613154E-27, -1.20793190886658723050E-27, +2.20446342551066852143E-28, -3.46061447029252398335E-29, +4.28913922246949096952E-30 }
-};
-
-static const double tab3 [8] = { +1, -1, +3, -15, +105, -945, +10395, -135135.0 };
-
-
-/*
- Calculated: oo
- 1 | -x²/2
- gauss(z) = --------- | e dx
- sqrt(2pi) |
- z
-
- gauss ( 0) = 0.5
- gauss ( 1) ~ 0.1586
- gauss ( 2) ~ 0.02275
- gauss ( 4) ~ 3.17e-5
- gauss (10) ~ 7.62e-24
- gauss (oo) = 0
-
- Note: only for z>0
-*/
-#include <stdio.h>
-#include <math.h>
-
-#define M_1_SQRT2PI 0.398942280401432686
-
-static long double gauss ( double x )
-{
- unsigned int i = (unsigned int)(x + 0.5);
- double y = x * x;
-
- if ( i > 150 ) return 0.;
- if ( i > 10 ) return M_1_SQRT2PI * exp (-0.5*y) / x * __poly (1./y, 7, tab3);
- if ( i > 0 ) return -__poly ((x-i), 31, tab2 [i-1]);
- return 0.5 - x * __poly (y, 9, tab1);
- }
-
-double erf ( double x )
-{
- return x < 0. ? -0.5 + gauss(-x) : 0.5 - gauss(x);
-}
-
-double erfc ( double x )
-{
- return x < 0. ? 1.0 - gauss(-x) : gauss(x);
-}
-
diff --git a/mdk-stage1/dietlibc/libm/gamma.c b/mdk-stage1/dietlibc/libm/gamma.c
deleted file mode 100644
index d5f3e4275..000000000
--- a/mdk-stage1/dietlibc/libm/gamma.c
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "dietlibm.h"
-
-/*--------------------------------------------------------------------------*
-
-Name gamma, lgamma - gamma function
-
-Usage double gamma (double x);
- double lgamma(double x);
- extern int signgam;
-
-Prototype in math.h
-
-Description gamma returns the logarithm of the absolute value of the
- gamma function. So it is possible â(x) for very large x.
- The sign is stored in signgam, a extern variable
- overwritten during every call to gamma(). lgamma() is
- a synonym for gamma().
- You can calculate â(x) by the following sequence:
-
- double gammafunction(double x)
- { double y=exp(gamma(x));
-
- return signgam ? -y : +y;
- }
-
-Return value gamma returns a value in range (-0.1208, +oo). For a input
- value of zero, it returns +oo and errno is set to:
-
- ERANGE Result out of range
-
-*---------------------------------------------------------------------------*/
-
-#include <stdlib.h>
-#include <math.h>
-
-#define B0 + 1.0l/ 6/ 1/ 2
-#define B1 - 1.0l/ 30/ 3/ 4
-#define B2 + 1.0l/ 42/ 5/ 6
-#define B3 - 1.0l/ 30/ 7/ 8
-#define B4 + 5.0l/ 66/ 9/10
-#define B5 - 691.0l/2730/11/12
-#define B6 + 7.0l/ 6/13/14
-#define B7 - 3617.0l/ 510/15/16
-#define B8 + 43867.0l/ 798/17/18
-#define B9 - 174611.0l/ 330/19/20
-#define B10 + 854513.0l/ 138/21/22
-#define B11 - 236364091.0l/2730/23/24
-#define B12 + 8553103.0l/ 6/25/26
-
-static const double coeff[] = { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10 };
-int signgam;
-
-#define EXPL(x) (((short *)&x)[4] & 0x7FFF)
-
-static double logfact ( long double x )
-{
- long double z = 2. * M_PI * x;
- register int e = EXPL (x);
-
- static unsigned char list [] = { 6, 4, 3, 3, 2, 2 };
-
- return (log(x) - 1) * x + 0.5*log(z) + __poly (1./(x*x), e<0x4003 ? 10 : (e>0x4008 ? 1 : list [e-0x4003] ), coeff) / x;
-}
-
-
-double lgamma ( double x )
-{
- register int k = floor (x);
- long double w;
- long double y;
- long double z;
-
- signgam = 0;
-
- if ( k >= 7 )
- return logfact (x-1);
-
- if ( k == x )
- switch (k) {
- case 1 :
- case 2 : return 0.000000000000000000000000000l;
- case 3 : return 0.693147180559945309432805516l;
- case 4 : return 1.791759469228055000858148560l;
- case 5 : return 3.178053830347945619723759592l;
- case 6 : return 4.787491742782045994244981560l;
- default: return 1./0.; /* ignore the gcc warning, this is intentional */
- }
-
- z = logfact (y = x - k + 7.0 - 1);
- w = 1;
- for ( k = 7 - k; k--; )
- w *= y, y -= 1.;
-
- signgam = k >= 0 ? 0 : k & 1;
- return z - log (w);
-}
-
-double gamma ( double val ) __attribute__ ((weak,alias("lgamma")));
diff --git a/mdk-stage1/dietlibc/libm/ipow.c b/mdk-stage1/dietlibc/libm/ipow.c
deleted file mode 100644
index 399986ea1..000000000
--- a/mdk-stage1/dietlibc/libm/ipow.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#define _GNU_SOURCE
-#include <math.h>
-/*
- * This is not standard, but often you only need such this function
- * which is much shorter than the generic pow() function.
- *
- * double ipow ( double mant, int expo );
- */
-
-double ipow ( double mant, int expo )
-{
- double ret = 1.;
- unsigned int e = expo; /* Some attention is necessary for expo = 2^31 */
-
- if ( (int)e < 0 ) {
- e = -e;
- mant = 1./mant;
- }
-
- while (1) {
- if ( e & 1 )
- ret *= mant;
- if ( (e >>= 1) == 0 )
- break;
- mant *= mant;
- }
-
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/libm/poly.c b/mdk-stage1/dietlibc/libm/poly.c
deleted file mode 100644
index cdcfb8c5c..000000000
--- a/mdk-stage1/dietlibc/libm/poly.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*--------------------------------------------------------------------------*
-
-Name __poly - generates a polynomial from arguments
-
-Usage double __poly ( double x, int n, const double* c );
-
-Prototype in math.h
-
-Description __poly generates a polynomial in x, of degree n, with
- coefficients c[0], c[1], ..., c[n]. For example, if n=4,
- the generated polynomial is
-
- c[4]*x^4 + c[3]*x^3 + c[2]*x^2 + c[1]*x + c[0]
-
- The polynomial is calculated using Horner's method:
-
- polynom = (..((x*c[n] + c[n-1])*x + c[n-2])..)*x + c[0]
-
-Return value __poly returns the value of the polynomial as evaluated for
- the given x.
- A range error occurs if the result exceeds double range.
-
-*---------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include "dietlibm.h"
-
-double __poly ( double x, size_t n, const double* c)
-{
- long double ret;
- size_t i;
-
- i = n;
- c += n;
- ret = 0;
- do
- ret = ret * x + *c--;
- while ( i-- );
-
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/libm/pow.c b/mdk-stage1/dietlibc/libm/pow.c
deleted file mode 100644
index e0e5a2983..000000000
--- a/mdk-stage1/dietlibc/libm/pow.c
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#include <math.h>
-#include "dietlibm.h"
-
-double pow ( double mant, double expo )
-{
- unsigned int e;
- long double ret;
-
- /* special cases 0^x */
- if ( mant == 0. ) {
- if ( expo > 0. )
- return 0.;
- else if ( expo == 0. )
- return 1.;
- else
- return 1./mant;
- }
-
- /* special cases x^n with n is integer */
- if ( expo == (int) (e = (int) expo) ) {
-
- if ( (int)e < 0 ) {
- e = -e;
- mant = 1./mant;
- }
-
- ret = 1.;
-
- while (1) {
- if ( e & 1 )
- ret *= mant;
- if ( (e >>= 1) == 0 )
- break;
- mant *= mant;
- }
- return ret;
- }
-
- /* normal case */
- return exp2 ( log2 (mant) * expo );
-}
diff --git a/mdk-stage1/dietlibc/libm/rint.c b/mdk-stage1/dietlibc/libm/rint.c
deleted file mode 100644
index b6f0d8f85..000000000
--- a/mdk-stage1/dietlibc/libm/rint.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <math.h>
-
-double rint(double x) {
- return floor(x+0.5);
-}
diff --git a/mdk-stage1/dietlibc/libm/sinh.c b/mdk-stage1/dietlibc/libm/sinh.c
deleted file mode 100644
index ae4542d25..000000000
--- a/mdk-stage1/dietlibc/libm/sinh.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <math.h>
-
-extern const float __half;
-
-double sinh ( double x )
-{
- long double y = exp (x);
- return (y - 1./y) * __half;
-}
diff --git a/mdk-stage1/dietlibc/libm/tanh.c b/mdk-stage1/dietlibc/libm/tanh.c
deleted file mode 100644
index 21dc3d0c0..000000000
--- a/mdk-stage1/dietlibc/libm/tanh.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math.h>
-
-double tanh ( double x )
-{
- long double y = exp (x + x);
- return (y - 1.) / (y + 1.);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/CHANGES b/mdk-stage1/dietlibc/libpthread/CHANGES
deleted file mode 100644
index 63376623b..000000000
--- a/mdk-stage1/dietlibc/libpthread/CHANGES
+++ /dev/null
@@ -1,51 +0,0 @@
-This is the pthread implementation of dietlibc.
-Written from scratch by Olaf Dreesen.
-
-Mon Aug 6 15:46:39 MEST 2001
-
- Ups... did the wrong error handling... the error is returned not put to
- errno...
- probably thread_key is not SMP save...
-
-Thu Apr 12 16:47:12 MEST 2001
-
- added conditional variables...
- except pthread_cond_timedwait all should work man-page like
- pthread_cond_timedwait dosen't handle cancel request according to man-page
-
- added thread specific key handling (all according to man-page)
-
-Fri Mar 30 18:47:37 MEST 2001
-
- uff found some logic errors and fixed them.
- pthread_create had a problem with user provided stacks.
-
-
-Fri Mar 23 14:09:54 MET 2001
-
- arg.. the kernel-header are so inconsistent...
- on x86 it works on arm and sparc not due to MISSING defines, miss-places
- includes and __KERNEL__ checks....
- the best in this category is that the kernel-header are changed that the
- buggy (g)libc haven't to change... (f..k glibc, the headers HAVE to be
- CONSISTENT)
- a public defined symbol on arch X have to be in Y to unless marked...
- that is mainly speaking SCHED.H ! arg....
-
-
-Wed Mar 14 04:28:45 MET 2001
-
- I have implemented the "Manager Thread" so that nested thread creation
- works. really ugly stuff... don't look at it unless you're sitting on solid
- ground.
-
-
-Mon Mar 12 16:16:00 CET 2001
-
- first of all:
- I strongly suggest NOT to use it yet, it's very, very, ... very
- experimental. I guess you got the point. there is still much debug code,
- incomplete functions and unusable states....
-
- I'm still working on the final alpha...
-
diff --git a/mdk-stage1/dietlibc/libpthread/Makefile b/mdk-stage1/dietlibc/libpthread/Makefile
deleted file mode 100644
index f2ab8d8dc..000000000
--- a/mdk-stage1/dietlibc/libpthread/Makefile
+++ /dev/null
@@ -1,140 +0,0 @@
-all: libpthread.a
-
-ARCH=$(shell uname -m | sed 's/i[4-9]86/i386/')
-
-CFLAGS=-pipe
-CROSS=
-
-CC=gcc
-
-VPATH=../$(ARCH)/
-
-PTHREAD_OBJS = \
- __testandset.o \
- \
- pthread_internal.o \
- pthread_key.o \
- \
- pthread_once.o pthread_spinlock.o \
- \
- pthread_create.o pthread_detach.o \
- pthread_join.o pthread_self.o \
- pthread_exit.o pthread_equal.o \
- \
- pthread_cleanup_push.o \
- pthread_cleanup_pop.o \
- \
- pthread_attr_getdetachstate.o \
- pthread_attr_getinheritsched.o \
- pthread_attr_getschedparam.o \
- pthread_attr_getschedpolicy.o \
- pthread_attr_getscope.o \
- pthread_attr_getstackaddr.o \
- pthread_attr_getstacksize.o \
- pthread_attr_init.o \
- pthread_attr_setdetachstate.o \
- pthread_attr_setinheritsched.o \
- pthread_attr_setschedparam.o \
- pthread_attr_setschedpolicy.o \
- pthread_attr_setscope.o \
- pthread_attr_setstackaddr.o \
- pthread_attr_setstacksize.o \
- \
- pthread_cancel.o pthread_setcancelstate.o \
- pthread_setcanceltype.o pthread_testcancel.o \
- \
- pthread_mutex_init.o \
- pthread_mutex_destroy.o \
- pthread_mutex_lock.o \
- pthread_mutex_trylock.o \
- pthread_mutex_unlock.o \
- \
- pthread_mutexattr_getkind_np.o \
- pthread_mutexattr_init.o \
- pthread_mutexattr_setkind_np.o \
- \
- pthread_condattr.o \
- pthread_cond_broadcast.o \
- pthread_cond_destroy.o \
- pthread_cond_init.o \
- pthread_cond_signal.o \
- pthread_cond_timedwait.o \
- pthread_cond_wait.o \
- \
- pthread_key_create.o \
- pthread_key_delete.o \
- pthread_getspecific.o \
- pthread_setspecific.o \
- \
- pthread_atfork.o \
- pthread_sys_alloc.o \
- pthread_sys_close.o \
- pthread_sys_create.o \
- pthread_sys_fcntl.o \
- pthread_sys_fsync.o \
- pthread_sys_fdatasync.o \
- pthread_sys_nanosleep.o \
- pthread_sys_logging.o \
- pthread_sys_open.o \
- pthread_sys_pause.o \
- pthread_sys_read.o \
- pthread_sys_sigsuspend.o \
- pthread_sys_tcdrain.o \
- pthread_sys_waitpid.o \
- pthread_sys_write.o
-
-%.o : %.c
- $(CC) $(CFLAGS) -c -o $@ $?
-
-include ../$(ARCH)/Makefile.add
-
-ifeq ($(CFLAGS),-pipe)
-CFLAGS+=-O -fomit-frame-pointer
-endif
-
-#CFLAGS = -g
-CFLAGS += -Wall
-
-CFLAGS += -I.. -I../include -Wall
-
-PWD=$(shell pwd)
-
-.SUFFIXES:
-.SUFFIXES: .S .c
-
-% :: %,v
-
-%.o: %.S
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $<
-
-%.o: %.c
- $(CROSS)$(CC) -I. -Iinclude $(CFLAGS) -c $<
-# $(CROSS)strip -x -R .comment -R .note $@
-
-libpthread.a: $(PTHREAD_OBJS)
- ar cr $@ $^
-
-libpthread.so: libpthread.a
- $(CROSS)ld -whole-archive -shared -o $@ $^
-
-
-clean:
- $(RM) *.o *.a *.so *.out *~
-
-exports: libpthread.a
- nm -g libpthread.a | grep -w T | awk '{ print $$3 }' | sort -u > exports
-
-.PHONY: test.out
-
-test.out: test.o libpthread.a $(LIBS)
- $(CROSS)$(CC) -g $(CFLAGS) -nostdlib ../bin-$(ARCH)/start.o -o $@ $^ ../bin-$(ARCH)/dietlibc.a -lgcc
-
-
-.PHONY: sparc ppc mips arm alpha i386
-
-sparc ppc alpha i386:
- $(MAKE) ARCH=$@ CROSS=$@-linux- all t libdietc.so
-
-mips arm:
- $(MAKE) ARCH=$@ CROSS=$@-linux-gnu- all t libdietc.so
-
diff --git a/mdk-stage1/dietlibc/libpthread/README b/mdk-stage1/dietlibc/libpthread/README
deleted file mode 100644
index ee85a572d..000000000
--- a/mdk-stage1/dietlibc/libpthread/README
+++ /dev/null
@@ -1,36 +0,0 @@
-LIBPTHREAD
-
- This is the pthread implementation of dietlibc.
- Written from scratch by Olaf Dreesen.
-
-1. STATUS: near complete and should work (or not... I had a lot of heisen-bugs...)
- On non i386 archs the kernel header have major differences...
- NO workaround yet for this problems...
-
-It's like linuxthreads a clone base thread implementation.
-
-I have implemented a "Manager Thread" with all the pain it involves...
-Nested thread creation is now working fine...
-
-
-2. HOW-TO make this lib:
-
- it is a standard dietlibc helper lib...
-
-
-3. NOTES
-
-NON STANDARD SIGNAL HANDLING for the threads:
-
- SIGHUP the targeted thread is canceled
- depends on the cancel type of the thread.
-
- ASYNCHRONOUS: the signal handler will KILL the thread immediately.
-
- DEFERRED: the signal handler mark its thread as canceled.
- (only for the sig-handler to do some sane stuff...)
-
- SIGTERM the thread is KILLED
- if the thread signaled is the main thread, then ALL child-threads
- will get a SIGHUP and after some micros a SIGTERM....
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_atfork.c b/mdk-stage1/dietlibc/libpthread/pthread_atfork.c
deleted file mode 100644
index 70ca9f162..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_atfork.c
+++ /dev/null
@@ -1,77 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-#define PTHREAD_NUM_ATFORK 4
-
-static struct _pthread_fastlock __atfork_struct_lock;
-static struct {
- int used;
- void (*prepare)(void);
- void (*parent)(void);
- void (*child)(void);
-} pthread_atfork_buf[PTHREAD_NUM_ATFORK];
-
-int pthread_atfork(void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void))
-{
- int i,ret=-1;
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&__atfork_struct_lock);
-
- for (i=0;i<PTHREAD_NUM_ATFORK; ++i) {
- if (!(pthread_atfork_buf[i].used)) {
- pthread_atfork_buf[i].prepare=prepare;
- pthread_atfork_buf[i].parent=parent;
- pthread_atfork_buf[i].child=child;
- ret=0;
- break;
- }
- }
-
- __pthread_unlock(&__atfork_struct_lock);
- __NO_ASYNC_CANCEL_END;
-
- if (ret) ret=ENOMEM;
- return ret;
-}
-
-pid_t fork(void)
-{
- pid_t pid;
- int i=PTHREAD_NUM_ATFORK;
-
- __NO_ASYNC_CANCEL_BEGIN;
-
- __TEST_CANCEL();
- __pthread_lock(&__atfork_struct_lock);
-
- while (i) {
- if (pthread_atfork_buf[--i].used)
- if (pthread_atfork_buf[i].prepare)
- pthread_atfork_buf[i].prepare();
- }
-
- pid=__libc_fork();
-
- if (pid>0) { /* parent */
- for (i=0;i<PTHREAD_NUM_ATFORK;++i)
- if (pthread_atfork_buf[i].used)
- if (pthread_atfork_buf[i].parent)
- pthread_atfork_buf[i].parent();
- } else if (pid==0) { /* child */
- for (i=0;i<PTHREAD_NUM_ATFORK;++i)
- if (pthread_atfork_buf[i].used)
- if (pthread_atfork_buf[i].child)
- pthread_atfork_buf[i].child();
- }
-
- __pthread_unlock(&__atfork_struct_lock);
- __NO_ASYNC_CANCEL_END;
-
- return pid;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getdetachstate.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getdetachstate.c
deleted file mode 100644
index ccdfc0e47..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getdetachstate.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
-{
- __THREAD_INIT();
-
- *detachstate=attr->__detachstate;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getinheritsched.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getinheritsched.c
deleted file mode 100644
index 314fd8ade..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getinheritsched.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
-{
- __THREAD_INIT();
-
- *inherit = attr->__inheritsched;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedparam.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedparam.c
deleted file mode 100644
index f0a9a07d1..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedparam.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param)
-{
- __THREAD_INIT();
-
- param->sched_priority=attr->__schedparam.sched_priority;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedpolicy.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedpolicy.c
deleted file mode 100644
index 53f1bed8c..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getschedpolicy.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
-{
- __THREAD_INIT();
-
- *policy = attr->__schedpolicy;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getscope.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getscope.c
deleted file mode 100644
index 99a33110d..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getscope.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
-{
- __THREAD_INIT();
-
- *scope=PTHREAD_SCOPE_SYSTEM;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getstackaddr.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getstackaddr.c
deleted file mode 100644
index d71421901..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getstackaddr.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getstackaddr(pthread_attr_t *attr, void **stack)
-{
- __THREAD_INIT();
-
- *stack=attr->__stackaddr;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_getstacksize.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_getstacksize.c
deleted file mode 100644
index 4785979a0..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_getstacksize.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_getstacksize(pthread_attr_t *attr, size_t *stacksize)
-{
- __THREAD_INIT();
-
- *stacksize=attr->__stacksize;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_init.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_init.c
deleted file mode 100644
index fbcefa3bd..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_init.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_init(pthread_attr_t *attr)
-{
- __THREAD_INIT();
-
- memset(attr,0,sizeof(pthread_attr_t));
- attr->__stacksize=PTHREAD_STACK_SIZE;
- return 0;
-}
-
-int pthread_attr_destroy(pthread_attr_t *attr) __attribute__((alias("pthread_attr_init")));
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setdetachstate.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setdetachstate.c
deleted file mode 100644
index f5eab5816..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setdetachstate.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
-{
- __THREAD_INIT();
-
- if ((detachstate == PTHREAD_CREATE_JOINABLE) ||
- (detachstate == PTHREAD_CREATE_DETACHED)) {
- attr->__detachstate=detachstate;
- return 0;
- }
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setinheritsched.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setinheritsched.c
deleted file mode 100644
index 0b7a691e7..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setinheritsched.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
-{
- __THREAD_INIT();
-
- if ((inherit==PTHREAD_INHERIT_SCHED) ||
- (inherit==PTHREAD_EXPLICIT_SCHED)) {
- attr->__inheritsched=inherit;
- return 0;
- }
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedparam.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedparam.c
deleted file mode 100644
index a3e5a9b4a..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedparam.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param)
-{
- __THREAD_INIT();
-
- if ((attr->__schedpolicy == SCHED_OTHER) && (param->sched_priority == 0)) {
- attr->__schedparam.sched_priority=0;
- return 0;
- }
- if (((attr->__schedpolicy == SCHED_RR) || (attr->__schedpolicy == SCHED_FIFO))
- && ((param->sched_priority > 0) && (param->sched_priority < 100))) {
- attr->__schedparam.sched_priority=param->sched_priority;
- return 0;
- }
- return EINVAL;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c
deleted file mode 100644
index 227d3f7ad..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
-{
- __THREAD_INIT();
-
- if (policy==SCHED_OTHER) {
- attr->__schedpolicy=policy;
- return 0;
- }
- if ((policy==SCHED_FIFO) || (policy==SCHED_RR)) {
- if (geteuid()==0) {
- attr->__schedpolicy=policy;
- return 0;
- }
- return ENOTSUP;
- }
- else
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setscope.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setscope.c
deleted file mode 100644
index 9be11ca2d..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setscope.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setscope(pthread_attr_t *attr, int scope)
-{
- __THREAD_INIT();
-
- if (scope==PTHREAD_SCOPE_SYSTEM) return 0;
-
- if (scope==PTHREAD_SCOPE_PROCESS)
- return ENOTSUP;
- else
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setstackaddr.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setstackaddr.c
deleted file mode 100644
index 4b320cd9d..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setstackaddr.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stack)
-{
- __THREAD_INIT();
-
- attr->__stackaddr=stack;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setstacksize.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setstacksize.c
deleted file mode 100644
index 1a0aae929..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_attr_setstacksize.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
-{
- __THREAD_INIT();
-
- if (stacksize>=PTHREAD_STACK_SIZE) {
- attr->__stacksize=stacksize;
- return 0;
- }
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cancel.c b/mdk-stage1/dietlibc/libpthread/pthread_cancel.c
deleted file mode 100644
index c0ae60349..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cancel.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cancel(pthread_t th)
-{
- pthread_t j;
- _pthread_descr thread;
-
- __THREAD_INIT();
-
- j=__find_thread_id(th);
-
- if (j==-1) {
- return ESRCH;
- }
- thread = __get_thread_struct(j);
-
- if (thread==0) {
- return ESRCH;
- }
-
- if (thread->cancelstate!=PTHREAD_CANCEL_DISABLE) {
- thread->canceled=1;
- if (thread->canceltype!=PTHREAD_CANCEL_DEFERRED) {
- kill(thread->pid,SIGHUP);
- }
- }
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cleanup_pop.c b/mdk-stage1/dietlibc/libpthread/pthread_cleanup_pop.c
deleted file mode 100644
index 641bb6083..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cleanup_pop.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-void pthread_cleanup_pop(int execute)
-{
- _pthread_descr this;
- struct thread_cleanup_t tmp;
- int i=PTHREAD_MAX_CLEANUP;
-
- __THREAD_INIT();
-
- this = __thread_self();
-
- while(i>0) {
- if (this->cleanup_stack[--i].func) {
- tmp.func=this->cleanup_stack[i].func;
- tmp.arg=this->cleanup_stack[i].arg;
- this->cleanup_stack[i].func=0;
- break;
- }
- }
-
- if (execute) tmp.func(tmp.arg);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cleanup_push.c b/mdk-stage1/dietlibc/libpthread/pthread_cleanup_push.c
deleted file mode 100644
index cd2aabf71..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cleanup_push.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-void pthread_cleanup_push(void (*func)(void*), void *arg)
-{
- _pthread_descr this;
- int i;
-
- __THREAD_INIT();
-
- this = __thread_self();
-
- for (i=0; i<PTHREAD_MAX_CLEANUP; ++i) {
- if (this->cleanup_stack[i].func==0) {
- this->cleanup_stack[i].func=func;
- this->cleanup_stack[i].arg=arg;
- break;
- }
- }
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_broadcast.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_broadcast.c
deleted file mode 100644
index 776e0adfc..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_broadcast.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_broadcast(pthread_cond_t *cond)
-{
- _pthread_descr tmp;
-
- __THREAD_INIT();
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
-
- for (tmp=cond->wait_chain;tmp;tmp=tmp->waitnext) {
- tmp->waitnext=0;
- tmp->waiting=0;
- }
- cond->wait_chain=0;
-
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_STOP;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_destroy.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_destroy.c
deleted file mode 100644
index b553b41df..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_destroy.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_destroy(pthread_cond_t *cond)
-{
- __THREAD_INIT();
-
- if (cond->wait_chain) {
- return EBUSY;
- }
-
- memset(cond,0,sizeof(pthread_cond_t));
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_init.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_init.c
deleted file mode 100644
index 76dd5cb97..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_init.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr)
-{
- __THREAD_INIT();
-
- memset(cond,0,sizeof(pthread_cond_t));
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c
deleted file mode 100644
index 02a3c028e..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_signal(pthread_cond_t *cond)
-{
- _pthread_descr tmp=0;
-
- __THREAD_INIT();
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
- if ((tmp=cond->wait_chain)) cond->wait_chain=tmp->waitnext;
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_STOP;
-
- if (tmp) {
- tmp->waitnext=0;
- tmp->waiting=0;
- }
-
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_timedwait.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_timedwait.c
deleted file mode 100644
index 71d80bdb5..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_timedwait.c
+++ /dev/null
@@ -1,74 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- const struct timespec *abstime)
-{
- _pthread_descr tmp;
- _pthread_descr this;
- int ret=0;
-
- __THREAD_INIT();
-
- this=__thread_self();
-
- /* put in wait-chain */
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
- this->waiting=1;
- if (cond->wait_chain) {
- for(tmp=cond->wait_chain;tmp->waitnext;tmp=tmp->waitnext);
- tmp->waitnext=this;
- } else cond->wait_chain=this;
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_STOP;
-
- /* Aeh yeah / wait till cond-signal OR timeout */
- pthread_mutex_unlock(mutex);
- while (this->waiting) {
- struct timeval tv;
- gettimeofday(&tv,0);
- if ((abstime->tv_sec <= tv.tv_sec) && (abstime->tv_nsec <= (tv.tv_usec*1000))) {
- ret = 1;
- break;
- }
- __thread_wait_some_time();
- if (this->canceled) break; /* a cancel */
- }
- pthread_mutex_lock(mutex);
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
- if (this->waiting) { /* still waiting -> TIMEOUT or SIGNAL */
- _pthread_descr prev;
- /* remove from wait-chain */
- prev=cond->wait_chain;
- if ((prev=cond->wait_chain)==this) {
- cond->wait_chain=this->waitnext;
- } else {
- for (tmp=prev->waitnext;tmp;prev=tmp,tmp=prev->waitnext) {
- if (tmp==this) {
- prev->waitnext=this->waitnext;
- break;
- }
- }
- }
- this->waiting=0;
- this->waitnext=0;
- }
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_END;
-
- if (ret) return ETIMEDOUT;
-
- {
- register int err = (*__errno_location());
- if (err==EINTR) return err;
- }
- return 0;
-}
-
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_cond_wait.c b/mdk-stage1/dietlibc/libpthread/pthread_cond_wait.c
deleted file mode 100644
index 8db49e840..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_cond_wait.c
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
- _pthread_descr tmp;
- _pthread_descr this;
-
- __THREAD_INIT();
-
- this=__thread_self();
-
- /* put in wait-chain */
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
- this->waiting=1;
- if (cond->wait_chain) {
- for(tmp=cond->wait_chain;tmp->waitnext;tmp=tmp->waitnext);
- tmp->waitnext=this;
- } else cond->wait_chain=this;
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_STOP;
-
- /* Aeh yeah / wait till signal */
- pthread_mutex_unlock(mutex);
- while (this->waiting) {
- __thread_wait_some_time();
- if (this->canceled) break; /* we got a cancel signal */
- }
- pthread_mutex_lock(mutex);
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&(cond->lock));
- if (this->waiting) { /* still waiting -> SIGNAL */
- _pthread_descr prev;
- /* remove from wait-chain */
- prev=cond->wait_chain;
- if ((prev=cond->wait_chain)==this) {
- cond->wait_chain=this->waitnext;
- } else {
- for (tmp=prev->waitnext;tmp;prev=tmp,tmp=prev->waitnext) {
- if (tmp==this) {
- prev->waitnext=this->waitnext;
- break;
- }
- }
- }
- this->waiting=0;
- this->waitnext=0;
- }
- __pthread_unlock(&(cond->lock));
- __NO_ASYNC_CANCEL_END;
- return 0;
-}
-
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_condattr.c b/mdk-stage1/dietlibc/libpthread/pthread_condattr.c
deleted file mode 100644
index c537890ba..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_condattr.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <pthread.h>
-
-int pthread_condattr_init(pthread_condattr_t *attr)
-{
- return 0;
-}
-
-int pthread_condattr_destroy(pthread_condattr_t *attr)
-__attribute__((alias("pthread_condattr_init")));
-
-int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared)
-__attribute__((alias("pthread_condattr_init")));
-
-int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
-__attribute__((alias("pthread_condattr_init")));
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_create.c b/mdk-stage1/dietlibc/libpthread/pthread_create.c
deleted file mode 100644
index 714c2bf4b..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_create.c
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_create (pthread_t *thread, const pthread_attr_t *attr,
- void *(*start_routine) (void *), void *arg)
-{
- int ret=0;
- _pthread_descr td;
- pthread_attr_t default_attr;
-
- __THREAD_INIT();
-
- if (start_routine==0) {
- return EINVAL;
- }
-
- td = __thread_get_free();
-
- if (td) {
- td->go.__spinlock=PTHREAD_SPIN_LOCKED;
- if (!(attr)) {
- pthread_attr_init(&default_attr);
- attr=&default_attr;
- }
-
- if ((td->policy!=SCHED_OTHER)&&(td->priority==0)) {
- return EINVAL;
- }
-
- if (attr->__inheritsched==PTHREAD_INHERIT_SCHED) {
- _pthread_descr this = __thread_self();
- td->policy = this->policy;
- td->priority = this->priority;
- } else {
- td->policy = attr->__schedpolicy;
- td->priority = attr->__schedparam.sched_priority;
- }
-
- td->func = start_routine;
- td->arg = arg;
-
- td->detached = attr->__detachstate;
-
- td->stack_size = attr->__stacksize;
-
- if (!(attr->__stackaddr)) {
- char *stack=(char*)malloc(td->stack_size);
- if (!(stack)) {
- return EINVAL;
- }
- td->stack_begin = stack;
-#ifdef __parisc__
- td->stack_addr = stack;
-#else
- td->stack_addr = stack+td->stack_size;
-#endif
- } else {
- td->stack_begin = 0;
- td->stack_addr = attr->__stackaddr;
- }
-
- ret = signal_manager_thread(td);
-
- if (ret>1)
- *thread=ret;
- else {
- ++td->exited; /* mark as exited */
- __thread_cleanup(td);
- if (ret<0) return (*(__errno_location()));
- return EAGAIN;
- }
- }
- else
- return EAGAIN;
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_detach.c b/mdk-stage1/dietlibc/libpthread/pthread_detach.c
deleted file mode 100644
index 2f72b97a7..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_detach.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_detach(pthread_t th)
-{
- pthread_t j;
- _pthread_descr thread;
-
- __THREAD_INIT();
-
- j=__find_thread_id(th);
-
- if (j==-1) {
- return ESRCH;
- }
- thread = __get_thread_struct(j);
-
- if (thread->detached) {
- return EINVAL;
- }
-
- if (!thread->joined) {
- thread->detached=1;
- }
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_equal.c b/mdk-stage1/dietlibc/libpthread/pthread_equal.c
deleted file mode 100644
index d054d86ed..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_equal.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <pthread.h>
-
-int pthread_equal(pthread_t thread1, pthread_t thread2) { return (thread1==thread2); }
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_errno.c b/mdk-stage1/dietlibc/libpthread/pthread_errno.c
deleted file mode 100644
index d035544ad..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_errno.c
+++ /dev/null
@@ -1,5 +0,0 @@
-int errno;
-
-#include "dietwarning.h"
-
-link_warning("errno","\e[1;33;41m>>> your multithreaded code uses errno! <<<\e[0m");
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_exit.c b/mdk-stage1/dietlibc/libpthread/pthread_exit.c
deleted file mode 100644
index 41eac0a33..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_exit.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-void pthread_exit(void *retval)
-{
- _pthread_descr this;
-
- __THREAD_INIT();
-
- this = __thread_self();
- this->retval = retval;
-
- longjmp(this->jmp_exit,1);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_fdglue2.c b/mdk-stage1/dietlibc/libpthread/pthread_fdglue2.c
deleted file mode 100644
index d73c84220..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_fdglue2.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "dietstdio.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <errno.h>
-
-extern int __stdio_atexit;
-extern FILE* __stdio_init_file_nothreads(int fd,int closeonerror);
-
-FILE* __stdio_init_file(int fd,int closeonerror) {
- FILE *tmp=__stdio_init_file_nothreads(fd,closeonerror);
- if (tmp) pthread_mutex_init(&tmp->m,0);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_fgetc.c b/mdk-stage1/dietlibc/libpthread/pthread_fgetc.c
deleted file mode 100644
index 34e79e0fe..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_fgetc.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "dietstdio.h"
-#include <unistd.h>
-
-int fgetc(FILE *stream) {
- int tmp;
- pthread_mutex_lock(&stream->m);
- tmp=fgetc_unlocked(stream);
- pthread_mutex_unlock(&stream->m);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_flockfile.c b/mdk-stage1/dietlibc/libpthread/pthread_flockfile.c
deleted file mode 100644
index 72131ffb1..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_flockfile.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "dietstdio.h"
-
-void flockfile(FILE* f) {
- pthread_mutex_lock(&f->m);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_fputc.c b/mdk-stage1/dietlibc/libpthread/pthread_fputc.c
deleted file mode 100644
index 82344b107..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_fputc.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <dietstdio.h>
-
-int fputc(int c, FILE *stream) {
- int tmp;
- pthread_mutex_lock(&stream->m);
- tmp=fputc_unlocked(c,stream);
- pthread_mutex_unlock(&stream->m);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_funlockfile.c b/mdk-stage1/dietlibc/libpthread/pthread_funlockfile.c
deleted file mode 100644
index beae058af..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_funlockfile.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "dietstdio.h"
-
-void funlockfile(FILE* f) {
- pthread_mutex_unlock(&f->m);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_getschedparam.c b/mdk-stage1/dietlibc/libpthread/pthread_getschedparam.c
deleted file mode 100644
index aaaba4458..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_getschedparam.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_param *param)
-{
- int p;
- __THREAD_INIT();
-
- if (__find_thread_id(target_thread)<0) {
- return ESRCH;
- }
-
- if (((p=sched_getscheduler(target_thread))==-1)||
- (sched_getparam(target_thread,param) ==-1)) {
- return (*(__errno_location()));
- }
- *policy=p;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_getspecific.c b/mdk-stage1/dietlibc/libpthread/pthread_getspecific.c
deleted file mode 100644
index c2f84c814..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_getspecific.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-extern struct _thread_key __thread_keys[PTHREAD_KEYS_MAX];
-const void *pthread_getspecific(pthread_key_t key)
-{
- int id;
- __THREAD_INIT();
-
- id=__find_thread_id(getpid());
-
- if ((key<PTHREAD_KEYS_MAX) && (__thread_keys[key].used)) {
- return __thread_keys[key].tkd[id];
- }
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_internal.c b/mdk-stage1/dietlibc/libpthread/pthread_internal.c
deleted file mode 100644
index 7bb4e16cb..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_internal.c
+++ /dev/null
@@ -1,359 +0,0 @@
-#include <signal.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <sched.h>
-#include <sys/resource.h>
-
-#include <stdio.h>
-#include "thread_internal.h"
-
-static struct _pthread_fastlock __thread_struct_lock = {PTHREAD_SPIN_UNLOCKED};
-static struct _pthread_descr_struct threads[PTHREAD_THREADS_MAX];
-static int _max_used_thread_id=1;
-pthread_once_t __thread_inited;
-
-static struct _pthread_fastlock __manager_thread_signal_lock = {PTHREAD_SPIN_UNLOCKED};
-static struct _pthread_fastlock __manager_thread_data_lock = {PTHREAD_SPIN_LOCKED};
-static struct _pthread_fastlock __manager_thread_data_go_lock = {PTHREAD_SPIN_LOCKED};
-
-//#define DEBUG
-
-/* find thread */
-int __find_thread_id(int pid)
-{
- register int i;
- for (i=0; i<_max_used_thread_id; i++)
- if (threads[i].pid==pid)
- return i;
- return -1;
-}
-
-/* get thread */
-_pthread_descr __get_thread_struct(int id)
-{
- return threads+id;
-}
-
-/* thread errno location */
-int *__errno_location(void)
-{
- int id=0;
- if (__thread_inited) id=__find_thread_id(getpid());
- if (id<0)
- return 0;
- else
- return &threads[id].errno;
-}
-
-/* thread self */
-_pthread_descr __thread_self()
-{
- register int i=__find_thread_id(getpid());
- if (i<0)
- return 0;
- else
- return threads+i;
-}
-
-/* allocate a thread slot */
-_pthread_descr __thread_get_free()
-{
- _pthread_descr ret=0;
- int i;
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&__thread_struct_lock);
-
- for (i=0; i<PTHREAD_THREADS_MAX; i++) {
- if (threads[i].pid==0) {
- ret = threads+i;
- /* clear struct */
- memset(ret,0,sizeof(struct _pthread_descr_struct));
- ret->pid=1; /* mark as taken */
- if (i>=_max_used_thread_id) _max_used_thread_id=i+1;
- break;
- }
- }
-
- __pthread_unlock(&__thread_struct_lock);
- __NO_ASYNC_CANCEL_END;
- return ret;
-}
-
-/* sleep a little (reschedule for this time) */
-void __thread_wait_some_time()
-{
- struct timespec reg;
- reg.tv_sec=0;
- reg.tv_nsec=SPIN_SLEEP_DURATION;
- __libc_nanosleep(&reg,0);
-}
-
-/* cleanup/join a thread */
-int __thread_join(_pthread_descr th, void**return_value)
-{
- /* mark thread th as joined */
- if (__testandset(&(th->joined))) return EINVAL;
- /* wait for thread to exit */
- while(!th->exited) __thread_wait_some_time();
- /* put return value to caller */
- if (return_value) *return_value=th->retval;
- /* cleanup thread */
- if (th->stack_begin) free(th->stack_begin);
- th->joined=0;
- th->pid=0;
- return 0;
-}
-
-/* SIGHUP handler (thread cancel) PTHREAD_CANCEL_ASYNCHRONOUS */
-static void __thread_cancel_handler(int sig)
-{
- _pthread_descr this;
- this = __thread_self();
- this->canceled=1;
- if (this->canceltype==PTHREAD_CANCEL_ASYNCHRONOUS)
- pthread_exit(PTHREAD_CANCELED);
- signal( SIGHUP, __thread_cancel_handler );
-}
-
-/* kill ALL threads / other then prime task and manager thread */
-static void __kill_all_threads()
-{
- int i;
-
- for (i=2; i<_max_used_thread_id; i++) {
- if (threads[i].pid>1) {
-#ifdef DEBUG
- printf("CANCEL ! %d\n",threads[i].pid);
-#endif
- threads[i].canceled=1;
- kill(threads[i].pid, SIGHUP); /* cancel thread */
- }
- }
-
- __thread_wait_some_time();
-
- for (i=2; i<_max_used_thread_id; i++) {
- if (threads[i].pid>1) {
-#ifdef DEBUG
- printf("KILL ! %d\n",threads[i].pid);
-#endif
- kill(threads[i].pid, SIGTERM); /* KILL thread */
- }
- }
-}
-
-__attribute__((weak)) volatile void __thread_start__key(int id);
-__attribute__((weak)) volatile void __thread_start__key(int id) { return; }
-__attribute__((weak,alias("__thread_start__key"))) volatile void __thread_exit__key(int id);
-
-/* support for manager */
-static void *__mthread_starter(void *arg)
-{
- _pthread_descr td = (_pthread_descr)arg;
- int i = td->stack_size-4096;
-
- /* just to be sure */
- td->pid=getpid();
-
- /* signal handling for a thread */
- signal(SIGTERM, _exit);
- signal(SIGCHLD, SIG_DFL);
- signal(SIGHUP, __thread_cancel_handler );
-
- /* limit stack so that we NEVER have to worry */
- setrlimit(RLIMIT_STACK, (struct rlimit *)(&i));
-
- /* set scheduler */
- if (td->policy!=SCHED_OTHER) {
- struct sched_param sp;
- sp.sched_priority=td->priority;
- sched_setscheduler(td->pid,td->policy, &sp);
- }
-
- /* thread_key glue */
- __thread_start__key(td-threads);
-
-#ifdef DEBUG
- printf("in starter %d, parameter %8p\n", td->pid, td->func);
-#endif
- do {
- __thread_wait_some_time();
- if (td->canceled) return (void*)42;
- } while (__pthread_trylock(&td->go));
-
-#ifdef DEBUG
- printf("post starter %d, parameter %8p\n", td->pid, td->func);
-#endif
-
- if (!td->canceled) {
- if (!(setjmp(td->jmp_exit))) {
- td->retval=td->func(td->arg);
-#ifdef DEBUG
- } else {
- printf("pthread_exit called in %d\n", td->pid);
-#endif
- }
- }
- pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,0);
-
- /* thread_key glue */
- __thread_exit__key(td-threads);
-
-#ifdef DEBUG
- printf("end starter %d, retval %8p\n", td->pid, td->retval);
-#endif
-
- /* execute all functions on the cleanup-stack */
- for (i=PTHREAD_MAX_CLEANUP;i;) {
- if (td->cleanup_stack[--i].func) {
- td->cleanup_stack[i].func(td->cleanup_stack[i].arg);
- }
- }
-
- return 0;
-}
-
-
-/* manager thread and signal handler */
-static char __manager_thread_stack[12*1024];
-static volatile _pthread_descr __manager_thread_data;
-static void __manager_SIGCHLD(int sig)
-{
- int pid, status, i;
-
- while(1) {
- pid = __libc_waitpid (-1, &status, WNOHANG);
- if (pid <= 0) break;
-
- for (i=0; i<_max_used_thread_id; i++) {
- if (threads[i].pid==pid) {
- ++threads[i].exited;
- if (threads[i].detached) {
- threads[i].joined=0;
- __thread_cleanup(threads+i);
- }
- break;
- }
- }
- }
-}
-
-static void __manager_SIGTERM(int sig)
-{
- __kill_all_threads();
- _exit(0);
-}
-
-static void* __manager_thread(void *arg)
-{
- struct sigaction sig_action_chld;
- sig_action_chld.sa_handler = __manager_SIGCHLD;
- sigemptyset(&sig_action_chld.sa_mask);
- sig_action_chld.sa_flags = SA_RESTART;
-
- sigaction(SIGCHLD, &sig_action_chld, 0);
- signal(SIGTERM, __manager_SIGTERM);
- signal(SIGHUP, SIG_IGN);
-
- __pthread_unlock(&__manager_thread_data_go_lock); /* release init */
- while(1) {
- do {
- __thread_wait_some_time();
- if (getppid()<2) __manager_SIGTERM(0);
- } while (__pthread_trylock(&__manager_thread_data_lock));
-
- __manager_thread_data->pid =
- __clone(__mthread_starter,
- __manager_thread_data->stack_addr,
- CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD,
- __manager_thread_data);
- __thread_wait_some_time();
- __thread_wait_some_time();
- __pthread_unlock(&__manager_thread_data->go);
-#ifdef DEBUG
- printf("manager new thread %d\n",__manager_thread_data->pid);
-#endif
- __pthread_unlock(&__manager_thread_data_go_lock); /* release sender */
- }
- return 0;
-}
-
-/* pthread_create bottom half */
-int signal_manager_thread(_pthread_descr td)
-{
- __NO_ASYNC_CANCEL_BEGIN;
-
- __pthread_lock(&__manager_thread_signal_lock); /* lock */
-
- __manager_thread_data = td;
- __thread_wait_some_time();
- __pthread_unlock(&__manager_thread_data_lock); /* signal manager to start */
- __thread_wait_some_time();
- __pthread_lock(&__manager_thread_data_go_lock); /* wait for manager */
-
- __pthread_unlock(&__manager_thread_signal_lock); /* unlock */
-
- __NO_ASYNC_CANCEL_END;
-
- return td->pid;
-}
-
-
-/* thread stop */
-static void __thread_main_exit()
-{
- if (getpid()!=threads[0].pid) {
-#ifdef DEBUG
- printf("A THREAD ? %d\n",getpid());
-#endif
- kill(threads[0].pid, SIGTERM);
- while(1) __thread_wait_some_time();
- }
-#ifdef DEBUG
- else
- printf("EXIT ! %d\n",getpid());
-#endif
-
- /* stop ALL threads */
- kill(threads[1].pid, SIGTERM);
- __thread_wait_some_time();
- __kill_all_threads();
-}
-
-/* thread intern init */
-void __thread_init()
-{
- if (atexit(__thread_main_exit)==-1)
- exit(42);
-
-#ifdef DEBUG
- printf("INIT ! %d\n",getpid());
- memset(threads,0,sizeof(threads));
-#endif
-
- threads[0].pid = getpid();
-
- ++_max_used_thread_id;
- threads[1].stack_size=sizeof(__manager_thread_stack);
-#ifdef __parisc__
- threads[1].stack_addr=__manager_thread_stack;
-#else
- threads[1].stack_addr=&__manager_thread_stack[sizeof(__manager_thread_stack)];
-#endif
- threads[1].stack_begin=0;
- threads[1].func=__manager_thread;
-
- threads[1].pid = __clone(__mthread_starter, threads[1].stack_addr,
- CLONE_VM | CLONE_FS | CLONE_FILES, threads+1);
-
-#ifdef DEBUG
- printf("manager thread @ : %d\n",threads[1].pid);
-#endif
- __pthread_lock(&__manager_thread_data_go_lock); /* wait for manager to be ready */
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_join.c b/mdk-stage1/dietlibc/libpthread/pthread_join.c
deleted file mode 100644
index 39c076555..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_join.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include "thread_internal.h"
-#include <pthread.h>
-
-int pthread_join(pthread_t th, void **thread_return)
-{
- pthread_t j;
- _pthread_descr this, thread;
-
- __THREAD_INIT();
-
- this = __thread_self();
- j=__find_thread_id(th);
-
- if (j==-1) {
- return ESRCH;
- }
-
- thread = __get_thread_struct(j);
-
- /* error handling */
- if (thread==0) {
- return ESRCH;
- }
-
- if (this==thread) {
- return EDEADLK;
- }
-
- if (thread->detached || thread->joined) {
- return EINVAL;
- }
-
- return __thread_join(thread,thread_return);
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_key.c b/mdk-stage1/dietlibc/libpthread/pthread_key.c
deleted file mode 100644
index 8a77f281a..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_key.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-struct _pthread_fastlock __thread_keys_lock;
-struct _thread_key __thread_keys[PTHREAD_KEYS_MAX];
-
-void __thread_start__key(int id);
-void __thread_exit__key(int id);
-
-void __thread_start__key(int id)
-{
- int i;
-
- if (id<2) return;
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&__thread_keys_lock);
-
- for (i=0; i<PTHREAD_KEYS_MAX; i++) {
- __thread_keys[i].tkd[id]=0;
- }
-
- __pthread_unlock(&__thread_keys_lock);
- __NO_ASYNC_CANCEL_END;
-}
-
-void __thread_exit__key(int id)
-{
- int i,try;
-
- if (id<2) return;
-
- __NO_ASYNC_CANCEL_BEGIN;
-// __pthread_lock(&__thread_keys_lock);
-
- for (i=0; i<PTHREAD_KEYS_MAX; i++) {
- if ((__thread_keys[i].used) && (__thread_keys[i].destructor)) {
- for (try=0;__thread_keys[i].tkd[id] && (try<PTHREAD_DESTRUCTOR_ITERATIONS);++try)
- __thread_keys[i].destructor(__thread_keys[i].tkd[id]);
- }
- }
-
-// __pthread_unlock(&__thread_keys_lock);
- __NO_ASYNC_CANCEL_STOP;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_key_create.c b/mdk-stage1/dietlibc/libpthread/pthread_key_create.c
deleted file mode 100644
index 9718c695b..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_key_create.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-extern struct _pthread_fastlock __thread_keys_lock;
-extern struct _thread_key __thread_keys[PTHREAD_KEYS_MAX];
-int pthread_key_create(pthread_key_t *key, void (*destructor)(const void*))
-{
- int ret=-1,i;
-
- __THREAD_INIT();
-
- __NO_ASYNC_CANCEL_BEGIN;
- __pthread_lock(&__thread_keys_lock);
-
- for (i=0; i<PTHREAD_KEYS_MAX; i++) {
- if (!__thread_keys[i].used) {
- __thread_keys[i].used=1;
- __thread_keys[i].destructor=destructor;
- memset(__thread_keys[i].tkd,0,PTHREAD_THREADS_MAX*sizeof(void*));
- *key=i;
- ret=0;
- break;
- }
- }
-
- __pthread_unlock(&__thread_keys_lock);
- __NO_ASYNC_CANCEL_END;
-
- if (ret) return EAGAIN;
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_key_delete.c b/mdk-stage1/dietlibc/libpthread/pthread_key_delete.c
deleted file mode 100644
index 8f7fb577f..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_key_delete.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-extern struct _thread_key __thread_keys[PTHREAD_KEYS_MAX];
-int pthread_key_delete(pthread_key_t key)
-{
- __THREAD_INIT();
-
- if (key>=PTHREAD_KEYS_MAX) {
- return EINVAL;
- }
-
- __thread_keys[key].used=0;
-
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutex_destroy.c b/mdk-stage1/dietlibc/libpthread/pthread_mutex_destroy.c
deleted file mode 100644
index f5d66613c..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutex_destroy.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_mutex_destroy(pthread_mutex_t *mutex)
-{
- __THREAD_INIT();
-
- if ((mutex->owner)||(mutex->lock.__spinlock==PTHREAD_SPIN_LOCKED)) {
- return EBUSY;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutex_init.c b/mdk-stage1/dietlibc/libpthread/pthread_mutex_init.c
deleted file mode 100644
index 65161d0ec..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutex_init.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_mutex_init(pthread_mutex_t *mutex,
- const pthread_mutexattr_t *mutexattr)
-{
- __THREAD_INIT();
-
- memset(mutex,0,sizeof(pthread_mutex_t));
- if (mutexattr) {
- mutex->kind=mutexattr->__mutexkind;
- }
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutex_lock.c b/mdk-stage1/dietlibc/libpthread/pthread_mutex_lock.c
deleted file mode 100644
index 0df2bcd8d..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutex_lock.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <unistd.h>
-#include <sched.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-/* will never return EINVAL ! */
-
-int pthread_mutex_lock(pthread_mutex_t *mutex)
-{
- _pthread_descr this;
-
- __THREAD_INIT();
-
- this = __thread_self();
-
- if (this==mutex->owner) {
- if (mutex->kind==PTHREAD_MUTEX_ERRORCHECK_NP)
- return EDEADLK;
- if (mutex->kind==PTHREAD_MUTEX_RECURSIVE_NP) {
- ++(mutex->count);
- return 0;
- }
- }
-
- /* wait for mutex to free */
- __pthread_lock(&(mutex->lock));
- mutex->owner=this;
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutex_trylock.c b/mdk-stage1/dietlibc/libpthread/pthread_mutex_trylock.c
deleted file mode 100644
index 620d26150..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutex_trylock.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <unistd.h>
-#include <sched.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-/* will never return EINVAL ! */
-
-int pthread_mutex_trylock(pthread_mutex_t *mutex)
-{
- _pthread_descr this;
-
- __THREAD_INIT();
-
- this = __thread_self();
-
- if (this!=mutex->owner) {
- /* wait for mutex to free */
- if (__pthread_trylock(&(mutex->lock))) {
- return EBUSY;
- }
-
- mutex->owner=this;
- }
- else if (mutex->kind==PTHREAD_MUTEX_ERRORCHECK_NP) {
- return EDEADLK;
- }
-
- if (mutex->kind==PTHREAD_MUTEX_RECURSIVE_NP) ++(mutex->count);
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutex_unlock.c b/mdk-stage1/dietlibc/libpthread/pthread_mutex_unlock.c
deleted file mode 100644
index 0c12282c1..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutex_unlock.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <unistd.h>
-#include <sched.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-/* will never return EINVAL ! */
-
-int pthread_mutex_unlock(pthread_mutex_t *mutex)
-{
- _pthread_descr this;
-
- __THREAD_INIT();
-
- this = __thread_self();
-
- if (this==mutex->owner) {
- if (mutex->kind==PTHREAD_MUTEX_RECURSIVE_NP) {
- if (--(mutex->count)) return 0;
- }
-
- mutex->owner=0;
- __pthread_unlock(&(mutex->lock));
- }
- else if (mutex->kind==PTHREAD_MUTEX_ERRORCHECK_NP) {
- return EPERM;
- }
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_getkind_np.c b/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_getkind_np.c
deleted file mode 100644
index 63cd9133c..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_getkind_np.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr, int *kind)
-{
- __THREAD_INIT();
-
- *kind=attr->__mutexkind;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_init.c b/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_init.c
deleted file mode 100644
index ff60e4c74..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_init.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_mutexattr_init(pthread_mutexattr_t *attr)
-{
- __THREAD_INIT();
-
- attr->__mutexkind = 0;
- return 0;
-}
-
-int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) __attribute__((alias ("pthread_mutexattr_init")));
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_setkind_np.c b/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_setkind_np.c
deleted file mode 100644
index 8b110fe5a..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_mutexattr_setkind_np.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind)
-{
- __THREAD_INIT();
-
- if ((kind==PTHREAD_MUTEX_FAST_NP) || (kind==PTHREAD_MUTEX_RECURSIVE_NP) ||
- (kind==PTHREAD_MUTEX_ERRORCHECK_NP)) {
- attr->__mutexkind=kind;
- return 0;
- }
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_once.c b/mdk-stage1/dietlibc/libpthread/pthread_once.c
deleted file mode 100644
index 16d9cb392..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_once.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <pthread.h>
-#include "thread_internal.h"
-
-int __pthread_once (pthread_once_t* once_control, void (*init_routine)(void))
-{
- if (!(__testandset(once_control))) init_routine();
- return 0;
-}
-int pthread_once (pthread_once_t* once_control, void (*init_routine)(void)) __attribute__((alias("__pthread_once")));
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_self.c b/mdk-stage1/dietlibc/libpthread/pthread_self.c
deleted file mode 100644
index 394686dd4..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_self.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <unistd.h>
-#include <pthread.h>
-
-pthread_t pthread_self() { return getpid(); }
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setcancelstate.c b/mdk-stage1/dietlibc/libpthread/pthread_setcancelstate.c
deleted file mode 100644
index f832bef70..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_setcancelstate.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_setcancelstate(int state, int *oldstate)
-{
- _pthread_descr thread;
-
- __THREAD_INIT();
-
- if ((state==PTHREAD_CANCEL_ENABLE) || (state==PTHREAD_CANCEL_DISABLE))
- {
- thread = __thread_self();
-
- if (oldstate) *oldstate = thread->cancelstate;
- thread->cancelstate = state;
-
- return 0;
- }
-
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c b/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c
deleted file mode 100644
index f5669b70d..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_setcanceltype.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_setcanceltype(int type, int *oldtype)
-{
- _pthread_descr thread;
-
- __THREAD_INIT();
-
- if ((type==PTHREAD_CANCEL_DEFERRED) || (type==PTHREAD_CANCEL_ASYNCHRONOUS))
- {
- thread = __thread_self();
-
- if (oldtype) *oldtype = thread->canceltype;
- thread->canceltype = type;
-
- return 0;
- }
-
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c b/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c
deleted file mode 100644
index df007c408..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param)
-{
- __THREAD_INIT();
-
- if (__find_thread_id(target_thread)<0) {
- return ESRCH;
- }
-
- if (((policy == SCHED_OTHER) && (param->sched_priority==0)) ||
- (((policy == SCHED_RR) || (policy == SCHED_FIFO)) &&
- ((param->sched_priority > 0) && (param->sched_priority <100))))
- return sched_setscheduler(target_thread, policy, param);
-
- return EINVAL;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setspecific.c b/mdk-stage1/dietlibc/libpthread/pthread_setspecific.c
deleted file mode 100644
index b66ce31d0..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_setspecific.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <unistd.h>
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-extern struct _thread_key __thread_keys[PTHREAD_KEYS_MAX];
-int pthread_setspecific(pthread_key_t key, const void *value)
-{
- int id;
- __THREAD_INIT();
-
- id=__find_thread_id(getpid());
- if ((key<PTHREAD_KEYS_MAX) && (__thread_keys[key].used)) {
- __thread_keys[key].tkd[id]=value;
- return 0;
- }
- return EINVAL;
-}
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sigmask.c b/mdk-stage1/dietlibc/libpthread/pthread_sigmask.c
deleted file mode 100644
index 691e9e51a..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sigmask.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <signal.h>
-#include <errno.h>
-
-#include <pthread.h>
-
-int pthread_sigmask(int how, const sigset_t*newset, sigset_t *oldset) {
- return (sigprocmask(how,newset,oldset)==-1)?(*(__errno_location())):0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_spinlock.c b/mdk-stage1/dietlibc/libpthread/pthread_spinlock.c
deleted file mode 100644
index 463c186bd..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_spinlock.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <time.h>
-#include <pthread.h>
-#include "thread_internal.h"
-
-void __pthread_lock(struct _pthread_fastlock * lock)
-{
- int cnt = 0;
- struct timespec tm;
-
- while (__testandset(&lock->__spinlock)) {
- if (cnt < MAX_SPIN_COUNT) {
- sched_yield();
- cnt++;
- } else {
- tm.tv_sec = 0;
- tm.tv_nsec = SPIN_SLEEP_DURATION;
- __libc_nanosleep(&tm, 0);
- cnt = 0;
- }
- }
-}
-
-int __pthread_trylock(struct _pthread_fastlock * lock)
-{
- return __testandset(&lock->__spinlock);
-}
-
-int __pthread_unlock(struct _pthread_fastlock * lock)
-{
- lock->__spinlock = PTHREAD_SPIN_UNLOCKED;
- return 0;
-}
-
-
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_alloc.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_alloc.c
deleted file mode 100644
index 9fd4bcd95..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_alloc.c
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-#include <stdlib.h>
-
-static pthread_mutex_t mutex_alloc = PTHREAD_MUTEX_INITIALIZER;
-
-void free(void *ptr) {
- __NO_ASYNC_CANCEL_BEGIN;
- pthread_mutex_lock(&mutex_alloc);
- __libc_free(ptr);
- pthread_mutex_unlock(&mutex_alloc);
- __NO_ASYNC_CANCEL_END;
-}
-
-void *malloc(size_t size) {
- register void *ret;
- __NO_ASYNC_CANCEL_BEGIN;
- pthread_mutex_lock(&mutex_alloc);
- ret=__libc_malloc(size);
- pthread_mutex_unlock(&mutex_alloc);
- __NO_ASYNC_CANCEL_END;
- return ret;
-}
-
-void* realloc(void* ptr, size_t size) {
- register void *ret;
- __NO_ASYNC_CANCEL_BEGIN;
- pthread_mutex_lock(&mutex_alloc);
- ret=__libc_realloc(ptr, size);
- pthread_mutex_unlock(&mutex_alloc);
- __NO_ASYNC_CANCEL_END;
- return ret;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_close.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_close.c
deleted file mode 100644
index 84d5d5f36..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_close.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int close(int fd)
-{
- __TEST_CANCEL();
- return __libc_close(fd);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_create.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_create.c
deleted file mode 100644
index 9d47844f5..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_create.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int creat(const char *pathname, mode_t mode)
-{
- __TEST_CANCEL();
- return __libc_creat(pathname,mode);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_fcntl.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_fcntl.c
deleted file mode 100644
index c7c3fb884..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_fcntl.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int fcntl(int fd, int cmd, void *arg);
-int fcntl(int fd, int cmd, void *arg)
-{
- __TEST_CANCEL();
- return __libc_fcntl(fd,cmd,arg);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_fdatasync.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_fdatasync.c
deleted file mode 100644
index 69857c7b3..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_fdatasync.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int fdatasync(int fd)
-{
- __TEST_CANCEL();
- return __libc_fdatasync(fd);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_fsync.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_fsync.c
deleted file mode 100644
index a2c995069..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_fsync.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int fsync(int fd)
-{
- __TEST_CANCEL();
- return __libc_fsync(fd);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_logging.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_logging.c
deleted file mode 100644
index f9f93dce2..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_logging.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <unistd.h>
-#include <stdarg.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-#include <syslog.h>
-
-static pthread_mutex_t mutex_syslog = PTHREAD_MUTEX_INITIALIZER;
-
-void closelog(void)
-{
- pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
- pthread_mutex_lock(&mutex_syslog);
- __libc_closelog();
- pthread_cleanup_pop(1);
-}
-
-void openlog(const char *ident, int option, int facility)
-{
- pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
- pthread_mutex_lock(&mutex_syslog);
- __libc_openlog(ident, option, facility);
- pthread_cleanup_pop(1);
-}
-
-void vsyslog(int priority, const char *format, va_list arg_ptr)
-{
- pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
- pthread_mutex_lock(&mutex_syslog);
- __libc_vsyslog(priority, format, arg_ptr);
- pthread_cleanup_pop(1);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_nanosleep.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_nanosleep.c
deleted file mode 100644
index 699de4654..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_nanosleep.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <time.h>
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int nanosleep(const struct timespec *req, struct timespec *rem)
-{
- __TEST_CANCEL();
- return __libc_nanosleep(req,rem);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_open.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_open.c
deleted file mode 100644
index 8d9fb5523..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_open.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int __pthread_open(const char *pathname, int flags, mode_t mode);
-int __pthread_open(const char *pathname, int flags, mode_t mode)
-{
- __TEST_CANCEL();
- return __libc_open(pathname,flags,mode);
-}
-
-int open(const char *pathname, int flags, ...) __attribute__((alias("__pthread_open")));
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_pause.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_pause.c
deleted file mode 100644
index ab15ead11..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_pause.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int pause()
-{
- __TEST_CANCEL();
- return __libc_pause();
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_read.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_read.c
deleted file mode 100644
index 60f886003..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_read.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int read(int fd, void *buf, size_t count)
-{
- __TEST_CANCEL();
- return __libc_read(fd,buf,count);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_sigsuspend.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_sigsuspend.c
deleted file mode 100644
index 72cd783ae..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_sigsuspend.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int sigsuspend(const sigset_t *mask)
-{
- __TEST_CANCEL();
- return __libc_sigsuspend(mask);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_tcdrain.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_tcdrain.c
deleted file mode 100644
index d5d94978b..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_tcdrain.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-#include <termios.h>
-
-int tcdrain(int fd)
-{
- __TEST_CANCEL();
- return __libc_tcdrain(fd);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_waitpid.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_waitpid.c
deleted file mode 100644
index e5020221a..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_waitpid.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-#include <sys/wait.h>
-
-pid_t waitpid(pid_t pid, int *status, int options)
-{
- __TEST_CANCEL();
- return __libc_waitpid(pid,status,options);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_sys_write.c b/mdk-stage1/dietlibc/libpthread/pthread_sys_write.c
deleted file mode 100644
index 37541ae42..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_sys_write.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <unistd.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-int write(int fd, const void *buf, size_t count)
-{
- __TEST_CANCEL();
- return __libc_write(fd,buf,count);
-}
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_testcancel.c b/mdk-stage1/dietlibc/libpthread/pthread_testcancel.c
deleted file mode 100644
index 4151faca3..000000000
--- a/mdk-stage1/dietlibc/libpthread/pthread_testcancel.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <errno.h>
-
-#include <pthread.h>
-#include "thread_internal.h"
-
-void pthread_testcancel()
-{
- _pthread_descr thread;
- __THREAD_INIT();
-
- thread=__thread_self();
-
- if (thread && thread->canceled) {
- pthread_exit(PTHREAD_CANCELED);
- }
-}
diff --git a/mdk-stage1/dietlibc/libpthread/test.c b/mdk-stage1/dietlibc/libpthread/test.c
deleted file mode 100644
index 3272c1753..000000000
--- a/mdk-stage1/dietlibc/libpthread/test.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <stdio.h>
-#include <pthread.h>
-
-#include <unistd.h>
-#include <signal.h>
-
-#include <errno.h>
-
-int ra;
-
-void test(int sig)
-{
- printf("SIGNAL %d in %d\n",sig,getpid());
- fflush(stdout);
- signal(SIGHUP, test);
-}
-
-void* thread(void* arg)
-{
- int i;
- for (i=0;i<10; i++)
- {
- printf("child %ld %8p\n", pthread_self(),arg);
- sleep(1);
- }
- return arg;
-}
-
-void* thread2(void *arg)
-{
- pthread_t t;
- int i;
-
- printf("child %ld %8p\n", pthread_self(),arg);
- for (i=0; i<3; ++i) {
- printf("child starting next in %d secs %ld %8p\n", 3-i, pthread_self(),arg);
- sleep(1);
- }
- pthread_create(&t,0, thread, (void*)2);
- printf("new child @ %ld\n",t);
- return (void*)t;
-}
-
-int main(int argc, char*argv[])
-{
- pthread_t t;
-
- signal(SIGHUP, test);
-
- pthread_create(&t,0, thread2, 0);
- pthread_create(&t,0, thread, (void *)3);
- pthread_create(&t,0, thread, (void *)1);
-
- puts("main");
-
-#if 0
- {
- int i;
- for(i=0;i<4;i++) sleep(1);
- }
-#else
- {
- int *tt;
- int i = pthread_join(t,(void*)&tt);
- printf("join %d %p %d\n",i,tt,(*(__errno_location())));
- }
-#endif
-
- puts("main exit");
-
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libpthread/thread_internal.h b/mdk-stage1/dietlibc/libpthread/thread_internal.h
deleted file mode 100644
index 7843fb59d..000000000
--- a/mdk-stage1/dietlibc/libpthread/thread_internal.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef __THREAD_INTERNAL_H__
-#define __THREAD_INTERNAL_H__
-
-#include <pthread.h>
-#include <stdarg.h>
-#include <setjmp.h>
-#include "dietfeatures.h"
-#ifndef WANT_THREAD_SAFE
-#error "the diet libc is not compiled with thread safeness enabled!"
-#endif
-
-#undef errno
-
-/* cleanup */
-#define PTHREAD_MAX_CLEANUP 8
-struct thread_cleanup_t {
- void (*func)(void*);
- void *arg;
-};
-
-/* the thread descriptor / internal */
-struct _pthread_descr_struct {
- /* conditional variables */
- struct _pthread_descr_struct *waitnext; /* an other waiting thread or NULL */
- int waiting; /* internal waiting "lock" */
-
- /* thread/process data */
- int pid; /* Process id */
- int exited; /* Process is dead */
-
- int policy; /* thread scheduling policy */
- int priority; /* thread priority */
-
- /* errno handling */
- int errno;
- int h_errno;
-
- /* stack handling */
- unsigned int stack_size; /* stack size for setrlimit */
- void *stack_addr; /* stack address for clone */
- void *stack_begin; /* begin of lib-stack / lowest address (free) */
-
- /* thread exit handling */
- void *retval; /* thread return value */
- int joined; /* flag other thread has joined */
- jmp_buf jmp_exit; /* pthread_exit jump */
-
- /* thread flags */
- int detached; /* thread is detached */
- int canceled; /* thread canceled */
-
- /* cancel handling */
- int cancelstate; /* cancel state */
- int canceltype; /* type of cancellation */
-
- /* thread basics */
- void* (*func) (void* arg); /* thread function */
- void* arg; /* thread argument */
-
- /* create thread / manager thread lock */
- struct _pthread_fastlock go;
-
- /* cleanup stack */
- struct thread_cleanup_t cleanup_stack[PTHREAD_MAX_CLEANUP];
-
-} __attribute__ ((aligned(32)));
-
-/* thread keys */
-struct _thread_key {
- int used;
- void (*destructor)(const void*);
- const void *tkd[PTHREAD_THREADS_MAX];
-};
-
-/* internal stuff */
-int __testandset(int *spinlock);
-
-void __pthread_lock(struct _pthread_fastlock * lock);
-int __pthread_trylock(struct _pthread_fastlock * lock);
-int __pthread_unlock(struct _pthread_fastlock * lock);
-
-int __clone(void* (*fn)(void*), void* stack, int flags, void *arg);
-
-int __find_thread_id(int pid);
-_pthread_descr __get_thread_struct(int id);
-
-_pthread_descr __thread_get_free(void);
-_pthread_descr __thread_self(void);
-
-int __thread_join(_pthread_descr join, void **return_value);
-#define __thread_cleanup(th) (void)__thread_join((th),0)
-
-void __thread_wait_some_time(void);
-
-#define __NO_ASYNC_CANCEL_BEGIN { int oldtype; pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
-#define __NO_ASYNC_CANCEL_END pthread_setcanceltype(oldtype,0); pthread_testcancel(); }
-#define __NO_ASYNC_CANCEL_STOP pthread_setcanceltype(oldtype,0); }
-
-/* manager thread stuff */
-int signal_manager_thread(_pthread_descr td);
-
-/* init stuff */
-extern pthread_once_t __thread_inited;
-void __thread_init(void);
-#define __THREAD_INIT() __pthread_once(&__thread_inited, __thread_init)
-#define __TEST_CANCEL() pthread_testcancel()
-
-/* diet libc syscalls */
-
-void __libc_free(void *ptr);
-void *__libc_malloc(size_t size);
-void *__libc_realloc(void* ptr, size_t size);
-
-void __libc_closelog(void);
-void __libc_openlog(const char *ident, int option, int facility);
-void __libc_vsyslog(int priority, const char *format, va_list arg_ptr);
-
-pid_t __libc_fork(void);
-
-int __libc_close(int fd);
-int __libc_creat(const char *pathname, mode_t mode);
-int __libc_fcntl(int fd, int cmd, void *arg);
-int __libc_fsync(int fd);
-int __libc_fdatasync(int fd);
-int __libc_nanosleep(const struct timespec *req, struct timespec *rem);
-int __libc_open(const char *pathname, int flags, mode_t mode);
-int __libc_pause(void);
-int __libc_read(int fd, void *buf, size_t count);
-int __libc_sigsuspend(const sigset_t *mask);
-int __libc_tcdrain(int fd);
-pid_t __libc_waitpid(pid_t pid, int *status, int options);
-int __libc_write(int fd, const void *buf, size_t count);
-
-#endif
diff --git a/mdk-stage1/dietlibc/libregex/rx.c b/mdk-stage1/dietlibc/libregex/rx.c
deleted file mode 100644
index 9bab3e22c..000000000
--- a/mdk-stage1/dietlibc/libregex/rx.c
+++ /dev/null
@@ -1,494 +0,0 @@
-#define NDEBUG
-#include <regex.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <string.h>
-#include <assert.h>
-
-/* this is ugly.
- * the idea is to build a parse tree, then do some poor man's OOP with a
- * generic matcher function call that is always that the start of each
- * record, and a next pointer. When the parse tree is done, we need to
- * recursively set the next pointers to point to the part of the parse
- * tree that needs to match next.
- * This is the prototype of the generic match function call pointer.
- * The first argument is the "this" pointer, the second is the text to
- * be matched against, ofs is the offset from the start of the matched
- * text (so we can match "^") and matches is an array where match
- * positions are stored. */
-/* now declared in regex.h: */
-/* typedef int (*matcher)(void*,const char*,int ofs,regmatch_t* matches,int plus,int eflags); */
-
-/* one would think that this is approach is an order of magnitude slower
- * than the standard NFA approach, but it isn't. The busybox grep took
- * 0.26 seconds for a fixed string compared to 0.19 seconds for the
- * glibc regex. */
-
-/* first part: parse a regex into a parse tree */
-struct bracketed {
- unsigned int cc[32];
-};
-
-/* now declared in regex.h:
-struct regex {
- matcher m;
- void* next;
- int pieces;
- int num;
- struct branch *b;
-}; */
-
-struct atom {
- matcher m;
- void* next;
- enum { ILLEGAL, EMPTY, REGEX, BRACKET, ANY, LINESTART, LINEEND, WORDSTART, WORDEND, CHAR, } type;
- int bnum;
- union {
- struct regex r;
- struct bracketed b;
- char c;
- } u;
-};
-
-struct piece {
- matcher m;
- void* next;
- struct atom a;
- unsigned char min,max;
-};
-
-struct branch {
- matcher m;
- void* next;
- int num;
- struct piece *p;
-};
-
-static void clearcc(unsigned int* x) {
- memset(x,0,sizeof(struct bracketed));
-}
-
-static void setcc(unsigned int* x,unsigned int bit) {
- x[bit/32]|=(1<<((bit%32)-1));
-}
-
-static int issetcc(unsigned int* x,unsigned int bit) {
- return x[bit/32] & (1<<((bit%32)-1));
-}
-
-static const char* parsebracketed(struct bracketed*__restrict__ b,const char*__restrict__ s,regex_t*__restrict__ rx) {
- const char* t;
- int i,negflag=0;
- if (*s!='[') return s;
- t=s+1;
- clearcc(b->cc);
- if (*t=='^') { negflag=1; ++t; }
- do {
- if (*t==0) return s;
- setcc(b->cc,rx->cflags&REG_ICASE?tolower(*t):*t);
- if (t[1]=='-' && t[2]!=']') {
- for (i=*t+1; i<=t[2]; ++i) setcc(b->cc,rx->cflags&REG_ICASE?tolower(i):i);
- t+=2;
- }
- ++t;
- } while (*t!=']');
- if (negflag) for (i=0; i<32; ++i) b->cc[i]=~b->cc[i];
- return t+1;
-}
-
-static const char* parseregex(struct regex* r,const char* s,regex_t* rx);
-
-static int matchatom(void*__restrict__ x,const unsigned char*__restrict__ s,int ofs,struct __regex_t*__restrict__ preg,int plus,int eflags) {
- register struct atom* a=(struct atom*)x;
- int matchlen=0;
- assert(a->type!=ILLEGAL);
- switch (a->type) {
- case EMPTY:
-#ifdef DEBUG
- printf("matching atom EMPTY against \"%s\"\n",s);
- printf("a->bnum is %d\n",a->bnum);
-#endif
- if (a->bnum>=0) preg->l[a->bnum].rm_so=preg->l[a->bnum].rm_eo=ofs;
- goto match;
- case REGEX:
-#ifdef DEBUG
- printf("matching atom REGEX against \"%s\"\n",s);
- printf("a->bnum is %d\n",a->bnum);
-#endif
- if ((matchlen=a->u.r.m(&a->u.r,s,ofs,preg,0,eflags))>=0) {
- assert(a->bnum>=0);
- preg->l[a->bnum].rm_so=ofs;
- preg->l[a->bnum].rm_eo=ofs+matchlen;
- goto match;
- }
- break;
- case BRACKET:
-#ifdef DEBUG
- printf("matching atom BRACKET against \"%s\"\n",s);
-#endif
- matchlen=1;
- if (*s=='\n' && (preg->cflags&REG_NEWLINE)) break;
- if (*s && issetcc(a->u.b.cc,(preg->cflags&REG_ICASE?tolower(*s):*s)))
- goto match;
- break;
- case ANY:
-#ifdef DEBUG
- printf("matching atom ANY against \"%s\"\n",s);
-#endif
- if (*s=='\n' && (preg->cflags&REG_NEWLINE)) break;
- matchlen=1;
- if (*s) goto match;
- break;
- case LINESTART:
-#ifdef DEBUG
- printf("matching atom LINESTART against \"%s\"\n",s);
-#endif
- if (ofs==0 && (eflags&REG_NOTBOL)==0) {
- goto match;
- }
- break;
- case LINEEND:
-#ifdef DEBUG
- printf("matching atom LINEEND against \"%s\"\n",s);
-#endif
- if ((*s && *s!='\n') || (eflags&REG_NOTEOL)) break;
- goto match;
- case WORDSTART:
-#ifdef DEBUG
- printf("matching atom WORDSTART against \"%s\"\n",s);
-#endif
- if ((ofs==0 || !isalnum(s[-1])) && isalnum(*s))
- goto match;
- break;
- case WORDEND:
-#ifdef DEBUG
- printf("matching atom WORDEND against \"%s\"\n",s);
-#endif
- if (ofs>0 && isalnum(s[-1]) && !isalnum(*s))
- goto match;
- break;
- case CHAR:
-#ifdef DEBUG
- printf("matching atom CHAR %c against \"%s\"\n",a->u.c,s);
-#endif
- matchlen=1;
- if (((preg->cflags&REG_ICASE)?tolower(*s):*s)==a->u.c) goto match;
- break;
- }
- return -1;
-match:
- if (a->next)
- return ((struct atom*)(a->next))->m(a->next,s+matchlen,ofs+matchlen,preg,plus+matchlen,eflags);
- else
- return plus+matchlen;
-}
-
-static const char* parseatom(struct atom*__restrict__ a,const char*__restrict__ s,regex_t*__restrict__ rx) {
- const char *tmp;
- a->m=(matcher)matchatom;
- a->bnum=-1;
- switch (*s) {
- case '(':
- a->bnum=++rx->brackets;
- if (s[1]==')') {
- a->type=EMPTY;
- return s+2;
- }
- a->type=REGEX;
- if ((tmp=parseregex(&a->u.r,s+1,rx))!=s) {
- if (*tmp==')')
- return tmp+1;
- }
- case 0:
- case '|':
- case ')':
- return s;
- case '[':
- a->type=BRACKET;
- if ((tmp=parsebracketed(&a->u.b,s,rx))!=s)
- return tmp;
- return s;
- case '.':
- a->type=ANY;
- break;
- case '^':
- a->type=LINESTART;
- break;
- case '$':
- a->type=LINEEND;
- break;
- case '\\':
- if (!*++s) return s;
- if (*s=='<') {
- a->type=WORDSTART;
- break;
- } else if (*s=='>') {
- a->type=WORDEND;
- break;
- }
- default:
- a->type=CHAR;
- a->u.c=rx->cflags&REG_ICASE?tolower(*s):*s;
- break;
- }
- return s+1;
-}
-
-/* needs to do "greedy" matching, i.e. match as often as possible */
-static int matchpiece(void*__restrict__ x,const char*__restrict__ s,int ofs,struct __regex_t*__restrict__ preg,int plus,int eflags) {
- register struct piece* a=(struct piece*)x;
- int matchlen=0;
- int tmp=0,num=0;
- unsigned int *offsets;
- assert(a->max>0 && a->max<1000);
-#ifdef DEBUG
- printf("alloca(%d)\n",sizeof(int)*a->max);
-#endif
- offsets=alloca(sizeof(int)*a->max);
- offsets[0]=0;
-// printf("allocating %d offsets...\n",a->max);
-// printf("matchpiece \"%s\"...\n",s);
- /* first, try to match the atom as often as possible, up to a->max times */
- if (a->max == 1 && a->min == 1)
- return a->a.m(&a->a,s+matchlen,ofs+matchlen,preg,0,eflags);
- while (num<a->max) {
- void* save=a->a.next;
- a->a.next=0;
- if ((tmp=a->a.m(&a->a,s+matchlen,ofs+matchlen,preg,0,eflags))>=0) {
- a->a.next=save;
- ++num;
- matchlen+=tmp;
-// printf("setting offsets[%d] to %d\n",num,tmp);
- offsets[num]=tmp;
- } else {
- a->a.next=save;
- break;
- }
- }
- if (num<a->min) return -1; /* already at minimum matches; signal mismatch */
- /* then, while the rest does not match, back off */
- for (;num>=0;) {
- if (a->next)
- tmp=((struct atom*)(a->next))->m(a->next,s+matchlen,ofs+matchlen,preg,plus+matchlen,eflags);
- else
- tmp=plus+matchlen;
- if (tmp>=0) break; /* it did match; don't back off any further */
-// printf("using offsets[%d] (%d)\n",num,offsets[num]);
- matchlen-=offsets[num];
- --num;
- }
- return tmp;
-}
-
-static const char* parsepiece(struct piece*__restrict__ p,const char*__restrict__ s,regex_t*__restrict__ rx) {
- const char* tmp=parseatom(&p->a,s,rx);
- if (tmp==s) return s;
- p->m=matchpiece;
- p->min=p->max=1;
- switch (*tmp) {
- case '*': p->min=0; p->max=RE_DUP_MAX; break;
- case '+': p->min=1; p->max=RE_DUP_MAX; break;
- case '?': p->min=0; p->max=1; break;
- case '{':
- if (isdigit(*++tmp)) {
- p->min=*tmp-'0'; p->max=RE_DUP_MAX;
- while (isdigit(*++tmp)) p->min=p->min*10+*tmp-'0';
- if (*tmp==',') {
- if (isdigit(*++tmp)) {
- p->max=*tmp-'0';
- while (isdigit(*++tmp)) p->max=p->max*10+*tmp-'0';
- }
- }
- if (*tmp!='}') return s;
- ++tmp;
- }
- default:
- return tmp;
- }
- return tmp+1;
-}
-
-/* trivial, just pass through */
-static int matchbranch(void*__restrict__ x,const char*__restrict__ s,int ofs,struct __regex_t*__restrict__ preg,int plus,int eflags) {
- register struct branch* a=(struct branch*)x;
- int tmp;
-#ifdef DEBUG
- printf("%08p matching branch against \"%s\"\n",a,s);
- printf("%p %p\n",&a->p->m,a->p->m);
-#endif
- assert(a->p->m==matchpiece);
- tmp=a->p->m(a->p,s,ofs,preg,plus,eflags);
- if (tmp>=0) {
- if (a->next)
- return ((struct atom*)(a->next))->m(a->next,s+tmp,ofs+tmp,preg,plus+tmp,eflags);
- else
- return plus+tmp;
- }
- return -1;
-}
-
-static const char* parsebranch(struct branch*__restrict__ b,const char*__restrict__ s,regex_t*__restrict__ rx,int*__restrict__ pieces) {
- struct piece p;
- const char *tmp; /* the gcc warning here is bogus */
- b->m=matchbranch;
- b->num=0; b->p=0;
- for (;;) {
- if (*s=='|') {
- if (b->num==0) {
- tmp=s+1;
- p.a.type=EMPTY;
- p.min=p.max=1;
- }
- } else {
- tmp=parsepiece(&p,s,rx);
- if (tmp==s) return s;
- }
-// printf("b->p from %p to ",b->p);
- if (!(b->p=realloc(b->p,++b->num*sizeof(p)))) return s;
-// printf("%p (size %d)\n",b->p,b->num*sizeof(p));
- b->p[b->num-1]=p;
- if (*tmp=='|') { break; }
- s=tmp;
- }
- *pieces+=b->num;
- return tmp;
-}
-
-/* try the branches one by one */
-static int matchregex(void*__restrict__ x,const char*__restrict__ s,int ofs,struct __regex_t*__restrict__ preg,int plus,int eflags) {
- register struct regex* a=(struct regex*)x;
- int i,tmp;
-#ifdef DEBUG
- printf("%08p matching regex against \"%s\"\n",a,s);
-#endif
- for (i=0; i<a->num; ++i) {
- assert(a->b[i].m==matchbranch);
- tmp=a->b[i].m(&a->b[i],s,ofs,preg,plus,eflags);
- if (tmp>=0) {
- if (a->next)
- return ((struct atom*)(a->next))->m(a->next,s+tmp,ofs+tmp,preg,plus+tmp,eflags);
- else
- return plus+tmp;
- }
- }
- return -1;
-}
-
-static const char* parseregex(struct regex*__restrict__ r,const char*__restrict__ s,regex_t*__restrict__ p) {
- struct branch b;
- const char *tmp;
- r->m=matchregex;
- r->num=0; r->b=0; r->pieces=0;
- p->brackets=0;
- for (;;) {
- tmp=parsebranch(&b,s,p,&r->pieces);
- if (tmp==s) return s;
-// printf("r->b from %p to ",r->b);
- if (!(r->b=realloc(r->b,++r->num*sizeof(b)))) return s;
-// printf("%p (size %d)\n",r->b,r->num*sizeof(b));
- r->b[r->num-1]=b;
- s=tmp; if (*s=='|') ++s;
- }
- return tmp;
-}
-
-
-/* The matcher relies on the presence of next pointers, of which the
- * parser does not know the correct destination. So we need an
- * additional pass through the data structure that sets the next
- * pointers correctly. */
-static void regex_putnext(struct regex* r,void* next);
-
-static void atom_putnext(struct atom*__restrict__ a,void*__restrict__ next) {
- a->next=next;
- if (a->type==REGEX)
- regex_putnext(&a->u.r,0);
-}
-
-static void piece_putnext(struct piece*__restrict__ p,void*__restrict__ next) {
- p->next=next;
- atom_putnext(&p->a,next);
-}
-
-static void branch_putnext(struct branch*__restrict__ b,void*__restrict__ next) {
- int i;
- for (i=0; i<b->num-1; ++i) {
- if (b->p[i+1].min==1 && b->p[i+1].max==1)
- piece_putnext(&b->p[i],&b->p[i+1].a);
- else
- piece_putnext(&b->p[i],&b->p[i+1]);
- }
- piece_putnext(&b->p[i],0);
- b->next=next;
-}
-
-static void regex_putnext(struct regex*__restrict__ r,void*__restrict__ next) {
- int i;
- for (i=0; i<r->num; ++i)
- branch_putnext(&r->b[i],next);
- r->next=next;
-}
-
-
-
-int regcomp(regex_t*__restrict__ preg, const char*__restrict__ regex, int cflags) {
- const char* t;
- preg->cflags=cflags;
- t=parseregex(&preg->r,regex,preg);
- if (t==regex) return -1;
- regex_putnext(&preg->r,0);
- return 0;
-}
-
-int regexec(const regex_t*__restrict__ preg, const char*__restrict__ string, size_t nmatch, regmatch_t pmatch[], int eflags) {
- int matched;
- const char *orig=string;
- assert(preg->brackets+1>0 && preg->brackets<1000);
-#ifdef DEBUG
- printf("alloca(%d)\n",sizeof(regmatch_t)*(preg->brackets+3));
-#endif
- ((regex_t*)preg)->l=alloca(sizeof(regmatch_t)*(preg->brackets+3));
- while (*string) {
- matched=preg->r.m((void*)&preg->r,string,string-orig,(regex_t*)preg,0,eflags);
-// printf("ebp on stack = %x\n",stack[1]);
- if (matched>=0) {
- preg->l[0].rm_so=string-orig;
- preg->l[0].rm_eo=string-orig+matched;
- if ((preg->cflags&REG_NOSUB)==0) memcpy(pmatch,preg->l,nmatch*sizeof(regmatch_t));
- return 0;
- }
- ++string; eflags|=REG_NOTBOL;
- }
- return REG_NOMATCH;
-}
-
-
-
-void regfree(regex_t* preg) {
- int i;
- for (i=0; i<preg->r.num; ++i)
- free(preg->r.b[i].p);
- free(preg->r.b);
-}
-
-size_t regerror(int errcode, const regex_t*__restrict__ preg, char*__restrict__ errbuf, size_t errbuf_size) {
- strncpy(errbuf,"invalid regular expression (sorry)",errbuf_size);
- return strlen(errbuf);
-}
-
-
-
-
-#if 0
-int main() {
- struct regex r;
- int bnum=-1;
- const char* t=parseregex(&r,"^a*ab$",&bnum);
- regex_putnext(&r,0);
- printf("%d pieces, %s\n",r.pieces,t);
- printf("%d\n",r.m(&r,"aaab",0,0,0));
- return 0;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/librpc/auth_none.c b/mdk-stage1/dietlibc/librpc/auth_none.c
deleted file mode 100644
index 59124bae4..000000000
--- a/mdk-stage1/dietlibc/librpc/auth_none.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* @(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * auth_none.c
- * Creates a client authentication handle for passing "null"
- * credentials and verifiers to remote systems.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/auth.h>
-#define MAX_MARSHEL_SIZE 20
-
-static void authnone_verf();
-static bool_t authnone_validate();
-static bool_t authnone_refresh();
-static void authnone_destroy();
-static bool_t authnone_marshal(AUTH *client, XDR *xdrs);
-
-static struct auth_ops ops = {
- authnone_verf,
- authnone_marshal,
- authnone_validate,
- authnone_refresh,
- authnone_destroy
-};
-
-static struct authnone_private {
- AUTH no_client;
- char marshalled_client[MAX_MARSHEL_SIZE];
- unsigned int mcnt;
-} *authnone_private;
-
-AUTH *authnone_create()
-{
- register struct authnone_private *ap = authnone_private;
- XDR xdr_stream;
- register XDR *xdrs;
-
- if (ap == 0) {
- ap = (struct authnone_private *) calloc(1, sizeof(*ap));
- if (ap == 0)
- return (0);
- authnone_private = ap;
- }
- if (!ap->mcnt) {
- ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth;
- ap->no_client.ah_ops = &ops;
- xdrs = &xdr_stream;
- xdrmem_create(xdrs, ap->marshalled_client,
- (unsigned int) MAX_MARSHEL_SIZE, XDR_ENCODE);
- (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_cred);
- (void) xdr_opaque_auth(xdrs, &ap->no_client.ah_verf);
- ap->mcnt = XDR_GETPOS(xdrs);
- XDR_DESTROY(xdrs);
- }
- return (&ap->no_client);
-}
-
- /*ARGSUSED*/ static bool_t authnone_marshal(client, xdrs)
-AUTH *client;
-XDR *xdrs;
-{
- register struct authnone_private *ap = authnone_private;
-
- if (ap == 0)
- return (0);
- return ((*xdrs->x_ops->x_putbytes) (xdrs,
- ap->marshalled_client, ap->mcnt));
-}
-
-static void authnone_verf()
-{
-}
-
-static bool_t authnone_validate()
-{
-
- return (TRUE);
-}
-
-static bool_t authnone_refresh()
-{
-
- return (FALSE);
-}
-
-static void authnone_destroy()
-{
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/auth_unix.c b/mdk-stage1/dietlibc/librpc/auth_unix.c
deleted file mode 100644
index 59eb6ff18..000000000
--- a/mdk-stage1/dietlibc/librpc/auth_unix.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/* @(#)auth_unix.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * auth_unix.c, Implements UNIX style authentication parameters.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * The system is very weak. The client uses no encryption for it's
- * credentials and only sends null verifiers. The server sends backs
- * null verifiers or optionally a verifier that suggests a new short hand
- * for the credentials.
- *
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <string.h>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/auth.h>
-#include <rpc/auth_unix.h>
-
-/*
- * Unix authenticator operations vector
- */
-static void authunix_nextverf();
-static bool_t authunix_marshal();
-static bool_t authunix_validate();
-static bool_t authunix_refresh();
-static void authunix_destroy();
-
-static struct auth_ops auth_unix_ops = {
- authunix_nextverf,
- authunix_marshal,
- authunix_validate,
- authunix_refresh,
- authunix_destroy
-};
-
-/*
- * This struct is pointed to by the ah_private field of an auth_handle.
- */
-struct audata {
- struct opaque_auth au_origcred; /* original credentials */
- struct opaque_auth au_shcred; /* short hand cred */
- unsigned long au_shfaults; /* short hand cache faults */
- char au_marshed[MAX_AUTH_BYTES];
- unsigned int au_mpos; /* xdr pos at end of marshed */
-};
-
-#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private)
-
-static void marshal_new_auth();
-
-
-/*
- * Create a unix style authenticator.
- * Returns an auth handle with the given stuff in it.
- */
-AUTH *authunix_create __P ((char *machname, uid_t uid,
- gid_t gid, int len,
- gid_t *aup_gids))
-{
- struct authunix_parms aup;
- char mymem[MAX_AUTH_BYTES];
- struct timeval now;
- XDR xdrs;
- register AUTH *auth;
- register struct audata *au;
-
- /*
- * Allocate and set up auth handle
- */
- auth = (AUTH *) mem_alloc(sizeof(*auth));
-#ifndef KERNEL
- if (auth == NULL) {
- (void) fprintf(stderr, "authunix_create: out of memory\n");
- return (NULL);
- }
-#endif
- au = (struct audata *) mem_alloc(sizeof(*au));
-#ifndef KERNEL
- if (au == NULL) {
- (void) fprintf(stderr, "authunix_create: out of memory\n");
- return (NULL);
- }
-#endif
- auth->ah_ops = &auth_unix_ops;
- auth->ah_private = (char*) au;
- auth->ah_verf = au->au_shcred = _null_auth;
- au->au_shfaults = 0;
-
- /*
- * fill in param struct from the given params
- */
- (void) gettimeofday(&now, (struct timezone *) 0);
- aup.aup_time = now.tv_sec;
- aup.aup_machname = machname;
- aup.aup_uid = uid;
- aup.aup_gid = gid;
- aup.aup_len = (unsigned int) len;
- aup.aup_gids = aup_gids;
-
- /*
- * Serialize the parameters into origcred
- */
- xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE);
- if (!xdr_authunix_parms(&xdrs, &aup))
- abort();
- au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs);
- au->au_origcred.oa_flavor = AUTH_UNIX;
-#ifdef KERNEL
- au->au_origcred.oa_base = mem_alloc((unsigned int) len);
-#else
- if ((au->au_origcred.oa_base = mem_alloc((unsigned int) len)) == NULL) {
- (void) fprintf(stderr, "authunix_create: out of memory\n");
- return (NULL);
- }
-#endif
- memmove(au->au_origcred.oa_base, mymem, (unsigned int) len);
-
- /*
- * set auth handle to reflect new cred.
- */
- auth->ah_cred = au->au_origcred;
- marshal_new_auth(auth);
- return (auth);
-}
-
-/*
- * Returns an auth handle with parameters determined by doing lots of
- * syscalls.
- */
-AUTH *authunix_create_default()
-{
- register int len;
- char machname[MAX_MACHINE_NAME + 1];
- register int uid;
- register int gid;
- gid_t gids[NGRPS];
-
- if (gethostname(machname, MAX_MACHINE_NAME) == -1)
- abort();
- machname[MAX_MACHINE_NAME] = 0;
- uid = geteuid();
- gid = getegid();
- if ((len = getgroups(NGRPS, gids)) < 0)
- abort();
- return (authunix_create(machname, uid, gid, len, gids));
-}
-
-/*
- * authunix operations
- */
-
-static void authunix_nextverf(auth)
-AUTH *auth;
-{
- /* no action necessary */
-}
-
-static bool_t authunix_marshal(auth, xdrs)
-AUTH *auth;
-XDR *xdrs;
-{
- register struct audata *au = AUTH_PRIVATE(auth);
-
- return (XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos));
-}
-
-static bool_t authunix_validate(auth, verf)
-register AUTH *auth;
-struct opaque_auth verf;
-{
- register struct audata *au;
- XDR xdrs;
-
- if (verf.oa_flavor == AUTH_SHORT) {
- au = AUTH_PRIVATE(auth);
- xdrmem_create(&xdrs, verf.oa_base, verf.oa_length, XDR_DECODE);
-
- if (au->au_shcred.oa_base != NULL) {
- mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length);
- au->au_shcred.oa_base = NULL;
- }
- if (xdr_opaque_auth(&xdrs, &au->au_shcred)) {
- auth->ah_cred = au->au_shcred;
- } else {
- xdrs.x_op = XDR_FREE;
- (void) xdr_opaque_auth(&xdrs, &au->au_shcred);
- au->au_shcred.oa_base = NULL;
- auth->ah_cred = au->au_origcred;
- }
- marshal_new_auth(auth);
- }
- return (TRUE);
-}
-
-static bool_t authunix_refresh(auth)
-register AUTH *auth;
-{
- register struct audata *au = AUTH_PRIVATE(auth);
- struct authunix_parms aup;
- struct timeval now;
- XDR xdrs;
- register int stat;
-
- if (auth->ah_cred.oa_base == au->au_origcred.oa_base) {
- /* there is no hope. Punt */
- return (FALSE);
- }
- au->au_shfaults++;
-
- /* first deserialize the creds back into a struct authunix_parms */
- aup.aup_machname = NULL;
- aup.aup_gids = (gid_t *) NULL;
- xdrmem_create(&xdrs, au->au_origcred.oa_base,
- au->au_origcred.oa_length, XDR_DECODE);
- stat = xdr_authunix_parms(&xdrs, &aup);
- if (!stat)
- goto done;
-
- /* update the time and serialize in place */
- (void) gettimeofday(&now, (struct timezone *) 0);
- aup.aup_time = now.tv_sec;
- xdrs.x_op = XDR_ENCODE;
- XDR_SETPOS(&xdrs, 0);
- stat = xdr_authunix_parms(&xdrs, &aup);
- if (!stat)
- goto done;
- auth->ah_cred = au->au_origcred;
- marshal_new_auth(auth);
- done:
- /* free the struct authunix_parms created by deserializing */
- xdrs.x_op = XDR_FREE;
- (void) xdr_authunix_parms(&xdrs, &aup);
- XDR_DESTROY(&xdrs);
- return (stat);
-}
-
-static void authunix_destroy(auth)
-register AUTH *auth;
-{
- register struct audata *au = AUTH_PRIVATE(auth);
-
- mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length);
-
- if (au->au_shcred.oa_base != NULL)
- mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length);
-
- mem_free(auth->ah_private, sizeof(struct audata));
-
- if (auth->ah_verf.oa_base != NULL)
- mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length);
-
- mem_free((char*) auth, sizeof(*auth));
-}
-
-/*
- * Marshals (pre-serializes) an auth struct.
- * sets private data, au_marshed and au_mpos
- */
-static void marshal_new_auth(auth)
-register AUTH *auth;
-{
- XDR xdr_stream;
- register XDR *xdrs = &xdr_stream;
- register struct audata *au = AUTH_PRIVATE(auth);
-
- xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
- if ((!xdr_opaque_auth(xdrs, &(auth->ah_cred))) ||
- (!xdr_opaque_auth(xdrs, &(auth->ah_verf)))) {
- perror("auth_none.c - Fatal marshalling problem");
- } else {
- au->au_mpos = XDR_GETPOS(xdrs);
- }
- XDR_DESTROY(xdrs);
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/authunix_prot.c b/mdk-stage1/dietlibc/librpc/authunix_prot.c
deleted file mode 100644
index 53897a364..000000000
--- a/mdk-stage1/dietlibc/librpc/authunix_prot.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* @(#)authunix_prot.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * authunix_prot.c
- * XDR for UNIX style authentication parameters for RPC
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/auth.h>
-#include <rpc/auth_unix.h>
-
-/*
- * XDR for unix authentication parameters.
- */
-bool_t xdr_authunix_parms(xdrs, p)
-register XDR *xdrs;
-register struct authunix_parms *p;
-{
- int a,b;
-
- if (xdr_u_long(xdrs, &(p->aup_time))
- && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
- && xdr_int(xdrs, &a)
- && xdr_int(xdrs, &b)
- && xdr_array(xdrs, (char* *) & (p->aup_gids),
- &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int)) {
- p->aup_uid=(uid_t)a;
- p->aup_gid=(gid_t)b;
- return (TRUE);
- }
- return (FALSE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/bindresvport.c b/mdk-stage1/dietlibc/librpc/bindresvport.c
deleted file mode 100644
index 1131cc263..000000000
--- a/mdk-stage1/dietlibc/librpc/bindresvport.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * Copyright (c) 1987 by Sun Microsystems, Inc.
- */
-
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include "dietfeatures.h"
-
-/*
- * Bind a socket to a privileged IP port
- */
-int bindresvport(sd, sin)
-int sd;
-struct sockaddr_in *sin;
-{
- int res;
- static short port;
- struct sockaddr_in myaddr;
- int i;
-
-#define STARTPORT 600
-#define ENDPORT (IPPORT_RESERVED - 1)
-#define NPORTS (ENDPORT - STARTPORT + 1)
-
- if (sin == (struct sockaddr_in *) 0) {
- sin = &myaddr;
- memset(sin,0,sizeof(*sin));
- sin->sin_family = AF_INET;
- } else if (sin->sin_family != AF_INET) {
- errno = EPFNOSUPPORT;
- return (-1);
- }
- if (port == 0) {
- port = (getpid() % NPORTS) + STARTPORT;
- }
- res = -1;
- errno = EADDRINUSE;
- for (i = 0; i < NPORTS && res < 0 && errno == EADDRINUSE; i++) {
- sin->sin_port = htons(port++);
- if (port > ENDPORT) {
- port = STARTPORT;
- }
- res = bind(sd, (struct sockaddr*)sin, sizeof(struct sockaddr_in));
- }
- return (res);
-}
diff --git a/mdk-stage1/dietlibc/librpc/clnt_generic.c b/mdk-stage1/dietlibc/librpc/clnt_generic.c
deleted file mode 100644
index 5c0b96af9..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_generic.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* @(#)clnt_generic.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI";
-#endif
-/*
- * Copyright (C) 1987, Sun Microsystems, Inc.
- */
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <netdb.h>
-#include <string.h>
-
-/*
- * Generic client creation: takes (hostname, program-number, protocol) and
- * returns client handle. Default options are set, which the user can
- * change using the rpc equivalent of ioctl()'s.
- */
-CLIENT *clnt_create __P ((const char *hostname, const unsigned long prog,
- const unsigned long vers, const char *proto))
-{
- struct hostent *h;
- struct protoent *p;
- struct sockaddr_in sin;
- int sock;
- struct timeval tv;
- CLIENT *client;
-
- h = gethostbyname(hostname);
- if (h == NULL) {
- rpc_createerr.cf_stat = RPC_UNKNOWNHOST;
- return (NULL);
- }
- if (h->h_addrtype != AF_INET) {
- /*
- * Only support INET for now
- */
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = EAFNOSUPPORT;
- return (NULL);
- }
-#ifdef __linux__
- memset((char*)&sin,0,sizeof(sin));
-#endif
- sin.sin_family = h->h_addrtype;
- sin.sin_port = 0;
-#ifndef __linux__
- memset(sin.sin_zero,0,sizeof(sin.sin_zero));
-#endif
- memmove((char *) &sin.sin_addr, h->h_addr, h->h_length);
- p = getprotobyname(proto);
- if (p == NULL) {
- rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
- rpc_createerr.cf_error.re_errno = EPFNOSUPPORT;
- return (NULL);
- }
- sock = RPC_ANYSOCK;
- switch (p->p_proto) {
- case IPPROTO_UDP:
- tv.tv_sec = 5;
- tv.tv_usec = 0;
- client = clntudp_create(&sin, prog, vers, tv, &sock);
- if (client == NULL) {
- return (NULL);
- }
- tv.tv_sec = 25;
- clnt_control(client, CLSET_TIMEOUT, (char*)&tv);
- break;
- case IPPROTO_TCP:
- client = clnttcp_create(&sin, prog, vers, &sock, 0, 0);
- if (client == NULL) {
- return (NULL);
- }
- tv.tv_sec = 25;
- tv.tv_usec = 0;
- clnt_control(client, CLSET_TIMEOUT, (char*)&tv);
- break;
- default:
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = EPFNOSUPPORT;
- return (NULL);
- }
- return (client);
-}
diff --git a/mdk-stage1/dietlibc/librpc/clnt_perror.c b/mdk-stage1/dietlibc/librpc/clnt_perror.c
deleted file mode 100644
index 4ede1a43e..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_perror.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* @(#)clnt_perror.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)clnt_perror.c 1.15 87/10/07 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * clnt_perror.c
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- */
-#include <stdio.h>
-
-#include <rpc/types.h>
-#include <rpc/auth.h>
-#include <rpc/clnt.h>
-
-//extern char *sys_errlist[];
-//static char *auth_errmsg();
-
-extern char *strcpy();
-
-#if 0
-static char *buf;
-
-static char *_buf()
-{
-
- if (buf == 0)
- buf = (char *) malloc(256);
- return (buf);
-}
-#endif
-
-/*
- * Print reply error info
- */
-char *clnt_sperror __P ((CLIENT *rpch, const char *s))
-{
-#if 0
- struct rpc_err e;
- void clnt_perrno();
- char *err;
- char *str = _buf();
- char *strstart = str;
-
- if (str == 0)
- return (0);
- CLNT_GETERR(rpch, &e);
-
- (void) sprintf(str, "%s: ", s);
- str += strlen(str);
-
- (void) strcpy(str, clnt_sperrno(e.re_status));
- str += strlen(str);
-
- switch (e.re_status) {
- case RPC_SUCCESS:
- case RPC_CANTENCODEARGS:
- case RPC_CANTDECODERES:
- case RPC_TIMEDOUT:
- case RPC_PROGUNAVAIL:
- case RPC_PROCUNAVAIL:
- case RPC_CANTDECODEARGS:
- case RPC_SYSTEMERROR:
- case RPC_UNKNOWNHOST:
- case RPC_UNKNOWNPROTO:
- case RPC_PMAPFAILURE:
- case RPC_PROGNOTREGISTERED:
- case RPC_FAILED:
- break;
-
- case RPC_CANTSEND:
- case RPC_CANTRECV:
- (void) sprintf(str, "; errno = %s", sys_errlist[e.re_errno]);
- str += strlen(str);
- break;
-
- case RPC_VERSMISMATCH:
- (void) sprintf(str,
- "; low version = %lu, high version = %lu",
- e.re_vers.low, e.re_vers.high);
- str += strlen(str);
- break;
-
- case RPC_AUTHERROR:
- err = auth_errmsg(e.re_why);
- (void) sprintf(str, "; why = ");
- str += strlen(str);
- if (err != NULL) {
- (void) sprintf(str, "%s", err);
- } else {
- (void) sprintf(str,
- "(unknown authentication error - %d)",
- (int) e.re_why);
- }
- str += strlen(str);
- break;
-
- case RPC_PROGVERSMISMATCH:
- (void) sprintf(str,
- "; low version = %lu, high version = %lu",
- e.re_vers.low, e.re_vers.high);
- str += strlen(str);
- break;
-
- default: /* unknown */
- (void) sprintf(str,
- "; s1 = %lu, s2 = %lu", e.re_lb.s1, e.re_lb.s2);
- str += strlen(str);
- break;
- }
- (void) sprintf(str, "\n");
- return (strstart);
-#endif
- return (0);
-}
-
-void clnt_perror __P ((CLIENT *rpch, const char *s))
-{
- (void) fprintf(stderr, "%s", clnt_sperror(rpch, s));
-}
-
-
-struct rpc_errtab {
- enum clnt_stat status;
- char *message;
-};
-
-#if 0
-static struct rpc_errtab rpc_errlist[] = {
- {RPC_SUCCESS,
- "RPC: Success"},
- {RPC_CANTENCODEARGS,
- "RPC: Can't encode arguments"},
- {RPC_CANTDECODERES,
- "RPC: Can't decode result"},
- {RPC_CANTSEND,
- "RPC: Unable to send"},
- {RPC_CANTRECV,
- "RPC: Unable to receive"},
- {RPC_TIMEDOUT,
- "RPC: Timed out"},
- {RPC_VERSMISMATCH,
- "RPC: Incompatible versions of RPC"},
- {RPC_AUTHERROR,
- "RPC: Authentication error"},
- {RPC_PROGUNAVAIL,
- "RPC: Program unavailable"},
- {RPC_PROGVERSMISMATCH,
- "RPC: Program/version mismatch"},
- {RPC_PROCUNAVAIL,
- "RPC: Procedure unavailable"},
- {RPC_CANTDECODEARGS,
- "RPC: Server can't decode arguments"},
- {RPC_SYSTEMERROR,
- "RPC: Remote system error"},
- {RPC_UNKNOWNHOST,
- "RPC: Unknown host"},
- {RPC_UNKNOWNPROTO,
- "RPC: Unknown protocol"},
- {RPC_PMAPFAILURE,
- "RPC: Port mapper failure"},
- {RPC_PROGNOTREGISTERED,
- "RPC: Program not registered"},
- {RPC_FAILED,
- "RPC: Failed (unspecified error)"}
-};
-#endif
-
-/*
- * This interface for use by clntrpc
- */
-char *clnt_sperrno(stat)
-enum clnt_stat stat;
-{
-#if 0
- int i;
-
- for (i = 0; i < sizeof(rpc_errlist) / sizeof(struct rpc_errtab); i++) {
- if (rpc_errlist[i].status == stat) {
- return (rpc_errlist[i].message);
- }
- }
-#endif
- return ("RPC: (unknown error code)");
-}
-
-void clnt_perrno(num)
-enum clnt_stat num;
-{
- (void) fprintf(stderr, "%s", clnt_sperrno(num));
-}
-
-
-char *clnt_spcreateerror __P ((__const char *s))
-{
-#if 0
- extern int sys_nerr;
- extern char *sys_errlist[];
- char *str = _buf();
-
- if (str == 0)
- return (0);
- (void) sprintf(str, "%s: ", s);
- (void) strcat(str, clnt_sperrno(rpc_createerr.cf_stat));
- switch (rpc_createerr.cf_stat) {
- case RPC_PMAPFAILURE:
- (void) strcat(str, " - ");
- (void) strcat(str, clnt_sperrno(rpc_createerr.cf_error.re_status));
- break;
-
- case RPC_SYSTEMERROR:
- (void) strcat(str, " - ");
- if (rpc_createerr.cf_error.re_errno > 0
- && rpc_createerr.cf_error.re_errno < sys_nerr)
- (void) strcat(str,
- sys_errlist[rpc_createerr.cf_error.re_errno]);
- else
- (void) sprintf(&str[strlen(str)], "Error %d",
- rpc_createerr.cf_error.re_errno);
- break;
- }
- (void) strcat(str, "\n");
- return (str);
-#endif
- return(0);
-}
-
-extern void clnt_pcreateerror __P ((__const char *s))
-{
- (void) fprintf(stderr, "%s", clnt_spcreateerror(s));
-}
-
-struct auth_errtab {
- enum auth_stat status;
- char *message;
-};
-
-#if 0
-static struct auth_errtab auth_errlist[] = {
- {AUTH_OK,
- "Authentication OK"},
- {AUTH_BADCRED,
- "Invalid client credential"},
- {AUTH_REJECTEDCRED,
- "Server rejected credential"},
- {AUTH_BADVERF,
- "Invalid client verifier"},
- {AUTH_REJECTEDVERF,
- "Server rejected verifier"},
- {AUTH_TOOWEAK,
- "Client credential too weak"},
- {AUTH_INVALIDRESP,
- "Invalid server verifier"},
- {AUTH_FAILED,
- "Failed (unspecified error)"},
-};
-
-static char *auth_errmsg(stat)
-enum auth_stat stat;
-{
- int i;
-
- for (i = 0; i < sizeof(auth_errlist) / sizeof(struct auth_errtab); i++) {
- if (auth_errlist[i].status == stat) {
- return (auth_errlist[i].message);
- }
- }
- return (NULL);
-}
-#endif
diff --git a/mdk-stage1/dietlibc/librpc/clnt_raw.c b/mdk-stage1/dietlibc/librpc/clnt_raw.c
deleted file mode 100644
index 52ab64421..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_raw.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* @(#)clnt_raw.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * clnt_raw.c
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * Memory based rpc for simple testing and timing.
- * Interface to create an rpc client and server in the same process.
- * This lets us similate rpc and get round trip overhead, without
- * any interference from the kernal.
- */
-
-#include <rpc/rpc.h>
-
-#define MCALL_MSG_SIZE 24
-
-/*
- * This is the "network" we will be moving stuff over.
- */
-static struct clntraw_private {
- CLIENT client_object;
- XDR xdr_stream;
- char _raw_buf[UDPMSGSIZE];
- char mashl_callmsg[MCALL_MSG_SIZE];
- unsigned int mcnt;
-} *clntraw_private;
-
-static enum clnt_stat clntraw_call();
-static void clntraw_abort();
-static void clntraw_geterr();
-static bool_t clntraw_freeres();
-static bool_t clntraw_control();
-static void clntraw_destroy();
-
-static struct clnt_ops client_ops = {
- clntraw_call,
- clntraw_abort,
- clntraw_geterr,
- clntraw_freeres,
- clntraw_destroy,
- clntraw_control
-};
-
-/*
- * Create a client handle for memory based rpc.
- */
-CLIENT *clntraw_create(prog, vers)
-unsigned long prog;
-unsigned long vers;
-{
- register struct clntraw_private *clp = clntraw_private;
- struct rpc_msg call_msg;
- XDR *xdrs = &clp->xdr_stream;
- CLIENT *client = &clp->client_object;
-
- if (clp == 0) {
- clp = (struct clntraw_private *) calloc(1, sizeof(*clp));
- if (clp == 0)
- return (0);
- clntraw_private = clp;
- }
- /*
- * pre-serialize the staic part of the call msg and stash it away
- */
- call_msg.rm_direction = CALL;
- call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
- call_msg.rm_call.cb_prog = prog;
- call_msg.rm_call.cb_vers = vers;
- xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
- if (!xdr_callhdr(xdrs, &call_msg)) {
- perror("clnt_raw.c - Fatal header serialization error.");
- }
- clp->mcnt = XDR_GETPOS(xdrs);
- XDR_DESTROY(xdrs);
-
- /*
- * Set xdrmem for client/server shared buffer
- */
- xdrmem_create(xdrs, clp->_raw_buf, UDPMSGSIZE, XDR_FREE);
-
- /*
- * create client handle
- */
- client->cl_ops = &client_ops;
- client->cl_auth = authnone_create();
- return (client);
-}
-
-static enum clnt_stat
-clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
-CLIENT *h;
-unsigned long proc;
-xdrproc_t xargs;
-char* argsp;
-xdrproc_t xresults;
-char* resultsp;
-struct timeval timeout;
-{
- register struct clntraw_private *clp = clntraw_private;
- register XDR *xdrs = &clp->xdr_stream;
- struct rpc_msg msg;
- enum clnt_stat status;
- struct rpc_err error;
-
- if (clp == 0)
- return (RPC_FAILED);
- call_again:
- /*
- * send request
- */
- xdrs->x_op = XDR_ENCODE;
- XDR_SETPOS(xdrs, 0);
- ((struct rpc_msg *) clp->mashl_callmsg)->rm_xid++;
- if ((!XDR_PUTBYTES(xdrs, clp->mashl_callmsg, clp->mcnt)) ||
- (!XDR_PUTLONG(xdrs, (long *) &proc)) ||
- (!AUTH_MARSHALL(h->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp))) {
- return (RPC_CANTENCODEARGS);
- }
- (void) XDR_GETPOS(xdrs); /* called just to cause overhead */
-
- /*
- * We have to call server input routine here because this is
- * all going on in one process. Yuk.
- */
- svc_getreq(1);
-
- /*
- * get results
- */
- xdrs->x_op = XDR_DECODE;
- XDR_SETPOS(xdrs, 0);
- msg.acpted_rply.ar_verf = _null_auth;
- msg.acpted_rply.ar_results.where = resultsp;
- msg.acpted_rply.ar_results.proc = xresults;
- if (!xdr_replymsg(xdrs, &msg))
- return (RPC_CANTDECODERES);
- _seterr_reply(&msg, &error);
- status = error.re_status;
-
- if (status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(h->cl_auth, &msg.acpted_rply.ar_verf)) {
- status = RPC_AUTHERROR;
- }
- } /* end successful completion */
- else {
- if (AUTH_REFRESH(h->cl_auth))
- goto call_again;
- } /* end of unsuccessful completion */
-
- if (status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(h->cl_auth, &msg.acpted_rply.ar_verf)) {
- status = RPC_AUTHERROR;
- }
- if (msg.acpted_rply.ar_verf.oa_base != NULL) {
- xdrs->x_op = XDR_FREE;
- (void) xdr_opaque_auth(xdrs, &(msg.acpted_rply.ar_verf));
- }
- }
-
- return (status);
-}
-
-static void clntraw_geterr()
-{
-}
-
-
-static bool_t clntraw_freeres(cl, xdr_res, res_ptr)
-CLIENT *cl;
-xdrproc_t xdr_res;
-char* res_ptr;
-{
- register struct clntraw_private *clp = clntraw_private;
- register XDR *xdrs = &clp->xdr_stream;
- bool_t rval;
-
- if (clp == 0) {
- rval = (bool_t) RPC_FAILED;
- return (rval);
- }
- xdrs->x_op = XDR_FREE;
- return ((*xdr_res) (xdrs, res_ptr));
-}
-
-static void clntraw_abort()
-{
-}
-
-static bool_t clntraw_control()
-{
- return (FALSE);
-}
-
-static void clntraw_destroy()
-{
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/clnt_simple.c b/mdk-stage1/dietlibc/librpc/clnt_simple.c
deleted file mode 100644
index e1f4c5f6c..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_simple.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* @(#)clnt_simple.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * clnt_simple.c
- * Simplified front end to rpc.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <string.h>
-
-static struct callrpc_private {
- CLIENT *client;
- int socket;
- int oldprognum, oldversnum, valid;
- char *oldhost;
-} *callrpc_private;
-
-int callrpc (const char *host, const unsigned long prognum,
- const unsigned long versnum, const unsigned long procnum,
- const xdrproc_t inproc, const char *in,
- const xdrproc_t outproc, char *out)
-{
- register struct callrpc_private *crp = callrpc_private;
- struct sockaddr_in server_addr;
- enum clnt_stat clnt_stat;
- struct hostent *hp;
- struct timeval timeout, tottimeout;
-
- if (crp == 0) {
- crp = (struct callrpc_private *) calloc(1, sizeof(*crp));
- if (crp == 0)
- return (0);
- callrpc_private = crp;
- }
- if (crp->oldhost == NULL) {
- crp->oldhost = malloc(256);
- crp->oldhost[0] = 0;
- crp->socket = RPC_ANYSOCK;
- }
- if (crp->valid && crp->oldprognum == prognum
- && crp->oldversnum == versnum && strcmp(crp->oldhost, host) == 0) {
- /* reuse old client */
- } else {
- crp->valid = 0;
- (void) close(crp->socket);
- crp->socket = RPC_ANYSOCK;
- if (crp->client) {
- clnt_destroy(crp->client);
- crp->client = NULL;
- }
- if ((hp = gethostbyname(host)) == NULL)
- return ((int) RPC_UNKNOWNHOST);
- timeout.tv_usec = 0;
- timeout.tv_sec = 5;
- memmove((char *) &server_addr.sin_addr, hp->h_addr, hp->h_length);
- server_addr.sin_family = AF_INET;
- server_addr.sin_port = 0;
- if ((crp->client = clntudp_create(&server_addr, (unsigned long) prognum,
- (unsigned long) versnum, timeout,
- &crp->socket)) == NULL)
- return ((int) rpc_createerr.cf_stat);
- crp->valid = 1;
- crp->oldprognum = prognum;
- crp->oldversnum = versnum;
- (void) strcpy(crp->oldhost, host);
- }
- tottimeout.tv_sec = 25;
- tottimeout.tv_usec = 0;
- clnt_stat = clnt_call(crp->client, procnum, inproc, (char*)in,
- outproc, out, tottimeout);
- /*
- * if call failed, empty cache
- */
- if (clnt_stat != RPC_SUCCESS)
- crp->valid = 0;
- return ((int) clnt_stat);
-}
diff --git a/mdk-stage1/dietlibc/librpc/clnt_tcp.c b/mdk-stage1/dietlibc/librpc/clnt_tcp.c
deleted file mode 100644
index f2ebed677..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_tcp.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* @(#)clnt_tcp.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * clnt_tcp.c, Implements a TCP/IP based, client side RPC.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * TCP based RPC supports 'batched calls'.
- * A sequence of calls may be batched-up in a send buffer. The rpc call
- * return immediately to the client even though the call was not necessarily
- * sent. The batching occurs if the results' xdr routine is NULL (0) AND
- * the rpc timeout value is zero (see clnt.h, rpc).
- *
- * Clients should NOT casually batch calls that in fact return results; that is,
- * the server side should be aware that a call is batched and not produce any
- * return message. Batched calls that produce many result messages can
- * deadlock (netlock) the client and the server....
- *
- * Now go hang yourself.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <errno.h>
-#include <rpc/pmap_clnt.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-#define MCALL_MSG_SIZE 24
-
-static int readtcp();
-static int writetcp();
-
-static enum clnt_stat clnttcp_call();
-static void clnttcp_abort();
-static void clnttcp_geterr();
-static bool_t clnttcp_freeres();
-static bool_t clnttcp_control();
-static void clnttcp_destroy();
-
-static struct clnt_ops tcp_ops = {
- clnttcp_call,
- clnttcp_abort,
- clnttcp_geterr,
- clnttcp_freeres,
- clnttcp_destroy,
- clnttcp_control
-};
-
-struct ct_data {
- int ct_sock;
- bool_t ct_closeit;
- struct timeval ct_wait;
- bool_t ct_waitset; /* wait set by clnt_control? */
- struct sockaddr_in ct_addr;
- struct rpc_err ct_error;
- char ct_mcall[MCALL_MSG_SIZE]; /* marshalled callmsg */
- unsigned int ct_mpos; /* pos after marshal */
- XDR ct_xdrs;
-};
-
-/*
- * Create a client handle for a tcp/ip connection.
- * If *sockp<0, *sockp is set to a newly created TCP socket and it is
- * connected to raddr. If *sockp non-negative then
- * raddr is ignored. The rpc/tcp package does buffering
- * similar to stdio, so the client must pick send and receive buffer sizes,];
- * 0 => use the default.
- * If raddr->sin_port is 0, then a binder on the remote machine is
- * consulted for the right port number.
- * NB: *sockp is copied into a private area.
- * NB: It is the clients responsibility to close *sockp.
- * NB: The rpch->cl_auth is set null authentication. Caller may wish to set this
- * something more useful.
- */
-CLIENT *clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
-struct sockaddr_in *raddr;
-unsigned long prog;
-unsigned long vers;
-register int *sockp;
-unsigned int sendsz;
-unsigned int recvsz;
-{
- CLIENT *h;
- register struct ct_data *ct;
- struct timeval now;
- struct rpc_msg call_msg;
-
- h = (CLIENT *) mem_alloc(sizeof(*h));
- if (h == NULL) {
- (void) fprintf(stderr, "clnttcp_create: out of memory\n");
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- goto fooy;
- }
- ct = (struct ct_data *) mem_alloc(sizeof(*ct));
- if (ct == NULL) {
- (void) fprintf(stderr, "clnttcp_create: out of memory\n");
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- goto fooy;
- }
-
- /*
- * If no port number given ask the pmap for one
- */
- if (raddr->sin_port == 0) {
- unsigned short port;
-
- if ((port = pmap_getport(raddr, prog, vers, IPPROTO_TCP)) == 0) {
- mem_free((char*) ct, sizeof(struct ct_data));
-
- mem_free((char*) h, sizeof(CLIENT));
- return ((CLIENT *) NULL);
- }
- raddr->sin_port = htons(port);
- }
-
- /*
- * If no socket given, open one
- */
- if (*sockp < 0) {
- *sockp = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- (void) bindresvport(*sockp, (struct sockaddr_in *) 0);
- if ((*sockp < 0)
- || (connect(*sockp, (struct sockaddr *) raddr,
- sizeof(*raddr)) < 0)) {
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- if (*sockp >= 0)
- (void) close(*sockp);
- goto fooy;
- }
- ct->ct_closeit = TRUE;
- } else {
- ct->ct_closeit = FALSE;
- }
-
- /*
- * Set up private data struct
- */
- ct->ct_sock = *sockp;
- ct->ct_wait.tv_usec = 0;
- ct->ct_waitset = FALSE;
- ct->ct_addr = *raddr;
-
- /*
- * Initialize call message
- */
- (void) gettimeofday(&now, (struct timezone *) 0);
- call_msg.rm_xid = getpid() ^ now.tv_sec ^ now.tv_usec;
- call_msg.rm_direction = CALL;
- call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
- call_msg.rm_call.cb_prog = prog;
- call_msg.rm_call.cb_vers = vers;
-
- /*
- * pre-serialize the staic part of the call msg and stash it away
- */
- xdrmem_create(&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
- XDR_ENCODE);
- if (!xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
- if (ct->ct_closeit) {
- (void) close(*sockp);
- }
- goto fooy;
- }
- ct->ct_mpos = XDR_GETPOS(&(ct->ct_xdrs));
- XDR_DESTROY(&(ct->ct_xdrs));
-
- /*
- * Create a client handle which uses xdrrec for serialization
- * and authnone for authentication.
- */
- xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz,
- (char*) ct, readtcp, writetcp);
- h->cl_ops = &tcp_ops;
- h->cl_private = (char*) ct;
- h->cl_auth = authnone_create();
- return (h);
-
- fooy:
- /*
- * Something goofed, free stuff and barf
- */
- mem_free((char*) ct, sizeof(struct ct_data));
-
- mem_free((char*) h, sizeof(CLIENT));
- return ((CLIENT *) NULL);
-}
-
-static enum clnt_stat
-clnttcp_call(h, proc, xdr_args, args_ptr, xdr_results, results_ptr,
- timeout)
-register CLIENT *h;
-unsigned long proc;
-xdrproc_t xdr_args;
-char* args_ptr;
-xdrproc_t xdr_results;
-char* results_ptr;
-struct timeval timeout;
-{
- register struct ct_data *ct = (struct ct_data *) h->cl_private;
- register XDR *xdrs = &(ct->ct_xdrs);
- struct rpc_msg reply_msg;
- unsigned long x_id;
- uint32_t *msg_x_id = (uint32_t *) (ct->ct_mcall); /* yuk */
- register bool_t shipnow;
- int refreshes = 2;
-
- if (!ct->ct_waitset) {
- ct->ct_wait = timeout;
- }
-
- shipnow =
- (xdr_results == (xdrproc_t) 0 && timeout.tv_sec == 0
- && timeout.tv_usec == 0) ? FALSE : TRUE;
-
- call_again:
- xdrs->x_op = XDR_ENCODE;
- ct->ct_error.re_status = RPC_SUCCESS;
- x_id = ntohl(--(*msg_x_id));
- if ((!XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) ||
- (!XDR_PUTLONG(xdrs, (long *) &proc)) ||
- (!AUTH_MARSHALL(h->cl_auth, xdrs)) ||
- (!(*xdr_args) (xdrs, args_ptr))) {
- if (ct->ct_error.re_status == RPC_SUCCESS)
- ct->ct_error.re_status = RPC_CANTENCODEARGS;
- (void) xdrrec_endofrecord(xdrs, TRUE);
- return (ct->ct_error.re_status);
- }
- if (!xdrrec_endofrecord(xdrs, shipnow))
- return (ct->ct_error.re_status = RPC_CANTSEND);
- if (!shipnow)
- return (RPC_SUCCESS);
- /*
- * Hack to provide rpc-based message passing
- */
- if (timeout.tv_sec == 0 && timeout.tv_usec == 0) {
- return (ct->ct_error.re_status = RPC_TIMEDOUT);
- }
-
-
- /*
- * Keep receiving until we get a valid transaction id
- */
- xdrs->x_op = XDR_DECODE;
- while (TRUE) {
- reply_msg.acpted_rply.ar_verf = _null_auth;
- reply_msg.acpted_rply.ar_results.where = NULL;
- reply_msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
- if (!xdrrec_skiprecord(xdrs))
- return (ct->ct_error.re_status);
- /* now decode and validate the response header */
- if (!xdr_replymsg(xdrs, &reply_msg)) {
- if (ct->ct_error.re_status == RPC_SUCCESS)
- continue;
- return (ct->ct_error.re_status);
- }
- if ((uint32_t)reply_msg.rm_xid == (uint32_t)x_id)
- break;
- }
-
- /*
- * process header
- */
- _seterr_reply(&reply_msg, &(ct->ct_error));
- if (ct->ct_error.re_status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(h->cl_auth, &reply_msg.acpted_rply.ar_verf)) {
- ct->ct_error.re_status = RPC_AUTHERROR;
- ct->ct_error.re_why = AUTH_INVALIDRESP;
- } else if (!(*xdr_results) (xdrs, results_ptr)) {
- if (ct->ct_error.re_status == RPC_SUCCESS)
- ct->ct_error.re_status = RPC_CANTDECODERES;
- }
- /* free verifier ... */
- if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
- xdrs->x_op = XDR_FREE;
- (void) xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf));
- }
- } /* end successful completion */
- else {
- /* maybe our credentials need to be refreshed ... */
- if (refreshes-- && AUTH_REFRESH(h->cl_auth))
- goto call_again;
- } /* end of unsuccessful completion */
- return (ct->ct_error.re_status);
-}
-
-static void clnttcp_geterr(h, errp)
-CLIENT *h;
-struct rpc_err *errp;
-{
- register struct ct_data *ct = (struct ct_data *) h->cl_private;
-
- *errp = ct->ct_error;
-}
-
-static bool_t clnttcp_freeres(cl, xdr_res, res_ptr)
-CLIENT *cl;
-xdrproc_t xdr_res;
-char* res_ptr;
-{
- register struct ct_data *ct = (struct ct_data *) cl->cl_private;
- register XDR *xdrs = &(ct->ct_xdrs);
-
- xdrs->x_op = XDR_FREE;
- return ((*xdr_res) (xdrs, res_ptr));
-}
-
-static void clnttcp_abort()
-{
-}
-
-static bool_t clnttcp_control(cl, request, info)
-CLIENT *cl;
-int request;
-char *info;
-{
- register struct ct_data *ct = (struct ct_data *) cl->cl_private;
-
- switch (request) {
- case CLSET_TIMEOUT:
- ct->ct_wait = *(struct timeval *) info;
- ct->ct_waitset = TRUE;
- break;
- case CLGET_TIMEOUT:
- *(struct timeval *) info = ct->ct_wait;
- break;
- case CLGET_SERVER_ADDR:
- *(struct sockaddr_in *) info = ct->ct_addr;
- break;
- default:
- return (FALSE);
- }
- return (TRUE);
-}
-
-
-static void clnttcp_destroy(h)
-CLIENT *h;
-{
- register struct ct_data *ct = (struct ct_data *) h->cl_private;
-
- if (ct->ct_closeit) {
- (void) close(ct->ct_sock);
- }
- XDR_DESTROY(&(ct->ct_xdrs));
- mem_free((char*) ct, sizeof(struct ct_data));
-
- mem_free((char*) h, sizeof(CLIENT));
-}
-
-/*
- * Interface between xdr serializer and tcp connection.
- * Behaves like the system calls, read & write, but keeps some error state
- * around for the rpc level.
- */
-static int readtcp(ct, buf, len)
-register struct ct_data *ct;
-char* buf;
-register int len;
-{
-#ifdef FD_SETSIZE
- fd_set mask;
- fd_set readfds;
-
- if (len == 0)
- return (0);
- FD_ZERO(&mask);
- FD_SET(ct->ct_sock, &mask);
-#else
- register int mask = 1 << (ct->ct_sock);
- int readfds;
-
- if (len == 0)
- return (0);
-
-#endif /* def FD_SETSIZE */
- while (TRUE) {
- readfds = mask;
- switch (select
- (_rpc_dtablesize(), &readfds, 0, 0,
- &(ct->ct_wait))) {
- case 0:
- ct->ct_error.re_status = RPC_TIMEDOUT;
- return (-1);
-
- case -1:
- if (errno == EINTR)
- continue;
- ct->ct_error.re_status = RPC_CANTRECV;
- ct->ct_error.re_errno = errno;
- return (-1);
- }
- break;
- }
- switch (len = read(ct->ct_sock, buf, len)) {
-
- case 0:
- /* premature eof */
- ct->ct_error.re_errno = ECONNRESET;
- ct->ct_error.re_status = RPC_CANTRECV;
- len = -1; /* it's really an error */
- break;
-
- case -1:
- ct->ct_error.re_errno = errno;
- ct->ct_error.re_status = RPC_CANTRECV;
- break;
- }
- return (len);
-}
-
-static int writetcp(ct, buf, len)
-struct ct_data *ct;
-char* buf;
-int len;
-{
- register int i, cnt;
-
- for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = write(ct->ct_sock, buf, cnt)) == -1) {
- ct->ct_error.re_errno = errno;
- ct->ct_error.re_status = RPC_CANTSEND;
- return (-1);
- }
- }
- return (len);
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/clnt_udp.c b/mdk-stage1/dietlibc/librpc/clnt_udp.c
deleted file mode 100644
index 962718269..000000000
--- a/mdk-stage1/dietlibc/librpc/clnt_udp.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/* @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * clnt_udp.c, Implements a UDP/IP based, client side RPC.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <netdb.h>
-#include <errno.h>
-#include <rpc/pmap_clnt.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-/*
- * UDP bases client side rpc operations
- */
-static enum clnt_stat clntudp_call();
-static void clntudp_abort();
-static void clntudp_geterr();
-static bool_t clntudp_freeres();
-static bool_t clntudp_control();
-static void clntudp_destroy();
-
-static struct clnt_ops udp_ops = {
- clntudp_call,
- clntudp_abort,
- clntudp_geterr,
- clntudp_freeres,
- clntudp_destroy,
- clntudp_control
-};
-
-
-/*
- * Private data kept per client handle
- */
-struct cu_data {
- int cu_sock;
- bool_t cu_closeit;
- struct sockaddr_in cu_raddr;
- int cu_rlen;
- struct timeval cu_wait;
- struct timeval cu_total;
- struct rpc_err cu_error;
- XDR cu_outxdrs;
- unsigned int cu_xdrpos;
- unsigned int cu_sendsz;
- char *cu_outbuf;
- unsigned int cu_recvsz;
- char cu_inbuf[1];
-};
-
-/*
- * Create a UDP based client handle.
- * If *sockp<0, *sockp is set to a newly created UPD socket.
- * If raddr->sin_port is 0 a binder on the remote machine
- * is consulted for the correct port number.
- * NB: It is the clients responsibility to close *sockp.
- * NB: The rpch->cl_auth is initialized to null authentication.
- * Caller may wish to set this something more useful.
- *
- * wait is the amount of time used between retransmitting a call if
- * no response has been heard; retransmition occurs until the actual
- * rpc call times out.
- *
- * sendsz and recvsz are the maximum allowable packet sizes that can be
- * sent and received.
- */
-CLIENT *clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz,
- recvsz)
-struct sockaddr_in *raddr;
-unsigned long program;
-unsigned long version;
-struct timeval wait;
-register int *sockp;
-unsigned int sendsz;
-unsigned int recvsz;
-{
- CLIENT *cl;
- register struct cu_data *cu;
- struct timeval now;
- struct rpc_msg call_msg;
-
- cl = (CLIENT *) mem_alloc(sizeof(CLIENT));
- if (cl == NULL) {
- (void) fprintf(stderr, "clntudp_create: out of memory\n");
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- goto fooy;
- }
- sendsz = ((sendsz + 3) / 4) * 4;
- recvsz = ((recvsz + 3) / 4) * 4;
- cu = (struct cu_data *) mem_alloc(sizeof(*cu) + sendsz + recvsz);
- if (cu == NULL) {
- (void) fprintf(stderr, "clntudp_create: out of memory\n");
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- goto fooy;
- }
- cu->cu_outbuf = &cu->cu_inbuf[recvsz];
-
- (void) gettimeofday(&now, (struct timezone *) 0);
- if (raddr->sin_port == 0) {
- unsigned short port;
-
- if ((port =
- pmap_getport(raddr, program, version, IPPROTO_UDP)) == 0) {
- goto fooy;
- }
- raddr->sin_port = htons(port);
- }
- cl->cl_ops = &udp_ops;
- cl->cl_private = (char*) cu;
- cu->cu_raddr = *raddr;
- cu->cu_rlen = sizeof(cu->cu_raddr);
- cu->cu_wait = wait;
- cu->cu_total.tv_sec = -1;
- cu->cu_total.tv_usec = -1;
- cu->cu_sendsz = sendsz;
- cu->cu_recvsz = recvsz;
- call_msg.rm_xid = getpid() ^ now.tv_sec ^ now.tv_usec;
- call_msg.rm_direction = CALL;
- call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
- call_msg.rm_call.cb_prog = program;
- call_msg.rm_call.cb_vers = version;
- xdrmem_create(&(cu->cu_outxdrs), cu->cu_outbuf, sendsz, XDR_ENCODE);
- if (!xdr_callhdr(&(cu->cu_outxdrs), &call_msg)) {
- goto fooy;
- }
- cu->cu_xdrpos = XDR_GETPOS(&(cu->cu_outxdrs));
- if (*sockp < 0) {
- int dontblock = 1;
-
- *sockp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if (*sockp < 0) {
- rpc_createerr.cf_stat = RPC_SYSTEMERROR;
- rpc_createerr.cf_error.re_errno = errno;
- goto fooy;
- }
- /* attempt to bind to prov port */
- (void) bindresvport(*sockp, (struct sockaddr_in *) 0);
- /* the sockets rpc controls are non-blocking */
- (void) ioctl(*sockp, FIONBIO, (char *) &dontblock);
- cu->cu_closeit = TRUE;
- } else {
- cu->cu_closeit = FALSE;
- }
- cu->cu_sock = *sockp;
- cl->cl_auth = authnone_create();
- return (cl);
- fooy:
- if (cu)
- mem_free((char*) cu, sizeof(*cu) + sendsz + recvsz);
- if (cl)
- mem_free((char*) cl, sizeof(CLIENT));
- return ((CLIENT *) NULL);
-}
-
-CLIENT *clntudp_create(raddr, program, version, wait, sockp)
-struct sockaddr_in *raddr;
-unsigned long program;
-unsigned long version;
-struct timeval wait;
-register int *sockp;
-{
-
- return (clntudp_bufcreate(raddr, program, version, wait, sockp,
- UDPMSGSIZE, UDPMSGSIZE));
-}
-
-static enum clnt_stat
-clntudp_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout)
-register CLIENT *cl; /* client handle */
-unsigned long proc; /* procedure number */
-xdrproc_t xargs; /* xdr routine for args */
-char* argsp; /* pointer to args */
-xdrproc_t xresults; /* xdr routine for results */
-char* resultsp; /* pointer to results */
-struct timeval utimeout; /* seconds to wait before giving up */
-{
- register struct cu_data *cu = (struct cu_data *) cl->cl_private;
- register XDR *xdrs;
- register int outlen;
- register int inlen;
- int fromlen;
-
-#ifdef FD_SETSIZE
- fd_set readfds;
- fd_set mask;
-#else
- int readfds;
- register int mask;
-#endif /* def FD_SETSIZE */
- struct sockaddr_in from;
- struct rpc_msg reply_msg;
- XDR reply_xdrs;
- struct timeval time_waited;
- bool_t ok;
- int nrefreshes = 2; /* number of times to refresh cred */
- struct timeval timeout;
-
- if (cu->cu_total.tv_usec == -1) {
- timeout = utimeout; /* use supplied timeout */
- } else {
- timeout = cu->cu_total; /* use default timeout */
- }
-
- time_waited.tv_sec = 0;
- time_waited.tv_usec = 0;
- call_again:
- xdrs = &(cu->cu_outxdrs);
- xdrs->x_op = XDR_ENCODE;
- XDR_SETPOS(xdrs, cu->cu_xdrpos);
- /*
- * the transaction is the first thing in the out buffer
- */
- (*(uint32_t *) (cu->cu_outbuf))++;
- if ((!XDR_PUTLONG(xdrs, (long *) &proc)) ||
- (!AUTH_MARSHALL(cl->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp)))
- return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
- outlen = (int) XDR_GETPOS(xdrs);
-
- send_again:
- if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0,
- (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen)
- != outlen) {
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTSEND);
- }
-
- /*
- * Hack to provide rpc-based message passing
- */
- if (timeout.tv_sec == 0 && timeout.tv_usec == 0) {
- return (cu->cu_error.re_status = RPC_TIMEDOUT);
- }
- /*
- * sub-optimal code appears here because we have
- * some clock time to spare while the packets are in flight.
- * (We assume that this is actually only executed once.)
- */
- reply_msg.acpted_rply.ar_verf = _null_auth;
- reply_msg.acpted_rply.ar_results.where = resultsp;
- reply_msg.acpted_rply.ar_results.proc = xresults;
-#ifdef FD_SETSIZE
- FD_ZERO(&mask);
- FD_SET(cu->cu_sock, &mask);
-#else
- mask = 1 << cu->cu_sock;
-#endif /* def FD_SETSIZE */
- for (;;) {
- readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, 0, 0, &(cu->cu_wait))) {
-
- case 0:
- time_waited.tv_sec += cu->cu_wait.tv_sec;
- time_waited.tv_usec += cu->cu_wait.tv_usec;
- while (time_waited.tv_usec >= 1000000) {
- time_waited.tv_sec++;
- time_waited.tv_usec -= 1000000;
- }
- if ((time_waited.tv_sec < timeout.tv_sec) ||
- ((time_waited.tv_sec == timeout.tv_sec) &&
- (time_waited.tv_usec < timeout.tv_usec)))
- goto send_again;
- return (cu->cu_error.re_status = RPC_TIMEDOUT);
-
- /*
- * buggy in other cases because time_waited is not being
- * updated.
- */
- case -1:
- if (errno == EINTR)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
- }
- do {
- fromlen = sizeof(struct sockaddr);
-
- inlen = recvfrom(cu->cu_sock, cu->cu_inbuf,
- (int) cu->cu_recvsz, 0,
- (struct sockaddr *) &from, &fromlen);
- } while (inlen < 0 && errno == EINTR);
- if (inlen < 0) {
- if (errno == EWOULDBLOCK)
- continue;
- cu->cu_error.re_errno = errno;
- return (cu->cu_error.re_status = RPC_CANTRECV);
- }
- if (inlen < 4)
- continue;
- /* see if reply transaction id matches sent id */
- if (*((uint32_t *) (cu->cu_inbuf)) != *((uint32_t *) (cu->cu_outbuf)))
- continue;
- /* we now assume we have the proper reply */
- break;
- }
-
- /*
- * now decode and validate the response
- */
- xdrmem_create(&reply_xdrs, cu->cu_inbuf, (unsigned int) inlen, XDR_DECODE);
- ok = xdr_replymsg(&reply_xdrs, &reply_msg);
- /* XDR_DESTROY(&reply_xdrs); save a few cycles on noop destroy */
- if (ok) {
- _seterr_reply(&reply_msg, &(cu->cu_error));
- if (cu->cu_error.re_status == RPC_SUCCESS) {
- if (!AUTH_VALIDATE(cl->cl_auth,
- &reply_msg.acpted_rply.ar_verf)) {
- cu->cu_error.re_status = RPC_AUTHERROR;
- cu->cu_error.re_why = AUTH_INVALIDRESP;
- }
- if (reply_msg.acpted_rply.ar_verf.oa_base != NULL) {
- xdrs->x_op = XDR_FREE;
- (void) xdr_opaque_auth(xdrs,
- &(reply_msg.acpted_rply.ar_verf));
- }
- } /* end successful completion */
- else {
- /* maybe our credentials need to be refreshed ... */
- if (nrefreshes > 0 && AUTH_REFRESH(cl->cl_auth)) {
- nrefreshes--;
- goto call_again;
- }
- } /* end of unsuccessful completion */
- } /* end of valid reply message */
- else {
- cu->cu_error.re_status = RPC_CANTDECODERES;
- }
- return (cu->cu_error.re_status);
-}
-
-static void clntudp_geterr(cl, errp)
-CLIENT *cl;
-struct rpc_err *errp;
-{
- register struct cu_data *cu = (struct cu_data *) cl->cl_private;
-
- *errp = cu->cu_error;
-}
-
-
-static bool_t clntudp_freeres(cl, xdr_res, res_ptr)
-CLIENT *cl;
-xdrproc_t xdr_res;
-char* res_ptr;
-{
- register struct cu_data *cu = (struct cu_data *) cl->cl_private;
- register XDR *xdrs = &(cu->cu_outxdrs);
-
- xdrs->x_op = XDR_FREE;
- return ((*xdr_res) (xdrs, res_ptr));
-}
-
-static void clntudp_abort( /*h */ )
- /*CLIENT *h; */
-{
-}
-
-static bool_t clntudp_control(cl, request, info)
-CLIENT *cl;
-int request;
-char *info;
-{
- register struct cu_data *cu = (struct cu_data *) cl->cl_private;
-
- switch (request) {
- case CLSET_TIMEOUT:
- cu->cu_total = *(struct timeval *) info;
- break;
- case CLGET_TIMEOUT:
- *(struct timeval *) info = cu->cu_total;
- break;
- case CLSET_RETRY_TIMEOUT:
- cu->cu_wait = *(struct timeval *) info;
- break;
- case CLGET_RETRY_TIMEOUT:
- *(struct timeval *) info = cu->cu_wait;
- break;
- case CLGET_SERVER_ADDR:
- *(struct sockaddr_in *) info = cu->cu_raddr;
- break;
- default:
- return (FALSE);
- }
- return (TRUE);
-}
-
-static void clntudp_destroy(cl)
-CLIENT *cl;
-{
- register struct cu_data *cu = (struct cu_data *) cl->cl_private;
-
- if (cu->cu_closeit) {
- (void) close(cu->cu_sock);
- }
- XDR_DESTROY(&(cu->cu_outxdrs));
- mem_free((char*) cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
- mem_free((char*) cl, sizeof(CLIENT));
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/get_myaddress.c b/mdk-stage1/dietlibc/librpc/get_myaddress.c
deleted file mode 100644
index 1ce2c2b32..000000000
--- a/mdk-stage1/dietlibc/librpc/get_myaddress.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* @(#)get_myaddress.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * get_myaddress.c
- *
- * Get client's IP address via ioctl. This avoids using the yellowpages.
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/types.h>
-#include <rpc/pmap_prot.h>
-#include <sys/socket.h>
-#include <stdio.h>
-//#include <net/if.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-
-/* DO use gethostbyname because it's portable */
-#include <unistd.h>
-#include <netdb.h>
-#include <string.h>
-void get_myaddress(struct sockaddr_in* addr)
-{
- char localhost[256 + 1];
- struct hostent *hp;
-
- gethostname(localhost, 256);
- if ((hp = gethostbyname(localhost)) == NULL) {
- perror("get_myaddress: gethostbyname");
- exit(1);
- }
- addr->sin_family = AF_INET;
- memmove((char *) &addr->sin_addr, (char *) hp->h_addr, hp->h_length);
- addr->sin_port = htons(PMAPPORT);
-}
diff --git a/mdk-stage1/dietlibc/librpc/getrpcent.c b/mdk-stage1/dietlibc/librpc/getrpcent.c
deleted file mode 100644
index 71774a2eb..000000000
--- a/mdk-stage1/dietlibc/librpc/getrpcent.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/* @(#)getrpcent.c 2.2 88/07/29 4.0 RPCSRC */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)getrpcent.c 1.9 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * Copyright (c) 1985 by Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <rpc/rpc.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-/*
- * Internet version.
- */
-struct rpcdata {
- FILE *rpcf;
- char *current;
- int currentlen;
- int stayopen;
-#define MAXALIASES 35
- char *rpc_aliases[MAXALIASES];
- struct rpcent rpc;
- char line[BUFSIZ + 1];
- char *domain;
-} *rpcdata;
-
-static struct rpcent *interpret(const char* val, size_t len);
-
-#ifndef __linux__
-static char *index();
-#else
-char *index();
-#endif
-
-static char RPCDB[] = "/etc/rpc";
-
-static struct rpcdata *_rpcdata()
-{
- register struct rpcdata *d = rpcdata;
-
- if (d == 0) {
- d = (struct rpcdata *) calloc(1, sizeof(struct rpcdata));
-
- rpcdata = d;
- }
- return (d);
-}
-
-struct rpcent *getrpcbynumber(number)
-register int number;
-{
- register struct rpcdata *d = _rpcdata();
- register struct rpcent *p;
-
- if (d == 0)
- return (0);
- setrpcent(0);
- while ((p = getrpcent())) {
- if (p->r_number == number)
- break;
- }
- endrpcent();
- return (p);
-}
-
-struct rpcent *
-#ifdef __linux__
-getrpcbyname(const char *name)
-#else
-getrpcbyname(name)
-char *name;
-#endif
-{
- struct rpcent *rpc;
- char **rp;
-
- setrpcent(0);
- while ((rpc = getrpcent())) {
- if (strcmp(rpc->r_name, name) == 0)
- return (rpc);
- for (rp = rpc->r_aliases; *rp != NULL; rp++) {
- if (strcmp(*rp, name) == 0)
- return (rpc);
- }
- }
- endrpcent();
- return (NULL);
-}
-
-#ifdef __linux__
-void
-#endif
-setrpcent(f)
-int f;
-{
- register struct rpcdata *d = _rpcdata();
-
- if (d == 0)
- return;
- if (d->rpcf == NULL)
- d->rpcf = fopen(RPCDB, "r");
- else
- rewind(d->rpcf);
- if (d->current)
- free(d->current);
- d->current = NULL;
- d->stayopen |= f;
-}
-
-#ifdef __linux__
-void
-#endif
-endrpcent()
-{
- register struct rpcdata *d = _rpcdata();
-
- if (d == 0)
- return;
- if (d->current && !d->stayopen) {
- free(d->current);
- d->current = NULL;
- }
- if (d->rpcf && !d->stayopen) {
- fclose(d->rpcf);
- d->rpcf = NULL;
- }
-}
-
-struct rpcent *getrpcent()
-{
- register struct rpcdata *d = _rpcdata();
-
- if (d == 0)
- return (NULL);
- if (d->rpcf == NULL && (d->rpcf = fopen(RPCDB, "r")) == NULL)
- return (NULL);
- if (fgets(d->line, BUFSIZ, d->rpcf) == NULL)
- return (NULL);
- return interpret(d->line, strlen(d->line));
-}
-
-#ifdef __linux__
-static char *firstwhite(s)
-char *s;
-{
- char *s1, *s2;
-
- s1 = index(s, ' ');
- s2 = index(s, '\t');
- if (s1) {
- if (s2)
- return (s1 < s2) ? s1 : s2;
- else
- return s1;
- } else
- return s2;
-}
-#endif
-
-static struct rpcent *interpret(const char* val, size_t len)
-{
- register struct rpcdata *d = _rpcdata();
- char *p;
- register char *cp, **q;
-
- if (d == 0)
- return 0;
- strncpy(d->line, val, (size_t)len);
- p = d->line;
- d->line[len] = '\n';
- if (*p == '#')
- return (getrpcent());
- cp = index(p, '#');
- if (cp == NULL) {
- cp = index(p, '\n');
- if (cp == NULL)
- return (getrpcent());
- }
- *cp = '\0';
-#ifdef __linux__
- if ((cp = firstwhite(p)))
- *cp++ = 0;
- else
- return (getrpcent());
-#else
- cp = index(p, ' ');
- if (cp == NULL) {
- cp = index(p, '\t');
- if (cp == NULL)
- return (getrpcent());
- }
- *cp++ = '\0';
-#endif
- /* THIS STUFF IS INTERNET SPECIFIC */
- d->rpc.r_name = d->line;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- d->rpc.r_number = atoi(cp);
- q = d->rpc.r_aliases = d->rpc_aliases;
-#ifdef __linux__
- if ((cp = firstwhite(cp)))
- *cp++ = '\0';
-#else
- cp = index(p, ' ');
- if (cp != NULL)
- *cp++ = '\0';
- else {
- cp = index(p, '\t');
- if (cp != NULL)
- *cp++ = '\0';
- }
-#endif
- while (cp && *cp) {
- if (*cp == ' ' || *cp == '\t') {
- cp++;
- continue;
- }
- if (q < &(d->rpc_aliases[MAXALIASES - 1]))
- *q++ = cp;
-#ifdef __linux__
- if ((cp = firstwhite(cp)))
- *cp++ = '\0';
-#else
- cp = index(p, ' ');
- if (cp != NULL)
- *cp++ = '\0';
- else {
- cp = index(p, '\t');
- if (cp != NULL)
- *cp++ = '\0';
- }
-#endif
- }
- *q = NULL;
- return (&d->rpc);
-}
diff --git a/mdk-stage1/dietlibc/librpc/getrpcport.c b/mdk-stage1/dietlibc/librpc/getrpcport.c
deleted file mode 100644
index 7b6e50a7d..000000000
--- a/mdk-stage1/dietlibc/librpc/getrpcport.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)getrpcport.c 1.3 87/08/11 SMI";
-#endif
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * Copyright (c) 1985 by Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <string.h>
-#include <rpc/pmap_clnt.h>
-
-extern int getrpcport (const char * host, unsigned long prognum,
- unsigned long versnum, unsigned int proto)
-{
- struct sockaddr_in addr;
- struct hostent *hp;
-
- if ((hp = gethostbyname(host)) == NULL)
- return (0);
- memmove((char *) &addr.sin_addr, hp->h_addr, hp->h_length);
- addr.sin_family = AF_INET;
- addr.sin_port = 0;
- return (pmap_getport(&addr, prognum, versnum, proto));
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_clnt.c b/mdk-stage1/dietlibc/librpc/pmap_clnt.c
deleted file mode 100644
index 9dbf3f624..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_clnt.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/* @(#)pmap_clnt.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)pmap_clnt.c 1.37 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_clnt.c
- * Client interface to pmap rpc service.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
-#include <unistd.h>
-
-static struct timeval timeout = { 5, 0 };
-static struct timeval tottimeout = { 60, 0 };
-
-/*
- * Set a mapping between program,version and port.
- * Calls the pmap service remotely to do the mapping.
- */
-bool_t pmap_set(program, version, protocol, port)
-unsigned long program;
-unsigned long version;
-int protocol;
-unsigned short port;
-{
- struct sockaddr_in myaddress;
- int socket = -1;
- register CLIENT *client;
- struct pmap parms;
- bool_t rslt;
-
- get_myaddress(&myaddress);
- client = clntudp_bufcreate(&myaddress, PMAPPROG, PMAPVERS,
- timeout, &socket, RPCSMALLMSGSIZE,
- RPCSMALLMSGSIZE);
- if (client == (CLIENT *) NULL)
- return (FALSE);
- parms.pm_prog = program;
- parms.pm_vers = version;
- parms.pm_prot = protocol;
- parms.pm_port = port;
- if (CLNT_CALL(client, PMAPPROC_SET, (xdrproc_t)xdr_pmap, (char*)&parms, (xdrproc_t)xdr_bool, (void*)&rslt,
- tottimeout) != RPC_SUCCESS) {
- clnt_perror(client, "Cannot register service");
- return (FALSE);
- }
- CLNT_DESTROY(client);
- (void) close(socket);
- return (rslt);
-}
-
-/*
- * Remove the mapping between program,version and port.
- * Calls the pmap service remotely to do the un-mapping.
- */
-bool_t pmap_unset(program, version)
-unsigned long program;
-unsigned long version;
-{
- struct sockaddr_in myaddress;
- int socket = -1;
- register CLIENT *client;
- struct pmap parms;
- bool_t rslt;
-
- get_myaddress(&myaddress);
- client = clntudp_bufcreate(&myaddress, PMAPPROG, PMAPVERS,
- timeout, &socket, RPCSMALLMSGSIZE,
- RPCSMALLMSGSIZE);
- if (client == (CLIENT *) NULL)
- return (FALSE);
- parms.pm_prog = program;
- parms.pm_vers = version;
- parms.pm_port = parms.pm_prot = 0;
- CLNT_CALL(client, PMAPPROC_UNSET, (xdrproc_t)xdr_pmap, (char*)&parms, (xdrproc_t)xdr_bool, (void*)&rslt,
- tottimeout);
- CLNT_DESTROY(client);
- (void) close(socket);
- return (rslt);
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_getmaps.c b/mdk-stage1/dietlibc/librpc/pmap_getmaps.c
deleted file mode 100644
index de51a733a..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_getmaps.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* @(#)pmap_getmaps.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_getmap.c
- * Client interface to pmap rpc service.
- * contains pmap_getmaps, which is only tcp service involved
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <errno.h>
-#include <netinet/in.h>
-//#include <net/if.h>
-#include <sys/ioctl.h>
-#define NAMELEN 255
-#define MAX_BROADCAST_SIZE 1400
-#include <unistd.h>
-
-/*
- * Get a copy of the current port maps.
- * Calls the pmap service remotely to do get the maps.
- */
-struct pmaplist *pmap_getmaps(address)
-struct sockaddr_in *address;
-{
- struct pmaplist *head = (struct pmaplist *) NULL;
- int socket = -1;
- struct timeval minutetimeout;
- register CLIENT *client;
-
- minutetimeout.tv_sec = 60;
- minutetimeout.tv_usec = 0;
- address->sin_port = htons(PMAPPORT);
- client = clnttcp_create(address, PMAPPROG, PMAPVERS, &socket, 50, 500);
- if (client != (CLIENT *) NULL) {
- if (CLNT_CALL(client, PMAPPROC_DUMP, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_pmaplist,
- (char*)&head, minutetimeout) != RPC_SUCCESS) {
- clnt_perror(client, "pmap_getmaps rpc problem");
- }
- CLNT_DESTROY(client);
- }
- (void) close(socket);
- address->sin_port = 0;
- return (head);
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_getport.c b/mdk-stage1/dietlibc/librpc/pmap_getport.c
deleted file mode 100644
index f26cb7621..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_getport.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* @(#)pmap_getport.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)pmap_getport.c 1.9 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_getport.c
- * Client interface to pmap rpc service.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
-#include <sys/socket.h>
-//#include <net/if.h>
-#include <unistd.h>
-
-static struct timeval timeout = { 5, 0 };
-static struct timeval tottimeout = { 60, 0 };
-
-/*
- * Find the mapped port for program,version.
- * Calls the pmap service remotely to do the lookup.
- * Returns 0 if no map exists.
- */
-unsigned short pmap_getport(address, program, version, protocol)
-struct sockaddr_in *address;
-unsigned long program;
-unsigned long version;
-unsigned int protocol;
-{
- unsigned short port = 0;
- int socket = -1;
- register CLIENT *client;
- struct pmap parms;
-
- address->sin_port = htons((unsigned short)PMAPPORT);
- if (protocol == IPPROTO_TCP)
- client = clnttcp_create(address, PMAPPROG, PMAPVERS, &socket,
- RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
- else
- client = clntudp_bufcreate(address, PMAPPROG, PMAPVERS, timeout,
- &socket, RPCSMALLMSGSIZE,
- RPCSMALLMSGSIZE);
- if (client != (CLIENT *) NULL) {
- parms.pm_prog = program;
- parms.pm_vers = version;
- parms.pm_prot = protocol;
- parms.pm_port = 0; /* not needed or used */
- if (CLNT_CALL(client, PMAPPROC_GETPORT, (xdrproc_t)xdr_pmap, (char*)&parms,
- (xdrproc_t)xdr_u_short, (char*)&port, tottimeout) != RPC_SUCCESS) {
- rpc_createerr.cf_stat = RPC_PMAPFAILURE;
- clnt_geterr(client, &rpc_createerr.cf_error);
- } else if (port == 0) {
- rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED;
- }
- CLNT_DESTROY(client);
- }
- (void) close(socket);
- address->sin_port = 0;
- return (port);
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_prot.c b/mdk-stage1/dietlibc/librpc/pmap_prot.c
deleted file mode 100644
index ec8b5af79..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_prot.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* @(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_prot.c
- * Protocol for the local binder service, or pmap.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/pmap_prot.h>
-
-
-bool_t xdr_pmap(xdrs, regs)
-XDR *xdrs;
-struct pmap *regs;
-{
-
- if (xdr_u_long(xdrs, &regs->pm_prog) &&
- xdr_u_long(xdrs, &regs->pm_vers) &&
- xdr_u_long(xdrs, &regs->pm_prot))
- return (xdr_u_long(xdrs, &regs->pm_port));
- return (FALSE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_prot2.c b/mdk-stage1/dietlibc/librpc/pmap_prot2.c
deleted file mode 100644
index cd2deb036..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_prot2.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* @(#)pmap_prot2.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)pmap_prot2.c 1.3 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_prot2.c
- * Protocol for the local binder service, or pmap.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <rpc/pmap_prot.h>
-
-
-/*
- * What is going on with linked lists? (!)
- * First recall the link list declaration from pmap_prot.h:
- *
- * struct pmaplist {
- * struct pmap pml_map;
- * struct pmaplist *pml_map;
- * };
- *
- * Compare that declaration with a corresponding xdr declaration that
- * is (a) pointer-less, and (b) recursive:
- *
- * typedef union switch (bool_t) {
- *
- * case TRUE: struct {
- * struct pmap;
- * pmaplist_t foo;
- * };
- *
- * case FALSE: struct {};
- * } pmaplist_t;
- *
- * Notice that the xdr declaration has no nxt pointer while
- * the C declaration has no bool_t variable. The bool_t can be
- * interpreted as ``more data follows me''; if FALSE then nothing
- * follows this bool_t; if TRUE then the bool_t is followed by
- * an actual struct pmap, and then (recursively) by the
- * xdr union, pamplist_t.
- *
- * This could be implemented via the xdr_union primitive, though this
- * would cause a one recursive call per element in the list. Rather than do
- * that we can ``unwind'' the recursion
- * into a while loop and do the union arms in-place.
- *
- * The head of the list is what the C programmer wishes to past around
- * the net, yet is the data that the pointer points to which is interesting;
- * this sounds like a job for xdr_reference!
- */
-bool_t xdr_pmaplist(XDR* xdrs, struct pmaplist** rp)
-{
- /*
- * more_elements is pre-computed in case the direction is
- * XDR_ENCODE or XDR_FREE. more_elements is overwritten by
- * xdr_bool when the direction is XDR_DECODE.
- */
- bool_t more_elements;
- register int freeing = (xdrs->x_op == XDR_FREE);
- register struct pmaplist **next=0;
-
- while (TRUE) {
- more_elements = (bool_t) (*rp != NULL);
- if (!xdr_bool(xdrs, &more_elements))
- return (FALSE);
- if (!more_elements)
- return (TRUE); /* we are done */
- /*
- * the unfortunate side effect of non-recursion is that in
- * the case of freeing we must remember the next object
- * before we free the current object ...
- */
- if (freeing)
- next = &((*rp)->pml_next);
- if (!xdr_reference(xdrs, (char* *) rp,
- (unsigned int) sizeof(struct pmaplist), (xdrproc_t)xdr_pmap))
- return (FALSE);
-
- rp = (freeing) ? next : &((*rp)->pml_next);
- }
-}
diff --git a/mdk-stage1/dietlibc/librpc/pmap_rmt.c b/mdk-stage1/dietlibc/librpc/pmap_rmt.c
deleted file mode 100644
index 390bd736e..000000000
--- a/mdk-stage1/dietlibc/librpc/pmap_rmt.c
+++ /dev/null
@@ -1,402 +0,0 @@
-/* @(#)pmap_rmt.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * pmap_rmt.c
- * Client interface to pmap rpc service.
- * remote call and broadcast service
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-#include <rpc/pmap_prot.h>
-#include <rpc/pmap_clnt.h>
-#include <rpc/pmap_rmt.h>
-#include <sys/socket.h>
-#include <stdio.h>
-#include <errno.h>
-//#include <net/if.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#define MAX_BROADCAST_SIZE 1400
-#include <unistd.h>
-#include <string.h>
-#include "dietfeatures.h"
-
-static struct timeval timeout = { 3, 0 };
-
-
-/*
- * pmapper remote-call-service interface.
- * This routine is used to call the pmapper remote call service
- * which will look up a service program in the port maps, and then
- * remotely call that routine with the given parameters. This allows
- * programs to do a lookup and call in one step.
-*/
-enum clnt_stat pmap_rmtcall (struct sockaddr_in *addr,
- const unsigned long prog,
- const unsigned long vers,
- const unsigned long proc,
- xdrproc_t xdrargs,
- char* argsp, xdrproc_t xdrres,
- char* resp, struct timeval tout,
- unsigned long *port_ptr) {
- int socket = -1;
- register CLIENT *client;
- struct rmtcallargs a;
- struct rmtcallres r;
- enum clnt_stat stat;
-
- addr->sin_port = htons((short)PMAPPORT);
- client = clntudp_create(addr, PMAPPROG, PMAPVERS, timeout, &socket);
- if (client != (CLIENT *) NULL) {
- a.prog = prog;
- a.vers = vers;
- a.proc = proc;
- a.args_ptr = argsp;
- a.xdr_args = xdrargs;
- r.port_ptr = port_ptr;
- r.results_ptr = resp;
- r.xdr_results = xdrres;
- stat = CLNT_CALL(client, PMAPPROC_CALLIT, (xdrproc_t)xdr_rmtcall_args, (char*)&a,
- (xdrproc_t)xdr_rmtcallres, (char*)&r, tout);
- CLNT_DESTROY(client);
- } else {
- stat = RPC_FAILED;
- }
- (void) close(socket);
- addr->sin_port = 0;
- return (stat);
-}
-
-
-/*
- * XDR remote call arguments
- * written for XDR_ENCODE direction only
- */
-bool_t xdr_rmtcall_args(XDR* xdrs, struct rmtcallargs* cap)
-{
- unsigned int lenposition, argposition, position;
-
- if (xdr_u_long(xdrs, &(cap->prog)) &&
- xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {
- lenposition = XDR_GETPOS(xdrs);
- if (!xdr_u_long(xdrs, &(cap->arglen)))
- return (FALSE);
- argposition = XDR_GETPOS(xdrs);
- if (!(*(cap->xdr_args)) (xdrs, cap->args_ptr))
- return (FALSE);
- position = XDR_GETPOS(xdrs);
- cap->arglen = (unsigned long) position - (unsigned long) argposition;
- XDR_SETPOS(xdrs, lenposition);
- if (!xdr_u_long(xdrs, &(cap->arglen)))
- return (FALSE);
- XDR_SETPOS(xdrs, position);
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * XDR remote call results
- * written for XDR_DECODE direction only
- */
-bool_t xdr_rmtcallres(XDR* xdrs, struct rmtcallres* crp)
-{
- char* port_ptr;
-
- port_ptr = (char*) crp->port_ptr;
- if (xdr_reference(xdrs, &port_ptr, sizeof(unsigned long),
- (xdrproc_t)xdr_u_long) && xdr_u_long(xdrs, &crp->resultslen)) {
- crp->port_ptr = (unsigned long *) port_ptr;
- return ((*(crp->xdr_results)) (xdrs, crp->results_ptr));
- }
- return (FALSE);
-}
-
-
-/*
- * The following is kludged-up support for simple rpc broadcasts.
- * Someday a large, complicated system will replace these trivial
- * routines which only support udp/ip .
- */
-
-static int getbroadcastnets(addrs, sock, buf)
-struct in_addr *addrs;
-int sock; /* any valid socket will do */
-char *buf; /* why allocxate more when we can use existing... */
-{
-#ifdef __linux__
- struct sockaddr_in addr;
-
- get_myaddress(&addr);
-#if 1
- printf("%s(%d): no inet_makeaddr()\n", __FILE__, __LINE__);
-#else
- addrs[0] = inet_makeaddr(inet_netof(addr.sin_addr), INADDR_ANY);
-#endif
- return 1;
-#else
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- struct sockaddr_in *sin;
- int n, i;
-
- ifc.ifc_len = UDPMSGSIZE;
- ifc.ifc_buf = buf;
- if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) < 0) {
- perror("broadcast: ioctl (get interface configuration)");
- return (0);
- }
- ifr = ifc.ifc_req;
- for (i = 0, n = ifc.ifc_len / sizeof(struct ifreq); n > 0; n--, ifr++) {
- ifreq = *ifr;
- if (ioctl(sock, SIOCGIFFLAGS, (char *) &ifreq) < 0) {
- perror("broadcast: ioctl (get interface flags)");
- continue;
- }
- if ((ifreq.ifr_flags & IFF_BROADCAST) &&
- (ifreq.ifr_flags & IFF_UP) &&
- ifr->ifr_addr.sa_family == AF_INET) {
- sin = (struct sockaddr_in *) &ifr->ifr_addr;
-#ifdef SIOCGIFBRDADDR /* 4.3BSD */
- if (ioctl(sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0) {
-#if 1
- printf("%s(%d): no inet_makeaddr()\n", __FILE__, __LINE__);
-#else
- addrs[i++] = inet_makeaddr(inet_netof
- (sin->sin_addr.s_addr),
- INADDR_ANY);
-#endif
- } else {
- addrs[i++] = ((struct sockaddr_in *)
- &ifreq.ifr_addr)->sin_addr;
- }
-#else /* 4.2 BSD */
-#if 1
- printf("%s(%d): no inet_makeaddr()\n", __FILE__, __LINE__);
-#else
- addrs[i++] = inet_makeaddr(inet_netof
- (sin->sin_addr.s_addr), INADDR_ANY);
-#endif
-#endif
- }
- }
- return (i);
-#endif
-}
-
-enum clnt_stat
-clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp,
- eachresult)
-unsigned long prog; /* program number */
-unsigned long vers; /* version number */
-unsigned long proc; /* procedure number */
-xdrproc_t xargs; /* xdr routine for args */
-char* argsp; /* pointer to args */
-xdrproc_t xresults; /* xdr routine for results */
-char* resultsp; /* pointer to results */
-resultproc_t eachresult; /* call with each result obtained */
-{
- enum clnt_stat stat;
- AUTH *unix_auth = authunix_create_default();
- XDR xdr_stream;
- register XDR *xdrs = &xdr_stream;
- int outlen, inlen, fromlen, nets;
- register int sock;
- int on = 1;
-
-#ifdef FD_SETSIZE
- fd_set mask;
- fd_set readfds;
-#else
- int readfds;
- register int mask;
-#endif /* def FD_SETSIZE */
- register int i;
- bool_t done = FALSE;
- register unsigned long xid;
- unsigned long port;
- struct in_addr addrs[20];
- struct sockaddr_in baddr, raddr; /* broadcast and response addresses */
- struct rmtcallargs a;
- struct rmtcallres r;
- struct rpc_msg msg;
- struct timeval t;
- char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE];
-
- /*
- * initialization: create a socket, a broadcast address, and
- * preserialize the arguments into a send buffer.
- */
- if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("Cannot create socket for broadcast rpc");
- stat = RPC_CANTSEND;
- goto done_broad;
- }
-#ifdef SO_BROADCAST
- if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)) < 0) {
- perror("Cannot set socket option SO_BROADCAST");
- stat = RPC_CANTSEND;
- goto done_broad;
- }
-#endif /* def SO_BROADCAST */
-#ifdef FD_SETSIZE
- FD_ZERO(&mask);
- FD_SET(sock, &mask);
-#else
- mask = (1 << sock);
-#endif /* def FD_SETSIZE */
- nets = getbroadcastnets(addrs, sock, inbuf);
- memset((char*)&baddr,0,sizeof(baddr));
- baddr.sin_family = AF_INET;
- baddr.sin_port = htons((short)PMAPPORT);
- baddr.sin_addr.s_addr = htonl(INADDR_ANY);
-/* baddr.sin_addr.S_un.S_addr = htonl(INADDR_ANY); */
- (void) gettimeofday(&t, (struct timezone *) 0);
- msg.rm_xid = xid = getpid() ^ t.tv_sec ^ t.tv_usec;
- t.tv_usec = 0;
- msg.rm_direction = CALL;
- msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
- msg.rm_call.cb_prog = PMAPPROG;
- msg.rm_call.cb_vers = PMAPVERS;
- msg.rm_call.cb_proc = PMAPPROC_CALLIT;
- msg.rm_call.cb_cred = unix_auth->ah_cred;
- msg.rm_call.cb_verf = unix_auth->ah_verf;
- a.prog = prog;
- a.vers = vers;
- a.proc = proc;
- a.xdr_args = xargs;
- a.args_ptr = argsp;
- r.port_ptr = &port;
- r.xdr_results = xresults;
- r.results_ptr = resultsp;
- xdrmem_create(xdrs, outbuf, MAX_BROADCAST_SIZE, XDR_ENCODE);
- if ((!xdr_callmsg(xdrs, &msg)) || (!xdr_rmtcall_args(xdrs, &a))) {
- stat = RPC_CANTENCODEARGS;
- goto done_broad;
- }
- outlen = (int) xdr_getpos(xdrs);
- xdr_destroy(xdrs);
- /*
- * Basic loop: broadcast a packet and wait a while for response(s).
- * The response timeout grows larger per iteration.
- */
- for (t.tv_sec = 4; t.tv_sec <= 14; t.tv_sec += 2) {
- for (i = 0; i < nets; i++) {
- baddr.sin_addr = addrs[i];
- if (sendto(sock, outbuf, (size_t)outlen, 0,
- (struct sockaddr *) &baddr,
- sizeof(struct sockaddr)) != outlen) {
- perror("Cannot send broadcast packet");
- stat = RPC_CANTSEND;
- goto done_broad;
- }
- }
- if (eachresult == NULL) {
- stat = RPC_SUCCESS;
- goto done_broad;
- }
- recv_again:
- msg.acpted_rply.ar_verf = _null_auth;
- msg.acpted_rply.ar_results.where = (char*) & r;
- msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_rmtcallres;
- readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, 0, 0, &t)) {
-
- case 0: /* timed out */
- stat = RPC_TIMEDOUT;
- continue;
-
- case -1: /* some kind of error */
- if (errno == EINTR)
- goto recv_again;
- perror("Broadcast select problem");
- stat = RPC_CANTRECV;
- goto done_broad;
-
- } /* end of select results switch */
- try_again:
- fromlen = sizeof(struct sockaddr);
-
- inlen = recvfrom(sock, inbuf, UDPMSGSIZE, 0,
- (struct sockaddr *) &raddr, &fromlen);
- if (inlen < 0) {
- if (errno == EINTR)
- goto try_again;
- perror("Cannot receive reply to broadcast");
- stat = RPC_CANTRECV;
- goto done_broad;
- }
- if ((size_t)inlen < sizeof(unsigned long))
- goto recv_again;
- /*
- * see if reply transaction id matches sent id.
- * If so, decode the results.
- */
- xdrmem_create(xdrs, inbuf, (unsigned int) inlen, XDR_DECODE);
- if (xdr_replymsg(xdrs, &msg)) {
- if ((msg.rm_xid == xid) &&
- (msg.rm_reply.rp_stat == MSG_ACCEPTED) &&
- (msg.acpted_rply.ar_stat == SUCCESS)) {
- raddr.sin_port = htons((unsigned short) port);
- done = (*eachresult) (resultsp, &raddr);
- }
- /* otherwise, we just ignore the errors ... */
- } else {
-#ifdef notdef
- /* some kind of deserialization problem ... */
- if (msg.rm_xid == xid)
- fprintf(stderr, "Broadcast deserialization problem");
- /* otherwise, just random garbage */
-#endif
- }
- xdrs->x_op = XDR_FREE;
- msg.acpted_rply.ar_results.proc = (xdrproc_t)xdr_void;
- (void) xdr_replymsg(xdrs, &msg);
- (void) (*xresults) (xdrs, resultsp);
- xdr_destroy(xdrs);
- if (done) {
- stat = RPC_SUCCESS;
- goto done_broad;
- } else {
- goto recv_again;
- }
- }
- done_broad:
- (void) close(sock);
- AUTH_DESTROY(unix_auth);
- return (stat);
-}
diff --git a/mdk-stage1/dietlibc/librpc/rpc_callmsg.c b/mdk-stage1/dietlibc/librpc/rpc_callmsg.c
deleted file mode 100644
index a3514f41c..000000000
--- a/mdk-stage1/dietlibc/librpc/rpc_callmsg.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* @(#)rpc_callmsg.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)rpc_callmsg.c 1.4 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * rpc_callmsg.c
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- */
-
-#include <sys/param.h>
-
-#include <rpc/rpc.h>
-#include <string.h>
-
-/*
- * XDR a call message
- */
-bool_t xdr_callmsg(xdrs, cmsg)
-register XDR *xdrs;
-register struct rpc_msg *cmsg;
-{
- register int32_t *buf;
- register struct opaque_auth *oa;
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (cmsg->rm_call.cb_cred.oa_length > MAX_AUTH_BYTES) {
- return (FALSE);
- }
- if (cmsg->rm_call.cb_verf.oa_length > MAX_AUTH_BYTES) {
- return (FALSE);
- }
- buf = XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT
- + RNDUP(cmsg->rm_call.cb_cred.oa_length)
- + 2 * BYTES_PER_XDR_UNIT
- + RNDUP(cmsg->rm_call.cb_verf.oa_length));
- if (buf != NULL) {
- IXDR_PUT_LONG(buf, cmsg->rm_xid);
- IXDR_PUT_ENUM(buf, cmsg->rm_direction);
- if (cmsg->rm_direction != CALL) {
- return (FALSE);
- }
- IXDR_PUT_LONG(buf, cmsg->rm_call.cb_rpcvers);
- if (cmsg->rm_call.cb_rpcvers != RPC_MSG_VERSION) {
- return (FALSE);
- }
- IXDR_PUT_LONG(buf, cmsg->rm_call.cb_prog);
- IXDR_PUT_LONG(buf, cmsg->rm_call.cb_vers);
- IXDR_PUT_LONG(buf, cmsg->rm_call.cb_proc);
- oa = &cmsg->rm_call.cb_cred;
- IXDR_PUT_ENUM(buf, oa->oa_flavor);
- IXDR_PUT_LONG(buf, oa->oa_length);
- if (oa->oa_length) {
- memmove((char*) buf, oa->oa_base, oa->oa_length);
- buf += RNDUP(oa->oa_length) / sizeof(long);
- }
- oa = &cmsg->rm_call.cb_verf;
- IXDR_PUT_ENUM(buf, oa->oa_flavor);
- IXDR_PUT_LONG(buf, oa->oa_length);
- if (oa->oa_length) {
- memmove((char*) buf, oa->oa_base, oa->oa_length);
- /* no real need....
- buf += RNDUP(oa->oa_length) / sizeof (long);
- */
- }
- return (TRUE);
- }
- }
- if (xdrs->x_op == XDR_DECODE) {
- buf = XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT);
- if (buf != NULL) {
- cmsg->rm_xid = IXDR_GET_LONG(buf);
- cmsg->rm_direction = IXDR_GET_ENUM(buf, enum msg_type);
-
- if (cmsg->rm_direction != CALL) {
- return (FALSE);
- }
- cmsg->rm_call.cb_rpcvers = IXDR_GET_LONG(buf);
- if (cmsg->rm_call.cb_rpcvers != RPC_MSG_VERSION) {
- return (FALSE);
- }
- cmsg->rm_call.cb_prog = IXDR_GET_LONG(buf);
- cmsg->rm_call.cb_vers = IXDR_GET_LONG(buf);
- cmsg->rm_call.cb_proc = IXDR_GET_LONG(buf);
- oa = &cmsg->rm_call.cb_cred;
- oa->oa_flavor = IXDR_GET_ENUM(buf, enum_t);
- oa->oa_length = IXDR_GET_LONG(buf);
- if (oa->oa_length) {
- if (oa->oa_length > MAX_AUTH_BYTES) {
- return (FALSE);
- }
- if (oa->oa_base == NULL) {
- oa->oa_base = (char*)
- mem_alloc(oa->oa_length);
- }
- buf = XDR_INLINE(xdrs, RNDUP(oa->oa_length));
- if (buf == NULL) {
- if (xdr_opaque(xdrs, oa->oa_base,
- oa->oa_length) == FALSE) {
- return (FALSE);
- }
- } else {
- memmove(oa->oa_base, (char*) buf, oa->oa_length);
- /* no real need....
- buf += RNDUP(oa->oa_length) /
- sizeof (long);
- */
- }
- }
- oa = &cmsg->rm_call.cb_verf;
- buf = XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
- if (buf == NULL) {
- if (xdr_enum(xdrs, &oa->oa_flavor) == FALSE ||
- xdr_u_int(xdrs, &oa->oa_length) == FALSE) {
- return (FALSE);
- }
- } else {
- oa->oa_flavor = IXDR_GET_ENUM(buf, enum_t);
- oa->oa_length = IXDR_GET_LONG(buf);
- }
- if (oa->oa_length) {
- if (oa->oa_length > MAX_AUTH_BYTES) {
- return (FALSE);
- }
- if (oa->oa_base == NULL) {
- oa->oa_base = (char*)
- mem_alloc(oa->oa_length);
- }
- buf = XDR_INLINE(xdrs, RNDUP(oa->oa_length));
- if (buf == NULL) {
- if (xdr_opaque(xdrs, oa->oa_base,
- oa->oa_length) == FALSE) {
- return (FALSE);
- }
- } else {
- memmove(oa->oa_base, (char*) buf, oa->oa_length);
- /* no real need...
- buf += RNDUP(oa->oa_length) /
- sizeof (long);
- */
- }
- }
- return (TRUE);
- }
- }
- if (xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
- xdr_enum(xdrs, (enum_t *) & (cmsg->rm_direction)) &&
- (cmsg->rm_direction == CALL) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
- (cmsg->rm_call.cb_rpcvers == RPC_MSG_VERSION) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_proc)) &&
- xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)))
- return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf)));
- return (FALSE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/rpc_commondata.c b/mdk-stage1/dietlibc/librpc/rpc_commondata.c
deleted file mode 100644
index 39648d284..000000000
--- a/mdk-stage1/dietlibc/librpc/rpc_commondata.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* @(#)rpc_commondata.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#include <rpc/rpc.h>
-/*
- * This file should only contain common data (global data) that is exported
- * by public interfaces
- */
-struct opaque_auth _null_auth;
-
-#ifdef FD_SETSIZE
-fd_set svc_fdset;
-#else
-int svc_fds;
-#endif /* def FD_SETSIZE */
-struct rpc_createerr rpc_createerr;
diff --git a/mdk-stage1/dietlibc/librpc/rpc_dtablesize.c b/mdk-stage1/dietlibc/librpc/rpc_dtablesize.c
deleted file mode 100644
index b08ebaccd..000000000
--- a/mdk-stage1/dietlibc/librpc/rpc_dtablesize.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* @(#)rpc_dtablesize.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)rpc_dtablesize.c 1.2 87/08/11 Copyr 1987 Sun Micro";
-#endif
-
-#include <unistd.h>
-
-/*
- * Cache the result of getdtablesize(), so we don't have to do an
- * expensive system call every time.
- */
-int _rpc_dtablesize()
-{
- static int size;
-
- if (size == 0) {
- size = getdtablesize();
- }
- return (size);
-}
diff --git a/mdk-stage1/dietlibc/librpc/rpc_prot.c b/mdk-stage1/dietlibc/librpc/rpc_prot.c
deleted file mode 100644
index d5ca5ab77..000000000
--- a/mdk-stage1/dietlibc/librpc/rpc_prot.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/* @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * rpc_prot.c
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * This set of routines implements the rpc message definition,
- * its serializer and some common rpc utility routines.
- * The routines are meant for various implementations of rpc -
- * they are NOT for the rpc client or rpc service implementations!
- * Because authentication stuff is easy and is part of rpc, the opaque
- * routines are also in this program.
- */
-
-#include <sys/param.h>
-
-#include <rpc/rpc.h>
-
-/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
-
-struct opaque_auth _null_auth;
-
-/*
- * XDR an opaque authentication struct
- * (see auth.h)
- */
-bool_t xdr_opaque_auth(xdrs, ap)
-register XDR *xdrs;
-register struct opaque_auth *ap;
-{
-
- if (xdr_enum(xdrs, &(ap->oa_flavor)))
- return (xdr_bytes(xdrs, &ap->oa_base,
- &ap->oa_length, MAX_AUTH_BYTES));
- return (FALSE);
-}
-
-/*
- * XDR a DES block
- */
-bool_t xdr_des_block(xdrs, blkp)
-register XDR *xdrs;
-register des_block *blkp;
-{
- return (xdr_opaque(xdrs, (char*) blkp, sizeof(des_block)));
-}
-
-/* * * * * * * * * * * * * * XDR RPC MESSAGE * * * * * * * * * * * * * * * */
-
-/*
- * XDR the MSG_ACCEPTED part of a reply message union
- */
-bool_t xdr_accepted_reply(xdrs, ar)
-register XDR *xdrs;
-register struct accepted_reply *ar;
-{
-
- /* personalized union, rather than calling xdr_union */
- if (!xdr_opaque_auth(xdrs, &(ar->ar_verf)))
- return (FALSE);
- if (!xdr_enum(xdrs, (enum_t *) & (ar->ar_stat)))
- return (FALSE);
- switch (ar->ar_stat) {
-
- case SUCCESS:
- return ((*(ar->ar_results.proc)) (xdrs, ar->ar_results.where));
-
- case PROG_MISMATCH:
- if (!xdr_u_long(xdrs, &(ar->ar_vers.low)))
- return (FALSE);
- return (xdr_u_long(xdrs, &(ar->ar_vers.high)));
- }
- return (TRUE); /* TRUE => open ended set of problems */
-}
-
-/*
- * XDR the MSG_DENIED part of a reply message union
- */
-bool_t xdr_rejected_reply(xdrs, rr)
-register XDR *xdrs;
-register struct rejected_reply *rr;
-{
-
- /* personalized union, rather than calling xdr_union */
- if (!xdr_enum(xdrs, (enum_t *) & (rr->rj_stat)))
- return (FALSE);
- switch (rr->rj_stat) {
-
- case RPC_MISMATCH:
- if (!xdr_u_long(xdrs, &(rr->rj_vers.low)))
- return (FALSE);
- return (xdr_u_long(xdrs, &(rr->rj_vers.high)));
-
- case AUTH_ERROR:
- return (xdr_enum(xdrs, (enum_t *) & (rr->rj_why)));
- }
- return (FALSE);
-}
-
-static struct xdr_discrim reply_dscrm[3] = {
- {(int) MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply},
- {(int) MSG_DENIED, (xdrproc_t)xdr_rejected_reply},
- {__dontcare__, NULL_xdrproc_t}
-};
-
-/*
- * XDR a reply message
- */
-bool_t xdr_replymsg(xdrs, rmsg)
-register XDR *xdrs;
-register struct rpc_msg *rmsg;
-{
- if (xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
- xdr_enum(xdrs, (enum_t *) & (rmsg->rm_direction)) &&
- (rmsg->rm_direction == REPLY))
- return (xdr_union(xdrs, (enum_t *) & (rmsg->rm_reply.rp_stat),
- (char*) & (rmsg->rm_reply.ru), reply_dscrm,
- NULL_xdrproc_t));
- return (FALSE);
-}
-
-
-/*
- * Serializes the "static part" of a call message header.
- * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
- * The rm_xid is not really static, but the user can easily munge on the fly.
- */
-bool_t xdr_callhdr(xdrs, cmsg)
-register XDR *xdrs;
-register struct rpc_msg *cmsg;
-{
-
- cmsg->rm_direction = CALL;
- cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
- if (
- (xdrs->x_op == XDR_ENCODE) &&
- xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
- xdr_enum(xdrs, (enum_t *) & (cmsg->rm_direction)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
- xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)))
- return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)));
- return (FALSE);
-}
-
-/* ************************** Client utility routine ************* */
-
-static void accepted(acpt_stat, error)
-register enum accept_stat acpt_stat;
-register struct rpc_err *error;
-{
-
- switch (acpt_stat) {
-
- case PROG_UNAVAIL:
- error->re_status = RPC_PROGUNAVAIL;
- return;
-
- case PROG_MISMATCH:
- error->re_status = RPC_PROGVERSMISMATCH;
- return;
-
- case PROC_UNAVAIL:
- error->re_status = RPC_PROCUNAVAIL;
- return;
-
- case GARBAGE_ARGS:
- error->re_status = RPC_CANTDECODEARGS;
- return;
-
- case SYSTEM_ERR:
- error->re_status = RPC_SYSTEMERROR;
- return;
-
- case SUCCESS:
- error->re_status = RPC_SUCCESS;
- return;
- }
- /* something's wrong, but we don't know what ... */
- error->re_status = RPC_FAILED;
- error->re_lb.s1 = (long) MSG_ACCEPTED;
- error->re_lb.s2 = (long) acpt_stat;
-}
-
-static void rejected(rjct_stat, error)
-register enum reject_stat rjct_stat;
-register struct rpc_err *error;
-{
-
- switch (rjct_stat) {
-
- case RPC_VERSMISMATCH:
- error->re_status = RPC_VERSMISMATCH;
- return;
-
- case AUTH_ERROR:
- error->re_status = RPC_AUTHERROR;
- return;
- }
- /* something's wrong, but we don't know what ... */
- error->re_status = RPC_FAILED;
- error->re_lb.s1 = (long) MSG_DENIED;
- error->re_lb.s2 = (long) rjct_stat;
-}
-
-/*
- * given a reply message, fills in the error
- */
-void _seterr_reply(msg, error)
-register struct rpc_msg *msg;
-register struct rpc_err *error;
-{
-
- /* optimized for normal, SUCCESSful case */
- switch (msg->rm_reply.rp_stat) {
-
- case MSG_ACCEPTED:
- if (msg->acpted_rply.ar_stat == SUCCESS) {
- error->re_status = RPC_SUCCESS;
- return;
- };
- accepted(msg->acpted_rply.ar_stat, error);
- break;
-
- case MSG_DENIED:
- rejected(msg->rjcted_rply.rj_stat, error);
- break;
-
- default:
- error->re_status = RPC_FAILED;
- error->re_lb.s1 = (long) (msg->rm_reply.rp_stat);
- break;
- }
- switch (error->re_status) {
-
- case RPC_VERSMISMATCH:
- error->re_vers.low = msg->rjcted_rply.rj_vers.low;
- error->re_vers.high = msg->rjcted_rply.rj_vers.high;
- break;
-
- case RPC_AUTHERROR:
- error->re_why = msg->rjcted_rply.rj_why;
- break;
-
- case RPC_PROGVERSMISMATCH:
- error->re_vers.low = msg->acpted_rply.ar_vers.low;
- error->re_vers.high = msg->acpted_rply.ar_vers.high;
- break;
- }
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc.c b/mdk-stage1/dietlibc/librpc/svc.c
deleted file mode 100644
index b430deb4a..000000000
--- a/mdk-stage1/dietlibc/librpc/svc.c
+++ /dev/null
@@ -1,478 +0,0 @@
-/* @(#)svc.c 2.4 88/08/11 4.0 RPCSRC; from 1.44 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc.c, Server-side remote procedure call interface.
- *
- * There are two sets of procedures here. The xprt routines are
- * for handling transport handles. The svc routines handle the
- * list of service routines.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <errno.h>
-#include <rpc/rpc.h>
-#include <rpc/pmap_clnt.h>
-#include <string.h>
-#ifdef __linux__
-#include <sys/types.h>
-#endif
-
-#ifdef FD_SETSIZE
-static SVCXPRT **xports;
-#else
-#define NOFILE 32
-
-static SVCXPRT *xports[NOFILE];
-#endif /* def FD_SETSIZE */
-
-#define NULL_SVC ((struct svc_callout *)0)
-#define RQCRED_SIZE 400 /* this size is excessive */
-
-/*
- * The services list
- * Each entry represents a set of procedures (an rpc program).
- * The dispatch routine takes request structs and runs the
- * apropriate procedure.
- */
-static struct svc_callout {
- struct svc_callout *sc_next;
- unsigned long sc_prog;
- unsigned long sc_vers;
- void (*sc_dispatch) ();
-} *svc_head;
-
-static struct svc_callout *svc_find();
-
-/* *************** SVCXPRT related stuff **************** */
-
-/*
- * Activate a transport handle.
- */
-void xprt_register(xprt)
-SVCXPRT *xprt;
-{
- register int sock = xprt->xp_sock;
-
-#ifdef FD_SETSIZE
- if (xports == NULL) {
- xports = (SVCXPRT **)
- mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *));
- }
- if (sock < _rpc_dtablesize()) {
- xports[sock] = xprt;
- FD_SET(sock, &svc_fdset);
- }
-#else
- if (sock < NOFILE) {
- xports[sock] = xprt;
- svc_fds |= (1 << sock);
- }
-#endif /* def FD_SETSIZE */
-
-}
-
-/*
- * De-activate a transport handle.
- */
-void xprt_unregister(xprt)
-SVCXPRT *xprt;
-{
- register int sock = xprt->xp_sock;
-
-#ifdef FD_SETSIZE
- if ((sock < _rpc_dtablesize()) && (xports[sock] == xprt)) {
- xports[sock] = (SVCXPRT *) 0;
- FD_CLR(sock, &svc_fdset);
- }
-#else
- if ((sock < NOFILE) && (xports[sock] == xprt)) {
- xports[sock] = (SVCXPRT *) 0;
- svc_fds &= ~(1 << sock);
- }
-#endif /* def FD_SETSIZE */
-}
-
-
-/* ********************** CALLOUT list related stuff ************* */
-
-/*
- * Add a service program to the callout list.
- * The dispatch routine will be called when a rpc request for this
- * program number comes in.
- */
-bool_t svc_register(xprt, prog, vers, dispatch, protocol)
-SVCXPRT *xprt;
-unsigned long prog;
-unsigned long vers;
-void (*dispatch) ();
-rpcprot_t protocol;
-{
- struct svc_callout *prev;
- register struct svc_callout *s;
-
- if ((s = svc_find(prog, vers, &prev)) != NULL_SVC) {
- if (s->sc_dispatch == dispatch)
- goto pmap_it; /* he is registering another xptr */
- return (FALSE);
- }
- s = (struct svc_callout *) mem_alloc(sizeof(struct svc_callout));
-
- if (s == (struct svc_callout *) 0) {
- return (FALSE);
- }
- s->sc_prog = prog;
- s->sc_vers = vers;
- s->sc_dispatch = dispatch;
- s->sc_next = svc_head;
- svc_head = s;
- pmap_it:
- /* now register the information with the local binder service */
- if (protocol) {
- return (pmap_set(prog, vers, protocol, xprt->xp_port));
- }
- return (TRUE);
-}
-
-/*
- * Remove a service program from the callout list.
- */
-void svc_unregister(prog, vers)
-unsigned long prog;
-unsigned long vers;
-{
- struct svc_callout *prev;
- register struct svc_callout *s;
-
- if ((s = svc_find(prog, vers, &prev)) == NULL_SVC)
- return;
- if (prev == NULL_SVC) {
- svc_head = s->sc_next;
- } else {
- prev->sc_next = s->sc_next;
- }
- s->sc_next = NULL_SVC;
- mem_free((char *) s, (unsigned int) sizeof(struct svc_callout));
-
- /* now unregister the information with the local binder service */
- (void) pmap_unset(prog, vers);
-}
-
-/*
- * Search the callout list for a program number, return the callout
- * struct.
- */
-static struct svc_callout *svc_find(prog, vers, prev)
-unsigned long prog;
-unsigned long vers;
-struct svc_callout **prev;
-{
- register struct svc_callout *s, *p;
-
- p = NULL_SVC;
- for (s = svc_head; s != NULL_SVC; s = s->sc_next) {
- if ((s->sc_prog == prog) && (s->sc_vers == vers))
- goto done;
- p = s;
- }
- done:
- *prev = p;
- return (s);
-}
-
-/* ******************* REPLY GENERATION ROUTINES ************ */
-
-/*
- * Send a reply to an rpc request
- */
-bool_t svc_sendreply(xprt, xdr_results, xdr_location)
-register SVCXPRT *xprt;
-xdrproc_t xdr_results;
-char* xdr_location;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = SUCCESS;
- rply.acpted_rply.ar_results.where = xdr_location;
- rply.acpted_rply.ar_results.proc = xdr_results;
- return (SVC_REPLY(xprt, &rply));
-}
-
-/*
- * No procedure error reply
- */
-void svcerr_noproc(xprt)
-register SVCXPRT *xprt;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = PROC_UNAVAIL;
- SVC_REPLY(xprt, &rply);
-}
-
-/*
- * Can't decode args error reply
- */
-void svcerr_decode(xprt)
-register SVCXPRT *xprt;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = GARBAGE_ARGS;
- SVC_REPLY(xprt, &rply);
-}
-
-/*
- * Some system error
- */
-void svcerr_systemerr(xprt)
-register SVCXPRT *xprt;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = SYSTEM_ERR;
- SVC_REPLY(xprt, &rply);
-}
-
-/*
- * Authentication error reply
- */
-void svcerr_auth(xprt, why)
-SVCXPRT *xprt;
-enum auth_stat why;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_DENIED;
- rply.rjcted_rply.rj_stat = AUTH_ERROR;
- rply.rjcted_rply.rj_why = why;
- SVC_REPLY(xprt, &rply);
-}
-
-/*
- * Auth too weak error reply
- */
-void svcerr_weakauth(xprt)
-SVCXPRT *xprt;
-{
-
- svcerr_auth(xprt, AUTH_TOOWEAK);
-}
-
-/*
- * Program unavailable error reply
- */
-void svcerr_noprog(xprt)
-register SVCXPRT *xprt;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = PROG_UNAVAIL;
- SVC_REPLY(xprt, &rply);
-}
-
-/*
- * Program version mismatch error reply
- */
-void svcerr_progvers(xprt, low_vers, high_vers)
-register SVCXPRT *xprt;
-unsigned long low_vers;
-unsigned long high_vers;
-{
- struct rpc_msg rply;
-
- rply.rm_direction = REPLY;
- rply.rm_reply.rp_stat = MSG_ACCEPTED;
- rply.acpted_rply.ar_verf = xprt->xp_verf;
- rply.acpted_rply.ar_stat = PROG_MISMATCH;
- rply.acpted_rply.ar_vers.low = low_vers;
- rply.acpted_rply.ar_vers.high = high_vers;
- SVC_REPLY(xprt, &rply);
-}
-
-/* ******************* SERVER INPUT STUFF ******************* */
-
-/*
- * Get server side input from some transport.
- *
- * Statement of authentication parameters management:
- * This function owns and manages all authentication parameters, specifically
- * the "raw" parameters (msg.rm_call.cb_cred and msg.rm_call.cb_verf) and
- * the "cooked" credentials (rqst->rq_clntcred).
- * However, this function does not know the structure of the cooked
- * credentials, so it make the following assumptions:
- * a) the structure is contiguous (no pointers), and
- * b) the cred structure size does not exceed RQCRED_SIZE bytes.
- * In all events, all three parameters are freed upon exit from this routine.
- * The storage is trivially management on the call stack in user land, but
- * is mallocated in kernel land.
- */
-
-void svc_getreq(rdfds)
-int rdfds;
-{
-#ifdef FD_SETSIZE
- fd_set readfds;
-
- FD_ZERO(&readfds);
-/*#ifdef __linux__*/
-#if 0
- readfds = rdfds;
-#else
- readfds.fds_bits[0] = rdfds;
-#endif
- svc_getreqset(&readfds);
-#else
- int readfds = rdfds & svc_fds;
-
- svc_getreqset(&readfds);
-#endif /* def FD_SETSIZE */
-}
-
-void svc_getreqset(readfds)
-#ifdef FD_SETSIZE
-fd_set *readfds;
-{
-#else
-int *readfds;
-{
- int readfds_local = *readfds;
-#endif /* def FD_SETSIZE */
- enum xprt_stat stat;
- struct rpc_msg msg;
- int prog_found;
- unsigned long low_vers;
- unsigned long high_vers;
- struct svc_req r;
- register SVCXPRT *xprt;
- register unsigned long mask;
- register int bit;
- register unsigned long *maskp;
- register int setsize;
- register int sock;
- char cred_area[2 * MAX_AUTH_BYTES + RQCRED_SIZE];
-
- msg.rm_call.cb_cred.oa_base = cred_area;
- msg.rm_call.cb_verf.oa_base = &(cred_area[MAX_AUTH_BYTES]);
- r.rq_clntcred = &(cred_area[2 * MAX_AUTH_BYTES]);
-
-
-#ifdef FD_SETSIZE
- setsize = _rpc_dtablesize();
-#ifdef __linux__
-/*#define NFDBITS 32*/
- maskp = (unsigned long *) readfds;
-#else
- maskp = (unsigned long *) readfds->fds_bits;
-#endif
- for (sock = 0; sock < setsize; sock += NFDBITS) {
- for (mask = *maskp++; (bit = ffs(mask)); mask ^= (1 << (bit - 1))) {
- /* sock has input waiting */
- xprt = xports[sock + bit - 1];
-#else
- for (sock = 0; readfds_local != 0; sock++, readfds_local >>= 1) {
- if ((readfds_local & 1) != 0) {
- /* sock has input waiting */
- xprt = xports[sock];
-#endif /* def FD_SETSIZE */
- /* now receive msgs from xprtprt (support batch calls) */
- do {
- if (SVC_RECV(xprt, &msg)) {
-
- /* now find the exported program and call it */
- register struct svc_callout *s;
- enum auth_stat why;
-
- r.rq_xprt = xprt;
- r.rq_prog = msg.rm_call.cb_prog;
- r.rq_vers = msg.rm_call.cb_vers;
- r.rq_proc = msg.rm_call.cb_proc;
- r.rq_cred = msg.rm_call.cb_cred;
- /* first authenticate the message */
- if ((why = _authenticate(&r, &msg)) != AUTH_OK) {
- svcerr_auth(xprt, why);
- goto call_done;
- }
- /* now match message with a registered service */
- prog_found = FALSE;
- low_vers = 0 - 1;
- high_vers = 0;
- for (s = svc_head; s != NULL_SVC; s = s->sc_next) {
- if (s->sc_prog == r.rq_prog) {
- if (s->sc_vers == r.rq_vers) {
- (*s->sc_dispatch) (&r, xprt);
- goto call_done;
- } /* found correct version */
- prog_found = TRUE;
- if (s->sc_vers < low_vers)
- low_vers = s->sc_vers;
- if (s->sc_vers > high_vers)
- high_vers = s->sc_vers;
- } /* found correct program */
- }
- /*
- * if we got here, the program or version
- * is not served ...
- */
- if (prog_found)
- svcerr_progvers(xprt, low_vers, high_vers);
- else
- svcerr_noprog(xprt);
- /* Fall through to ... */
- }
- call_done:
- if ((stat = SVC_STAT(xprt)) == XPRT_DIED) {
- SVC_DESTROY(xprt);
- break;
- }
- } while (stat == XPRT_MOREREQS);
- }
- }
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc_auth.c b/mdk-stage1/dietlibc/librpc/svc_auth.c
deleted file mode 100644
index 336586d95..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_auth.c
+++ /dev/null
@@ -1,115 +0,0 @@
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)svc_auth.c 2.1 88/08/07 4.0 RPCSRC; from 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * svc_auth_nodes.c, Server-side rpc authenticator interface,
- * *WITHOUT* DES authentication.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-
-/*
- * svcauthsw is the bdevsw of server side authentication.
- *
- * Server side authenticators are called from authenticate by
- * using the client auth struct flavor field to index into svcauthsw.
- * The server auth flavors must implement a routine that looks
- * like:
- *
- * enum auth_stat
- * flavorx_auth(rqst, msg)
- * register struct svc_req *rqst;
- * register struct rpc_msg *msg;
- *
- */
-
-enum auth_stat _svcauth_null(); /* no authentication */
-enum auth_stat _svcauth_unix(); /* unix style (uid, gids) */
-enum auth_stat _svcauth_short(); /* short hand unix style */
-
-static struct {
- enum auth_stat (*authenticator) ();
-} svcauthsw[] = {
- { _svcauth_null }, /* AUTH_NULL */
- { _svcauth_unix }, /* AUTH_UNIX */
- { _svcauth_short }, /* AUTH_SHORT */
-};
-
-#define AUTH_MAX 2 /* HIGHEST AUTH NUMBER */
-
-
-/*
- * The call rpc message, msg has been obtained from the wire. The msg contains
- * the raw form of credentials and verifiers. authenticate returns AUTH_OK
- * if the msg is successfully authenticated. If AUTH_OK then the routine also
- * does the following things:
- * set rqst->rq_xprt->verf to the appropriate response verifier;
- * sets rqst->rq_client_cred to the "cooked" form of the credentials.
- *
- * NB: rqst->rq_cxprt->verf must be pre-alloctaed;
- * its length is set appropriately.
- *
- * The caller still owns and is responsible for msg->u.cmb.cred and
- * msg->u.cmb.verf. The authentication system retains ownership of
- * rqst->rq_client_cred, the cooked credentials.
- *
- * There is an assumption that any flavour less than AUTH_NULL is
- * invalid.
- */
-enum auth_stat _authenticate(rqst, msg)
-register struct svc_req *rqst;
-struct rpc_msg *msg;
-{
- register int cred_flavor;
-
- rqst->rq_cred = msg->rm_call.cb_cred;
- rqst->rq_xprt->xp_verf.oa_flavor = _null_auth.oa_flavor;
- rqst->rq_xprt->xp_verf.oa_length = 0;
- cred_flavor = rqst->rq_cred.oa_flavor;
- if ((cred_flavor <= AUTH_MAX) && (cred_flavor >= AUTH_NULL)) {
- return ((*(svcauthsw[cred_flavor].authenticator)) (rqst, msg));
- }
-
- return (AUTH_REJECTEDCRED);
-}
-
-enum auth_stat _svcauth_null( /*rqst, msg */ )
- /*struct svc_req *rqst;
- struct rpc_msg *msg; */
-{
-
- return (AUTH_OK);
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc_auth_unix.c b/mdk-stage1/dietlibc/librpc/svc_auth_unix.c
deleted file mode 100644
index e81eba7d9..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_auth_unix.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* @(#)svc_auth_unix.c 2.3 88/08/01 4.0 RPCSRC; from 1.28 88/02/08 SMI */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)svc_auth_unix.c 1.28 88/02/08 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc_auth_unix.c
- * Handles UNIX flavor authentication parameters on the service side of rpc.
- * There are two svc auth implementations here: AUTH_UNIX and AUTH_SHORT.
- * _svcauth_unix does full blown unix style uid,gid+gids auth,
- * _svcauth_short uses a shorthand auth to index into a cache of longhand auths.
- * Note: the shorthand has been gutted for efficiency.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <string.h>
-
-/*
- * Unix longhand authenticator
- */
-enum auth_stat _svcauth_unix(rqst, msg)
-register struct svc_req *rqst;
-register struct rpc_msg *msg;
-{
- register enum auth_stat stat;
- XDR xdrs;
- register struct authunix_parms *aup;
- register int32_t *buf;
- struct area {
- struct authunix_parms area_aup;
- char area_machname[MAX_MACHINE_NAME + 1];
- gid_t area_gids[NGRPS];
- } *area;
- unsigned int auth_len;
- int str_len, gid_len;
- register int i;
-
- area = (struct area *) rqst->rq_clntcred;
- aup = &area->area_aup;
- aup->aup_machname = area->area_machname;
- aup->aup_gids = area->area_gids;
- auth_len = (unsigned int) msg->rm_call.cb_cred.oa_length;
- xdrmem_create(&xdrs, msg->rm_call.cb_cred.oa_base, auth_len,
- XDR_DECODE);
- buf = XDR_INLINE(&xdrs, auth_len);
- if (buf != NULL) {
- aup->aup_time = IXDR_GET_LONG(buf);
- str_len = IXDR_GET_U_LONG(buf);
- if (str_len > MAX_MACHINE_NAME) {
- stat = AUTH_BADCRED;
- goto done;
- }
- memmove(aup->aup_machname, (char*) buf, (unsigned int) str_len);
- aup->aup_machname[str_len] = 0;
- str_len = RNDUP(str_len);
- buf += str_len / sizeof(long);
-
- aup->aup_uid = IXDR_GET_LONG(buf);
- aup->aup_gid = IXDR_GET_LONG(buf);
- gid_len = IXDR_GET_U_LONG(buf);
- if (gid_len > NGRPS) {
- stat = AUTH_BADCRED;
- goto done;
- }
- aup->aup_len = gid_len;
- for (i = 0; i < gid_len; i++) {
- aup->aup_gids[i] = IXDR_GET_LONG(buf);
- }
- /*
- * five is the smallest unix credentials structure -
- * timestamp, hostname len (0), uid, gid, and gids len (0).
- */
- if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len) {
- (void) printf("bad auth_len gid %d str %d auth %d\n",
- gid_len, str_len, auth_len);
- stat = AUTH_BADCRED;
- goto done;
- }
- } else if (!xdr_authunix_parms(&xdrs, aup)) {
- xdrs.x_op = XDR_FREE;
- (void) xdr_authunix_parms(&xdrs, aup);
- stat = AUTH_BADCRED;
- goto done;
- }
- rqst->rq_xprt->xp_verf.oa_flavor = AUTH_NULL;
- rqst->rq_xprt->xp_verf.oa_length = 0;
- stat = AUTH_OK;
- done:
- XDR_DESTROY(&xdrs);
- return (stat);
-}
-
-
-/*
- * Shorthand unix authenticator
- * Looks up longhand in a cache.
- */
- /*ARGSUSED*/ enum auth_stat _svcauth_short(rqst, msg)
-struct svc_req *rqst;
-struct rpc_msg *msg;
-{
- return (AUTH_REJECTEDCRED);
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc_raw.c b/mdk-stage1/dietlibc/librpc/svc_raw.c
deleted file mode 100644
index eebb433ee..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_raw.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* @(#)svc_raw.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)svc_raw.c 1.15 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc_raw.c, This a toy for simple testing and timing.
- * Interface to create an rpc client and server in the same UNIX process.
- * This lets us similate rpc and get rpc (round trip) overhead, without
- * any interference from the kernal.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <rpc/rpc.h>
-
-
-/*
- * This is the "network" that we will be moving data over
- */
-static struct svcraw_private {
- char _raw_buf[UDPMSGSIZE];
- SVCXPRT server;
- XDR xdr_stream;
- char verf_body[MAX_AUTH_BYTES];
-} *svcraw_private;
-
-static bool_t svcraw_recv();
-static enum xprt_stat svcraw_stat();
-static bool_t svcraw_getargs();
-static bool_t svcraw_reply();
-static bool_t svcraw_freeargs();
-static void svcraw_destroy();
-
-static struct xp_ops server_ops = {
- svcraw_recv,
- svcraw_stat,
- svcraw_getargs,
- svcraw_reply,
- svcraw_freeargs,
- svcraw_destroy
-};
-
-
-SVCXPRT *svcraw_create()
-{
- register struct svcraw_private *srp = svcraw_private;
-
- if (srp == 0) {
- srp = (struct svcraw_private *) calloc(1, sizeof(*srp));
- if (srp == 0)
- return (0);
- }
- srp->server.xp_sock = 0;
- srp->server.xp_port = 0;
- srp->server.xp_ops = &server_ops;
- srp->server.xp_verf.oa_base = srp->verf_body;
- xdrmem_create(&srp->xdr_stream, srp->_raw_buf, UDPMSGSIZE, XDR_FREE);
- return (&srp->server);
-}
-
-static enum xprt_stat svcraw_stat()
-{
-
- return (XPRT_IDLE);
-}
-
-static bool_t svcraw_recv(xprt, msg)
-SVCXPRT *xprt;
-struct rpc_msg *msg;
-{
- register struct svcraw_private *srp = svcraw_private;
- register XDR *xdrs;
-
- if (srp == 0)
- return (0);
- xdrs = &srp->xdr_stream;
- xdrs->x_op = XDR_DECODE;
- XDR_SETPOS(xdrs, 0);
- if (!xdr_callmsg(xdrs, msg))
- return (FALSE);
- return (TRUE);
-}
-
-static bool_t svcraw_reply(xprt, msg)
-SVCXPRT *xprt;
-struct rpc_msg *msg;
-{
- register struct svcraw_private *srp = svcraw_private;
- register XDR *xdrs;
-
- if (srp == 0)
- return (FALSE);
- xdrs = &srp->xdr_stream;
- xdrs->x_op = XDR_ENCODE;
- XDR_SETPOS(xdrs, 0);
- if (!xdr_replymsg(xdrs, msg))
- return (FALSE);
- (void) XDR_GETPOS(xdrs); /* called just for overhead */
- return (TRUE);
-}
-
-static bool_t svcraw_getargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
- register struct svcraw_private *srp = svcraw_private;
-
- if (srp == 0)
- return (FALSE);
- return ((*xdr_args) (&srp->xdr_stream, args_ptr));
-}
-
-static bool_t svcraw_freeargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
- register struct svcraw_private *srp = svcraw_private;
- register XDR *xdrs;
-
- if (srp == 0)
- return (FALSE);
- xdrs = &srp->xdr_stream;
- xdrs->x_op = XDR_FREE;
- return ((*xdr_args) (xdrs, args_ptr));
-}
-
-static void svcraw_destroy()
-{
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/svc_run.c b/mdk-stage1/dietlibc/librpc/svc_run.c
deleted file mode 100644
index 506b37942..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_run.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* @(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * This is the rpc server side idle loop
- * Wait for input, call server program.
- */
-#include <rpc/rpc.h>
-#include <errno.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-void svc_run()
-{
-#ifdef FD_SETSIZE
- fd_set readfds;
-#else
- int readfds;
-#endif /* def FD_SETSIZE */
-
- for (;;) {
-#ifdef FD_SETSIZE
- readfds = svc_fdset;
-#else
- readfds = svc_fds;
-#endif /* def FD_SETSIZE */
- switch (select(_rpc_dtablesize(), &readfds, 0, 0, 0)) {
- case -1:
- if (errno == EINTR) {
- continue;
- }
- perror("svc_run: - select failed");
- return;
- case 0:
- continue;
- default:
- svc_getreqset(&readfds);
- }
- }
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc_simple.c b/mdk-stage1/dietlibc/librpc/svc_simple.c
deleted file mode 100644
index d2310de1e..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_simple.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* @(#)svc_simple.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc_simple.c
- * Simplified front end to rpc.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <rpc/pmap_clnt.h>
-#include <string.h>
-
-static struct proglst {
- char *(*p_progname) ();
- int p_prognum;
- int p_procnum;
- xdrproc_t p_inproc, p_outproc;
- struct proglst *p_nxt;
-} *proglst;
-static void universal();
-static SVCXPRT *transp;
-struct proglst *pl;
-
-int registerrpc(int prognum, int versnum, int procnum, char *(*progname)(), xdrproc_t inproc, xdrproc_t outproc)
-{
-
- if (procnum == NULLPROC) {
- (void) fprintf(stderr,
- "can't reassign procedure number %d\n", NULLPROC);
- return (-1);
- }
- if (transp == 0) {
- transp = svcudp_create(RPC_ANYSOCK);
- if (transp == NULL) {
- (void) fprintf(stderr, "couldn't create an rpc server\n");
- return (-1);
- }
- }
- (void) pmap_unset((unsigned long) prognum, (unsigned long) versnum);
- if (!svc_register(transp, (unsigned long) prognum, (unsigned long) versnum,
- universal, IPPROTO_UDP)) {
- (void) fprintf(stderr, "couldn't register prog %d vers %d\n",
- prognum, versnum);
- return (-1);
- }
- pl = (struct proglst *) malloc(sizeof(struct proglst));
-
- if (pl == NULL) {
- (void) fprintf(stderr, "registerrpc: out of memory\n");
- return (-1);
- }
- pl->p_progname = progname;
- pl->p_prognum = prognum;
- pl->p_procnum = procnum;
- pl->p_inproc = inproc;
- pl->p_outproc = outproc;
- pl->p_nxt = proglst;
- proglst = pl;
- return (0);
-}
-
-static void universal(rqstp, transp)
-struct svc_req *rqstp;
-SVCXPRT *transp;
-{
- int prog, proc;
- char *outdata;
- char xdrbuf[UDPMSGSIZE];
- struct proglst *pl;
-
- /*
- * enforce "procnum 0 is echo" convention
- */
- if (rqstp->rq_proc == NULLPROC) {
- if (svc_sendreply(transp, (xdrproc_t)xdr_void, (char *) NULL) == FALSE) {
- (void) fprintf(stderr, "xxx\n");
- exit(1);
- }
- return;
- }
- prog = rqstp->rq_prog;
- proc = rqstp->rq_proc;
- for (pl = proglst; pl != NULL; pl = pl->p_nxt)
- if (pl->p_prognum == prog && pl->p_procnum == proc) {
- /* decode arguments into a CLEAN buffer */
- memset(xdrbuf, 0, sizeof(xdrbuf)); /* required ! */
- if (!svc_getargs(transp, pl->p_inproc, xdrbuf)) {
- svcerr_decode(transp);
- return;
- }
- outdata = (*(pl->p_progname)) (xdrbuf);
- if (outdata == NULL && pl->p_outproc != (xdrproc_t)xdr_void)
- /* there was an error */
- return;
- if (!svc_sendreply(transp, pl->p_outproc, outdata)) {
- (void) fprintf(stderr,
- "trouble replying to prog %d\n",
- pl->p_prognum);
- exit(1);
- }
- /* free the decoded arguments */
- (void) svc_freeargs(transp, pl->p_inproc, xdrbuf);
- return;
- }
- (void) fprintf(stderr, "never registered prog %d\n", prog);
- exit(1);
-}
diff --git a/mdk-stage1/dietlibc/librpc/svc_tcp.c b/mdk-stage1/dietlibc/librpc/svc_tcp.c
deleted file mode 100644
index 0444bc0d0..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_tcp.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/* @(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc_tcp.c, Server side for TCP/IP based RPC.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * Actually implements two flavors of transporter -
- * a tcp rendezvouser (a listner and connection establisher)
- * and a record/tcp stream.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-/*
- * Ops vector for TCP/IP based rpc service handle
- */
-static bool_t svctcp_recv();
-static enum xprt_stat svctcp_stat();
-static bool_t svctcp_getargs();
-static bool_t svctcp_reply();
-static bool_t svctcp_freeargs();
-static void svctcp_destroy();
-
-static struct xp_ops svctcp_op;
-
-/*
- * Ops vector for TCP/IP rendezvous handler
- */
-static bool_t rendezvous_request();
-static enum xprt_stat rendezvous_stat();
-
-static struct xp_ops svctcp_rendezvous_op = {
- rendezvous_request,
- rendezvous_stat,
- (void*)abort,
- (void*)abort,
- (void*)abort,
- svctcp_destroy
-};
-
-static int readtcp(), writetcp();
-static SVCXPRT *makefd_xprt();
-
-struct tcp_rendezvous { /* kept in xprt->xp_p1 */
- unsigned int sendsize;
- unsigned int recvsize;
-};
-
-struct tcp_conn { /* kept in xprt->xp_p1 */
- enum xprt_stat strm_stat;
- unsigned long x_id;
- XDR xdrs;
- char verf_body[MAX_AUTH_BYTES];
-};
-
-/*
- * Usage:
- * xprt = svctcp_create(sock, send_buf_size, recv_buf_size);
- *
- * Creates, registers, and returns a (rpc) tcp based transporter.
- * Once *xprt is initialized, it is registered as a transporter
- * see (svc.h, xprt_register). This routine returns
- * a NULL if a problem occurred.
- *
- * If sock<0 then a socket is created, else sock is used.
- * If the socket, sock is not bound to a port then svctcp_create
- * binds it to an arbitrary port. The routine then starts a tcp
- * listener on the socket's associated port. In any (successful) case,
- * xprt->xp_sock is the registered socket number and xprt->xp_port is the
- * associated port number.
- *
- * Since tcp streams do buffered io similar to stdio, the caller can specify
- * how big the send and receive buffers are via the second and third parms;
- * 0 => use the system default.
- */
-SVCXPRT *svctcp_create(sock, sendsize, recvsize)
-register int sock;
-unsigned int sendsize;
-unsigned int recvsize;
-{
- bool_t madesock = FALSE;
- register SVCXPRT *xprt;
- register struct tcp_rendezvous *r;
- struct sockaddr_in addr;
- int len = sizeof(struct sockaddr_in);
-
- if (sock == RPC_ANYSOCK) {
- if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
- perror("svc_tcp.c - tcp socket creation problem");
- return ((SVCXPRT *) NULL);
- }
- madesock = TRUE;
- }
- memset((char *) &addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- if (bindresvport(sock, &addr)) {
- addr.sin_port = 0;
- (void) bind(sock, (struct sockaddr *) &addr, len);
- }
- if ((getsockname(sock, (struct sockaddr *) &addr, &len) != 0) ||
- (listen(sock, 2) != 0)) {
- perror("svctcp_.c - cannot getsockname or listen");
- if (madesock)
- (void) close(sock);
- return ((SVCXPRT *) NULL);
- }
- r = (struct tcp_rendezvous *) mem_alloc(sizeof(*r));
- if (r == NULL) {
- (void) fprintf(stderr, "svctcp_create: out of memory\n");
- return (NULL);
- }
- r->sendsize = sendsize;
- r->recvsize = recvsize;
- xprt = (SVCXPRT *) mem_alloc(sizeof(SVCXPRT));
- if (xprt == NULL) {
- (void) fprintf(stderr, "svctcp_create: out of memory\n");
- return (NULL);
- }
- xprt->xp_p2 = NULL;
- xprt->xp_p1 = (char*) r;
- xprt->xp_verf = _null_auth;
- xprt->xp_ops = &svctcp_rendezvous_op;
- xprt->xp_port = ntohs(addr.sin_port);
- xprt->xp_sock = sock;
- xprt_register(xprt);
- return (xprt);
-}
-
-/*
- * Like svtcp_create(), except the routine takes any *open* UNIX file
- * descriptor as its first input.
- */
-SVCXPRT *svcfd_create(fd, sendsize, recvsize)
-int fd;
-unsigned int sendsize;
-unsigned int recvsize;
-{
-
- return (makefd_xprt(fd, sendsize, recvsize));
-}
-
-static SVCXPRT *makefd_xprt(fd, sendsize, recvsize)
-int fd;
-unsigned int sendsize;
-unsigned int recvsize;
-{
- register SVCXPRT *xprt;
- register struct tcp_conn *cd;
-
- xprt = (SVCXPRT *) mem_alloc(sizeof(SVCXPRT));
- if (xprt == (SVCXPRT *) NULL) {
- (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n");
- goto done;
- }
- cd = (struct tcp_conn *) mem_alloc(sizeof(struct tcp_conn));
-
- if (cd == (struct tcp_conn *) NULL) {
- (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n");
- mem_free((char *) xprt, sizeof(SVCXPRT));
- xprt = (SVCXPRT *) NULL;
- goto done;
- }
- cd->strm_stat = XPRT_IDLE;
- xdrrec_create(&(cd->xdrs), sendsize, recvsize,
- (char*) xprt, readtcp, writetcp);
- xprt->xp_p2 = NULL;
- xprt->xp_p1 = (char*) cd;
- xprt->xp_verf.oa_base = cd->verf_body;
- xprt->xp_addrlen = 0;
- xprt->xp_ops = &svctcp_op; /* truely deals with calls */
- xprt->xp_port = 0; /* this is a connection, not a rendezvouser */
- xprt->xp_sock = fd;
- xprt_register(xprt);
- done:
- return (xprt);
-}
-
-static bool_t rendezvous_request(xprt)
-register SVCXPRT *xprt;
-{
- int sock;
- struct tcp_rendezvous *r;
- struct sockaddr_in addr;
- int len;
-
- r = (struct tcp_rendezvous *) xprt->xp_p1;
- again:
- len = sizeof(struct sockaddr_in);
-
- if ((sock = accept(xprt->xp_sock, (struct sockaddr *) &addr,
- &len)) < 0) {
- if (errno == EINTR)
- goto again;
- return (FALSE);
- }
- /*
- * make a new transporter (re-uses xprt)
- */
- xprt = makefd_xprt(sock, r->sendsize, r->recvsize);
- xprt->xp_raddr = addr;
- xprt->xp_addrlen = len;
- return (FALSE); /* there is never an rpc msg to be processed */
-}
-
-static enum xprt_stat rendezvous_stat()
-{
-
- return (XPRT_IDLE);
-}
-
-static void svctcp_destroy(xprt)
-register SVCXPRT *xprt;
-{
- register struct tcp_conn *cd = (struct tcp_conn *) xprt->xp_p1;
-
- xprt_unregister(xprt);
- (void) close(xprt->xp_sock);
- if (xprt->xp_port != 0) {
- /* a rendezvouser socket */
- xprt->xp_port = 0;
- } else {
- /* an actual connection socket */
- XDR_DESTROY(&(cd->xdrs));
- }
- mem_free((char*) cd, sizeof(struct tcp_conn));
-
- mem_free((char*) xprt, sizeof(SVCXPRT));
-}
-
-/*
- * All read operations timeout after 35 seconds.
- * A timeout is fatal for the connection.
- */
-static struct timeval wait_per_try = { 35, 0 };
-
-/*
- * reads data from the tcp conection.
- * any error is fatal and the connection is closed.
- * (And a read of zero bytes is a half closed stream => error.)
- */
-static int readtcp(xprt, buf, len)
-register SVCXPRT *xprt;
-char* buf;
-register int len;
-{
- register int sock = xprt->xp_sock;
-
-#ifdef FD_SETSIZE
- fd_set mask;
- fd_set readfds;
-
- FD_ZERO(&mask);
- FD_SET(sock, &mask);
-#else
- register int mask = 1 << sock;
- int readfds;
-#endif /* def FD_SETSIZE */
- do {
- readfds = mask;
- if (select(_rpc_dtablesize(), &readfds, 0, 0, &wait_per_try) <= 0) {
- if (errno == EINTR) {
- continue;
- }
- goto fatal_err;
- }
-#ifdef FD_SETSIZE
- } while (!FD_ISSET(sock, &readfds));
-#else
- } while (readfds != mask);
-#endif /* def FD_SETSIZE */
- if ((len = read(sock, buf, len)) > 0) {
- return (len);
- }
- fatal_err:
- ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
- return (-1);
-}
-
-/*
- * writes data to the tcp connection.
- * Any error is fatal and the connection is closed.
- */
-static int writetcp(xprt, buf, len)
-register SVCXPRT *xprt;
-char* buf;
-int len;
-{
- register int i, cnt;
-
- for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = write(xprt->xp_sock, buf, cnt)) < 0) {
- ((struct tcp_conn *) (xprt->xp_p1))->strm_stat = XPRT_DIED;
- return (-1);
- }
- }
- return (len);
-}
-
-static enum xprt_stat svctcp_stat(xprt)
-SVCXPRT *xprt;
-{
- register struct tcp_conn *cd = (struct tcp_conn *) (xprt->xp_p1);
-
- if (cd->strm_stat == XPRT_DIED)
- return (XPRT_DIED);
- if (!xdrrec_eof(&(cd->xdrs)))
- return (XPRT_MOREREQS);
- return (XPRT_IDLE);
-}
-
-static bool_t svctcp_recv(xprt, msg)
-SVCXPRT *xprt;
-register struct rpc_msg *msg;
-{
- register struct tcp_conn *cd = (struct tcp_conn *) (xprt->xp_p1);
- register XDR *xdrs = &(cd->xdrs);
-
- xdrs->x_op = XDR_DECODE;
- (void) xdrrec_skiprecord(xdrs);
- if (xdr_callmsg(xdrs, msg)) {
- cd->x_id = msg->rm_xid;
- return (TRUE);
- }
- return (FALSE);
-}
-
-static bool_t svctcp_getargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
-
- return ((*xdr_args)
- (&(((struct tcp_conn *) (xprt->xp_p1))->xdrs), args_ptr));
-}
-
-static bool_t svctcp_freeargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
- register XDR *xdrs = &(((struct tcp_conn *) (xprt->xp_p1))->xdrs);
-
- xdrs->x_op = XDR_FREE;
- return ((*xdr_args) (xdrs, args_ptr));
-}
-
-static bool_t svctcp_reply(xprt, msg)
-SVCXPRT *xprt;
-register struct rpc_msg *msg;
-{
- register struct tcp_conn *cd = (struct tcp_conn *) (xprt->xp_p1);
- register XDR *xdrs = &(cd->xdrs);
- register bool_t stat;
-
- xdrs->x_op = XDR_ENCODE;
- msg->rm_xid = cd->x_id;
- stat = xdr_replymsg(xdrs, msg);
- (void) xdrrec_endofrecord(xdrs, TRUE);
- return (stat);
-}
-
-static struct xp_ops svctcp_op = {
- svctcp_recv,
- svctcp_stat,
- svctcp_getargs,
- svctcp_reply,
- svctcp_freeargs,
- svctcp_destroy
-};
-
diff --git a/mdk-stage1/dietlibc/librpc/svc_udp.c b/mdk-stage1/dietlibc/librpc/svc_udp.c
deleted file mode 100644
index af22f289f..000000000
--- a/mdk-stage1/dietlibc/librpc/svc_udp.c
+++ /dev/null
@@ -1,467 +0,0 @@
-/* @(#)svc_udp.c 2.2 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * svc_udp.c,
- * Server side for UDP/IP based RPC. (Does some caching in the hopes of
- * achieving execute-at-most-once semantics.)
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- */
-
-#include <stdio.h>
-#include <rpc/rpc.h>
-#include <sys/socket.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include "dietfeatures.h"
-
-#define rpc_buffer(xprt) ((xprt)->xp_p1)
-
-static bool_t svcudp_recv();
-static bool_t svcudp_reply();
-static enum xprt_stat svcudp_stat();
-static bool_t svcudp_getargs();
-static bool_t svcudp_freeargs();
-static void svcudp_destroy();
-
-static struct xp_ops svcudp_op;
-
-/*
- * kept in xprt->xp_p2
- */
-struct svcudp_data {
- unsigned int su_iosz; /* byte size of send.recv buffer */
- unsigned long su_xid; /* transaction id */
- XDR su_xdrs; /* XDR handle */
- char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */
- char *su_cache; /* cached data, NULL if no cache */
-};
-
-#define su_data(xprt) ((struct svcudp_data *)(xprt->xp_p2))
-
-static int cache_get(SVCXPRT* xprt, struct rpc_msg* msg, char** replyp, unsigned long* replylenp);
-static void cache_set(SVCXPRT* xprt, unsigned long replylen);
-
-/*
- * Usage:
- * xprt = svcudp_create(sock);
- *
- * If sock<0 then a socket is created, else sock is used.
- * If the socket, sock is not bound to a port then svcudp_create
- * binds it to an arbitrary port. In any (successful) case,
- * xprt->xp_sock is the registered socket number and xprt->xp_port is the
- * associated port number.
- * Once *xprt is initialized, it is registered as a transporter;
- * see (svc.h, xprt_register).
- * The routines returns NULL if a problem occurred.
- */
-SVCXPRT *svcudp_bufcreate(sock, sendsz, recvsz)
-register int sock;
-unsigned int sendsz, recvsz;
-{
- bool_t madesock = FALSE;
- register SVCXPRT *xprt;
- register struct svcudp_data *su;
- struct sockaddr_in addr;
- int len = sizeof(struct sockaddr_in);
-
- if (sock == RPC_ANYSOCK) {
- if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("svcudp_create: socket creation problem");
- return ((SVCXPRT *) NULL);
- }
- madesock = TRUE;
- }
- memset((char *) &addr, 0, sizeof(addr));
- addr.sin_family = AF_INET;
- if (bindresvport(sock, &addr)) {
- addr.sin_port = 0;
- (void) bind(sock, (struct sockaddr *) &addr, len);
- }
- if (getsockname(sock, (struct sockaddr *) &addr, &len) != 0) {
- perror("svcudp_create - cannot getsockname");
- if (madesock)
- (void) close(sock);
- return ((SVCXPRT *) NULL);
- }
- xprt = (SVCXPRT *) mem_alloc(sizeof(SVCXPRT));
- if (xprt == NULL) {
- (void) fprintf(stderr, "svcudp_create: out of memory\n");
- return (NULL);
- }
- su = (struct svcudp_data *) mem_alloc(sizeof(*su));
- if (su == NULL) {
- (void) fprintf(stderr, "svcudp_create: out of memory\n");
- return (NULL);
- }
- su->su_iosz = ((MAX(sendsz, recvsz) + 3) / 4) * 4;
- if ((rpc_buffer(xprt) = mem_alloc(su->su_iosz)) == NULL) {
- (void) fprintf(stderr, "svcudp_create: out of memory\n");
- return (NULL);
- }
- xdrmem_create(&(su->su_xdrs), rpc_buffer(xprt), su->su_iosz,
- XDR_DECODE);
- su->su_cache = NULL;
- xprt->xp_p2 = (char*) su;
- xprt->xp_verf.oa_base = su->su_verfbody;
- xprt->xp_ops = &svcudp_op;
- xprt->xp_port = ntohs(addr.sin_port);
- xprt->xp_sock = sock;
- xprt_register(xprt);
- return (xprt);
-}
-
-SVCXPRT *svcudp_create(sock)
-int sock;
-{
-
- return (svcudp_bufcreate(sock, UDPMSGSIZE, UDPMSGSIZE));
-}
-
-static enum xprt_stat svcudp_stat(xprt)
-SVCXPRT *xprt;
-{
-
- return (XPRT_IDLE);
-}
-
-static bool_t svcudp_recv(xprt, msg)
-register SVCXPRT *xprt;
-struct rpc_msg *msg;
-{
- register struct svcudp_data *su = su_data(xprt);
- register XDR *xdrs = &(su->su_xdrs);
- register int rlen;
- char *reply;
- unsigned long replylen;
-
- again:
- xprt->xp_addrlen = sizeof(struct sockaddr_in);
-
- rlen = recvfrom(xprt->xp_sock, rpc_buffer(xprt), (int) su->su_iosz,
- 0, (struct sockaddr *) &(xprt->xp_raddr),
- &(xprt->xp_addrlen));
- if (rlen == -1 && errno == EINTR)
- goto again;
- if (rlen < 4 * sizeof(unsigned long))
- return (FALSE);
- xdrs->x_op = XDR_DECODE;
- XDR_SETPOS(xdrs, 0);
- if (!xdr_callmsg(xdrs, msg))
- return (FALSE);
- su->su_xid = msg->rm_xid;
- if (su->su_cache != NULL) {
- if (cache_get(xprt, msg, &reply, &replylen)) {
- (void) sendto(xprt->xp_sock, reply, (int) replylen, 0,
- (struct sockaddr *) &xprt->xp_raddr,
- xprt->xp_addrlen);
- return (TRUE);
- }
- }
- return (TRUE);
-}
-
-static bool_t svcudp_reply(xprt, msg)
-register SVCXPRT *xprt;
-struct rpc_msg *msg;
-{
- register struct svcudp_data *su = su_data(xprt);
- register XDR *xdrs = &(su->su_xdrs);
- register int slen;
- register bool_t stat = FALSE;
-
- xdrs->x_op = XDR_ENCODE;
- XDR_SETPOS(xdrs, 0);
- msg->rm_xid = su->su_xid;
- if (xdr_replymsg(xdrs, msg)) {
- slen = (int) XDR_GETPOS(xdrs);
- if (sendto(xprt->xp_sock, rpc_buffer(xprt), slen, 0,
- (struct sockaddr *) &(xprt->xp_raddr), xprt->xp_addrlen)
- == slen) {
- stat = TRUE;
- if (su->su_cache && slen >= 0) {
- cache_set(xprt, (unsigned long) slen);
- }
- }
- }
- return (stat);
-}
-
-static bool_t svcudp_getargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
-
- return ((*xdr_args) (&(su_data(xprt)->su_xdrs), args_ptr));
-}
-
-static bool_t svcudp_freeargs(xprt, xdr_args, args_ptr)
-SVCXPRT *xprt;
-xdrproc_t xdr_args;
-char* args_ptr;
-{
- register XDR *xdrs = &(su_data(xprt)->su_xdrs);
-
- xdrs->x_op = XDR_FREE;
- return ((*xdr_args) (xdrs, args_ptr));
-}
-
-static void svcudp_destroy(xprt)
-register SVCXPRT *xprt;
-{
- register struct svcudp_data *su = su_data(xprt);
-
- xprt_unregister(xprt);
- (void) close(xprt->xp_sock);
- XDR_DESTROY(&(su->su_xdrs));
- mem_free(rpc_buffer(xprt), su->su_iosz);
- mem_free((char*) su, sizeof(struct svcudp_data));
-
- mem_free((char*) xprt, sizeof(SVCXPRT));
-}
-
-
-/***********this could be a separate file*********************/
-
-/*
- * Fifo cache for udp server
- * Copies pointers to reply buffers into fifo cache
- * Buffers are sent again if retransmissions are detected.
- */
-
-#define SPARSENESS 4 /* 75% sparse */
-
-#define CACHE_PERROR(msg) \
- (void) fprintf(stderr,"%s\n", msg)
-
-#define ALLOC(type, size) \
- (type *) mem_alloc((unsigned) (sizeof(type) * (size)))
-
-#define BZERO(addr, type, size) \
- memset((char *) addr, 0, sizeof(type) * (int) (size))
-
-/*
- * An entry in the cache
- */
-typedef struct cache_node *cache_ptr;
-struct cache_node {
- /*
- * Index into cache is xid, proc, vers, prog and address
- */
- unsigned long cache_xid;
- unsigned long cache_proc;
- unsigned long cache_vers;
- unsigned long cache_prog;
- struct sockaddr_in cache_addr;
- /*
- * The cached reply and length
- */
- char *cache_reply;
- unsigned long cache_replylen;
- /*
- * Next node on the list, if there is a collision
- */
- cache_ptr cache_next;
-};
-
-
-
-/*
- * The entire cache
- */
-struct udp_cache {
- unsigned long uc_size; /* size of cache */
- cache_ptr *uc_entries; /* hash table of entries in cache */
- cache_ptr *uc_fifo; /* fifo list of entries in cache */
- unsigned long uc_nextvictim; /* points to next victim in fifo list */
- unsigned long uc_prog; /* saved program number */
- unsigned long uc_vers; /* saved version number */
- unsigned long uc_proc; /* saved procedure number */
- struct sockaddr_in uc_addr; /* saved caller's address */
-};
-
-
-/*
- * the hashing function
- */
-#define CACHE_LOC(transp, xid) \
- (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
-
-
-/*
- * Enable use of the cache.
- * Note: there is no disable.
- */
-int svcudp_enablecache(SVCXPRT* transp, unsigned long size)
-{
- struct svcudp_data *su = su_data(transp);
- struct udp_cache *uc;
-
- if (su->su_cache != NULL) {
- CACHE_PERROR("enablecache: cache already enabled");
- return (0);
- }
- uc = ALLOC(struct udp_cache, 1);
- if (uc == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache");
- return (0);
- }
- uc->uc_size = size;
- uc->uc_nextvictim = 0;
- uc->uc_entries = ALLOC(cache_ptr, size * SPARSENESS);
- if (uc->uc_entries == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache data");
- return (0);
- }
- BZERO(uc->uc_entries, cache_ptr, size * SPARSENESS);
- uc->uc_fifo = ALLOC(cache_ptr, size);
- if (uc->uc_fifo == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache fifo");
- return (0);
- }
- BZERO(uc->uc_fifo, cache_ptr, size);
- su->su_cache = (char *) uc;
- return (1);
-}
-
-
-/*
- * Set an entry in the cache
- */
-static void cache_set(SVCXPRT* xprt, unsigned long replylen)
-{
- register cache_ptr victim;
- register cache_ptr *vicp;
- register struct svcudp_data *su = su_data(xprt);
- struct udp_cache *uc = (struct udp_cache *) su->su_cache;
- unsigned int loc;
- char *newbuf;
-
- /*
- * Find space for the new entry, either by
- * reusing an old entry, or by mallocing a new one
- */
- victim = uc->uc_fifo[uc->uc_nextvictim];
- if (victim != NULL) {
- loc = CACHE_LOC(xprt, victim->cache_xid);
- for (vicp = &uc->uc_entries[loc];
- *vicp != NULL && *vicp != victim;
- vicp = &(*vicp)->cache_next);
- if (*vicp == NULL) {
- CACHE_PERROR("cache_set: victim not found");
- return;
- }
- *vicp = victim->cache_next; /* remote from cache */
- newbuf = victim->cache_reply;
- } else {
- victim = ALLOC(struct cache_node, 1);
-
- if (victim == NULL) {
- CACHE_PERROR("cache_set: victim alloc failed");
- return;
- }
- newbuf = mem_alloc(su->su_iosz);
- if (newbuf == NULL) {
- CACHE_PERROR("cache_set: could not allocate new rpc_buffer");
- return;
- }
- }
-
- /*
- * Store it away
- */
- victim->cache_replylen = replylen;
- victim->cache_reply = rpc_buffer(xprt);
- rpc_buffer(xprt) = newbuf;
- xdrmem_create(&(su->su_xdrs), rpc_buffer(xprt), su->su_iosz,
- XDR_ENCODE);
- victim->cache_xid = su->su_xid;
- victim->cache_proc = uc->uc_proc;
- victim->cache_vers = uc->uc_vers;
- victim->cache_prog = uc->uc_prog;
- victim->cache_addr = uc->uc_addr;
- loc = CACHE_LOC(xprt, victim->cache_xid);
- victim->cache_next = uc->uc_entries[loc];
- uc->uc_entries[loc] = victim;
- uc->uc_fifo[uc->uc_nextvictim++] = victim;
- uc->uc_nextvictim %= uc->uc_size;
-}
-
-/*
- * Try to get an entry from the cache
- * return 1 if found, 0 if not found
- */
-static int cache_get(SVCXPRT* xprt, struct rpc_msg* msg, char** replyp, unsigned long* replylenp)
-{
- unsigned int loc;
- register cache_ptr ent;
- register struct svcudp_data *su = su_data(xprt);
- register struct udp_cache *uc = (struct udp_cache *) su->su_cache;
-
-# define EQADDR(a1, a2) (memcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
-
- loc = CACHE_LOC(xprt, su->su_xid);
- for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next) {
- if (ent->cache_xid == su->su_xid &&
- ent->cache_proc == uc->uc_proc &&
- ent->cache_vers == uc->uc_vers &&
- ent->cache_prog == uc->uc_prog &&
- EQADDR(ent->cache_addr, uc->uc_addr)) {
- *replyp = ent->cache_reply;
- *replylenp = ent->cache_replylen;
- return (1);
- }
- }
- /*
- * Failed to find entry
- * Remember a few things so we can do a set later
- */
- uc->uc_proc = msg->rm_call.cb_proc;
- uc->uc_vers = msg->rm_call.cb_vers;
- uc->uc_prog = msg->rm_call.cb_prog;
- uc->uc_addr = xprt->xp_raddr;
- return (0);
-}
-
-static struct xp_ops svcudp_op = {
- svcudp_recv,
- svcudp_stat,
- svcudp_getargs,
- svcudp_reply,
- svcudp_freeargs,
- svcudp_destroy
-};
-
diff --git a/mdk-stage1/dietlibc/librpc/xdr.c b/mdk-stage1/dietlibc/librpc/xdr.c
deleted file mode 100644
index 8849dde7a..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr.c
+++ /dev/null
@@ -1,576 +0,0 @@
-/* @(#)xdr.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)xdr.c 1.35 87/08/12";
-#endif
-
-/*
- * xdr.c, Generic XDR routines implementation.
- *
- * Copyright (C) 1986, Sun Microsystems, Inc.
- *
- * These are the "generic" xdr routines used to serialize and de-serialize
- * most common data items. See xdr.h for more info on the interface to
- * xdr.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <string.h>
-
-/*
- * constants specific to the xdr "protocol"
- */
-#define XDR_FALSE ((long) 0)
-#define XDR_TRUE ((long) 1)
-#define LASTUNSIGNED ((unsigned int) 0-1)
-
-/*
- * for unit alignment
- */
-static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
-
-/*
- * Free a data structure using XDR
- * Not a filter, but a convenient utility nonetheless
- */
-void xdr_free(xdrproc_t proc, char* objp)
-{
- XDR x;
-
- x.x_op = XDR_FREE;
- (*proc) (&x, objp);
-}
-
-/*
- * XDR nothing
- */
-bool_t xdr_void( /* xdrs, addr */ )
- /* XDR *xdrs; */
- /* char* addr; */
-{
-
- return (TRUE);
-}
-
-/*
- * XDR integers
- */
-bool_t xdr_int(XDR* xdrs, int* ip)
-{
- if (sizeof(int) == sizeof(long)) {
- return (xdr_long(xdrs, (long *) ip));
- } else if (sizeof(int) < sizeof(long)) {
- long l;
- switch (xdrs->x_op) {
- case XDR_ENCODE:
- l = (long) *ip;
- return XDR_PUTLONG(xdrs, &l);
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l))
- return FALSE;
- *ip = (int) l;
- case XDR_FREE:
- return TRUE;
- }
- return FALSE;
- } else {
- return (xdr_short(xdrs, (short *) ip));
- }
-}
-
-/*
- * XDR unsigned integers
- */
-bool_t xdr_u_int(XDR* xdrs, unsigned int* up)
-{
- if (sizeof(unsigned int) == sizeof(unsigned long)) {
- return (xdr_u_long(xdrs, (unsigned long *) up));
- } else if (sizeof(unsigned int) < sizeof(unsigned long)) {
- unsigned long l;
- switch (xdrs->x_op) {
- case XDR_ENCODE:
- l = (unsigned long) *up;
- return XDR_PUTLONG(xdrs, &l);
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l))
- return FALSE;
- *up = (unsigned int) l;
- case XDR_FREE:
- return TRUE;
- }
- return FALSE;
- } else {
- return (xdr_short(xdrs, (short *) up));
- }
-}
-
-/*
- * XDR long integers
- * same as xdr_u_long - open coded to save a proc call!
- */
-bool_t xdr_long(XDR* xdrs, long* lp)
-{
-
- if (xdrs->x_op == XDR_ENCODE
- && (sizeof(int32_t) == sizeof(long)
- || (int32_t) *lp == *lp))
- return (XDR_PUTLONG(xdrs, lp));
-
- if (xdrs->x_op == XDR_DECODE)
- return (XDR_GETLONG(xdrs, lp));
-
- if (xdrs->x_op == XDR_FREE)
- return (TRUE);
-
- return (FALSE);
-}
-
-/*
- * XDR unsigned long integers
- * same as xdr_long - open coded to save a proc call!
- */
-bool_t xdr_u_long(XDR* xdrs, unsigned long* ulp)
-{
-
- if (xdrs->x_op == XDR_DECODE) {
- long l;
- if (XDR_GETLONG(xdrs, &l) == FALSE)
- return FALSE;
- *ulp = (uint32_t) l;
- return TRUE;
- }
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (sizeof(uint32_t) != sizeof(unsigned long)
- && (uint32_t) *ulp != *ulp)
- return FALSE;
-
- return (XDR_PUTLONG(xdrs, (long *) ulp));
- }
-
- if (xdrs->x_op == XDR_FREE)
- return (TRUE);
-
- return (FALSE);
-}
-
-/*
- * XDR short integers
- */
-bool_t xdr_short(XDR* xdrs, short* sp)
-{
- long l;
-
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- l = (long) *sp;
- return (XDR_PUTLONG(xdrs, &l));
-
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
- return (FALSE);
- }
- *sp = (short) l;
- return (TRUE);
-
- case XDR_FREE:
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * XDR unsigned short integers
- */
-bool_t xdr_u_short(XDR* xdrs, unsigned short* usp)
-{
- unsigned long l;
-
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- l = (unsigned long) * usp;
- return (XDR_PUTLONG(xdrs, &l));
-
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l)) {
- return (FALSE);
- }
- *usp = (unsigned short) l;
- return (TRUE);
-
- case XDR_FREE:
- return (TRUE);
- }
- return (FALSE);
-}
-
-
-/*
- * XDR a char
- */
-bool_t xdr_char(XDR* xdrs, char* cp)
-{
- int i;
-
- i = (*cp);
- if (!xdr_int(xdrs, &i)) {
- return (FALSE);
- }
- *cp = i;
- return (TRUE);
-}
-
-/*
- * XDR an unsigned char
- */
-bool_t xdr_u_char(XDR* xdrs, unsigned char* cp)
-{
- unsigned int u;
-
- u = (*cp);
- if (!xdr_u_int(xdrs, &u)) {
- return (FALSE);
- }
- *cp = u;
- return (TRUE);
-}
-
-/*
- * XDR booleans
- */
-bool_t xdr_bool(xdrs, bp)
-register XDR *xdrs;
-bool_t *bp;
-{
- long lb;
-
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- lb = *bp ? XDR_TRUE : XDR_FALSE;
- return (XDR_PUTLONG(xdrs, &lb));
-
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &lb)) {
- return (FALSE);
- }
- *bp = (lb == XDR_FALSE) ? FALSE : TRUE;
- return (TRUE);
-
- case XDR_FREE:
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * XDR enumerations
- */
-bool_t xdr_enum(xdrs, ep)
-XDR *xdrs;
-enum_t *ep;
-{
- enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
-
- /*
- * enums are treated as ints
- */
- if (sizeof(enum sizecheck) == sizeof(long)) {
- return (xdr_long(xdrs, (long *) ep));
- } else if (sizeof(enum sizecheck) == sizeof(int)) {
- long l;
- switch (xdrs->x_op) {
- case XDR_ENCODE:
- l = *ep;
- return XDR_PUTLONG(xdrs, &l);
- case XDR_DECODE:
- if (!XDR_GETLONG(xdrs, &l))
- return FALSE;
- *ep = l;
- case XDR_FREE:
- return TRUE;
- }
- return FALSE;
- } else if (sizeof(enum sizecheck) == sizeof(short)) {
- return (xdr_short(xdrs, (short *) ep));
- } else {
- return (FALSE);
- }
-}
-
-/*
- * XDR opaque data
- * Allows the specification of a fixed size sequence of opaque bytes.
- * cp points to the opaque object and cnt gives the byte length.
- */
-bool_t xdr_opaque(xdrs, cp, cnt)
-register XDR *xdrs;
-char* cp;
-register unsigned int cnt;
-{
- register unsigned int rndup;
- static char crud[BYTES_PER_XDR_UNIT];
-
- /*
- * if no data we are done
- */
- if (cnt == 0)
- return (TRUE);
-
- /*
- * round byte count to full xdr units
- */
- rndup = cnt % BYTES_PER_XDR_UNIT;
- if (rndup > 0)
- rndup = BYTES_PER_XDR_UNIT - rndup;
-
- if (xdrs->x_op == XDR_DECODE) {
- if (!XDR_GETBYTES(xdrs, cp, cnt)) {
- return (FALSE);
- }
- if (rndup == 0)
- return (TRUE);
- return (XDR_GETBYTES(xdrs, crud, rndup));
- }
-
- if (xdrs->x_op == XDR_ENCODE) {
- if (!XDR_PUTBYTES(xdrs, cp, cnt)) {
- return (FALSE);
- }
- if (rndup == 0)
- return (TRUE);
- return (XDR_PUTBYTES(xdrs, xdr_zero, rndup));
- }
-
- if (xdrs->x_op == XDR_FREE) {
- return (TRUE);
- }
-
- return (FALSE);
-}
-
-/*
- * XDR counted bytes
- * *cpp is a pointer to the bytes, *sizep is the count.
- * If *cpp is NULL maxsize bytes are allocated
- */
-bool_t xdr_bytes(xdrs, cpp, sizep, maxsize)
-register XDR *xdrs;
-char **cpp;
-register unsigned int *sizep;
-unsigned int maxsize;
-{
- register char *sp = *cpp; /* sp is the actual string pointer */
- register unsigned int nodesize;
-
- /*
- * first deal with the length since xdr bytes are counted
- */
- if (!xdr_u_int(xdrs, sizep)) {
- return (FALSE);
- }
- nodesize = *sizep;
- if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE)) {
- return (FALSE);
- }
-
- /*
- * now deal with the actual bytes
- */
- switch (xdrs->x_op) {
-
- case XDR_DECODE:
- if (nodesize == 0) {
- return (TRUE);
- }
- if (sp == NULL) {
- *cpp = sp = (char *) mem_alloc(nodesize);
- }
- if (sp == NULL) {
- (void) fprintf(stderr, "xdr_bytes: out of memory\n");
- return (FALSE);
- }
- /* fall into ... */
-
- case XDR_ENCODE:
- return (xdr_opaque(xdrs, sp, nodesize));
-
- case XDR_FREE:
- if (sp != NULL) {
- mem_free(sp, nodesize);
- *cpp = NULL;
- }
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * Implemented here due to commonality of the object.
- */
-bool_t xdr_netobj(xdrs, np)
-XDR *xdrs;
-struct netobj *np;
-{
-
- return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
-}
-
-/*
- * XDR a descriminated union
- * Support routine for discriminated unions.
- * You create an array of xdrdiscrim structures, terminated with
- * an entry with a null procedure pointer. The routine gets
- * the discriminant value and then searches the array of xdrdiscrims
- * looking for that value. It calls the procedure given in the xdrdiscrim
- * to handle the discriminant. If there is no specific routine a default
- * routine may be called.
- * If there is no specific or default routine an error is returned.
- */
-bool_t xdr_union(XDR* xdrs, enum_t* dscmp, char* unp, const struct xdr_discrim* choices, xdrproc_t dfault)
-{
- register enum_t dscm;
-
- /*
- * we deal with the discriminator; it's an enum
- */
- if (!xdr_enum(xdrs, dscmp)) {
- return (FALSE);
- }
- dscm = *dscmp;
-
- /*
- * search choices for a value that matches the discriminator.
- * if we find one, execute the xdr routine for that value.
- */
- for (; choices->proc != NULL_xdrproc_t; choices++) {
- if (choices->value == dscm)
- return ((*(choices->proc)) (xdrs, unp, LASTUNSIGNED));
- }
-
- /*
- * no match - execute the default xdr routine if there is one
- */
- return ((dfault == NULL_xdrproc_t) ? FALSE :
- (*dfault) (xdrs, unp, LASTUNSIGNED));
-}
-
-
-/*
- * Non-portable xdr primitives.
- * Care should be taken when moving these routines to new architectures.
- */
-
-
-/*
- * XDR null terminated ASCII strings
- * xdr_string deals with "C strings" - arrays of bytes that are
- * terminated by a NULL character. The parameter cpp references a
- * pointer to storage; If the pointer is null, then the necessary
- * storage is allocated. The last parameter is the max allowed length
- * of the string as specified by a protocol.
- */
-bool_t xdr_string(xdrs, cpp, maxsize)
-register XDR *xdrs;
-char **cpp;
-unsigned int maxsize;
-{
- register char *sp = *cpp; /* sp is the actual string pointer */
- unsigned int size;
- unsigned int nodesize;
-
- /*
- * first deal with the length since xdr strings are counted-strings
- */
- switch (xdrs->x_op) {
- case XDR_FREE:
- if (sp == NULL) {
- return (TRUE); /* already free */
- }
- /* fall through... */
- case XDR_ENCODE:
- size = strlen(sp);
- break;
- }
- if (!xdr_u_int(xdrs, &size)) {
- return (FALSE);
- }
- if (size > maxsize) {
- return (FALSE);
- }
- nodesize = size + 1;
-
- /*
- * now deal with the actual bytes
- */
- switch (xdrs->x_op) {
-
- case XDR_DECODE:
- if (nodesize == 0) {
- return (TRUE);
- }
- if (sp == NULL)
- *cpp = sp = (char *) mem_alloc(nodesize);
- if (sp == NULL) {
- (void) fprintf(stderr, "xdr_string: out of memory\n");
- return (FALSE);
- }
- sp[size] = 0;
- /* fall into ... */
-
- case XDR_ENCODE:
- return (xdr_opaque(xdrs, sp, size));
-
- case XDR_FREE:
- mem_free(sp, nodesize);
- *cpp = NULL;
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * Wrapper for xdr_string that can be called directly from
- * routines like clnt_call
- */
-bool_t xdr_wrapstring(xdrs, cpp)
-XDR *xdrs;
-char **cpp;
-{
- if (xdr_string(xdrs, cpp, LASTUNSIGNED)) {
- return (TRUE);
- }
- return (FALSE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/xdr_array.c b/mdk-stage1/dietlibc/librpc/xdr_array.c
deleted file mode 100644
index f0c9bbbb3..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_array.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* @(#)xdr_array.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * xdr_array.c, Generic XDR routines impelmentation.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * These are the "non-trivial" xdr primitives used to serialize and de-serialize
- * arrays. See xdr.h for more info on the interface to xdr.
- */
-
-#include <stdio.h>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <string.h>
-
-#define LASTUNSIGNED ((unsigned int)0-1)
-
-
-/*
- * XDR an array of arbitrary elements
- * *addrp is a pointer to the array, *sizep is the number of elements.
- * If addrp is NULL (*sizep * elsize) bytes are allocated.
- * elsize is the size (in bytes) of each element, and elproc is the
- * xdr procedure to call to handle each element of the array.
- */
-bool_t xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
-register XDR *xdrs;
-char* *addrp; /* array pointer */
-unsigned int *sizep; /* number of elements */
-unsigned int maxsize; /* max numberof elements */
-unsigned int elsize; /* size in bytes of each element */
-xdrproc_t elproc; /* xdr routine to handle each element */
-{
- register unsigned int i;
- register char* target = *addrp;
- register unsigned int c; /* the actual element count */
- register bool_t stat = TRUE;
- register unsigned int nodesize;
-
- /* like strings, arrays are really counted arrays */
- if (!xdr_u_int(xdrs, sizep)) {
- return (FALSE);
- }
- c = *sizep;
- if ((c > maxsize) && (xdrs->x_op != XDR_FREE)) {
- return (FALSE);
- }
- /* duh, look for integer overflow (fefe) */
- {
- unsigned int i;
- nodesize = 0;
- for (i=c; i; --i) {
- unsigned int tmp=nodesize+elsize;
- if (tmp<nodesize) /* overflow */
- return FALSE;
- nodesize=tmp;
- }
- }
-
- /*
- * if we are deserializing, we may need to allocate an array.
- * We also save time by checking for a null array if we are freeing.
- */
- if (target == NULL)
- switch (xdrs->x_op) {
- case XDR_DECODE:
- if (c == 0)
- return (TRUE);
- *addrp = target = mem_alloc(nodesize);
- if (target == NULL) {
- (void) fprintf(stderr, "xdr_array: out of memory\n");
- return (FALSE);
- }
- memset(target, 0, nodesize);
- break;
-
- case XDR_FREE:
- return (TRUE);
- }
-
- /*
- * now we xdr each element of array
- */
- for (i = 0; (i < c) && stat; i++) {
- stat = (*elproc) (xdrs, target, LASTUNSIGNED);
- target += elsize;
- }
-
- /*
- * the array may need freeing
- */
- if (xdrs->x_op == XDR_FREE) {
- mem_free(*addrp, nodesize);
- *addrp = NULL;
- }
- return (stat);
-}
-
-/*
- * xdr_vector():
- *
- * XDR a fixed length array. Unlike variable-length arrays,
- * the storage of fixed length arrays is static and unfreeable.
- * > basep: base of the array
- * > size: size of the array
- * > elemsize: size of each element
- * > xdr_elem: routine to XDR each element
- */
-bool_t xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
-register XDR *xdrs;
-register char *basep;
-register unsigned int nelem;
-register unsigned int elemsize;
-register xdrproc_t xdr_elem;
-{
- register unsigned int i;
- register char *elptr;
-
- elptr = basep;
- for (i = 0; i < nelem; i++) {
- if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED)) {
- return (FALSE);
- }
- elptr += elemsize;
- }
- return (TRUE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/xdr_float.c b/mdk-stage1/dietlibc/librpc/xdr_float.c
deleted file mode 100644
index f8eb5e99c..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_float.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/* @(#)xdr_float.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)xdr_float.c 1.12 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * xdr_float.c, Generic XDR routines impelmentation.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * These are the "floating point" xdr routines used to (de)serialize
- * most common data items. See xdr.h for more info on the interface to
- * xdr.
- */
-
-#include <stdio.h>
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-
-/*
- * NB: Not portable.
- * This routine works on Suns (Sky / 68000's) and Vaxen.
- */
-
-#ifdef __linux__
-/* cheat big time */
-#define sparc
-#endif
-
-#ifdef vax
-
-/* What IEEE single precision floating point looks like on a Vax */
-struct ieee_single {
- unsigned int mantissa:23;
- unsigned int exp:8;
- unsigned int sign:1;
-};
-
-/* Vax single precision floating point */
-struct vax_single {
- unsigned int mantissa1:7;
- unsigned int exp:8;
- unsigned int sign:1;
- unsigned int mantissa2:16;
-};
-
-#define VAX_SNG_BIAS 0x81
-#define IEEE_SNG_BIAS 0x7f
-
-static struct sgl_limits {
- struct vax_single s;
- struct ieee_single ieee;
-} sgl_limits[2] = {
- { {
- 0x7f, 0xff, 0x0, 0xffff}, /* Max Vax */
- {
- 0x0, 0xff, 0x0}}, /* Max IEEE */
- { {
- 0x0, 0x0, 0x0, 0x0}, /* Min Vax */
- {
- 0x0, 0x0, 0x0}} /* Min IEEE */
-};
-#endif /* vax */
-
-bool_t xdr_float(xdrs, fp)
-register XDR *xdrs;
-register float *fp;
-{
-#if !defined(mc68000) && !defined(sparc)
- struct ieee_single is;
- struct vax_single vs, *vsp;
- struct sgl_limits *lim;
- int i;
-#endif
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
-#if defined(mc68000) || defined(sparc)
- return (XDR_PUTLONG(xdrs, (long *) fp));
-#else
- vs = *((struct vax_single *) fp);
- for (i = 0, lim = sgl_limits;
-
- i < sizeof(sgl_limits) / sizeof(struct sgl_limits);
- i++, lim++) {
- if ((vs.mantissa2 == lim->s.mantissa2) &&
- (vs.exp == lim->s.exp) &&
- (vs.mantissa1 == lim->s.mantissa1)) {
- is = lim->ieee;
- goto shipit;
- }
- }
- is.exp = vs.exp - VAX_SNG_BIAS + IEEE_SNG_BIAS;
- is.mantissa = (vs.mantissa1 << 16) | vs.mantissa2;
- shipit:
- is.sign = vs.sign;
- return (XDR_PUTLONG(xdrs, (long *) &is));
-#endif
-
- case XDR_DECODE:
-#if defined(mc68000) || defined(sparc)
- return (XDR_GETLONG(xdrs, (long *) fp));
-#else
- vsp = (struct vax_single *) fp;
- if (!XDR_GETLONG(xdrs, (long *) &is))
- return (FALSE);
- for (i = 0, lim = sgl_limits;
-
- i < sizeof(sgl_limits) / sizeof(struct sgl_limits);
- i++, lim++) {
- if ((is.exp == lim->ieee.exp) &&
- (is.mantissa == lim->ieee.mantissa)) {
- *vsp = lim->s;
- goto doneit;
- }
- }
- vsp->exp = is.exp - IEEE_SNG_BIAS + VAX_SNG_BIAS;
- vsp->mantissa2 = is.mantissa;
- vsp->mantissa1 = (is.mantissa >> 16);
- doneit:
- vsp->sign = is.sign;
- return (TRUE);
-#endif
-
- case XDR_FREE:
- return (TRUE);
- }
- return (FALSE);
-}
-
-/*
- * This routine works on Suns (Sky / 68000's) and Vaxen.
- */
-
-#ifdef vax
-/* What IEEE double precision floating point looks like on a Vax */
-struct ieee_double {
- unsigned int mantissa1:20;
- unsigned int exp:11;
- unsigned int sign:1;
- unsigned int mantissa2:32;
-};
-
-/* Vax double precision floating point */
-struct vax_double {
- unsigned int mantissa1:7;
- unsigned int exp:8;
- unsigned int sign:1;
- unsigned int mantissa2:16;
- unsigned int mantissa3:16;
- unsigned int mantissa4:16;
-};
-
-#define VAX_DBL_BIAS 0x81
-#define IEEE_DBL_BIAS 0x3ff
-#define MASK(nbits) ((1 << nbits) - 1)
-
-static struct dbl_limits {
- struct vax_double d;
- struct ieee_double ieee;
-} dbl_limits[2] = {
- { {
- 0x7f, 0xff, 0x0, 0xffff, 0xffff, 0xffff}, /* Max Vax */
- {
- 0x0, 0x7ff, 0x0, 0x0}}, /* Max IEEE */
- { {
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, /* Min Vax */
- {
- 0x0, 0x0, 0x0, 0x0}} /* Min IEEE */
-};
-
-#endif /* vax */
-
-
-bool_t xdr_double(xdrs, dp)
-register XDR *xdrs;
-double *dp;
-{
- register long *lp;
-
-#if !defined(mc68000) && !defined(sparc)
- struct ieee_double id;
- struct vax_double vd;
- register struct dbl_limits *lim;
- int i;
-#endif
-
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
-#if defined(mc68000) || defined(sparc)
- lp = (long *) dp;
-#else
- vd = *((struct vax_double *) dp);
- for (i = 0, lim = dbl_limits;
-
- i < sizeof(dbl_limits) / sizeof(struct dbl_limits);
- i++, lim++) {
- if ((vd.mantissa4 == lim->d.mantissa4) &&
- (vd.mantissa3 == lim->d.mantissa3) &&
- (vd.mantissa2 == lim->d.mantissa2) &&
- (vd.mantissa1 == lim->d.mantissa1) &&
- (vd.exp == lim->d.exp)) {
- id = lim->ieee;
- goto shipit;
- }
- }
- id.exp = vd.exp - VAX_DBL_BIAS + IEEE_DBL_BIAS;
- id.mantissa1 = (vd.mantissa1 << 13) | (vd.mantissa2 >> 3);
- id.mantissa2 = ((vd.mantissa2 & MASK(3)) << 29) |
- (vd.mantissa3 << 13) | ((vd.mantissa4 >> 3) & MASK(13));
- shipit:
- id.sign = vd.sign;
- lp = (long *) &id;
-#endif
- return (XDR_PUTLONG(xdrs, lp++) && XDR_PUTLONG(xdrs, lp));
-
- case XDR_DECODE:
-#if defined(mc68000) || defined(sparc)
- lp = (long *) dp;
- return (XDR_GETLONG(xdrs, lp++) && XDR_GETLONG(xdrs, lp));
-#else
- lp = (long *) &id;
- if (!XDR_GETLONG(xdrs, lp++) || !XDR_GETLONG(xdrs, lp))
- return (FALSE);
- for (i = 0, lim = dbl_limits;
-
- i < sizeof(dbl_limits) / sizeof(struct dbl_limits);
- i++, lim++) {
- if ((id.mantissa2 == lim->ieee.mantissa2) &&
- (id.mantissa1 == lim->ieee.mantissa1) &&
- (id.exp == lim->ieee.exp)) {
- vd = lim->d;
- goto doneit;
- }
- }
- vd.exp = id.exp - IEEE_DBL_BIAS + VAX_DBL_BIAS;
- vd.mantissa1 = (id.mantissa1 >> 13);
- vd.mantissa2 = ((id.mantissa1 & MASK(13)) << 3) |
- (id.mantissa2 >> 29);
- vd.mantissa3 = (id.mantissa2 >> 13);
- vd.mantissa4 = (id.mantissa2 << 3);
- doneit:
- vd.sign = id.sign;
- *dp = *((double *) &vd);
- return (TRUE);
-#endif
-
- case XDR_FREE:
- return (TRUE);
- }
- return (FALSE);
-}
diff --git a/mdk-stage1/dietlibc/librpc/xdr_mem.c b/mdk-stage1/dietlibc/librpc/xdr_mem.c
deleted file mode 100644
index c21121183..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_mem.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * xdr_mem.h, XDR implementation using memory buffers.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * If you have some data to be interpreted as external data representation
- * or to be converted to external data representation in a memory buffer,
- * then this is the package for you.
- *
- */
-
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <limits.h>
-
-static bool_t xdrmem_getlong (XDR *, long *);
-static bool_t xdrmem_putlong (XDR *, const long *);
-static bool_t xdrmem_getbytes (XDR *, char *, unsigned int);
-static bool_t xdrmem_putbytes (XDR *, const char *, unsigned int);
-static unsigned int xdrmem_getpos (const XDR *);
-static bool_t xdrmem_setpos (XDR *, unsigned int);
-static int32_t *xdrmem_inline (XDR *, unsigned int);
-static void xdrmem_destroy (XDR *);
-
-static struct xdr_ops xdrmem_ops = {
- xdrmem_getlong,
- xdrmem_putlong,
- xdrmem_getbytes,
- xdrmem_putbytes,
- xdrmem_getpos,
- xdrmem_setpos,
- xdrmem_inline,
- xdrmem_destroy
-};
-
-
-/*
- * The procedure xdrmem_create initializes a stream descriptor for a
- * memory buffer.
- */
-void
-xdrmem_create (XDR *xdrs, const char* addr, unsigned int size, enum xdr_op op)
-{
- xdrs->x_op = op;
- xdrs->x_ops = &xdrmem_ops;
- xdrs->x_private = xdrs->x_base = (char*)addr;
- xdrs->x_handy = size;
-}
-
-static void
-xdrmem_destroy (XDR *xdrs)
-{
-}
-
-static bool_t
-xdrmem_getlong (XDR *xdrs, long *lp)
-{
- if (xdrs->x_handy < 4) return FALSE;
- xdrs->x_handy -= 4;
-
- *lp = (int32_t) ntohl((*((int32_t *) (xdrs->x_private))));
- xdrs->x_private += 4;
- return TRUE;
-}
-
-static bool_t
-xdrmem_putlong (XDR *xdrs, const long *lp)
-{
- if (xdrs->x_handy < 4) return FALSE;
- xdrs->x_handy -= 4;
-
- *(int32_t *) xdrs->x_private = htonl(*lp);
- xdrs->x_private += 4;
- return (TRUE);
-}
-
-static bool_t
-xdrmem_getbytes (XDR *xdrs, char *addr, unsigned int len)
-{
- if (xdrs->x_handy < len) return FALSE;
- xdrs->x_handy -= len;
- memmove(addr, xdrs->x_private, len);
- xdrs->x_private += len;
- return TRUE;
-}
-
-static bool_t
-xdrmem_putbytes (XDR *xdrs, const char *addr, unsigned int len)
-{
- if (xdrs->x_handy < len) return FALSE;
- xdrs->x_handy -= len;
- memmove(xdrs->x_private, addr, len);
- xdrs->x_private += len;
- return (TRUE);
-}
-
-static unsigned int
-xdrmem_getpos (const XDR *xdrs)
-{
- return ((unsigned long) xdrs->x_private - (unsigned long) xdrs->x_base);
-}
-
-static bool_t xdrmem_setpos(xdrs, pos)
-register XDR *xdrs;
-unsigned int pos;
-{
- register char* newaddr = xdrs->x_base + pos;
- register char* lastaddr = xdrs->x_private + xdrs->x_handy;
-
- if ((long) newaddr > (long) lastaddr
- || (UINT_MAX < LONG_MAX
- && (long) UINT_MAX < (long) lastaddr - (long) newaddr))
- return (FALSE);
- xdrs->x_private = newaddr;
- xdrs->x_handy = (long) lastaddr - (long) newaddr;
- return (TRUE);
-}
-
-static int32_t *
-xdrmem_inline (XDR *xdrs, unsigned int len)
-{
- int32_t *buf = 0;
-
- if (xdrs->x_handy >= len) {
- xdrs->x_handy -= len;
- buf = (int32_t *) xdrs->x_private;
- xdrs->x_private += len;
- }
- return (buf);
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/xdr_rec.c b/mdk-stage1/dietlibc/librpc/xdr_rec.c
deleted file mode 100644
index ab0b6fd8d..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_rec.c
+++ /dev/null
@@ -1,572 +0,0 @@
-/* @(#)xdr_rec.c 2.2 88/08/01 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
- * layer above tcp (for rpc's use).
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * These routines interface XDRSTREAMS to a tcp/ip connection.
- * There is a record marking layer between the xdr stream
- * and the tcp transport level. A record is composed on one or more
- * record fragments. A record fragment is a thirty-two bit header followed
- * by n bytes of data, where n is contained in the header. The header
- * is represented as a htonl(unsigned long). Thegh order bit encodes
- * whether or not the fragment is the last fragment of the record
- * (1 => fragment is last, 0 => more fragments to follow.
- * The other 31 bits encode the byte length of the fragment.
- */
-
-#include <stdio.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <unistd.h>
-
-static unsigned int fix_buf_size (unsigned int);
-
-static bool_t xdrrec_getlong (XDR *, long *);
-static bool_t xdrrec_putlong (XDR *, const long *);
-static bool_t xdrrec_getbytes (XDR *, char *, unsigned int);
-static bool_t xdrrec_putbytes (XDR *, const char *, unsigned int);
-static unsigned int xdrrec_getpos (const XDR *);
-static bool_t xdrrec_setpos (XDR *, unsigned int);
-static int32_t *xdrrec_inline (XDR *, unsigned int);
-static void xdrrec_destroy (XDR *);
-
-static struct xdr_ops xdrrec_ops = {
- xdrrec_getlong,
- xdrrec_putlong,
- xdrrec_getbytes,
- xdrrec_putbytes,
- xdrrec_getpos,
- xdrrec_setpos,
- xdrrec_inline,
- xdrrec_destroy
-};
-
-
-/*
- * A record is composed of one or more record fragments.
- * A record fragment is a two-byte header followed by zero to
- * 2**32-1 bytes. The header is treated as a long unsigned and is
- * encode/decoded to the network via htonl/ntohl. The low order 31 bits
- * are a byte count of the fragment. The highest order bit is a boolean:
- * 1 => this fragment is the last fragment of the record,
- * 0 => this fragment is followed by more fragment(s).
- *
- * The fragment/record machinery is not general; it is constructed to
- * meet the needs of xdr and rpc based on tcp.
- */
-
-#define LAST_FRAG ((unsigned long)(1 << 31))
-
-typedef struct rec_strm {
- char* tcp_handle;
- char* the_buffer;
- /*
- * out-goung bits
- */
- int (*writeit) (char *, char *, int);
- char* out_base; /* output buffer (points to frag header) */
- char* out_finger; /* next output position */
- char* out_boundry; /* data cannot up to this address */
- uint32_t *frag_header; /* beginning of curren fragment */
- bool_t frag_sent; /* true if buffer sent in middle of record */
- /*
- * in-coming bits
- */
- int (*readit) (char *, char *, int);
- unsigned long in_size; /* fixed size of the input buffer */
- char* in_base;
- char* in_finger; /* location of next byte to be had */
- char* in_boundry; /* can read up to this location */
- long fbtbc; /* fragment bytes to be consumed */
- bool_t last_frag;
- unsigned int sendsize;
- unsigned int recvsize;
-} RECSTREAM;
-
-
-/*
- * Create an xdr handle for xdrrec
- * xdrrec_create fills in xdrs. Sendsize and recvsize are
- * send and recv buffer sizes (0 => use default).
- * tcp_handle is an opaque handle that is passed as the first parameter to
- * the procedures readit and writeit. Readit and writeit are read and
- * write respectively. They are like the system
- * calls expect that they take an opaque handle rather than an fd.
- */
-void
-xdrrec_create (XDR *xdrs, unsigned int sendsize,
- unsigned int recvsize, char *tcp_handle,
- int (*readit) (char *, char *, int),
- int (*writeit) (char *, char *, int))
-{
- register RECSTREAM *rstrm = (RECSTREAM *) mem_alloc(sizeof(RECSTREAM));
-
- if (rstrm == NULL) {
- (void) fprintf(stderr, "xdrrec_create: out of memory\n");
- /*
- * This is bad. Should rework xdrrec_create to
- * return a handle, and in this case return NULL
- */
- return;
- }
- /*
- * adjust sizes and allocate buffer quad byte aligned
- */
- rstrm->sendsize = sendsize = fix_buf_size(sendsize);
- rstrm->recvsize = recvsize = fix_buf_size(recvsize);
- rstrm->the_buffer =
- mem_alloc(sendsize + recvsize + BYTES_PER_XDR_UNIT);
- if (rstrm->the_buffer == NULL) {
- (void) fprintf(stderr, "xdrrec_create: out of memory\n");
- return;
- }
- for (rstrm->out_base = rstrm->the_buffer;
- (unsigned long) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
- rstrm->out_base++);
- rstrm->in_base = rstrm->out_base + sendsize;
- /*
- * now the rest ...
- */
- xdrs->x_ops = &xdrrec_ops;
- xdrs->x_private = (char*) rstrm;
- rstrm->tcp_handle = tcp_handle;
- rstrm->readit = readit;
- rstrm->writeit = writeit;
- rstrm->out_finger = rstrm->out_boundry = rstrm->out_base;
- rstrm->frag_header = (uint32_t *) rstrm->out_base;
- rstrm->out_finger += 4;
- rstrm->out_boundry += sendsize;
- rstrm->frag_sent = FALSE;
- rstrm->in_size = recvsize;
- rstrm->in_boundry = rstrm->in_base;
- rstrm->in_finger = (rstrm->in_boundry += recvsize);
- rstrm->fbtbc = 0;
- rstrm->last_frag = TRUE;
-}
-
-
-/*
- * The reoutines defined below are the xdr ops which will go into the
- * xdr handle filled in by xdrrec_create.
- */
-
-static bool_t
-xdrrec_getlong (XDR *xdrs, long *lp)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
- register int32_t *buflp = (int32_t *) (rstrm->in_finger);
- int32_t mylong;
-
- /* first try the inline, fast case */
- if ((rstrm->fbtbc >= BYTES_PER_XDR_UNIT) &&
- ((rstrm->in_boundry - (char *) buflp) >= BYTES_PER_XDR_UNIT)) {
- *lp = (int32_t) ntohl(*buflp);
- rstrm->fbtbc -= BYTES_PER_XDR_UNIT;
- rstrm->in_finger += BYTES_PER_XDR_UNIT;
- } else {
- if (!xdrrec_getbytes(xdrs, (char*) & mylong, BYTES_PER_XDR_UNIT))
- return (FALSE);
-
- *lp = (int32_t) ntohl(mylong);
- }
- return (TRUE);
-}
-
-/*
- * Internal useful routines
- */
-static bool_t flush_out(RECSTREAM* rstrm, bool_t eor)
-{
- register unsigned long eormask = (eor == TRUE) ? LAST_FRAG : 0;
- register unsigned long len = (rstrm->out_finger
- - (char *) rstrm->frag_header
- - BYTES_PER_XDR_UNIT);
-
- *(rstrm->frag_header) = htonl(len | eormask);
- len = rstrm->out_finger - rstrm->out_base;
- if ((*(rstrm->writeit)) (rstrm->tcp_handle, rstrm->out_base, (int) len)
- != (int) len)
- return (FALSE);
- rstrm->frag_header = (uint32_t *) rstrm->out_base;
- rstrm->out_finger = (char*) rstrm->out_base + BYTES_PER_XDR_UNIT;
- return (TRUE);
-}
-
-static bool_t
-/* knows nothing about records! Only about input buffers */
-fill_input_buf(rstrm)
-register RECSTREAM *rstrm;
-{
- register char* where;
- unsigned int i;
- register int len;
-
- where = rstrm->in_base;
- i = (unsigned long) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
- where += i;
- len = rstrm->in_size - i;
- if ((len = (*(rstrm->readit)) (rstrm->tcp_handle, where, len)) == -1)
- return (FALSE);
- rstrm->in_finger = where;
- where += len;
- rstrm->in_boundry = where;
- return (TRUE);
-}
-
-static bool_t
-/* knows nothing about records! Only about input buffers */
-get_input_bytes(rstrm, addr, len)
-register RECSTREAM *rstrm;
-register char* addr;
-register int len;
-{
- register int current;
-
- while (len > 0) {
- current = rstrm->in_boundry - rstrm->in_finger;
- if (current == 0) {
- if (!fill_input_buf(rstrm))
- return (FALSE);
- continue;
- }
- current = (len < current) ? len : current;
- memmove(addr, rstrm->in_finger, current);
- rstrm->in_finger += current;
- addr += current;
- len -= current;
- }
- return (TRUE);
-}
-
-static bool_t
-/* next two bytes of the input stream are treated as a header */
-set_input_fragment(rstrm)
-register RECSTREAM *rstrm;
-{
- uint32_t header;
-
- if (!get_input_bytes(rstrm, (char*) & header, sizeof(header)))
- return (FALSE);
- header = ntohl(header);
- rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE;
- /*
- * Sanity check. Try not to accept wildly incorrect fragment
- * sizes. Unfortunately, only a size of zero can be identified as
- * 'wildely incorrect', and this only, if it is not the last
- * fragment of a message. Ridiculously large fragment sizes may look
- * wrong, but we don't have any way to be certain that they aren't
- * what the client actually intended to send us. Many existing RPC
- * implementations may sent a fragment of size zero as the last
- * fragment of a message.
- */
- if (header == 0)
- return FALSE;
- rstrm->fbtbc = header & (~LAST_FRAG);
- return (TRUE);
-}
-
-static bool_t
-/* consumes input bytes; knows nothing about records! */
-skip_input_bytes(rstrm, cnt)
-register RECSTREAM *rstrm;
-long cnt;
-{
- register int current;
-
- while (cnt > 0) {
- current = rstrm->in_boundry - rstrm->in_finger;
- if (current == 0) {
- if (!fill_input_buf(rstrm))
- return (FALSE);
- continue;
- }
- current = (cnt < current) ? cnt : current;
- rstrm->in_finger += current;
- cnt -= current;
- }
- return (TRUE);
-}
-
-static unsigned int
-fix_buf_size (unsigned int s)
-{
-
- if (s < 100)
- s = 4000;
- return (RNDUP(s));
-}
-
-static bool_t
-xdrrec_putlong (XDR *xdrs, const long *lp)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
- register int32_t *dest_lp = (int32_t *) rstrm->out_finger;
-
- if ((rstrm->out_finger += BYTES_PER_XDR_UNIT) > rstrm->out_boundry) {
- /*
- * this case should almost never happen so the code is
- * inefficient
- */
- rstrm->out_finger -= BYTES_PER_XDR_UNIT;
-
- rstrm->frag_sent = TRUE;
- if (!flush_out(rstrm, FALSE))
- return (FALSE);
- dest_lp = ((int32_t *) (rstrm->out_finger));
- rstrm->out_finger += BYTES_PER_XDR_UNIT;
- }
- *dest_lp = htonl(*lp);
- return (TRUE);
-}
-
-static bool_t /* must manage buffers, fragments, and records */
-xdrrec_getbytes (XDR *xdrs, char *addr, unsigned int len)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
- register unsigned int current;
-
- while (len > 0) {
- current = rstrm->fbtbc;
- if (current == 0) {
- if (rstrm->last_frag)
- return (FALSE);
- if (!set_input_fragment(rstrm))
- return (FALSE);
- continue;
- }
- current = (len < current) ? len : current;
- if (!get_input_bytes(rstrm, addr, current))
- return (FALSE);
- addr += current;
- rstrm->fbtbc -= current;
- len -= current;
- }
- return (TRUE);
-}
-
-static bool_t
-xdrrec_putbytes (XDR *xdrs, const char *addr, unsigned int len)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
- register unsigned int current;
-
- while (len > 0) {
- current = rstrm->out_boundry - rstrm->out_finger;
- current = (len < current) ? len : current;
- memmove(rstrm->out_finger, addr, current);
- rstrm->out_finger += current;
- addr += current;
- len -= current;
- if (rstrm->out_finger == rstrm->out_boundry) {
- rstrm->frag_sent = TRUE;
- if (!flush_out(rstrm, FALSE))
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-static unsigned int
-xdrrec_getpos (const XDR *xdrs)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
- register long pos;
-
- pos = lseek((int)((long) rstrm->tcp_handle), (long) 0, 1);
- if (pos != -1)
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- pos += rstrm->out_finger - rstrm->out_base;
- break;
-
- case XDR_DECODE:
- pos -= rstrm->in_boundry - rstrm->in_finger;
- break;
-
- default:
- pos = (unsigned int) - 1;
- break;
- }
- return ((unsigned int) pos);
-}
-
-static bool_t
-xdrrec_setpos (XDR *xdrs, unsigned int pos)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
- unsigned int currpos = xdrrec_getpos(xdrs);
- int delta = currpos - pos;
- char* newpos;
-
- if ((int) currpos != -1)
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- newpos = rstrm->out_finger - delta;
- if ((newpos > (char*) (rstrm->frag_header)) &&
- (newpos < rstrm->out_boundry)) {
- rstrm->out_finger = newpos;
- return (TRUE);
- }
- break;
-
- case XDR_DECODE:
- newpos = rstrm->in_finger - delta;
- if ((delta < (int) (rstrm->fbtbc)) &&
- (newpos <= rstrm->in_boundry) &&
- (newpos >= rstrm->in_base)) {
- rstrm->in_finger = newpos;
- rstrm->fbtbc -= delta;
- return (TRUE);
- }
- break;
- }
- return (FALSE);
-}
-
-static int32_t *xdrrec_inline(XDR* xdrs, unsigned int len)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
- int32_t *buf = NULL;
-
- switch (xdrs->x_op) {
-
- case XDR_ENCODE:
- if ((rstrm->out_finger + len) <= rstrm->out_boundry) {
- buf = (int32_t *) rstrm->out_finger;
- rstrm->out_finger += len;
- }
- break;
-
- case XDR_DECODE:
- if ((len <= rstrm->fbtbc) &&
- ((rstrm->in_finger + len) <= rstrm->in_boundry)) {
- buf = (int32_t *) rstrm->in_finger;
- rstrm->fbtbc -= len;
- rstrm->in_finger += len;
- }
- break;
- }
- return (buf);
-}
-
-static void
-xdrrec_destroy (XDR *xdrs)
-{
- register RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
-
- mem_free(rstrm->the_buffer,
- rstrm->sendsize + rstrm->recvsize + BYTES_PER_XDR_UNIT);
- mem_free((char*) rstrm, sizeof(RECSTREAM));
-}
-
-
-/*
- * Exported routines to manage xdr records
- */
-
-/*
- * Before reading (deserializing from the stream, one should always call
- * this procedure to guarantee proper record alignment.
- */
-bool_t xdrrec_skiprecord(xdrs)
-XDR *xdrs;
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
-
- while (rstrm->fbtbc > 0 || (!rstrm->last_frag)) {
- if (!skip_input_bytes(rstrm, rstrm->fbtbc))
- return (FALSE);
- rstrm->fbtbc = 0;
- if ((!rstrm->last_frag) && (!set_input_fragment(rstrm)))
- return (FALSE);
- }
- rstrm->last_frag = FALSE;
- return (TRUE);
-}
-
-/*
- * Look ahead fuction.
- * Returns TRUE iff there is no more input in the buffer
- * after consuming the rest of the current record.
- */
-bool_t xdrrec_eof(xdrs)
-XDR *xdrs;
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
-
- while (rstrm->fbtbc > 0 || (!rstrm->last_frag)) {
- if (!skip_input_bytes(rstrm, rstrm->fbtbc))
- return (TRUE);
- rstrm->fbtbc = 0;
- if ((!rstrm->last_frag) && (!set_input_fragment(rstrm)))
- return (TRUE);
- }
- if (rstrm->in_finger == rstrm->in_boundry)
- return (TRUE);
- return (FALSE);
-}
-
-/*
- * The client must tell the package when an end-of-record has occurred.
- * The second paraemters tells whether the record should be flushed to the
- * (output) tcp stream. (This let's the package support batched or
- * pipelined procedure calls.) TRUE => immmediate flush to tcp connection.
- */
-bool_t xdrrec_endofrecord(xdrs, sendnow)
-XDR *xdrs;
-bool_t sendnow;
-{
- register RECSTREAM *rstrm = (RECSTREAM *) (xdrs->x_private);
- register unsigned long len; /* fragment length */
-
- if (sendnow || rstrm->frag_sent ||
- (rstrm->out_finger + BYTES_PER_XDR_UNIT >= rstrm->out_boundry)) {
- rstrm->frag_sent = FALSE;
- return (flush_out(rstrm, TRUE));
- }
- len = rstrm->out_finger - (char *)rstrm->frag_header -
- BYTES_PER_XDR_UNIT;
- *(rstrm->frag_header) = htonl((unsigned long) len | LAST_FRAG);
- rstrm->frag_header = (uint32_t *) rstrm->out_finger;
- rstrm->out_finger += BYTES_PER_XDR_UNIT;
- return (TRUE);
-}
-
diff --git a/mdk-stage1/dietlibc/librpc/xdr_reference.c b/mdk-stage1/dietlibc/librpc/xdr_reference.c
deleted file mode 100644
index 3e42d12f3..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_reference.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* @(#)xdr_reference.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
-#endif
-
-/*
- * xdr_reference.c, Generic XDR routines impelmentation.
- *
- * Copyright (C) 1987, Sun Microsystems, Inc.
- *
- * These are the "non-trivial" xdr primitives used to serialize and de-serialize
- * "pointers". See xdr.h for more info on the interface to xdr.
- */
-
-#include <stdio.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
-#include <string.h>
-
-#define LASTUNSIGNED ((unsigned int)0-1)
-
-/*
- * XDR an indirect pointer
- * xdr_reference is for recursively translating a structure that is
- * referenced by a pointer inside the structure that is currently being
- * translated. pp references a pointer to storage. If *pp is null
- * the necessary storage is allocated.
- * size is the sizeof the referneced structure.
- * proc is the routine to handle the referenced structure.
- */
-bool_t xdr_reference(xdrs, pp, size, proc)
-register XDR *xdrs;
-char* *pp; /* the pointer to work on */
-unsigned int size; /* size of the object pointed to */
-xdrproc_t proc; /* xdr routine to handle the object */
-{
- register char* loc = *pp;
- register bool_t stat;
-
- if (loc == NULL)
- switch (xdrs->x_op) {
- case XDR_FREE:
- return (TRUE);
-
- case XDR_DECODE:
- *pp = loc = (char*) mem_alloc(size);
- if (loc == NULL) {
- (void) fprintf(stderr, "xdr_reference: out of memory\n");
- return (FALSE);
- }
- memset(loc, 0, (int) size);
- break;
- }
-
- stat = (*proc) (xdrs, loc, LASTUNSIGNED);
-
- if (xdrs->x_op == XDR_FREE) {
- mem_free(loc, size);
- *pp = NULL;
- }
- return (stat);
-}
-
-
-/*
- * xdr_pointer():
- *
- * XDR a pointer to a possibly recursive data structure. This
- * differs with xdr_reference in that it can serialize/deserialiaze
- * trees correctly.
- *
- * What's sent is actually a union:
- *
- * union object_pointer switch (boolean b) {
- * case TRUE: object_data data;
- * case FALSE: void nothing;
- * }
- *
- * > objpp: Pointer to the pointer to the object.
- * > obj_size: size of the object.
- * > xdr_obj: routine to XDR an object.
- *
- */
-bool_t xdr_pointer(xdrs, objpp, obj_size, xdr_obj)
-register XDR *xdrs;
-char **objpp;
-unsigned int obj_size;
-xdrproc_t xdr_obj;
-{
-
- bool_t more_data;
-
- more_data = (*objpp != NULL);
- if (!xdr_bool(xdrs, &more_data)) {
- return (FALSE);
- }
- if (!more_data) {
- *objpp = NULL;
- return (TRUE);
- }
- return (xdr_reference(xdrs, objpp, obj_size, xdr_obj));
-}
diff --git a/mdk-stage1/dietlibc/librpc/xdr_stdio.c b/mdk-stage1/dietlibc/librpc/xdr_stdio.c
deleted file mode 100644
index 405cc6a69..000000000
--- a/mdk-stage1/dietlibc/librpc/xdr_stdio.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* @(#)xdr_stdio.c 2.1 88/07/29 4.0 RPCSRC */
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-#if !defined(lint) && defined(SCCSIDS)
-static char sccsid[] =
-
- "@(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro";
-#endif
-
-/*
- * xdr_stdio.c, XDR implementation on standard i/o file.
- *
- * Copyright (C) 1984, Sun Microsystems, Inc.
- *
- * This set of routines implements a XDR on a stdio stream.
- * XDR_ENCODE serializes onto the stream, XDR_DECODE de-serializes
- * from the stream.
- */
-
-#include <rpc/types.h>
-#include <stdio.h>
-#include <rpc/xdr.h>
-
-static bool_t xdrstdio_getlong();
-static bool_t xdrstdio_putlong();
-static bool_t xdrstdio_getbytes();
-static bool_t xdrstdio_putbytes();
-static unsigned int xdrstdio_getpos();
-static bool_t xdrstdio_setpos();
-static int32_t *xdrstdio_inline();
-static void xdrstdio_destroy();
-
-/*
- * Ops vector for stdio type XDR
- */
-static struct xdr_ops xdrstdio_ops = {
- xdrstdio_getlong, /* deseraialize a long int */
- xdrstdio_putlong, /* seraialize a long int */
- xdrstdio_getbytes, /* deserialize counted bytes */
- xdrstdio_putbytes, /* serialize counted bytes */
- xdrstdio_getpos, /* get offset in the stream */
- xdrstdio_setpos, /* set offset in the stream */
- xdrstdio_inline, /* prime stream for inline macros */
- xdrstdio_destroy /* destroy stream */
-};
-
-
-/*
- * Initialize a stdio xdr stream.
- * Sets the xdr stream handle xdrs for use on the stream file.
- * Operation flag is set to op.
- */
-void xdrstdio_create(xdrs, file, op)
-register XDR *xdrs;
-FILE *file;
-enum xdr_op op;
-{
-
- xdrs->x_op = op;
- xdrs->x_ops = &xdrstdio_ops;
- xdrs->x_private = (char*) file;
- xdrs->x_handy = 0;
- xdrs->x_base = 0;
-}
-
-/*
- * Destroy a stdio xdr stream.
- * Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create.
- */
-static void xdrstdio_destroy(xdrs)
-register XDR *xdrs;
-{
- (void) fflush((FILE *) xdrs->x_private);
- /* xx should we close the file ?? */
-};
-
-static bool_t xdrstdio_getlong(xdrs, lp)
-XDR *xdrs;
-register long *lp;
-{
-
- if (fread((char*) lp, sizeof(long), 1, (FILE *) xdrs->x_private) !=
- 1) return (FALSE);
-
-#ifndef mc68000
- *lp = ntohl(*lp);
-#endif
- return (TRUE);
-}
-
-static bool_t xdrstdio_putlong(xdrs, lp)
-XDR *xdrs;
-long *lp;
-{
-
-#ifndef mc68000
- long mycopy = htonl(*lp);
-
- lp = &mycopy;
-#endif
- if (fwrite((char*) lp, sizeof(long), 1, (FILE *) xdrs->x_private) !=
- 1) return (FALSE);
-
- return (TRUE);
-}
-
-static bool_t xdrstdio_getbytes(xdrs, addr, len)
-XDR *xdrs;
-char* addr;
-unsigned int len;
-{
-
- if ((len != 0)
- && (fread(addr, (int) len, 1, (FILE *) xdrs->x_private) != 1))
- return (FALSE);
- return (TRUE);
-}
-
-static bool_t xdrstdio_putbytes(xdrs, addr, len)
-XDR *xdrs;
-char* addr;
-unsigned int len;
-{
-
- if ((len != 0)
- && (fwrite(addr, (int) len, 1, (FILE *) xdrs->x_private) != 1))
- return (FALSE);
- return (TRUE);
-}
-
-static unsigned int xdrstdio_getpos(xdrs)
-XDR *xdrs;
-{
-
- return ((unsigned int) ftell((FILE *) xdrs->x_private));
-}
-
-static bool_t xdrstdio_setpos(xdrs, pos)
-XDR *xdrs;
-unsigned int pos;
-{
-
- return ((fseek((FILE *) xdrs->x_private, (long) pos, 0) < 0) ?
- FALSE : TRUE);
-}
-
-static int32_t *xdrstdio_inline(XDR* xdrs, unsigned int len)
-{
-
- /*
- * Must do some work to implement this: must insure
- * enough data in the underlying stdio buffer,
- * that the buffer is aligned so that we can indirect through a
- * long *, and stuff this pointer in xdrs->x_buf. Doing
- * a fread or fwrite to a scratch buffer would defeat
- * most of the gains to be had here and require storage
- * management on this buffer, so we don't do this.
- */
- return (NULL);
-}
-
diff --git a/mdk-stage1/dietlibc/libshell/basename.c b/mdk-stage1/dietlibc/libshell/basename.c
deleted file mode 100644
index fbf5b2478..000000000
--- a/mdk-stage1/dietlibc/libshell/basename.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <string.h>
-#include <libgen.h>
-
-/*
- path dirname basename
- "/usr/lib" "/usr" "lib"
- "/usr/" "/" "usr"
- "usr" "." "usr"
- "/" "/" "/"
- "." "." "."
- ".." "." ".."
-*/
-
-char *basename(char *path) {
- char *c;
-again:
- if (!(c=strrchr(path,'/'))) return path;
- if (c[1]==0) {
- if (c == path)
- return c;
- else {
- *c=0;
- goto again;
- }
- }
- return c+1;
-}
diff --git a/mdk-stage1/dietlibc/libshell/dirname.c b/mdk-stage1/dietlibc/libshell/dirname.c
deleted file mode 100644
index d35e6ea62..000000000
--- a/mdk-stage1/dietlibc/libshell/dirname.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <string.h>
-#include <libgen.h>
-
-/*
- path dirname basename
- "/usr/lib" "/usr" "lib"
- "/usr/" "/" "usr"
- "usr" "." "usr"
- "/" "/" "/"
- "." "." "."
- ".." "." ".."
-*/
-
-char *dirname(char *path) {
- char *c;
-again:
- if (!(c=strrchr(path,'/'))) return ".";
- while (c[1]==0) { /* remove trailing slashes */
- if (c==path) return c; /* unless path=='/' */
- *c=0;
- if (*--c!='/') break;
- }
- if (*c=='/') { if (c!=path) *c=0; return path; }
- goto again;
-}
diff --git a/mdk-stage1/dietlibc/libshell/fnmatch.c b/mdk-stage1/dietlibc/libshell/fnmatch.c
deleted file mode 100644
index ef43735f6..000000000
--- a/mdk-stage1/dietlibc/libshell/fnmatch.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <ctype.h>
-#include <fnmatch.h>
-#include <string.h>
-
-#define NOTFIRST 128
-
-static int match(char c,char d,int flags) {
- if (flags&FNM_CASEFOLD)
- return (tolower(c)==tolower(d));
- else
- return (c==d);
-}
-
-int fnmatch(const char *pattern, const char *string, int flags) {
- /*printf("fnmatch(\"%s\",\"%s\")\n",pattern,string);*/
- if (*string==0) {
- while (*pattern=='*') ++pattern;
- return (!!*pattern);
- }
- if (*string=='.' && *pattern!='.' && (flags&FNM_PERIOD)) {
- /* don't match if FNM_PERIOD and this is the first char */
- if ((flags&FNM_PERIOD) && (!(flags&NOTFIRST)))
- return FNM_NOMATCH;
- /* don't match if FNM_PERIOD and FNM_FILE_NAME and previous was '/' */
- if ((flags&(FNM_FILE_NAME|FNM_PERIOD)) && string[-1]=='/')
- return FNM_NOMATCH;
- }
- flags|=NOTFIRST;
- switch (*pattern) {
- case '[':
- {
- int neg=0;
- ++pattern;
- if (*string=='/' && flags&FNM_PATHNAME) return FNM_NOMATCH;
- if (*pattern=='^') { neg=1; ++pattern; }
- while (*pattern && *pattern!=']') {
- int res=0;
- if (pattern[1]=='-') {
- if (*string>=*pattern && *string<=pattern[2]) res=1;
- if (flags&FNM_CASEFOLD) {
- if (tolower(*string)>=tolower(*pattern) && tolower(*string)<=tolower(pattern[2])) res=1;
- }
- pattern+=3;
- } else {
- res=match(*pattern,*string,flags);
- ++pattern;
- }
- if (res ^ neg) {
- while (*pattern && *pattern!=']') ++pattern;
- return fnmatch(pattern+1,string+1,flags);
- }
- }
- }
- break;
- case '\\':
- if (flags&FNM_NOESCAPE) {
- if (*string=='\\')
- return fnmatch(pattern+1,string+1,flags);
- } else {
- if (*string==pattern[1])
- return fnmatch(pattern+2,string+1,flags);
- }
- break;
- case '*':
- if ((*string=='/' && flags&FNM_PATHNAME) || fnmatch(pattern,string+1,flags))
- return fnmatch(pattern+1,string,flags);
- return 0;
- case 0:
- if (*string==0 || (*string=='/' && (flags&FNM_LEADING_DIR)))
- return 0;
- break;
- default:
- if (match(*pattern,*string,flags))
- return fnmatch(pattern+1,string+1,flags);
- break;
- }
- return FNM_NOMATCH;
-}
diff --git a/mdk-stage1/dietlibc/libshell/glob.c b/mdk-stage1/dietlibc/libshell/glob.c
deleted file mode 100644
index def55f8dc..000000000
--- a/mdk-stage1/dietlibc/libshell/glob.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * dietlibc/libshell/glob.c
- *
- * Copyright 2001 Guillaume Cottenceau <gc@mandrakesoft.com>
- *
- * This is free software, licensed under the Gnu General Public License.
- *
- */
-
-/*
- * unsupported: GLOB_BRACE GLOB_ALTDIRFUNC GLOB_MAGCHAR
- */
-
-#define DEBUG(x)
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <assert.h>
-#include <fnmatch.h>
-#include <dirent.h>
-#include <pwd.h>
-#include "dietfeatures.h"
-
-#include <glob.h>
-
-
-
-/* If i18n, should be using strcoll */
-static int cmp_func(const void * a, const void * b)
-{
- const char *const s1 = *(const char *const * const) a;
- const char *const s2 = *(const char *const * const) b;
- if (s1 == NULL)
- return 1;
- if (s2 == NULL)
- return -1;
- return strcoll(s1, s2);
-}
-
-
-/* Like `glob', but PATTERN is a final pathname component,
- and matches are searched for in DIRECTORY.
- The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
- The GLOB_APPEND flag is assumed to be set (always appends).
- Prepends DIRECTORY in constructed PGLOB. */
-static void close_dir_keep_errno(DIR* dp) {
- int save = errno;
- if (dp)
- closedir (dp);
- errno=save;
-}
-
-static int add_entry(const char* name,glob_t *pglob,int* nfound) {
- pglob->gl_pathv = (char **) realloc(pglob->gl_pathv,
- (pglob->gl_pathc + pglob->gl_offs + 2)
- * sizeof (char *));
- if (pglob->gl_pathv == NULL)
- return 1;
- pglob->gl_pathv[pglob->gl_offs + pglob->gl_pathc] = strdup(name);
- pglob->gl_pathv[pglob->gl_offs + pglob->gl_pathc + 1] = NULL;
- pglob->gl_pathc++;
- (*nfound)++;
- return 0;
-}
-
-static void build_fullname(char * fullname, const char * directory, const char * filename) {
- char *dest=fullname;
- if (directory[0]=='/' && !directory[1]) {
- *dest='/'; ++dest;
- } else if (directory[0]!='.' || directory[1]) {
- strcpy(dest,directory);
- dest=strchr(dest,0);
- *dest='/'; ++dest;
- }
- strcpy(dest,filename);
-}
-
-static int glob_in_dir(const char *pattern, const char *directory, int flags,
- int errfunc(const char * epath, int eerrno),
- glob_t *pglob)
-{
- DIR *dp = opendir(directory);
- int nfound = 0;
-
- int i;
- char * ptr;
-
- if (!dp) {
- if (errno != ENOTDIR
- && ((errfunc != NULL && (*errfunc) (directory, errno))
- || (flags & GLOB_ERR)))
- return GLOB_ABORTED;
- } else {
- int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
- | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
- struct dirent *ep;
- while ((ep = readdir(dp))) {
- i = strlen(directory) + strlen(ep->d_name) + 2;
- ptr = (char *) alloca(i);
- build_fullname(ptr, directory, ep->d_name);
- if (flags & GLOB_ONLYDIR) {
- struct stat statr;
- if (stat(ptr, &statr) || !S_ISDIR(statr.st_mode))
- continue;
- }
- if (fnmatch(pattern, ep->d_name, fnm_flags) == 0)
- if (add_entry(ptr,pglob,&nfound))
- goto memory_error;
- }
- }
-
- close_dir_keep_errno(dp);
-
- if (nfound != 0)
- pglob->gl_flags = flags;
- else if (flags & GLOB_NOCHECK) {
- /* nfound == 0 */
- i = strlen(directory) + strlen(pattern) + 2;
- ptr = (char *) alloca(i);
- build_fullname(ptr, directory, pattern);
- if (add_entry(ptr,pglob,&nfound))
- goto memory_error;
- }
-
- return (nfound == 0) ? GLOB_NOMATCH : 0;
-
- memory_error:
- /* We're in trouble since we can't free the already allocated memory. [allocated from strdup(filame)]
- * Well, after all, when malloc returns NULL we're already in a bad mood, and no doubt the
- * program will manage to segfault by itself very soon :-). */
- close_dir_keep_errno(dp);
- return GLOB_NOSPACE;
-}
-
-
-
-int glob(const char *pattern, int flags, int errfunc(const char * epath, int eerrno), glob_t *pglob)
-{
- char * pattern_;
- char * filename;
- char * dirname;
- size_t oldcount;
- struct stat statr;
-
- size_t i; /* tmp variables are declared here to save a bit of object space */
- int j, k; /* */
- char * ptr, * ptr2;
-
- if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) {
- errno=EINVAL;
- return -1;
- }
-
- if (!(flags & GLOB_DOOFFS))
- pglob->gl_offs = 0;
-
-
- /* Duplicate pattern so I can make modif to it later (to handle
- TILDE stuff replacing old contents, and to null-terminate the
- directory) */
- pattern_ = alloca(strlen(pattern) + 1);
- strcpy(pattern_, pattern);
-
- /* Check for TILDE stuff */
- if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern_[0] == '~') {
- char * home_dir = NULL;
- if (pattern_[1] == '\0' || pattern_[1] == '/') {
- /* She's asking for ~, her homedir */
- home_dir = getenv("HOME");
- } else {
- /* She's asking for another one's homedir */
- struct passwd * p;
- ptr2 = alloca(strlen(pattern_) + 1);
- strcpy(ptr2, pattern_ + 1);
- ptr = strchr(ptr2, '/');
- if (ptr != NULL)
- *ptr = '\0';
- if (((p = getpwnam(ptr2)) != NULL))
- home_dir = p->pw_dir;
- }
- if (home_dir != NULL) {
- i = strlen(home_dir) + strlen(pattern_); /* pessimistic (the ~ case) */
- ptr = alloca(i);
- strncpy(ptr, home_dir, i);
- ptr2 = pattern_ + 1;
- while (*ptr2 != '/' && *ptr2 != '\0')
- ptr2++;
- strncat(ptr, ptr2, i);
- pattern_ = ptr;
- } else if (flags & GLOB_TILDE_CHECK)
- return GLOB_NOMATCH;
- }
-
- /* Find the filename */
- filename = strrchr(pattern_, '/');
-
- if (filename == NULL) {
- /* We have no '/' in the pattern */
- filename = pattern_;
- dirname = (char*)".";
- } else if (filename == pattern_) {
- /* "/pattern". */
- dirname = (char*)"/";
- filename++;
- } else {
- dirname = pattern_;
- filename++;
- /* allow dirname to be null terminated */
- *(filename-1) = '\0';
-
- if (filename[0] == '\0' && strcmp(pattern_, "/")) {
- /* "pattern/". Expand "pattern", appending slashes. */
- j = glob(dirname, flags | GLOB_MARK, errfunc, pglob);
- if (j == 0)
- pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
- | (flags & GLOB_MARK));
- return j;
- }
- }
-
-
- /* Reserve memory for pglob */
- if (!(flags & GLOB_APPEND)) {
- pglob->gl_pathc = 0;
- if (!(flags & GLOB_DOOFFS))
- pglob->gl_pathv = NULL;
- else {
- pglob->gl_pathv = (char **) malloc((pglob->gl_offs + 1) * sizeof (char *));
- if (pglob->gl_pathv == NULL)
- return GLOB_NOSPACE;
- for (i = 0; i <= pglob->gl_offs; i++)
- pglob->gl_pathv[i] = NULL;
- }
- }
-
-
- oldcount = pglob->gl_pathc + pglob->gl_offs;
-
-
- /* Begin real work */
- if (!strcmp(dirname, "/") || !strcmp(dirname, ".")
- || (!strchr(dirname, '*') && !strchr(dirname, '?') && !strchr(dirname, '['))) {
- /* Approx of a terminal state, glob directly in dir. */
- j = glob_in_dir(filename, dirname, flags, errfunc, pglob);
- if (j != 0)
- return j;
- } else {
- /* We are not in a terminal state, so we have to glob for
- the directory, and then glob for the pattern in each
- directory found. */
- glob_t dirs;
-
- j = glob(dirname, ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ALTDIRFUNC))
- | GLOB_NOSORT | GLOB_ONLYDIR),
- errfunc, &dirs);
- if (j != 0)
- return j;
-
- /* We have successfully globbed the directory name.
- For each name we found, call glob_in_dir on it and FILENAME,
- appending the results to PGLOB. */
- for (i = 0; i < dirs.gl_pathc; i++) {
- j = glob_in_dir(filename, dirs.gl_pathv[i], ((flags | GLOB_APPEND) & ~GLOB_NOCHECK),
- errfunc, pglob);
- if (j == GLOB_NOMATCH)
- /* No matches in this directory. Try the next. */
- continue;
- if (j != 0) {
- globfree(&dirs);
- globfree(pglob);
- return j;
- }
- }
-
- /* We have ignored the GLOB_NOCHECK flag in the `glob_in_dir' calls.
- But if we have not found any matching entry and the GLOB_NOCHECK
- flag was set we must return the list consisting of the disrectory
- names followed by the filename. */
- if (pglob->gl_pathc + pglob->gl_offs == oldcount)
- {
- /* No matches. */
- if (flags & GLOB_NOCHECK)
- {
- for (i = 0; i < dirs.gl_pathc; i++) {
- if (stat(dirs.gl_pathv[i], &statr) || !S_ISDIR(statr.st_mode))
- continue;
-
- /* stat is okay, we will add the entry, but before let's resize the pathv */
- j = pglob->gl_pathc + pglob->gl_offs;
- pglob->gl_pathv = (char **) realloc(pglob->gl_pathv, (j + 2) * sizeof (char *));
- if (pglob->gl_pathv == NULL) {
- globfree (&dirs);
- return GLOB_NOSPACE;
- }
-
- /* okay now we add the new entry */
- k = strlen(dirs.gl_pathv[i]) + strlen(filename) + 2;
- if ((pglob->gl_pathv[j] = malloc(k)) == NULL) {
- globfree(&dirs);
- globfree(pglob);
- return GLOB_NOSPACE;
- }
- build_fullname(pglob->gl_pathv[j], dirs.gl_pathv[i], filename);
- pglob->gl_pathc++;
- pglob->gl_pathv[j+1] = NULL;
- }
- } else {
- globfree(&dirs);
- return GLOB_NOMATCH;
- }
- }
-
- globfree (&dirs);
- }
-
-
- if (flags & GLOB_MARK) {
- for (i = oldcount; i < pglob->gl_pathc + pglob->gl_offs; i++)
- if (!stat(pglob->gl_pathv[i], &statr) && S_ISDIR(statr.st_mode)) {
- size_t len = strlen(pglob->gl_pathv[i]) + 2;
- ptr = realloc(pglob->gl_pathv[i], len);
- if (ptr == NULL) {
- globfree(pglob);
- return GLOB_NOSPACE;
- }
- strcpy(&ptr[len - 2], "/");
- pglob->gl_pathv[i] = ptr;
- }
- }
-
- if (!(flags & GLOB_NOSORT)) {
- qsort(&pglob->gl_pathv[oldcount],
- pglob->gl_pathc + pglob->gl_offs - oldcount,
- sizeof(char *), cmp_func);
- }
-
- return 0;
-}
-
-
-/* Free storage allocated in PGLOB by a previous `glob' call. */
-void globfree (glob_t * pglob)
-{
- if (pglob->gl_pathv != NULL) {
- size_t i;
- for (i = 0; i < pglob->gl_pathc; i++)
- if (pglob->gl_pathv[pglob->gl_offs + i] != NULL)
- free((void *) pglob->gl_pathv[pglob->gl_offs + i]);
- free((void *) pglob->gl_pathv);
- }
-}
diff --git a/mdk-stage1/dietlibc/libshell/realpath.c b/mdk-stage1/dietlibc/libshell/realpath.c
deleted file mode 100644
index 9aee2c585..000000000
--- a/mdk-stage1/dietlibc/libshell/realpath.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <limits.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include "dietfeatures.h"
-
-char* realpath(const char *path, char *resolved_path) {
- int fd=open(".",O_RDONLY);
- char* tmp=(char*)"";
- if (fd<0) return 0;
- if (chdir(path)) {
- if (errno==ENOTDIR) {
- char* match;
- if ((match=strrchr(path,'/'))) {
- tmp=match;
- memmove(resolved_path,path,tmp-path);
- resolved_path[tmp-path]=0;
- if (chdir(resolved_path)) { resolved_path=0; goto abort; }
- }
- } else {
- resolved_path=0; goto abort;
- }
- }
- if (!getcwd(resolved_path,PATH_MAX)) { resolved_path=0; goto abort; }
- strcat(resolved_path,tmp);
-abort:
- fchdir(fd);
- close(fd);
- return resolved_path;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/clearerr.c b/mdk-stage1/dietlibc/libstdio/clearerr.c
deleted file mode 100644
index 8bde8c702..000000000
--- a/mdk-stage1/dietlibc/libstdio/clearerr.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "dietstdio.h"
-
-void clearerr( FILE *stream) {
- stream->flags&=~(ERRORINDICATOR|EOFINDICATOR);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fclose.c b/mdk-stage1/dietlibc/libstdio/fclose.c
deleted file mode 100644
index 491ed2522..000000000
--- a/mdk-stage1/dietlibc/libstdio/fclose.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "dietstdio.h"
-#include <stdlib.h>
-#include <unistd.h>
-
-int fclose(FILE *stream) {
- int res;
- FILE *f,*fl;
- fflush(stream);
- res=close(stream->fd);
- for (fl=0,f=__stdio_root; f; fl=f,f=f->next)
- if (f==stream) {
- if (fl)
- fl->next=f->next;
- else
- __stdio_root=f->next;
- break;
- }
- if ((!(stream->flags&STATICBUF))&&(stream->buf))
- free(stream->buf);
- free(stream);
- return res;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fdglue.c b/mdk-stage1/dietlibc/libstdio/fdglue.c
deleted file mode 100644
index 9542711e2..000000000
--- a/mdk-stage1/dietlibc/libstdio/fdglue.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include "dietstdio.h"
-
-int __stdio_parse_mode(const char *mode) {
- int f=0;
- for (;;) {
- switch (*mode) {
- case 0: return f;
- case 'b': break;
- case 'r': f=O_RDONLY; break;
- case 'w': f=O_WRONLY|O_CREAT|O_TRUNC; break;
- case 'a': f=O_WRONLY|O_CREAT|O_APPEND; break;
- case '+': f=(f&(~O_WRONLY))|O_RDWR; break;
- }
- ++mode;
- }
-}
-
diff --git a/mdk-stage1/dietlibc/libstdio/fdglue2.c b/mdk-stage1/dietlibc/libstdio/fdglue2.c
deleted file mode 100644
index b96e4c5b8..000000000
--- a/mdk-stage1/dietlibc/libstdio/fdglue2.c
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include "dietstdio.h"
-#include <stdlib.h>
-#include <pthread.h>
-
-extern int __stdio_atexit;
-
-FILE* __stdio_init_file_nothreads(int fd,int closeonerror);
-FILE* __stdio_init_file_nothreads(int fd,int closeonerror) {
- FILE *tmp=(FILE*)malloc(sizeof(FILE));
- if (!tmp) goto err_out;
- tmp->buf=(char*)malloc(BUFSIZE);
- if (!tmp->buf) {
- free(tmp);
-err_out:
- if (closeonerror) close(fd);
- errno=ENOMEM;
- return 0;
- }
- tmp->fd=fd;
- tmp->bm=0;
- tmp->bs=0;
- tmp->buflen=BUFSIZE;
- {
- struct stat st;
- fstat(fd,&st);
- tmp->flags=(S_ISFIFO(st.st_mode))?FDPIPE:0;
- }
- tmp->popen_kludge=0;
- if (__stdio_atexit==0) {
- __stdio_atexit=1;
- atexit(__stdio_flushall);
- }
- tmp->next=__stdio_root;
- __stdio_root=tmp;
- tmp->ungotten=0;
- return tmp;
-}
-
-FILE* __stdio_init_file(int fd,int closeonerror) __attribute__((weak,alias("__stdio_init_file_nothreads")));
diff --git a/mdk-stage1/dietlibc/libstdio/fdopen.c b/mdk-stage1/dietlibc/libstdio/fdopen.c
deleted file mode 100644
index 748b716eb..000000000
--- a/mdk-stage1/dietlibc/libstdio/fdopen.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-#include <sys/types.h>
-#include <dietstdio.h>
-#include <unistd.h>
-
-FILE *fdopen(int filedes, const char *mode) {
- int f=0; /* O_RDONLY, O_WRONLY or O_RDWR */
-
- f=__stdio_parse_mode(mode);
- if (filedes<0) { errno=EBADF; return 0; }
- return __stdio_init_file(filedes,0);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fdprintf.c b/mdk-stage1/dietlibc/libstdio/fdprintf.c
deleted file mode 100644
index f9fc7a3b4..000000000
--- a/mdk-stage1/dietlibc/libstdio/fdprintf.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int fdprintf(int fd,const char *format,...) {
- int n;
- va_list arg_ptr;
- va_start(arg_ptr,format);
- n=vfdprintf(fd,format,arg_ptr);
- va_end(arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/feof.c b/mdk-stage1/dietlibc/libstdio/feof.c
deleted file mode 100644
index bf2267fcf..000000000
--- a/mdk-stage1/dietlibc/libstdio/feof.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <dietstdio.h>
-
-int feof(FILE *stream) {
- /* yuck!!! */
- if (stream->ungotten) return 0;
- return (stream->flags&EOFINDICATOR);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/ferror.c b/mdk-stage1/dietlibc/libstdio/ferror.c
deleted file mode 100644
index e86873be0..000000000
--- a/mdk-stage1/dietlibc/libstdio/ferror.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <dietstdio.h>
-
-int ferror(FILE *stream) {
- return (stream->flags&ERRORINDICATOR);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fflush.c b/mdk-stage1/dietlibc/libstdio/fflush.c
deleted file mode 100644
index e0e23b3ba..000000000
--- a/mdk-stage1/dietlibc/libstdio/fflush.c
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <unistd.h>
-#include <stdlib.h>
-#include "dietwarning.h"
-#include "dietstdio.h"
-
-FILE *__stdio_root;
-
-int __stdio_atexit=0;
-
-void __stdio_flushall(void) {
- fflush(0);
-}
-
-int fflush(FILE *stream) {
- if (stream==0) {
- int res;
- FILE *f;
- __fflush_stdin();
- __fflush_stdout();
- __fflush_stderr();
- for (res=0, f=__stdio_root; f; f=f->next)
- if (fflush(f))
- res=-1;
- return res;
- }
-// if (stream->flags&NOBUF) return 0;
- if (stream->flags&BUFINPUT) {
- register int tmp;
- if ((tmp=stream->bm-stream->bs)) {
- lseek(stream->fd,tmp,SEEK_CUR);
- }
- stream->bs=stream->bm=0;
- } else {
- if (stream->bm && write(stream->fd,stream->buf,stream->bm)!=(int)stream->bm) {
- stream->flags|=ERRORINDICATOR;
- return -1;
- }
- stream->bm=0;
- }
- return 0;
-}
-
-int __fflush4(FILE *stream,int next) {
- if (!__stdio_atexit) {
- __stdio_atexit=1;
- atexit(__stdio_flushall);
- }
- if ((stream->flags&BUFINPUT)!=next) {
- int res=fflush(stream);
- stream->flags=(stream->flags&~BUFINPUT)|next;
- return res;
- }
- if (stream->fd==0) __fflush_stdout();
- return 0;
-}
-
-/* Internal function, has no prototype.
- * This is defined here because of the weak symbol ELF semantics */
-int __stdio_outs(const char *s,size_t len);
-int __stdio_outs(const char *s,size_t len) {
- return fwrite(s,1,(size_t)len,stdout)==len?1:0;
-}
-
-link_warning("fflush","warning: your code uses stdio (7+k bloat).")
diff --git a/mdk-stage1/dietlibc/libstdio/fgetc_unlocked.c b/mdk-stage1/dietlibc/libstdio/fgetc_unlocked.c
deleted file mode 100644
index 5136c8df1..000000000
--- a/mdk-stage1/dietlibc/libstdio/fgetc_unlocked.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "dietstdio.h"
-#include <unistd.h>
-
-int fgetc_unlocked(FILE *stream) {
- unsigned char c;
- if (stream->ungotten) {
- stream->ungotten=0;
- return stream->ungetbuf;
- }
- if (feof(stream))
- return EOF;
- if (__fflush4(stream,BUFINPUT)) return EOF;
- if (stream->bm>=stream->bs) {
- int len=read(stream->fd,stream->buf,stream->buflen);
- if (len==0) {
- stream->flags|=EOFINDICATOR;
- return EOF;
- } else if (len<0) {
- stream->flags|=ERRORINDICATOR;
- return EOF;
- }
- stream->bm=0;
- stream->bs=len;
- }
- c=stream->buf[stream->bm];
- ++stream->bm;
- return c;
-}
-
-int fgetc(FILE* stream) __attribute__((weak,alias("fgetc_unlocked")));
diff --git a/mdk-stage1/dietlibc/libstdio/fgetpos.c b/mdk-stage1/dietlibc/libstdio/fgetpos.c
deleted file mode 100644
index d58b6fa5b..000000000
--- a/mdk-stage1/dietlibc/libstdio/fgetpos.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-
-int fgetpos(FILE *stream, fpos_t *pos) {
- long l=ftell(stream);
- if (l==-1) return -1;
- *pos=l;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fgets.c b/mdk-stage1/dietlibc/libstdio/fgets.c
deleted file mode 100644
index d2ce4195d..000000000
--- a/mdk-stage1/dietlibc/libstdio/fgets.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "dietstdio.h"
-
-char *fgets(char *s, int size, FILE *stream) {
- char *orig=s;
- int l;
- for (l=size; l>1;) {
- int c=fgetc(stream);
- if (c==EOF) break;
- *s=c;
- ++s;
- --l;
- if (c=='\n') break;
- }
- if (l==size || ferror(stream))
- return 0;
- *s=0;
- return orig;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fileno.c b/mdk-stage1/dietlibc/libstdio/fileno.c
deleted file mode 100644
index f021d3881..000000000
--- a/mdk-stage1/dietlibc/libstdio/fileno.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <dietstdio.h>
-
-int fileno(FILE *stream) {
- return stream->fd;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fopen.c b/mdk-stage1/dietlibc/libstdio/fopen.c
deleted file mode 100644
index 3d9c28198..000000000
--- a/mdk-stage1/dietlibc/libstdio/fopen.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sys/types.h>
-#include <dietstdio.h>
-#include <unistd.h>
-
-extern int __stdio_atexit;
-
-FILE *fopen (const char *path, const char *mode) {
- int f=0; /* O_RDONLY, O_WRONLY or O_RDWR */
- int fd;
-
- f=__stdio_parse_mode(mode);
- if ((fd=open(path,f,0666))<0)
- return 0;
- return __stdio_init_file(fd,1);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fprintf.c b/mdk-stage1/dietlibc/libstdio/fprintf.c
deleted file mode 100644
index 6b3849a33..000000000
--- a/mdk-stage1/dietlibc/libstdio/fprintf.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int fprintf(FILE *f,const char *format,...) {
- int n;
- va_list arg_ptr;
- va_start(arg_ptr,format);
- n=vfprintf(f,format,arg_ptr);
- va_end(arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fputc_unlocked.c b/mdk-stage1/dietlibc/libstdio/fputc_unlocked.c
deleted file mode 100644
index 6441c5741..000000000
--- a/mdk-stage1/dietlibc/libstdio/fputc_unlocked.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-int fputc_unlocked(int c, FILE *stream) {
- if (__fflush4(stream,0)) return EOF;
- if (stream->bm>=stream->buflen-1)
- if (fflush(stream)) return EOF;
- if (stream->flags&NOBUF) {
- if (write(stream->fd,&c,1) != 1) return EOF;
- return 0;
- }
- stream->buf[stream->bm]=c;
- ++stream->bm;
- if (((stream->flags&BUFLINEWISE) && c=='\n') ||
- ((stream->flags&NOBUF))) /* puke */
- if (fflush(stream)) return EOF;
- return 0;
-}
-
-int fputc(int c,FILE* stream) __attribute__((weak,alias("fputc_unlocked")));
diff --git a/mdk-stage1/dietlibc/libstdio/fputs.c b/mdk-stage1/dietlibc/libstdio/fputs.c
deleted file mode 100644
index 51ee9a96e..000000000
--- a/mdk-stage1/dietlibc/libstdio/fputs.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "dietstdio.h"
-#include <string.h>
-
-int fputs(const char *s, FILE *stream) {
- return fwrite(s,strlen(s),1,stream);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fread.c b/mdk-stage1/dietlibc/libstdio/fread.c
deleted file mode 100644
index 813a98fb2..000000000
--- a/mdk-stage1/dietlibc/libstdio/fread.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <sys/types.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-size_t fread( void *ptr, size_t size, size_t nmemb, FILE *stream) {
- int res;
- unsigned long i,j;
- j=size*nmemb;
- i=0;
-
- if (!j || j/nmemb!=size) return 0;
- if (stream->ungotten) {
- stream->ungotten=0;
- *(char*)ptr=stream->ungetbuf;
- ++i;
- }
- if (!j) return 1;
-
-#ifdef WANT_FREAD_OPTIMIZATION
- if ( !(stream->flags&FDPIPE) && (j>stream->buflen)) {
- size_t tmp=j-i;
- int res;
- fflush(stream);
- while ((res=read(stream->fd,ptr+i,tmp))<(int)tmp) {
- if (res==-1) {
- stream->flags|=ERRORINDICATOR;
- goto exit;
- } else if (!res) {
- stream->flags|=EOFINDICATOR;
- goto exit;
- }
- i+=res; tmp-=res;
- }
- return nmemb;
- }
-#endif
- for (; i<j; ++i) {
- res=fgetc(stream);
- if (res==EOF)
-exit:
- return i/size;
- else
- ((unsigned char*)ptr)[i]=(unsigned char)res;
- }
- return nmemb;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/freopen.c b/mdk-stage1/dietlibc/libstdio/freopen.c
deleted file mode 100644
index 8d4644a10..000000000
--- a/mdk-stage1/dietlibc/libstdio/freopen.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <dietstdio.h>
-#include <unistd.h>
-
-FILE *freopen (const char *path, const char *mode, FILE *stream) {
- fclose(stream);
- stream=fopen(path,mode);
- return stream;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fscanf.c b/mdk-stage1/dietlibc/libstdio/fscanf.c
deleted file mode 100644
index 07f477462..000000000
--- a/mdk-stage1/dietlibc/libstdio/fscanf.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-int fscanf(FILE *stream, const char *format, ...) {
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vfscanf(stream,format,arg_ptr);
- va_end (arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fseek.c b/mdk-stage1/dietlibc/libstdio/fseek.c
deleted file mode 100644
index a49230f0a..000000000
--- a/mdk-stage1/dietlibc/libstdio/fseek.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-int fseek(FILE *stream, long offset, int whence) {
- fflush(stream);
- stream->bm=0; stream->bs=0;
- stream->flags&=~(ERRORINDICATOR|EOFINDICATOR);
- stream->ungotten=0;
- return lseek(stream->fd,offset,whence)!=-1?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fseeko.c b/mdk-stage1/dietlibc/libstdio/fseeko.c
deleted file mode 100644
index 6459a6ff4..000000000
--- a/mdk-stage1/dietlibc/libstdio/fseeko.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-int fseeko(FILE *stream, off_t offset, int whence) {
- fflush(stream);
- stream->bm=0; stream->bs=0;
- stream->flags&=~(ERRORINDICATOR|EOFINDICATOR);
- stream->ungotten=0;
- return lseek(stream->fd,offset,whence)!=-1?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/fseeko64.c b/mdk-stage1/dietlibc/libstdio/fseeko64.c
deleted file mode 100644
index 3b00596a1..000000000
--- a/mdk-stage1/dietlibc/libstdio/fseeko64.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-#ifndef __NO_STAT64
-int fseeko64(FILE *stream, off64_t offset, int whence) {
- fflush(stream);
- stream->bm=0; stream->bs=0;
- stream->flags&=~(ERRORINDICATOR|EOFINDICATOR);
- stream->ungotten=0;
- return lseek64(stream->fd,offset,whence)!=-1?0:-1;
-}
-#endif
diff --git a/mdk-stage1/dietlibc/libstdio/fsetpos.c b/mdk-stage1/dietlibc/libstdio/fsetpos.c
deleted file mode 100644
index 336135fff..000000000
--- a/mdk-stage1/dietlibc/libstdio/fsetpos.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-int fsetpos(FILE *stream, fpos_t *pos) {
- if (fseek(stream,*pos,SEEK_SET)==-1)
- return -1;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/ftell.c b/mdk-stage1/dietlibc/libstdio/ftell.c
deleted file mode 100644
index 48f74858a..000000000
--- a/mdk-stage1/dietlibc/libstdio/ftell.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-long ftell(FILE *stream) {
- fflush(stream);
- return (lseek(stream->fd,0,SEEK_CUR)-stream->ungotten);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/ftello.c b/mdk-stage1/dietlibc/libstdio/ftello.c
deleted file mode 100644
index 9d36318e2..000000000
--- a/mdk-stage1/dietlibc/libstdio/ftello.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-off_t ftello(FILE *stream) {
- fflush(stream);
- return (lseek(stream->fd,0,SEEK_CUR));
-}
diff --git a/mdk-stage1/dietlibc/libstdio/ftello64.c b/mdk-stage1/dietlibc/libstdio/ftello64.c
deleted file mode 100644
index bda7a7de4..000000000
--- a/mdk-stage1/dietlibc/libstdio/ftello64.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <dietstdio.h>
-#include <unistd.h>
-
-#ifndef __NO_STAT64
-off64_t ftello64(FILE *stream) {
- fflush(stream);
- return (lseek64(stream->fd,0ull,SEEK_CUR));
-}
-#endif
diff --git a/mdk-stage1/dietlibc/libstdio/fwrite.c b/mdk-stage1/dietlibc/libstdio/fwrite.c
deleted file mode 100644
index e2536ccfb..000000000
--- a/mdk-stage1/dietlibc/libstdio/fwrite.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <sys/types.h>
-#include "dietstdio.h"
-#include <unistd.h>
-#include <errno.h>
-
-size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
- int res;
- unsigned long len=size*nmemb;
- long i;
- if (!nmemb || len/nmemb!=size) return 0; /* check for integer overflow */
- if (len>stream->buflen || (stream->flags&NOBUF)) {
- fflush(stream);
- do {
- res=write(stream->fd,ptr,size*nmemb);
- } while (res==-1 && errno==EINTR);
- } else {
- register const unsigned char *c=ptr;
- for (i=len; i>0; --i,++c)
- if (fputc(*c,stream)) { res=len-i; goto abort; }
- res=len;
- }
- if (res<0) {
- stream->flags|=ERRORINDICATOR;
- return 0;
- }
-abort:
- return size?res/size:0;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/printf.c b/mdk-stage1/dietlibc/libstdio/printf.c
deleted file mode 100644
index 5af172c58..000000000
--- a/mdk-stage1/dietlibc/libstdio/printf.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-
-int printf(const char *format,...)
-{
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vprintf(format, arg_ptr);
- va_end(arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/putchar.c b/mdk-stage1/dietlibc/libstdio/putchar.c
deleted file mode 100644
index 7e5285a48..000000000
--- a/mdk-stage1/dietlibc/libstdio/putchar.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-#undef putchar
-int putchar(int c) {
- return fputc(c,stdout);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/puts.c b/mdk-stage1/dietlibc/libstdio/puts.c
deleted file mode 100644
index b1da01f9d..000000000
--- a/mdk-stage1/dietlibc/libstdio/puts.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include "dietstdio.h"
-#include "dietfeatures.h"
-
-int __cheap_outs(const char *s,size_t len);
-int __cheap_outs(const char *s,size_t len) {
- return (size_t)write(1,s,len)==len?1:0;
-}
-
-int __stdio_outs(const char *s,size_t len) __attribute__((weak,alias("__cheap_outs")));
-
-int puts(const char *s) {
- return (__stdio_outs(s,strlen(s)) && __stdio_outs("\n",1))?0:-1;
-}
-
diff --git a/mdk-stage1/dietlibc/libstdio/scanf.c b/mdk-stage1/dietlibc/libstdio/scanf.c
deleted file mode 100644
index 589c19f41..000000000
--- a/mdk-stage1/dietlibc/libstdio/scanf.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-int scanf(const char *format, ...) {
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vfscanf(stdin,format,arg_ptr);
- va_end (arg_ptr);
- return n;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/setvbuf.c b/mdk-stage1/dietlibc/libstdio/setvbuf.c
deleted file mode 100644
index b8b50addf..000000000
--- a/mdk-stage1/dietlibc/libstdio/setvbuf.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <sys/types.h>
-#include "dietstdio.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include "dietwarning.h"
-
-static int set_flags (FILE *stream, int flags) {
- switch (flags) {
- case _IONBF: stream->flags = (stream->flags & ~(BUFLINEWISE)) | NOBUF; break;
- case _IOLBF: stream->flags = (stream->flags & ~(NOBUF)) | BUFLINEWISE; break;
- case _IOFBF: stream->flags = stream->flags & ~(NOBUF | BUFLINEWISE); break;
- default: return -1;
- }
- return 0;
-}
-
-int setvbuf(FILE *stream, char *buf, int flags, size_t size) {
- if (buf) {
- if (!(stream->flags&STATICBUF)) free(stream->buf);
- stream->buf=buf;
- }
- else {
- char *tmp;
- if (!size) {
- return set_flags(stream,flags);
- }
- if (!(tmp=malloc(size))) return -1;
- if (!(stream->flags&STATICBUF)) free(stream->buf);
- stream->buf=tmp;
- }
- stream->buflen=size;
- stream->bm=stream->bs=0;
- return set_flags(stream,flags);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/stderr.c b/mdk-stage1/dietlibc/libstdio/stderr.c
deleted file mode 100644
index a9a34fd7e..000000000
--- a/mdk-stage1/dietlibc/libstdio/stderr.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <dietstdio.h>
-
-static FILE __stderr = {
- .fd=2,
- .flags=NOBUF,
- .bs=0, .bm=0,
- .buflen=0,
- .buf=0,
- .next=0,
- .popen_kludge=0,
- .ungetbuf=0,
- .ungotten=0
-#ifdef WANT_THREAD_SAFE
- , .m=PTHREAD_MUTEX_INITIALIZER
-#endif
-};
-
-FILE *stderr=&__stderr;
-
-int __fflush_stderr(void) {
- return fflush(stderr);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/stdin.c b/mdk-stage1/dietlibc/libstdio/stdin.c
deleted file mode 100644
index 217f3f609..000000000
--- a/mdk-stage1/dietlibc/libstdio/stdin.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <dietstdio.h>
-
-static char __stdin_buf[BUFSIZE];
-static FILE __stdin = {
- .fd=0,
- .flags=BUFINPUT|STATICBUF,
- .bs=0, .bm=0,
- .buflen=BUFSIZE,
- .buf=__stdin_buf,
- .next=0,
- .popen_kludge=0,
- .ungetbuf=0,
- .ungotten=0
-#ifdef WANT_THREAD_SAFE
- , .m=PTHREAD_MUTEX_INITIALIZER
-#endif
-};
-
-FILE *stdin=&__stdin;
-
-int __fflush_stdin(void) {
- return fflush(stdin);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/stdout.c b/mdk-stage1/dietlibc/libstdio/stdout.c
deleted file mode 100644
index 08054d0d4..000000000
--- a/mdk-stage1/dietlibc/libstdio/stdout.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <dietstdio.h>
-
-static char __stdout_buf[BUFSIZE];
-static FILE __stdout = {
- .fd=1,
- .flags=BUFLINEWISE|STATICBUF,
- .bs=0, .bm=0,
- .buflen=BUFSIZE,
- .buf=__stdout_buf,
- .next=0,
- .popen_kludge=0,
- .ungetbuf=0,
- .ungotten=0
-#ifdef WANT_THREAD_SAFE
- , .m=PTHREAD_MUTEX_INITIALIZER
-#endif
-};
-
-FILE *stdout=&__stdout;
-
-int __fflush_stdout(void) {
- return fflush(stdout);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/tmpfile.c b/mdk-stage1/dietlibc/libstdio/tmpfile.c
deleted file mode 100644
index b20d8410d..000000000
--- a/mdk-stage1/dietlibc/libstdio/tmpfile.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "dietstdio.h"
-#include <stdlib.h>
-#include <unistd.h>
-
-FILE *tmpfile (void) {
- int fd;
- char template[20] = "/tmp/tmpfile-XXXXXX";
- if ((fd=mkstemp(template))<0)
- return 0;
- unlink(template);
- return __stdio_init_file(fd,1);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/ungetc.c b/mdk-stage1/dietlibc/libstdio/ungetc.c
deleted file mode 100644
index 133e92820..000000000
--- a/mdk-stage1/dietlibc/libstdio/ungetc.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "dietstdio.h"
-
-int ungetc(int c, FILE *stream) {
- if (stream->ungotten || c<0 || c>255)
- return EOF;
- stream->ungotten=1;
- stream->ungetbuf=(unsigned char)c;
- stream->flags&=~(ERRORINDICATOR|EOFINDICATOR);
- return c;
-}
diff --git a/mdk-stage1/dietlibc/libstdio/vfdprintf.c b/mdk-stage1/dietlibc/libstdio/vfdprintf.c
deleted file mode 100644
index fdfeb09e1..000000000
--- a/mdk-stage1/dietlibc/libstdio/vfdprintf.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-
-static int __fwrite(void*ptr, size_t nmemb, int fd) {
- return write(fd,ptr,nmemb);
-}
-
-int vfdprintf(int fd, const char *format, va_list arg_ptr)
-{
- struct arg_printf ap = { (void*)(long)fd, (int(*)(void*,size_t,void*)) __fwrite };
- return __v_printf(&ap,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/vfprintf.c b/mdk-stage1/dietlibc/libstdio/vfprintf.c
deleted file mode 100644
index 5e64cf099..000000000
--- a/mdk-stage1/dietlibc/libstdio/vfprintf.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-
-static int __fwrite(void*ptr, size_t nmemb, FILE* f) {
- return fwrite(ptr,1,nmemb,f);
-}
-
-int vfprintf(FILE *stream, const char *format, va_list arg_ptr)
-{
- struct arg_printf ap = { stream, (int(*)(void*,size_t,void*)) __fwrite };
- return __v_printf(&ap,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/vfscanf.c b/mdk-stage1/dietlibc/libstdio/vfscanf.c
deleted file mode 100644
index 6d75a45ac..000000000
--- a/mdk-stage1/dietlibc/libstdio/vfscanf.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-int vfscanf(FILE *stream, const char *format, va_list arg_ptr)
-{
- struct arg_scanf farg = { (void*)stream, (int(*)(void*))fgetc, (int(*)(int,void*))ungetc };
- return __v_scanf(&farg,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/libstdio/vprintf.c b/mdk-stage1/dietlibc/libstdio/vprintf.c
deleted file mode 100644
index 7fe579e0a..000000000
--- a/mdk-stage1/dietlibc/libstdio/vprintf.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <stdarg.h>
-#include <unistd.h>
-#include "dietstdio.h"
-
-int __stdio_outs(const char *s,size_t len) __attribute__((weak));
-int __stdio_outs(const char *s,size_t len) {
- return (write(1,s,len)==(int)len)?1:0;
-}
-
-int vprintf(const char *format, va_list ap)
-{
- struct arg_printf _ap = { 0, (int(*)(void*,size_t,void*)) __stdio_outs };
- return __v_printf(&_ap,format,ap);
-}
-
diff --git a/mdk-stage1/dietlibc/libstdio/vscanf.c b/mdk-stage1/dietlibc/libstdio/vscanf.c
deleted file mode 100644
index ba9358fc4..000000000
--- a/mdk-stage1/dietlibc/libstdio/vscanf.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include "dietstdio.h"
-#include <unistd.h>
-
-int vscanf(const char *format, va_list arg_ptr)
-{
- return vfscanf(stdin,format,arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/libugly/asctime.c b/mdk-stage1/dietlibc/libugly/asctime.c
deleted file mode 100644
index e1fcc8706..000000000
--- a/mdk-stage1/dietlibc/libugly/asctime.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <time.h>
-
-static char buf[25];
-
-char *asctime(const struct tm *timeptr) {
- return asctime_r(timeptr,buf);
-}
diff --git a/mdk-stage1/dietlibc/libugly/asctime_r.c b/mdk-stage1/dietlibc/libugly/asctime_r.c
deleted file mode 100644
index 43c5e2cb2..000000000
--- a/mdk-stage1/dietlibc/libugly/asctime_r.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <time.h>
-
-static const char days[] = "Sun Mon Tue Wed Thu Fri Sat ";
-static const char months[] = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ";
-
-static void num2str(char *c,int i) {
- c[0]=i/10+'0';
- c[1]=i%10+'0';
-}
-
-char *asctime_r(const struct tm *t, char *buf) {
- /* "Wed Jun 30 21:49:08 1993\n" */
- *(int*)buf=*(int*)(days+(t->tm_wday<<2));
- *(int*)(buf+4)=*(int*)(months+(t->tm_mon<<2));
- num2str(buf+8,t->tm_mday);
- if (buf[8]=='0') buf[8]=' ';
- buf[10]=' ';
- num2str(buf+11,t->tm_hour);
-// if (buf[11]=='0') buf[11]=' ';
- buf[13]=':';
- num2str(buf+14,t->tm_min);
- buf[16]=':';
- num2str(buf+17,t->tm_sec);
- buf[19]=' ';
- num2str(buf+20,(t->tm_year+1900)/100);
- num2str(buf+22,(t->tm_year+1900)%100);
- buf[24]='\n';
- return buf;
-}
diff --git a/mdk-stage1/dietlibc/libugly/asprintf.c b/mdk-stage1/dietlibc/libugly/asprintf.c
deleted file mode 100644
index 9db1f67c7..000000000
--- a/mdk-stage1/dietlibc/libugly/asprintf.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdarg.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "dietwarning.h"
-
-int asprintf(char **s, const char *format,...)
-{
- int n;
- va_list arg_ptr;
- va_start(arg_ptr, format);
- n=vsnprintf(0,1000000,format,arg_ptr);
- va_start (arg_ptr, format);
- if ((*s=malloc(n+1))) {
- n=vsnprintf(*s,n+1,format,arg_ptr);
- return n;
- }
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/ctime.c b/mdk-stage1/dietlibc/libugly/ctime.c
deleted file mode 100644
index a0e12d673..000000000
--- a/mdk-stage1/dietlibc/libugly/ctime.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <time.h>
-
-char *ctime(const time_t *timep) {
- return asctime(localtime(timep));
-}
diff --git a/mdk-stage1/dietlibc/libugly/difftime.c b/mdk-stage1/dietlibc/libugly/difftime.c
deleted file mode 100644
index fc71363c7..000000000
--- a/mdk-stage1/dietlibc/libugly/difftime.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <time.h>
-#include "../dietwarning.h"
-
-double difftime(time_t time1, time_t time2) {
- return (double)time1 - (double)time2;
-}
-
-link_warning("difftime","warning: difftime introduces an unnecessary floating point dependency. Don't use it!")
diff --git a/mdk-stage1/dietlibc/libugly/dirfd.c b/mdk-stage1/dietlibc/libugly/dirfd.c
deleted file mode 100644
index 8d5af8b9a..000000000
--- a/mdk-stage1/dietlibc/libugly/dirfd.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <sys/types.h>
-#include "dietdirent.h"
-#define _BSD_SOURCE
-#include <dirent.h>
-
-int dirfd(DIR* dirp) {
- return dirp->fd;
-}
diff --git a/mdk-stage1/dietlibc/libugly/endmntent.c b/mdk-stage1/dietlibc/libugly/endmntent.c
deleted file mode 100644
index 00ade38e5..000000000
--- a/mdk-stage1/dietlibc/libugly/endmntent.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-#include <mntent.h>
-
-int endmntent(FILE *filep) {
- return fclose(filep);
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/facilitynames.c b/mdk-stage1/dietlibc/libugly/facilitynames.c
deleted file mode 100644
index 8b0e1f21f..000000000
--- a/mdk-stage1/dietlibc/libugly/facilitynames.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <sys/syslog.h>
-
-#ifndef INTERNAL_MARK
-#define INTERNAL_MARK 0x300
-#endif
-
-CODE facilitynames[] =
- {
- { "auth", LOG_AUTH },
- { "authpriv", LOG_AUTHPRIV },
- { "cron", LOG_CRON },
- { "daemon", LOG_DAEMON },
- { "ftp", LOG_FTP },
- { "kern", LOG_KERN },
- { "lpr", LOG_LPR },
- { "mail", LOG_MAIL },
- { "mark", INTERNAL_MARK }, /* INTERNAL */
- { "news", LOG_NEWS },
- { "security", LOG_AUTH }, /* DEPRECATED */
- { "syslog", LOG_SYSLOG },
- { "user", LOG_USER },
- { "uucp", LOG_UUCP },
- { "local0", LOG_LOCAL0 },
- { "local1", LOG_LOCAL1 },
- { "local2", LOG_LOCAL2 },
- { "local3", LOG_LOCAL3 },
- { "local4", LOG_LOCAL4 },
- { "local5", LOG_LOCAL5 },
- { "local6", LOG_LOCAL6 },
- { "local7", LOG_LOCAL7 },
- { 0, -1 }
- };
diff --git a/mdk-stage1/dietlibc/libugly/freeaddrinfo.c b/mdk-stage1/dietlibc/libugly/freeaddrinfo.c
deleted file mode 100644
index 72a13f5e1..000000000
--- a/mdk-stage1/dietlibc/libugly/freeaddrinfo.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/socket.h>
-#include <stdlib.h>
-
-void freeaddrinfo(struct addrinfo *res) {
- while (res) {
- struct addrinfo *duh;
- duh=res;
- res=res->ai_next;
- free(duh);
- }
-}
diff --git a/mdk-stage1/dietlibc/libugly/ftime.c b/mdk-stage1/dietlibc/libugly/ftime.c
deleted file mode 100644
index 3aa2d15c3..000000000
--- a/mdk-stage1/dietlibc/libugly/ftime.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sys/time.h>
-#include <sys/timeb.h>
-#include <unistd.h>
-
-int ftime(struct timeb *tp) {
- struct timeval tv;
- struct timezone tz;
- int ret=gettimeofday(&tv,&tz);
- tp->time = tv.tv_sec;
- tp->millitm = tv.tv_usec/1000;
- tp->timezone = tz.tz_minuteswest;
- tp->dstflag = tz.tz_dsttime;
- return ret;
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/gai_strerror.c b/mdk-stage1/dietlibc/libugly/gai_strerror.c
deleted file mode 100644
index 9dc4f5dde..000000000
--- a/mdk-stage1/dietlibc/libugly/gai_strerror.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <sys/socket.h>
-
-const char* gai_strerror(int error) {
- switch (error) {
- case EAI_FAMILY: return "family not supported";
- case EAI_SOCKTYPE: return "socket type not supported";
- case EAI_NONAME: return "unknown host";
- case EAI_SERVICE: return "unknown service";
- case EAI_MEMORY: return "memory allocation failure";
- case EAI_AGAIN: return "temporary failure";
- }
- return "DNS error. Sorry.";
-}
diff --git a/mdk-stage1/dietlibc/libugly/getaddrinfo.c b/mdk-stage1/dietlibc/libugly/getaddrinfo.c
deleted file mode 100644
index a4675d92b..000000000
--- a/mdk-stage1/dietlibc/libugly/getaddrinfo.c
+++ /dev/null
@@ -1,140 +0,0 @@
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <stdlib.h>
-#include <string.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-
-/* XXX TODO FIXME */
-
-int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) {
- struct addrinfo **tmp;
- int family;
- tmp=res; *res=0;
- if (hints) {
- if (hints->ai_family && hints->ai_family != PF_INET6 && hints->ai_family != PF_INET) return EAI_FAMILY;
- if (hints->ai_socktype && hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM) return EAI_SOCKTYPE;
- }
- for (family=PF_INET6; ; family=PF_INET) {
- if (!hints || hints->ai_family==family || hints->ai_family==AF_UNSPEC) { /* IPv6 addresses are OK */
- struct hostent h;
- struct hostent *H;
- int herrno=0;
- char buf[4096];
- int lookupok=0;
- h.h_addr_list=(char**)buf+16;
- if (node) {
- if (inet_pton(family,node,buf)>0) {
- h.h_name=(char*)node;
- h.h_addr_list[0]=buf;
- lookupok=1;
- } else if ((!hints || !(hints->ai_flags&AI_NUMERICHOST)) &&
- !gethostbyname2_r(node,family,&h,buf,4096,&H,&herrno)) {
- lookupok=1;
- } else {
- if (herrno==TRY_AGAIN) { freeaddrinfo(*res); return EAI_AGAIN; }
- }
- } else {
- h.h_name=0;
- h.h_addr_list[0]=buf;
- memset(buf,0,16);
- if (!hints || !(hints->ai_flags&AI_PASSIVE)) {
- if (family==AF_INET) {
- buf[0]=127; buf[3]=1;
- } else
- buf[15]=1;
- }
- lookupok=1;
- }
- if (lookupok) {
- struct ai_v6 {
- struct addrinfo ai;
- union {
- struct sockaddr_in6 ip6;
- struct sockaddr_in ip4;
- } ip;
- char name[1];
- } *foo;
- unsigned short port;
- int len=sizeof(struct ai_v6)+(h.h_name?strlen(h.h_name):0);
- if (!(foo=malloc(len))) goto error;
- foo->ai.ai_next=0;
- foo->ai.ai_socktype=SOCK_STREAM;
- foo->ai.ai_protocol=IPPROTO_TCP;
- foo->ai.ai_addrlen=family==PF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in);
- foo->ai.ai_addr=(struct sockaddr*)&foo->ip;
- if (family==PF_INET6) {
- memset(&foo->ip,0,sizeof(foo->ip));
- memmove(&foo->ip.ip6.sin6_addr,h.h_addr_list[0],16);
- } else {
- memmove(&foo->ip.ip4.sin_addr,h.h_addr_list[0],4);
- }
- foo->ip.ip6.sin6_family=foo->ai.ai_family=family;
- if (h.h_name) {
- foo->ai.ai_canonname=foo->name;
- memmove(foo->name,h.h_name,strlen(h.h_name)+1);
- } else
- foo->ai.ai_canonname=0;
- if (!hints || hints->ai_socktype!=SOCK_DGRAM) { /* TCP is OK */
- char *x;
- port=htons(strtol(service?service:"0",&x,0));
- if (*x) { /* service is not numeric :-( */
- struct servent* se;
- if ((se=getservbyname(service,"tcp"))) { /* found a service. */
- port=se->s_port;
- blah1:
- if (family==PF_INET6)
- foo->ip.ip6.sin6_port=port;
- else
- foo->ip.ip4.sin_port=port;
- if (!*tmp) *tmp=&(foo->ai); else (*tmp)->ai_next=&(foo->ai);
- if (!(foo=malloc(len))) goto error;
- memmove(foo,*tmp,len);
- tmp=&(*tmp)->ai_next;
- foo->ai.ai_addr=(struct sockaddr*)&foo->ip;
- if (foo->ai.ai_canonname)
- foo->ai.ai_canonname=foo->name;
- } else {
- freeaddrinfo(*res);
- return EAI_SERVICE;
- }
- } else goto blah1;
- }
- foo->ai.ai_socktype=SOCK_DGRAM;
- foo->ai.ai_protocol=IPPROTO_UDP;
- if (!hints || hints->ai_socktype!=SOCK_STREAM) { /* UDP is OK */
- char *x;
- port=htons(strtol(service?service:"0",&x,0));
- if (*x) { /* service is not numeric :-( */
- struct servent* se;
- if ((se=getservbyname(service,"udp"))) { /* found a service. */
- port=se->s_port;
- blah2:
- if (family==PF_INET6)
- foo->ip.ip6.sin6_port=port;
- else
- foo->ip.ip4.sin_port=port;
- if (!*tmp) *tmp=&(foo->ai); else (*tmp)->ai_next=&(foo->ai);
- if (!(foo=malloc(len))) goto error;
- memmove(foo,*tmp,len);
- tmp=&(*tmp)->ai_next;
- foo->ai.ai_addr=(struct sockaddr*)&foo->ip;
- foo->ai.ai_canonname=foo->name;
- } else {
- freeaddrinfo(*res);
- return EAI_SERVICE;
- }
- } else goto blah2;
- }
- free(foo);
- }
- }
- if (family==PF_INET) break;
- }
- if (*res==0) return EAI_NONAME; /* kludge kludge... */
- return 0;
-error:
- freeaddrinfo(*res);
- return EAI_MEMORY;
-}
diff --git a/mdk-stage1/dietlibc/libugly/gethostent.c b/mdk-stage1/dietlibc/libugly/gethostent.c
deleted file mode 100644
index fe92beacf..000000000
--- a/mdk-stage1/dietlibc/libugly/gethostent.c
+++ /dev/null
@@ -1,116 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <ctype.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include "dietfeatures.h"
-
-static char* hostmap=0;
-static unsigned int hostlen;
-
-static char *cur;
-
-/* ::1 localhost6 alias1 alias2 # internet protocol, pseudo protocol number */
-struct hostent* gethostent_r(char* buf, int len) {
- char *dest;
- struct hostent* pe=(struct hostent*)buf;
- char* last;
- char* max=buf+len;
- int aliasidx;
- if (!hostmap) {
- int hostfd=open(_PATH_HOSTS,O_RDONLY);
- if (hostfd<0) return 0;
- hostlen=lseek(hostfd,0,SEEK_END);
- hostmap=mmap(0,hostlen,PROT_READ|PROT_WRITE,MAP_PRIVATE,hostfd,0);
- if ((long)hostmap==(-1)) { close(hostfd); hostmap=0; goto error; }
- close(hostfd); hostfd=-1;
- cur=hostmap;
- }
- last=hostmap+hostlen;
-again:
- if ((size_t)len<sizeof(struct hostent)+11*sizeof(char*)) goto nospace;
- dest=buf+sizeof(struct hostent);
- pe->h_name=0;
- pe->h_aliases=(char**)dest; pe->h_aliases[0]=0; dest+=10*sizeof(char*);
- pe->h_addr_list=(char**)dest; dest+=2*sizeof(char**);
- if (cur>=last) return 0;
- if (*cur=='#' || *cur=='\n') goto parseerror;
- /* first, the ip number */
- pe->h_name=cur;
- while (cur<last && !isspace(*cur)) cur++;
- if (cur>=last) return 0;
- if (*cur=='\n') goto parseerror;
- {
- char save=*cur;
- *cur=0;
- pe->h_addr_list[0]=dest;
- pe->h_addr_list[1]=0;
- if (max-dest<16) goto nospace;
- if (inet_pton(AF_INET6,pe->h_name,dest)>0) {
- pe->h_addrtype=AF_INET6;
- pe->h_length=16;
- dest+=16;
- } else if (inet_pton(AF_INET,pe->h_name,dest)>0) {
- pe->h_addrtype=AF_INET;
- pe->h_length=4;
- dest+=4;
- } else {
- *cur=save;
- goto parseerror;
- }
- *cur=save;
- }
- ++cur;
- /* now the aliases */
- for (aliasidx=0;aliasidx<9;++aliasidx) {
- while (cur<last && isblank(*cur)) ++cur;
- pe->h_aliases[aliasidx]=cur;
- while (cur<last && !isspace(*cur)) ++cur;
- {
- char *from=pe->h_aliases[aliasidx];
- int len=cur-from;
- if (max-dest<len+2) goto nospace;
- pe->h_aliases[aliasidx]=dest;
- memmove(dest,from,(size_t)(cur-from));
- dest+=len;
- *dest=0; ++dest;
- }
- if (*cur=='\n') { ++cur; ++aliasidx; break; }
- if (cur>=last || !isblank(*cur)) break;
- cur++;
- }
- pe->h_aliases[aliasidx]=0;
- pe->h_name=pe->h_aliases[0];
- pe->h_aliases++;
- return pe;
-parseerror:
- while (cur<last && *cur!='\n') cur++;
- cur++;
- goto again;
-nospace:
- errno=ERANGE;
- goto __error;
-error:
- errno=ENOMEM;
-__error:
- if (hostmap!=(char*)-1) munmap(hostmap,hostlen);
- hostmap=(char*)-1;
- return 0;
-}
-
-void sethostent(int stayopen) {
- (void)stayopen;
- cur=hostmap;
-}
-
-void endhostent(void) {
- if (hostmap!=(char*)-1) munmap(hostmap,hostlen);
- hostmap=0;
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/getmntent.c b/mdk-stage1/dietlibc/libugly/getmntent.c
deleted file mode 100644
index 1a1bdca24..000000000
--- a/mdk-stage1/dietlibc/libugly/getmntent.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <mntent.h>
-#include <string.h>
-
-struct mntent *getmntent(FILE *filep) {
- static struct mntent m;
- static char buf[1024];
- do {
- char *tmp=buf;
- int num;
- if (!fgets(buf,1024,filep)) return 0;
-/* "/dev/ide/host0/bus0/target0/lun0/part2 / reiserfs defaults 1 1" */
- for (num=0; num<6; ++num) {
- switch (num) {
- case 0: m.mnt_fsname=tmp; break;
- case 1: m.mnt_dir=tmp; break;
- case 2: m.mnt_type=tmp; break;
- case 3: m.mnt_opts=tmp; break;
- case 4: m.mnt_freq=strtol(tmp,&tmp,0); if (*tmp!=' ' && *tmp!='\t') continue; break;
- case 5: m.mnt_passno=strtol(tmp,&tmp,0); if (*tmp=='\n') return &m; break;
- }
- while (*tmp && *tmp!=' ' && *tmp!='\n' && *tmp!='\t') ++tmp;
- if (*tmp) {
- if (num<4) *tmp++=0;
- while (*tmp==' ' || *tmp=='\t') ++tmp;
- } else
- continue;
- }
- } while (1);
-}
diff --git a/mdk-stage1/dietlibc/libugly/getnameinfo.c b/mdk-stage1/dietlibc/libugly/getnameinfo.c
deleted file mode 100644
index 40883ba09..000000000
--- a/mdk-stage1/dietlibc/libugly/getnameinfo.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <string.h>
-
-extern int __ltostr(char *s, int size, unsigned long i, int base, char UpCase);
-
-int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
- size_t hostlen, char *serv, size_t servlen, int flags) {
- sa_family_t f=((struct sockaddr_storage *)sa)->ss_family;
- (void)salen; /* shut gcc up about unused salen */
- if (host && hostlen>0) { /* user wants me to resolve the host name */
- register const char*addr=(f==AF_INET6)?(char*)&((struct sockaddr_in6*)sa)->sin6_addr:
- (char*)&((struct sockaddr_in*)sa)->sin_addr;
- if (flags&NI_NUMERICHOST) {
- if (!inet_ntop(f,addr,host,hostlen))
- return EAI_NONAME;
- } else {
- char buf[4096];
- struct hostent h;
- struct hostent *H;
- int herrno;
- if (gethostbyaddr_r(addr,f==AF_INET6?16:4,f,&h,buf,4096,&H,&herrno)) {
- switch (herrno) {
- case TRY_AGAIN: return EAI_AGAIN;
- case NO_DATA:
- case HOST_NOT_FOUND: return EAI_NONAME;
- }
- }
- strncpy(host,h.h_name,hostlen-1);
- host[hostlen-1]=0;
- }
- }
- if (serv && servlen>0) {
- register short int port=(f==AF_INET6)?((struct sockaddr_in6*)sa)->sin6_port:((struct sockaddr_in*)sa)->sin_port;
- if (flags&NI_NUMERICSERV) {
- __ltostr(serv,servlen,ntohs(port),10,0);
- } else {
- struct servent *s;
- if (!(s=getservbyport(port,flags&NI_DGRAM?"udp":"tcp")))
- return EAI_SERVICE;
- }
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotobyname.c b/mdk-stage1/dietlibc/libugly/getprotobyname.c
deleted file mode 100644
index 1de348791..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotobyname.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern struct protoent __protoent_pw;
-extern char __protoent_buf[1000];
-
-struct protoent *getprotobyname(const char *name) {
- struct protoent* tmp;
- if (getprotobyname_r(name,&__protoent_pw,__protoent_buf,sizeof(__protoent_buf),&tmp)==0)
- return tmp;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotobyname_r.c b/mdk-stage1/dietlibc/libugly/getprotobyname_r.c
deleted file mode 100644
index 3b1219aa7..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotobyname_r.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern int getprotobyname_r(const char* name,
- struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) {
- while (!getprotoent_r(res,buf,buflen,res_sig)) {
- int i;
- if (!strcmp(res->p_name,name)) goto found;
- for (i=0; res->p_aliases[i]; ++i)
- if (!strcmp(res->p_aliases[i],name)) goto found;
- }
- *res_sig=0;
-found:
- endprotoent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotobynumber.c b/mdk-stage1/dietlibc/libugly/getprotobynumber.c
deleted file mode 100644
index 6170753e2..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotobynumber.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern struct protoent __protoent_pw;
-extern char __protoent_buf[1000];
-
-struct protoent *getprotobynumber(int proto) {
- struct protoent* tmp;
- if (getprotobynumber_r(proto,&__protoent_pw,__protoent_buf,sizeof(__protoent_buf),&tmp)==0)
- return tmp;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotobynumber_r.c b/mdk-stage1/dietlibc/libugly/getprotobynumber_r.c
deleted file mode 100644
index 2ca439fc6..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotobynumber_r.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern int getprotobynumber_r(int proto,
- struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) {
- while (!getprotoent_r(res,buf,buflen,res_sig))
- if (proto==res->p_proto) goto found;
- *res_sig=0;
-found:
- endprotoent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotoent.c b/mdk-stage1/dietlibc/libugly/getprotoent.c
deleted file mode 100644
index 3f0fd4d41..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotoent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <netdb.h>
-
-extern struct protoent __protoent_pw;
-extern char __protoent_buf[1000];
-
-struct protoent *getprotoent(void) {
- struct protoent* tmp;
- getprotoent_r(&__protoent_pw,__protoent_buf,sizeof(__protoent_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getprotoent_r.c b/mdk-stage1/dietlibc/libugly/getprotoent_r.c
deleted file mode 100644
index aa9af79c3..000000000
--- a/mdk-stage1/dietlibc/libugly/getprotoent_r.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <string.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <netdb.h>
-#include <ctype.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setprotoent(int stayopen) {
- (void)stayopen;
- __prepare_parse(_PATH_PROTOCOLS,&__ps);
-}
-
-void endprotoent(void) {
- __end_parse(&__ps);
-}
-
-#define ALIASES 16
-
-/* "igmp 2 IGMP # internet group management protocol" */
-int getprotoent_r(struct protoent *res, char *buf, size_t buflen,
- struct protoent **res_sig) {
- size_t i,j,n,g;
- unsigned long l;
- if (!__ps.buffirst) setprotoent(0);
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
- res->p_aliases=(char**)buf;
-/* getprotoent */
-again:
- n=ALIASES*sizeof(char*); g=0;
- for (i=0; i<3; ++i) {
- char found;
- __ps.cur+=__parse_ws(&__ps);
- if (__ps.cur>=__ps.buflen) { if (i==2) break; else goto error; }
- j=__parse_nws(&__ps);
- if (!isblank(found=__ps.buffirst[__ps.cur+j])) {
- if (i==2) break; /* it's ok, no (more) aliases necessary */
-parseerror:
- while (__ps.cur+j<__ps.buflen) {
- if (__ps.buffirst[__ps.cur+j]=='\n') {
- __ps.cur+=j+1;
- goto again;
- }
- ++j;
- }
- }
- switch (i) {
- case 0:
- res->p_name=buf+n;
-copy:
- if ((size_t)buflen<=n+j) goto error;
- memcpy(buf+n,__ps.buffirst+__ps.cur,j);
- buf[n+j]=0;
- n+=j+1;
- if ((found=='\n' || found=='#') && i==1) i=3;
- break;
- case 1:
- if (scan_ulong(__ps.buffirst+__ps.cur,&l)!=j) goto parseerror;
- res->p_proto=l;
- break;
- case 2:
- res->p_aliases[g]=buf+n;
- ++g;
- if (g==(ALIASES-1)) break;
- --i; /* again */
- goto copy;
- }
- __ps.cur+=j+1;
- }
- res->p_aliases[g]=0;
- *res_sig=res;
- return 0;
-error:
- *res_sig=0;/* the glibc people should be taken behind the barn and shot */
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservbyname.c b/mdk-stage1/dietlibc/libugly/getservbyname.c
deleted file mode 100644
index f1c74eaa9..000000000
--- a/mdk-stage1/dietlibc/libugly/getservbyname.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern struct servent __servent_pw;
-extern char __servent_buf[1000];
-
-struct servent *getservbyname(const char *name, const char *proto) {
- struct servent* tmp;
- if (getservbyname_r(name,proto,&__servent_pw,__servent_buf,sizeof(__servent_buf),&tmp)==0)
- return tmp;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservbyname_r.c b/mdk-stage1/dietlibc/libugly/getservbyname_r.c
deleted file mode 100644
index f523a01ca..000000000
--- a/mdk-stage1/dietlibc/libugly/getservbyname_r.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern int getservbyname_r(const char* name,const char* proto,
- struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) {
- while (!getservent_r(res,buf,buflen,res_sig)) {
- int i;
- if (proto && strcmp(res->s_proto,proto)) continue;
- if (!strcmp(res->s_name,name)) goto found;
- for (i=0; res->s_aliases[i]; ++i)
- if (!strcmp(res->s_aliases[i],name)) goto found;
- }
- *res_sig=0;
-found:
- endservent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservbyport.c b/mdk-stage1/dietlibc/libugly/getservbyport.c
deleted file mode 100644
index 2821deb63..000000000
--- a/mdk-stage1/dietlibc/libugly/getservbyport.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern struct servent __servent_pw;
-extern char __servent_buf[1000];
-
-struct servent *getservbyport(int port, const char *proto) {
- struct servent* tmp;
- if (getservbyport_r(port,proto,&__servent_pw,__servent_buf,sizeof(__servent_buf),&tmp)==0)
- return tmp;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservbyport_r.c b/mdk-stage1/dietlibc/libugly/getservbyport_r.c
deleted file mode 100644
index 9c0f21bdf..000000000
--- a/mdk-stage1/dietlibc/libugly/getservbyport_r.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <string.h>
-#include <netdb.h>
-
-extern int getservbyport_r(int port,const char* proto,
- struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) {
- while (!getservent_r(res,buf,buflen,res_sig))
- if (port==res->s_port && !strcmp(res->s_proto,proto)) goto ok;
- *res_sig=0;
-ok:
- endservent();
- return *res_sig?0:-1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservent.c b/mdk-stage1/dietlibc/libugly/getservent.c
deleted file mode 100644
index 9eabc972a..000000000
--- a/mdk-stage1/dietlibc/libugly/getservent.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <netdb.h>
-
-extern struct servent __servent_pw;
-extern char __servent_buf[1000];
-
-struct servent *getservent(void) {
- struct servent* tmp;
- getservent_r(&__servent_pw,__servent_buf,sizeof(__servent_buf),&tmp);
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libugly/getservent_r.c b/mdk-stage1/dietlibc/libugly/getservent_r.c
deleted file mode 100644
index 33db6f31d..000000000
--- a/mdk-stage1/dietlibc/libugly/getservent_r.c
+++ /dev/null
@@ -1,91 +0,0 @@
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <netdb.h>
-#include <ctype.h>
-#include "parselib.h"
-
-static struct state __ps;
-
-void setservent(int stayopen) {
- (void)stayopen;
- __prepare_parse(_PATH_SERVICES,&__ps);
-}
-
-void endservent(void) {
- __end_parse(&__ps);
-}
-
-#define ALIASES 16
-
-/* "tcpmux 1/tcp # TCP port multiplexer (RFC1078)" */
-int getservent_r(struct servent *res, char *buf, size_t buflen,
- struct servent **res_sig) {
- size_t i,j,n,g;
- unsigned long l;
- if (!__ps.buffirst) setservent(0);
- if (!__ps.buffirst) goto error;
- if (__ps.cur>=__ps.buflen) goto error;
- res->s_aliases=(char**)buf;
-/* getservent */
-again:
- n=ALIASES*sizeof(char*); g=0;
- for (i=0; i<3; ++i) {
- char found;
- __ps.cur+=__parse_ws(&__ps);
- if (__ps.cur>=__ps.buflen) { if (i==2) break; else goto error; }
- j=__parse_nws(&__ps);
- if (!isblank(found=__ps.buffirst[__ps.cur+j])) {
- if (i==2 && found=='#') break;
- if (found=='#' || (i>1 && found!='\n')) {
-parseerror:
- while (__ps.cur+j<__ps.buflen) {
- if (__ps.buffirst[__ps.cur+j]=='\n') {
- __ps.cur+=j+1;
- goto again;
- }
- ++j;
- }
- goto error;
- }
- }
- switch (i) {
- case 0:
- res->s_name=buf+n;
-copy:
- if (!j) goto parseerror;
- if ((size_t)buflen<=n+j) goto error;
- memcpy(buf+n,__ps.buffirst+__ps.cur,j);
- buf[n+j]=0;
- n+=j+1;
- if ((found=='\n' || found=='#') && i==1) i=3;
- break;
- case 1:
- {
- int k;
- k=scan_ulong(__ps.buffirst+__ps.cur,&l);
- if (__ps.buffirst[__ps.cur+k]!='/') {
- goto parseerror;
- }
- res->s_port=htons(l);
- res->s_proto=buf+n;
- j-=k+1; __ps.cur+=k+1;
- goto copy;
- }
- case 2:
- res->s_aliases[g]=buf+n;
- ++g;
- if (g==(ALIASES-1)) break;
- --i; /* again */
- goto copy;
- }
- __ps.cur+=j+1;
- }
- res->s_aliases[g]=0;
- *res_sig=res;
- return 0;
-error:
- *res_sig=0;/* the glibc people should be taken behind the barn and shot */
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/gmtime.c b/mdk-stage1/dietlibc/libugly/gmtime.c
deleted file mode 100644
index d33af7972..000000000
--- a/mdk-stage1/dietlibc/libugly/gmtime.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <time.h>
-
-struct tm* gmtime(const time_t *t) {
- static struct tm tmp;
- return gmtime_r(t,&tmp);
-}
diff --git a/mdk-stage1/dietlibc/libugly/gmtime_r.c b/mdk-stage1/dietlibc/libugly/gmtime_r.c
deleted file mode 100644
index 6bc0bb5b2..000000000
--- a/mdk-stage1/dietlibc/libugly/gmtime_r.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <time.h>
-
-/* seconds per day */
-#define SPD 24*60*60
-
-extern short __spm[];
-
-struct tm *gmtime_r(const time_t *timep, struct tm *r) {
- time_t i;
- register time_t work=*timep%(SPD);
- r->tm_sec=work%60; work/=60;
- r->tm_min=work%60; r->tm_hour=work/60;
- work=*timep/(SPD);
- r->tm_wday=(4+work)%7;
- for (i=1970; ; ++i) {
- register time_t k=__isleap(i)?366:365;
- if (work>=k)
- work-=k;
- else
- break;
- }
- r->tm_year=i-1900;
- r->tm_yday=work;
-
- r->tm_mday=1;
- if (__isleap(i) && (work>58)) {
- if (work==59) r->tm_mday=2; /* 29.2. */
- work-=1;
- }
-
- for (i=11; i && (__spm[i]>work); --i) ;
- r->tm_mon=i;
- r->tm_mday+=work-__spm[i];
- return r;
-}
diff --git a/mdk-stage1/dietlibc/libugly/grantpt.c b/mdk-stage1/dietlibc/libugly/grantpt.c
deleted file mode 100644
index 0aa903b29..000000000
--- a/mdk-stage1/dietlibc/libugly/grantpt.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#define _XOPEN_SOURCE
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-
-int grantpt (int fd) {
- struct stat st;
- if ((fstat(fd, &st))<0) return -1;
- if ((chmod((char*)ptsname(fd), st.st_mode | S_IRUSR | S_IWUSR | S_IWGRP))<0)
- return -1;
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/hasmntopt.c b/mdk-stage1/dietlibc/libugly/hasmntopt.c
deleted file mode 100644
index 2a547feee..000000000
--- a/mdk-stage1/dietlibc/libugly/hasmntopt.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <string.h>
-#include <mntent.h>
-
-char *hasmntopt(const struct mntent *mnt, const char *opt) {
- char *s=mnt->mnt_opts;
- char *c;
- int len=strlen(opt);
- if (!s) return 0;
- for (c=s;;) {
- if (!(c=strstr(c,opt))) break;
- if (c==s || c[-1]==',') {
- if (c[len]==0 || c[len]==',' || c[len]=='=')
- return c;
- }
- c+=len+1;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/iconv.c b/mdk-stage1/dietlibc/libugly/iconv.c
deleted file mode 100644
index 45be5d91d..000000000
--- a/mdk-stage1/dietlibc/libugly/iconv.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include "dietfeatures.h"
-#include <errno.h>
-#include "dieticonv.h"
-#include <netinet/in.h>
-
-size_t iconv(iconv_t cd, const char* * inbuf, size_t *
- inbytesleft, char* * outbuf, size_t * outbytesleft) {
- size_t converted=0,i,j,k;
- int bits;
- if (!inbuf || !*inbuf) return 0;
- while (*inbytesleft) {
- unsigned int v=0;
- v=*(unsigned char*)*inbuf;
- i=j=1;
- switch (ic_from(cd)) {
- case UCS_2:
- v=ntohs(*(unsigned short*)*inbuf);
- i=2;
- break;
- case UCS_4:
- v=ntohs(*(unsigned int*)*inbuf);
- i=4;
- case ISO_8859_1:
- break;
- case UTF_8:
- if (!(v&0x80)) break;
- for (i=0xC0; i!=0xFC; i=(i>>1)+0x80)
- if ((v&((i>>1)|0x80))==i) {
- v&=~i;
- break;
- }
- for (i=1; ((*inbuf)[i]&0xc0)==0x80; ++i)
- v=(v<<6)|((*inbuf)[i]&0x3f);
-/* printf("got %u in %u bytes, buflen %u\n",v,i,*inbytesleft); */
- break;
- }
- switch (ic_to(cd)) {
- case ISO_8859_1:
- **outbuf=(unsigned char)v;
- break;
- case UCS_2:
- *(unsigned short*)*outbuf=htons(v);
- j=2;
- break;
- case UCS_4:
- *(unsigned int*)*outbuf=htonl(v);
- j=4;
- break;
- case UTF_8:
- if (v>0x04000000) { bits=30; **outbuf=0xFC; j=6; } else
- if (v>0x00200000) { bits=24; **outbuf=0xF8; j=5; } else
- if (v>0x00010000) { bits=18; **outbuf=0xF0; j=4; } else
- if (v>0x00000800) { bits=12; **outbuf=0xE0; j=3; } else
- if (v>0x00000080) { bits=6; **outbuf=0xC0; j=2; } else
- { bits=0; **outbuf=0; }
- **outbuf |= (unsigned char)(v>>bits);
- if (*outbytesleft<j) {
- errno=E2BIG;
- return (size_t)-1;
- }
- for (k=1; k<j; ++k) {
- bits-=6;
- (*outbuf)[k]=0x80+((v>>bits)&0x3F);
- }
- break;
- }
- *inbuf+=i; *inbytesleft-=i; ++converted;
- *outbuf+=j; *outbytesleft-=j;
- }
- return converted;
-}
diff --git a/mdk-stage1/dietlibc/libugly/iconv_close.c b/mdk-stage1/dietlibc/libugly/iconv_close.c
deleted file mode 100644
index 7d5d4c4b9..000000000
--- a/mdk-stage1/dietlibc/libugly/iconv_close.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdlib.h>
-#include "dieticonv.h"
-
-int iconv_close(iconv_t cd) {
- (void)cd; /* shut gcc up about unused cd */
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/libugly/iconv_open.c b/mdk-stage1/dietlibc/libugly/iconv_open.c
deleted file mode 100644
index eabab4273..000000000
--- a/mdk-stage1/dietlibc/libugly/iconv_open.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <string.h>
-#include <strings.h>
-#include "dietfeatures.h"
-#include <errno.h>
-#include <stdlib.h>
-#include "dieticonv.h"
-
-static enum charset parsecharset(const char* s) {
- if (!strcasecmp(s,"UTF-8")) return UTF_8; else
- if (!strcasecmp(s,"UCS-2") || !strcasecmp(s,"UCS2")) return UCS_2; else
- if (!strcasecmp(s,"UCS-4") || !strcasecmp(s,"UCS4")) return UCS_4; else
- if (!strcasecmp(s,"ISO-8859-1")) return ISO_8859_1; else
- if (!strcasecmp(s,"US-ASCII")) return ISO_8859_1; else
- return INVALID;
-}
-
-iconv_t iconv_open(const char* tocode, const char* fromcode) {
- int f,t;
-
- f=parsecharset(fromcode);
- t=parsecharset(tocode);
-
- if (f==INVALID || t==INVALID) {
- errno=EINVAL;
- return (iconv_t)(-1);
- }
- return (f|t<<16);
-}
diff --git a/mdk-stage1/dietlibc/libugly/isleap.c b/mdk-stage1/dietlibc/libugly/isleap.c
deleted file mode 100644
index d83712792..000000000
--- a/mdk-stage1/dietlibc/libugly/isleap.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <time.h>
-
-int __isleap(int year) {
- /* every fourth year is a leap year except for century years that are
- * not divisible by 400. */
-/* return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); */
- return (!(year%4) && ((year%100) || !(year%400)));
-}
diff --git a/mdk-stage1/dietlibc/libugly/localtime.c b/mdk-stage1/dietlibc/libugly/localtime.c
deleted file mode 100644
index 6fa6acf8a..000000000
--- a/mdk-stage1/dietlibc/libugly/localtime.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <time.h>
-
-struct tm* localtime(const time_t* t) {
- static struct tm tmp;
- return localtime_r(t,&tmp);
-}
diff --git a/mdk-stage1/dietlibc/libugly/localtime_r.c b/mdk-stage1/dietlibc/libugly/localtime_r.c
deleted file mode 100644
index 5d420303c..000000000
--- a/mdk-stage1/dietlibc/libugly/localtime_r.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "dietfeatures.h"
-#include <time.h>
-#include <sys/time.h>
-
-#ifdef WANT_TZFILE_PARSER
-extern void __maplocaltime(void);
-extern time_t __tzfile_map(time_t t, int *isdst);
-#else
-extern long int timezone;
-extern int daylight;
-#endif
-
-struct tm* localtime_r(const time_t* t, struct tm* r) {
- time_t tmp;
-#ifdef WANT_TZFILE_PARSER
- __maplocaltime();
- tmp=__tzfile_map(*t,&r->tm_isdst);
-#else
- struct timezone tz;
- gettimeofday(0, &tz);
- timezone=tz.tz_minuteswest*60L;
- tmp=*t+timezone;
-#endif
- return gmtime_r(&tmp,r);
-}
diff --git a/mdk-stage1/dietlibc/libugly/logging.c b/mdk-stage1/dietlibc/libugly/logging.c
deleted file mode 100644
index 680a1f850..000000000
--- a/mdk-stage1/dietlibc/libugly/logging.c
+++ /dev/null
@@ -1,197 +0,0 @@
-#include <errno.h>
-#include "dietfeatures.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <string.h>
-#include <time.h>
-#include <sys/socket.h>
-#include <signal.h>
-
-#define _PATH_CONSOLE "/dev/console"
-#define BUF_SIZE 2048 /* messagebuffer size (>= 200) */
-
-#define MAX_LOGTAG 1000
-
-/* those have to be global *sigh* */
-static volatile int connected = 0; /* have done connect */
-static volatile int LogMask = 0xff; /* mask of priorities to be logged */
-static char LogTag[MAX_LOGTAG]; /* string to tag the entry with */
-static int LogFile = -1; /* fd for log */
-static int LogType = SOCK_DGRAM; /* type of socket connection */
-static int LogFacility = LOG_USER; /* default facility code */
-static int LogStat; /* status bits, set by openlog() */
-extern char *__progname; /* Program name, from crt0. */
-static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
-
-static void closelog_intern(void)
-{
- if (!connected) return;
- close(LogFile);
- LogFile = -1;
- connected = 0;
-}
-
-void __libc_closelog(void);
-void __libc_closelog(void)
-{
- closelog_intern();
-
- LogTag[0]=0;
- LogType = SOCK_DGRAM;
-}
-void closelog(void) __attribute__((weak,alias("__libc_closelog")));
-
-static void openlog_intern(int option, int facility)
-{
- LogStat = option;
- if (facility && ((facility & ~LOG_FACMASK) == 0))
- LogFacility = facility;
-
- /* yep, there is a continue inside ;) */
- while(1) {
- if (LogFile == -1) {
- SyslogAddr.sa_family = AF_UNIX;
- strncpy(SyslogAddr.sa_data, _PATH_LOG, sizeof(SyslogAddr.sa_data));
- if (LogStat & LOG_NDELAY)
- {
- if ((LogFile = socket(AF_UNIX, LogType, 0)) == -1) return;
- fcntl(LogFile, F_SETFD, 1);
- }
- }
- if ((LogFile != -1) && !connected) {
- int old_errno=errno;
- if(connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) == -1) {
- int saved_errno=errno;
- close(LogFile);
- LogFile = -1;
- if((LogType == SOCK_DGRAM) && (saved_errno == EPROTOTYPE)) {
- /* retry with SOCK_STREAM instead of SOCK_DGRAM */
- LogType = SOCK_STREAM;
- errno=old_errno;
- continue;
- }
- }
- else connected = 1;
- }
- break;
- }
-}
-
-/* has to be secured against multiple, simultanious call's in threaded environment */
-void __libc_openlog(const char *ident, int option, int facility);
-void __libc_openlog(const char *ident, int option, int facility)
-{
- if (ident) {
- strncpy(LogTag,ident,MAX_LOGTAG);
- LogTag[MAX_LOGTAG-1]=0;
- }
- openlog_intern(option, facility);
-}
-void openlog(const char *ident, int option, int facility) __attribute__((weak,alias("__libc_openlog")));
-
-int setlogmask(int mask)
-{
- int old = LogMask;
- if (mask) LogMask = mask;
- return old;
-}
-
-void __libc_vsyslog(int priority, const char *format, va_list arg_ptr);
-void __libc_vsyslog(int priority, const char *format, va_list arg_ptr)
-{
- char buffer[BUF_SIZE];
- char time_buf[20];
- int buflen, headerlen;
- time_t now;
- struct tm now_tm;
- pid_t pid;
- int fd;
- int sigpipe;
- struct sigaction action, oldaction;
- struct sigaction *oldaction_ptr = NULL;
- int saved_errno = errno;
-
- /* check for invalid priority/facility bits */
- if (priority & ~(LOG_PRIMASK|LOG_FACMASK)) {
- syslog(LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID, "syslog: unknown facility/priorityority: %x", priority);
- priority &= LOG_PRIMASK|LOG_FACMASK;
- }
-
- /* check priority against setlogmask */
- if ((LOG_MASK(LOG_PRI(priority)) && LogMask) == 0) return;
-
- /* Set default facility if none specified. */
- if ((priority & LOG_FACMASK) == 0) priority |= LogFacility;
-
- pid = getpid();
- time(&now);
- strftime(time_buf, 20, "%h %e %T", localtime_r (&now, &now_tm));
-
- if (LogStat & LOG_PID)
- headerlen = snprintf(buffer, 130, "<%d>%s %s[%d]: ", priority, time_buf, LogTag, pid);
- else
- headerlen = snprintf(buffer, 130, "<%d>%s %s: ", priority, time_buf, LogTag);
-
- if (!LogTag[0]) {
- if ((LogStat & LOG_PID) != LOG_PID)
- headerlen = snprintf(buffer, 130, "<%d>%s (unknown)[%d]: ", priority, time_buf, pid);
- strcat(buffer+headerlen, "syslog without openlog w/ ident, please check code!");
- buflen = 41;
- }
- else {
- errno=saved_errno;
- buflen = vsnprintf(buffer+headerlen, BUF_SIZE - headerlen, format, arg_ptr);
- }
- if (LogStat & LOG_PERROR) {
- write(1, buffer+headerlen, buflen);
- if (buffer[headerlen+buflen] != '\n') write(1,"\n", 1);
- }
-
- /* prepare for broken connection */
- memset(&action, 0, sizeof(action));
- action.sa_handler = SIG_IGN;
- sigemptyset(&action.sa_mask);
-
- if ((sigpipe = sigaction (SIGPIPE, &action, &oldaction))==0)
- oldaction_ptr = &oldaction;
-
- if (!connected) openlog_intern(LogStat | LOG_NDELAY, 0);
-
- /* If we have a SOCK_STREAM connection, also send ASCII NUL as a
- * record terminator. */
- if (LogType == SOCK_STREAM) buflen++;
-
- if (!connected || (send(LogFile, buffer, buflen+headerlen, 0) != buflen+headerlen)) {
- if (LogType == SOCK_STREAM) buflen--;
- closelog_intern();
- /*
- * Output the message to the console; don't worry about blocking,
- * if console blocks everything will. Make sure the error reported
- * is the one from the syslogd failure.
- */
- if ((LogStat & LOG_CONS) &&
- ((fd = open(_PATH_CONSOLE, O_WRONLY|O_NOCTTY, 0)) >= 0))
- {
- write(fd, buffer, buflen+headerlen);
- write(fd, "\r\n", 2);
- }
- }
-
- if (sigpipe == 0)
- sigaction(SIGPIPE, &oldaction, (struct sigaction *) NULL);
-}
-void vsyslog(int priority, const char *format, va_list arg_ptr) __attribute__((weak,alias("__libc_vsyslog")));
-
-void syslog(int priority, const char *format, ...)
-{
- va_list arg_ptr;
- va_start(arg_ptr, format);
- vsyslog(priority, format, arg_ptr);
- va_end(arg_ptr);
-}
diff --git a/mdk-stage1/dietlibc/libugly/mktime.c b/mdk-stage1/dietlibc/libugly/mktime.c
deleted file mode 100644
index 348068e1d..000000000
--- a/mdk-stage1/dietlibc/libugly/mktime.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <time.h>
-
-extern const short __spm [];
-
-time_t mktime ( register struct tm* const t )
-{
- register time_t day;
- register time_t i;
-
- if ( t->tm_year < 70 )
- return (time_t) -1;
-
- day = t->tm_yday = __spm [t->tm_mon] + t->tm_mday-1 + ( __isleap (t->tm_year+1900) & (t->tm_mon > 1) );
-
- for ( i = 70; i < t->tm_year; i++ )
- day += 365 + __isleap (i+1900);
-
- /* day is now the number of days since 'Jan 1 1970' */
- i = 7;
- t->tm_wday = (day + 4) % i; /* Sunday=0, Monday=1, ..., Saturday=6 */
-
- i = 24;
- day *= i;
- i = 60;
- return ((day + t->tm_hour) * i + t->tm_min) * i + t->tm_sec;
-}
-
-#if 0
-
-#include <math.h>
-
-main()
-{
- int i, j, k;
- static char *s[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-
- for (i=70; i<200; i++)
- for (j=0; j<12; j++)
- for (k=1; k<=31; k++) {
- struct tm t;
- double x;
- t.tm_year = i;
- t.tm_mon = j;
- t.tm_mday = k;
- t.tm_hour = 0;
- t.tm_min = 0;
- t.tm_sec = 0;
- x = mktime (&t);
- printf ("%4d.%5.0f %2u.%02u.%04u %s\n", (int)floor(x/86400), x-86400.*(int)floor(x/86400), k, j+1, 1900+i, s[t.tm_wday] );
- }
-
-}
-#endif
diff --git a/mdk-stage1/dietlibc/libugly/netent.c b/mdk-stage1/dietlibc/libugly/netent.c
deleted file mode 100644
index 4710d0fe6..000000000
--- a/mdk-stage1/dietlibc/libugly/netent.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <ctype.h>
-#include "dietfeatures.h"
-#include <netdb.h>
-#include <arpa/inet.h>
-
-static int netfd=-1;
-static char* netmap;
-static unsigned int netlen;
-
-static char* aliases[10];
-
-static char *cur;
-
-/* loopback 127.0.0.0 lo # comment */
-struct netent *getnetent(void) {
- static struct netent ne;
- char *last;
- int aliasidx;
- if (netfd<0) {
- netfd=open(_PATH_NETWORKS,O_RDONLY);
- if (netfd<0) return 0;
- fcntl (netfd, F_SETFD, FD_CLOEXEC);
- netlen=lseek(netfd,0,SEEK_END);
- netmap=mmap(0,netlen,PROT_READ|PROT_WRITE,MAP_PRIVATE,netfd,0);
- if ((long)netmap==(-1)) goto error;
- cur=netmap;
- }
- last=netmap+netlen;
-again:
- ne.n_name=0;
- ne.n_aliases=aliases; aliases[0]=0;
- ne.n_addrtype=AF_INET;
- ne.n_net=0;
- if (cur>=last) return 0;
- if (*cur=='#' || *cur=='\n') goto parseerror;
- /* first, the primary name */
- if (!isalpha(*cur)) goto parseerror;
- ne.n_name=cur;
- ne.n_aliases=aliases;
- while (cur<last && isalnum(*cur)) cur++;
- if (cur>=last) return 0;
- if (*cur=='\n') goto parseerror;
- *cur=0; cur++;
- /* second, the ip */
- while (cur<last && isblank(*cur)) cur++;
- {
- const char *tmp=cur;
- char save;
- while (cur<last && (isdigit(*cur) || *cur=='.')) ++cur;
- save=*cur; *cur=0;
- if (inet_aton(tmp,(struct in_addr*)&ne.n_net)==0) goto parseerror;
- *cur=save;
- }
- if (cur>=last) return 0;
- /* now the aliases */
- for (aliasidx=0;aliasidx<10;++aliasidx) {
- while (cur<last && isblank(*cur)) ++cur;
- aliases[aliasidx]=cur;
- while (cur<last && isalpha(*cur)) ++cur;
- if (*cur=='\n') { *cur++=0; ++aliasidx; break; }
- if (cur>=last || !isblank(*cur)) break;
- *cur++=0;
- }
- aliases[aliasidx]=0;
- return &ne;
-parseerror:
- while (cur<last && *cur!='\n') cur++;
- cur++;
- goto again;
-error:
- if (netmap!=(char*)-1) munmap(netmap,netlen);
- if (netfd!=-1) close(netfd);
- netmap=(char*)-1;
- netfd=-1;
- errno=ENOMEM;
- return 0;
-}
-
-struct netent *getnetbyaddr(unsigned long net, int type) {
- struct netent *s;
- for (s=getnetent(); s; s=getnetent()) {
- if (net==s->n_net && type==s->n_addrtype)
- return s;
- }
- return 0;
-}
-
-void endnetent(void) {
- if (netmap!=(char*)-1) munmap(netmap,netlen);
- if (netfd!=-1) close(netfd);
- netmap=(char*)-1;
- netfd=-1;
-}
-
-void setnetent(int stayopen) {
- (void)stayopen;
- endnetent();
-}
-
-struct netent *getnetbyname(const char *name) {
- struct netent *s;
- setnetent(0);
- for (s=getnetent(); s; s=getnetent()) {
- char **tmp;
-#if 0
- write(1,"found ",6);
- write(1,s->s_name,strlen(s->s_name));
- write(1,"/",1);
- write(1,s->s_proto,strlen(s->s_proto));
- write(1,"\n",1);
- if (!strcmp(s->s_name,"ssh")) {
- write(2,"ssh!\n",5);
- }
-#endif
- if (!strcmp(name,s->n_name))
- return s;
- tmp=s->n_aliases;
- while (*tmp)
- if (!strcmp(name,*tmp++)) return s;
- }
- return 0;
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/openpty.c b/mdk-stage1/dietlibc/libugly/openpty.c
deleted file mode 100644
index 8d06f329c..000000000
--- a/mdk-stage1/dietlibc/libugly/openpty.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <unistd.h>
-#include <pty.h>
-#include <fcntl.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <string.h>
-
-extern int __ltostr(char *s, int size, unsigned long i, int base, char UpCase);
-
-int openpty(int *amaster, int *aslave, char *name, struct termios
- *termp, struct winsize *winp) {
- int fd;
- char buf[20];
-#if 0
- This is what glibc does:
- open("/dev/ptmx", O_RDWR) = 4
- statfs("/dev/pts", {f_type=0x1cd1, f_bsize=1024, f_blocks=0, f_bfree=0, f_files=0, f_ffree=0, f_namelen=255}) = 0
- ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
- ioctl(4, 0x80045430, [0]) = 0
- stat("/dev/pts/0", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
- statfs("/dev/pts/0", {f_type=0x1cd1, f_bsize=1024, f_blocks=0, f_bfree=0, f_files=0, f_ffree=0, f_namelen=255}) = 0
- ioctl(4, 0x40045431, [0]) = 0
- ioctl(4, TCGETS, {B38400 opost isig icanon echo ...}) = 0
- ioctl(4, 0x80045430, [0]) = 0
- stat("/dev/pts/0", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
- open("/dev/pts/0", O_RDWR|O_NOCTTY) = 5
-#endif
- if ((fd=open("/dev/ptmx",O_RDWR))<0) return -1;
-#if 0
- if (ioctl(fd,TCGETS,&ts)<0) goto kaputt;
-#endif
- {
- int unlock=0;
- while (ioctl(fd,TIOCSPTLCK, &unlock)<0) if (errno!=EINTR) goto kaputt;
- }
- {
- int ptyno;
- while (ioctl(fd,TIOCGPTN,&ptyno)<0) if (errno!=EINTR) goto kaputt;
- strcpy(buf,"/dev/pts/");
- __ltostr(buf+9,10,ptyno,10,0);
- }
- *aslave=open(buf,O_RDWR|O_NOCTTY);
- if (*aslave<0) goto kaputt;
- *amaster=fd;
- if (name) strcpy(name,buf);
- if (termp)
- while (tcsetattr(*aslave,TCSAFLUSH,termp) && errno==EINTR);
- if (winp) while (ioctl(*aslave, TIOCSWINSZ, winp) && errno==EINTR);
- return 0;
-kaputt:
- close(fd);
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/pclose.c b/mdk-stage1/dietlibc/libugly/pclose.c
deleted file mode 100644
index e33076c19..000000000
--- a/mdk-stage1/dietlibc/libugly/pclose.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sys/types.h>
-#include <sys/wait.h>
-#include "dietstdio.h"
-
-int pclose(FILE *f) {
- int status;
- fclose(f);
- if (waitpid(f->popen_kludge,&status,0)>=0)
- return status;
- return -1;
-}
diff --git a/mdk-stage1/dietlibc/libugly/popen.c b/mdk-stage1/dietlibc/libugly/popen.c
deleted file mode 100644
index aa9a2cde0..000000000
--- a/mdk-stage1/dietlibc/libugly/popen.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "dietstdio.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include "binshstr.h"
-
-extern char **environ;
-
-FILE *popen(const char *command, const char *type) {
- int pfd[2];
- int fd0;
- FILE* f;
- pid_t pid;
-
- if (pipe(pfd)<0) return 0;
- fd0=(*type=='r');
- if (!(f=fdopen(pfd[!fd0],type))) {
- close(pfd[0]); /* malloc failed */
- close(pfd[1]);
- return 0;
- }
- if ((pid=fork())<0) {
- close(pfd[0]);
- close(pfd[1]);
- return 0;
- }
- if (!pid) { /* child */
- const char *argv[]={__sh,"-c",0,0};
- close(pfd[!fd0]); close(fd0);
- dup2(pfd[fd0],fd0); close(pfd[fd0]);
- argv[2]=command;
- execve(__binsh,(char*const*)argv,environ);
- _exit(127);
- }
- close(pfd[fd0]);
- fcntl (pfd[!fd0], F_SETFD, FD_CLOEXEC);
- f->popen_kludge=pid;
- return f;
-}
diff --git a/mdk-stage1/dietlibc/libugly/prioritynames.c b/mdk-stage1/dietlibc/libugly/prioritynames.c
deleted file mode 100644
index 87a99b76d..000000000
--- a/mdk-stage1/dietlibc/libugly/prioritynames.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <sys/syslog.h>
-
-#ifndef INTERNAL_NOPRI
-#define INTERNAL_NOPRI 0x10
-#endif
-
-CODE prioritynames[] =
- {
- { "alert", LOG_ALERT },
- { "crit", LOG_CRIT },
- { "debug", LOG_DEBUG },
- { "emerg", LOG_EMERG },
- { "err", LOG_ERR },
- { "error", LOG_ERR }, /* DEPRECATED */
- { "info", LOG_INFO },
- { "none", INTERNAL_NOPRI }, /* INTERNAL */
- { "notice", LOG_NOTICE },
- { "panic", LOG_EMERG }, /* DEPRECATED */
- { "warn", LOG_WARNING }, /* DEPRECATED */
- { "warning", LOG_WARNING },
- { 0, -1 }
- };
diff --git a/mdk-stage1/dietlibc/libugly/protoent_buf.c b/mdk-stage1/dietlibc/libugly/protoent_buf.c
deleted file mode 100644
index 0e303a5d4..000000000
--- a/mdk-stage1/dietlibc/libugly/protoent_buf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <netdb.h>
-
-struct protoent __protoent_pw;
-char __protoent_buf[1000];
-
diff --git a/mdk-stage1/dietlibc/libugly/ptsname.c b/mdk-stage1/dietlibc/libugly/ptsname.c
deleted file mode 100644
index a332faf6c..000000000
--- a/mdk-stage1/dietlibc/libugly/ptsname.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#define _XOPEN_SOURCE
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <stdlib.h>
-#include <string.h>
-
-# define MAX_FDS 4
-
-char *ptsname(int fd) {
- static char buffer[9+MAX_FDS]; /* Ahh..great */
- int pty;
-
- strcpy(buffer,"/dev/pts/");
- if ((ioctl(fd, TIOCGPTN, &pty)) == -1) return 0;
- __ltostr(buffer+9, MAX_FDS, pty, 10, 0);
- return buffer;
-}
diff --git a/mdk-stage1/dietlibc/libugly/putpwent.c b/mdk-stage1/dietlibc/libugly/putpwent.c
deleted file mode 100644
index f192c5934..000000000
--- a/mdk-stage1/dietlibc/libugly/putpwent.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* man, what a crook! */
-
-#include <pwd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#include "dietwarning.h"
-
-int putpwent(const struct passwd *p, FILE *stream) {
- if (p && stream) {
- fprintf(stream,"%s:%s:%d:%d:%s:%s:%s\n", p->pw_name, p->pw_passwd,
- p->pw_uid, p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell);
- return 0;
- }
- (*__errno_location())=EINVAL;
- return -1;
-}
-
-link_warning("putpwent","putpwent is garbage, don't use!")
diff --git a/mdk-stage1/dietlibc/libugly/servent_buf.c b/mdk-stage1/dietlibc/libugly/servent_buf.c
deleted file mode 100644
index b9e992adf..000000000
--- a/mdk-stage1/dietlibc/libugly/servent_buf.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <netdb.h>
-
-struct servent __servent_pw;
-char __servent_buf[1000];
-
diff --git a/mdk-stage1/dietlibc/libugly/setenv.c b/mdk-stage1/dietlibc/libugly/setenv.c
deleted file mode 100644
index c65910471..000000000
--- a/mdk-stage1/dietlibc/libugly/setenv.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-
-#include <dietwarning.h>
-link_warning("setenv","setenv calls malloc. Avoid it in small programs.");
-
-int setenv(const char *name, const char *value, int overwrite) {
- if (getenv(name)) {
- if (!overwrite) return 0;
- unsetenv(name);
- }
- {
- char *c=malloc(strlen(name)+strlen(value)+3);
- strcpy(c,name);
- strcat(c,"=");
- strcat(c,value);
- return putenv(c);
- }
-}
diff --git a/mdk-stage1/dietlibc/libugly/setmntent.c b/mdk-stage1/dietlibc/libugly/setmntent.c
deleted file mode 100644
index a91d3902b..000000000
--- a/mdk-stage1/dietlibc/libugly/setmntent.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-#include <mntent.h>
-
-FILE *setmntent(const char *filename, const char *type) {
- return fopen(filename,type);
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/strftime.c b/mdk-stage1/dietlibc/libugly/strftime.c
deleted file mode 100644
index 365d0c84f..000000000
--- a/mdk-stage1/dietlibc/libugly/strftime.c
+++ /dev/null
@@ -1,118 +0,0 @@
-#include <sys/types.h>
-#include <time.h>
-#include "dietfeatures.h"
-
-static const char sweekdays [7] [4] = {
- "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
-};
-static const char weekdays [7] [10] = {
- "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
-};
-static const char smonths [12] [4] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-};
-static const char* months [12] = {
- "January", "February", "March", "April", smonths[5-1], "June",
- "July", "August", "September", "October", "November", "December"
-};
-static const char ampm [4] [3] = {
- "am", "pm",
- "AM", "PM"
-};
-
-static int i2a ( char* dest,unsigned int x )
-{
- int div = 10;
- *dest++ = x/div + '0';
- *dest++ = x%div + '0';
- *dest++ = '\0';
- return 2;
-}
-
-size_t strftime ( char* dst, size_t max, const char* format, const struct tm* tm )
-{
- char* p = dst;
- const char* src;
- unsigned int no;
- char buf [5];
-
-
- for ( ; *format != '\0'; format++ ) {
- if (*format == '%') {
- if (*++format == '%') {
- *p++ = '%';
- }
- else
-again:
- switch (*format) {
-// case '%': *p++ = '%'; break; // reduce size of jump table
- case 'n': *p++ = '\n'; break;
- case 't': *p++ = '\t'; break;
- case 'O': case 'E': ++format; goto again;
- case 'c': src = "%b %a %d %k:%M:%S %Z %Y"; goto _strf;
- case 'r': src = "%I:%M:%S %p"; goto _strf;
- case 'R': src = "%H:%M"; goto _strf;
- case 'x': src = "%b %a %d"; goto _strf;
- case 'X': src = "%k:%M:%S"; goto _strf;
- case 'D': src = "%m/%d/%y"; goto _strf;
- case 'T': src = "%H:%M:%S";
- _strf: p += strftime (p, (size_t)(dst+max-p), src, tm); break;
- case 'a': src = sweekdays [tm->tm_wday]; goto _str;
- case 'A': src = weekdays [tm->tm_wday]; goto _str;
- case 'h':
- case 'b': src = smonths [tm->tm_mon]; goto _str;
- case 'B': src = months [tm->tm_mon]; goto _str;
- case 'p': src = ampm [tm->tm_hour > 12 ? 3 : 2]; goto _str;
- case 'P': src = ampm [tm->tm_hour > 12 ? 1 : 0]; goto _str;
- case 'C': no = tm->tm_year/100 + 19; goto _no;
- case 'd': no = tm->tm_mday; goto _no;
- case 'e': no = tm->tm_mday; goto _nos;
- case 'H': no = tm->tm_hour; goto _no;
- case 'I': no = tm->tm_hour % 12; goto _no;
- case 'j': no = tm->tm_yday; goto _no;
- case 'k': no = tm->tm_hour; goto _nos;
- case 'l': no = tm->tm_hour % 12; goto _nos;
- case 'm': no = tm->tm_mon + 1; goto _no;
- case 'M': no = tm->tm_min; goto _no;
- case 'S': no = tm->tm_sec; goto _no;
- case 'u': no = tm->tm_wday ? tm->tm_wday : 7; goto _no;
- case 'w': no = tm->tm_wday; goto _no;
- case 'U': no = (tm->tm_yday - tm->tm_wday + 7) / 7; goto _no;
- case 'W': no = (tm->tm_yday - (tm->tm_wday - 1 + 7) % 7 + 7) / 7; goto _no;
- case 'Z':
-#ifdef WANT_TZFILE_PARSER
- tzset(); src = tzname[0];
-#else
- src = "[unknown timezone]";
-#endif
- goto _str;
- case 'Y': i2a ( buf+0, (unsigned int)(tm->tm_year / 100 + 19) );
- i2a ( buf+2, (unsigned int)(tm->tm_year % 100) );
- src = buf;
- goto _str;
- case 'y': no = tm->tm_year % 100; goto _no;
- _no: i2a ( buf, no ); /* append number 'no' */
- src = buf;
- goto _str;
- _nos: i2a ( buf, no ); /* the same, but '0'->' ' */
- if (buf[0] == '0')
- buf[0] = ' ';
- src = buf;
- _str: while (*src && p < dst+max) /* append string */
- *p++ = *src++;
- break;
- };
- } else {
- *p++ = *format;
- }
-
- if (p >= dst+max)
- break;
- }
-
- *p = '\0';
- return p - dst;
-}
-
-
diff --git a/mdk-stage1/dietlibc/libugly/strndup.c b/mdk-stage1/dietlibc/libugly/strndup.c
deleted file mode 100644
index 7f912d4c6..000000000
--- a/mdk-stage1/dietlibc/libugly/strndup.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-
-char *strndup(const char *s,size_t n) {
- char *tmp=(char *)malloc(n+1);
- if (!tmp) return 0;
- strncpy(tmp,s,n);
- tmp[n]=0;
- return tmp;
-}
diff --git a/mdk-stage1/dietlibc/libugly/strsignal.c b/mdk-stage1/dietlibc/libugly/strsignal.c
deleted file mode 100644
index d72777571..000000000
--- a/mdk-stage1/dietlibc/libugly/strsignal.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#define _GNU_SOURCE
-#include <string.h>
-#include <signal.h>
-
-const char* strsignal(int sig) {
- if (sig<=SIGRTMAX)
- return sys_siglist[sig];
- else
- return "(unknown signal)";
-}
diff --git a/mdk-stage1/dietlibc/libugly/system.c b/mdk-stage1/dietlibc/libugly/system.c
deleted file mode 100644
index 714aad056..000000000
--- a/mdk-stage1/dietlibc/libugly/system.c
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <signal.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include "dietwarning.h"
-#include "dietfeatures.h"
-#include "binshstr.h"
-
-extern char **environ;
-
-int __libc_system (const char *line);
-
-int __libc_system (const char *line)
-{
- struct sigaction sa, intr, quit;
- sigset_t block,omask;
- int save,pid,ret=-1;
-
- if (line == 0) return __libc_system("exit 0") == 0;
-
- sa.sa_handler = SIG_IGN;
- sa.sa_flags = 0;
- sigemptyset (&sa.sa_mask);
-
- if (sigaction(SIGINT, &sa, &intr)<0) return -1;
- if (sigaction(SIGQUIT, &sa, &quit)<0) {
- save = errno;
-undo:
- sigaction (SIGINT, &intr, (struct sigaction*)0);
- errno=save;
- return -1;
- }
- sigemptyset(&block);
- sigaddset(&block,SIGCHLD);
- if (sigprocmask(SIG_BLOCK,&block,&omask)<0) {
- save=errno;
- sigaction (SIGQUIT, &quit, (struct sigaction*)0);
- goto undo;
- }
-
- pid=fork();
- if (pid>0)
- { /* parent */
- int n;
- do
- n=waitpid(pid, &ret, 0);
- while ((n==-1) && (errno==EINTR));
- if (n!=pid) ret=-1;
- }
- else if (!pid)
- { /* child */
- const char *nargs[4];
- nargs[0] = __sh;
- nargs[1] = "-c";
- nargs[2] = line;
- nargs[3] = 0;
-
- sigaction(SIGINT, &intr, (struct sigaction*)0);
- sigaction(SIGQUIT, &quit, (struct sigaction*)0);
- sigprocmask(SIG_SETMASK,&omask,0);
-
- execve(__binsh,(char *const *)nargs, environ);
- _exit(127);
- }
- save = errno;
- sigaction (SIGINT, &intr, (struct sigaction *)0);
- sigaction (SIGQUIT, &quit, (struct sigaction *)0);
- sigprocmask(SIG_SETMASK,&omask,0);
- errno=save;
- return ret;
-}
-
-int system (const char *line) __attribute__((weak,alias("__libc_system")));
-
-link_warning("system","warning: system() is a security risk. Use fork and execvp instead!")
diff --git a/mdk-stage1/dietlibc/libugly/time_table_spd.c b/mdk-stage1/dietlibc/libugly/time_table_spd.c
deleted file mode 100644
index 6850d76c4..000000000
--- a/mdk-stage1/dietlibc/libugly/time_table_spd.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <time.h>
-
-/* days per month -- nonleap! */
-const short __spm[12] =
- { 0,
- (31),
- (31+28),
- (31+28+31),
- (31+28+31+30),
- (31+28+31+30+31),
- (31+28+31+30+31+30),
- (31+28+31+30+31+30+31),
- (31+28+31+30+31+30+31+31),
- (31+28+31+30+31+30+31+31+30),
- (31+28+31+30+31+30+31+31+30+31),
- (31+28+31+30+31+30+31+31+30+31+30),
- };
-
diff --git a/mdk-stage1/dietlibc/libugly/timezone.c b/mdk-stage1/dietlibc/libugly/timezone.c
deleted file mode 100644
index e8a94a906..000000000
--- a/mdk-stage1/dietlibc/libugly/timezone.c
+++ /dev/null
@@ -1,3 +0,0 @@
-
-long int timezone;
-int daylight;
diff --git a/mdk-stage1/dietlibc/libugly/tzfile.c b/mdk-stage1/dietlibc/libugly/tzfile.c
deleted file mode 100644
index e0e8f7846..000000000
--- a/mdk-stage1/dietlibc/libugly/tzfile.c
+++ /dev/null
@@ -1,107 +0,0 @@
-#include "dietfeatures.h"
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <netinet/in.h>
-#include <time.h>
-
-/* #include <stdio.h> */
-
-char* tzname[2]={"GMT","GMT"};
-
-#ifdef WANT_TZFILE_PARSER
-static char *tzfile=0;
-static int tzlen=-1;
-
-void __maplocaltime(void);
-void __maplocaltime(void) {
- int fd;
- unsigned int len;
- if (tzlen>=0) return;
- tzlen=0;
- if ((fd=open("/etc/localtime",O_RDONLY))<0) return;
- len=lseek(fd,0,SEEK_END);
- if ((tzfile=mmap(0,len,PROT_READ,MAP_PRIVATE,fd,0))==MAP_FAILED) return;
- close(fd);
- if (ntohl(*(int*)tzfile) != 0x545a6966) return;
- tzlen=len;
-}
-
-static unsigned long __myntohl(const unsigned char* c) {
- return (((unsigned long)c[0])<<24) +
- (((unsigned long)c[1])<<16) +
- (((unsigned long)c[2])<<8) +
- ((unsigned long)c[3]);
-}
-
-time_t __tzfile_map(time_t t, int *isdst);
-time_t __tzfile_map(time_t t, int *isdst) {
- /* "TZif" plus 16 reserved bytes. */
- char *tmp;
- int i;
- int tzh_ttisgmtcnt, tzh_ttisstdcnt, tzh_leapcnt, tzh_timecnt, tzh_typecnt, tzh_charcnt;
- *isdst=0;
- if (!tzfile) return t;
- tzh_ttisgmtcnt=ntohl(*(int*)(tzfile+20));
- tzh_ttisstdcnt=ntohl(*(int*)(tzfile+24));
- tzh_leapcnt=ntohl(*(int*)(tzfile+28));
- tzh_timecnt=ntohl(*(int*)(tzfile+32));
- tzh_typecnt=ntohl(*(int*)(tzfile+36));
- tzh_charcnt=ntohl(*(int*)(tzfile+40));
-
-#if 0
- tmp=tzfile+20+6*4;
- printf("ttisgmtcnt %d ttisstdcnt %d leapcnt %d timecnt %d typecnt %d charcnt %d\n",tzh_ttisgmtcnt,tzh_ttisstdcnt, tzh_leapcnt, tzh_timecnt, tzh_typecnt, tzh_charcnt);
- printf("transition times: ");
- for (i=0; i<tzh_timecnt; ++i) {
- printf("%s%lu",i?", ":"",ntohl(*(int*)tmp)); tmp+=4;
- }
- printf("\n");
- printf("indices: ");
- for (i=0; i<tzh_timecnt; ++i) {
- printf("%s%d",i?", ":"",*tmp); ++tmp;
- }
- printf("\n");
- printf("transition times: ");
- for (i=0; i<tzh_typecnt; ++i) {
- printf("%s(%lu,%d,%d)",i?", ":"",ntohl(*(int*)tmp),tmp[4],tmp[5]); tmp+=6;
- }
- printf("\n");
- for (i=0; i<tzh_charcnt; ++i) {
- printf("%s\"%s\"",i?", ":"",tmp);
- tmp+=strlen(tmp);
- }
- printf("\n");
-#endif
-
- tmp=tzfile+20+6*4;
- daylight=(tzh_timecnt>0);
- for (i=0; i<tzh_timecnt; ++i) {
- if ((time_t)__myntohl(tmp+i*4) >= t) {
- char* tz=tmp;
-/* printf("match at %d\n",i); */
- tmp+=tzh_timecnt*4;
- i=tmp[i-1];
-/* printf("using index %d\n",i); */
- tmp+=tzh_timecnt;
- tz+=tzh_timecnt*5+tzh_leapcnt*4+tzh_typecnt*6;
- tmp+=i*6;
-/* printf("(%lu,%d,%d)\n",ntohl(*(int*)tmp),tmp[4],tmp[5]); */
- *isdst=tmp[4];
- tzname[0]=tz+tmp[5];
- timezone=-(__myntohl(tmp));
- return t-timezone;
- }
- }
- return t;
-}
-
-void tzset(void) {
- int isdst;
- __maplocaltime();
- __tzfile_map(time(0),&isdst);
-}
-
-#else
-void tzset(void) __attribute__((weak,alias("__nop")));
-#endif
diff --git a/mdk-stage1/dietlibc/libugly/unlockpt.c b/mdk-stage1/dietlibc/libugly/unlockpt.c
deleted file mode 100644
index e0246ed8e..000000000
--- a/mdk-stage1/dietlibc/libugly/unlockpt.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#define _XOPEN_SOURCE
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-int unlockpt (int fd) {
- int foo;
- /* hehe, that one is easy */
- return (ioctl (fd, TIOCSPTLCK, &foo));
-}
diff --git a/mdk-stage1/dietlibc/libugly/unsetenv.c b/mdk-stage1/dietlibc/libugly/unsetenv.c
deleted file mode 100644
index 46e880271..000000000
--- a/mdk-stage1/dietlibc/libugly/unsetenv.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdlib.h>
-
-void unsetenv(const char *name) {
- putenv(name);
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/utent.c b/mdk-stage1/dietlibc/libugly/utent.c
deleted file mode 100644
index d8d5d1ba7..000000000
--- a/mdk-stage1/dietlibc/libugly/utent.c
+++ /dev/null
@@ -1,103 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <utmp.h>
-
-static const char *utmp_file_name = _PATH_UTMP;
-static int fd = -1;
-
-static int lock_record(int type) {
- struct flock fl;
- fl.l_whence = SEEK_CUR;
- fl.l_start = 0;
- fl.l_len = sizeof(struct utmp);
- fl.l_pid = 0;
- fl.l_type = type;
- return fcntl(fd, F_SETLKW, &fl);
-}
-
-static int unlock_record() {
- struct flock fl;
- fl.l_whence = SEEK_CUR;
- fl.l_start = -sizeof(struct utmp);
- fl.l_len = sizeof(struct utmp);
- fl.l_pid = 0;
- fl.l_type = F_UNLCK;
- return fcntl(fd, F_SETLK, &fl);
-}
-
-void utmpname(const char *file) {
- if (file)
- utmp_file_name = file;
- else
- utmp_file_name = _PATH_UTMP;
-}
-
-void setutent() {
- if (fd<0) fd = open(utmp_file_name,O_RDWR);
- if (fd<0) fd = open(utmp_file_name,O_RDONLY);
- fcntl (fd, F_SETFD, FD_CLOEXEC);
- lseek(fd,0,SEEK_SET);
-}
-
-void endutent() {
- if (fd<0) return;
- close(fd); fd=-1;
-}
-
-struct utmp *getutent(void) {
- static struct utmp getutent_tmp;
- int ret;
-
- if (fd<0) {
- setutent();
- if (fd<0) return 0;
- }
- if (lock_record(F_RDLCK)) return 0;
- ret=read(fd, &getutent_tmp, sizeof(struct utmp));
- unlock_record();
- if (ret<1) return 0;
- return &getutent_tmp;
-}
-
-struct utmp *getutid(struct utmp *ut) {
- struct utmp *tmp;
-
- while ((tmp = getutent())) {
- if (ut->ut_type && (ut->ut_type <= OLD_TIME)) {
- if (ut->ut_type == tmp->ut_type) break;
- }
- if ((ut->ut_type >= INIT_PROCESS) && (ut->ut_type <= DEAD_PROCESS)) {
- if (!strncmp(ut->ut_id,tmp->ut_id,4)) break;
- }
- }
- return tmp;
-}
-
-struct utmp *getutline(struct utmp *ut) {
- struct utmp *tmp;
-
- while ((tmp = getutent())) {
- if ((tmp->ut_type == USER_PROCESS) || (tmp->ut_type == LOGIN_PROCESS)) {
- if (!strncmp(ut->ut_line,tmp->ut_line,UT_LINESIZE)) break;
- }
- }
- return tmp;
-}
-
-void pututline(struct utmp *ut) {
- struct utmp *tmp;
-
- if ((tmp = getutid(ut))) {
- lseek(fd, - (off_t)sizeof(struct utmp), SEEK_CUR);
- if (lock_record(F_WRLCK)) return;
- write(fd, ut, sizeof(struct utmp));
- }
- else {
- lseek(fd, 0, SEEK_END);
- if (lock_record(F_WRLCK)) return;
- write(fd, ut, (off_t)sizeof(struct utmp));
- }
- unlock_record();
-}
-
diff --git a/mdk-stage1/dietlibc/libugly/wtent.c b/mdk-stage1/dietlibc/libugly/wtent.c
deleted file mode 100644
index 1ca7c3202..000000000
--- a/mdk-stage1/dietlibc/libugly/wtent.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <utmp.h>
-
-void updwtmp(const char *wtmp_file, const struct utmp *ut) {
- int fd = open(wtmp_file, O_WRONLY|O_APPEND);
- if (fd<0) return;
- fcntl (fd, F_SETFD, FD_CLOEXEC);
- write(fd, ut, sizeof(struct utmp));
- close(fd);
-}
-
-void logwtmp(const char *line, const char *name, const char *host) {
- struct utmp ut;
-
- memset(&ut, 0, sizeof(struct utmp));
-
- ut.ut_pid = getpid ();
- ut.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS;
-
- memccpy (ut.ut_line, line, 0, sizeof ut.ut_line);
- memccpy (ut.ut_name, name, 0, sizeof ut.ut_name);
- memccpy (ut.ut_host, host, 0, sizeof ut.ut_host);
-
- gettimeofday (&ut.ut_tv, NULL);
-
- updwtmp (_PATH_WTMP, &ut);
-}
-
diff --git a/mdk-stage1/dietlibc/linuxnet.h b/mdk-stage1/dietlibc/linuxnet.h
deleted file mode 100644
index 8e2204701..000000000
--- a/mdk-stage1/dietlibc/linuxnet.h
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#define SYS_SOCKET 1 /* sys_socket(2) */
-#define SYS_BIND 2 /* sys_bind(2) */
-#define SYS_CONNECT 3 /* sys_connect(2) */
-#define SYS_LISTEN 4 /* sys_listen(2) */
-#define SYS_ACCEPT 5 /* sys_accept(2) */
-#define SYS_GETSOCKNAME 6 /* sys_getsockname(2) */
-#define SYS_GETPEERNAME 7 /* sys_getpeername(2) */
-#define SYS_SOCKETPAIR 8 /* sys_socketpair(2) */
-#define SYS_SEND 9 /* sys_send(2) */
-#define SYS_RECV 10 /* sys_recv(2) */
-#define SYS_SENDTO 11 /* sys_sendto(2) */
-#define SYS_RECVFROM 12 /* sys_recvfrom(2) */
-#define SYS_SHUTDOWN 13 /* sys_shutdown(2) */
-#define SYS_SETSOCKOPT 14 /* sys_setsockopt(2) */
-#define SYS_GETSOCKOPT 15 /* sys_getsockopt(2) */
-#define SYS_SENDMSG 16 /* sys_sendmsg(2) */
-#define SYS_RECVMSG 17 /* sys_recvmsg(2) */
-
diff --git a/mdk-stage1/dietlibc/parselib.h b/mdk-stage1/dietlibc/parselib.h
deleted file mode 100644
index 831d9da2b..000000000
--- a/mdk-stage1/dietlibc/parselib.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* parse lib: parse mmapped text with \n terminated lines */
-
-/* a memory buffer. */
-struct state {
- const unsigned char* buffirst;/* pointer to the buffer */
- size_t buflen; /* length of the buffer */
- size_t cur; /* already parsed bytes */
-};
-
-/* open and mmap file, fill in struct state */
-void __prepare_parse(const char* filename,struct state* s);
-/* unmap file */
-void __end_parse(struct state* s);
-
-/* return the length of the matching string, 0 on error */
-/* match while pred returns nonzero */
-size_t __parse(struct state* s,int (*pred)(int ch));
-
-size_t __parse_ws(struct state* s); /* skip ' ' or '\t', break at '\n' or '#' */
-size_t __parse_nws(struct state* s); /* skip non-whitespace, break at '\n' or '#' */
-size_t __parse_1(struct state* s,char c); /* skip to c */
-
-size_t scan_ulong(const char* s,unsigned long* l);
diff --git a/mdk-stage1/dietlibc/ppc/Makefile.add b/mdk-stage1/dietlibc/ppc/Makefile.add
deleted file mode 100644
index 641cf1ade..000000000
--- a/mdk-stage1/dietlibc/ppc/Makefile.add
+++ /dev/null
@@ -1,3 +0,0 @@
-
-CFLAGS+=-mpowerpc-gpopt -mpowerpc-gfxopt -Os
-VPATH:=ppc:syscalls.s:$(VPATH)
diff --git a/mdk-stage1/dietlibc/ppc/__longjmp.S b/mdk-stage1/dietlibc/ppc/__longjmp.S
deleted file mode 100644
index 8113eeeea..000000000
--- a/mdk-stage1/dietlibc/ppc/__longjmp.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <setjmp.h>
-
-
-#ifdef PIC
-#define JUMPTARGET(name) name##@plt
-#else
-#define JUMPTARGET(name) name
-#endif
-
-.global __longjmp
-.type __longjmp,@function
-.align 2
-__longjmp:
- lwz 1,(JB_GPR1*4)(3)
- lwz 2,(JB_GPR2*4)(3)
- lwz 0,(JB_LR*4)(3)
- lwz 14,((JB_GPRS+0)*4)(3)
- lfd 14,((JB_FPRS+0*2)*4)(3)
- lwz 15,((JB_GPRS+1)*4)(3)
- lfd 15,((JB_FPRS+1*2)*4)(3)
- lwz 16,((JB_GPRS+2)*4)(3)
- lfd 16,((JB_FPRS+2*2)*4)(3)
- lwz 17,((JB_GPRS+3)*4)(3)
- lfd 17,((JB_FPRS+3*2)*4)(3)
- lwz 18,((JB_GPRS+4)*4)(3)
- lfd 18,((JB_FPRS+4*2)*4)(3)
- lwz 19,((JB_GPRS+5)*4)(3)
- lfd 19,((JB_FPRS+5*2)*4)(3)
- lwz 20,((JB_GPRS+6)*4)(3)
- lfd 20,((JB_FPRS+6*2)*4)(3)
- mtlr 0
- lwz 21,((JB_GPRS+7)*4)(3)
- lfd 21,((JB_FPRS+7*2)*4)(3)
- lwz 22,((JB_GPRS+8)*4)(3)
- lfd 22,((JB_FPRS+8*2)*4)(3)
- lwz 0,(JB_CR*4)(3)
- lwz 23,((JB_GPRS+9)*4)(3)
- lfd 23,((JB_FPRS+9*2)*4)(3)
- lwz 24,((JB_GPRS+10)*4)(3)
- lfd 24,((JB_FPRS+10*2)*4)(3)
- lwz 25,((JB_GPRS+11)*4)(3)
- lfd 25,((JB_FPRS+11*2)*4)(3)
- mtcrf 0xFF,0
- lwz 26,((JB_GPRS+12)*4)(3)
- lfd 26,((JB_FPRS+12*2)*4)(3)
- lwz 27,((JB_GPRS+13)*4)(3)
- lfd 27,((JB_FPRS+13*2)*4)(3)
- lwz 28,((JB_GPRS+14)*4)(3)
- lfd 28,((JB_FPRS+14*2)*4)(3)
- lwz 29,((JB_GPRS+15)*4)(3)
- lfd 29,((JB_FPRS+15*2)*4)(3)
- lwz 30,((JB_GPRS+16)*4)(3)
- lfd 30,((JB_FPRS+16*2)*4)(3)
- lwz 31,((JB_GPRS+17)*4)(3)
- lfd 31,((JB_FPRS+17*2)*4)(3)
- mr 3,4
- blr
-.size __longjmp,.-__longjmp
-
diff --git a/mdk-stage1/dietlibc/ppc/__testandset.S b/mdk-stage1/dietlibc/ppc/__testandset.S
deleted file mode 100644
index 146982337..000000000
--- a/mdk-stage1/dietlibc/ppc/__testandset.S
+++ /dev/null
@@ -1,12 +0,0 @@
-.global __testandset
-.type __testandset,@function
-.align 2
-__testandset:
-1: lwarx 5,0,3
- li 0,1
- stwcx. 0,0,3
- bne- 1b
- mr 3,5
- blr
-.size __testandset,.-__testandset
-
diff --git a/mdk-stage1/dietlibc/ppc/clone.S b/mdk-stage1/dietlibc/ppc/clone.S
deleted file mode 100644
index 98f6bd4e8..000000000
--- a/mdk-stage1/dietlibc/ppc/clone.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <dietfeatures.h>
-#include "syscalls.h"
-#include <errno.h>
-
-.text
-.weak clone
-clone:
-.global __clone
-__clone:
- cmpwi 4,0 /* check have non null child_stack pointer */
- cmpwi cr1, 3,0 /* check have non null thread_funcion */
- cror eq,4*cr1+eq,eq /* now if eq is set one is or both are zero */
- beq .Lclone_error
-
- stwu 1,-32(1) /* alloc some space on the stack */
- stmw 29, 16(1) /* save r29,r30,r31 on stack */
-
- rlwinm 4,4,0,0,27 /* mask out lower 4 bits */
-
- /* move parameter to positions clone wants them */
- mr 29,3 /* r29 = r3 fn */
- mr 30,4 /* r30 = r4 stack */
- mr 31,6 /* r31 = r6 arg */
- mr 3, 5 /* r3 = r5 flags */
-
- li 0, __NR_clone /* load syscall nr. */
- sc
-
- cmpwi cr1,3,0 /* compare return of syscall with 0 */
- crandc 4*cr1+eq,4*cr1+eq,so
- bne .Lclone_parent /* return was non zero -> .Lclone_parent */
-
- /* we are the cloned process */
- mr 1, 30 /* set stack pointer */
- mtctr 29 /* set count register to fn ? */
- mr 3, 31 /* set argument */
- bctrl /* branch trough count register and link */
- b _exit /* exit thread */
-
-.Lclone_parent:
- lmw 29,16(1) /* restore saved registers */
- addi 1, 1,32 /* free stack */
- bnslr+ /* had cloned a thread so return to parent */
- b error_unified_syscall
-
-.Lclone_error:
- li 3, EINVAL
- b error_unified_syscall
diff --git a/mdk-stage1/dietlibc/ppc/mmap.c b/mdk-stage1/dietlibc/ppc/mmap.c
deleted file mode 100644
index d03e87089..000000000
--- a/mdk-stage1/dietlibc/ppc/mmap.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "dietfeatures.h"
-#include <sys/types.h>
-#include <errno.h>
-#include "syscalls.h"
-
-int mmap(void*start,size_t length,int prot,int flags,int fd,off_t offset) {
- unsigned long __sc_ret, __sc_err;
- {
- register unsigned long __sc_0 __asm__ ("r0");
- register unsigned long __sc_3 __asm__ ("r3");
- register unsigned long __sc_4 __asm__ ("r4");
- register unsigned long __sc_5 __asm__ ("r5");
- register unsigned long __sc_6 __asm__ ("r6");
- register unsigned long __sc_7 __asm__ ("r7");
- register unsigned long __sc_8 __asm__ ("r8");
-
- __sc_3 = (unsigned long) (start);
- __sc_4 = (unsigned long) (length);
- __sc_5 = (unsigned long) (prot);
- __sc_6 = (unsigned long) (flags);
- __sc_7 = (unsigned long) (fd);
- __sc_8 = (unsigned long) (offset);
- __sc_0 = __NR_mmap;
- __asm__ __volatile__
- ("sc \n\t"
- "mfcr %1 "
- : "=&r" (__sc_3), "=&r" (__sc_0)
- : "0" (__sc_3), "1" (__sc_0),
- "r" (__sc_4),
- "r" (__sc_5),
- "r" (__sc_6),
- "r" (__sc_7),
- "r" (__sc_8)
- : "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
- __sc_ret = __sc_3;
- __sc_err = __sc_0;
- }
- return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0),
- (int) __sc_ret;
-}
diff --git a/mdk-stage1/dietlibc/ppc/setjmp.S b/mdk-stage1/dietlibc/ppc/setjmp.S
deleted file mode 100644
index 50fa2bdd4..000000000
--- a/mdk-stage1/dietlibc/ppc/setjmp.S
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <setjmp.h>
-
-#ifdef PIC
-#define JUMPTARGET(name) name##@plt
-#else
-#define JUMPTARGET(name) name
-#endif
-
-.global __sigsetjmp
-.type __sigsetjmp,@function
-.align 2
-__sigsetjmp:
- stw 1,(JB_GPR1*4)(3)
- mflr 0
- stw 2,(JB_GPR2*4)(3)
- stw 14,((JB_GPRS+0)*4)(3)
- stfd 14,((JB_FPRS+0*2)*4)(3)
- stw 0,(JB_LR*4)(3)
- stw 15,((JB_GPRS+1)*4)(3)
- stfd 15,((JB_FPRS+1*2)*4)(3)
- mfcr 0
- stw 16,((JB_GPRS+2)*4)(3)
- stfd 16,((JB_FPRS+2*2)*4)(3)
- stw 0,(JB_CR*4)(3)
- stw 17,((JB_GPRS+3)*4)(3)
- stfd 17,((JB_FPRS+3*2)*4)(3)
- stw 18,((JB_GPRS+4)*4)(3)
- stfd 18,((JB_FPRS+4*2)*4)(3)
- stw 19,((JB_GPRS+5)*4)(3)
- stfd 19,((JB_FPRS+5*2)*4)(3)
- stw 20,((JB_GPRS+6)*4)(3)
- stfd 20,((JB_FPRS+6*2)*4)(3)
- stw 21,((JB_GPRS+7)*4)(3)
- stfd 21,((JB_FPRS+7*2)*4)(3)
- stw 22,((JB_GPRS+8)*4)(3)
- stfd 22,((JB_FPRS+8*2)*4)(3)
- stw 23,((JB_GPRS+9)*4)(3)
- stfd 23,((JB_FPRS+9*2)*4)(3)
- stw 24,((JB_GPRS+10)*4)(3)
- stfd 24,((JB_FPRS+10*2)*4)(3)
- stw 25,((JB_GPRS+11)*4)(3)
- stfd 25,((JB_FPRS+11*2)*4)(3)
- stw 26,((JB_GPRS+12)*4)(3)
- stfd 26,((JB_FPRS+12*2)*4)(3)
- stw 27,((JB_GPRS+13)*4)(3)
- stfd 27,((JB_FPRS+13*2)*4)(3)
- stw 28,((JB_GPRS+14)*4)(3)
- stfd 28,((JB_FPRS+14*2)*4)(3)
- stw 29,((JB_GPRS+15)*4)(3)
- stfd 29,((JB_FPRS+15*2)*4)(3)
- stw 30,((JB_GPRS+16)*4)(3)
- stfd 30,((JB_FPRS+16*2)*4)(3)
- stw 31,((JB_GPRS+17)*4)(3)
- stfd 31,((JB_FPRS+17*2)*4)(3)
- b JUMPTARGET (__sigjmp_save)
-.size __sigsetjmp,.-__sigsetjmp
diff --git a/mdk-stage1/dietlibc/ppc/start.S b/mdk-stage1/dietlibc/ppc/start.S
deleted file mode 100644
index 7b2aed7fb..000000000
--- a/mdk-stage1/dietlibc/ppc/start.S
+++ /dev/null
@@ -1,42 +0,0 @@
-.text
-.global _start
-.type _start,@function
-_start:
- /* Save the stack pointer, in case we're statically linked under Linux. */
- mr 9,1
- /* Set up an initial stack frame, and clear the LR. */
- clrrwi 1,1,4
- li 0,0
- stwu 1,-16(1)
- mtlr 0
- stw 0,0(1)
-
- /* r9 contains the initial stack pointer
- argc = (r9)
- argv = (r9+4)
- envp = argv+(argc+1)*4 */
-
- lwzu 3,0(9) /* argc */
- addi 4,9,4 /* argv */
- add 5,0,3 /* argc... */
- addi 5,5,1 /* argc+1...*/
- slwi 5,5,2 /* (argc+1)*4 */
- add 5,5,4 /* argv+(argc+1)*4 */
-
- lis 14,environ@ha
- stw 5,environ@l(14)
-
-#ifdef WANT_DYNAMIC
- mr 6,7
- bl _dyn_start
-#else
- bl main
-#endif
- b exit
-.size _start,.-_start
-
-
-/* Define a symbol for the first piece of initialized data. */
- .section ".data"
-__data_start:
-
diff --git a/mdk-stage1/dietlibc/ppc/syscalls.h b/mdk-stage1/dietlibc/ppc/syscalls.h
deleted file mode 100644
index 5e8707357..000000000
--- a/mdk-stage1/dietlibc/ppc/syscalls.h
+++ /dev/null
@@ -1,259 +0,0 @@
-
-#define __NR_exit 1
-#define __NR_fork 2
-#define __NR_read 3
-#define __NR_write 4
-#define __NR_open 5
-#define __NR_close 6
-#define __NR_waitpid 7
-#define __NR_creat 8
-#define __NR_link 9
-#define __NR_unlink 10
-#define __NR_execve 11
-#define __NR_chdir 12
-#define __NR_time 13
-#define __NR_mknod 14
-#define __NR_chmod 15
-#define __NR_lchown 16
-#define __NR_break 17
-#define __NR_oldstat 18
-#define __NR_lseek 19
-#define __NR_getpid 20
-#define __NR_mount 21
-#define __NR_umount 22
-#define __NR_setuid 23
-#define __NR_getuid 24
-#define __NR_stime 25
-#define __NR_ptrace 26
-#define __NR_alarm 27
-#define __NR_oldfstat 28
-#define __NR_pause 29
-#define __NR_utime 30
-#define __NR_stty 31
-#define __NR_gtty 32
-#define __NR_access 33
-#define __NR_nice 34
-#define __NR_ftime 35
-#define __NR_sync 36
-#define __NR_kill 37
-#define __NR_rename 38
-#define __NR_mkdir 39
-#define __NR_rmdir 40
-#define __NR_dup 41
-#define __NR_pipe 42
-#define __NR_times 43
-#define __NR_prof 44
-#define __NR_brk 45
-#define __NR_setgid 46
-#define __NR_getgid 47
-#define __NR_signal 48
-#define __NR_geteuid 49
-#define __NR_getegid 50
-#define __NR_acct 51
-#define __NR_umount2 52
-#define __NR_lock 53
-#define __NR_ioctl 54
-#define __NR_fcntl 55
-#define __NR_mpx 56
-#define __NR_setpgid 57
-#define __NR_ulimit 58
-#define __NR_oldolduname 59
-#define __NR_umask 60
-#define __NR_chroot 61
-#define __NR_ustat 62
-#define __NR_dup2 63
-#define __NR_getppid 64
-#define __NR_getpgrp 65
-#define __NR_setsid 66
-#define __NR_sigaction 67
-#define __NR_sgetmask 68
-#define __NR_ssetmask 69
-#define __NR_setreuid 70
-#define __NR_setregid 71
-#define __NR_sigsuspend 72
-#define __NR_sigpending 73
-#define __NR_sethostname 74
-#define __NR_setrlimit 75
-#define __NR_getrlimit 76
-#define __NR_getrusage 77
-#define __NR_gettimeofday 78
-#define __NR_settimeofday 79
-#define __NR_getgroups 80
-#define __NR_setgroups 81
-#define __NR_select 82
-#define __NR_symlink 83
-#define __NR_oldlstat 84
-#define __NR_readlink 85
-#define __NR_uselib 86
-#define __NR_swapon 87
-#define __NR_reboot 88
-#define __NR_readdir 89
-#define __NR_mmap 90
-#define __NR_munmap 91
-#define __NR_truncate 92
-#define __NR_ftruncate 93
-#define __NR_fchmod 94
-#define __NR_fchown 95
-#define __NR_getpriority 96
-#define __NR_setpriority 97
-#define __NR_profil 98
-#define __NR_statfs 99
-#define __NR_fstatfs 100
-#define __NR_ioperm 101
-#define __NR_socketcall 102
-#define __NR_syslog 103
-#define __NR_setitimer 104
-#define __NR_getitimer 105
-#define __NR_stat 106
-#define __NR_lstat 107
-#define __NR_fstat 108
-#define __NR_olduname 109
-#define __NR_iopl 110
-#define __NR_vhangup 111
-#define __NR_idle 112
-#define __NR_vm86 113
-#define __NR_wait4 114
-#define __NR_swapoff 115
-#define __NR_sysinfo 116
-#define __NR_ipc 117
-#define __NR_fsync 118
-#define __NR_sigreturn 119
-#define __NR_clone 120
-#define __NR_setdomainname 121
-#define __NR_uname 122
-#define __NR_modify_ldt 123
-#define __NR_adjtimex 124
-#define __NR_mprotect 125
-#define __NR_sigprocmask 126
-#define __NR_create_module 127
-#define __NR_init_module 128
-#define __NR_delete_module 129
-#define __NR_get_kernel_syms 130
-#define __NR_quotactl 131
-#define __NR_getpgid 132
-#define __NR_fchdir 133
-#define __NR_bdflush 134
-#define __NR_sysfs 135
-#define __NR_personality 136
-#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
-#define __NR_setfsuid 138
-#define __NR_setfsgid 139
-#define __NR__llseek 140
-#define __NR_getdents 141
-#define __NR__newselect 142
-#define __NR_flock 143
-#define __NR_msync 144
-#define __NR_readv 145
-#define __NR_writev 146
-#define __NR_getsid 147
-#define __NR_fdatasync 148
-#define __NR__sysctl 149
-#define __NR_mlock 150
-#define __NR_munlock 151
-#define __NR_mlockall 152
-#define __NR_munlockall 153
-#define __NR_sched_setparam 154
-#define __NR_sched_getparam 155
-#define __NR_sched_setscheduler 156
-#define __NR_sched_getscheduler 157
-#define __NR_sched_yield 158
-#define __NR_sched_get_priority_max 159
-#define __NR_sched_get_priority_min 160
-#define __NR_sched_rr_get_interval 161
-#define __NR_nanosleep 162
-#define __NR_mremap 163
-#define __NR_setresuid 164
-#define __NR_getresuid 165
-#define __NR_query_module 166
-#define __NR_poll 167
-#define __NR_nfsservctl 168
-#define __NR_setresgid 169
-#define __NR_getresgid 170
-#define __NR_prctl 171
-#define __NR_rt_sigreturn 172