Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
home:Ledest:erlang:23
erlang
0276-Remove-mentions-of-obsolete-emulator-flag-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0276-Remove-mentions-of-obsolete-emulator-flag-smp.patch of Package erlang
From 2dafb4b3540321b8be7c676789e04761867b60e5 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Fri, 30 Apr 2021 14:07:17 +0200 Subject: [PATCH 2/2] Remove mentions of obsolete emulator flag -smp --- erts/doc/src/escript_cmd.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/erts/doc/src/escript_cmd.xml b/erts/doc/src/escript_cmd.xml index 8aed1fd492..589e960f95 100644 --- a/erts/doc/src/escript_cmd.xml +++ b/erts/doc/src/escript_cmd.xml @@ -72,7 +72,7 @@ $ <input>chmod u+x factorial</input> $ <input>cat factorial</input> #!/usr/bin/env escript %% -*- erlang -*- -%%! -smp enable -sname factorial -mnesia debug verbose +%%! -sname factorial -mnesia debug verbose main([String]) -> try N = list_to_integer(String), @@ -129,7 +129,7 @@ io:setopts([{encoding, unicode}])</code> of the Emacs directive), arguments can be specified to the emulator, for example:</p> <pre> -%%! -smp enable -sname factorial -mnesia debug verbose</pre> +%%! -sname factorial -mnesia debug verbose</pre> <p>Such an argument line must start with <c>%%!</c> and the remaining line is interpreted as arguments to the emulator.</p> <p>If you know the location of the <c>escript</c> executable, the first @@ -272,27 +272,27 @@ factorial 5 = 120</pre> can either be returned as a binary or written to file.</p> <p>As an example of how the function can be used, we create an interpreted escript that uses <c>emu_args</c> to set some emulator - flag. In this case, it happens to disable the <c>smp_support</c>. We + flag. In this case, it happens to set number of schedulers with <c>+S3</c>. We also extract the different sections from the newly created script:</p> <pre> -> <input>Source = "%% Demo\nmain(_Args) ->\n io:format(erlang:system_info(smp_support)).\n".</input> -"%% Demo\nmain(_Args) ->\n io:format(erlang:system_info(smp_support)).\n" +> <input>Source = "%% Demo\nmain(_Args) ->\n io:format(\"~p\",[erlang:system_info(schedulers)]).\n".</input> +"%% Demo\nmain(_Args) ->\n io:format(erlang:system_info(schedulers)).\n" > <input>io:format("~s\n", [Source]).</input> %% Demo main(_Args) -> - io:format(erlang:system_info(smp_support)). + io:format(erlang:system_info(schedulers)). ok -> <input>{ok, Bin} = escript:create(binary, [shebang, comment, {emu_args, "-smp disable"}, +> <input>{ok, Bin} = escript:create(binary, [shebang, comment, {emu_args, "+S3"}, {source, list_to_binary(Source)}]).</input> -{ok,<<"#!/usr/bin/env escript\n%% This is an -*- erlang -*- file\n%%!-smp disabl"...>>} +{ok,<<"#!/usr/bin/env escript\n%% This is an -*- erlang -*- file\n%%!+S3"...>>} > <input>file:write_file("demo.escript", Bin).</input> ok > <input>os:cmd("escript demo.escript").</input> -"false" +"3" > <input>escript:extract("demo.escript", []).</input> -{ok,[{shebang,default}, {comment,default}, {emu_args,"-smp disable"}, - {source,<<"%% Demo\nmain(_Args) ->\n io:format(erlang:system_info(smp_su"...>>}]}</pre> +{ok,[{shebang,default}, {comment,default}, {emu_args,"+S3"}, + {source,<<"%% Demo\nmain(_Args) ->\n io:format(erlang:system_info(schedu"...>>}]}</pre> <p>An escript without header can be created as follows:</p> <pre> > <input>file:write_file("demo.erl", -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor