Browse Source

Initial revision

Erik Andersen 21 years ago
commit
64bc641218
100 changed files with 7138 additions and 0 deletions
  1. 481 0
      COPYING.LIB
  2. 63 0
      Makefile
  3. 115 0
      include/a.out.h
  4. 18 0
      include/ar.h
  5. 12 0
      include/arpa/inet.h
  6. 392 0
      include/arpa/nameser.h
  7. 319 0
      include/arpa/telnet.h
  8. 80 0
      include/arpa/tftp.h
  9. 23 0
      include/assert.h
  10. 8 0
      include/cfgfile.h
  11. 38 0
      include/ctype.h
  12. 155 0
      include/dirent.h
  13. 43 0
      include/endian.h
  14. 7 0
      include/err.h
  15. 25 0
      include/errno.h
  16. 20 0
      include/fcntl.h
  17. 39 0
      include/features.h
  18. 17 0
      include/getopt.h
  19. 37 0
      include/grp.h
  20. 140 0
      include/limits.h
  21. 30 0
      include/malloc.h
  22. 0 0
      include/math.h
  23. 1 0
      include/memory.h
  24. 110 0
      include/mntent.h
  25. 215 0
      include/netdb.h
  26. 24 0
      include/netinet/igmp.h
  27. 88 0
      include/netinet/in.h
  28. 1 0
      include/netinet/in_systm.h
  29. 39 0
      include/netinet/ip.h
  30. 1 0
      include/netinet/ip_fw.h
  31. 1 0
      include/netinet/ip_icmp.h
  32. 72 0
      include/netinet/ip_tcp.h
  33. 1 0
      include/netinet/ip_udp.h
  34. 62 0
      include/netinet/protocols.h
  35. 1 0
      include/netinet/tcp.h
  36. 1 0
      include/netinet/udp.h
  37. 22 0
      include/paths.h
  38. 40 0
      include/pwd.h
  39. 21 0
      include/regexp.h
  40. 85 0
      include/resolv.h
  41. 166 0
      include/rpc/auth.h
  42. 46 0
      include/rpc/auth_des.h
  43. 72 0
      include/rpc/auth_unix.h
  44. 331 0
      include/rpc/clnt.h
  45. 65 0
      include/rpc/pmap_clnt.h
  46. 94 0
      include/rpc/pmap_prot.h
  47. 53 0
      include/rpc/pmap_rmt.h
  48. 79 0
      include/rpc/rpc.h
  49. 187 0
      include/rpc/rpc_msg.h
  50. 280 0
      include/rpc/svc.h
  51. 42 0
      include/rpc/svc_auth.h
  52. 65 0
      include/rpc/types.h
  53. 270 0
      include/rpc/xdr.h
  54. 94 0
      include/search.h
  55. 22 0
      include/setjmp.h
  56. 166 0
      include/signal.h
  57. 47 0
      include/stdarg.h
  58. 118 0
      include/stdio.h
  59. 75 0
      include/stdlib.h
  60. 56 0
      include/string.h
  61. 1 0
      include/strings.h
  62. 94 0
      include/sys/bitypes.h
  63. 36 0
      include/sys/cdefs.h
  64. 17 0
      include/sys/dir.h
  65. 1 0
      include/sys/errno.h
  66. 1 0
      include/sys/fcntl.h
  67. 35 0
      include/sys/file.h
  68. 17 0
      include/sys/ioctl.h
  69. 35 0
      include/sys/mman.h
  70. 17 0
      include/sys/mount.h
  71. 46 0
      include/sys/param.h
  72. 73 0
      include/sys/resource.h
  73. 1 0
      include/sys/signal.h
  74. 135 0
      include/sys/socket.h
  75. 22 0
      include/sys/socketcall.h
  76. 1 0
      include/sys/socketio.h
  77. 8 0
      include/sys/socketvar.h
  78. 192 0
      include/sys/stat.h
  79. 182 0
      include/sys/syscall.h
  80. 200 0
      include/sys/syslog.h
  81. 4 0
      include/sys/termios.h
  82. 81 0
      include/sys/time.h
  83. 21 0
      include/sys/times.h
  84. 4 0
      include/sys/types.h
  85. 65 0
      include/sys/uio.h
  86. 1 0
      include/sys/un.h
  87. 18 0
      include/sys/utsname.h
  88. 17 0
      include/sys/vfs.h
  89. 125 0
      include/sys/vm86.h
  90. 146 0
      include/sys/wait.h
  91. 6 0
      include/syscall.h
  92. 1 0
      include/syslog.h
  93. 21 0
      include/termcap.h
  94. 1 0
      include/termio.h
  95. 32 0
      include/termios.h
  96. 128 0
      include/time.h
  97. 108 0
      include/unistd.h
  98. 15 0
      include/utime.h
  99. 52 0
      include/utmp.h
  100. 3 0
      include/wait.h

+ 481 - 0
COPYING.LIB

@@ -0,0 +1,481 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+                    675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+     Appendix: How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!

+ 63 - 0
Makefile

@@ -0,0 +1,63 @@
+DIRS = headers error gtermcap misc stdio2 time getent regexp string termios sysdeps \
+malloc-simple net rpc
+
+all: libc.a crt0.o
+
+libc.a: $(DIRS) dummy
+	m68k-pic-coff-ranlib $@
+
+crt0.o: crt
+
+headers: dummy
+	if [ ! -L "include/asm" ]; then ln -s ../../linux/include/asm include/asm ; fi
+	if [ ! -L "include/net" ]; then ln -s ../../linux/include/net include/net ; fi
+	if [ ! -L "include/linux" ]; then ln -s ../../linux/include/linux include/linux ; fi
+
+error: dummy
+	make -C error
+
+gtermcap: dummy
+	make -C gtermcap
+
+misc: dummy
+	make -C misc
+
+stdio2: dummy
+	make -C stdio2
+
+time: dummy
+	make -C time
+
+getent: dummy
+	make -C getent
+
+regexp: dummy
+	make -C regexp
+
+string: dummy
+	make -C string
+
+termios: dummy
+	make -C termios
+
+sysdeps: dummy
+	make -C sysdeps
+
+malloc-simple: dummy
+	make -C malloc-simple
+
+net: dummy
+	make -C net
+
+rpc: dummy
+	make -C rpc
+
+crt: dummy
+	make -C crt
+
+dummy:
+
+clean:
+	-rm `find -name \*.[oa]` `find -name \*~` core
+	-rm include/asm include/net include/linux
+

+ 115 - 0
include/a.out.h

@@ -0,0 +1,115 @@
+/* Copyright (C) 1990-1996 
+ * This file is part of the ld86 command for Linux-86 
+ * It is distributed under the GNU Library General Public License.
+ *
+ * - This may actually be BSD or Minix code, can someone clarify please. -RDB
+ */
+
+#ifndef __AOUT_H
+#define __AOUT_H
+
+struct	exec {			/* a.out header */
+  unsigned char	a_magic[2];	/* magic number */
+  unsigned char	a_flags;	/* flags, see below */
+  unsigned char	a_cpu;		/* cpu id */
+  unsigned char	a_hdrlen;	/* length of header */
+  unsigned char	a_unused;	/* reserved for future use */
+  unsigned short a_version;	/* version stamp (not used at present) */
+  long		a_text;		/* size of text segement in bytes */
+  long		a_data;		/* size of data segment in bytes */
+  long		a_bss;		/* size of bss segment in bytes */
+  long		a_entry;	/* entry point */
+  long		a_total;	/* total memory allocated */
+  long		a_syms;		/* size of symbol table */
+
+  /* SHORT FORM ENDS HERE */
+  long		a_trsize;	/* text relocation size */
+  long		a_drsize;	/* data relocation size */
+  long		a_tbase;	/* text relocation base */
+  long		a_dbase;	/* data relocation base */
+};
+
+#define A_MAGIC0      (unsigned char) 0x01
+#define A_MAGIC1      (unsigned char) 0x03
+#define BADMAG(X)     ((X).a_magic[0] != A_MAGIC0 ||(X).a_magic[1] != A_MAGIC1)
+
+/* CPU Id of TARGET machine (byte order coded in low order two bits) */
+#define A_NONE	0x00	/* unknown */
+#define A_I8086	0x04	/* intel i8086/8088 */
+#define A_M68K	0x0B	/* motorola m68000 */
+#define A_NS16K	0x0C	/* national semiconductor 16032 */
+#define A_I80386 0x10	/* intel i80386 */
+#define A_SPARC	0x17	/* Sun SPARC */
+
+#define A_BLR(cputype)	((cputype&0x01)!=0) /* TRUE if bytes left-to-right */
+#define A_WLR(cputype)	((cputype&0x02)!=0) /* TRUE if words left-to-right */
+
+/* Flags. */
+#define A_UZP	0x01	/* unmapped zero page (pages) */
+#define A_PAL	0x02	/* page aligned executable */
+#define A_NSYM	0x04	/* new style symbol table */
+#define A_EXEC	0x10	/* executable */
+#define A_SEP	0x20	/* separate I/D */
+#define A_PURE	0x40	/* pure text */
+#define A_TOVLY	0x80	/* text overlay */
+
+/* Offsets of various things. */
+#define A_MINHDR	32
+#define	A_TEXTPOS(X)	((long)(X).a_hdrlen)
+#define A_DATAPOS(X)	(A_TEXTPOS(X) + (X).a_text)
+#define	A_HASRELS(X)	((X).a_hdrlen > (unsigned char) A_MINHDR)
+#define A_HASEXT(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR +  8))
+#define A_HASLNS(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR + 16))
+#define A_HASTOFF(X)	((X).a_hdrlen > (unsigned char) (A_MINHDR + 24))
+#define A_TRELPOS(X)	(A_DATAPOS(X) + (X).a_data)
+#define A_DRELPOS(X)	(A_TRELPOS(X) + (X).a_trsize)
+#define A_SYMPOS(X)	(A_TRELPOS(X) + (A_HASRELS(X) ? \
+  			((X).a_trsize + (X).a_drsize) : 0))
+
+struct reloc {
+  long r_vaddr;			/* virtual address of reference */
+  unsigned short r_symndx;	/* internal segnum or extern symbol num */
+  unsigned short r_type;	/* relocation type */
+};
+
+/* r_tyep values: */
+#define R_ABBS		0
+#define R_RELLBYTE	2
+#define R_PCRBYTE	3
+#define R_RELWORD	4
+#define R_PCRWORD	5
+#define R_RELLONG	6
+#define R_PCRLONG	7
+#define R_REL3BYTE	8
+#define R_KBRANCHE	9
+
+/* r_symndx for internal segments */
+#define S_ABS		((unsigned short)-1)
+#define S_TEXT		((unsigned short)-2)
+#define S_DATA		((unsigned short)-3)
+#define S_BSS		((unsigned short)-4)
+
+struct nlist {			/* symbol table entry */
+  char n_name[8];		/* symbol name */
+  long n_value;			/* value */
+  unsigned char	n_sclass;	/* storage class */
+  unsigned char	n_numaux;	/* number of auxiliary entries (not used) */
+  unsigned short n_type;	/* language base and derived type (not used) */
+};
+
+/* Low bits of storage class (section). */
+#define	N_SECT		  07	/* section mask */
+#define N_UNDF		  00	/* undefined */
+#define N_ABS		  01	/* absolute */
+#define N_TEXT		  02	/* text */
+#define N_DATA		  03	/* data */
+#define	N_BSS		  04	/* bss */
+#define N_COMM		  05	/* (common) */
+
+/* High bits of storage class. */
+#define N_CLASS		0370	/* storage class mask */
+#define C_NULL
+#define C_EXT		0020	/* external symbol */
+#define C_STAT		0030	/* static */
+
+#endif /* _AOUT_H */

