forked from UESTC-ACM/py-lrun-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil.py
53 lines (51 loc) · 2.19 KB
/
util.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Utility settings for py-lrun-judge.
#
from os import path
c_language_blacklist = "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync," + \
"sync_file_range:k,syncfs:k,unshare:k,setns:k,clone:k,query_module:k," + \
"sysinfo:k,syslog:k,sysfs:k"
java_language_blacklist = "!execve:k,flock:k,ptrace:k,sync:k,fdatasync:k,fsync:k,msync," + \
"sync_file_range:k,syncfs:k,unshare:k,setns:k," + \
"clone[a&268435456==268435456]:k,query_module:k,sysinfo:k," + \
"syslog:k,sysfs:k"
judge_languages = {
"gnu-gcc": {
"name": "GNU GCC",
"extension": "c",
"id": "1",
"blacklist": c_language_blacklist,
"compile_command": "gcc -static -w -O2 -DONLINE_JUDGE --std=c99 " + \
"{work_dir}/{source_file}.{extension} -lm -o " + \
"{work_dir}/{source_file}.bin",
"executive_command": "{work_dir}/{source_file}.bin",
},
"gnu-g++": {
"name": "GNU G++",
"extension": "cc",
"id": "2",
"blacklist": c_language_blacklist,
"compile_command": "g++ -static -w -O2 -DONLINE_JUDGE " + \
"{work_dir}/{source_file}.{extension} -o " + \
"{work_dir}/{source_file}.bin",
"executive_command": "{work_dir}/{source_file}.bin",
},
"gnu-g++11": {
"name": "GNU G++(std=g++0x)",
"extension": "cc",
"id": "3",
"blacklist": c_language_blacklist,
"compile_command": "g++ -static -w -O2 -DONLINE_JUDGE --std=gnu++0x " + \
"{work_dir}/{source_file}.{extension} -o {work_dir}/{source_file}.bin",
"executive_command": "{work_dir}/{source_file}.bin",
},
"java": {
"name": "Java8",
"extension": "java",
"id": "3",
"blacklist": java_language_blacklist,
"compile_command": "javac {work_dir}/{source_file}.{extension} -d {work_dir}",
"executive_command": "java -cp {work_dir} -Djava.security.manager " + \
"-Djava.security.policy==%s {source_file}" % (path.abspath(".")),
},
}