summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:47:09 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-06-04 18:47:09 +0000
commitc46806bf74c2618daa398cb7c3e4b1c47509a105 (patch)
tree0b429074ffc365e7eba2391cf00d7f4eecf372ab /mdk-stage1/dietlibc/lib
parent7b14ca284d598e7748f6f7a831389525c84890ba (diff)
downloaddrakx-c46806bf74c2618daa398cb7c3e4b1c47509a105.tar
drakx-c46806bf74c2618daa398cb7c3e4b1c47509a105.tar.gz
drakx-c46806bf74c2618daa398cb7c3e4b1c47509a105.tar.bz2
drakx-c46806bf74c2618daa398cb7c3e4b1c47509a105.tar.xz
drakx-c46806bf74c2618daa398cb7c3e4b1c47509a105.zip
even more removals
Diffstat (limited to 'mdk-stage1/dietlibc/lib')
-rw-r--r--mdk-stage1/dietlibc/lib/__xmknod.c6
-rw-r--r--mdk-stage1/dietlibc/lib/alarm.c47
-rw-r--r--mdk-stage1/dietlibc/lib/errlist.c132
-rw-r--r--mdk-stage1/dietlibc/lib/getservent.c137
-rw-r--r--mdk-stage1/dietlibc/lib/memccmp.c17
-rw-r--r--mdk-stage1/dietlibc/lib/nop.c7
-rw-r--r--mdk-stage1/dietlibc/lib/puts.c12
-rw-r--r--mdk-stage1/dietlibc/lib/random.c9
-rw-r--r--mdk-stage1/dietlibc/lib/set_errno.c9
-rw-r--r--mdk-stage1/dietlibc/lib/speed.c67
-rw-r--r--mdk-stage1/dietlibc/lib/vfprintf.c19
-rw-r--r--mdk-stage1/dietlibc/lib/vprintf.c14
12 files changed, 0 insertions, 476 deletions
diff --git a/mdk-stage1/dietlibc/lib/__xmknod.c b/mdk-stage1/dietlibc/lib/__xmknod.c
deleted file mode 100644
index 4739a1f5f..000000000
--- a/mdk-stage1/dietlibc/lib/__xmknod.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <sys/stat.h>
-
-int __xmknod(int ver,char* filename,mode_t mode,dev_t *dev) {
- return mknod(filename,mode,*dev);
-}
-
diff --git a/mdk-stage1/dietlibc/lib/alarm.c b/mdk-stage1/dietlibc/lib/alarm.c
deleted file mode 100644
index fd35372f2..000000000
--- a/mdk-stage1/dietlibc/lib/alarm.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 1991, 1992, 1994, 1997 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. */
-
-#include <unistd.h>
-#include <sys/time.h>
-
-/* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM.
- If SECONDS is zero, any currently scheduled alarm will be cancelled.
- The function returns the number of seconds remaining until the last
- alarm scheduled would have signaled, or zero if there wasn't one.
- There is no return value to indicate an error, but you can set `errno'
- to 0 and check its value after calling `alarm', and this might tell you.
- The signal may come late due to processor scheduling. */
-unsigned int
-alarm (seconds)
- unsigned int seconds;
-{
- struct itimerval old, new;
- unsigned int retval;
-
- new.it_interval.tv_usec = 0;
- new.it_interval.tv_sec = 0;
- new.it_value.tv_usec = 0;
- new.it_value.tv_sec = (long int) seconds;
- if (setitimer (ITIMER_REAL, &new, &old) < 0)
- return 0;
-
- retval = old.it_value.tv_sec;
- if (old.it_value.tv_usec)
- ++retval;
- return retval;
-}
diff --git a/mdk-stage1/dietlibc/lib/errlist.c b/mdk-stage1/dietlibc/lib/errlist.c
deleted file mode 100644
index d0e712190..000000000
--- a/mdk-stage1/dietlibc/lib/errlist.c
+++ /dev/null
@@ -1,132 +0,0 @@
-
-const char *const sys_errlist[] = {
- "Success", /* 0 */
- "Operation not permitted", /* EPERM */
- "No such file or directory", /* ENOENT */
- "No such process", /* ESRCH */
- "Interrupted system call", /* EINTR */
- "I/O error", /* EIO */
- "No such device or address", /* ENXIO */
- "Arg list too long", /* E2BIG */
- "Exec format error", /* ENOEXEC */
- "Bad file number", /* EBADF */
- "No child processes", /* ECHILD */
- "Try again", /* EAGAIN */
- "Out of memory", /* ENOMEM */
- "Permission denied", /* EACCES */
- "Bad address", /* EFAULT */
- "Block device required", /* ENOTBLK */
- "Device or resource busy", /* EBUSY */
- "File exists", /* EEXIST */
- "Cross-device link", /* EXDEV */
- "No such device", /* ENODEV */
- "Not a directory", /* ENOTDIR */
- "Is a directory", /* EISDIR */
- "Invalid argument", /* EINVAL */
- "File table overflow", /* ENFILE */
- "Too many open files", /* EMFILE */
- "Not a typewriter", /* ENOTTY */
- "Text file busy", /* ETXTBSY */
- "File too large", /* EFBIG */
- "No space left on device", /* ENOSPC */
- "Illegal seek", /* ESPIPE */
- "Read-only file system", /* EROFS */
- "Too many links", /* EMLINK */
- "Broken pipe", /* EPIPE */
- "Math argument out of domain of func", /* EDOM */
- "Math result not representable", /* ERANGE */
- "Resource deadlock would occur", /* EDEADLK */
- "File name too long", /* ENAMETOOLONG */
- "No record locks available", /* ENOLCK */
- "Function not implemented", /* ENOSYS */
- "Directory not empty", /* ENOTEMPTY */
- "Too many symbolic links encountered", /* ELOOP */
- "Operation would block", /* EWOULDBLOCK */
- "No message of desired type", /* ENOMSG */
- "Identifier removed", /* EIDRM */
- "Channel number out of range", /* ECHRNG */
- "Level 2 not synchronized", /* EL2NSYNC */
- "Level 3 halted", /* EL3HLT */
- "Level 3 reset", /* EL3RST */
- "Link number out of range", /* ELNRNG */
- "Protocol driver not attached", /* EUNATCH */
- "No CSI structure available", /* ENOCSI */
- "Level 2 halted", /* EL2HLT */
- "Invalid exchange", /* EBADE */
- "Invalid request descriptor", /* EBADR */
- "Exchange full", /* EXFULL */
- "No anode", /* ENOANO */
- "Invalid request code", /* EBADRQC */
- "Invalid slot", /* EBADSLT */
- "File locking deadlock error", /* EDEADLOCK */
- "Bad font file format", /* EBFONT */
- "Device not a stream", /* ENOSTR */
- "No data available", /* ENODATA */
- "Timer expired", /* ETIME */
- "Out of streams resources", /* ENOSR */
- "Machine is not on the network", /* ENONET */
- "Package not installed", /* ENOPKG */
- "Object is remote", /* EREMOTE */
- "Link has been severed", /* ENOLINK */
- "Advertise error", /* EADV */
- "Srmount error", /* ESRMNT */
- "Communication error on send", /* ECOMM */
- "Protocol error", /* EPROTO */
- "Multihop attempted", /* EMULTIHOP */
- "RFS specific error", /* EDOTDOT */
- "Not a data message", /* EBADMSG */
- "Value too large for defined data type", /* EOVERFLOW */
- "Name not unique on network", /* ENOTUNIQ */
- "File descriptor in bad state", /* EBADFD */
- "Remote address changed", /* EREMCHG */
- "Can not access a needed shared library", /* ELIBACC */
- "Accessing a corrupted shared library", /* ELIBBAD */
- ".lib section in a.out corrupted", /* ELIBSCN */
- "Attempting to link in too many shared libraries", /* ELIBMAX */
- "Cannot exec a shared library directly", /* ELIBEXEC */
- "Illegal byte sequence", /* EILSEQ */
- "Interrupted system call should be restarted", /* ERESTART */
- "Streams pipe error", /* ESTRPIPE */
- "Too many users", /* EUSERS */
- "Socket operation on non-socket", /* ENOTSOCK */
- "Destination address required", /* EDESTADDRREQ */
- "Message too long", /* EMSGSIZE */
- "Protocol wrong type for socket", /* EPROTOTYPE */
- "Protocol not available", /* ENOPROTOOPT */
- "Protocol not supported", /* EPROTONOSUPPORT */
- "Socket type not supported", /* ESOCKTNOSUPPORT */
- "Operation not supported on transport endpoint", /* EOPNOTSUPP */
- "Protocol family not supported", /* EPFNOSUPPORT */
- "Address family not supported by protocol", /* EAFNOSUPPORT */
- "Address already in use", /* EADDRINUSE */
- "Cannot assign requested address", /* EADDRNOTAVAIL */
- "Network is down", /* ENETDOWN */
- "Network is unreachable", /* ENETUNREACH */
- "Network dropped connection because of reset", /* ENETRESET */
- "Software caused connection abort", /* ECONNABORTED */
- "Connection reset by peer", /* ECONNRESET */
- "No buffer space available", /* ENOBUFS */
- "Transport endpoint is already connected", /* EISCONN */
- "Transport endpoint is not connected", /* ENOTCONN */
- "Cannot send after transport endpoint shutdown", /* ESHUTDOWN */
- "Too many references: cannot splice", /* ETOOMANYREFS */
- "Connection timed out", /* ETIMEDOUT */
- "Connection refused", /* ECONNREFUSED */
- "Host is down", /* EHOSTDOWN */
- "No route to host", /* EHOSTUNREACH */
- "Operation already in progress", /* EALREADY */
- "Operation now in progress", /* EINPROGRESS */
- "Stale NFS file handle", /* ESTALE */
- "Structure needs cleaning", /* EUCLEAN */
- "Not a XENIX named type file", /* ENOTNAM */
- "No XENIX semaphores available", /* ENAVAIL */
- "Is a named type file", /* EISNAM */
- "Remote I/O error", /* EREMOTEIO */
- "Quota exceeded", /* EDQUOT */
- "No medium found", /* ENOMEDIUM */
- "Wrong medium type", /* EMEDIUMTYPE */
- 0
-};
-
-
-const int sys_nerr = ((sizeof (sys_errlist))/(sizeof(char *))-1);
diff --git a/mdk-stage1/dietlibc/lib/getservent.c b/mdk-stage1/dietlibc/lib/getservent.c
deleted file mode 100644
index bf25d046b..000000000
--- a/mdk-stage1/dietlibc/lib/getservent.c
+++ /dev/null
@@ -1,137 +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>
-
-static int servicesfd=-1;
-static char* servicesmap;
-static unsigned int serviceslen;
-
-static char* aliases[10];
-
-static char *cur;
-
-/* nameserver 42/tcp name # IEN 116 */
-struct servent *getservent(void) {
- static struct servent se;
- char *last;
- int aliasidx;
- if (servicesfd<0) {
- servicesfd=open(_PATH_SERVICES,O_RDONLY);
- if (servicesfd<0) return 0;
- serviceslen=lseek(servicesfd,0,SEEK_END);
- servicesmap=mmap(0,serviceslen,PROT_READ|PROT_WRITE,MAP_PRIVATE,servicesfd,0);
- if ((long)servicesmap==(-1)) goto error;
- cur=servicesmap;
- }
- last=servicesmap+serviceslen;
-again:
- se.s_name=0;
- se.s_aliases=aliases; aliases[0]=0;
- se.s_port=0;
- se.s_proto=0;
- if (cur>=last) return 0;
- if (*cur=='#' || *cur=='\n') goto parseerror;
- /* first, the primary name */
- if (!isalpha(*cur)) goto parseerror;
- se.s_name=cur;
- se.s_aliases=aliases;
- while (cur<last && isalnum(*cur)) cur++;
- if (cur>=last) return 0;
- if (*cur=='\n') goto parseerror;
- *cur=0; cur++;
- /* second, the port */
- while (cur<last && isblank(*cur)) cur++;
- while (cur<last && isdigit(*cur)) {
- se.s_port=se.s_port*10+*cur-'0';
- cur++;
- }
- se.s_port=htons(se.s_port);
- if (cur>=last) return 0;
- /* third, "/tcp" or "/udp" */
- if (*cur!='/') goto parseerror;
- cur++;
- se.s_proto=cur;
- while (cur<last && isalpha(*cur)) ++cur;
- if (cur>=last) return 0;
- if (*cur=='\n') { *cur++=0; return &se; }
- *cur=0; cur++;
- /* 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 &se;
-parseerror:
- while (cur<last && *cur!='\n') cur++;
- cur++;
- goto again;
-error:
- if (servicesmap!=(char*)-1) munmap(servicesmap,serviceslen);
- if (servicesfd!=-1) close(servicesfd);
- servicesmap=(char*)-1;
- servicesfd=-1;
- errno=ENOMEM;
- return 0;
-}
-
-void setservent(int stayopen) {
- cur=servicesmap;
-}
-
-struct servent *getservbyname(const char *name, const char *proto) {
- struct servent *s;
- setservent(0);
- for (s=getservent(); s; s=getservent()) {
- 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(name,"auth")) {
- tmp=s->s_aliases;
- write(1," aka ",5);
- while (*tmp) {
- write(1,*tmp,strlen(*tmp));
- write(1,", ",2);
- ++tmp;
- }
- write(1,"\n",1);
- }
-#endif
- if (!strcmp(name,s->s_name) && !strcmp(proto,s->s_proto))
- return s;
- tmp=s->s_aliases;
- while (*tmp)
- if (!strcmp(name,*tmp++)) return s;
- }
- return 0;
-}
-
-struct servent *getservbyport(int port, const char *proto) {
- struct servent *s;
- for (s=getservent(); s; s=getservent()) {
- if (port==s->s_port && !strcmp(proto,s->s_proto))
- return s;
- }
- return 0;
-}
-
-void endservent(void) {
- if (servicesmap!=(char*)-1) munmap(servicesmap,serviceslen);
- if (servicesfd!=-1) close(servicesfd);
- servicesmap=(char*)-1;
- servicesfd=-1;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/memccmp.c b/mdk-stage1/dietlibc/lib/memccmp.c
deleted file mode 100644
index 3a8c14f60..000000000
--- a/mdk-stage1/dietlibc/lib/memccmp.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#define _POSIX_SOURCE
-#define _XOPEN_SOURCE
-#include <sys/types.h>
-
-int memccmp(const void *dst, const void *src, int c, size_t count)
-{
- register const char *a = dst;
- register const char *b = src;
- while (count--)
- {
- register int res=(*a - *b);
- if (res) return res;
- if (*a==c) return 0;
- ++a; ++b;
- }
- return 0;
-}
diff --git a/mdk-stage1/dietlibc/lib/nop.c b/mdk-stage1/dietlibc/lib/nop.c
deleted file mode 100644
index c05bea813..000000000
--- a/mdk-stage1/dietlibc/lib/nop.c
+++ /dev/null
@@ -1,7 +0,0 @@
-
-int __fflush_stdin() __attribute__((weak,alias("__return0")));
-int __fflush_stdout() __attribute__((weak,alias("__return0")));
-int __fflush_stderr() __attribute__((weak,alias("__return0")));
-
-/* used for weak aliases */
-int __return0() { return 0; }
diff --git a/mdk-stage1/dietlibc/lib/puts.c b/mdk-stage1/dietlibc/lib/puts.c
deleted file mode 100644
index 54415151d..000000000
--- a/mdk-stage1/dietlibc/lib/puts.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <unistd.h>
-#include <string.h>
-#include "dietstdio.h"
-#include "dietfeatures.h"
-
-int puts(const char *s) {
-#ifdef WANT_BUFFERED_STDIO
- return fwrite(s,1,strlen(s),stdout) && fputc('\n',stdout);
-#else
- return write(1,s,strlen(s)) && write(1,"\n",1);
-#endif
-}
diff --git a/mdk-stage1/dietlibc/lib/random.c b/mdk-stage1/dietlibc/lib/random.c
deleted file mode 100644
index e7785c455..000000000
--- a/mdk-stage1/dietlibc/lib/random.c
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <stdlib.h>
-
-static unsigned int seed=1;
-
-long int random() {
- return ((seed = seed * 1103515245 + 12345) % ((unsigned int)RAND_MAX + 1));
-}
-
-void srandom(unsigned int i) { seed=i; }
diff --git a/mdk-stage1/dietlibc/lib/set_errno.c b/mdk-stage1/dietlibc/lib/set_errno.c
deleted file mode 100644
index 6553bc496..000000000
--- a/mdk-stage1/dietlibc/lib/set_errno.c
+++ /dev/null
@@ -1,9 +0,0 @@
-extern int errno;
-
-void __set_errno(int error) __attribute__ ((weak));
-
-void __set_errno(int error)
-{
- errno=error;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/speed.c b/mdk-stage1/dietlibc/lib/speed.c
deleted file mode 100644
index a7fcca7c9..000000000
--- a/mdk-stage1/dietlibc/lib/speed.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <unistd.h>
-#include <termios.h>
-#include <sys/types.h>
-
-#include <asm/errno.h>
-
-extern int errno;
-
-/* Hack around a kernel bug; value must correspond to the one used in tcsetattr.c */
-#define IBAUD0 020000000000
-
-
-/* Return the output baud rate stored in *TERMIOS_P. */
-speed_t cfgetospeed (struct termios *termios_p)
-{
- return termios_p->c_cflag & (CBAUD | CBAUDEX);
-}
-
-
-/* Return the input baud rate stored in *TERMIOS_P.
- Although for Linux there is no difference between input and output
- speed, the numerical 0 is a special case for the input baud rate. It
- should set the input baud rate to the output baud rate. */
-speed_t cfgetispeed (struct termios *termios_p)
-{
- return ((termios_p->c_iflag & IBAUD0)
- ? 0 : termios_p->c_cflag & (CBAUD | CBAUDEX));
-}
-
-
-/* Set the output baud rate stored in *TERMIOS_P to SPEED. */
-int cfsetospeed (struct termios *termios_p, speed_t speed)
-{
- if ((speed & ~CBAUD) != 0 && (speed < B57600 || speed > B460800)) {
- errno = EINVAL;
- return -1;
- }
-
- termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
- termios_p->c_cflag |= speed;
-
- return 0;
-}
-
-
-/* Set the input baud rate stored in *TERMIOS_P to SPEED.
- Although for Linux there is no difference between input and output
- speed, the numerical 0 is a special case for the input baud rate. It
- should set the input baud rate to the output baud rate. */
-int cfsetispeed (struct termios *termios_p, speed_t speed)
-{
- if ((speed & ~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/vfprintf.c b/mdk-stage1/dietlibc/lib/vfprintf.c
deleted file mode 100644
index c33a2404b..000000000
--- a/mdk-stage1/dietlibc/lib/vfprintf.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "dietstdarg.h"
-
-int vfprintf(FILE *fstream, const char *format, va_list ap)
-{
- char *tmp;
- va_list cp_ap;
- size_t n = 0;
-
- va_copy(cp_ap, ap);
- n=vsnprintf(0, 1000000, format, cp_ap);
- tmp=alloca(n+2);
- vsnprintf(tmp, n+1, format, ap);
- fwrite(tmp, n,1, fstream);
- return n;
-}
-
diff --git a/mdk-stage1/dietlibc/lib/vprintf.c b/mdk-stage1/dietlibc/lib/vprintf.c
deleted file mode 100644
index 46ecc47a4..000000000
--- a/mdk-stage1/dietlibc/lib/vprintf.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdarg.h>
-#include <linux/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-int vsnprintf (char *str,size_t size,const char *format, va_list arg_ptr);
-
-int vprintf(const char *format, va_list ap)
-{
- char tmp[1000000];
- size_t n = vsnprintf(tmp, sizeof(tmp), format, ap);
- write(1, tmp, n);
- return n;
-}