+ 18 - 0
include/ar.h

@@ -0,0 +1,18 @@
+#ifndef __AR_H
+#define __AR_H
+
+#define ARMAG "!<arch>\n"
+#define SARMAG 8
+#define ARFMAG "`\n"
+
+struct ar_hdr {
+	char	ar_name[16],
+		ar_date[12],
+		ar_uid[6],
+		ar_gid[6],
+		ar_mode[8],
+		ar_size[10],
+		ar_fmag[2];
+};
+
+#endif /* __AR_H */

+ 12 - 0
include/arpa/inet.h

@@ -0,0 +1,12 @@
+#ifndef __ARPA_INET_H
+#define __ARPA_INET_H
+
+#include <netinet/in.h>
+
+int inet_aton(const char *cp, struct in_addr *inp);
+      
+unsigned long int inet_addr(const char *cp);
+
+char *inet_ntoa(struct in_addr in);
+       
+#endif

+ 392 - 0
include/arpa/nameser.h

@@ -0,0 +1,392 @@
+/*
+ * ++Copyright++ 1983, 1989, 1993
+ * -
+ * Copyright (c) 1983, 1989, 1993
+ *    The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ * 	This product includes software developed by the University of
+ * 	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * --Copyright--
+ */
+
+/*
+ *      @(#)nameser.h	8.1 (Berkeley) 6/2/93
+ *	$Id: nameser.h,v 1.1 2000/05/14 04:16:36 erik Exp $
+ */
+
+#ifndef _NAMESER_H_
+#define	_NAMESER_H_
+
+#include <sys/param.h>
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#else
+# include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+
+#ifdef _AUX_SOURCE
+# include <sys/types.h>
+#endif
+
+/*
+ * revision information.  this is the release date in YYYYMMDD format.
+ * it can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__BIND > 19931104)".  do not
+ * compare for equality; rather, use it to determine whether your resolver
+ * is new enough to contain a certain feature.
+ */
+
+#define __BIND		19960801	/* interface version stamp */
+
+/*
+ * Define constants based on rfc883
+ */
+#define PACKETSZ	512		/* maximum packet size */
+#define MAXDNAME	1025		/* maximum domain name */
+#define MAXCDNAME	255		/* maximum compressed domain name */
+#define MAXLABEL	63		/* maximum length of domain label */
+#define HFIXEDSZ	12		/* #/bytes of fixed data in header */
+#define QFIXEDSZ	4		/* #/bytes of fixed data in query */
+#define RRFIXEDSZ	10		/* #/bytes of fixed data in r record */
+#define INT32SZ		4		/* for systems without 32-bit ints */
+#define INT16SZ		2		/* for systems without 16-bit ints */
+#define INADDRSZ	4		/* IPv4 T_A */
+#define IN6ADDRSZ	16		/* IPv6 T_AAAA */
+
+/*
+ * Internet nameserver port number
+ */
+#define NAMESERVER_PORT	53
+
+/*
+ * Currently defined opcodes
+ */
+#define QUERY		0x0		/* standard query */
+#define IQUERY		0x1		/* inverse query */
+#define STATUS		0x2		/* nameserver status query */
+/*#define xxx		0x3*/		/* 0x3 reserved */
+#define NS_NOTIFY_OP	0x4		/* notify secondary of SOA change */
+/*
+ * Currently defined response codes
+ */
+#define NOERROR		0		/* no error */
+#define FORMERR		1		/* format error */
+#define SERVFAIL	2		/* server failure */
+#define NXDOMAIN	3		/* non existent domain */
+#define NOTIMP		4		/* not implemented */
+#define REFUSED		5		/* query refused */
+
+/*
+ * Type values for resources and queries
+ */
+#define T_A		1		/* host address */
+#define T_NS		2		/* authoritative server */
+#define T_MD		3		/* mail destination */
+#define T_MF		4		/* mail forwarder */
+#define T_CNAME		5		/* canonical name */
+#define T_SOA		6		/* start of authority zone */
+#define T_MB		7		/* mailbox domain name */
+#define T_MG		8		/* mail group member */
+#define T_MR		9		/* mail rename name */
+#define T_NULL		10		/* null resource record */
+#define T_WKS		11		/* well known service */
+#define T_PTR		12		/* domain name pointer */
+#define T_HINFO		13		/* host information */
+#define T_MINFO		14		/* mailbox information */
+#define T_MX		15		/* mail routing information */
+#define T_TXT		16		/* text strings */
+#define T_RP		17		/* responsible person */
+#define T_AFSDB		18		/* AFS cell database */
+#define T_X25		19		/* X_25 calling address */
+#define T_ISDN		20		/* ISDN calling address */
+#define T_RT		21		/* router */
+#define T_NSAP		22		/* NSAP address */
+#define T_NSAP_PTR	23		/* reverse NSAP lookup (deprecated) */
+#define T_SIG		24		/* security signature */
+#define T_KEY		25		/* security key */
+#define T_PX		26		/* X.400 mail mapping */
+#define T_GPOS		27		/* geographical position (withdrawn) */
+#define T_AAAA		28		/* IP6 Address */
+#define T_LOC		29		/* Location Information */
+#define T_NXT		30		/* Next Valid Name in Zone */
+#define T_EID		31		/* Endpoint identifier */
+#define T_NIMLOC	32		/* Nimrod locator */
+#define T_SRV		33		/* Server selection */
+#define T_ATMA		34		/* ATM Address */
+#define T_NAPTR		35		/* Naming Authority PoinTeR */
+	/* non standard */
+#define T_UINFO		100		/* user (finger) information */
+#define T_UID		101		/* user ID */
+#define T_GID		102		/* group ID */
+#define T_UNSPEC	103		/* Unspecified format (binary data) */
+	/* Query type values which do not appear in resource records */
+#define	T_IXFR		251		/* incremental zone transfer */
+#define T_AXFR		252		/* transfer zone of authority */
+#define T_MAILB		253		/* transfer mailbox records */
+#define T_MAILA		254		/* transfer mail agent records */
+#define T_ANY		255		/* wildcard match */
+
+/*
+ * Values for class field
+ */
+
+#define C_IN		1		/* the arpa internet */
+#define C_CHAOS		3		/* for chaos net (MIT) */
+#define C_HS		4		/* for Hesiod name server (MIT) (XXX) */
+	/* Query class values which do not appear in resource records */
+#define C_ANY		255		/* wildcard match */
+
+/*
+ * Flags field of the KEY RR rdata
+ */
+#define	KEYFLAG_TYPEMASK	0xC000	/* Mask for "type" bits */
+#define	KEYFLAG_TYPE_AUTH_CONF	0x0000	/* Key usable for both */
+#define	KEYFLAG_TYPE_CONF_ONLY	0x8000	/* Key usable for confidentiality */
+#define	KEYFLAG_TYPE_AUTH_ONLY	0x4000	/* Key usable for authentication */
+#define	KEYFLAG_TYPE_NO_KEY	0xC000	/* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define	KEYFLAG_NO_AUTH		0x8000	/* Key not usable for authentication */
+#define	KEYFLAG_NO_CONF		0x4000	/* Key not usable for confidentiality */
+
+#define	KEYFLAG_EXPERIMENTAL	0x2000	/* Security is *mandatory* if bit=0 */
+#define	KEYFLAG_RESERVED3	0x1000  /* reserved - must be zero */
+#define	KEYFLAG_RESERVED4	0x0800  /* reserved - must be zero */
+#define	KEYFLAG_USERACCOUNT	0x0400	/* key is assoc. with a user acct */
+#define	KEYFLAG_ENTITY		0x0200	/* key is assoc. with entity eg host */
+#define	KEYFLAG_ZONEKEY		0x0100	/* key is zone key for the zone named */
+#define	KEYFLAG_IPSEC		0x0080  /* key is for IPSEC use (host or user)*/
+#define	KEYFLAG_EMAIL		0x0040  /* key is for email (MIME security) */
+#define	KEYFLAG_RESERVED10	0x0020  /* reserved - must be zero */
+#define	KEYFLAG_RESERVED11	0x0010  /* reserved - must be zero */
+#define	KEYFLAG_SIGNATORYMASK	0x000F	/* key can sign DNS RR's of same name */
+
+#define  KEYFLAG_RESERVED_BITMASK ( KEYFLAG_RESERVED3 | \
+				    KEYFLAG_RESERVED4 | \
+				    KEYFLAG_RESERVED10| KEYFLAG_RESERVED11)
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define	ALGORITHM_MD5RSA	1	/* MD5 with RSA */
+#define	ALGORITHM_EXPIRE_ONLY	253	/* No alg, no security */
+#define	ALGORITHM_PRIVATE_OID	254	/* Key begins with OID indicating alg */
+
+/* Signatures */
+					/* Size of a mod or exp in bits */
+#define	MIN_MD5RSA_KEY_PART_BITS	 512
+#define	MAX_MD5RSA_KEY_PART_BITS	2552
+					/* Total of binary mod and exp, bytes */
+#define	MAX_MD5RSA_KEY_BYTES		((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3)
+					/* Max length of text sig block */
+#define	MAX_KEY_BASE64			(((MAX_MD5RSA_KEY_BYTES+2)/3)*4)
+
+/*
+ * Status return codes for T_UNSPEC conversion routines
+ */
+#define CONV_SUCCESS	0
+#define CONV_OVERFLOW	(-1)
+#define CONV_BADFMT	(-2)
+#define CONV_BADCKSUM	(-3)
+#define CONV_BADBUFLEN	(-4)
+
+#ifndef BYTE_ORDER
+#if (BSD >= 199103)
+# include <machine/endian.h>
+#else
+#ifdef linux
+# include <endian.h>
+#else
+#define LITTLE_ENDIAN	1234	/* least-significant byte first (vax, pc) */
+#define BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
+#define PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp)*/
+
+#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
+    defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
+    defined(__alpha__) || defined(__alpha)
+#define BYTE_ORDER	LITTLE_ENDIAN
+#endif
+
+#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
+    defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
+    defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
+    defined(apollo) || defined(__convex__) || defined(_CRAY) || \
+    defined(__hppa) || defined(__hp9000) || \
+    defined(__hp9000s300) || defined(__hp9000s700) || \
+    defined (BIT_ZERO_ON_LEFT) || defined(m68k)
+#define BYTE_ORDER	BIG_ENDIAN
+#endif
+#endif /* linux */
+#endif /* BSD */
+#endif /* BYTE_ORDER */
+
+#if !defined(BYTE_ORDER) || \
+    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
+    BYTE_ORDER != PDP_ENDIAN)
+	/* you must determine what the correct bit order is for
+	 * your compiler - the next line is an intentional error
+	 * which will force your compiles to bomb until you fix
+	 * the above macros.
+	 */
+  error "Undefined or invalid BYTE_ORDER";
+#endif
+
+/*
+ * Structure for query header.  The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields.  We use bit fields only in int variables, as this
+ * is all ANSI requires.  This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+	unsigned	id :16;		/* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+			/* fields in third byte */
+	unsigned	qr: 1;		/* response flag */
+	unsigned	opcode: 4;	/* purpose of message */
+	unsigned	aa: 1;		/* authoritative answer */
+	unsigned	tc: 1;		/* truncated message */
+	unsigned	rd: 1;		/* recursion desired */
+			/* fields in fourth byte */
+	unsigned	ra: 1;		/* recursion available */
+	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
+	unsigned	ad: 1;		/* authentic data from named */
+	unsigned	cd: 1;		/* checking disabled by resolver */
+	unsigned	rcode :4;	/* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+			/* fields in third byte */
+	unsigned	rd :1;		/* recursion desired */
+	unsigned	tc :1;		/* truncated message */
+	unsigned	aa :1;		/* authoritative answer */
+	unsigned	opcode :4;	/* purpose of message */
+	unsigned	qr :1;		/* response flag */
+			/* fields in fourth byte */
+	unsigned	rcode :4;	/* response code */
+	unsigned	cd: 1;		/* checking disabled by resolver */
+	unsigned	ad: 1;		/* authentic data from named */
+	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
+	unsigned	ra :1;		/* recursion available */
+#endif
+			/* remaining bytes */
+	unsigned	qdcount :16;	/* number of question entries */
+	unsigned	ancount :16;	/* number of answer entries */
+	unsigned	nscount :16;	/* number of authority entries */
+	unsigned	arcount :16;	/* number of resource entries */
+} HEADER;
+
+/*
+ * Defines for handling compressed domain names
+ */
+#define INDIR_MASK	0xc0
+
+extern	u_int16_t	_getshort __P((const u_char *));
+extern	u_int32_t	_getlong __P((const u_char *));
+
+/*
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ *
+ * These macros demonstrate the property of C whereby it can be
+ * portable or it can be elegant but rarely both.
+ */
+#define GETSHORT(s, cp) { \
+	register u_char *t_cp = (u_char *)(cp); \
+	(s) = ((u_int16_t)t_cp[0] << 8) \
+	    | ((u_int16_t)t_cp[1]) \
+	    ; \
+	(cp) += INT16SZ; \
+}
+
+#define GETLONG(l, cp) { \
+	register u_char *t_cp = (u_char *)(cp); \
+	(l) = ((u_int32_t)t_cp[0] << 24) \
+	    | ((u_int32_t)t_cp[1] << 16) \
+	    | ((u_int32_t)t_cp[2] << 8) \
+	    | ((u_int32_t)t_cp[3]) \
+	    ; \
+	(cp) += INT32SZ; \
+}
+
+#define PUTSHORT(s, cp) { \
+	register u_int16_t t_s = (u_int16_t)(s); \
+	register u_char *t_cp = (u_char *)(cp); \
+	*t_cp++ = t_s >> 8; \
+	*t_cp   = t_s; \
+	(cp) += INT16SZ; \
+}
+
+#define PUTLONG(l, cp) { \
+	register u_int32_t t_l = (u_int32_t)(l); \
+	register u_char *t_cp = (u_char *)(cp); \
+	*t_cp++ = t_l >> 24; \
+	*t_cp++ = t_l >> 16; \
+	*t_cp++ = t_l >> 8; \
+	*t_cp   = t_l; \
+	(cp) += INT32SZ; \
+}
+
+#endif /* !_NAMESER_H_ */

