mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 12:21:27 +08:00
Limit os.sendfile arguments based on platform (#10790)
This commit is contained in:
@@ -657,18 +657,20 @@ if sys.platform != "win32":
|
||||
RWF_SYNC: int
|
||||
RWF_HIPRI: int
|
||||
RWF_NOWAIT: int
|
||||
@overload
|
||||
def sendfile(out_fd: int, in_fd: int, offset: int | None, count: int) -> int: ...
|
||||
@overload
|
||||
def sendfile(
|
||||
out_fd: int,
|
||||
in_fd: int,
|
||||
offset: int,
|
||||
count: int,
|
||||
headers: Sequence[ReadableBuffer] = ...,
|
||||
trailers: Sequence[ReadableBuffer] = ...,
|
||||
flags: int = 0,
|
||||
) -> int: ... # FreeBSD and Mac OS X only
|
||||
|
||||
if sys.platform == "linux":
|
||||
def sendfile(out_fd: FileDescriptor, in_fd: FileDescriptor, offset: int | None, count: int) -> int: ...
|
||||
else:
|
||||
def sendfile(
|
||||
out_fd: FileDescriptor,
|
||||
in_fd: FileDescriptor,
|
||||
offset: int,
|
||||
count: int,
|
||||
headers: Sequence[ReadableBuffer] = ...,
|
||||
trailers: Sequence[ReadableBuffer] = ...,
|
||||
flags: int = 0,
|
||||
) -> int: ... # FreeBSD and Mac OS X only
|
||||
|
||||
def readv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer]) -> int: ...
|
||||
def writev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer]) -> int: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user