This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Import openbsd doc about __ECOS to freebsd doc


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.41
diff -u -5 -p -r1.41 ChangeLog
--- ChangeLog	17 Jan 2004 14:10:52 -0000	1.41
+++ ChangeLog	18 Feb 2004 11:04:49 -0000
@@ -1,5 +1,10 @@
+2004-02-18  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* doc/freebsd.sgml: Import text from openbsd doc about use of __ECOS
+	<network.h>, etc.
+
 2004-01-17  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/sys/kern/sockio.c (bsd_connect): Set the sa_len field in
 	the sockaddr structure. Real FreeBSD does this.
 
Index: doc/freebsd.sgml
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/doc/freebsd.sgml,v
retrieving revision 1.3
diff -u -5 -p -r1.3 freebsd.sgml
--- doc/freebsd.sgml	14 Feb 2003 18:28:31 -0000	1.3
+++ doc/freebsd.sgml	18 Feb 2004 11:04:49 -0000
@@ -132,10 +132,42 @@ found in <FILENAME>/usr/include</FILENAM
  install/include/sys/socket.h
  install/include/sys/socketvar.h
  install/include/sys/sockio.h
 </PROGRAMLISTING>
 </PARA>
+<PARA>
+<filename>network.h</filename> at the top level
+defines various extensions, for example the API
+<function>init_all_network_interfaces(void)</function>
+described
+above.  We advise including <filename>network.h</filename> whether
+you use these features or not.</PARA>
+<PARA>In general, using the networking code may require definition
+of two symbols: _KERNEL and __ECOS.  _KERNEL
+is not normally required; __ECOS is normally required.
+So add this to your compile lines for files which use the network
+stack:</PARA>
+<PROGRAMLISTING>        -D__ECOS</PROGRAMLISTING>
+<PARA>To expand a little, it&rsquo;s like this because this is
+a port of a standard distribution external to eCos.  One goal
+is to perturb the sources as little as possible, so that upgrading
+and maintenance from the external distribution is simplified.  The __ECOS
+symbol marks out the eCos additions in making the port.
+The _KERNEL symbol is traditional UNIX practice: it distinguishes
+a compilation which is to be linked into the kernel from one which
+is part of an application.  eCos applications are fully linked,
+so this distinction does not apply.  _KERNEL can however
+be used to control the visibility of the internals of the stack,
+so depending on what features your application uses, it may or may
+not be necessary.</PARA>
+<PARA>The include file <filename>network.h</filename> undefines _KERNEL
+unconditionally, to provide an application-like compilation environment.
+If you were writing code which, for example,
+enumerates the stack&rsquo;s internal
+structures, that is a kernel-like compilation environment, so you
+would need to define _KERNEL (in addition to __ECOS)
+and avoid including <filename>network.h</filename>.</PARA>
 </SECT1>
 <SECT1 id="tcpip-freebsd-enhanced-select">
 <TITLE>Enhanced Select()</TITLE>
 <PARA>The network stack supports an extension to the standard select
 semantics which allows all threads that are waiting to be restarted


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]