+ 319 - 0
include/arpa/telnet.h

@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)telnet.h	8.2 (Berkeley) 12/15/93
+ */
+
+#ifndef _ARPA_TELNET_H
+#define _ARPA_TELNET_H
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define	IAC	255		/* interpret as command: */
+#define	DONT	254		/* you are not to use option */
+#define	DO	253		/* please, you use option */
+#define	WONT	252		/* I won't use option */
+#define	WILL	251		/* I will use option */
+#define	SB	250		/* interpret as subnegotiation */
+#define	GA	249		/* you may reverse the line */
+#define	EL	248		/* erase the current line */
+#define	EC	247		/* erase the current character */
+#define	AYT	246		/* are you there */
+#define	AO	245		/* abort output--but let prog finish */
+#define	IP	244		/* interrupt process--permanently */
+#define	BREAK	243		/* break */
+#define	DM	242		/* data mark--for connect. cleaning */
+#define	NOP	241		/* nop */
+#define	SE	240		/* end sub negotiation */
+#define EOR     239             /* end of record (transparent mode) */
+#define	ABORT	238		/* Abort process */
+#define	SUSP	237		/* Suspend process */
+#define	xEOF	236		/* End of file: EOF is already used... */
+
+#define SYNCH	242		/* for telfunc calls */
+
+#ifdef TELCMDS
+char *telcmds[] = {
+	"EOF", "SUSP", "ABORT", "EOR",
+	"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+	"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define	TELCMD_FIRST	xEOF
+#define	TELCMD_LAST	IAC
+#define	TELCMD_OK(x)	((unsigned int)(x) <= TELCMD_LAST && \
+			 (unsigned int)(x) >= TELCMD_FIRST)
+#define	TELCMD(x)	telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY	0	/* 8-bit data path */
+#define TELOPT_ECHO	1	/* echo */
+#define	TELOPT_RCP	2	/* prepare to reconnect */
+#define	TELOPT_SGA	3	/* suppress go ahead */
+#define	TELOPT_NAMS	4	/* approximate message size */
+#define	TELOPT_STATUS	5	/* give status */
+#define	TELOPT_TM	6	/* timing mark */
+#define	TELOPT_RCTE	7	/* remote controlled transmission and echo */
+#define TELOPT_NAOL 	8	/* negotiate about output line width */
+#define TELOPT_NAOP 	9	/* negotiate about output page size */
+#define TELOPT_NAOCRD	10	/* negotiate about CR disposition */
+#define TELOPT_NAOHTS	11	/* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD	12	/* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD	13	/* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS	14	/* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD	15	/* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD	16	/* negotiate about output LF disposition */
+#define TELOPT_XASCII	17	/* extended ascic character set */
+#define	TELOPT_LOGOUT	18	/* force logout */
+#define	TELOPT_BM	19	/* byte macro */
+#define	TELOPT_DET	20	/* data entry terminal */
+#define	TELOPT_SUPDUP	21	/* supdup protocol */
+#define	TELOPT_SUPDUPOUTPUT 22	/* supdup output */
+#define	TELOPT_SNDLOC	23	/* send location */
+#define	TELOPT_TTYPE	24	/* terminal type */
+#define	TELOPT_EOR	25	/* end or record */
+#define	TELOPT_TUID	26	/* TACACS user identification */
+#define	TELOPT_OUTMRK	27	/* output marking */
+#define	TELOPT_TTYLOC	28	/* terminal location number */
+#define	TELOPT_3270REGIME 29	/* 3270 regime */
+#define	TELOPT_X3PAD	30	/* X.3 PAD */
+#define	TELOPT_NAWS	31	/* window size */
+#define	TELOPT_TSPEED	32	/* terminal speed */
+#define	TELOPT_LFLOW	33	/* remote flow control */
+#define TELOPT_LINEMODE	34	/* Linemode option */
+#define TELOPT_XDISPLOC	35	/* X Display Location */
+#define TELOPT_OLD_ENVIRON 36	/* Old - Environment variables */
+#define	TELOPT_AUTHENTICATION 37/* Authenticate */
+#define	TELOPT_ENCRYPT	38	/* Encryption option */
+#define TELOPT_NEW_ENVIRON 39	/* New - Environment variables */
+#define	TELOPT_EXOPL	255	/* extended-options-list */
+
+
+#define	NTELOPTS	(1+TELOPT_NEW_ENVIRON)
+#ifdef TELOPTS
+char *telopts[NTELOPTS+1] = {
+	"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+	"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+	"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+	"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+	"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+	"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+	"TACACS UID", "OUTPUT MARKING", "TTYLOC",
+	"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+	"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+	"ENCRYPT", "NEW-ENVIRON",
+	0,
+};
+#define	TELOPT_FIRST	TELOPT_BINARY
+#define	TELOPT_LAST	TELOPT_NEW_ENVIRON
+#define	TELOPT_OK(x)	((unsigned int)(x) <= TELOPT_LAST)
+#define	TELOPT(x)	telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define	TELQUAL_IS	0	/* option is... */
+#define	TELQUAL_SEND	1	/* send option */
+#define	TELQUAL_INFO	2	/* ENVIRON: informational version of IS */
+#define	TELQUAL_REPLY	2	/* AUTHENTICATION: client version of IS */
+#define	TELQUAL_NAME	3	/* AUTHENTICATION: client version of IS */
+
+#define	LFLOW_OFF		0	/* Disable remote flow control */
+#define	LFLOW_ON		1	/* Enable remote flow control */
+#define	LFLOW_RESTART_ANY	2	/* Restart output on any char */
+#define	LFLOW_RESTART_XON	3	/* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define	LM_MODE		1
+#define	LM_FORWARDMASK	2
+#define	LM_SLC		3
+
+#define	MODE_EDIT	0x01
+#define	MODE_TRAPSIG	0x02
+#define	MODE_ACK	0x04
+#define MODE_SOFT_TAB	0x08
+#define MODE_LIT_ECHO	0x10
+
+#define	MODE_MASK	0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW		0x0100
+#define MODE_ECHO		0x0200
+#define MODE_INBIN		0x0400
+#define MODE_OUTBIN		0x0800
+#define MODE_FORCE		0x1000
+
+#define	SLC_SYNCH	1
+#define	SLC_BRK		2
+#define	SLC_IP		3
+#define	SLC_AO		4
+#define	SLC_AYT		5
+#define	SLC_EOR		6
+#define	SLC_ABORT	7
+#define	SLC_EOF		8
+#define	SLC_SUSP	9
+#define	SLC_EC		10
+#define	SLC_EL		11
+#define	SLC_EW		12
+#define	SLC_RP		13
+#define	SLC_LNEXT	14
+#define	SLC_XON		15
+#define	SLC_XOFF	16
+#define	SLC_FORW1	17
+#define	SLC_FORW2	18
+
+#define	NSLC		18
+
+/*
+ * For backwards compatability, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define	SLC_NAMELIST	"0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+			"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+			"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
+#ifdef	SLC_NAMES
+char *slc_names[] = {
+	SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define	SLC_NAMES SLC_NAMELIST
+#endif
+
+#define	SLC_NAME_OK(x)	((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x)	slc_names[x]
+
+#define	SLC_NOSUPPORT	0
+#define	SLC_CANTCHANGE	1
+#define	SLC_VARIABLE	2
+#define	SLC_DEFAULT	3
+#define	SLC_LEVELBITS	0x03
+
+#define	SLC_FUNC	0
+#define	SLC_FLAGS	1
+#define	SLC_VALUE	2
+
+#define	SLC_ACK		0x80
+#define	SLC_FLUSHIN	0x40
+#define	SLC_FLUSHOUT	0x20
+
+#define	OLD_ENV_VAR	1
+#define	OLD_ENV_VALUE	0
+#define	NEW_ENV_VAR	0
+#define	NEW_ENV_VALUE	1
+#define	ENV_ESC		2
+#define	ENV_USERVAR	3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define	AUTH_WHO_CLIENT		0	/* Client authenticating server */
+#define	AUTH_WHO_SERVER		1	/* Server authenticating client */
+#define	AUTH_WHO_MASK		1
+
+/*
+ * amount of authentication done
+ */
+#define	AUTH_HOW_ONE_WAY	0
+#define	AUTH_HOW_MUTUAL		2
+#define	AUTH_HOW_MASK		2
+
+#define	AUTHTYPE_NULL		0
+#define	AUTHTYPE_KERBEROS_V4	1
+#define	AUTHTYPE_KERBEROS_V5	2
+#define	AUTHTYPE_SPX		3
+#define	AUTHTYPE_MINK		4
+#define	AUTHTYPE_CNT		5
+
+#define	AUTHTYPE_TEST		99
+
+#ifdef	AUTH_NAMES
+char *authtype_names[] = {
+	"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define	AUTHTYPE_NAME_OK(x)	((unsigned int)(x) < AUTHTYPE_CNT)
+#define	AUTHTYPE_NAME(x)	authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define	ENCRYPT_IS		0	/* I pick encryption type ... */
+#define	ENCRYPT_SUPPORT		1	/* I support encryption types ... */
+#define	ENCRYPT_REPLY		2	/* Initial setup response */
+#define	ENCRYPT_START		3	/* Am starting to send encrypted */
+#define	ENCRYPT_END		4	/* Am ending encrypted */
+#define	ENCRYPT_REQSTART	5	/* Request you start encrypting */
+#define	ENCRYPT_REQEND		6	/* Request you send encrypting */
+#define	ENCRYPT_ENC_KEYID	7
+#define	ENCRYPT_DEC_KEYID	8
+#define	ENCRYPT_CNT		9
+
+#define	ENCTYPE_ANY		0
+#define	ENCTYPE_DES_CFB64	1
+#define	ENCTYPE_DES_OFB64	2
+#define	ENCTYPE_CNT		3
+
+#ifdef	ENCRYPT_NAMES
+char *encrypt_names[] = {
+	"IS", "SUPPORT", "REPLY", "START", "END",
+	"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+	0,
+};
+char *enctype_names[] = {
+	"ANY", "DES_CFB64",  "DES_OFB64",  0,
+};
+#else
+extern char *encrypt_names[];
+extern char *enctype_names[];
+#endif
+
+
+#define	ENCRYPT_NAME_OK(x)	((unsigned int)(x) < ENCRYPT_CNT)
+#define	ENCRYPT_NAME(x)		encrypt_names[x]
+
+#define	ENCTYPE_NAME_OK(x)	((unsigned int)(x) < ENCTYPE_CNT)
+#define	ENCTYPE_NAME(x)		enctype_names[x]
+#endif /* _ARPA_TELNET_H */

+ 80 - 0
include/arpa/tftp.h

@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)tftp.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ARPA_TFTP_H
+#define	_ARPA_TFTP_H 1
+
+/*
+ * Trivial File Transfer Protocol (IEN-133)
+ */
+#define	SEGSIZE		512		/* data segment size */
+
+/*
+ * Packet types.
+ */
+#define	RRQ	01				/* read request */
+#define	WRQ	02				/* write request */
+#define	DATA	03				/* data packet */
+#define	ACK	04				/* acknowledgement */
+#define	ERROR	05				/* error code */
+
+struct	tftphdr {
+	short	th_opcode;			/* packet type */
+	union {
+		unsigned short	tu_block;	/* block # */
+		short	tu_code;		/* error code */
+		char	tu_stuff[1];		/* request packet stuff */
+	} th_u;
+	char	th_data[1];			/* data or error string */
+};
+
+#define	th_block	th_u.tu_block
+#define	th_code		th_u.tu_code
+#define	th_stuff	th_u.tu_stuff
+#define	th_msg		th_data
+
+/*
+ * Error codes.
+ */
+#define	EUNDEF		0		/* not defined */
+#define	ENOTFOUND	1		/* file not found */
+#define	EACCESS		2		/* access violation */
+#define	ENOSPACE	3		/* disk full or allocation exceeded */
+#define	EBADOP		4		/* illegal TFTP operation */
+#define	EBADID		5		/* unknown transfer ID */
+#define	EEXISTS		6		/* file already exists */
+#define	ENOUSER		7		/* no such user */
+
+#endif /* arpa/tftp.h */

