Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
91221c29
Commit
91221c29
authored
Dec 02, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for netbsd1 and freebsd3, after suggestions by Anders Andersen
and Jacques Vidrine.
parent
c0f29c2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
Lib/posixfile.py
Lib/posixfile.py
+2
-2
Lib/test/test_fcntl.py
Lib/test/test_fcntl.py
+7
-2
No files found.
Lib/posixfile.py
View file @
91221c29
...
...
@@ -177,7 +177,7 @@ class _posixfile_:
# Hack by davem@magnet.com to get locking to go on freebsd;
# additions for AIX by Vladimir.Marangozov@imag.fr
import
sys
,
os
if
sys
.
platform
==
'freebsd2'
:
if
sys
.
platform
in
(
'netbsd1'
,
'freebsd2'
,
'freebsd3'
)
:
flock
=
struct
.
pack
(
'lxxxxlxxxxlhh'
,
\
l_start
,
l_len
,
os
.
getpid
(),
l_type
,
l_whence
)
elif
sys
.
platform
in
[
'aix3'
,
'aix4'
]:
...
...
@@ -190,7 +190,7 @@ class _posixfile_:
flock
=
fcntl
.
fcntl
(
self
.
_file_
.
fileno
(),
cmd
,
flock
)
if
'?'
in
how
:
if
sys
.
platform
==
'freebsd2'
:
if
sys
.
platform
in
(
'netbsd1'
,
'freebsd2'
,
'freebsd3'
)
:
l_start
,
l_len
,
l_pid
,
l_type
,
l_whence
=
\
struct
.
unpack
(
'lxxxxlxxxxlhh'
,
flock
)
elif
sys
.
platform
in
[
'aix3'
,
'aix4'
]:
...
...
Lib/test/test_fcntl.py
View file @
91221c29
...
...
@@ -5,7 +5,7 @@
import
struct
import
fcntl
import
FCNTL
import
os
import
os
,
sys
from
test_support
import
verbose
filename
=
'/tmp/delete-me'
...
...
@@ -16,7 +16,12 @@ rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, os.O_NONBLOCK)
if
verbose
:
print
'Status from fnctl with O_NONBLOCK: '
,
rv
lockdata
=
struct
.
pack
(
'hhllhh'
,
FCNTL
.
F_WRLCK
,
0
,
0
,
0
,
0
,
0
)
if
sys
.
platform
in
(
'netbsd1'
,
'freebsd2'
,
'freebsd3'
):
lockdata
=
struct
.
pack
(
'lxxxxlxxxxlhh'
,
0
,
0
,
0
,
FCNTL
.
F_WRLCK
,
0
)
elif
sys
.
platform
in
[
'aix3'
,
'aix4'
]:
lockdata
=
struct
.
pack
(
'hhlllii'
,
FCNTL
.
F_WRLCK
,
0
,
0
,
0
,
0
,
0
,
0
)
else
:
lockdata
=
struct
.
pack
(
'hhllhh'
,
FCNTL
.
F_WRLCK
,
0
,
0
,
0
,
0
,
0
)
if
verbose
:
print
'struct.pack: '
,
`lockdata`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment