diff options
Diffstat (limited to 'lib/kernel/doc')
-rw-r--r-- | lib/kernel/doc/src/app.xml | 4 | ||||
-rw-r--r-- | lib/kernel/doc/src/code.xml | 10 | ||||
-rw-r--r-- | lib/kernel/doc/src/disk_log.xml | 3 | ||||
-rw-r--r-- | lib/kernel/doc/src/erl_ddll.xml | 2 | ||||
-rw-r--r-- | lib/kernel/doc/src/file.xml | 134 | ||||
-rw-r--r-- | lib/kernel/doc/src/gen_sctp.xml | 131 | ||||
-rw-r--r-- | lib/kernel/doc/src/heart.xml | 2 | ||||
-rw-r--r-- | lib/kernel/doc/src/inet.xml | 14 | ||||
-rw-r--r-- | lib/kernel/doc/src/kernel_app.xml | 11 | ||||
-rw-r--r-- | lib/kernel/doc/src/make.dep | 28 | ||||
-rw-r--r-- | lib/kernel/doc/src/net_kernel.xml | 12 | ||||
-rw-r--r-- | lib/kernel/doc/src/notes.xml | 293 |
12 files changed, 502 insertions, 142 deletions
diff --git a/lib/kernel/doc/src/app.xml b/lib/kernel/doc/src/app.xml index ef1f5985f4..ff8a12fe97 100644 --- a/lib/kernel/doc/src/app.xml +++ b/lib/kernel/doc/src/app.xml @@ -4,7 +4,7 @@ <fileref> <header> <copyright> - <year>1997</year><year>2009</year> + <year>1997</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -170,7 +170,6 @@ Phases [{Phase,PhaseArgs}] undefined start phase defined by the <c>start_phases</c> key, and only after this extended start procedure will <c>application:start(Application)</c> return.</p> - <p></p> <p>Start phases may be used to synchronize startup of an application and its included applications. In this case, the <c>mod</c> key must be specified as:</p> @@ -182,7 +181,6 @@ Phases [{Phase,PhaseArgs}] undefined for the primary application) both for the primary application and for each of its included application, for which the start phase is defined.</p> - <p></p> <p>This implies that for an included application, the set of start phases must be a subset of the set of phases defined for the primary application. Refer to <em>OTP Design Principles</em> for more information.</p> diff --git a/lib/kernel/doc/src/code.xml b/lib/kernel/doc/src/code.xml index 98cdd416b0..ee687511a3 100644 --- a/lib/kernel/doc/src/code.xml +++ b/lib/kernel/doc/src/code.xml @@ -177,9 +177,9 @@ archives. But the functions in <c>erl_prim_loader</c> may also be used by other applications to read files from archives. For example, the call - <c>erl_prim_loader:list_dir("/otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/examples/bench)"</c> + <c>erl_prim_loader:list_dir( "/otp/root/lib/mnesia-4.4.7.ez/mnesia-4.4.7/examples/bench)"</c> would list the contents of a directory inside an archive. - See <seealso marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso></p> + See <seealso marker="erts:erl_prim_loader">erl_prim_loader(3)</seealso></p>. <p>An application archive file and a regular application directory may coexist. This may be useful when there is a need of having @@ -229,10 +229,10 @@ <c>-code_path_choice Choice</c>. If the flag is set to <c>relaxed</c>, the code server will instead choose a suitable directory depending on the actual file structure. If there exists a regular - application ebin directory,situation it will be choosen. But if it does - not exist, the ebin directory in the archive is choosen if it + application ebin directory,situation it will be chosen. But if it does + not exist, the ebin directory in the archive is chosen if it exists. If neither of them exists the original directory will be - choosen.</p> + chosen.</p> <p>The command line flag <c>-code_path_choice Choice</c> does also affect how <c>init</c> interprets the <c>boot script</c>. The diff --git a/lib/kernel/doc/src/disk_log.xml b/lib/kernel/doc/src/disk_log.xml index 9721907162..d278d54d93 100644 --- a/lib/kernel/doc/src/disk_log.xml +++ b/lib/kernel/doc/src/disk_log.xml @@ -475,8 +475,7 @@ <fsummary>Close a disk log.</fsummary> <type name="close_error_rsn"/> <desc> - <p> <marker id="close_1"></marker> -The function <c>close/1</c> closes a + <p><marker id="close_1"></marker>The function <c>close/1</c> closes a local or distributed disk log properly. An internally formatted log must be closed before the Erlang system is stopped, otherwise the log is regarded as unclosed and the diff --git a/lib/kernel/doc/src/erl_ddll.xml b/lib/kernel/doc/src/erl_ddll.xml index f9514dda2f..1911fb628e 100644 --- a/lib/kernel/doc/src/erl_ddll.xml +++ b/lib/kernel/doc/src/erl_ddll.xml @@ -989,7 +989,7 @@ <c>{ok, pending_driver}</c> or <c>{ok, pending_process}</c>.</p> </item> </taglist> - <p>The <c>pending_driver</c><c>MonitorOption</c> is by far + <p>The <c>pending_driver</c> <c>MonitorOption</c> is by far the most useful and it has to be used to ensure that the driver has really been unloaded and the ports closed whenever the <c>kill_ports</c> option is used or the diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 861c582211..772eff13cc 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -60,11 +60,13 @@ converted, why the Unicode mode for file names is not default on systems having completely transparent file naming.</p> - <note>As of R14B01, the most basic file handling modules - (<c>file</c>, <c>prim_file</c>, <c>filelib</c> and - <c>filename</c>) accept raw file names, but the rest of OTP is not - guaranteed to handle them, why Unicode file naming on systems - where it is not default is still considered experimental.</note> + <note> + <p>As of R14B01, the most basic file handling modules + (<c>file</c>, <c>prim_file</c>, <c>filelib</c> and + <c>filename</c>) accept raw file names, but the rest of OTP is not + guaranteed to handle them, why Unicode file naming on systems + where it is not default is still considered experimental.</p> + </note> <p>Raw file names is a new feature in OTP R14B01, which allows the user to supply completely uninterpreted file names to the @@ -147,6 +149,12 @@ <datatype> <name name="mode"/> </datatype> + <datatype> + <name name="file_info_option"/> + </datatype> + <datatype> + <name name="sendfile_option"/> + </datatype> </datatypes> <funcs> @@ -249,11 +257,9 @@ </item> </taglist> <p>Example:</p> - <code type="none"> -f.txt: {person, "kalle", 25}. +<code type="none">f.txt: {person, "kalle", 25}. {person, "pelle", 30}.</code> - <pre> -1> <input>file:consult("f.txt").</input> +<pre>1> <input>file:consult("f.txt").</input> {ok,[{person,"kalle",25},{person,"pelle",30}]}</pre> </desc> </func> @@ -362,7 +368,6 @@ f.txt: {person, "kalle", 25}. <p>In a future release, a bad type for the <c><anno>Filename</anno></c> argument will probably generate an exception.</p> - <p></p> </warning> </desc> </func> @@ -410,7 +415,7 @@ f.txt: {person, "kalle", 25}. <name>file_info(Filename) -> {ok, FileInfo} | {error, Reason}</name> <fsummary>Get information about a file (deprecated)</fsummary> <desc> - <p>This function is obsolete. Use <c>read_file_info/1</c> + <p>This function is obsolete. Use <c>read_file_info/1,2</c> instead.</p> </desc> </func> @@ -537,7 +542,7 @@ f.txt: {person, "kalle", 25}. <desc> <p>Makes a hard link from <c><anno>Existing</anno></c> to <c><anno>New</anno></c>, on - platforms that support links (Unix). This function returns + platforms that support links (Unix and Windows). This function returns <c>ok</c> if the link was successfully created, or <c>{error, <anno>Reason</anno>}</c>. On platforms that do not support links, <c>{error,enotsup}</c> is returned.</p> @@ -564,11 +569,12 @@ f.txt: {person, "kalle", 25}. <name name="make_symlink" arity="2"/> <fsummary>Make a symbolic link to a file or directory</fsummary> <desc> - <p>This function creates a symbolic link <c><anno>Name2</anno></c> to - the file or directory <c><anno>Name1</anno></c>, on platforms that - support - symbolic links (most Unix systems). <c><anno>Name1</anno></c> need not - exist. This function returns <c>ok</c> if the link was + <p>This function creates a symbolic link <c><anno>New</anno></c> to + the file or directory <c><anno>Existing</anno></c>, on platforms that + support symbolic links (most Unix systems and Windows beginning with + Vista). + <c><anno>Existing</anno></c> need not exist. + This function returns <c>ok</c> if the link was successfully created, or <c>{error, <anno>Reason</anno>}</c>. On platforms that do not support symbolic links, <c>{error, enotsup}</c> @@ -578,11 +584,11 @@ f.txt: {person, "kalle", 25}. <tag><c>eacces</c></tag> <item> <p>Missing read or write permissions for the parent directories - of <c><anno>Name1</anno></c> or <c><anno>Name2</anno></c>.</p> + of <c><anno>Existing</anno></c> or <c><anno>New</anno></c>.</p> </item> <tag><c>eexist</c></tag> <item> - <p><c><anno>Name2</anno></c> already exists.</p> + <p><c><anno>New</anno></c> already exists.</p> </item> <tag><c>enotsup</c></tag> <item> @@ -1186,6 +1192,7 @@ f.txt: {person, "kalle", 25}. </func> <func> <name name="read_file_info" arity="1"/> + <name name="read_file_info" arity="2"/> <fsummary>Get information about a file</fsummary> <desc> <p>Retrieves information about a file. Returns @@ -1197,6 +1204,20 @@ f.txt: {person, "kalle", 25}. from which the function is called:</p> <code type="none"> -include_lib("kernel/include/file.hrl").</code> + <p>The time type returned in <c>atime</c>, <c>mtime</c> and <c>ctime</c> + is dependent on the time type set in <c>Opts :: {time, Type}</c>. + Type <c>local</c> will return local time, <c>universal</c> will + return universal time and <c>posix</c> will return seconds since + or before unix time epoch which is 1970-01-01 00:00 UTC. + Default is <c>{time, local}</c>. + </p> + <note> + <p> + Since file times is stored in posix time on most OS it is + faster to query file information with the <c>posix</c> option. + </p> + </note> + <p>The record <c>file_info</c> contains the following fields.</p> <taglist> <tag><c>size = integer()</c></tag> @@ -1211,15 +1232,15 @@ f.txt: {person, "kalle", 25}. <item> <p>The current system access to the file.</p> </item> - <tag><c>atime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>atime = <seealso marker="#type-date_time">date_time()</seealso> | integer() </c></tag> <item> - <p>The last (local) time the file was read.</p> + <p>The last time the file was read.</p> </item> - <tag><c>mtime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>mtime = <seealso marker="#type-date_time">date_time()</seealso> | integer() </c></tag> <item> - <p>The last (local) time the file was written.</p> + <p>The last time the file was written.</p> </item> - <tag><c>ctime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>ctime = <seealso marker="#type-date_time">date_time()</seealso> | integer() </c></tag> <item> <p>The interpretation of this time field depends on the operating system. On Unix, it is the last time @@ -1375,9 +1396,11 @@ f.txt: {person, "kalle", 25}. </func> <func> <name name="read_link_info" arity="1"/> + <name name="read_link_info" arity="2"/> <fsummary>Get information about a link or file</fsummary> <desc> - <p>This function works like <c>read_file_info/1</c>, except that + <p>This function works like + <seealso marker="#read_file_info/2">read_file_info/1,2</seealso> except that if <c><anno>Name</anno></c> is a symbolic link, information about the link will be returned in the <c>file_info</c> record and the <c>type</c> field of the record will be set to @@ -1523,7 +1546,6 @@ f.txt: {person, "kalle", 25}. <p>In a future release, a bad type for the <c><anno>Dir</anno></c> argument will probably generate an exception.</p> - <p></p> </warning> </desc> </func> @@ -1576,6 +1598,48 @@ f.txt: {person, "kalle", 25}. </desc> </func> <func> + <name name="sendfile" arity="2"/> + <fsummary>send a file to a socket</fsummary> + <desc> + <p>Sends the file <c>Filename</c> to <c>Socket</c>. + Returns <c>{ok, BytesSent}</c> if successful, + otherwise <c>{error, Reason}</c>.</p> + </desc> + </func> + <func> + <name name="sendfile" arity="5"/> + <fsummary>send a file to a socket</fsummary> + <desc> + <p>Sends <c>Bytes</c> from the file + referenced by <c>RawFile</c> beginning at <c>Offset</c> to + <c>Socket</c>. + Returns <c>{ok, BytesSent}</c> if successful, + otherwise <c>{error, Reason}</c>. If <c>Bytes</c> is set to + 0 all data after the given <c>Offset</c> is sent.</p> + <p>The file used must be opened using the raw flag, and the process + calling sendfile must be the controlling process of the socket. + See <seealso marker="gen_tcp#controlling_process-2">gen_tcp:controlling_process/2</seealso></p> + <p>If the OS used does not support sendfile, an Erlang fallback + using file:read and gen_tcp:send is used.</p> + <p>The option list can contain the following options: + <taglist> + <tag><c>chunk_size</c></tag> + <item>The chunk size used by the erlang fallback to send + data. If using the fallback, this should be set to a value + which comfortably fits in the systems memory. Default is 20 MB.</item> + </taglist> + </p> + <p>On operating systems with thread support, it is recommended to use + async threads. See the command line flag + <c>+A</c> in <seealso marker="erts:erl">erl(1)</seealso>. If it is not + possible to use async threads for sendfile, it is recommended to use + a relatively small value for the send buffer on the socket. Otherwise + the Erlang VM might loose some of its soft realtime guarantees. + Which size to use depends on the OS/hardware and the requirements + of the application.</p> + </desc> + </func> + <func> <name name="write" arity="2"/> <fsummary>Write to a file</fsummary> <desc> @@ -1647,6 +1711,7 @@ f.txt: {person, "kalle", 25}. </func> <func> <name name="write_file_info" arity="2"/> + <name name="write_file_info" arity="3"/> <fsummary>Change information about a file</fsummary> <desc> <p>Change file information. Returns <c>ok</c> if successful, @@ -1657,18 +1722,25 @@ f.txt: {person, "kalle", 25}. from which the function is called:</p> <code type="none"> -include_lib("kernel/include/file.hrl").</code> + <p>The time type set in <c>atime</c>, <c>mtime</c> and <c>ctime</c> + is dependent on the time type set in <c>Opts :: {time, Type}</c>. + Type <c>local</c> will interpret the time set as local, <c>universal</c> will + interpret it as universal time and <c>posix</c> must be seconds since + or before unix time epoch which is 1970-01-01 00:00 UTC. + Default is <c>{time, local}</c>. + </p> <p>The following fields are used from the record, if they are given.</p> <taglist> - <tag><c>atime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>atime = <seealso marker="#type-date_time">date_time()</seealso> | integer()</c></tag> <item> - <p>The last (local) time the file was read.</p> + <p>The last time the file was read.</p> </item> - <tag><c>mtime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>mtime = <seealso marker="#type-date_time">date_time()</seealso> | integer()</c></tag> <item> - <p>The last (local) time the file was written.</p> + <p>The last time the file was written.</p> </item> - <tag><c>ctime = <seealso marker="#type-date_time">date_time()</seealso></c></tag> + <tag><c>ctime = <seealso marker="#type-date_time">date_time()</seealso> | integer()</c></tag> <item> <p>On Unix, any value give for this field will be ignored (the "ctime" for the file will be set to the current diff --git a/lib/kernel/doc/src/gen_sctp.xml b/lib/kernel/doc/src/gen_sctp.xml index cc49090386..579b7f1f74 100644 --- a/lib/kernel/doc/src/gen_sctp.xml +++ b/lib/kernel/doc/src/gen_sctp.xml @@ -45,10 +45,17 @@ SUSE Linux Enterprise Server 10 (x86_64) kernel 2.6.16.27-0.6-smp, with lksctp-tools-1.0.6, briefly on Solaris 10, and later on SUSE Linux Enterprise Server 10 Service Pack 1 (x86_64) - kernel 2.6.16.54-0.2.3-smp with lksctp-tools-1.0.7.</p> + kernel 2.6.16.54-0.2.3-smp with lksctp-tools-1.0.7, + and later also on FreeBSD 8.2. + </p> + <p> + This module was written for one-to-many style sockets + (type <c>seqpacket</c>). With the addition of + <seealso marker="#peeloff/2">peeloff/2</seealso>, one-to-one style + sockets (type <c>stream</c>) were introduced. + </p> <p>Record definitions for the <c>gen_sctp</c> module can be found using:</p> - <pre> - -include_lib("kernel/include/inet_sctp.hrl"). </pre> +<pre> -include_lib("kernel/include/inet_sctp.hrl"). </pre> <p>These record definitions use the "new" spelling 'adaptation', not the deprecated 'adaption', regardless of which spelling the underlying C API uses.</p> @@ -152,8 +159,7 @@ The result of <c>connect/*</c> is an <c>#sctp_assoc_change{}</c> event which contains, in particular, the new <seealso marker="#type-assoc_id">Association ID</seealso>.</p> - <pre> - #sctp_assoc_change{ +<pre> #sctp_assoc_change{ state = atom(), error = atom(), outbound_streams = integer(), @@ -163,8 +169,7 @@ <p>The number of outbound and inbound streams can be set by giving an <c>sctp_initmsg</c> option to <c>connect</c> as in:</p> - <pre> - connect(<anno>Socket</anno>, Ip, <anno>Port</anno>, +<pre> connect(<anno>Socket</anno>, Ip, <anno>Port</anno>, [{sctp_initmsg,#sctp_initmsg{num_ostreams=OutStreams, max_instreams=MaxInStreams}}]) </pre> <p>All options <c><anno>Opt</anno></c> are set on the socket before the @@ -257,15 +262,19 @@ </desc> </func> <func> - <name name="listen" arity="2"/> + <name name="listen" arity="2" clause_i="1"/> + <name name="listen" arity="2" clause_i="2"/> <fsummary>Set up a socket to listen.</fsummary> <desc> <p>Sets up a socket to listen on the IP address and port number - it is bound to. <c><anno>IsServer</anno></c> must be <c>true</c> - or <c>false</c>. - In the contrast to TCP, in SCTP there is no listening queue length. - If <c><anno>IsServer</anno></c> is <c>true</c> the socket accepts new associations, i.e. - it will become an SCTP server socket.</p> + it is bound to.</p> + <p>For type <c>seqpacket</c> sockets (the default) + <c><anno>IsServer</anno></c> must be <c>true</c> or <c>false</c>. + In contrast to TCP, in SCTP there is no listening queue length. + If <c><anno>IsServer</anno></c> is <c>true</c> the socket accepts new associations, i.e. + it will become an SCTP server socket.</p> + <p>For type <c>stream</c> sockets <anno>Backlog</anno> defines + the backlog queue length just like in TCP.</p> </desc> </func> <func> @@ -298,12 +307,40 @@ is used. In particular, the socket is opened in <seealso marker="#option-binary">binary</seealso> and <seealso marker="#option-active">passive</seealso> mode, + with <anno>SockType</anno> <c>seqpacket</c>, and with reasonably large <seealso marker="#option-sndbuf">kernel</seealso> and driver <seealso marker="#option-buffer">buffers.</seealso></p> </desc> </func> <func> + <name name="peeloff" arity="2"/> + <fsummary> + Peel off a type <c>stream</c> socket from a type <c>seqpacket</c> one + </fsummary> + <desc> + <p> + Branch off an existing association <anno>Assoc</anno> + in a socket <anno>Socket</anno> of type <c>seqpacket</c> + (one-to-may style) into + a new socket <anno>NewSocket</anno> of type <c>stream</c> + (one-to-one style). + </p> + <p> + The existing association argument <anno>Assoc</anno> + can be either a + <seealso marker="#record-sctp_assoc_change"> + #sctp_assoc_change{} + </seealso> + record as returned from e.g + <seealso marker="#recv-2">recv/*</seealso>, + <seealso marker="#connect-5">connect/*</seealso> or + from a listening socket in active mode. Or it can be just + the field <c>assoc_id</c> integer from such a record. + </p> + </desc> + </func> + <func> <name name="recv" arity="1"/> <name name="recv" arity="2"/> <fsummary>Receive a message from a socket</fsummary> @@ -340,8 +377,7 @@ <p><seealso marker="#record-sctp_assoc_change">#sctp_assoc_change{}</seealso>;</p> </item> <item> - <pre> - #sctp_paddr_change{ +<pre> #sctp_paddr_change{ addr = {ip_address(),port()}, state = atom(), error = integer(), @@ -378,8 +414,7 @@ converted into a string using <c>error_string/1</c>.</p> </item> <item> - <pre> - #sctp_send_failed{ +<pre> #sctp_send_failed{ flags = true | false, error = integer(), info = #sctp_sndrcvinfo{}, @@ -399,8 +434,7 @@ returned by <c>recv/*</c>.</p> </item> <item> - <pre> - #sctp_adaptation_event{ +<pre> #sctp_adaptation_event{ adaptation_ind = integer(), assoc_id = assoc_id() } </pre> @@ -411,8 +445,7 @@ the Erlang/SCTP binding, this event is disabled by default.</p> </item> <item> - <pre> - #sctp_pdapi_event{ +<pre> #sctp_pdapi_event{ indication = sctp_partial_delivery_aborted, assoc_id = assoc_id() } </pre> @@ -469,7 +502,7 @@ <marker id="option-binary"></marker> <marker id="option-list"></marker> <taglist> - <tag><c>{mode, list|binary}</c>or just <c>list</c> or <c>binary</c>.</tag> + <tag><c>{mode, list|binary}</c> or just <c>list</c> or <c>binary</c></tag> <item> <p>Determines the type of data returned from <c>gen_sctp:recv/1,2</c>.</p> <marker id="option-active"></marker> @@ -562,8 +595,7 @@ </item> <tag><c>{sctp_rtoinfo, #sctp_rtoinfo{}}</c></tag> <item> - <pre> - #sctp_rtoinfo{ +<pre> #sctp_rtoinfo{ assoc_id = assoc_id(), initial = integer(), max = integer(), @@ -577,8 +609,7 @@ </item> <tag><c>{sctp_associnfo, #sctp_assocparams{}}</c></tag> <item> - <pre> - #sctp_assocparams{ +<pre> #sctp_assocparams{ assoc_id = assoc_id(), asocmaxrxt = integer(), number_peer_destinations = integer(), @@ -593,8 +624,7 @@ </item> <tag><c>{sctp_initmsg, #sctp_initmsg{}}</c></tag> <item> - <pre> - #sctp_initmsg{ +<pre> #sctp_initmsg{ num_ostreams = integer(), max_instreams = integer(), max_attempts = integer(), @@ -622,7 +652,6 @@ for establishing an association.</p> </item> </list> - <p></p> </item> <tag><c>{sctp_autoclose, integer() >= 0}</c></tag> <item> @@ -657,8 +686,7 @@ </item> <tag><c>{sctp_primary_addr, #sctp_prim{}}</c></tag> <item> - <pre> - #sctp_prim{ +<pre> #sctp_prim{ assoc_id = assoc_id(), addr = {IP, Port} } @@ -671,8 +699,7 @@ </item> <tag><c>{sctp_set_peer_primary_addr, #sctp_setpeerprim{}}</c></tag> <item> - <pre> - #sctp_setpeerprim{ +<pre> #sctp_setpeerprim{ assoc_id = assoc_id(), addr = {IP, Port} } @@ -686,8 +713,7 @@ <tag><c>{sctp_adaptation_layer, #sctp_setadaptation{}}</c></tag> <item> <marker id="record-sctp_setadaptation"></marker> - <pre> - #sctp_setadaptation{ +<pre> #sctp_setadaptation{ adaptation_ind = integer() } </pre> <p>When set, requests that the local endpoint uses the value given by @@ -698,8 +724,7 @@ </item> <tag><c>{sctp_peer_addr_params, #sctp_paddrparams{}}</c></tag> <item> - <pre> - #sctp_paddrparams{ +<pre> #sctp_paddrparams{ assoc_id = assoc_id(), address = {IP, Port}, hbinterval = integer(), @@ -756,16 +781,13 @@ <p><c>sackdelay_disable</c>: disable SAC delay.</p> </item> </list> - <p></p> </item> </list> - <p></p> </item> <tag><c>{sctp_default_send_param, #sctp_sndrcvinfo{}}</c></tag> <item> <marker id="record-sctp_sndrcvinfo"></marker> - <pre> - #sctp_sndrcvinfo{ +<pre> #sctp_sndrcvinfo{ stream = integer(), ssn = integer(), flags = list(), @@ -807,20 +829,17 @@ association, with flushing of unsent data.</p> </item> </list> - <p></p> <p>Other fields are rarely used. See <url href="http://www.rfc-archive.org/getrfc.php?rfc=2960">RFC2960</url> and <url href="http://tools.ietf.org/html/draft-ietf-tsvwg-sctpsocket-13">Sockets API Extensions for SCTP</url> for full information.</p> </item> </list> - <p></p> <marker id="option-sctp_events"></marker> </item> <tag><c>{sctp_events, #sctp_event_subscribe{}}</c></tag> <item> <marker id="record-sctp_event_subscribe"></marker> - <pre> - #sctp_event_subscribe{ +<pre> #sctp_event_subscribe{ data_io_event = true | false, association_event = true | false, address_event = true | false, @@ -845,8 +864,7 @@ </item> <tag><c>{sctp_delayed_ack_time, #sctp_assoc_value{}}</c></tag> <item> - <pre> - #sctp_assoc_value{ +<pre> #sctp_assoc_value{ assoc_id = assoc_id(), assoc_value = integer() } </pre> @@ -857,8 +875,7 @@ </item> <tag><c>{sctp_status, #sctp_status{}}</c></tag> <item> - <pre> - #sctp_status{ +<pre> #sctp_status{ assoc_id = assoc_id(), state = atom(), rwnd = integer(), @@ -930,14 +947,12 @@ address (see below for the format of <c>#sctp_paddrinfo{}</c>).</p> </item> </list> - <p></p> <marker id="option-sctp_get_peer_addr_info"></marker> </item> <tag><c>{sctp_get_peer_addr_info, #sctp_paddrinfo{}}</c></tag> <item> <marker id="record-sctp_paddrinfo"></marker> - <pre> - #sctp_paddrinfo{ +<pre> #sctp_paddrinfo{ assoc_id = assoc_id(), address = {IP, Port}, state = inactive | active, @@ -968,8 +983,7 @@ <item> <p>Example of an Erlang SCTP Server which receives SCTP messages and prints them on the standard output:</p> - <pre> - -module(sctp_server). +<pre> -module(sctp_server). -export([server/0,server/1,server/2]). -include_lib("kernel/include/inet.hrl"). @@ -998,7 +1012,6 @@ io:format("Received: ~p~n", [Data]) end, server_loop(S). </pre> - <p></p> </item> <item> <p>Example of an Erlang SCTP Client which interacts with the above Server. @@ -1008,8 +1021,7 @@ over Stream 5 fails. The client then <c>abort</c>s the association, which results in the corresponding Event being received on the Server side.</p> - <pre> - -module(sctp_client). +<pre> -module(sctp_client). -export([client/0, client/1, client/2]). -include_lib("kernel/include/inet.hrl"). @@ -1042,13 +1054,11 @@ timer:sleep(1000), gen_sctp:close(S). </pre> - <p></p> </item> <item> <p>A very simple Erlang SCTP Client which uses the connect_init API.</p> - <pre> --module(ex3). +<pre>-module(ex3). -export([client/4]). -include_lib("kernel/include/inet.hrl"). @@ -1101,7 +1111,6 @@ client_loop(S, Peer1, Port1, AssocId1, Peer2, Port2, AssocId2) -> ok end. </pre> - <p></p> </item> </list> </section> diff --git a/lib/kernel/doc/src/heart.xml b/lib/kernel/doc/src/heart.xml index e2dbcbe63d..26d1e27822 100644 --- a/lib/kernel/doc/src/heart.xml +++ b/lib/kernel/doc/src/heart.xml @@ -42,7 +42,7 @@ system.</p> <p>An Erlang runtime system to be monitored by a heart program, should be started with the command line flag <c>-heart</c> (see - also <seealso marker="erts:erl">erl(1)</seealso>. The <c>heart</c> + also <seealso marker="erts:erl">erl(1)</seealso>). The <c>heart</c> process is then started automatically:</p> <pre> % <input>erl -heart ...</input></pre> diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index b36c28e027..1a05b4ba99 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -555,8 +555,14 @@ fe80::204:acff:fe17:bf38 mode will return <c>{ok, HttpPacket}</c> from <c>gen_tcp:recv</c> while an active socket will send messages like <c>{http, Socket, HttpPacket}</c>.</p> - <p>Note that the packet type <c>httph</c> is not - needed when reading from a socket.</p> + </item> + <tag><c>httph | httph_bin</c></tag> + <item> + <p>These two types are often not needed as the socket will + automatically switch from <c>http</c>/<c>http_bin</c> to + <c>httph</c>/<c>httph_bin</c> internally after the first line + has been read. There might be occasions however when they are + useful, such as parsing trailers from chunked encoding.</p> </item> </taglist> </item> @@ -567,6 +573,10 @@ fe80::204:acff:fe17:bf38 is longer than the max allowed length, the packet is considered invalid. The same happens if the packet header is too big for the socket receive buffer.</p> + <p>For line oriented protocols (<c>line</c>,<c>http*</c>), + option <c>packet_size</c> also guarantees that lines up to the + indicated length are accepted and not considered invalid due + to internal buffer limitations.</p> </item> <tag><c>{read_packets, Integer}</c>(UDP sockets)</tag> <item> diff --git a/lib/kernel/doc/src/kernel_app.xml b/lib/kernel/doc/src/kernel_app.xml index bf513b7815..0f71a4f0f2 100644 --- a/lib/kernel/doc/src/kernel_app.xml +++ b/lib/kernel/doc/src/kernel_app.xml @@ -4,7 +4,7 @@ <appref> <header> <copyright> - <year>1996</year><year>2009</year> + <year>1996</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -231,6 +231,15 @@ MaxT = TickTime + TickTime / 4</code> <p><em>Note:</em> Normally, a terminating node is detected immediately.</p> </item> + <tag><c>shutdown_timeout = integer() | infinity</c></tag> + <item> + <p>Specifies the time <c>application_controller</c> will wait + for an application to terminate during node shutdown. If the + timer expires, <c>application_controller</c> will brutally + kill <c>application_master</c> of the hanging + application. If this parameter is undefined, it defaults + to <c>infinity</c>.</p> + </item> <tag><c>sync_nodes_mandatory = [NodeName]</c></tag> <item> <p>Specifies which other nodes <em>must</em> be alive in order diff --git a/lib/kernel/doc/src/make.dep b/lib/kernel/doc/src/make.dep deleted file mode 100644 index f79d1c6367..0000000000 --- a/lib/kernel/doc/src/make.dep +++ /dev/null @@ -1,28 +0,0 @@ -# ---------------------------------------------------- -# >>>> Do not edit this file <<<< -# This file was automaticly generated by -# /home/otp/bin/docdepend -# ---------------------------------------------------- - - -# ---------------------------------------------------- -# TeX files that the DVI file depend on -# ---------------------------------------------------- - -book.dvi: app.tex application.tex auth.tex book.tex \ - code.tex config.tex disk_log.tex erl_boot_server.tex \ - erl_ddll.tex erl_prim_loader_stub.tex erlang_stub.tex \ - error_handler.tex error_logger.tex file.tex \ - gen_sctp.tex gen_tcp.tex gen_udp.tex global.tex \ - global_group.tex heart.tex inet.tex inet_res.tex \ - init_stub.tex kernel_app.tex net_adm.tex net_kernel.tex \ - os.tex packages.tex pg2.tex ref_man.tex rpc.tex \ - seq_trace.tex user.tex wrap_log_reader.tex \ - zlib_stub.tex - -# ---------------------------------------------------- -# Source inlined when transforming from source to LaTeX -# ---------------------------------------------------- - -book.tex: ref_man.xml - diff --git a/lib/kernel/doc/src/net_kernel.xml b/lib/kernel/doc/src/net_kernel.xml index 96e2aa665d..e54a427ff0 100644 --- a/lib/kernel/doc/src/net_kernel.xml +++ b/lib/kernel/doc/src/net_kernel.xml @@ -37,13 +37,10 @@ monitoring of the network.</p> <p>An Erlang node is started using the command line flag <c>-name</c> or <c>-sname</c>:</p> - <pre> -$ <input>erl -sname foobar</input></pre> +<pre>$ <input>erl -sname foobar</input></pre> <p>It is also possible to call <c>net_kernel:start([foobar])</c> directly from the normal Erlang shell prompt:</p> - <p></p> - <pre> -1> <input>net_kernel:start([foobar, shortnames]).</input> +<pre>1> <input>net_kernel:start([foobar, shortnames]).</input> {ok,<0.64.0>} (foobar@gringotts)2></pre> <p>If the node is started with the command line flag <c>-sname</c>, @@ -213,6 +210,10 @@ $ <input>erl -sname foobar</input></pre> <p><c>net_kernel</c> is currently changing <c>net_ticktime</c> to <c><anno>NetTicktime</anno></c> seconds.</p> </item> + <tag><c>ignored</c></tag> + <item> + <p>The local node is not alive.</p> + </item> </taglist> </desc> </func> @@ -226,7 +227,6 @@ $ <input>erl -sname foobar</input></pre> <c><anno>NetTicktime</anno></c> seconds. <c><anno>TransitionPeriod</anno></c> defaults to 60.</p> <p>Some definitions:</p> - <p></p> <taglist> <tag>The minimum transition traffic interval (<c>MTTI</c>)</tag> <item> diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml index e325443f6c..9121186631 100644 --- a/lib/kernel/doc/src/notes.xml +++ b/lib/kernel/doc/src/notes.xml @@ -30,6 +30,297 @@ </header> <p>This document describes the changes made to the Kernel application.</p> +<section><title>Kernel 2.15</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> Calls to <c>global:whereis_name/1</c> have been + substituted for calls to + <c>global:safe_whereis_name/1</c> since the latter is not + safe at all.</p> + <p>The reason for not doing this earlier is that setting + a global lock masked out a bug concerning the restart of + supervised children. The bug has now been fixed by a + modification of <c>global:whereis_name/1</c>. (Thanks to + Ulf Wiger for code contribution.)</p> + <p>A minor race conditions in <c>gen_fsm:start*</c> has + been fixed: if one of these functions returned <c>{error, + Reason}</c> or ignore, the name could still be registered + (either locally or in <c>global</c>. (This is the same + modification as was done for gen_server in OTP-7669.)</p> + <p>The undocumented function + <c>global:safe_whereis_name/1</c> has been removed. </p> + <p> + Own Id: OTP-9212 Aux Id: seq7117, OTP-4174 </p> + </item> + <item> + <p> + Honor option <c>packet_size</c> for http packet parsing + by both TCP socket and <c>erlang:decode_packet</c>. This + gives the ability to accept HTTP headers larger than the + default setting, but also avoid DoS attacks by accepting + lines only up to whatever length you wish to allow. For + consistency, packet type <c>line</c> also honor option + <c>packet_size</c>. (Thanks to Steve Vinoski)</p> + <p> + Own Id: OTP-9389</p> + </item> + <item> + <p> <c>disk_log:reopen/2,3</c> and + <c>disk_log:breopen/3</c> could return the error reason + from <c>file:rename/2</c> rather than the reason + <c>{file_error, Filename, Reason}</c>. This bug has been + fixed. </p> <p> The message <c>{disk_log, Node, {error, + disk_log_stopped}}</c> which according the documentation + is sent upon failure to truncate or reopen a disk log was + sometimes turned into a reply. This bug has been fixed. + </p> + <p> + *** POTENTIAL INCOMPATIBILITY ***</p> + <p> + Own Id: OTP-9508</p> + </item> + <item> + <p> + Environment variable 'shutdown_timeout' is added to + kernel application. Earlier, application_controller would + hang forever if an application top supervisor did not + terminate upon a shutdown request. If this new + environment variable is set to a positive integer T, then + application controller will now give up after T + milliseconds and instead brutally kill the application. + For backwards compatibility, the default value for + shutdown_timeout is 'infinity'.</p> + <p> + Own Id: OTP-9540</p> + </item> + <item> + <p> + Add '-callback' attributes in stdlib's behaviours</p> + <p> + Replace the behaviour_info(callbacks) export in stdlib's + behaviours with -callback' attributes for all the + callbacks. Update the documentation with information on + the callback attribute Automatically generate + 'behaviour_info' function from '-callback' attributes</p> + <p> + 'behaviour_info(callbacks)' is a special function that is + defined in a module which describes a behaviour and + returns a list of its callbacks.</p> + <p> + This function is now automatically generated using the + '-callback' specs. An error is returned by lint if user + defines both '-callback' attributes and the + behaviour_info/1 function. If no type info is needed for + a callback use a generic spec for it. Add '-callback' + attribute to language syntax</p> + <p> + Behaviours may define specs for their callbacks using the + familiar spec syntax, replacing the '-spec' keyword with + '-callback'. Simple lint checks are performed to ensure + that no callbacks are defined twice and all types + referred are declared.</p> + <p> + These attributes can be then used by tools to provide + documentation to the behaviour or find discrepancies in + the callback definitions in the callback module.</p> + <p> + Add callback specs into 'application' module in kernel + Add callback specs to tftp module following internet + documentation Add callback specs to inets_service module + following possibly deprecated comments</p> + <p> + Own Id: OTP-9621</p> + </item> + <item> + <p> + make tab completion work in remote shells (Thanks to Mats + Cronqvist)</p> + <p> + Own Id: OTP-9673</p> + </item> + <item> + <p> + Add missing parenthesis in heart doc.</p> + <p> + Add missing spaces in the Reference Manual distributed + section.</p> + <p> + In the HTML version of the doc those spaces are necessary + to separate those words.</p> + <p> + Own Id: OTP-9693</p> + </item> + <item> + <p> + Fixes net_kernel:get_net_ticktime() doc</p> + <p> + Adds missing description when `ignored' is returned. + (Thanks to Ricardo Catalinas Jim�nez )</p> + <p> + Own Id: OTP-9713</p> + </item> + <item> + <p> While <c>disk_log</c> eagerly collects logged terms + for better performance, collecting too much data may + choke the system and cause huge binaries to be written. + In order to remedy the situation a (small) limit on the + amount of data that is collected before writing to disk + has been introduced. </p> + <p> + Own Id: OTP-9764</p> + </item> + <item> + <p> + <list> <item><p>Correct callback spec in application + module</p></item> <item><p>Refine warning about callback + specs with extra ranges</p></item> <item><p>Cleanup + autoimport compiler directives</p></item> <item><p>Fix + Dialyzer's warnings in typer</p></item> <item><p>Fix + Dialyzer's warning for its own code</p></item> + <item><p>Fix bug in Dialyzer's behaviours + analysis</p></item> <item><p>Fix crash in + Dialyzer</p></item> <item><p>Variable substitution was + not generalizing any unknown variables.</p></item> + </list></p> + <p> + Own Id: OTP-9776</p> + </item> + <item> + <p> + Fix a crash when file:change_time/2,3 are called with + invalid dates</p> + <p> + Calling file:change_time/2,3 with an invalid date tuple + (e.g file:change_time("file.txt", {undefined, + undefined})) will cause file_server_2 to crash. + error_logger will shutdown and the whole VM will stop. + Change behavior to validate given dates on system + boundaries. (i.e before issuing a server call).(Thanks to + Ahmed Omar)</p> + <p> + Own Id: OTP-9785</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> An option list argument can now be passed to + <c>file:read_file_info/2, file:read_link_info/2</c> and + <c>file:write_file_info/3</c> and set time type + information in the call. Valid options are <c>{time, + local}, {time, universal}</c> and <c>{time, posix}</c>. + In the case of <c>posix</c> time no conversions are made + which makes the operation a bit faster. </p> + <p> + Own Id: OTP-7687</p> + </item> + <item> + <p><c>file:list_dir/1,2</c> will now fill an buffer + entire with filenames from the efile driver before + sending it to an erlang process. This will speed up this + file operation in most cases.</p> + <p> + Own Id: OTP-9023</p> + </item> + <item> + <p>gen_sctp:open/0-2 may now return + {error,eprotonosupport} if SCTP is not supported</p> + <p>gen_sctp:peeloff/1 has been implemented and creates a + one-to-one socket which also are supported now</p> + <p> + *** POTENTIAL INCOMPATIBILITY ***</p> + <p> + Own Id: OTP-9239</p> + </item> + <item> + <p> + Sendfile has been added to the file module's API. + sendfile/2 is used to read data from a file and send it + to a tcp socket using a zero copying mechanism if + available on that OS.</p> + <p> + Thanks to Tuncer Ayaz and Steve Vinovski for original + implementation</p> + <p> + Own Id: OTP-9240</p> + </item> + <item> + <p> + Tuple funs (a two-element tuple with a module name and a + function) are now officially deprecated and will be + removed in R16. Use '<c>fun M:F/A</c>' instead. To make + you aware that your system uses tuple funs, the very + first time a tuple fun is applied, a warning will be sent + to the error logger.</p> + <p> + Own Id: OTP-9649</p> + </item> + </list> + </section> + +</section> + +<section><title>Kernel 2.14.5</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> + Fix type of Packet arg of gen_tcp:send/2 and + gen_udp:send/4</p> + <p> + The type is marked as a binary() or a string() but in + practice it can be an iodata(). The test suite was + updated to confirm the gen_tcp/2 and gen_udp:send/4 + functions accept iodata() (iolists) packets. (Thanks to + Filipe David Manana)</p> + <p> + Own Id: OTP-9514</p> + </item> + <item> + <p> XML files have been corrected. </p> + <p> + Own Id: OTP-9550 Aux Id: OTP-9541 </p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> The types and specifications of the inet modules have + been improved. </p> + <p> + Own Id: OTP-9260</p> + </item> + <item> + <p> Types and specifications have been added. </p> + <p> + Own Id: OTP-9356</p> + </item> + <item> + <p> Contracts in STDLIB and Kernel have been improved and + type errors have been corrected. </p> + <p> + Own Id: OTP-9485</p> + </item> + <item> + <p> Update documentation and specifications of some of + the zlib functions. </p> + <p> + Own Id: OTP-9506</p> + </item> + </list> + </section> + +</section> + <section><title>Kernel 2.14.4</title> <section><title>Fixed Bugs and Malfunctions</title> @@ -2535,7 +2826,7 @@ <c>badarg</c> if a process is already registered. As it turns out there is no check in <c>global</c> if a process is registered under more than one name. If some process is - accidentaly or by design given several names, it is + accidentally or by design given several names, it is possible that the name registry becomes inconsistent due to the way the resolve function is called when name clashes are discovered (see <c>register_name/3</c> in |