+ 23 - 0
include/assert.h

@@ -0,0 +1,23 @@
+#ifndef	__ASSERT_H
+#define	__ASSERT_H
+#include <features.h>
+
+/* 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.  */
+
+extern void __assert __P((const char *, const char *, int));
+
+#define	assert(expr)							      \
+  ((void) ((expr) ||							      \
+	   (__assert (__STRING(expr),				      \
+			   __FILE__, __LINE__), 0)))
+
+#endif /* NDEBUG.  */
+
+#endif /* __ASSERT_H */

+ 8 - 0
include/cfgfile.h

@@ -0,0 +1,8 @@
+#ifndef __CFGFILE_H__
+#define __CFGFILE_H__
+
+#include <stdio.h>
+char ** cfgread(FILE *fp);
+char ** cfgfind(FILE *fp, char *var);
+
+#endif /* __CFGFILE_H__ */

+ 38 - 0
include/ctype.h

@@ -0,0 +1,38 @@
+/*
+ *	ctype.h		Character classification and conversion
+ */
+
+#ifndef __CTYPE_H
+#define __CTYPE_H
+
+extern	unsigned char	__ctype[];
+
+#define	__CT_d	0x01		/* numeric digit */
+#define	__CT_u	0x02		/* upper case */
+#define	__CT_l	0x04		/* lower case */
+#define	__CT_c	0x08		/* control character */
+#define	__CT_s	0x10		/* whitespace */
+#define	__CT_p	0x20		/* punctuation */
+#define	__CT_x	0x40		/* hexadecimal */
+
+#define	toupper(c)	(islower(c) ? (c)^0x20 : (c))
+#define	tolower(c)	(isupper(c) ? (c)^0x20 : (c))
+#define	_toupper(c)	((c)^0x20)
+#define	_tolower(c)	((c)^0x20)
+#define	toascii(c)	((c)&0x7F)
+
+/* Note the '!!' is a cast to 'bool' and even BCC deletes it in an if()  */
+#define	isalnum(c)	(!!(__ctype[(int) c]&(__CT_u|__CT_l|__CT_d)))
+#define	isalpha(c)	(!!(__ctype[(int) c]&(__CT_u|__CT_l)))
+#define	isascii(c)	(!((c)&~0x7F))
+#define	iscntrl(c)	(!!(__ctype[(int) c]&__CT_c))
+#define	isdigit(c)	(!!(__ctype[(int) c]&__CT_d))
+#define	isgraph(c)	(!(__ctype[(int) c]&(__CT_c|__CT_s)))
+#define	islower(c)	(!!(__ctype[(int) c]&__CT_l))
+#define	isprint(c)	(!(__ctype[(int) c]&__CT_c))
+#define	ispunct(c)	(!!(__ctype[(int) c]&__CT_p))
+#define	isspace(c)	(!!(__ctype[(int) c]&__CT_s))
+#define	isupper(c)	(!!(__ctype[(int) c]&__CT_u))
+#define	isxdigit(c)	(!!(__ctype[(int) c]&__CT_x))
+
+#endif /* __CTYPE_H */

