Mercurial > hgrepos > FreeBSD > ports > PyPy
comparison files/patch-rpython_rlib_rposix.py @ 111:cf8f8a3eea6b
Allow to build PyPy3 v7.3.14 on FreeBSD 13.2.
BUGS: Only Python 7.3.9 is currently implemented fully. Python 7.3.10 is only
begun partly.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 08 Jan 2024 09:37:21 +0100 |
| parents | ffca34182746 |
| children |
comparison
equal
deleted
inserted
replaced
| 110:3fa87db3a1a2 | 111:cf8f8a3eea6b |
|---|---|
| 1 --- rpython/rlib/rposix.py.orig 2022-12-29 08:05:46 UTC | 1 --- rpython/rlib/rposix.py.orig 2023-12-24 19:15:32 UTC |
| 2 +++ rpython/rlib/rposix.py | 2 +++ rpython/rlib/rposix.py |
| 3 @@ -3014,6 +3014,30 @@ if sys.platform.startswith('linux'): | 3 @@ -214,6 +214,8 @@ else: |
| 4 includes.append('sys/sysmacros.h') | |
| 5 if sys.platform.startswith('freebsd') or sys.platform.startswith('openbsd'): | |
| 6 includes.append('sys/ttycom.h') | |
| 7 + if sys.platform.startswith('freebsd') or sys.platform.startswith('openbsd'): | |
| 8 + includes.append('termios.h') | |
| 9 libraries = ['util'] | |
| 10 | |
| 11 eci = ExternalCompilationInfo( | |
| 12 @@ -3057,6 +3059,30 @@ if sys.platform.startswith('linux'): | |
| 13 """Passes offset==NULL; not support on all OSes""" | |
| 4 res = c_sendfile(out_fd, in_fd, lltype.nullptr(_OFF_PTR_T.TO), count) | 14 res = c_sendfile(out_fd, in_fd, lltype.nullptr(_OFF_PTR_T.TO), count) |
| 5 return handle_posix_error('sendfile', res) | 15 return handle_posix_error('sendfile', res) |
| 6 | 16 + |
| 7 +elif sys.platform.startswith('freebsd'): | 17 +elif sys.platform.startswith('freebsd'): |
| 8 + # FreeBSD | 18 + # FreeBSD |
| 9 + # | 19 + # |
| 10 + # Please note that the implementation below is partial; | 20 + # Please note that the implementation below is partial; |
| 11 + # the VOIDP is an iovec for sending headers and trailers which | 21 + # the VOIDP is an iovec for sending headers and trailers which |
| 25 + res = c_sendfile(in_fd, out_fd, offset, count, lltype.nullptr(rffi.VOIDP.TO), sbytes, 0) | 35 + res = c_sendfile(in_fd, out_fd, offset, count, lltype.nullptr(rffi.VOIDP.TO), sbytes, 0) |
| 26 + if res != 0: | 36 + if res != 0: |
| 27 + return handle_posix_error('sendfile', res) | 37 + return handle_posix_error('sendfile', res) |
| 28 + res = sbytes[0] | 38 + res = sbytes[0] |
| 29 + return res | 39 + return res |
| 30 + | 40 |
| 31 elif not _WIN32: | 41 elif not _WIN32: |
| 32 # Neither on Windows nor on Linux, so probably a BSD derivative of | 42 # Neither on Windows nor on Linux, so probably a BSD derivative of |
| 33 # some sort. Please note that the implementation below is partial; |
