@@ -61,7 +61,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
6161 "O_LARGEFILE"
6262 ]
6363
64- macos_x86_open_flags = {
64+ _macos_x86_open_flags = {
6565 "O_RDONLY" : 0x0 ,
6666 "O_WRONLY" : 0x1 ,
6767 "O_RDWR" : 0x2 ,
@@ -79,7 +79,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
7979 'O_LARGEFILE' : None
8080 }
8181
82- linux_x86_open_flags = {
82+ _linux_x86_open_flags = {
8383 'O_RDONLY' : 0x0 ,
8484 'O_WRONLY' : 0x1 ,
8585 'O_RDWR' : 0x2 ,
@@ -97,7 +97,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
9797 'O_LARGEFILE' : 0x0
9898 }
9999
100- linux_arm_open_flags = {
100+ _linux_arm_open_flags = {
101101 'O_RDONLY' : 0x0 ,
102102 'O_WRONLY' : 0x1 ,
103103 'O_RDWR' : 0x2 ,
@@ -115,7 +115,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
115115 'O_LARGEFILE' : 0x20000
116116 }
117117
118- linux_mips_open_flags = {
118+ _linux_mips_open_flags = {
119119 'O_RDONLY' : 0x0 ,
120120 'O_WRONLY' : 0x1 ,
121121 'O_RDWR' : 0x2 ,
@@ -133,7 +133,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
133133 'O_LARGEFILE' : 0x2000
134134 }
135135
136- freebsd_open_flags = {
136+ _freebsd_open_flags = {
137137 'O_RDONLY' : 0x0 ,
138138 'O_WRONLY' : 0x1 ,
139139 'O_RDWR' : 0x2 ,
@@ -151,7 +151,7 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
151151 'O_LARGEFILE' : None
152152 }
153153
154- qnx_open_flags = {
154+ _qnx_open_flags = {
155155 'O_RDONLY' : 0x00000 ,
156156 'O_WRONLY' : 0x00001 ,
157157 'O_RDWR' : 0x00002 ,
@@ -177,25 +177,25 @@ def flag_mapping(flags, mapping_name, mapping_from, mapping_to):
177177
178178 if ql .ostype == QL_OS .LINUX :
179179 if ql .archtype in (QL_ARCH .X86 , QL_ARCH .X8664 ):
180- f = linux_x86_open_flags
180+ f = _linux_x86_open_flags
181181 elif ql .archtype in (QL_ARCH .ARM , QL_ARCH .ARM_THUMB , QL_ARCH .ARM64 ):
182- f = linux_arm_open_flags
182+ f = _linux_arm_open_flags
183183 elif ql .archtype == QL_ARCH .MIPS :
184- f = linux_mips_open_flags
184+ f = _linux_mips_open_flags
185185 elif ql .ostype == QL_OS .MACOS :
186186 if ql .archtype in (QL_ARCH .X86 , QL_ARCH .X8664 ):
187- f = macos_x86_open_flags
187+ f = _macos_x86_open_flags
188188 elif ql .ostype == QL_OS .FREEBSD :
189- f = freebsd_open_flags
189+ f = _freebsd_open_flags
190190 elif ql .ostype == QL_OS .QNX :
191- f = qnx_open_flags
191+ f = _qnx_open_flags
192192
193193 if ql .platform_os == QL_OS .LINUX :
194- t = linux_x86_open_flags
194+ t = _linux_x86_open_flags
195195 elif ql .platform_os == QL_OS .MACOS :
196- t = macos_x86_open_flags
196+ t = _macos_x86_open_flags
197197 elif ql .platform_os == QL_OS .FREEBSD :
198- t = freebsd_open_flags
198+ t = _freebsd_open_flags
199199
200200 if f == t :
201201 return flags
@@ -206,16 +206,15 @@ def open_flags_mapping(flags, archtype, ostype):
206206 if ostype == QL_OS .MACOS :
207207 mapping_dict = {
208208 QL_ARCH .X8664 : macos_x86_open_flags ,
209- QL_ARCH .ARM64 : arm_open_flags ,
209+ QL_ARCH .ARM64 : linux_arm_open_flags ,
210210 }[archtype ]
211211 else :
212212 mapping_dict = {
213- QL_ARCH .X86 : x86_open_flags ,
214- QL_ARCH .X8664 : x86_open_flags ,
215- QL_ARCH .ARM : arm_open_flags ,
216- QL_ARCH .ARM64 : arm_open_flags ,
217- QL_ARCH .MIPS : mips_open_flags ,
218- QL_OS .MACOS : macos_x86_open_flags ,
213+ QL_ARCH .X86 : linux_x86_open_flags ,
214+ QL_ARCH .X8664 : linux_x86_open_flags ,
215+ QL_ARCH .ARM : linux_arm_open_flags ,
216+ QL_ARCH .ARM64 : linux_arm_open_flags ,
217+ QL_ARCH .MIPS : linux_mips_open_flags ,
219218 }[archtype ]
220219 ret = ["O_RDONLY" ]
221220 return _constant_mapping (flags , mapping_dict , ret )
@@ -260,17 +259,17 @@ def mmap_prot_mapping(prots):
260259def socket_type_mapping (t , archtype , ostype ):
261260 if ostype == QL_OS .MACOS :
262261 socket_type_map = {
263- QL_ARCH .ARM64 : arm_socket_types ,
264- QL_ARCH .X8664 : x86_socket_types ,
262+ QL_ARCH .ARM64 : linux_arm_socket_types ,
263+ QL_ARCH .X8664 : linux_x86_socket_types ,
265264 }[archtype ]
266265 else :
267266 socket_type_map = {
268- QL_ARCH .X86 : x86_socket_types ,
269- QL_ARCH .X8664 : x86_socket_types ,
270- QL_ARCH .ARM : arm_socket_types ,
271- QL_ARCH .ARM_THUMB : arm_socket_types ,
272- QL_ARCH .ARM64 : arm_socket_types ,
273- QL_ARCH .MIPS : mips_socket_types ,
267+ QL_ARCH .X86 : linux_x86_socket_types ,
268+ QL_ARCH .X8664 : linux_x86_socket_types ,
269+ QL_ARCH .ARM : linux_arm_socket_types ,
270+ QL_ARCH .ARM_THUMB : linux_arm_socket_types ,
271+ QL_ARCH .ARM64 : linux_arm_socket_types ,
272+ QL_ARCH .MIPS : linux_mips_socket_types ,
274273 }[archtype ]
275274
276275 # https://code.woboq.org/linux/linux/net/socket.c.html#1363
@@ -281,33 +280,33 @@ def socket_domain_mapping(p, archtype, ostype):
281280 if ostype == QL_OS .MACOS :
282281 socket_domain_map = {
283282 QL_ARCH .X8664 : macos_x86_socket_domain ,
284- QL_ARCH .ARM64 : arm_socket_domain ,
283+ QL_ARCH .ARM64 : linux_arm_socket_domain ,
285284 }[archtype ]
286285 else :
287286 socket_domain_map = {
288- QL_ARCH .X86 : x86_socket_domain ,
289- QL_ARCH .X8664 : x86_socket_domain ,
290- QL_ARCH .ARM : arm_socket_domain ,
291- QL_ARCH .ARM_THUMB : arm_socket_domain ,
292- QL_ARCH .ARM64 : arm_socket_domain ,
293- QL_ARCH .MIPS : mips_socket_domain ,
287+ QL_ARCH .X86 : linux_x86_socket_domain ,
288+ QL_ARCH .X8664 : linux_x86_socket_domain ,
289+ QL_ARCH .ARM : linux_arm_socket_domain ,
290+ QL_ARCH .ARM_THUMB : linux_arm_socket_domain ,
291+ QL_ARCH .ARM64 : linux_arm_socket_domain ,
292+ QL_ARCH .MIPS : linux_mips_socket_domain ,
294293 }[archtype ]
295294 return _constant_mapping (p , socket_domain_map , single_mapping = True )
296295
297296def socket_level_mapping (t , archtype , ostype ):
298297 if ostype == QL_OS .MACOS :
299298 socket_level_map = {
300- QL_ARCH .X8664 : x86_socket_level ,
301- QL_ARCH .ARM64 : arm_socket_level ,
299+ QL_ARCH .X8664 : linux_x86_socket_level ,
300+ QL_ARCH .ARM64 : linux_arm_socket_level ,
302301 }[archtype ]
303302 else :
304303 socket_level_map = {
305- QL_ARCH .X86 : x86_socket_level ,
306- QL_ARCH .X8664 : x86_socket_level ,
307- QL_ARCH .ARM : arm_socket_level ,
308- QL_ARCH .ARM_THUMB : arm_socket_level ,
309- QL_ARCH .ARM64 : arm_socket_level ,
310- QL_ARCH .MIPS : mips_socket_level ,
304+ QL_ARCH .X86 : linux_x86_socket_level ,
305+ QL_ARCH .X8664 : linux_x86_socket_level ,
306+ QL_ARCH .ARM : linux_arm_socket_level ,
307+ QL_ARCH .ARM_THUMB : linux_arm_socket_level ,
308+ QL_ARCH .ARM64 : linux_arm_socket_level ,
309+ QL_ARCH .MIPS : linux_mips_socket_level ,
311310 }[archtype ]
312311 return _constant_mapping (t , socket_level_map , single_mapping = True )
313312
@@ -320,29 +319,29 @@ def socket_ip_option_mapping(t, archtype, ostype):
320319 }[archtype ]
321320 else :
322321 socket_option_map = {
323- QL_ARCH .X86 : posix_socket_ip_options ,
324- QL_ARCH .X8664 : posix_socket_ip_options ,
325- QL_ARCH .ARM : posix_socket_ip_options ,
326- QL_ARCH .ARM_THUMB : posix_socket_ip_options ,
327- QL_ARCH .ARM64 : posix_socket_ip_options ,
328- QL_ARCH .MIPS : mips_socket_ip_options ,
322+ QL_ARCH .X86 : linux_socket_ip_options ,
323+ QL_ARCH .X8664 : linux_socket_ip_options ,
324+ QL_ARCH .ARM : linux_socket_ip_options ,
325+ QL_ARCH .ARM_THUMB : linux_socket_ip_options ,
326+ QL_ARCH .ARM64 : linux_socket_ip_options ,
327+ QL_ARCH .MIPS : linux_socket_ip_options ,
329328 }[archtype ]
330329 return _constant_mapping (t , socket_option_map , single_mapping = True )
331330
332331
333332def socket_option_mapping (t , archtype , ostype ):
334333 if ostype == QL_OS .MACOS :
335334 socket_option_map = {
336- QL_ARCH .X8664 : x86_socket_options ,
337- QL_ARCH .ARM64 : arm_socket_options ,
335+ QL_ARCH .X8664 : linux_x86_socket_options ,
336+ QL_ARCH .ARM64 : linux_arm_socket_options ,
338337 }[archtype ]
339338 else :
340339 socket_option_map = {
341340 QL_ARCH .X86 : x86_socket_options ,
342341 QL_ARCH .X8664 : x86_socket_options ,
343- QL_ARCH .ARM : arm_socket_options ,
344- QL_ARCH .ARM_THUMB : arm_socket_options ,
345- QL_ARCH .ARM64 : arm_socket_options ,
346- QL_ARCH .MIPS : mips_socket_options ,
342+ QL_ARCH .ARM : linux_arm_socket_options ,
343+ QL_ARCH .ARM_THUMB : linux_arm_socket_options ,
344+ QL_ARCH .ARM64 : linux_arm_socket_options ,
345+ QL_ARCH .MIPS : linux_mips_socket_options ,
347346 }[archtype ]
348347 return _constant_mapping (t , socket_option_map , single_mapping = True )
0 commit comments