+ 155 - 0
include/dirent.h

@@ -0,0 +1,155 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the, 1992 Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+/*
+ *	POSIX Standard: 5.1.2 Directory Operations	<dirent.h>
+ */
+
+#ifndef	_DIRENT_H
+
+#define	_DIRENT_H	1
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <gnu/types.h>
+
+#define	__need_size_t
+#include <stddef.h>
+
+#include <sys/types.h>
+#include <linux/limits.h>
+#include <linux/dirent.h>
+
+#if defined(__USE_GNU)
+#define	d_fileno	d_ino		/* glibc compatibility.  */
+#if 0
+#define	d_namlen	d_reclen	/* glibc compatibility.  */
+#endif
+#endif
+
+#if defined(DIRENT_ILLEGAL_ACCESS) || \
+	(defined(__SVR4_I386_ABI_L1__) && !defined(INTERNAL_LINUX_C_LIB))
+
+/* Use it at your own risk. */
+typedef struct DIR
+{
+  /* file descriptor */
+  int dd_fd;
+
+  /* offset of the next dir entry in buffer */
+  off_t dd_loc;
+
+  /* bytes of valid entries in buffer */
+  size_t dd_size;
+
+  /* -> directory buffer */
+  struct dirent *dd_buf;
+} DIR;
+
+#else
+
+/* The internal is hidden from the user. */
+typedef struct DIR DIR;
+
+#endif
+
+
+/* Open a directory stream on NAME.
+   Return a DIR stream on the directory, or NULL if it could not be opened.  */
+extern DIR *opendir __P ((__const char *__name));
+
+/* Close the directory stream DIRP.
+   Return 0 if successful, -1 if not.  */
+extern int closedir __P ((DIR * __dirp));
+
+/* Read a directory entry from DIRP.
+   Return a pointer to a `struct dirent' describing the entry,
+   or NULL for EOF or error.  The storage returned may be overwritten
+   by a later readdir call on the same DIR stream.  */
+extern struct dirent *readdir __P ((DIR * __dirp));
+
+/* Rewind DIRP to the beginning of the directory.  */
+extern void rewinddir __P ((DIR * __dirp));
+
+#if defined(__USE_BSD) || defined(__USE_MISC)
+
+#ifndef	MAXNAMLEN
+/* Get the definitions of the POSIX.1 limits.  */
+#include <posix1_lim.h>
+
+/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'.  */
+#ifdef	NAME_MAX
+#define	MAXNAMLEN	NAME_MAX
+#else
+#define	MAXNAMLEN	255
+#endif
+#endif
+
+#include <gnu/types.h>
+
+/* Seek to position POS on DIRP.  */
+extern void seekdir __P ((DIR * __dirp, __off_t __pos));
+
+/* Return the current position of DIRP.  */
+extern __off_t telldir __P ((DIR * __dirp));
+
+typedef int (*__dir_select_fn_t) __P ((__const struct dirent *));
+
+typedef int (*__dir_compar_fn_t) __P ((
+		__const struct dirent * __const *,
+		__const struct dirent * __const *
+		));
+
+/* Scan the directory DIR, calling SELECT on each directory entry.
+   Entries for which SELECT returns nonzero are individually malloc'd,
+   sorted using qsort with CMP, and collected in a malloc'd array in
+   *NAMELIST.  Returns the number of entries selected, or -1 on error.  */
+extern int scandir __P ((__const char *__dir,
+			 struct dirent ***__namelist,
+			 __dir_select_fn_t __dir_select_fn,
+			 __dir_compar_fn_t __dir_compar_fn));
+
+/* Function to compare two `struct dirent's alphabetically.  */
+extern int alphasort __P ((
+		__const struct dirent * __const *,
+		__const struct dirent * __const *
+		));
+
+
+/* Read directory entries from FD into BUF, reading at most NBYTES.
+   Reading starts at offset *BASEP, and *BASEP is updated with the new
+   position after reading.  Returns the number of bytes read; zero when at
+   end of directory; or -1 for errors.  */
+extern __ssize_t __getdirentries __P ((int __fd, char *__buf,
+				       size_t __nbytes, __off_t *__basep));
+extern __ssize_t getdirentries __P ((int __fd, char *__buf,
+				     size_t __nbytes, __off_t *__basep));
+
+extern int dirfd __P ((DIR *__dirp));
+
+#endif /* Use BSD or misc.  */
+
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_REENTRANT)
+extern int readdir_r __P((DIR *__dirp, struct dirent *__entry,
+		struct dirent **__result));
+#endif
+
+__END_DECLS
+
+#endif /* dirent.h  */

+ 43 - 0
include/endian.h

@@ -0,0 +1,43 @@
+/* Copyright (C) 1992, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef	_ENDIAN_H
+#define	_ENDIAN_H	1
+#include <features.h>
+
+/* Definitions for byte order, according to significance of bytes, from low
+   addresses to high addresses.  The value is what you get by putting '4'
+   in the most significant byte, '3' in the second most significant byte,
+   '2' in the second least significant byte, and '1' in the least
+   significant byte.  */
+
+#define	__LITTLE_ENDIAN	1234
+#define	__BIG_ENDIAN	4321
+#define	__PDP_ENDIAN	3412
+
+/* This file defines `__BYTE_ORDER' for the particular machine.  */
+#include <bytesex.h>
+
+#ifdef	__USE_BSD
+#define	LITTLE_ENDIAN	__LITTLE_ENDIAN
+#define	BIG_ENDIAN	__BIG_ENDIAN
+#define	PDP_ENDIAN	__PDP_ENDIAN
+#define	BYTE_ORDER	__BYTE_ORDER
+#endif
+
+#endif	/* endian.h */

+ 7 - 0
include/err.h

@@ -0,0 +1,7 @@
+#ifndef __ERR_H__
+#define __ERR_H__
+
+#define warn(X,args...) ({char _buf[128]; sprintf(_buf, X,args); perror(_buf);})
+#define err(X,Y,args...) ({char _buf[128]; sprintf(_buf, Y,##args); perror(_buf); exit(X);})
+
+#endif /* __ERR_H__ */

+ 25 - 0
include/errno.h

@@ -0,0 +1,25 @@
+#ifndef __ERRNO_H
+#define __ERRNO_H
+
+#include <features.h>
+#include <linux/errno.h>
+
+#ifdef  __USE_BSD
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif
+#ifdef  __USE_GNU
+extern int _sys_nerr;
+extern char *_sys_errlist[];
+#endif
+
+extern int	errno;
+
+__BEGIN_DECLS
+
+extern void	perror __P ((__const char* __s));
+extern char*	strerror __P ((int __errno));
+
+__END_DECLS
+
+#endif

+ 20 - 0
include/fcntl.h

@@ -0,0 +1,20 @@
+#ifndef __FCNTL_H
+#define __FCNTL_H
+
+#include <features.h>
+#include <sys/types.h>
+#include <linux/fcntl.h>
+
+#ifndef FNDELAY
+#define FNDELAY	O_NDELAY
+#endif
+
+__BEGIN_DECLS
+
+extern int creat __P ((__const char * __filename, mode_t __mode));
+extern int fcntl __P ((int __fildes,int __cmd, ...));
+extern int open __P ((__const char * __filename, int __flags, ...));
+
+__END_DECLS
+
+#endif

+ 39 - 0
include/features.h

@@ -0,0 +1,39 @@
+
+#ifndef __FEATURES_H
+#define __FEATURES_H
+
+#ifdef __STDC__
+
+#define __P(x) x
+#define __const const
+
+/* Almost ansi */
+#if __STDC__ != 1
+#define const
+#define volatile
+#endif
+
+#else /* K&R */
+
+#define __P(x) ()
+#define __const
+#define const
+#define volatile
+
+#endif
+
+/* No C++ */
+#define __BEGIN_DECLS
+#define __END_DECLS
+
+/* GNUish things */
+#define __CONSTVALUE
+#define __CONSTVALUE2
+
+#define _POSIX_THREAD_SAFE_FUNCTIONS
+
+#include <sys/cdefs.h>
+
+
+#endif
+

+ 17 - 0
include/getopt.h

