stack size and Python3 binding

This commit is contained in:
virusdefender 2017-05-06 18:51:52 +08:00
parent 1bbdbbeb52
commit d4d1538968
4 changed files with 18 additions and 10 deletions

View File

@ -166,7 +166,7 @@
<li><a href="#struct-result-members">struct result members</a></li>
<li><a href="#python-binding-python-27-only">Python binding (Python 2.7 only)</a></li>
<li><a href="#python-binding-python-27-and-35">Python binding (Python 2.7 and 3.5)</a></li>
<li><a href="#run-tests">Run tests</a></li>
@ -192,6 +192,7 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
<li><code>max_cpu_time</code> (ms): max cpu time this process can cost, -1 for unlimited</li>
<li><code>max_real_time</code> (ms): max time this process can run, -1 for unlimited</li>
<li><code>max_memory</code> (byte): max size of the process's virtual memory (address space), -1 for unlimited</li>
<li><code>max_stack</code> (byte): max size of the process's stack size</li>
<li><code>max_process_number</code>: max number of child process this process can create (to avoid fork bomb), -1 for unlimited</li>
<li><code>max_output_size</code> (byte): max size of data this process can output to stdout, stderr and file, -1 for unlimited</li>
<li><code>exe_path</code>: path of file to run</li>
@ -239,7 +240,7 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
<li>EXECVE_FAILED = -10</li>
<li>SPJ_ERROR = -11 (judger module will never return this value, it's used for awswer checker)</li>
</ul>
<h2 id="python-binding-python-27-only">Python binding (Python 2.7 only)</h2>
<h2 id="python-binding-python-27-and-35">Python binding (Python 2.7 and 3.5)</h2>
<pre><code>sudo python setup.py install
</code></pre>
@ -252,9 +253,10 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
&gt;&gt;&gt; _judger.run(max_cpu_time=1000,
... max_real_time=2000,
... max_memory=1000000000,
... max_memory=128 * 1024 * 1024,
... max_process_number=200,
... max_output_size=10000,
... max_stack=32 * 1024 * 1024,
... # five args above can be _judger.UNLIMITED
... exe_path=&quot;/bin/echo&quot;,
... input_path=&quot;/dev/null&quot;,

View File

@ -166,7 +166,7 @@
<li><a href="#struct-result-members">struct result members</a></li>
<li><a href="#python-binding-python-27-only">Python binding (Python 2.7 only)</a></li>
<li><a href="#python-binding-python-27-and-35">Python binding (Python 2.7 and 3.5)</a></li>
<li><a href="#run-tests">Run tests</a></li>
@ -192,6 +192,7 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
<li><code>max_cpu_time</code> (ms): max cpu time this process can cost, -1 for unlimited</li>
<li><code>max_real_time</code> (ms): max time this process can run, -1 for unlimited</li>
<li><code>max_memory</code> (byte): max size of the process's virtual memory (address space), -1 for unlimited</li>
<li><code>max_stack</code> (byte): max size of the process's stack size</li>
<li><code>max_process_number</code>: max number of child process this process can create (to avoid fork bomb), -1 for unlimited</li>
<li><code>max_output_size</code> (byte): max size of data this process can output to stdout, stderr and file, -1 for unlimited</li>
<li><code>exe_path</code>: path of file to run</li>
@ -239,7 +240,7 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
<li>EXECVE_FAILED = -10</li>
<li>SPJ_ERROR = -11 (judger module will never return this value, it's used for awswer checker)</li>
</ul>
<h2 id="python-binding-python-27-only">Python binding (Python 2.7 only)</h2>
<h2 id="python-binding-python-27-and-35">Python binding (Python 2.7 and 3.5)</h2>
<pre><code>sudo python setup.py install
</code></pre>
@ -252,9 +253,10 @@ mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; s
&gt;&gt;&gt; _judger.run(max_cpu_time=1000,
... max_real_time=2000,
... max_memory=1000000000,
... max_memory=128 * 1024 * 1024,
... max_process_number=200,
... max_output_size=10000,
... max_stack=32 * 1024 * 1024,
... # five args above can be _judger.UNLIMITED
... exe_path=&quot;/bin/echo&quot;,
... input_path=&quot;/dev/null&quot;,

View File

@ -16,6 +16,7 @@ mkdir build && cd build && cmake .. && make && sudo make install
- `max_cpu_time` (ms): max cpu time this process can cost, -1 for unlimited
- `max_real_time` (ms): max time this process can run, -1 for unlimited
- `max_memory` (byte): max size of the process's virtual memory (address space), -1 for unlimited
- `max_stack` (byte): max size of the process's stack size
- `max_process_number`: max number of child process this process can create (to avoid fork bomb), -1 for unlimited
- `max_output_size` (byte): max size of data this process can output to stdout, stderr and file, -1 for unlimited
- `exe_path`: path of file to run
@ -61,7 +62,7 @@ mkdir build && cd build && cmake .. && make && sudo make install
- EXECVE_FAILED = -10
- SPJ_ERROR = -11 (judger module will never return this value, it's used for awswer checker)
## Python binding (Python 2.7 only)
## Python binding (Python 2.7 and 3.5)
```
sudo python setup.py install
@ -80,9 +81,10 @@ Args with string must be Python `str` type
>>> _judger.run(max_cpu_time=1000,
... max_real_time=2000,
... max_memory=1000000000,
... max_memory=128 * 1024 * 1024,
... max_process_number=200,
... max_output_size=10000,
... max_stack=32 * 1024 * 1024,
... # five args above can be _judger.UNLIMITED
... exe_path="/bin/echo",
... input_path="/dev/null",

View File

@ -16,6 +16,7 @@ mkdir build && cd build && cmake .. && make && sudo make install
- `max_cpu_time` (ms): max cpu time this process can cost, -1 for unlimited
- `max_real_time` (ms): max time this process can run, -1 for unlimited
- `max_memory` (byte): max size of the process's virtual memory (address space), -1 for unlimited
- `max_stack` (byte): max size of the process's stack size
- `max_process_number`: max number of child process this process can create (to avoid fork bomb), -1 for unlimited
- `max_output_size` (byte): max size of data this process can output to stdout, stderr and file, -1 for unlimited
- `exe_path`: path of file to run
@ -61,7 +62,7 @@ mkdir build && cd build && cmake .. && make && sudo make install
- EXECVE_FAILED = -10
- SPJ_ERROR = -11 (judger module will never return this value, it's used for awswer checker)
## Python binding (Python 2.7 only)
## Python binding (Python 2.7 and 3.5)
```
sudo python setup.py install
@ -80,9 +81,10 @@ Args with string must be Python `str` type
>>> _judger.run(max_cpu_time=1000,
... max_real_time=2000,
... max_memory=1000000000,
... max_memory=128 * 1024 * 1024,
... max_process_number=200,
... max_output_size=10000,
... max_stack=32 * 1024 * 1024,
... # five args above can be _judger.UNLIMITED
... exe_path="/bin/echo",
... input_path="/dev/null",