aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-11-30 23:34:55 +0200
committerMatti Picus <matti.picus@gmail.com>2020-11-30 23:34:55 +0200
commitc89a7aed8ad361a1ceb3cb93787e23a1aab9c584 (patch)
treeae4827c458eb68c22ec418cc572cfd7360742293
parentfix position of elif clauses in the ast (diff)
downloadpypy-c89a7aed8ad361a1ceb3cb93787e23a1aab9c584.tar.gz
pypy-c89a7aed8ad361a1ceb3cb93787e23a1aab9c584.tar.bz2
pypy-c89a7aed8ad361a1ceb3cb93787e23a1aab9c584.zip
backport changes from py3.7 to rpython
-rw-r--r--rpython/rlib/_rsocket_rffi.py2
-rw-r--r--rpython/rlib/rsocket.py2
-rw-r--r--rpython/rlib/rtime.py1
-rw-r--r--rpython/rlib/rwin32.py2
4 files changed, 6 insertions, 1 deletions
diff --git a/rpython/rlib/_rsocket_rffi.py b/rpython/rlib/_rsocket_rffi.py
index ae5b3f637e..7eacf28f81 100644
--- a/rpython/rlib/_rsocket_rffi.py
+++ b/rpython/rlib/_rsocket_rffi.py
@@ -208,7 +208,7 @@ SIO_RCVALL SIO_KEEPALIVE_VALS
SIOCGIFNAME SIOCGIFINDEX
-SO_DOMAIN SO_PROTOCOL SO_PEERSEC SO_PASSSEC TCP_USER_TIMEOUT TCP_CONGESTION
+SO_DOMAIN SO_PROTOCOL SO_PEERSEC SO_PASSSEC TCP_USER_TIMEOUT TCP_CONGESTION TCP_NOTSENT_LOWAT
'''.split()
for name in constant_names:
diff --git a/rpython/rlib/rsocket.py b/rpython/rlib/rsocket.py
index 493e379477..c6383756cc 100644
--- a/rpython/rlib/rsocket.py
+++ b/rpython/rlib/rsocket.py
@@ -32,6 +32,8 @@ def mallocbuf(buffersize):
constants = _c.constants
locals().update(constants) # Define constants from _c
+HAS_SO_PROTOCOL = hasattr(_c, 'SO_PROTOCOL')
+
if _c.WIN32:
from rpython.rlib import rwin32
diff --git a/rpython/rlib/rtime.py b/rpython/rlib/rtime.py
index 7ddaf365a5..4158e1da59 100644
--- a/rpython/rlib/rtime.py
+++ b/rpython/rlib/rtime.py
@@ -83,6 +83,7 @@ constant_names = ['RUSAGE_SELF', 'EINTR',
'CLOCK_THREAD_CPUTIME_ID',
'CLOCK_HIGHRES',
'CLOCK_PROF',
+ 'CLOCK_UPTIME',
]
for const in constant_names:
setattr(CConfig, const, rffi_platform.DefinedConstantInteger(const))
diff --git a/rpython/rlib/rwin32.py b/rpython/rlib/rwin32.py
index 028c9ad9c4..b261a48953 100644
--- a/rpython/rlib/rwin32.py
+++ b/rpython/rlib/rwin32.py
@@ -146,6 +146,8 @@ if WIN32:
GENERIC_ALL = rffi.cast(DWORD, r_longlong(0x10000000))
FILE_SHARE_READ = rffi.cast(DWORD, r_longlong(0x00000001))
FILE_SHARE_WRITE = rffi.cast(DWORD, r_longlong(0x00000002))
+ ALL_READ_WRITE = rffi.cast(DWORD, r_longlong(0xC0000003))
+ SHARE_READ_WRITE = rffi.cast(DWORD, r_longlong(0x00000003))
PFILETIME = rffi.CArrayPtr(FILETIME)