@@ -0,0 +1,17 @@
+/* Copyright (C) 1996 Robert de Bath <rdebath@cix.compulink.co.uk>
+ * This file is part of the Linux-8086 C library and is distributed
+ * under the GNU Library General Public License.
+ */
+
+#ifndef __GETOPT_H
+#define __GETOPT_H
+
+#include <features.h>
+
+extern char *optarg;
+extern int opterr;
+extern int optind;
+
+extern int getopt __P((int argc, char *const *argv, const char *shortopts));
+
+#endif /* __GETOPT_H */

+ 37 - 0
include/grp.h

@@ -0,0 +1,37 @@
+#ifndef	__GRP_H
+#define	__GRP_H
+
+#include <sys/types.h>
+#include <features.h>
+#include <stdio.h>
+
+/* The group structure */
+struct group
+{
+  char *gr_name;		/* Group name.	*/
+  char *gr_passwd;		/* Password.	*/
+  gid_t gr_gid;			/* Group ID.	*/
+  char **gr_mem;		/* Member list.	*/
+};
+
+extern void setgrent __P ((void));
+extern void endgrent __P ((void));
+extern struct group * getgrent __P ((void));
+
+extern struct group * getgrgid __P ((__const gid_t gid));
+extern struct group * getgrnam __P ((__const char * name));
+
+extern struct group * fgetgrent __P ((FILE * file));
+
+extern int setgroups __P ((size_t n, __const gid_t * groups));
+extern int initgroups __P ((__const char * user, gid_t gid));
+
+
+#ifdef __LIBC__
+extern struct group * __getgrent __P ((int grp_fd));
+#endif
+
+#endif /* _GRP_H */
+
+
+

+ 140 - 0
include/limits.h

@@ -0,0 +1,140 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+/*
+ *	ANSI Standard: 4.14/2.2.4.2 Limits of integral types	<limits.h>
+ */
+
+#ifndef	_LIMITS_H
+
+#define	_LIMITS_H	1
+#include <features.h>
+
+#ifdef	__USE_POSIX
+/* POSIX adds things to <limits.h>.  */
+#include <posix1_lim.h>
+#endif
+
+#ifdef	__USE_POSIX2
+#include <posix2_lim.h>
+#endif
+
+
+/* Only if gcc 2.x is used and -traditional is not used, we can use
+ * #include_next.
+#if	__GNUC__ >= 2 && __STDC__
+ */
+#if	__GNUC__ >= 2
+
+ /* Have we done that? */
+# if !defined(_GCC_LIMITS_H_) && !defined(_GCC_LIMITS_H)
+  /* Get the compiler's limits.h, which defines all the ANSI
+   * constants.
+   */
+  /* This tells it not to look for another.  */
+# define _LIBC_LIMITS_H
+# define _LIBC_LIMITS_H_
+# include_next <limits.h>
+# endif
+
+#else	/* Not GCC 2.  */
+
+/* We don't have #include_next.
+   Define ANSI <limits.h> for standard 32-bit words.  */
+
+/* These assume 8-bit `char's, 16-bit `short int's,
+   and 32-bit `int's and `long int's.  */
+
+/* Number of bits in a `char'.	*/
+#define	CHAR_BIT	8
+
+/* Maximum length of any multibyte character in any locale.
+   Locale-writers should change this as necessary.  */
+#define	MB_LEN_MAX	1
+
+/* Minimum and maximum values a `signed char' can hold.  */
+#define	SCHAR_MIN	(-128)
+#define	SCHAR_MAX	127
+
+/* Maximum value an `unsigned char' can hold.  (Minimum is 0.)  */
+#ifdef	__STDC__
+#define	UCHAR_MAX	255U
+#else
+#define	UCHAR_MAX	255
+#endif
+
+/* Minimum and maximum values a `char' can hold.  */
+#ifdef __CHAR_UNSIGNED__
+#define	CHAR_MIN	0
+#define	CHAR_MAX	UCHAR_MAX
+#else
+#define	CHAR_MIN	SCHAR_MIN
+#define	CHAR_MAX	SCHAR_MAX
+#endif
+
+/* Minimum and maximum values a `signed short int' can hold.  */
+#define	SHRT_MIN	(-32768)
+#define	SHRT_MAX	32767
+
+/* Maximum value an `unsigned short int' can hold.  (Minimum is 0.)  */
+#define	USHRT_MAX	65535
+
+/* Minimum and maximum values a `signed int' can hold.  */
+#define	INT_MIN	(- INT_MAX - 1)
+#define	INT_MAX	2147483647
+
+/* Maximum value an `unsigned int' can hold.  (Minimum is 0.)  */
+#ifdef	__STDC__
+#define	UINT_MAX	4294967295U
+#else
+#define	UINT_MAX	4294967295
+#endif
+
+/* Minimum and maximum values a `signed long int' can hold.  */
+#define	LONG_MIN	INT_MIN
+#define	LONG_MAX	INT_MAX
+
+/* Maximum value an `unsigned long int' can hold.  (Minimum is 0.)  */
+#define	ULONG_MAX	UINT_MAX
+
+#endif	/* GCC 2.  */
+
+
+#ifndef RAND_MAX
+/* The largest number rand will return (same as INT_MAX).  */
+#define RAND_MAX	INT_MAX
+#endif
+
+#ifdef __SVR4_I386_ABI_L1__
+
+#define NL_ARGMAX	9
+#define NL_LANGMAX	14
+#define NL_MSGMAX	32767
+#define NL_NMAX		1
+#define NL_SETMAX	255
+#define NL_TEXTMAX	255
+#define NZERO		20
+
+#define WORD_BIT	32
+#define LONG_BIT	32
+
+#define FCHR_MAX	1048576
+
+#endif /* __SVR4_I386_ABI_L1__ */
+
+#endif	/* limits.h  */

+ 30 - 0
include/malloc.h

@@ -0,0 +1,30 @@
+
+#ifndef __MALLOC_H
+#define __MALLOC_H
+#include <features.h>
+#include <sys/types.h>
+
+/*
+ * Mini malloc allows you to use a less efficient but smaller malloc the
+ * cost is about 100 bytes of code in free but malloc (700bytes) doesn't
+ * have to be linked. Unfortunatly memory can only be reused if everything
+ * above it has been freed
+ * 
+ */
+
+extern void free __P((void *));
+extern void *malloc __P((size_t));
+extern void *realloc __P((void *, size_t));
+extern void *alloca __P((size_t));
+
+extern void *(*__alloca_alloc) __P((size_t));
+
+#ifdef __LIBC__
+#define __MINI_MALLOC__
+#endif
+
+#ifdef __MINI_MALLOC__
+#define malloc(x) ((*__alloca_alloc)(x))
+#endif
+
+#endif

+ 0 - 0
include/math.h


+ 1 - 0
include/memory.h

@@ -0,0 +1 @@
+#include <string.h>

+ 110 - 0
include/mntent.h

@@ -0,0 +1,110 @@
+#ifndef _MNTENT_H
+#define _MNTENT_H
+
+#include <features.h>
+
+#define MNTTAB "/etc/fstab"
+#define MOUNTED "/etc/mtab"
+
+#define MNTMAXSTR	512
+
+#define MNTTYPE_COHERENT	"coherent"	/* Coherent file system */
+#define MNTTYPE_EXT		"ext"		/* Extended file system */
+#define MNTTYPE_EXT2		"ext2"		/* Second Extended file system */
+#define MNTTYPE_HPFS		"hpfs"		/* OS/2's high performance file system */
+#define MNTTYPE_ISO9660		"iso9660"	/* ISO CDROM file system */
+#define MNTTYPE_MINIX		"minix"		/* MINIX file system */
+#define MNTTYPE_MSDOS		"msdos"		/* MS-DOS file system */
+#define	MNTTYPE_VFAT		"vfat"		/* VFAT (Win95) file system */
+#define MNTTYPE_SYSV		"sysv"		/* System V file system */
+#define MNTTYPE_UMSDOS		"umsdos"	/* U MS-DOS file system */
+#define MNTTYPE_XENIX		"xenix"		/* Xenix file system */
+#define MNTTYPE_XIAFS		"xiafs"		/* Frank Xia's file system */
+#define MNTTYPE_NFS		"nfs"		/* Network file system */
+#define MNTTYPE_PROC		"proc"		/* Linux process file system */
+#define MNTTYPE_IGNORE		"ignore"	/* Ignore this entry */
+#define MNTTYPE_SWAP		"swap"		/* Swap device */
+
+/* generic mount options */
+#define MNTOPT_DEFAULTS		"defaults"	/* use all default opts */
+#define MNTOPT_RO		"ro"		/* read only */
+#define MNTOPT_RW		"rw"		/* read/write */
+#define MNTOPT_SUID		"suid"		/* set uid allowed */
+#define MNTOPT_NOSUID		"nosuid"	/* no set uid allowed */
+#define MNTOPT_NOAUTO		"noauto"	/* don't auto mount */
+
+/* ext2 and msdos options */
+#define	MNTOPT_CHECK		"check"		/* filesystem check level */
+
+/* ext2 specific options */
+#define	MNTOPT_BSDDF		"bsddf"		/* disable MINIX compatibility disk free counting */
+#define	MNTOPT_BSDGROUPS	"bsdgroups"	/* set BSD group usage */
+#define	MNTOPT_ERRORS		"errors"	/* set behaviour on error */
+#define	MNTOPT_GRPID		"grpid"		/* set BSD group usage */
+#define	MNTOPT_MINIXDF		"minixdf"	/* enable MINIX compatibility disk free counting */
+#define	MNTOPT_NOCHECK		"nocheck"	/* reset filesystem checks */
+#define	MNTOPT_NOGRPID		"nogrpid"	/* set SYSV group usage */
+#define	MNTOPT_RESGID		"resgid"	/* group to consider like root for reserved blocks */
+#define	MNTOPT_RESUID		"resuid"	/* user to consider like root for reserved blocks */
+#define	MNTOPT_SB		"sb"		/* set used super block */
+#define	MNTOPT_SYSVGROUPS	"sysvgroups"	/* set SYSV group usage */
+
+/* options common to hpfs, isofs, and msdos */
+#define	MNTOPT_CONV		"conv"		/* convert specified types of data */
+#define	MNTOPT_GID		"gid"		/* use given gid */
+#define	MNTOPT_UID		"uid"		/* use given uid */
+#define	MNTOPT_UMASK		"umask"		/* use given umask, not isofs */
+
+/* hpfs specific options */
+#define	MNTOPT_CASE		"case"		/* case conversation */
+
+/* isofs specific options */
+#define	MNTOPT_BLOCK		"block"		/* use given block size */
+#define	MNTOPT_CRUFT		"cruft"		/* ??? */
+#define	MNTOPT_MAP		"map"		/* ??? */
+#define	MNTOPT_NOROCK		"norock"	/* not rockwell format ??? */
+
+/* msdos specific options */
+#define	MNTOPT_FAT		"fat"		/* set FAT size */
+#define	MNTOPT_QUIET		"quiet"		/* ??? */
+
+/* swap specific options */
+
+/* options common to ext, ext2, minix, xiafs, sysv, xenix, coherent */
+#define MNTOPT_NOQUOTA		"noquota"	/* don't use any quota on this partition */
+#define MNTOPT_USRQUOTA		"usrquota"	/* use userquota on this partition */
+#define MNTOPT_GRPQUOTA		"grpquota"	/* use groupquota on this partition */
+
+/* none defined yet */
+
+__BEGIN_DECLS
+
+struct mntent{
+	char *mnt_fsname;
+	char *mnt_dir;
+	char *mnt_type;
+	char *mnt_opts;
+	int  mnt_freq;
+	int  mnt_passno;
+};
+
+__END_DECLS
+
+#define __need_file
+#include <stdio.h>
+
+__BEGIN_DECLS
+
+extern FILE	*setmntent __P ((__const char *__filep,
+			__const char *__type));
+extern struct mntent
+		*getmntent __P ((FILE *__filep));
+extern int	addmntent __P ((FILE *__filep,
+			__const struct mntent *__mnt));
+extern char	*hasmntopt __P ((__const struct mntent *__mnt,
+			__const char *__opt));
+extern int	endmntent __P ((FILE *__filep));
+
+__END_DECLS
+
+#endif /* _MNTENT_H */

