<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Judge%3ASystem_calls</id>
		<title>Judge:System calls - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wcipeg.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Judge%3ASystem_calls"/>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;action=history"/>
		<updated>2026-05-09T18:53:19Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1537&amp;oldid=prev</id>
		<title>Brian at 22:24, 24 December 2011</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1537&amp;oldid=prev"/>
				<updated>2011-12-24T22:24:21Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:24, 24 December 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L19&quot; &gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_sigaction''', '''sys_signal''': Could be useful if used in conjunction with ''sys_setitimer''. Note that attempts to use this system call to circumvent the grader are futile. For example, catching SIGXCPU might allow your program to execute for longer than the CPU time limit, but you'll get a TLE mark anyway, since the grader knows how much CPU time you used. (It also won't allow you to exceed the wall clock limit, since your program receives SIGKILL when this happens.)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_sigaction''', '''sys_signal''': Could be useful if used in conjunction with ''sys_setitimer''. Note that attempts to use this system call to circumvent the grader are futile. For example, catching SIGXCPU might allow your program to execute for longer than the CPU time limit, but you'll get a TLE mark anyway, since the grader knows how much CPU time you used. (It also won't allow you to exceed the wall clock limit, since your program receives SIGKILL when this happens.)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_socketcall''': '''Not allowed''', since programs are not supposed to access the network. They will fail anyway since your program is not allowed to open new file descriptors.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_socketcall''': '''Not allowed''', since programs are not supposed to access the network. They will fail anyway since your program is not allowed to open new file descriptors.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* '''sys_time''': Like ''sys_getpid''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_write''': Like ''sys_read''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''sys_write''': Like ''sys_read''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1536&amp;oldid=prev</id>
		<title>Brian at 11:30, 24 December 2011</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1536&amp;oldid=prev"/>
				<updated>2011-12-24T11:30:14Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:30, 24 December 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page lists some common Linux system calls and discusses their usage in programs &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;on &lt;/del&gt;the PEG Judge. Note that almost all of these have corresponding wrappers in libc without the &amp;quot;sys_&amp;quot; prefix (''e.g.'', ''read'' for ''sys_read'').&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page lists some common Linux system calls and discusses their usage in programs &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;graded by &lt;/ins&gt;the PEG Judge. Note that almost all of these have corresponding wrappers in libc without the &amp;quot;sys_&amp;quot; prefix (''e.g.'', ''read'' for ''sys_read'').&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In general, the state of the filesystem is required to be identical before and after your program runs (except that the judge collects your output and automatically determines execution time and other statistics), and your program is not allowed to examine the filesystem at all except by reading from standard input. Thus, you may not create files, delete files, move files, open additional files, examine file attributes, nor change file attributes, nor may you do any of the same on directories; you also are not allowed to change working directory. Obviously, you should also not try to do anything that requires root privileges, such as increasing your resource limits.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In general, the state of the filesystem is required to be identical before and after your program runs (except that the judge collects your output and automatically determines execution time and other statistics), and your program is not allowed to examine the filesystem at all except by reading from standard input. Thus, you may not create files, delete files, move files, open additional files, examine file attributes, nor change file attributes, nor may you do any of the same on directories; you also are not allowed to change working directory. Obviously, you should also not try to do anything that requires root privileges, such as increasing your resource limits.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	<entry>
		<id>http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1535&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;This page lists some common Linux system calls and discusses their usage in programs on the PEG Judge. Note that almost all of these have corresponding wrappers in libc without t...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.wcipeg.com/wiki/index.php?title=Judge:System_calls&amp;diff=1535&amp;oldid=prev"/>
				<updated>2011-12-24T11:29:53Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;This page lists some common Linux system calls and discusses their usage in programs on the PEG Judge. Note that almost all of these have corresponding wrappers in libc without t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page lists some common Linux system calls and discusses their usage in programs on the PEG Judge. Note that almost all of these have corresponding wrappers in libc without the &amp;quot;sys_&amp;quot; prefix (''e.g.'', ''read'' for ''sys_read'').&lt;br /&gt;
