summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1991-01-30 10:25:34 +0000
committerRoland McGrath <roland@gnu.org>1991-01-30 10:25:34 +0000
commitc2547ce6a46f905a7f876f3e2c35e6e9e9b36527 (patch)
tree2b619afb1196c20c60ea0272412e589ad8a9039d
parent1c078555037a905f1e9bb29951e5e16420d66992 (diff)
Initial revision
-rw-r--r--assert/assert.c44
-rw-r--r--assert/assert.h63
-rw-r--r--ctype/ctype.c50
-rw-r--r--dirent/Makefile27
-rw-r--r--dirent/list.c63
-rw-r--r--errno.h34
-rw-r--r--gnulib/Makefile22
-rw-r--r--grp/getgrent.c66
-rw-r--r--grp/getgrnam.c49
-rw-r--r--grp/grpopen.c27
-rw-r--r--locale/localeconv.c49
-rw-r--r--misc/nlist.h43
-rw-r--r--misc/sys/dir.h27
-rw-r--r--misc/sys/ioctl.h88
-rw-r--r--misc/sys/ptrace.h132
-rw-r--r--misc/sys/uio.h53
-rw-r--r--posix/sys/times.h53
-rw-r--r--posix/sys/utsname.h60
-rw-r--r--pwd/Makefile25
-rw-r--r--pwd/fgetpwent.c39
-rw-r--r--pwd/getpw.c47
-rw-r--r--pwd/getpwent.c66
-rw-r--r--pwd/getpwnam.c49
-rw-r--r--pwd/putpwent.c40
-rw-r--r--pwd/pwdopen.c27
-rw-r--r--resource/sys/vlimit.h63
-rw-r--r--setjmp/setjmp.h107
-rw-r--r--stdio/tmpfile.c43
-rw-r--r--stdio/tmpnam.c41
-rw-r--r--stdlib/abs.c29
-rw-r--r--stdlib/atof.c29
-rw-r--r--stdlib/atoi.c29
-rw-r--r--stdlib/atol.c29
-rw-r--r--stdlib/bsearch.c55
-rw-r--r--stdlib/div.c38
-rw-r--r--stdlib/labs.c30
-rw-r--r--stdlib/ldiv.c38
-rw-r--r--stdlib/mblen.c30
-rw-r--r--stdlib/mbstowcs.c69
-rw-r--r--stdlib/mbtowc.c73
-rw-r--r--stdlib/strtoul.c20
-rw-r--r--stdlib/wcstombs.c73
-rw-r--r--stdlib/wctomb.c58
-rw-r--r--string/memory.h33
-rw-r--r--string/strcoll.c69
-rw-r--r--string/strdup.c37
-rw-r--r--string/strsignal.c44
-rw-r--r--string/strtok.c72
-rw-r--r--string/strxfrm.c75
-rw-r--r--sysdeps/generic/acos.c41
-rw-r--r--sysdeps/generic/asin.c43
-rw-r--r--sysdeps/generic/atan.c26
-rw-r--r--sysdeps/generic/bcopy.c31
-rw-r--r--sysdeps/generic/bzero.c31
-rw-r--r--sysdeps/generic/fabs.c26
-rw-r--r--sysdeps/generic/getpgrp.c37
-rw-r--r--sysdeps/generic/hypot.c26
-rw-r--r--sysdeps/generic/infnan.c45
-rw-r--r--sysdeps/generic/log10.c36
-rw-r--r--sysdeps/generic/modf.c30
-rw-r--r--sysdeps/generic/pow.c36
-rw-r--r--sysdeps/generic/strcspn.c37
-rw-r--r--sysdeps/generic/strpbrk.c34
-rw-r--r--sysdeps/generic/strspn.c43
-rw-r--r--sysdeps/generic/vlimit.c50
-rw-r--r--sysdeps/ieee754/log10.c29
-rw-r--r--sysdeps/m68k/fpu/acos.c31
-rw-r--r--sysdeps/m68k/fpu/drem.c28
-rw-r--r--sysdeps/m68k/fpu/fmod.c26
-rw-r--r--sysdeps/m68k/fpu/frexp.c26
-rw-r--r--sysdeps/m68k/fpu/isinf.c31
-rw-r--r--sysdeps/m68k/fpu/ldexp.c26
-rw-r--r--sysdeps/m68k/fpu/pow.c26
-rw-r--r--sysdeps/posix/clock.c33
-rw-r--r--sysdeps/posix/ctermid.c38
-rw-r--r--sysdeps/posix/raise.c27
-rw-r--r--sysdeps/posix/rename.c47
-rw-r--r--sysdeps/posix/signal.c44
-rw-r--r--sysdeps/posix/sigsuspend.c50
-rw-r--r--sysdeps/stub/__longjmp.c43
-rw-r--r--sysdeps/stub/accept.c42
-rw-r--r--sysdeps/stub/acct.c39
-rw-r--r--sysdeps/stub/acos.c37
-rw-r--r--sysdeps/stub/alarm.c43
-rw-r--r--sysdeps/stub/asin.c37
-rw-r--r--sysdeps/stub/atan2.c36
-rw-r--r--sysdeps/stub/bind.c38
-rw-r--r--sysdeps/stub/chroot.c38
-rw-r--r--sysdeps/stub/closedir.c40
-rw-r--r--sysdeps/stub/connect.c41
-rw-r--r--sysdeps/stub/cos.c37
-rw-r--r--sysdeps/stub/cosh.c37
-rw-r--r--sysdeps/stub/ctermid.c40
-rw-r--r--sysdeps/stub/exp.c37
-rw-r--r--sysdeps/stub/fmod.c37
-rw-r--r--sysdeps/stub/fsync.c37
-rw-r--r--sysdeps/stub/ftruncate.c29
-rw-r--r--sysdeps/stub/getenv.c37
-rw-r--r--sysdeps/stub/gethostid.c37
-rw-r--r--sysdeps/stub/getlogin.c39
-rw-r--r--sysdeps/stub/getrlimit.c39
-rw-r--r--sysdeps/stub/getsockopt.c41
-rw-r--r--sysdeps/stub/init-posix.c37
-rw-r--r--sysdeps/stub/isinf.c36
-rw-r--r--sysdeps/stub/kill.c40
-rw-r--r--sysdeps/stub/listen.c40
-rw-r--r--sysdeps/stub/log.c37
-rw-r--r--sysdeps/stub/log10.c37
-rw-r--r--sysdeps/stub/mktemp.c36
-rw-r--r--sysdeps/stub/morecore.c42
-rw-r--r--sysdeps/stub/opendir.c36
-rw-r--r--sysdeps/stub/pause.c41
-rw-r--r--sysdeps/stub/raise.c28
-rw-r--r--sysdeps/stub/readdir.c35
-rw-r--r--sysdeps/stub/recv.c39
-rw-r--r--sysdeps/stub/recvmsg.c39
-rw-r--r--sysdeps/stub/rewinddir.c36
-rw-r--r--sysdeps/stub/sbrk.c38
-rw-r--r--sysdeps/stub/sendmsg.c39
-rw-r--r--sysdeps/stub/sendto.c40
-rw-r--r--sysdeps/stub/sethostid.c38
-rw-r--r--sysdeps/stub/setjmp.c40
-rw-r--r--sysdeps/stub/setrlimit.c40
-rw-r--r--sysdeps/stub/setsockopt.c41
-rw-r--r--sysdeps/stub/shutdown.c43
-rw-r--r--sysdeps/stub/signum.h55
-rw-r--r--sysdeps/stub/sigpending.c45
-rw-r--r--sysdeps/stub/sigstack.c30
-rw-r--r--sysdeps/stub/sigvec.c42
-rw-r--r--sysdeps/stub/sin.c37
-rw-r--r--sysdeps/stub/sinh.c37
-rw-r--r--sysdeps/stub/socket.c40
-rw-r--r--sysdeps/stub/socketpair.c41
-rw-r--r--sysdeps/stub/sqrt.c37
-rw-r--r--sysdeps/stub/swapon.c38
-rw-r--r--sysdeps/stub/sync.c37
-rw-r--r--sysdeps/stub/unlink.c45
-rw-r--r--sysdeps/stub/utimes.c37
-rw-r--r--sysdeps/unix/bsd/tahoe/sysdep.h22
-rw-r--r--sysdeps/unix/opendir.c72
-rw-r--r--sysdeps/unix/rewinddir.c29
-rw-r--r--sysdeps/unix/sparc/vfork.S54
-rw-r--r--time/localtime.c51
143 files changed, 5969 insertions, 0 deletions
diff --git a/assert/assert.c b/assert/assert.c
new file mode 100644
index 0000000000..dd54bbc8ed
--- /dev/null
+++ b/assert/assert.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/* This function, when passed a string containing an asserted
+ expression, a filename, and a line number, prints a message
+ on the standard error stream of the form:
+ a.c:10: Assertion `a == b' failed.
+ It then aborts program execution via a call to abort(). */
+
+int
+DEFUN(__assert_fail, (assertion, file, line),
+ CONST char *assertion AND CONST char *file AND unsigned int line)
+{
+ /* Print the message. */
+ (void) fprintf(stderr, "%s:%u: Assertion `%s' failed.\n",
+ file, line, assertion);
+ (void) fflush(stderr);
+
+ abort();
+
+ /* This function never returns, so making it void would make sense,
+ but returning something makes the assert macro easier to write. */
+ return(0);
+}
diff --git a/assert/assert.h b/assert/assert.h
new file mode 100644
index 0000000000..056925119b
--- /dev/null
+++ b/assert/assert.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * ANSI Standard: 4.2 DIAGNOSTICS <assert.h>
+ */
+
+#ifdef _ASSERT_H
+
+#undef _ASSERT_H
+#undef assert
+#undef __assert_quotearg
+
+#endif /* assert.h */
+
+#define _ASSERT_H 1
+#include <features.h>
+
+/* void assert(int expression);
+ If NDEBUG is defined, do nothing.
+ If not, and EXPRESSION is zero, print an error message and abort. */
+
+#ifdef NDEBUG
+
+#define assert(expr) ((void) 0)
+
+#else /* Not NDEBUG. */
+
+/* This prints an "Assertion failed" message and aborts. */
+extern int EXFUN(__assert_fail, (CONST char *__assertion,
+ CONST char *__file, unsigned int __line));
+
+/* IGNORE($ */
+#ifdef __STDC__
+/* $) IFANSI($ */
+#define __assert_quotearg(s) #s
+/* $) IGNORE($ */
+#else /* Not ANSI C. */
+/* $) IFTRAD($ */
+#define __assert_quotearg(s) "s"
+/* $) IGNORE($ */
+#endif /* ANSI C. */
+/* $) */
+
+#define assert(expr) \
+ ((void) ((expr) || \
+ __assert_fail(__assert_quotearg(expr), __FILE__, __LINE__)))
+
+#endif /* NDEBUG. */
diff --git a/ctype/ctype.c b/ctype/ctype.c
new file mode 100644
index 0000000000..ba3e5290ca
--- /dev/null
+++ b/ctype/ctype.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+
+#define __NO_CTYPE
+#include <ctype.h>
+
+/* Provide real-function versions of all the ctype macros. */
+
+#define func(name, type) \
+ int DEFUN(name, (c), int c) { return __isctype(c, type); }
+
+func(isalnum, _ISalnum)
+func(isalpha, _ISalpha)
+func(iscntrl, _IScntrl)
+func(isdigit, _ISdigit)
+func(islower, _ISlower)
+func(isgraph, _ISgraph)
+func(isprint, _ISprint)
+func(ispunct, _ISpunct)
+func(isspace, _ISspace)
+func(isupper, _ISupper)
+func(isxdigit, _ISxdigit)
+
+int
+DEFUN(tolower, (c), int c)
+{
+ return __tolower(c);
+}
+
+int
+DEFUN(toupper, (c), int c)
+{
+ return __toupper(c);
+}
diff --git a/dirent/Makefile b/dirent/Makefile
new file mode 100644
index 0000000000..41d3b36530
--- /dev/null
+++ b/dirent/Makefile
@@ -0,0 +1,27 @@
+# Copyright (C) 1991 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with the GNU C Library; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#
+# Sub-makefile for dirent portion of the library.
+#
+subdir := dirent
+
+routines := opendir closedir readdir rewinddir seekdir telldir
+
+tests := list
+
+include ../Rules
diff --git a/dirent/list.c b/dirent/list.c
new file mode 100644
index 0000000000..11e81d0f70
--- /dev/null
+++ b/dirent/list.c
@@ -0,0 +1,63 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+
+
+void
+DEFUN(test, (name), CONST char *name)
+{
+ DIR *dirp;
+ struct dirent *entp;
+
+ puts(name);
+
+ dirp = opendir(name);
+ if (dirp == NULL)
+ {
+ perror("opendir");
+ return;
+ }
+
+ while ((entp = readdir(dirp)) != NULL)
+ printf("%s\tfile number %lu\n",
+ entp->d_name, (unsigned long int) entp->d_fileno);
+
+ if (closedir(dirp) < 0)
+ perror("closedir");
+}
+
+int
+DEFUN(main, (argc, argv), int argc AND char **argv)
+{
+ --argc;
+ ++argv;
+
+ if (argc == 0)
+ test(".");
+ else
+ while (argc-- > 0)
+ test(*argv++);
+
+ exit(0);
+ return(0);
+}
diff --git a/errno.h b/errno.h
new file mode 100644
index 0000000000..5968c85610
--- /dev/null
+++ b/errno.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * ANSI Standard: 4.1.3 Errors <errno.h>
+ */
+
+#ifndef _ERRNO_H
+
+#define _ERRNO_H 1
+#include <features.h>
+
+/* Get the error number constants. */
+#include <errnos.h>
+
+/* Declare the `errno' variable. */
+extern VOLATILE int errno;
+
+
+#endif /* errno.h */
diff --git a/gnulib/Makefile b/gnulib/Makefile
new file mode 100644
index 0000000000..7b7666d4bf
--- /dev/null
+++ b/gnulib/Makefile
@@ -0,0 +1,22 @@
+# Copyright (C) 1991 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with the GNU C Library; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+subdir := gnulib
+
+# Which routines are required is machine-dependent.
+
+include ../Rules
diff --git a/grp/getgrent.c b/grp/getgrent.c
new file mode 100644
index 0000000000..92306ccb5b
--- /dev/null
+++ b/grp/getgrent.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <grp.h>
+
+static FILE *stream = NULL;
+
+/* Rewind the stream. */
+void
+DEFUN_VOID(setgrent)
+{
+ if (stream != NULL)
+ rewind(stream);
+}
+
+
+/* Close the stream. */
+void
+DEFUN_VOID(endgrent)
+{
+ if (stream != NULL)
+ {
+ (void) fclose(stream);
+ stream = NULL;
+ }
+}
+
+
+/* Read an entry from the stream. */
+struct group *
+DEFUN_VOID(getgrent)
+{
+ static PTR info = NULL;
+ if (info == NULL)
+ {
+ info = __grpalloc();
+ if (info == NULL)
+ return(NULL);
+ }
+
+ if (stream == NULL)
+ {
+ stream = __grpopen();
+ if (stream == NULL)
+ return(NULL);
+ }
+
+ return(__grpread(stream, info));
+}
diff --git a/grp/getgrnam.c b/grp/getgrnam.c
new file mode 100644
index 0000000000..ec4d0a9d35
--- /dev/null
+++ b/grp/getgrnam.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <grp.h>
+
+/* Search for an entry with a matching name. */
+struct group *
+DEFUN(getgrnam, (name), register CONST char *name)
+{
+ static PTR info = NULL;
+ register FILE *stream;
+ register struct group *g;
+
+ if (info == NULL)
+ {
+ info = __grpalloc();
+ if (info == NULL)
+ return NULL;
+ }
+
+ stream = __grpopen();
+ if (stream == NULL)
+ return NULL;
+
+ while ((g = __grpread(stream, info)) != NULL)
+ if (!strcmp(g->gr_name, name))
+ break;
+
+ (void) fclose(stream);
+ return g;
+}
diff --git a/grp/grpopen.c b/grp/grpopen.c
new file mode 100644
index 0000000000..0750becf11
--- /dev/null
+++ b/grp/grpopen.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdio.h>
+#include <grp.h>
+
+/* Return a new stream open on the group file. */
+FILE *
+DEFUN_VOID(__grpopen)
+{
+ return fopen("/etc/group", "r");
+}
diff --git a/locale/localeconv.c b/locale/localeconv.c
new file mode 100644
index 0000000000..ef3e613c44
--- /dev/null
+++ b/locale/localeconv.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <locale.h>
+
+
+/* Return monetary and numeric information about the current locale. */
+struct lconv *
+DEFUN_VOID(localeconv)
+{
+ static struct lconv result;
+
+ result.decimal_point = (char *) _numeric_info->decimal_point;
+ result.thousands_sep = (char *) _numeric_info->thousands_sep;
+ result.grouping = (char *) _numeric_info->grouping;
+
+ result.int_curr_symbol = (char *) _monetary_info->int_curr_symbol;
+ result.currency_symbol = (char *) _monetary_info->currency_symbol;
+ result.mon_decimal_point = (char *) _monetary_info->mon_decimal_point;
+ result.mon_thousands_sep = (char *) _monetary_info->mon_thousands_sep;
+ result.mon_grouping = (char *) _monetary_info->mon_grouping;
+ result.positive_sign = (char *) _monetary_info->positive_sign;
+ result.negative_sign = (char *) _monetary_info->negative_sign;
+ result.frac_digits = _monetary_info->frac_digits;
+ result.p_cs_precedes = _monetary_info->p_cs_precedes;
+ result.p_sep_by_space = _monetary_info->p_sep_by_space;
+ result.n_cs_precedes = _monetary_info->p_cs_precedes;
+ result.n_sep_by_space = _monetary_info->n_sep_by_space;
+ result.p_sign_posn = _monetary_info->p_sign_posn;
+ result.n_sign_posn = _monetary_info->n_sign_posn;
+
+ return &result;
+}
diff --git a/misc/nlist.h b/misc/nlist.h
new file mode 100644
index 0000000000..5cfd88d462
--- /dev/null
+++ b/misc/nlist.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _NLIST_H
+
+#define _NLIST_H 1
+#include <features.h>
+
+
+/* Structure describing a symbol-table entry. */
+struct nlist
+ {
+ char *n_name;
+ unsigned char n_type;
+ char n_other;
+ short int n_desc;
+ unsigned long int n_value;
+ };
+#define N_NLIST_DECLARED
+#include <a.out.h>
+
+
+/* Search the executable FILE for symbols matching those in NL,
+ which is terminated by an element with a NULL `n_un.n_name' member,
+ and fill in the elements of NL. */
+extern int EXFUN(nlist, (CONST char *__file, struct nlist *__nl));
+
+
+#endif /* nlist.h */
diff --git a/misc/sys/dir.h b/misc/sys/dir.h
new file mode 100644
index 0000000000..162fa933ee
--- /dev/null
+++ b/misc/sys/dir.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _SYS_DIR_H
+
+#define _SYS_DIR_H 1
+#include <features.h>
+
+#include <dirent.h>
+
+#define direct dirent
+
+#endif /* sys/dir.h */
diff --git a/misc/sys/ioctl.h b/misc/sys/ioctl.h
new file mode 100644
index 0000000000..dc2acf3ab1
--- /dev/null
+++ b/misc/sys/ioctl.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _SYS_IOCTL_H
+
+#define _SYS_IOCTL_H 1
+#include <features.h>
+
+/* Get the list of `ioctl' requests and related constants. */
+#include <ioctls.h>
+
+
+#if defined(TIOCGETC) || defined(TIOCSETC)
+/* Type of ARG for TIOCGETC and TIOCSETC requests. */
+struct tchars
+ {
+ char t_intrc; /* Interrupt character. */
+ char t_quitc; /* Quit character. */
+ char t_startc; /* Start-output character. */
+ char t_stopc; /* Stop-output character. */
+ char t_eofc; /* End-of-file character. */
+ char t_brkc; /* Input delimiter character. */
+ };
+#endif
+
+#if defined(TIOCGLTC) || defined(TIOCSLTC)
+/* Type of ARG for TIOCGLTC and TIOCSLTC requests. */
+struct ltchars
+ {
+ char t_suspc; /* Suspend character. */
+ char t_dsuspc; /* Delayed suspend character. */
+ char t_rprntc; /* Reprint-line character. */
+ char t_flushc; /* Flush-output character. */
+ char t_werasc; /* Word-erase character. */
+ char t_lnextc; /* Literal-next character. */
+ };
+#endif
+
+#if defined(TIOCGETP) || defined(TIOCSETP)
+/* Type of ARG for TIOCGETP and TIOCSETP requests. */
+struct sgttyb
+ {
+ char sg_ispeed; /* Input speed. */
+ char sg_ospeed; /* Output speed. */
+ char sg_erase; /* Erase character. */
+ char sg_kill; /* Kill character. */
+ short int sg_flags; /* Mode flags. */
+ };
+#endif
+
+#if defined(TIOCGWINSZ) || defined(TIOCSWINSZ)
+/* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */
+struct winsize
+ {
+ unsigned short int ws_row; /* Rows, in characters. */
+ unsigned short int ws_col; /* Columns, in characters. */
+
+ unsigned short int ws_xpixel; /* Horizontal pixels. */
+ unsigned short int ws_ypixel; /* Vertical pixels. */
+ };
+#endif
+
+
+/* Perform the I/O control operation specified by REQUEST on FD.
+ The actual type and use of ARG and the return value depend on REQUEST. */
+extern int EXFUN(__ioctl, (int __fd, int __request, PTR __arg));
+extern int EXFUN(ioctl, (int __fd, int __request, PTR __arg));
+
+#ifdef __OPTIMIZE__
+#define ioctl(fd, request, arg) __ioctl((fd), (request), (arg))
+#endif
+
+
+#endif /* sys/ioctl.h */
diff --git a/misc/sys/ptrace.h b/misc/sys/ptrace.h
new file mode 100644
index 0000000000..da7fb7280f
--- /dev/null
+++ b/misc/sys/ptrace.h
@@ -0,0 +1,132 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _PTRACE_H
+
+#define _PTRACE_H 1
+#include <features.h>
+
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+ {
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user space at offset ADDR. */
+ PTRACE_POKEUSER,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL,
+#define PT_KILL PTRACE_KILL
+
+ /* Single step the process.
+ This is not supported on all machines. */
+ PTRACE_SINGLESTEP,
+#define PT_STEP PTRACE_SINGLESTEP
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Get the process's registers (not including floating-point registers)
+ and put them in the `struct regs' (see <machine/regs.h>) at ADDR. */
+ PTRACE_GETREGS = 12,
+
+ /* Set the process's registers (not including floating-point registers)
+ to the contents of the `struct regs' (see <machine/regs.h>) at ADDR. */
+ PTRACE_SETREGS,
+
+ /* Get the process's floating point registers and put them
+ in the `struct fp_status' (see <machine/regs.h>) at ADDR. */
+ PTRACE_GETFPGEGS = 14,
+
+ /* Set the process's floating point registers to the contents
+ of the `struct fp_status' (see <machine/regs.h>) at ADDR. */
+ PTRACE_SETFPREGS,
+
+ /* Read DATA bytes from the process's data space at address ADDR.
+ Put the result starting at address ADDR2 in the caller's
+ address space. */
+ PTRACE_READDATA = 16,
+
+ /* Write DATA bytes from ADDR2 in the caller's address space into
+ the process's data space at address ADDR. */
+ PTRACE_WRITEDATA,
+
+ /* Read DATA bytes from the process's text space at address ADDR.
+ Put the result starting at address ADDR2 in the caller's
+ address space. */
+ PTRACE_READTEXT = 18,
+
+ /* Write DATA bytes from ADDR2 in the caller's address space into
+ the process's text space at address ADDR. */
+ PTRACE_WRITETEXT,
+
+ /* Read the floating-point accelerator unit registers and
+ put them into the `struct fpa_regs' (see <machine/regs.h>) at ADDR. */
+ PTRACE_GETFPAREGS = 20,
+
+ /* Write the floating-point accelerator unit registers from
+ the contents of the `struct fpa_regs' at ADDR. */
+ PTRACE_SETFPAREGS,
+ };
+
+/* Perform process tracing functions. REQUEST is one of the values
+ above, and determines the action to be taken.
+ For all requests except PTRACE_TRACEME, PID specifies the process to be
+ traced.
+
+ PID and the other arguments described above for the various requests should
+ appear (those that are used for the particular request) as:
+ pid_t PID, void *ADDR, int DATA, void *ADDR2
+ after REQUEST. */
+extern int EXFUN(ptrace, (enum __ptrace_request __request DOTS));
+
+#endif /* ptrace.h */
diff --git a/misc/sys/uio.h b/misc/sys/uio.h
new file mode 100644
index 0000000000..b47416f030
--- /dev/null
+++ b/misc/sys/uio.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _SYS_UIO_H
+
+#define _SYS_UIO_H 1
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+
+/* Structure describing a section of memory. */
+
+struct iovec
+ {
+ /* Starting address. */
+ PTR iov_base;
+ /* Length in bytes. */
+ size_t iov_len;
+ };
+
+
+/* Read data from file descriptor FD, and put the result in the
+ buffers described by VECTOR, which is a vector of COUNT `struct iovec's.
+ The buffers are filled in the order specified.
+ Operates just like `read' (see <unistd.h>) except that data are
+ put in VECTOR instead of a contiguous buffer. */
+int EXFUN(readv, (int __fd, CONST struct iovec *__vector, size_t __count));
+
+/* Write data pointed by the buffers described by VECTOR, which
+ is a vector of COUNT `struct iovec's, to file descriptor FD.
+ The data is written in the order specified.
+ Operates just like `write' (see <unistd.h>) except that the data
+ are taken from VECTOR instead of a contiguous buffer. */
+int EXFUN(writev, (int __fd, CONST struct iovec *__vector, size_t __count));
+
+
+#endif /* sys/uio.h */
diff --git a/posix/sys/times.h b/posix/sys/times.h
new file mode 100644
index 0000000000..bd4d33c3d9
--- /dev/null
+++ b/posix/sys/times.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * POSIX Standard: 4.5.2 Process Times <sys/times.h>
+ */
+
+#ifndef _SYS_TIMES_H
+
+#define _SYS_TIMES_H 1
+#include <features.h>
+
+#define __need_clock_t
+#include <time.h>
+
+
+/* Structure describing CPU time used by a process and its children. */
+struct tms
+ {
+ clock_t tms_utime; /* User CPU time. */
+ clock_t tms_stime; /* System CPU time. */
+
+ clock_t tms_cutime; /* User CPU time of dead children. */
+ clock_t tms_cstime; /* System CPU time of dead children. */
+ };
+
+
+/* Store the CPU time used by this process and all its
+ dead children (and their dead children) in BUFFER.
+ Return the elapsed real time, or (clock_t) -1 for errors.
+ All times are in CLK_TCKths of a second. */
+extern clock_t EXFUN(__times, (struct tms *buffer));
+extern clock_t EXFUN(times, (struct tms *buffer));
+
+#ifdef __OPTIMIZE__
+#define times(buffer) __times(buffer)
+#endif /* Optimizing. */
+
+#endif /* sys/times.h */
diff --git a/posix/sys/utsname.h b/posix/sys/utsname.h
new file mode 100644
index 0000000000..6b83f342b9
--- /dev/null
+++ b/posix/sys/utsname.h
@@ -0,0 +1,60 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * POSIX Standard: 4.4 System Identification <sys/utsname.h>
+ */
+
+#ifndef _SYS_UTSNAME_H
+
+#define _SYS_UTSNAME_H 1
+#include <features.h>
+
+
+/* The size of the character arrays used to hold the information
+ in a `struct utsname'. Enlarge this as necessary. */
+#define _UTSNAME_LENGTH 100
+
+
+/* Structure describing the system and machine. */
+struct utsname
+ {
+ /* Name of the implementation of the operating system. */
+ char sysname[_UTSNAME_LENGTH];
+
+ /* Name of this node on the network. */
+ char nodename[_UTSNAME_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];
+};
+
+
+/* Put information about the system in NAME. */
+extern int EXFUN(uname, (struct utsname *__name));
+
+
+/* Store the nodename in NAME, writing no more than LEN characters. */
+extern int EXFUN(__uname_getnode, (char *__name, unsigned int __len));
+
+
+#endif /* sys/utsname.h */
diff --git a/pwd/Makefile b/pwd/Makefile
new file mode 100644
index 0000000000..a095df1c64
--- /dev/null
+++ b/pwd/Makefile
@@ -0,0 +1,25 @@
+# Copyright (C) 1991 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with the GNU C Library; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#
+# Sub-makefile for pwd portion of the library.
+#
+subdir := pwd
+
+routines := pwdopen pwdread fgetpwent getpw getpwent getpwnam getpwuid putpwent
+
+include ../Rules
diff --git a/pwd/fgetpwent.c b/pwd/fgetpwent.c
new file mode 100644
index 0000000000..eb2d02c7f6
--- /dev/null
+++ b/pwd/fgetpwent.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <limits.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <pwd.h>
+
+/* Read one entry from the given stream. */
+struct passwd *
+DEFUN(fgetpwent, (stream), FILE *stream)
+{
+ static PTR info = NULL;
+ if (info == NULL)
+ {
+ info = __pwdalloc();
+ if (info == NULL)
+ return(NULL);
+ }
+
+ return(__pwdread(stream, info));
+}
diff --git a/pwd/getpw.c b/pwd/getpw.c
new file mode 100644
index 0000000000..642c149055
--- /dev/null
+++ b/pwd/getpw.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <pwd.h>
+
+
+/* Re-construct the password-file line for the given uid
+ in the given buffer. This knows the format that the caller
+ will expect, but this need not be the format of the password file. */
+int
+DEFUN(getpw, (uid, buf), int uid AND register char *buf)
+{
+ register struct passwd *p;
+
+ if (uid < 0 || buf == NULL)
+ {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ p = getpwuid(uid);
+ if (p == NULL)
+ return(-1);
+
+ if (sprintf(buf, "%s:%s:%d:%d:%s:%s:%s", p->pw_name, p->pw_passwd,
+ p->pw_uid, p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell) < 0)
+ return(-1);
+
+ return(0);
+}
diff --git a/pwd/getpwent.c b/pwd/getpwent.c
new file mode 100644
index 0000000000..4bdb5d191d
--- /dev/null
+++ b/pwd/getpwent.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <pwd.h>
+
+static FILE *stream = NULL;
+
+/* Rewind the stream. */
+void
+DEFUN_VOID(setpwent)
+{
+ if (stream != NULL)
+ rewind(stream);
+}
+
+
+/* Close the stream. */
+void
+DEFUN_VOID(endpwent)
+{
+ if (stream != NULL)
+ {
+ (void) fclose(stream);
+ stream = NULL;
+ }
+}
+
+
+/* Return one entry from the password file. */
+struct passwd *
+DEFUN_VOID(getpwent)
+{
+ static PTR info = NULL;
+ if (info == NULL)
+ {
+ info = __pwdalloc();
+ if (info == NULL)
+ return(NULL);
+ }
+
+ if (stream == NULL)
+ {
+ stream = __pwdopen();
+ if (stream == NULL)
+ return(NULL);
+ }
+
+ return(__pwdread(stream, info));
+}
diff --git a/pwd/getpwnam.c b/pwd/getpwnam.c
new file mode 100644
index 0000000000..5110f60299
--- /dev/null
+++ b/pwd/getpwnam.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <pwd.h>
+
+/* Search for an entry with a matching name. */
+struct passwd *
+DEFUN(getpwnam, (name), register CONST char *name)
+{
+ static PTR info = NULL;
+ register FILE *stream;
+ register struct passwd *p;
+
+ if (info == NULL)
+ {
+ info = __pwdalloc();
+ if (info == NULL)
+ return(NULL);
+ }
+
+ stream = __pwdopen();
+ if (stream == NULL)
+ return(NULL);
+
+ while ((p = __pwdread(stream, info)) != NULL)
+ if (!strcmp(p->pw_name, name))
+ break;
+
+ (void) fclose(stream);
+ return(p);
+}
diff --git a/pwd/putpwent.c b/pwd/putpwent.c
new file mode 100644
index 0000000000..41ee1d75ee
--- /dev/null
+++ b/pwd/putpwent.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stdio.h>
+#include <pwd.h>
+
+
+/* Write an entry to the given stream.
+ This must know the format of the password file. */
+int
+DEFUN(putpwent, (p, stream), register CONST struct passwd *p AND FILE *stream)
+{
+ if (p == NULL || stream == NULL)
+ {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ if (fprintf(stream, "%s:%s:%d:%d:%s:%s\n", p->pw_name, p->pw_passwd,
+ p->pw_uid, p->pw_gid, p->pw_gecos, p->pw_shell) < 0)
+ return(-1);
+
+ return(0);
+}
diff --git a/pwd/pwdopen.c b/pwd/pwdopen.c
new file mode 100644
index 0000000000..f3c54fbfd3
--- /dev/null
+++ b/pwd/pwdopen.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdio.h>
+#include <pwd.h>
+
+/* Return a new stream open on the password file. */
+FILE *
+DEFUN_VOID(__pwdopen)
+{
+ return(fopen("/etc/passwd", "r"));
+}
diff --git a/resource/sys/vlimit.h b/resource/sys/vlimit.h
new file mode 100644
index 0000000000..ceb377fd66
--- /dev/null
+++ b/resource/sys/vlimit.h
@@ -0,0 +1,63 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _SYS_VLIMIT_H
+
+#define _SYS_VLIMIT_H 1
+#include <features.h>
+
+/* This interface is obsolete, and is superseded by <sys/resource.h>. */
+
+/* Kinds of resource limit. */
+enum __vlimit_resource
+ {
+ /* Setting this non-zero makes it impossible to raise limits.
+ Only the super-use can set it to zero.
+
+ This is not implemented in recent versions of BSD, nor by
+ the GNU C library. */
+ LIM_NORAISE,
+
+ /* CPU time available for each process (seconds). */
+ LIM_CPU,
+
+ /* Largest file which can be created (bytes). */
+ LIM_FSIZE,
+
+ /* Maximum size of the data segment (bytes). */
+ LIM_DATA,
+
+ /* Maximum size of the stack segment (bytes). */
+ LIM_STACK,
+
+ /* Largest core file that will be created (bytes). */
+ LIM_CORE,
+
+ /* Resident set size (bytes). */
+ LIM_MAXRSS
+ };
+
+/* This means no limit. */
+#define INFINITY 0x7fffffff
+
+
+/* Set the soft limit for RESOURCE to be VALUE.
+ Returns 0 for success, -1 for failure. */
+int EXFUN(vlimit, (enum __vlimit_resource __resource, int __value));
+
+
+#endif /* vlimit.h */
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
new file mode 100644
index 0000000000..483d893b49
--- /dev/null
+++ b/setjmp/setjmp.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * ANSI Standard: 4.6 NON-LOCAL JUMPS <setjmp.h>
+ */
+
+#ifndef _SETJMP_H
+
+#define _SETJMP_H 1
+#include <features.h>
+
+/* Get the machine-dependent definition of `__jmp_buf'. */
+#include <jmp_buf.h>
+
+#ifndef __NORETURN
+#ifdef __GNUC__
+/* The `volatile' keyword tells GCC that a function never returns. */
+#define __NORETURN __volatile
+#else /* Not GCC. */
+#define __NORETURN
+#endif /* GCC. */
+#endif /* __NORETURN not defined. */
+
+/* Jump to the environment saved in ENV, making the
+ setjmp call there return VAL, or 1 if VAL is 0. */
+extern __NORETURN void EXFUN(__longjmp, (CONST __jmp_buf __env, int __val));
+extern __NORETURN void EXFUN(longjmp, (CONST __jmp_buf __env, int __val));
+
+#ifdef __OPTIMIZE__
+#define longjmp(env, val) __longjmp((env), (val))
+#endif /* Optimizing. */
+
+/* Set ENV to the current position and return 0. */
+extern int EXFUN(__setjmp, (__jmp_buf __env));
+/* The ANSI standard says `setjmp' is a macro. */
+#define setjmp(env) __setjmp(env)
+
+
+#ifdef __USE_POSIX
+#define __need_sigset_t
+#include <signal.h>
+
+/* Calling environment, plus possibly a saved signal mask. */
+typedef struct
+ {
+ __jmp_buf __jmpbuf; /* Calling environment. */
+ sigset_t __sigmask; /* Saved signal mask. */
+ unsigned int __savemask:1; /* Saved the signal mask? */
+ } sigjmp_buf[1];
+
+/* Store the calling environment in ENV, also saving the
+ signal mask if SAVEMASK is nonzero. Return 0. */
+extern int EXFUN(sigsetjmp, (sigjmp_buf __env, int __savemask));
+
+/* Jump to the environment saved in ENV, making the
+ sigsetjmp call there return VAL, or 1 if VAL is 0.
+ Restore the signal mask if that sigsetjmp call saved it. */
+extern __NORETURN void EXFUN(siglongjmp, (CONST sigjmp_buf __env, int __val));
+#endif /* Use POSIX. */
+
+
+#ifdef __USE_BSD
+extern __NORETURN void EXFUN(_longjmp, (CONST __jmp_buf __env, int __val));
+extern int EXFUN(_setjmp, (__jmp_buf __env));
+
+#ifdef __OPTIMIZE__
+#define _longjmp(env, val) longjmp((env), (val))
+#define _setjmp(env) __setjmp(env)
+#endif /* Optimizing. */
+#endif /* Use BSD. */
+
+#ifdef __FAVOR_BSD
+
+/* BSD defines `setjmp' and `longjmp' to save and restore the set of
+ blocked signals. For this, `jmp_buf' must be what POSIX calls
+ `sigjmp_buf', which includes that information. */
+typedef sigjmp_buf jmp_buf;
+
+#undef setjmp
+#define setjmp(env) sigsetjmp((env), 1)
+
+#undef longjmp
+#define longjmp(env, val) siglongjmp((env), (val))
+
+#else /* Don't favor BSD. */
+
+/* A `jmp_buf' really is a `jmp_buf'. Oh boy. */
+typedef __jmp_buf jmp_buf;
+
+#endif /* Favor BSD. */
+
+#endif /* setjmp.h */
diff --git a/stdio/tmpfile.c b/stdio/tmpfile.c
new file mode 100644
index 0000000000..05476cdca3
--- /dev/null
+++ b/stdio/tmpfile.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdio.h>
+
+
+/* This returns a new stream opened on a temporary file (generated
+ by tmpnam) The file is opened with mode "w+b" (binary read/write).
+ If we couldn't generate a unique filename or the file couldn't
+ be opened, NULL is returned. */
+FILE *
+DEFUN_VOID(tmpfile)
+{
+ register char *filename;
+ register FILE *f;
+
+ filename = __stdio_gen_tempname((char *) NULL, "tmpf", 0, (size_t *) NULL);
+ if (filename == NULL)
+ return NULL;
+ f = fopen(filename, "w+b");
+ if (f == NULL)
+ return NULL;
+
+ /* Note that this relies on the Unix semantics that
+ a file is not really removed until it is closed. */
+ (void) remove(filename);
+ return f;
+}
diff --git a/stdio/tmpnam.c b/stdio/tmpnam.c
new file mode 100644
index 0000000000..85077a5b9e
--- /dev/null
+++ b/stdio/tmpnam.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+
+
+/* Generate a unique filename in P_tmpdir. */
+char *
+DEFUN(tmpnam, (s), register char *s)
+{
+ register char *t = __stdio_gen_tempname((CONST char *) NULL,
+ (CONST char *) NULL, 0,
+ (size_t *) NULL);
+
+ if (t == NULL)
+ return NULL;
+
+ if (s != NULL)
+ (void) strcpy(s, t);
+ else
+ s = t;
+
+ return s;
+}
diff --git a/stdlib/abs.c b/stdlib/abs.c
new file mode 100644
index 0000000000..3480bc367a
--- /dev/null
+++ b/stdlib/abs.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef abs
+
+/* Return the absolute value of I. */
+__CONSTVALUE
+int
+DEFUN(abs, (i), int i)
+{
+ return(i < 0 ? -i : i);
+}
diff --git a/stdlib/atof.c b/stdlib/atof.c
new file mode 100644
index 0000000000..609715ef8b
--- /dev/null
+++ b/stdlib/atof.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef atof
+
+
+/* Convert a string to a double. */
+double
+DEFUN(atof, (nptr), CONST char *nptr)
+{
+ return(strtod(nptr, (char **) NULL));
+}
diff --git a/stdlib/atoi.c b/stdlib/atoi.c
new file mode 100644
index 0000000000..00c7a92bf2
--- /dev/null
+++ b/stdlib/atoi.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef atoi
+
+
+/* Convert a string to an int. */
+int
+DEFUN(atoi, (nptr), CONST char *nptr)
+{
+ return((int) strtol(nptr, (char **) NULL, 10));
+}
diff --git a/stdlib/atol.c b/stdlib/atol.c
new file mode 100644
index 0000000000..4a6e522af1
--- /dev/null
+++ b/stdlib/atol.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef atol
+
+
+/* Convert a string to a long int. */
+long int
+DEFUN(atol, (nptr), CONST char *nptr)
+{
+ return(strtol(nptr, (char **) NULL, 10));
+}
diff --git a/stdlib/bsearch.c b/stdlib/bsearch.c
new file mode 100644
index 0000000000..79537e5d47
--- /dev/null
+++ b/stdlib/bsearch.c
@@ -0,0 +1,55 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+
+/* Perform a binary search for KEY in BASE which has NMEMB elements
+ of SIZE bytes each. The comparisons are done by (*COMPAR)(). */
+PTR
+DEFUN(bsearch, (key, base, nmemb, size, compar),
+ register CONST PTR key AND register CONST PTR base AND
+ size_t nmemb AND register size_t size AND
+ register int EXFUN((*compar), (CONST PTR, CONST PTR)))
+{
+ register size_t l, u, idx;
+ register CONST PTR p;
+ register int comparison;
+
+ l = 0;
+ u = nmemb - 1;
+ while (l <= u)
+ {
+ idx = (l + u) / 2;
+ p = (PTR) (((CONST char *) base) + (idx * size));
+ comparison = (*compar)(key, p);
+ /* Don't make U negative because it will wrap around. */
+ if (comparison < 0)
+ {
+ if (idx == 0)
+ break;
+ u = idx - 1;
+ }
+ else if (comparison > 0)
+ l = idx + 1;
+ else
+ return (PTR) p;
+ }
+
+ return NULL;
+}
diff --git a/stdlib/div.c b/stdlib/div.c
new file mode 100644
index 0000000000..6e5e7f2df5
--- /dev/null
+++ b/stdlib/div.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+
+/* Return the `div_t' representation of NUMER over DENOM. */
+__CONSTVALUE
+div_t
+DEFUN(div, (numer, denom), int numer AND int denom)
+{
+ div_t result;
+ /* Behavior for negative numbers is guaranteed. */
+ register int sign = (numer < 0) == (denom < 0) ? 1 : -1;
+
+ numer = numer < 0 ? -numer : numer;
+ denom = denom < 0 ? -denom : denom;
+
+ result.quot = (numer / denom) * sign;
+ result.rem = (numer % denom) * sign;
+
+ return(result);
+}
diff --git a/stdlib/labs.c b/stdlib/labs.c
new file mode 100644
index 0000000000..ac18fc5046
--- /dev/null
+++ b/stdlib/labs.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef labs
+
+
+/* Return the absolute value of I. */
+__CONSTVALUE
+long int
+DEFUN(labs, (i), long int i)
+{
+ return(i < 0 ? -i : i);
+}
diff --git a/stdlib/ldiv.c b/stdlib/ldiv.c
new file mode 100644
index 0000000000..a5c905ceac
--- /dev/null
+++ b/stdlib/ldiv.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+
+/* Return the `ldiv_t' representation of NUMER over DENOM. */
+__CONSTVALUE
+ldiv_t
+DEFUN(ldiv, (numer, denom), long int numer AND long int denom)
+{
+ ldiv_t result;
+ /* Behavior for negative numbers is guaranteed. */
+ register long int sign = (numer < 0L) == (denom < 0L) ? 1L : -1L;
+
+ numer = numer < 0L ? -numer : numer;
+ denom = denom < 0L ? -denom : denom;
+
+ result.quot = (numer / denom) * sign;
+ result.rem = (numer % denom) * sign;
+
+ return result;
+}
diff --git a/stdlib/mblen.c b/stdlib/mblen.c
new file mode 100644
index 0000000000..9d724a62f0
--- /dev/null
+++ b/stdlib/mblen.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdlib.h>
+
+#undef mblen
+
+
+/* Return the length of the multibyte character (if there is one)
+ at S which is no longer than N characters. */
+int
+DEFUN(mblen, (s, n), CONST char *s AND size_t n)
+{
+ return(mbtowc((wchar_t *) NULL, s, n));
+}
diff --git a/stdlib/mbstowcs.c b/stdlib/mbstowcs.c
new file mode 100644
index 0000000000..cdb576b998
--- /dev/null
+++ b/stdlib/mbstowcs.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <ctype.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+
+extern int _mb_shift; /* Defined in mbtowc.c. */
+
+/* Convert the string of multibyte characters in S to `wchar_t's in
+ PWCS, writing no more than N. Return the number written,
+ or (size_t) -1 if an invalid multibyte character is encountered. */
+size_t
+DEFUN(mbstowcs, (pwcs, s, n),
+ register wchar_t *pwcs AND register CONST char *s AND register size_t n)
+{
+ int save_shift;
+ register size_t written = 0;
+
+ /* Save the shift state. */
+ save_shift = _mb_shift;
+ /* Reset the shift state. */
+ _mb_shift = 0;
+
+ while (*s != '\0')
+ {
+ int len;
+ if (isascii(*s) || (len = mbtowc(pwcs, s, n)) < 1)
+ {
+ /* Return an error. */
+ written = (size_t) -1;
+ break;
+ }
+ else
+ {
+ /* Multibyte character converted. */
+ ++pwcs;
+ ++written;
+ s += len;
+ n -= len;
+ }
+ }
+
+ /* Terminate the string if it has space. */
+ if (n > 0)
+ *pwcs = (wchar_t) 0;
+
+ /* Restore the old shift state. */
+ _mb_shift = save_shift;
+
+ /* Return how many we wrote (or maybe an error). */
+ return written;
+}
diff --git a/stdlib/mbtowc.c b/stdlib/mbtowc.c
new file mode 100644
index 0000000000..03cfdd233b
--- /dev/null
+++ b/stdlib/mbtowc.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <ctype.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+long int _mb_shift = 0;
+
+/* Convert the multibyte character at S, which is no longer
+ than N characters, to its `wchar_t' representation, placing
+ this n *PWC and returning its length. */
+int
+DEFUN(mbtowc, (pwc, s, n), wchar_t *pwc AND CONST char *s AND size_t n)
+{
+ register CONST mb_char *mb;
+ register wchar_t i;
+
+ if (s == NULL)
+ return _mb_shift != 0;
+
+ if (_ctype_info->mbchar == NULL ||
+ _ctype_info->mbchar->mb_chars == NULL)
+ return -1;
+ if (*s == '\0')
+ return 0;
+
+ if (n > MB_CUR_MAX)
+ n = MB_CUR_MAX;
+
+ for (i = 0; i < WCHAR_MAX; ++i)
+ {
+ mb = &_ctype_info->mbchar->mb_chars[i];
+ /* EOF and NUL aren't MB chars. */
+ if (i == (wchar_t) EOF || i == (wchar_t) '\0')
+ continue;
+ /* Normal ASCII values can't start MB chars. */
+ else if (isascii(i))
+ continue;
+ else if (mb->string == NULL || mb->len == 0)
+ continue;
+ else if (mb->len > n)
+ continue;
+ else if (!strncmp(mb->string, s, mb->len))
+ {
+ _mb_shift += mb->shift;
+ if (pwc != NULL)
+ *pwc = i;
+ return mb->len;
+ }
+ }
+
+ return -1;
+}
diff --git a/stdlib/strtoul.c b/stdlib/strtoul.c
new file mode 100644
index 0000000000..d4c76e322b
--- /dev/null
+++ b/stdlib/strtoul.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#define UNSIGNED 1
+
+#include <strtol.c>
diff --git a/stdlib/wcstombs.c b/stdlib/wcstombs.c
new file mode 100644
index 0000000000..4bd5d52c3a
--- /dev/null
+++ b/stdlib/wcstombs.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <ctype.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Convert the `wchar_t' string in PWCS to a multibyte character string
+ in S, writing no more than N characters. Return the number of bytes
+ written, or (size_t) -1 if an invalid `wchar_t' was found. */
+size_t
+DEFUN(wcstombs, (s, pwcs, n),
+ register char *s AND register CONST wchar_t *pwcs AND register size_t n)
+{
+ register CONST mb_char *mb;
+ register int shift = 0;
+
+ register size_t written = 0;
+ register wchar_t w;
+
+ while ((w = *pwcs++) != (wchar_t) '\0')
+ {
+ if (w == ((wchar_t) EOF) || isascii(w))
+ {
+ written = (size_t) -1;
+ break;
+ }
+ else
+ {
+ mb = &_ctype_info->mbchar->mb_chars[w + shift];
+ if (mb->string == NULL || mb->len == 0)
+ {
+ written = (size_t) -1;
+ break;
+ }
+ else if (mb->len > n)
+ break;
+ else
+ {
+ memcpy((PTR) s, (CONST PTR) mb->string, mb->len);
+ n -= mb->len;
+ written += mb->len;
+ shift += mb->shift;
+ }
+ }
+ }
+
+ /* Terminate the string if it has space. */
+ if (n > 0)
+ *s = '\0';
+
+ /* Return the number of characters written (or maybe an error). */
+ return written;
+}
diff --git a/stdlib/wctomb.c b/stdlib/wctomb.c
new file mode 100644
index 0000000000..81c911417f
--- /dev/null
+++ b/stdlib/wctomb.c
@@ -0,0 +1,58 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+extern int _mb_shift; /* Defined in mbtowc.c. */
+
+/* Convert WCHAR into its multibyte character representation,
+ putting this in S and returning its length. */
+int
+DEFUN(wctomb, (s, wchar), register char *s AND wchar_t wchar)
+{
+ register CONST mb_char *mb;
+
+ if (_ctype_info->mbchar == NULL)
+ mb = NULL;
+ else
+ mb = _ctype_info->mbchar->mb_chars;
+
+ /* If S is NULL, just say if we're shifted or not. */
+ if (s == NULL)
+ return _mb_shift != 0;
+
+ if (wchar == (wchar_t) '\0')
+ {
+ _mb_shift = 0;
+ return 0;
+ }
+ else if (mb == NULL)
+ return -1;
+
+ mb += wchar + _mb_shift;
+ if (mb->string == NULL || mb->len == 0)
+ return -1;
+ memcpy((PTR) s, (CONST PTR) mb->string, mb->len + 1);
+ _mb_shift += mb->shift;
+ return mb->len;
+}
diff --git a/string/memory.h b/string/memory.h
new file mode 100644
index 0000000000..763613bc80
--- /dev/null
+++ b/string/memory.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/*
+ * SVID
+ */
+
+#ifndef _MEMORY_H
+
+#define _MEMORY_H 1
+#include <features.h>
+
+
+#ifndef _STRING_H
+#include <string.h>
+#endif /* string.h */
+
+
+#endif /* memory.h */
diff --git a/string/strcoll.c b/string/strcoll.c
new file mode 100644
index 0000000000..0146aee780
--- /dev/null
+++ b/string/strcoll.c
@@ -0,0 +1,69 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Compare S1 and S2, returning less than, equal to or
+ greater than zero if the collated form of S1 is lexiographically
+ less than, equal to or greater than the collated form of S2. */
+int
+DEFUN(strcoll, (s1, s2), CONST char *s1 AND CONST char *s2)
+{
+ if (_collate_info == NULL || _collate_info->values == NULL)
+ return strcmp(s1, s2);
+ else
+ {
+ CONST unsigned char *CONST values = _collate_info->values;
+ CONST unsigned char *CONST offsets = _collate_info->offsets;
+
+ while (*s1 != '\0' && *s2 != '\0')
+ {
+ CONST unsigned char c1 = *s1++, c2 = *s2++;
+ CONST unsigned char v1 = values[c1], v2 = values[c2];
+ CONST unsigned char o1 = offsets[c1], o2 = offsets[c2];
+
+ if (v1 == UCHAR_MAX && o1 == 0)
+ /* This is a non-collating element. Skip it. */
+ --s2;
+ else if (v2 == UCHAR_MAX && o2 == 0)
+ --s1;
+ else if (v1 == UCHAR_MAX && o1 == CHAR_MAX)
+ {
+ /* This element collates lower than anything else. */
+ if (v2 != UCHAR_MAX || o2 != CHAR_MAX)
+ return -1;
+ }
+ else if (v2 == UCHAR_MAX && o2 == CHAR_MAX)
+ return 1;
+ else if (v1 != v2)
+ return v1 - v2;
+ else if (o1 != o2)
+ return o1 - o2;
+ }
+
+ if (*s1 == '\0')
+ return *s2 == '\0' ? 0 : -1;
+ else if (*s2 == '\0')
+ return 1;
+ return 0;
+ }
+}
diff --git a/string/strdup.c b/string/strdup.c
new file mode 100644
index 0000000000..af35fda366
--- /dev/null
+++ b/string/strdup.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Duplicate S, returning an identical malloc'd string. */
+char *
+DEFUN(strdup, (s), CONST char *s)
+{
+ size_t len = strlen(s) + 1;
+ PTR new = malloc(len);
+
+ if (new == NULL)
+ return NULL;
+
+ memcpy(new, (PTR) s, len);
+
+ return (char *) new;
+}
diff --git a/string/strsignal.c b/string/strsignal.c
new file mode 100644
index 0000000000..d873318835
--- /dev/null
+++ b/string/strsignal.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+
+
+/* Defined in stdio/sys_siglist.c. */
+extern CONST char *CONST _sys_siglist[];
+
+
+/* Return a string describing the meaning of the signal number SIGNUM. */
+char *
+DEFUN(strsignal, (signum), int signum)
+{
+ if (signum < 0 || signum > NSIG)
+ {
+ static char unknown_signal[] = "Unknown signal 000000000000000000";
+ static char fmt[] = "Unknown signal%d";
+ size_t len = sprintf(unknown_signal, fmt, signum);
+ if (len < sizeof(fmt) - 2)
+ return NULL;
+ unknown_signal[len - 1] = '\0';
+ return unknown_signal;
+ }
+
+ return (char *) _sys_siglist[signum];
+}
diff --git a/string/strtok.c b/string/strtok.c
new file mode 100644
index 0000000000..0eaa82d1ea
--- /dev/null
+++ b/string/strtok.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <string.h>
+
+
+static char *olds = NULL;
+
+/* Parse S into tokens separated by characters in DELIM.
+ If S is NULL, the last string strtok() was called with is
+ used. For example:
+ char s[] = "-abc=-def";
+ x = strtok(s, "-"); // x = "abc"
+ x = strtok(NULL, "=-"); // x = "def"
+ x = strtok(NULL, "="); // x = NULL
+ // s = "abc\0-def\0"
+*/
+char *
+DEFUN(strtok, (s, delim),
+ register char *s AND register CONST char *delim)
+{
+ char *token;
+
+ if (s == NULL)
+ {
+ if (olds == NULL)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+ else
+ s = olds;
+ }
+
+ /* Scan leading delimiters. */
+ s += strspn(s, delim);
+ if (*s == '\0')
+ {
+ olds = NULL;
+ return NULL;
+ }
+
+ /* Find the end of the token. */
+ token = s;
+ s = strpbrk(token, delim);
+ if (s == NULL)
+ /* This token finishes the string. */
+ olds = NULL;
+ else
+ {
+ /* Terminate the token and make OLDS point past it. */
+ *s = '\0';
+ olds = s + 1;
+ }
+ return token;
+}
diff --git a/string/strxfrm.c b/string/strxfrm.c
new file mode 100644
index 0000000000..a37996b13a
--- /dev/null
+++ b/string/strxfrm.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Transform SRC into a form such that the result of strcmp
+ on two strings that have been transformed by strxfrm is
+ the same as the result of strcoll on the two strings before
+ their transformation. The transformed string is put in at
+ most N characters of DEST and its length is returned. */
+size_t
+DEFUN(strxfrm, (dest, src, n), char *dest AND CONST char *src AND size_t n)
+{
+ CONST unsigned char *CONST values
+ = _collate_info != NULL ? _collate_info->values : NULL;
+ CONST unsigned char *CONST offsets
+ = _collate_info != NULL ? _collate_info->offsets : NULL;
+ register size_t done = 0;
+
+ while (*src != '\0')
+ {
+ CONST unsigned char c = *src++;
+
+ ++done;
+ if (offsets != NULL && offsets[c] != 0)
+ {
+ ++done;
+ if (offsets[c] == CHAR_MAX)
+ ++done;
+ }
+ if (done < n && dest != NULL)
+ {
+ if (values == NULL)
+ *dest++ = c;
+ else if (values[c] == UCHAR_MAX && offsets[c] == 0)
+ /* This is a non-collating element. Skip it. */
+ ;
+ else if (values[c] == UCHAR_MAX && offsets[c] == CHAR_MAX)
+ {
+ /* This element collates lower than anything else. */
+ *dest++ = '\001';
+ *dest++ = '\001';
+ *dest++ = '\001';
+ }
+ else
+ {
+ *dest++ = values[c];
+ *dest++ = offsets[c];
+ }
+ }
+ }
+
+ if (dest != NULL)
+ *dest = '\0';
+ return done;
+}
diff --git a/sysdeps/generic/acos.c b/sysdeps/generic/acos.c
new file mode 100644
index 0000000000..ca6f7304b9
--- /dev/null
+++ b/sysdeps/generic/acos.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the inverse cosine of X. */
+double
+DEFUN(acos, (x), double x)
+{
+ double t;
+
+ if (__isnan(x))
+ {
+ errno = EDOM;
+ return x;
+ }
+
+ if (x == -1.0)
+ /* If X is -1, the general formula blows up (zero divided by zero loses),
+ but we know that acos(-1) = pi. */
+ t = atan2(1.0, 0.0);
+ else
+ t = atan2(sqrt((1.0 - x) / (1.0 + x)), 1.0);
+ return t + t;
+}
diff --git a/sysdeps/generic/asin.c b/sysdeps/generic/asin.c
new file mode 100644
index 0000000000..9823e3e6e6
--- /dev/null
+++ b/sysdeps/generic/asin.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the inverse sine of X. */
+double
+DEFUN(asin, (x), double x)
+{
+ double abs_x;
+
+ if (__isnan(x))
+ {
+ errno = EDOM;
+ return x;
+ }
+
+ abs_x = fabs(x);
+
+ if (abs_x <= 0.5)
+ return atan2(x, sqrt(1.0 - (x * x)));
+ else
+ {
+ double t = 1.0 - abs_x;
+ return atan2(x, sqrt((t + t) - (t * t)));
+ }
+}
diff --git a/sysdeps/generic/atan.c b/sysdeps/generic/atan.c
new file mode 100644
index 0000000000..98f2e5a16c
--- /dev/null
+++ b/sysdeps/generic/atan.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+/* Return the inverse tangent of X. */
+double
+DEFUN(atan, (x), register double x)
+{
+ return atan2(x, 1.0);
+}
diff --git a/sysdeps/generic/bcopy.c b/sysdeps/generic/bcopy.c
new file mode 100644
index 0000000000..1384e4a9dc
--- /dev/null
+++ b/sysdeps/generic/bcopy.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <bstring.h>
+#include <string.h>
+
+
+#define memmove bcopy
+#define rettype void
+#define RETURN(s) return
+#define a1 src
+#define a1const CONST
+#define a2 dest
+#define a2const
+
+#include <memmove.c>
diff --git a/sysdeps/generic/bzero.c b/sysdeps/generic/bzero.c
new file mode 100644
index 0000000000..8401c8b04b
--- /dev/null
+++ b/sysdeps/generic/bzero.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <bstring.h>
+
+
+/* Set N bytes of S to 0. */
+void
+DEFUN(bzero, (s, n), PTR s AND size_t n)
+{
+ register char *p = (char *) s;
+ register size_t i = n;
+
+ while (i-- > 0)
+ *p++ = 0;
+}
diff --git a/sysdeps/generic/fabs.c b/sysdeps/generic/fabs.c
new file mode 100644
index 0000000000..90350cc89a
--- /dev/null
+++ b/sysdeps/generic/fabs.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+/* Return the absolute value of X. */
+double
+DEFUN(fabs, (x), register double x)
+{
+ return x < 0.0 ? -x : x;
+}
diff --git a/sysdeps/generic/getpgrp.c b/sysdeps/generic/getpgrp.c
new file mode 100644
index 0000000000..f3db36caa8
--- /dev/null
+++ b/sysdeps/generic/getpgrp.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+
+/* Get the process group ID of the calling process. */
+int
+DEFUN_VOID(getpgrp)
+{
+ return getpid();
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(getpgrp);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/generic/hypot.c b/sysdeps/generic/hypot.c
new file mode 100644
index 0000000000..d284fd5f89
--- /dev/null
+++ b/sysdeps/generic/hypot.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+/* Return `sqrt(x*x + y*y)'. */
+double
+DEFUN(hypot, (x, y), double x AND double y)
+{
+ return sqrt(x*x + y*y);
+}
diff --git a/sysdeps/generic/infnan.c b/sysdeps/generic/infnan.c
new file mode 100644
index 0000000000..1cb0eaaf1e
--- /dev/null
+++ b/sysdeps/generic/infnan.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Deal with an infinite or NaN result.
+ If ERROR is ERANGE, result is +Inf;
+ if ERROR is - ERANGE, result is -Inf;
+ otherwise result is NaN.
+ This will set `errno' to either ERANGE or EDOM,
+ and may return an infinity or NaN, or may do something else. */
+double
+DEFUN(__infnan, (error), int error)
+{
+ switch (error)
+ {
+ case ERANGE:
+ errno = ERANGE;
+ return HUGE_VAL;
+
+ case - ERANGE:
+ errno = ERANGE;
+ return - HUGE_VAL;
+
+ default:
+ errno = EDOM;
+ return 0.0;
+ }
+}
diff --git a/sysdeps/generic/log10.c b/sysdeps/generic/log10.c
new file mode 100644
index 0000000000..b72d9e779e
--- /dev/null
+++ b/sysdeps/generic/log10.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+#ifndef LN10
+#define LN10 log(10.0)
+#endif
+
+/* Return the base-ten logarithm of X. */
+double
+DEFUN(log10, (x), double x)
+{
+ static double ln10 = 0.0;
+
+ if (ln10 == 0.0)
+ ln10 = LN10;
+
+ return log(x) / ln10;
+}
diff --git a/sysdeps/generic/modf.c b/sysdeps/generic/modf.c
new file mode 100644
index 0000000000..d502b576bb
--- /dev/null
+++ b/sysdeps/generic/modf.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+#undef modf
+
+/* Break VALUE into integral and fractional parts. */
+double
+DEFUN(modf, (value, iptr), double value AND double *iptr)
+{
+ register double ipart = floor(value);
+ *iptr = ipart;
+ return value - ipart;
+}
diff --git a/sysdeps/generic/pow.c b/sysdeps/generic/pow.c
new file mode 100644
index 0000000000..e9bdf5f6df
--- /dev/null
+++ b/sysdeps/generic/pow.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return X to the Y power. */
+double
+DEFUN(pow, (x, y), double x AND double y)
+{
+ if (y == 0.0 || x == 1.0)
+ return 1.0;
+ else if (y == 1.0)
+ return x;
+ else if (y == 2.0)
+ return x * x;
+ else if (y == -1.0)
+ return 1.0 / x;
+
+ return exp(y * log(x));
+}
diff --git a/sysdeps/generic/strcspn.c b/sysdeps/generic/strcspn.c
new file mode 100644
index 0000000000..c3f7fe552a
--- /dev/null
+++ b/sysdeps/generic/strcspn.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <string.h>
+
+
+/* Return the length of the maximum inital segment of S
+ which contains no characters from REJECT. */
+size_t
+DEFUN(strcspn, (s, reject),
+ register CONST char *s AND register CONST char *reject)
+{
+ register size_t count = 0;
+
+ while (*s != '\0')
+ if (strchr(reject, *s++) == NULL)
+ ++count;
+ else
+ return count;
+
+ return count;
+}
diff --git a/sysdeps/generic/strpbrk.c b/sysdeps/generic/strpbrk.c
new file mode 100644
index 0000000000..2adfafeb52
--- /dev/null
+++ b/sysdeps/generic/strpbrk.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <string.h>
+
+
+/* Find the first ocurrence in S of any character in ACCEPT. */
+char *
+DEFUN(strpbrk, (s, accept),
+ register CONST char *s AND register CONST char *accept)
+{
+ while (*s != '\0')
+ if (strchr(accept, *s) == NULL)
+ ++s;
+ else
+ return (char *) s;
+
+ return NULL;
+}
diff --git a/sysdeps/generic/strspn.c b/sysdeps/generic/strspn.c
new file mode 100644
index 0000000000..17c6eabc10
--- /dev/null
+++ b/sysdeps/generic/strspn.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <string.h>
+
+
+/* Return the length of the maximum initial segment
+ of S which contains only characters in ACCEPT. */
+size_t
+DEFUN(strspn, (s, accept), CONST char *s AND CONST char *accept)
+{
+ register CONST char *p;
+ register CONST char *a;
+ register size_t count = 0;
+
+ for (p = s; *p != '\0'; ++p)
+ {
+ for (a = accept; *a != '\0'; ++a)
+ if (*p == *a)
+ break;
+ if (*a == '\0')
+ return count;
+ else
+ ++count;
+ }
+
+ return count;
+}
diff --git a/sysdeps/generic/vlimit.c b/sysdeps/generic/vlimit.c
new file mode 100644
index 0000000000..d93ce48674
--- /dev/null
+++ b/sysdeps/generic/vlimit.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This is generic in the sense that it will work with the BSD, SYSV,
+ or stub versions of getrlimit. Separate versions could be written
+ for efficiency, but it's probably not worth it. */
+
+#include <ansidecl.h>
+#include <sys/vlimit.h>
+#include <sys/resource.h>
+#include <errno.h>
+
+/* Set the soft limit for RESOURCE to be VALUE.
+ Returns 0 for success, -1 for failure. */
+int
+DEFUN(vlimit, (resource, value),
+ enum __vlimit_resource resource AND int value)
+{
+ if (resource >= LIM_CPU && resource <= LIM_MAXRSS)
+ {
+ /* The rlimit codes happen to each be one less
+ than the corresponding vlimit codes. */
+ enum __rlimit_resource rlimit_res =
+ (enum __rlimit_resource) ((int) resource - 1);
+ struct rlimit lims;
+
+ if (getrlimit(rlimit_res, &lims) < 0)
+ return -1;
+
+ lims.rlim_cur = value;
+ return setrlimit(rlimit_res, &lims);
+ }
+
+ errno = EINVAL;
+ return -1;
+}
diff --git a/sysdeps/ieee754/log10.c b/sysdeps/ieee754/log10.c
new file mode 100644
index 0000000000..9d52eec256
--- /dev/null
+++ b/sysdeps/ieee754/log10.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the base-ten logarithm of X. */
+double
+DEFUN(log10, (x), double x)
+{
+ CONST double inverse_ln10 = 4.3429448190325181667e-1; /* 1 / log(10) */
+
+ return inverse_ln10 * log(x);
+}
diff --git a/sysdeps/m68k/fpu/acos.c b/sysdeps/m68k/fpu/acos.c
new file mode 100644
index 0000000000..c9968979ed
--- /dev/null
+++ b/sysdeps/m68k/fpu/acos.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+#ifndef FUNC
+#define FUNC acos
+#endif
+
+
+double
+DEFUN(FUNC, (x), double x)
+{
+ return __m81_u(FUNC)(x);
+}
diff --git a/sysdeps/m68k/fpu/drem.c b/sysdeps/m68k/fpu/drem.c
new file mode 100644
index 0000000000..a9c504dad8
--- /dev/null
+++ b/sysdeps/m68k/fpu/drem.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+#undef drem
+
+double
+DEFUN(drem, (x, y), double x AND double y)
+{
+ return __drem(x, y);
+}
diff --git a/sysdeps/m68k/fpu/fmod.c b/sysdeps/m68k/fpu/fmod.c
new file mode 100644
index 0000000000..c8caabfef9
--- /dev/null
+++ b/sysdeps/m68k/fpu/fmod.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+double
+DEFUN(fmod, (x, y), double x AND double y)
+{
+ return __fmod(x, y);
+}
diff --git a/sysdeps/m68k/fpu/frexp.c b/sysdeps/m68k/fpu/frexp.c
new file mode 100644
index 0000000000..6ab7c5b937
--- /dev/null
+++ b/sysdeps/m68k/fpu/frexp.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+double
+DEFUN(frexp, (value, expptr), double value AND int *expptr)
+{
+ return __frexp(value, expptr);
+}
diff --git a/sysdeps/m68k/fpu/isinf.c b/sysdeps/m68k/fpu/isinf.c
new file mode 100644
index 0000000000..3d336029b1
--- /dev/null
+++ b/sysdeps/m68k/fpu/isinf.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+#ifndef FUNC
+#define FUNC __isinf
+#endif
+
+
+int
+DEFUN(FUNC, (x), double x)
+{
+ return __m81_u(FUNC)(x);
+}
diff --git a/sysdeps/m68k/fpu/ldexp.c b/sysdeps/m68k/fpu/ldexp.c
new file mode 100644
index 0000000000..0ecba72c7f
--- /dev/null
+++ b/sysdeps/m68k/fpu/ldexp.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+double
+DEFUN(ldexp, (x, exp), double x AND int exp)
+{
+ return __ldexp(x, exp);
+}
diff --git a/sysdeps/m68k/fpu/pow.c b/sysdeps/m68k/fpu/pow.c
new file mode 100644
index 0000000000..9273c8043b
--- /dev/null
+++ b/sysdeps/m68k/fpu/pow.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#define __NO_MATH_INLINES
+#include <math.h>
+
+double
+DEFUN(pow, (x, y), double x AND double y)
+{
+ return __pow(x, y);
+}
diff --git a/sysdeps/posix/clock.c b/sysdeps/posix/clock.c
new file mode 100644
index 0000000000..62ce45111c
--- /dev/null
+++ b/sysdeps/posix/clock.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <sys/times.h>
+#include <time.h>
+
+/* Return the time used by the program so far (user time + system time). */
+clock_t
+DEFUN_VOID(clock)
+{
+ struct tms buf;
+ clock_t result;
+
+ if (__times(&buf) < 0)
+ return (clock_t) -1;
+
+ return ((buf.tms_utime + buf.tms_stime) * CLK_TCK * CLOCKS_PER_SEC);
+}
diff --git a/sysdeps/posix/ctermid.c b/sysdeps/posix/ctermid.c
new file mode 100644
index 0000000000..528e821e10
--- /dev/null
+++ b/sysdeps/posix/ctermid.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdio.h>
+#include <string.h>
+
+
+/* Return the name of the controlling terminal.
+ If S is not NULL, the name is copied into it (it should be at
+ least L_ctermid bytes long), otherwise a static buffer is used. */
+char *
+DEFUN(ctermid, (s), char *s)
+{
+ static char name[L_ctermid];
+
+ if (name[0] == '\0')
+ (void) strcpy(name, "/dev/tty");
+
+ if (s == NULL)
+ return(name);
+
+ return(strcpy(s, name));
+}
diff --git a/sysdeps/posix/raise.c b/sysdeps/posix/raise.c
new file mode 100644
index 0000000000..e3932988d6
--- /dev/null
+++ b/sysdeps/posix/raise.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <signal.h>
+#include <unistd.h>
+
+/* Raise the signal SIG. */
+int
+DEFUN(raise, (sig), int sig)
+{
+ return __kill(__getpid(), sig);
+}
diff --git a/sysdeps/posix/rename.c b/sysdeps/posix/rename.c
new file mode 100644
index 0000000000..4db8f262e3
--- /dev/null
+++ b/sysdeps/posix/rename.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+
+/* Rename the file OLD to NEW. */
+int
+DEFUN(rename, (old, new), CONST char *old AND CONST char *new)
+{
+ int save = errno;
+ if (__link(old, new) < 0)
+ {
+ if (errno == EEXIST)
+ {
+ errno = save;
+ /* Race condition, required for 1003.1 conformance. */
+ if (__unlink(new) < 0 ||
+ __link(old, new) < 0)
+ return -1;
+ }
+ }
+ if (__unlink(old) < 0)
+ {
+ save = errno;
+ if (__unlink(new) == 0)
+ errno = save;
+ return -1;
+ }
+ return 0;
+}
diff --git a/sysdeps/posix/signal.c b/sysdeps/posix/signal.c
new file mode 100644
index 0000000000..ee6ee7f92e
--- /dev/null
+++ b/sysdeps/posix/signal.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <signal.h>
+
+
+/* Set the handler for the signal SIG to HANDLER,
+ returning the old handler, or SIG_ERR on error. */
+__sighandler_t
+DEFUN(signal, (sig, handler), int sig AND __sighandler_t handler)
+{
+ struct sigaction act, oact;
+
+ if (handler == SIG_ERR)
+ {
+ errno = EINVAL;
+ return SIG_ERR;
+ }
+
+ act.sa_handler = handler;
+ if (__sigemptyset(&act.sa_mask) < 0)
+ return SIG_ERR;
+ act.sa_flags = 0;
+ if (__sigaction(sig, &act, &oact) < 0)
+ return SIG_ERR;
+
+ return oact.sa_handler;
+}
diff --git a/sysdeps/posix/sigsuspend.c b/sysdeps/posix/sigsuspend.c
new file mode 100644
index 0000000000..df378c2528
--- /dev/null
+++ b/sysdeps/posix/sigsuspend.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <signal.h>
+#include <stddef.h>
+#include <unistd.h>
+
+
+/* Change the set of blocked signals to SET,
+ wait until a signal arrives, and restore the set of blocked signals. */
+int
+DEFUN(sigsuspend, (set), CONST sigset_t *set)
+{
+ sigset_t oset;
+ int save;
+
+ if (set == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (sigprocmask(SIG_SETMASK, set, &oset) < 0)
+ return -1;
+
+ (void) pause();
+ save = errno;
+
+ if (sigprocmask(SIG_SETMASK, &oset, (sigset_t *) NULL) < 0)
+ return -1;
+
+ errno = save;
+ return -1;
+}
diff --git a/sysdeps/stub/__longjmp.c b/sysdeps/stub/__longjmp.c
new file mode 100644
index 0000000000..87ae45356d
--- /dev/null
+++ b/sysdeps/stub/__longjmp.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <setjmp.h>
+
+
+/* Jump to the position specified by ENV, causing the
+ setjmp call there to return VAL, or 1 if VAL is 0. */
+__NORETURN
+void
+DEFUN(__longjmp, (env, val), CONST jmp_buf env AND int val)
+{
+ if (val == 0)
+ val = 1;
+
+ errno = ENOSYS;
+ /* No way to signal failure. */
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(longjmp);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/accept.c b/sysdeps/stub/accept.c
new file mode 100644
index 0000000000..400a91e896
--- /dev/null
+++ b/sysdeps/stub/accept.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Await a connection on socket FD.
+ When a connection arrives, open a new socket to communicate with it,
+ set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+ peer and *ADDR_LEN to the address's actual length, and return the
+ new socket's descriptor, or -1 for errors. */
+int
+DEFUN(accept, (fd, addr, addr_len),
+ int fd AND struct sockaddr *addr AND size_t *addr_len)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(accept);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/acct.c b/sysdeps/stub/acct.c
new file mode 100644
index 0000000000..a9ff2658e1
--- /dev/null
+++ b/sysdeps/stub/acct.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Turn accounting on if NAME is an existing file. The system will then write
+ a record for each process as it terminates, to this file. If NAME is NULL,
+ turn accounting off. This call is restricted to the super-user. */
+int
+DEFUN(acct, (name), CONST char *name)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(acct);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/acos.c b/sysdeps/stub/acos.c
new file mode 100644
index 0000000000..8fd781322c
--- /dev/null
+++ b/sysdeps/stub/acos.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the inverse cosine of X. */
+double
+DEFUN(acos, (x), double x)
+{
+ errno = ENOSYS;
+ return 0.0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(acos);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/alarm.c b/sysdeps/stub/alarm.c
new file mode 100644
index 0000000000..17402dd5bb
--- /dev/null
+++ b/sysdeps/stub/alarm.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.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
+DEFUN(alarm, (seconds), unsigned int seconds)
+{
+ errno = ENOSYS;
+ return 0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(alarm);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/asin.c b/sysdeps/stub/asin.c
new file mode 100644
index 0000000000..902c3bd19e
--- /dev/null
+++ b/sysdeps/stub/asin.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the inverse sine of X. */
+double
+DEFUN(asin, (x), double x)
+{
+ errno = ENOSYS;
+ return 0.0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(asin);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/atan2.c b/sysdeps/stub/atan2.c
new file mode 100644
index 0000000000..08376df699
--- /dev/null
+++ b/sysdeps/stub/atan2.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+/* Return the inverse tangent of Y/X. */
+double
+DEFUN(atan2, (y, x), double y AND double x)
+{
+ errno = ENOSYS;
+ return 0.0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(atan2);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/bind.c b/sysdeps/stub/bind.c
new file mode 100644
index 0000000000..2048451200
--- /dev/null
+++ b/sysdeps/stub/bind.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Give the socket FD the local address ADDR (which is LEN bytes long). */
+int
+DEFUN(bind, (fd, addr, len),
+ int fd AND struct sockaddr *addr AND size_t len)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(bind);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/chroot.c b/sysdeps/stub/chroot.c
new file mode 100644
index 0000000000..449640c0a1
--- /dev/null
+++ b/sysdeps/stub/chroot.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Make PATH be the root directory (the starting point for absolute paths).
+ This call is restricted to the super-user. */
+int
+DEFUN(chroot, (path), CONST char *path)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(chroot);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/closedir.c b/sysdeps/stub/closedir.c
new file mode 100644
index 0000000000..f6cc3bf086
--- /dev/null
+++ b/sysdeps/stub/closedir.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <dirent.h>
+
+
+/* Close the directory stream DIRP.
+ Return 0 if successful, -1 if not. */
+int
+DEFUN(closedir, (dirp), DIR *dirp)
+{
+ errno = ENOSYS;
+ return(-1);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(closedir);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/connect.c b/sysdeps/stub/connect.c
new file mode 100644
index 0000000000..5b4f47f584
--- /dev/null
+++ b/sysdeps/stub/connect.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
+ For connectionless socket types, just set the default address to send to
+ and the only address from which to accept transmissions.
+ Return 0 on success, -1 for errors. */
+int
+DEFUN(connect, (fd, addr, len),
+ int fd AND struct sockaddr *addr AND size_t len)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(connect);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/cos.c b/sysdeps/stub/cos.c
new file mode 100644
index 0000000000..33920e7145
--- /dev/null
+++ b/sysdeps/stub/cos.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the cosine of X. */
+double
+DEFUN(cos, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(cos);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/cosh.c b/sysdeps/stub/cosh.c
new file mode 100644
index 0000000000..ba655acad7
--- /dev/null
+++ b/sysdeps/stub/cosh.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the hyperbolic cosine of X. */
+double
+DEFUN(cosh, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(cosh);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/ctermid.c b/sysdeps/stub/ctermid.c
new file mode 100644
index 0000000000..bd3e2cffa3
--- /dev/null
+++ b/sysdeps/stub/ctermid.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stdio.h>
+
+
+/* Return the name of the controlling terminal.
+ If S is not NULL, the name is copied into it (it should be at
+ least L_ctermid bytes long), otherwise a static buffer is used. */
+char *
+DEFUN(ctermid, (s), char *s)
+{
+ errno = ENOSYS;
+ return NULL;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(ctermid);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/exp.c b/sysdeps/stub/exp.c
new file mode 100644
index 0000000000..4b0eaeb657
--- /dev/null
+++ b/sysdeps/stub/exp.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return e to the X. */
+double
+DEFUN(exp, (x), double x)
+{
+ errno = ENOSYS;
+ return 0.0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(exp);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/fmod.c b/sysdeps/stub/fmod.c
new file mode 100644
index 0000000000..835bb896c9
--- /dev/null
+++ b/sysdeps/stub/fmod.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the floating-point modulo remainder of X/Y. */
+double
+DEFUN(fmod, (x, y), double x AND double y)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(fmod);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/fsync.c b/sysdeps/stub/fsync.c
new file mode 100644
index 0000000000..33711f40d2
--- /dev/null
+++ b/sysdeps/stub/fsync.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Make all changes done to FD actually appear on disk. */
+int
+DEFUN(fsync, (fd), int fd)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(fsync);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/ftruncate.c b/sysdeps/stub/ftruncate.c
new file mode 100644
index 0000000000..6e3c2dd203
--- /dev/null
+++ b/sysdeps/stub/ftruncate.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <sys/types.h>
+#include <errno.h>
+
+/* Truncate the file FD refers to to LENGTH bytes. */
+int
+DEFUN(ftruncate, (fd, length),
+ int fd AND off_t length)
+{
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/sysdeps/stub/getenv.c b/sysdeps/stub/getenv.c
new file mode 100644
index 0000000000..2e8d181657
--- /dev/null
+++ b/sysdeps/stub/getenv.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* Return the value of the environment variable NAME. */
+char *
+DEFUN(getenv, (name), CONST char *name)
+{
+ errno = ENOSYS;
+ return(NULL);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(getenv);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/gethostid.c b/sysdeps/stub/gethostid.c
new file mode 100644
index 0000000000..bff0ce47a2
--- /dev/null
+++ b/sysdeps/stub/gethostid.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Return the current machine's Internet number. */
+long int
+DEFUN_VOID(gethostid)
+{
+ errno = ENOSYS;
+ return -1L;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(gethostid);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/getlogin.c b/sysdeps/stub/getlogin.c
new file mode 100644
index 0000000000..aa099d37fb
--- /dev/null
+++ b/sysdeps/stub/getlogin.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Return the login name of the user, or NULL if it can't be determined.
+ The returned pointer, if not NULL, is good only until the next call. */
+char *
+DEFUN_VOID(getlogin)
+{
+ errno = ENOSYS;
+ return NULL;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(getlogin);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/getrlimit.c b/sysdeps/stub/getrlimit.c
new file mode 100644
index 0000000000..6ec394245b
--- /dev/null
+++ b/sysdeps/stub/getrlimit.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <sys/resource.h>
+#include <errno.h>
+
+/* Put the soft and hard limits for RESOURCE in *RLIMITS.
+ Returns 0 if successful, -1 if not (and sets errno). */
+int
+DEFUN(getrlimit, (resource, rlimits),
+ enum __rlimit_resource resource AND struct rlimit *rlimits)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(getrlimit);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/getsockopt.c b/sysdeps/stub/getsockopt.c
new file mode 100644
index 0000000000..a56aa83550
--- /dev/null
+++ b/sysdeps/stub/getsockopt.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
+ into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
+ actual length. Returns 0 on success, -1 for errors. */
+int
+DEFUN(getsockopt, (fd, level, optname, optval, optlen),
+ int fd AND int level AND int optname AND
+ PTR optval AND size_t *optlen)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(getsockopt);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/init-posix.c b/sysdeps/stub/init-posix.c
new file mode 100644
index 0000000000..1240cdaa05
--- /dev/null
+++ b/sysdeps/stub/init-posix.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+
+#ifndef __GNU_STAB__
+
+void
+DEFUN_VOID(__init_posix)
+{
+ return;
+}
+
+#endif
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__init_posix);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/isinf.c b/sysdeps/stub/isinf.c
new file mode 100644
index 0000000000..92aaddea4e
--- /dev/null
+++ b/sysdeps/stub/isinf.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <math.h>
+
+/* Return 0 if VALUE is finite or NaN, +1 if it
+ is +Infinity, -1 if it is -Infinity. */
+int
+DEFUN(__isinf, (value), double value)
+{
+ return 0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__isinf);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/kill.c b/sysdeps/stub/kill.c
new file mode 100644
index 0000000000..7b376c5efa
--- /dev/null
+++ b/sysdeps/stub/kill.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <signal.h>
+
+
+/* Send signal SIG to process number PID. If PID is zero,
+ send SIG to all processes in the current process's process group.
+ If PID is < -1, send SIG to all processes in process group - PID. */
+int
+DEFUN(__kill, (pid, sig), int pid AND int sig)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__kill);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/listen.c b/sysdeps/stub/listen.c
new file mode 100644
index 0000000000..99cf638a06
--- /dev/null
+++ b/sysdeps/stub/listen.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Prepare to accept connections on socket FD.
+ N connection requests will be queued before further requests are refused.
+ Returns 0 on success, -1 for errors. */
+int
+DEFUN(listen, (fd, n),
+ int fd AND unsigned int n)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(listen);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/log.c b/sysdeps/stub/log.c
new file mode 100644
index 0000000000..20bb8a9f7a
--- /dev/null
+++ b/sysdeps/stub/log.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the natural logarithm of X. */
+double
+DEFUN(log, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(log);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/log10.c b/sysdeps/stub/log10.c
new file mode 100644
index 0000000000..ebb9335b32
--- /dev/null
+++ b/sysdeps/stub/log10.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the base-ten logarithm of X. */
+double
+DEFUN(log10, (x), double x)
+{
+ errno = ENOSYS;
+ return 0.0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(log10);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/mktemp.c b/sysdeps/stub/mktemp.c
new file mode 100644
index 0000000000..8dfd2a8c14
--- /dev/null
+++ b/sysdeps/stub/mktemp.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <string.h>
+#include <errno.h>
+
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the filename unique. */
+char *
+DEFUN(mktemp, (template), char *template)
+{
+ if (strcmp(&template[strlen(template) - 6], "XXXXXX"))
+ {
+ errno = EINVAL;
+ return template;
+ }
+
+ errno = ENOSYS;
+ return NULL;
+}
diff --git a/sysdeps/stub/morecore.c b/sysdeps/stub/morecore.c
new file mode 100644
index 0000000000..8889251bfe
--- /dev/null
+++ b/sysdeps/stub/morecore.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <errno.h>
+
+#define _MALLOC_INTERNAL
+#include <malloc.h>
+
+/* Allocate INCREMENT more bytes of data space,
+ and return the start of data space, or NULL on errors.
+ If INCREMENT is negative, shrink data space. */
+PTR
+DEFUN(__default_morecore, (increment), long int increment)
+{
+ errno = ENOSYS;
+ return NULL;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__default_morecore);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/opendir.c b/sysdeps/stub/opendir.c
new file mode 100644
index 0000000000..cb94d18ef1
--- /dev/null
+++ b/sysdeps/stub/opendir.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY. No author or distributor accepts responsibility for
+the consequences of using it or for whether it serves any particular
+purpose or works at all, unless he says so in writing. Refer to the GNU
+C Library General Public License (in the file COPYING) for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+the GNU C Library, but only under the conditions described in the
+GNU C Library General Public License. Among other things, this notice
+must not be changed and a copy of the license must be included. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <dirent.h>
+
+
+/* Open a directory stream on NAME. */
+DIR *
+DEFUN(opendir, (name), CONST char *name)
+{
+ errno = ENOSYS;
+ return(NULL);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(opendir);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/pause.c b/sysdeps/stub/pause.c
new file mode 100644
index 0000000000..d8d39c70a8
--- /dev/null
+++ b/sysdeps/stub/pause.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+
+/* Suspend the process until a signal arrives.
+ This is supposed to always return -1 and set errno to EINTR,
+ but rules were meant to be broken. */
+int
+DEFUN_VOID(pause)
+{
+ errno = ENOSYS;
+ return(-1);
+}
+
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(pause);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/raise.c b/sysdeps/stub/raise.c
new file mode 100644
index 0000000000..cf4a87c7d0
--- /dev/null
+++ b/sysdeps/stub/raise.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <signal.h>
+#include <errno.h>
+
+/* Raise the signal SIG. */
+int
+DEFUN(raise, (sig), int sig)
+{
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/sysdeps/stub/readdir.c b/sysdeps/stub/readdir.c
new file mode 100644
index 0000000000..f227b33fa4
--- /dev/null
+++ b/sysdeps/stub/readdir.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY. No author or distributor accepts responsibility for
+the consequences of using it or for whether it serves any particular
+purpose or works at all, unless he says so in writing. Refer to the GNU
+C Library General Public License (in the file COPYING) for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+the GNU C Library, but only under the conditions described in the
+GNU C Library General Public License. Among other things, this notice
+must not be changed and a copy of the license must be included. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <dirent.h>
+
+/* Read a directory entry from DIRP. */
+struct dirent *
+DEFUN(readdir, (dirp), DIR *dirp)
+{
+ errno = ENOSYS;
+ return(NULL);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(readdir);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/recv.c b/sysdeps/stub/recv.c
new file mode 100644
index 0000000000..880ade7497
--- /dev/null
+++ b/sysdeps/stub/recv.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Read N bytes into BUF from socket FD.
+ Returns the number read or -1 for errors. */
+int
+DEFUN(recv, (fd, buf, n, flags),
+ int fd AND PTR buf AND size_t n AND int flags)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(recv);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/recvmsg.c b/sysdeps/stub/recvmsg.c
new file mode 100644
index 0000000000..ce6449dcdb
--- /dev/null
+++ b/sysdeps/stub/recvmsg.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Receive a message as described by MESSAGE from socket FD.
+ Returns the number of bytes read or -1 for errors. */
+int
+DEFUN(recvmsg, (fd, message, flags),
+ int fd AND struct msghdr *message AND int flags)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(recvmsg);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/rewinddir.c b/sysdeps/stub/rewinddir.c
new file mode 100644
index 0000000000..0fb68bda10
--- /dev/null
+++ b/sysdeps/stub/rewinddir.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY. No author or distributor accepts responsibility for
+the consequences of using it or for whether it serves any particular
+purpose or works at all, unless he says so in writing. Refer to the GNU
+C Library General Public License (in the file COPYING) for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+the GNU C Library, but only under the conditions described in the
+GNU C Library General Public License. Among other things, this notice
+must not be changed and a copy of the license must be included. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <dirent.h>
+
+
+/* Rewind DIRP to the beginning of the directory. */
+void
+DEFUN(rewinddir, (dirp), DIR *dirp)
+{
+ errno = ENOSYS;
+ /* No way to indicate failure. */
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(rewinddir);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sbrk.c b/sysdeps/stub/sbrk.c
new file mode 100644
index 0000000000..0c4756f275
--- /dev/null
+++ b/sysdeps/stub/sbrk.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+
+/* Extend the process's data space by INCREMENT.
+ If INCREMENT is negative, shrink data space by - INCREMENT.
+ Return the address of the start of data space, or -1 for errors. */
+PTR
+DEFUN(__sbrk, (increment), int increment)
+{
+ errno = ENOSYS;
+ return (PTR) -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__sbrk);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sendmsg.c b/sysdeps/stub/sendmsg.c
new file mode 100644
index 0000000000..74d7ae0bb6
--- /dev/null
+++ b/sysdeps/stub/sendmsg.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Send a message described MESSAGE on socket FD.
+ Returns the number of bytes sent, or -1 for errors. */
+int
+DEFUN(sendmsg, (fd, message, flags),
+ int fd AND CONST struct msghdr *message AND int flags)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sendmsg);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sendto.c b/sysdeps/stub/sendto.c
new file mode 100644
index 0000000000..639d49ddcc
--- /dev/null
+++ b/sysdeps/stub/sendto.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
+ ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
+int
+DEFUN(sendto, (fd, buf, n, flags, addr, addr_len),
+ int fd AND PTR buf AND size_t n AND int flags AND
+ struct sockaddr *addr AND size_t addr_len)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sendto);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sethostid.c b/sysdeps/stub/sethostid.c
new file mode 100644
index 0000000000..b2432adc0c
--- /dev/null
+++ b/sysdeps/stub/sethostid.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Set the current machine's Internet number to ID.
+ This call is restricted to the super-user. */
+int
+DEFUN(sethostid, (id), long int id)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sethostid);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/setjmp.c b/sysdeps/stub/setjmp.c
new file mode 100644
index 0000000000..e1c9221915
--- /dev/null
+++ b/sysdeps/stub/setjmp.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <setjmp.h>
+
+
+/* Save the current program position in ENV and return 0. */
+int
+DEFUN(__setjmp, (env), jmp_buf env)
+{
+ errno = ENOSYS;
+
+ /* No way to signal failure. */
+ return 0;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__setjmp);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/setrlimit.c b/sysdeps/stub/setrlimit.c
new file mode 100644
index 0000000000..61968a254e
--- /dev/null
+++ b/sysdeps/stub/setrlimit.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <sys/resource.h>
+#include <errno.h>
+
+/* Set the soft and hard limits for RESOURCE to *RLIMITS.
+ Only the super-user can increase hard limits.
+ Return 0 if successful, -1 if not (and sets errno). */
+int
+DEFUN(setrlimit, (resource, rlimits),
+ enum __rlimit_resource resource AND struct rlimit *rlimits)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(setrlimit);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/setsockopt.c b/sysdeps/stub/setsockopt.c
new file mode 100644
index 0000000000..00bec9c392
--- /dev/null
+++ b/sysdeps/stub/setsockopt.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Set socket FD's option OPTNAME at protocol level LEVEL
+ to *OPTVAL (which is OPTLEN bytes long).
+ Returns 0 on success, -1 for errors. */
+int
+DEFUN(setsockopt, (fd, level, optname, optval, optlen),
+ int fd AND int level AND int optname AND
+ PTR optval AND size_t optlen)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(setsockopt);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/shutdown.c b/sysdeps/stub/shutdown.c
new file mode 100644
index 0000000000..d47684ca29
--- /dev/null
+++ b/sysdeps/stub/shutdown.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Shut down all or part of the connection open on socket FD.
+ HOW determines what to shut down:
+ 0 = No more receptions;
+ 1 = No more transmissions;
+ 2 = No more receptions or transmissions.
+ Returns 0 on success, -1 for errors. */
+int
+DEFUN(shutdown, (fd, how),
+ int fd AND int how)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(shutdown);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/signum.h b/sysdeps/stub/signum.h
new file mode 100644
index 0000000000..db115f2417
--- /dev/null
+++ b/sysdeps/stub/signum.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+extern void EXFUN(_sig_ign, (int sig));
+extern void EXFUN(_sig_dfl, (int sig));
+
+#define SIG_ERR /* Error return. */ \
+ ((void EXFUN((*), (int sig))) 0)
+#define SIG_DFL /* Default action. */ \
+ _sig_dfl
+#define SIG_IGN /* Ignore signal. */ \
+ _sig_ign
+
+
+/* ANSI signals. */
+#define SIGABRT 1 /* Abnormal termination. */
+#define SIGFPE 2 /* Erroneous arithmetic operation. */
+#define SIGILL 3 /* Illegal instruction. */
+#define SIGINT 3 /* Interactive attention signal. */
+#define SIGSEGV 4 /* Invalid access to storage. */
+#define SIGTERM 5 /* Termination request. */
+
+/* POSIX signals. */
+#define SIGHUP 6 /* Hangup. */
+#define SIGQUIT 7 /* Quit. */
+#define SIGPIPE 8 /* Broken pipe. */
+#define SIGKILL 9 /* Kill (cannot be blocked, caught, or ignored). */
+#define SIGALRM 10 /* Alarm clock. */
+#define SIGSTOP 11 /* Stop (cannot be blocked, caught, or ignored). */
+#define SIGTSTP 12 /* Keyboard stop. */
+#define SIGCONT 13 /* Continue. */
+#define SIGCHLD 14 /* Child terminated or stopped. */
+#define SIGTTIN 15 /* Background read from control terminal. */
+#define SIGTTOU 16 /* Background write to control terminal. */
+
+#endif /* <signal.h> included. */
+
+#define _NSIG 17
diff --git a/sysdeps/stub/sigpending.c b/sysdeps/stub/sigpending.c
new file mode 100644
index 0000000000..62136a3fc3
--- /dev/null
+++ b/sysdeps/stub/sigpending.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <signal.h>
+
+
+/* Store in SET all signals that are blocked and pending. */
+int
+DEFUN(sigpending, (set), sigset_t *set)
+{
+ if (set == NULL)
+ {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sigpending);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sigstack.c b/sysdeps/stub/sigstack.c
new file mode 100644
index 0000000000..c4463bec5a
--- /dev/null
+++ b/sysdeps/stub/sigstack.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <signal.h>
+
+/* Run signals handlers on the stack specified by SS (if not NULL).
+ If OSS is not NULL, it is filled in with the old signal stack status. */
+int
+DEFUN(sigstack, (ss, oss),
+ CONST struct sigstack *ss AND struct sigstack *oss)
+{
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/sysdeps/stub/sigvec.c b/sysdeps/stub/sigvec.c
new file mode 100644
index 0000000000..139b0e1d91
--- /dev/null
+++ b/sysdeps/stub/sigvec.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <signal.h>
+#include <errno.h>
+
+/* If VEC is non-NULL, set the handler for SIG to the `sv_handler' member
+ of VEC. The signals in `sv_mask' will be blocked while the handler runs.
+ If the SV_RESETHAND bit is set in `sv_flags', the handler for SIG will be
+ reset to SIG_DFL before `sv_handler' is entered. If OVEC is non-NULL,
+ it is filled in with the old information for SIG. */
+int
+DEFUN(__sigvec, (sig, vec, ovec),
+ int sig AND CONST struct sigvec *vec AND struct sigvec *ovec)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__sigvec);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sin.c b/sysdeps/stub/sin.c
new file mode 100644
index 0000000000..bb602a704e
--- /dev/null
+++ b/sysdeps/stub/sin.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the sine of X. */
+double
+DEFUN(sin, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sin);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sinh.c b/sysdeps/stub/sinh.c
new file mode 100644
index 0000000000..a83f6fc801
--- /dev/null
+++ b/sysdeps/stub/sinh.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the hyperbolic sine of X. */
+double
+DEFUN(sinh, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sinh);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/socket.c b/sysdeps/stub/socket.c
new file mode 100644
index 0000000000..d4c7ee8f1c
--- /dev/null
+++ b/sysdeps/stub/socket.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Create a new socket of type TYPE in domain DOMAIN, using
+ protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
+ Returns a file descriptor for the new socket, or -1 for errors. */
+int
+DEFUN(socket, (domain, type, protocol),
+ int domain AND enum __socket_type type AND int protocol)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(socket);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/socketpair.c b/sysdeps/stub/socketpair.c
new file mode 100644
index 0000000000..466ff0d788
--- /dev/null
+++ b/sysdeps/stub/socketpair.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <sys/socket.h>
+
+/* Create two new sockets, of type TYPE in domain DOMAIN and using
+ protocol PROTOCOL, which are connected to each other, and put file
+ descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
+ one will be chosen automatically. Returns 0 on success, -1 for errors. */
+int
+DEFUN(socketpair, (domain, type, protocol, fds),
+ int domain AND enum __socket_type type AND int protocol AND int fds[2])
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(socketpair);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sqrt.c b/sysdeps/stub/sqrt.c
new file mode 100644
index 0000000000..a49d26d8db
--- /dev/null
+++ b/sysdeps/stub/sqrt.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <math.h>
+
+/* Return the square root of X. */
+double
+DEFUN(sqrt, (x), double x)
+{
+ errno = ENOSYS;
+ return(0.0);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sqrt);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/swapon.c b/sysdeps/stub/swapon.c
new file mode 100644
index 0000000000..04b460195b
--- /dev/null
+++ b/sysdeps/stub/swapon.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Make the block special device PATH available to the system for swapping.
+ This call is restricted to the super-user. */
+int
+DEFUN(swapon, (path), CONST char *path)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(swapon);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/sync.c b/sysdeps/stub/sync.c
new file mode 100644
index 0000000000..84c690c9ac
--- /dev/null
+++ b/sysdeps/stub/sync.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <unistd.h>
+
+/* Make all changes done to all files actually appear on disk. */
+int
+DEFUN_VOID(sync)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(sync);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/unlink.c b/sysdeps/stub/unlink.c
new file mode 100644
index 0000000000..9312fb3a45
--- /dev/null
+++ b/sysdeps/stub/unlink.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <unistd.h>
+
+
+/* Remove the link named NAME. */
+int
+DEFUN(__unlink, (name), CONST char *name)
+{
+ if (name == NULL)
+ {
+ errno = EINVAL;
+ return(-1);
+ }
+
+ errno = ENOSYS;
+ return(-1);
+}
+
+
+#ifdef __GNU_STAB__
+
+#include <gnu-stabs.h>
+
+stub_warning(__unlink);
+
+#endif /* GNU stabs. */
diff --git a/sysdeps/stub/utimes.c b/sysdeps/stub/utimes.c
new file mode 100644
index 0000000000..39e63159b9
--- /dev/null
+++ b/sysdeps/stub/utimes.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <stddef.h>
+
+/* Change the access time of FILE to TVP[0] and
+ the modification time of FILE to TVP[1]. */
+int
+DEFUN(__utimes, (file, tvp),
+ CONST char *file AND struct timeval tvp[2])
+{
+ if (file == NULL || tvp == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ errno = ENOSYS;
+ return -1;
+}
diff --git a/sysdeps/unix/bsd/tahoe/sysdep.h b/sysdeps/unix/bsd/tahoe/sysdep.h
new file mode 100644
index 0000000000..a115f43467
--- /dev/null
+++ b/sysdeps/unix/bsd/tahoe/sysdep.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* The Tahoe is just like the Vax, except the
+ `chmk' instruction is called `kcall'. */
+
+#define __MAGIC_INSN "kcall"
+#include "../sysdeps/unix/bsd/vax/sysdep.h"
diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c
new file mode 100644
index 0000000000..d988f7e098
--- /dev/null
+++ b/sysdeps/unix/opendir.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY. No author or distributor accepts responsibility for
+the consequences of using it or for whether it serves any particular
+purpose or works at all, unless he says so in writing. Refer to the GNU
+C Library General Public License (in the file COPYING) for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+the GNU C Library, but only under the conditions described in the
+GNU C Library General Public License. Among other things, this notice
+must not be changed and a copy of the license must be included. */
+
+#include <ansidecl.h>
+#include <errno.h>
+#include <limits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <bsddir.h>
+
+/* Open a directory stream on NAME. */
+DIR *
+DEFUN(opendir, (name), CONST char *name)
+{
+ DIR *dirp;
+ struct stat statbuf;
+ int fd;
+
+ fd = __open(name, O_RDONLY);
+ if (fd < 0)
+ return NULL;
+
+ {
+ int flags = FD_CLOEXEC;
+ if (fcntl(fd, F_SETFD, &flags) < 0)
+ return NULL;
+ }
+
+ dirp = (DIR *) malloc(sizeof(DIR) + NAME_MAX);
+ if (dirp == NULL)
+ {
+ int save = errno;
+ (void) __close(fd);
+ errno = save;
+ return NULL;
+ }
+
+ if (__fstat(fd, &statbuf) < 0 || statbuf.st_blksize < sizeof(struct direct))
+ dirp->__allocation = sizeof(struct direct);
+ else
+ dirp->__allocation = statbuf.st_blksize;
+ dirp->__data = (char *) malloc(dirp->__allocation);
+ if (dirp->__data == NULL)
+ {
+ int save = errno;
+ free((PTR) dirp);
+ (void) __close(fd);
+ errno = save;
+ return NULL;
+ }
+
+ dirp->__fd = fd;
+ dirp->__offset = 0;
+ dirp->__size = 0;
+ return dirp;
+}
diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c
new file mode 100644
index 0000000000..b8c2353180
--- /dev/null
+++ b/sysdeps/unix/rewinddir.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY. No author or distributor accepts responsibility for
+the consequences of using it or for whether it serves any particular
+purpose or works at all, unless he says so in writing. Refer to the GNU
+C Library General Public License (in the file COPYING) for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+the GNU C Library, but only under the conditions described in the
+GNU C Library General Public License. Among other things, this notice
+must not be changed and a copy of the license must be included. */
+
+#include <ansidecl.h>
+#include <stddef.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+
+/* Rewind DIRP to the beginning of the directory. */
+void
+DEFUN(rewinddir, (dirp), DIR *dirp)
+{
+ (void) lseek(dirp->__fd, (off_t) 0, SEEK_SET);
+ dirp->__offset = 0;
+ dirp->__size = 0;
+}
diff --git a/sysdeps/unix/sparc/vfork.S b/sysdeps/unix/sparc/vfork.S
new file mode 100644
index 0000000000..e59cb424ce
--- /dev/null
+++ b/sysdeps/unix/sparc/vfork.S
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#define ASM
+
+#include <ansidecl.h>
+#include <sysdep.h>
+
+#ifndef SYS_vfork
+#define SYS_vfork 66
+#endif
+
+/* Clone the calling process, but without copying the whole address space.
+ The the calling process is suspended until the the new process exits or is
+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+.global ___vfork
+___vfork:
+ /* Put the syscall number in %g1 and trap into the kernel. */
+ mov SYS_vfork, %g1
+ ta 0
+
+ bcs error /* Branch forward if it failed. */
+
+ /* It succeeded. See which fork we're in. */
+ tst %o1 /* If %o1 is zero, we're the parent. */
+ bne,a end
+ /* We're the child, so return zero. */
+ clr %o0
+
+end:
+ retl
+ nop
+
+error:
+ /* We got an error. Set errno with the code in %o0 and return -1. */
+ sethi %hi(_errno), %g1
+ st %o0, [%g1 + %lo(_errno)]
+ retl
+ sub %g0, 1, %o0
diff --git a/time/localtime.c b/time/localtime.c
new file mode 100644
index 0000000000..f3e54970dd
--- /dev/null
+++ b/time/localtime.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <ansidecl.h>
+#include <localeinfo.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+
+/* Return the `struct tm' representation of *TIMER in the local timezone. */
+struct tm *
+DEFUN(localtime, (timer), CONST time_t *timer)
+{
+ extern int EXFUN(__tz_compute, (time_t, struct tm));
+ register struct tm *tp;
+
+ if (timer == NULL)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
+
+ tp = gmtime(timer);
+ if (tp == NULL)
+ return NULL;
+
+ if (!__tz_compute(*timer, *tp))
+ return NULL;
+
+ tp = __offtime(timer, __timezone);
+ tp->tm_isdst = __daylight;
+ return tp;
+}