+ 215 - 0
include/netdb.h

@@ -0,0 +1,215 @@
+/*-
+ * Copyright (c) 1980, 1983, 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)netdb.h	8.1 (Berkeley) 6/2/93
+ *      netdb.h,v 1.4 1995/08/14 04:05:04 hjl Exp
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+#ifndef _NETDB_H_
+#define _NETDB_H_
+
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_REENTRANT)
+#include <stdio.h>
+#include <netinet/in.h>
+#endif
+
+#include <paths.h>
+
+#define _PATH_HEQUIV	__PATH_ETC_INET"/hosts.equiv"
+#define _PATH_HOSTS	__PATH_ETC_INET"/hosts"
+#define _PATH_NETWORKS	__PATH_ETC_INET"/networks"
+#define _PATH_PROTOCOLS	__PATH_ETC_INET"/protocols"
+#define _PATH_SERVICES	__PATH_ETC_INET"/services"
+#define _PATH_RESCONF	__PATH_ETC_INET"/resolv.conf"
+#define _PATH_RPC	__PATH_ETC_INET"/rpc"
+
+
+/*
+ * Structures returned by network data base library.  All addresses are
+ * supplied in host order, and returned in network order (suitable for
+ * use in system calls).
+ */
+struct	hostent {
+	char	*h_name;	/* official name of host */
+	char	**h_aliases;	/* alias list */
+	int	h_addrtype;	/* host address type */
+	int	h_length;	/* length of address */
+	char	**h_addr_list;	/* list of addresses from name server */
+#define	h_addr	h_addr_list[0]	/* address, for backward compatiblity */
+};
+
+/*
+ * Assumption here is that a network number
+ * fits in an unsigned long -- probably a poor one.
+ */
+struct	netent {
+	char		*n_name;	/* official name of net */
+	char		**n_aliases;	/* alias list */
+	int		n_addrtype;	/* net address type */
+	unsigned long	n_net;		/* network # */
+};
+
+struct	servent {
+	char	*s_name;	/* official service name */
+	char	**s_aliases;	/* alias list */
+	int	s_port;		/* port # */
+	char	*s_proto;	/* protocol to use */
+};
+
+struct	protoent {
+	char	*p_name;	/* official protocol name */
+	char	**p_aliases;	/* alias list */
+	int	p_proto;	/* protocol # */
+};
+
+struct rpcent {
+	char	*r_name;	/* name of server for this rpc program */
+	char	**r_aliases;	/* alias list */
+	int	r_number;	/* rpc program number */
+};
+
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_REENTRANT)
+
+#define __NETDB_MAXALIASES	35
+#define __NETDB_MAXADDRS	35
+
+/*
+ * Error return codes from gethostbyname() and gethostbyaddr()
+ * (left in extern int h_errno).
+ */
+#define h_errno		(*__h_errno_location ())
+#else
+extern int h_errno;
+#endif
+
+#define	NETDB_INTERNAL -1 /* see errno */
+#define	NETDB_SUCCESS   0 /* no problem */
+#define	HOST_NOT_FOUND	1 /* Authoritative Answer Host not found */
+#define	TRY_AGAIN	2 /* Non-Authoritive Host not found, or SERVERFAIL */
+#define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
+#define	NO_DATA		4 /* Valid name, no data record of requested type */
+#define	NO_ADDRESS	NO_DATA		/* no address, look for MX record */
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+void		endhostent __P((void));
+void		endnetent __P((void));
+void		endprotoent __P((void));
+void		endservent __P((void));
+void		endrpcent __P ((void));
+struct hostent	*gethostbyaddr __P((__const char *, int, int));
+struct hostent	*gethostbyname __P((__const char *));
+struct hostent	*gethostent __P((void));
+struct netent	*getnetbyaddr __P((long, int)); /* u_long? */
+struct netent	*getnetbyname __P((__const char *));
+struct netent	*getnetent __P((void));
+struct protoent	*getprotobyname __P((__const char *));
+struct protoent	*getprotobynumber __P((int));
+struct protoent	*getprotoent __P((void));
+struct servent	*getservbyname __P((__const char *, __const char *));
+struct servent	*getservbyport __P((int, __const char *));
+struct servent	*getservent __P((void));
+struct rpcent	*getrpcent __P((void));
+struct rpcent	*getrpcbyname __P((__const char *));
+struct rpcent	*getrpcbynumber __P((int));
+void		herror __P((__const char *));
+void		sethostent __P((int));
+/* void		sethostfile __P((__const char *)); */
+void		setnetent __P((int));
+void		setprotoent __P((int));
+void		setservent __P((int));
+void		setrpcent __P((int));
+
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_REENTRANT)
+struct hostent	*gethostbyaddr_r __P((const char *__addr,
+			int __length, int __type,
+			struct hostent *__result,
+			char *__buffer, int __buflen, int *__h_errnop));
+struct hostent	*gethostbyname_r __P((const char * __name,
+			struct hostent *__result, char *__buffer,
+			int __buflen, int *__h_errnop));
+struct hostent	*gethostent_r __P((struct hostent *__result,
+			char *__buffer, int __buflen, int *__h_errnop));
+struct netent	*getnetbyaddr_r __P((long __net, int __type,
+			struct netent *__result, char *__buffer,
+			int __buflen));
+struct netent	*getnetbyname_r __P((const char * __name,
+			struct netent *__result, char *__buffer,
+			int __buflen));
+struct netent	*getnetent_r __P((struct netent *__result,
+			char *__buffer, int __buflen));
+struct protoent	*getprotobyname_r __P((const char * __name,
+			struct protoent *__result, char *__buffer,
+			int __buflen));
+struct protoent	*getprotobynumber_r __P((int __proto,
+			struct protoent *__result, char *__buffer,
+			int __buflen));
+struct protoent	*getprotoent_r __P((struct protoent *__result,
+			char *__buffer, int __buflen));
+struct servent	*getservbyname_r __P((const char * __name,
+			const char *__proto, struct servent *__result,
+			char *__buffer, int __buflen));
+struct servent	*getservbyport_r __P((int __port,
+			const char *__proto, struct servent *__result,
+			char *__buffer, int __buflen));
+struct servent	*getservent_r __P((struct servent *__result,
+			char *__buffer, int __buflen));
+
+int *__h_errno_location __P((void));
+
+#endif
+
+__END_DECLS
+
+#endif /* !_NETDB_H_ */

+ 24 - 0
include/netinet/igmp.h

@@ -0,0 +1,24 @@
+#ifndef _NETINET_IGMP_H
+#define _NETINET_IGMP_H
+
+#include <linux/igmp.h>
+
+#ifdef __BSD_SOURCE
+
+struct igmp
+{
+	__u8 igmp_type;
+	__u8 igmp_code;
+	__u16 igmp_cksum;
+	struct in_addr igmp_group;
+};
+
+#define IGMP_MINLEN 			8
+#define IGMP_MAX_HOST_REPORT_DELAY	10
+#define IGMP_TIMER_SCALE		10
+
+#define IGMP_AGE_THRESHOLD		540
+
+#endif
+
+#endif /* _NETINET_IGMP_H */