&lt;br /&gt;
In general, the state of the filesystem is required to be identical before and after your program runs (except that the judge collects your output and automatically determines execution time and other statistics), and your program is not allowed to examine the filesystem at all except by reading from standard input. Thus, you may not create files, delete files, move files, open additional files, examine file attributes, nor change file attributes, nor may you do any of the same on directories; you also are not allowed to change working directory. Obviously, you should also not try to do anything that requires root privileges, such as increasing your resource limits.&lt;br /&gt;
* '''sys_brk''': This is essential for dynamic memory allocation, but you'll only ever want to call it directly if you're using assembly language; otherwise the programming language or standard libraries should be allowed to take care of it. Note that if you try to allocate more memory this way than the memory limit for your program, this call will fail.&lt;br /&gt;
* '''sys_clone''': See ''sys_fork''.&lt;br /&gt;
* '''sys_close''': This does not necessarily have to be called, as the kernel automatically closes all open file descriptors when a program terminates in any way. However, it is almost always called indirectly when a program terminates (unless this program is written in assembly language).&lt;br /&gt;
* '''sys_execve''': '''Not allowed'''. Your program may not invoke any other programs. If it tries, either it will be killed, or the system call will simply fail.&lt;br /&gt;
* '''sys_exit''': Every program must ''sys_exit'' when it is done executing. You can exit your program at any time, and return any exit code. If your output is correct, you will receive points regardless of the exit code; however, if your program is not accepted, the submission status will indicate &amp;quot;Invalid Return&amp;quot; (IR). Note that calling ''sys_exit'' does not flush the standard output stream, but instead immediately discards anything left in the buffer. This is not a problem when ''sys_exit'' is called indirectly by ''exit'' in libc, which always closes the standard streams before calling ''sys_exit''.&lt;br /&gt;
* '''sys_fcntl''': Your programming language runtime might use this call. There is probably no use for it in the code you submit.&lt;br /&gt;
* '''sys_fork''': '''Not allowed'''. Programs may not ''sys_fork'', and may be killed if they try, or the attempt will just fail anyway..&lt;br /&gt;
* '''sys_getitimer''': See ''sys_setitimer''.&lt;br /&gt;
* '''sys_getpid''': This is often useful for seeding random number generators.&lt;br /&gt;
* '''sys_kill''': It's obviously '''not allowed''' to ''sys_kill'' other processes, and trying to do so will either cause your program to be ''sys_kill''ed itself, or simply fail. Programs can ''sys_kill'' themselves though.&lt;br /&gt;
* '''sys_lseek''', '''sys_llseek''': You can use this if you want, but be aware that it won't work if the standard streams turn out to be pipes instead of files.&lt;br /&gt;
* '''sys_mmap''': Analogous to ''sys_lseek''.&lt;br /&gt;
* '''sys_open''': '''Not allowed'''. Your program will have standard input, standard output, and standard error streams already open when it is invoked. You are not allowed to attempt to read from or write to other files.&lt;br /&gt;
* '''sys_read''': This system call is necessary for reading input. Be aware however that the input may come from a pipe, in which case it won't be possible to ''sys_read'' large amounts of data in at once, but instead it will be necessary to check the return value to determine how many bytes were actually read, and then try again if there is yet more data to be read. This is not an issue when using I/O functions from programming language standard libraries (such as ''fread''), as these will automatically call ''sys_read'' multiple times if necessary.&lt;br /&gt;
* '''sys_setitimer''': This might be useful for arranging for a recursive backtracking algorithm to automatically terminate when your program's time limit has nearly expired, so that your program can print out the best solution it's found so far and you can hope for the best.&lt;br /&gt;
* '''sys_sigaction''', '''sys_signal''': Could be useful if used in conjunction with ''sys_setitimer''. Note that attempts to use this system call to circumvent the grader are futile. For example, catching SIGXCPU might allow your program to execute for longer than the CPU time limit, but you'll get a TLE mark anyway, since the grader knows how much CPU time you used. (It also won't allow you to exceed the wall clock limit, since your program receives SIGKILL when this happens.)&lt;br /&gt;
* '''sys_socketcall''': '''Not allowed''', since programs are not supposed to access the network. They will fail anyway since your program is not allowed to open new file descriptors.&lt;br /&gt;
* '''sys_write''': Like ''sys_read''.&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>