+ 88 - 0
include/netinet/in.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	_NETINET_IN_H
+
+#define	_NETINET_IN_H	1
+#include <features.h>
+
+#include <sys/socket.h>
+
+__BEGIN_DECLS
+
+/* Standard well-known ports.  */
+enum
+  {
+    IPPORT_ECHO = 7,		/* Echo service.  */
+    IPPORT_DISCARD = 9,		/* Discard transmissions service.  */
+    IPPORT_SYSTAT = 11,		/* System status service.  */
+    IPPORT_DAYTIME = 13,	/* Time of day service.  */
+    IPPORT_NETSTAT = 15,	/* Network status service.  */
+    IPPORT_FTP = 21,		/* File Transfer Protocol.  */
+    IPPORT_TELNET = 23,		/* Telnet protocol.  */
+    IPPORT_SMTP = 25,		/* Simple Mail Transfer Protocol.  */
+    IPPORT_TIMESERVER = 37,	/* Timeserver service.  */
+    IPPORT_NAMESERVER = 42,	/* Domain Name Service.  */
+    IPPORT_WHOIS = 43,		/* Internet Whois service.  */
+    IPPORT_MTP = 57,
+
+    IPPORT_TFTP = 69,		/* Trivial File Transfer Protocol.  */
+    IPPORT_RJE = 77,
+    IPPORT_FINGER = 79,		/* Finger service.  */
+    IPPORT_TTYLINK = 87,
+    IPPORT_SUPDUP = 95,		/* SUPDUP protocol.  */
+
+
+    IPPORT_EXECSERVER = 512,	/* execd service.  */
+    IPPORT_LOGINSERVER = 513,	/* rlogind service.  */
+    IPPORT_CMDSERVER = 514,
+    IPPORT_EFSSERVER = 520,
+
+    /* UDP ports.  */
+    IPPORT_BIFFUDP = 512,
+    IPPORT_WHOSERVER = 513,
+    IPPORT_ROUTESERVER = 520,
+
+    /* Ports less than this value are reserved for privileged processes.  */
+    IPPORT_RESERVED = 1024,
+
+    /* Ports greater this value are reserved for (non-privileged) servers.  */
+    IPPORT_USERRESERVED = 5000
+  };
+
+
+/* Link numbers.  */
+#define	IMPLINK_IP		155
+#define	IMPLINK_LOWEXPER	156
+#define	IMPLINK_HIGHEXPER	158
+
+
+/*
+ * Many other definitions have been moved to <linux/in.h>,
+ * because several parts of the kernel need them. -FvK
+ */
+#include <linux/in.h>
+
+/*
+ * Bind a socket to a privileged IP port
+ */
+extern int bindresvport __P ((int __sockfd,
+		struct sockaddr_in * __sin));
+
+__END_DECLS
+
+#endif	/* netinet/in.h */

+ 1 - 0
include/netinet/in_systm.h

@@ -0,0 +1 @@
+#include <linux/in_systm.h>

+ 39 - 0
include/netinet/ip.h

@@ -0,0 +1,39 @@
+#ifndef _NETINET_IP_H
+#define _NETINET_IP_H
+
+#include <features.h>
+#include <netinet/in.h>
+#include <linux/ip.h>
+
+#ifdef _BSD_SOURCE
+
+/*
+ *	BSD has the following structure
+ */
+ 
+struct ip
+{
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8	ip_hl:4,
+		ip_v:4;
+#else
+	__u8	ip_v:4,
+		ip_hl:4;
+#endif
+#define IPVERSION	4
+	__u8	ip_tos;
+	__u16	ip_len;
+	__u16	ip_id;
+	__u16	ip_off;
+	__u8	ip_ttl;
+	__u8	ip_p;
+	__u16	ip_csum;
+	struct	in_addr ip_src,ip_dst;
+};
+
+#define	IP_DF	0x4000		/* dont fragment flag */
+#define	IP_MF	0x2000		/* more fragments flag */
+
+#endif
+
+#endif /* _NETINET_IP_H */

+ 1 - 0
include/netinet/ip_fw.h

@@ -0,0 +1 @@
+#include <linux/ip_fw.h>

+ 1 - 0
include/netinet/ip_icmp.h

@@ -0,0 +1 @@
+#include <linux/icmp.h>

+ 72 - 0
include/netinet/ip_tcp.h

@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *	@(#)tcp.h	7.5 (Berkeley) 6/29/88
+ */
+
+#ifndef _NETINET_IP_TCP_H
+#define _NETINET_IP_TCP_H
+
+#include <endian.h>
+#include <linux/socket.h>
+#include <sys/types.h>
+
+typedef	u_long	tcp_seq;
+/*
+ * TCP header.
+ * Per RFC 793, September, 1981.
+ */
+struct tcphdr {
+	u_short	th_sport;		/* source port */
+	u_short	th_dport;		/* destination port */
+	tcp_seq	th_seq;			/* sequence number */
+	tcp_seq	th_ack;			/* acknowledgement number */
+#if __BYTE_ORDER == __LITTLE_ENDIAN 
+	u_char	th_x2:4,		/* (unused) */
+		th_off:4;		/* data offset */
+#endif
+#if __BYTE_ORDER == __BIG_ENDIAN 
+	u_char	th_off:4,		/* data offset */
+		th_x2:4;		/* (unused) */
+#endif
+	u_char	th_flags;
+#define	TH_FIN	0x01
+#define	TH_SYN	0x02
+#define	TH_RST	0x04
+#define	TH_PUSH	0x08
+#define	TH_ACK	0x10
+#define	TH_URG	0x20
+	u_short	th_win;			/* window */
+	u_short	th_sum;			/* checksum */
+	u_short	th_urp;			/* urgent pointer */
+};
+
+#define	TCPOPT_EOL	0
+#define	TCPOPT_NOP	1
+#define	TCPOPT_MAXSEG	2
+
+/*
+ * Default maximum segment size for TCP.
+ * With an IP MSS of 576, this is 536,
+ * but 512 is probably more convenient.
+ */
+#ifdef	lint
+#define	TCP_MSS	536
+#else
+#define	TCP_MSS	MIN(512, IP_MSS - sizeof (struct tcpiphdr))
+#endif
+
+#endif /* _NETINET_TCP_H */

+ 1 - 0
include/netinet/ip_udp.h

@@ -0,0 +1 @@
+#include <linux/udp.h>

+ 62 - 0
include/netinet/protocols.h

@@ -0,0 +1,62 @@
+/* protocols.h */
+#ifndef _NETINET_PROTOCOLS_H
+#define _NETINET_PROTOCOLS_H
+
+#define IP_ICMP		  1
+#define IP_IGMP		  2
+#define IP_GGP 		  3
+#define IP_ST  		  5
+#define IP_TCP 		  6
+#define IP_UCL 		  7
+#define IP_EGP 		  8
+#define IP_IGP 		  9
+#define IP_BBN_RCC_MON	 10
+#define IP_NVP_II	 11
+#define IP_PUP		 12
+#define IP_ARGUS	 13
+#define IP_EMCON	 14
+#define IP_XNET		 15
+#define IP_CHAOS	 16
+#define IP_UDP		 17
+#define IP_MUX		 18
+#define IP_DCN_MEAS	 19
+#define IP_HMP		 20
+#define IP_PRM		 21
+#define IP_XNS_IDP	 22
+#define IP_TRUNK1	 23
+#define IP_TRUNK2	 24
+#define IP_LEAF1	 25
+#define IP_LEAF2	 26
+#define IP_RDP		 27
+#define IP_IRTP		 28
+#define IP_ISO_TP4	 29
+#define IP_NETBLT	 30
+#define IP_MFE_NSP	 31
+#define IP_MERIT_INP	 32
+#define IP_SEP		 33
+#define IP_3PC		 34
+#define IP_CFTP		 62
+#define SAT_EXPAK	 64
+#define IP_RVD		 66
+#define IP_IPPC		 67
+#define IP_SAT_MON	 69
+#define IP_VISA		 70
+#define IP_IPCV		 71
+#define IP_BR_SAT_MON	 76
+#define IP_SUN_ND	 77
+#define IP_WB_MON	 78
+#define IP_WB_EXPAK	 79
+#define IP_ISO_IP	 80
+#define IP_VMTP		 81
+#define IP_SECURE_VMTP	 82
+#define IP_VINES	 83
+#define IP_TTP		 84
+#define NSFNET_IGP	 85
+#define IP_DGP		 86
+#define IP_TCF		 87
+#define IP_IGRP		 88
+#define IP_OSPFIGP	 89
+#define IP_SPRITE_RPG	 90
+#define IP_LARP		 91
+
+#endif /*  _NETINET_PROTOCOLS_H*/

+ 1 - 0
include/netinet/tcp.h

@@ -0,0 +1 @@
+#include <netinet/ip_tcp.h>

+ 1 - 0
include/netinet/udp.h

@@ -0,0 +1 @@
+#include <netinet/ip_udp.h>

+ 22 - 0
include/paths.h

@@ -0,0 +1,22 @@
+/* paths.h <ndf@linux.mit.edu> */
+
+#ifndef ___PATHS_H
+#define	___PATHS_H
+
+
+#define	_PATH_CONSOLE	"/dev/console"
+#define	_PATH_TTY	"/dev/tty"
+#define	_PATH_NOLOGIN	"/etc/nologin"
+#define	_PATH_LOGIN	"/bin/login"
+#define	_PATH_BSHELL	"/bin/sh"
+#define _PATH_UTMP	"/var/run/utmp"
+#define _PATH_WTMP	"/var/log/wtmp"
+#define	_PATH_DEFPATH	"/bin:/usr/bin:/usr/local/bin:."
+#define	_PATH_DEV	"/dev/"
+#define _PATH_DEVNULL	"/dev/null"
+#define	_PATH_TMP	"/tmp/"
+#define _PATH_LASTLOG	"/var/log/lastlog"
+#define _PATH_LOCALE	"/usr/lib/locale"
+#define _PATH_VARRUN	"/var/log/"
+
+#endif /* __PATHS_H */

+ 40 - 0
include/pwd.h

@@ -0,0 +1,40 @@
+#ifndef	__PWD_H
+#define	__PWD_H
+
+#include <sys/types.h>
+#include <features.h>
+#include <stdio.h>
+