Skip to content

Commit 1ed756e

Browse files
paulofariaCodaFi
authored andcommitted
Add sendfile to Glibc
1 parent 580372b commit 1ed756e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

stdlib/public/Platform/glibc.modulemap.gyb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ module SwiftGlibc [system] {
351351
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/select.h"
352352
export *
353353
}
354+
module sendfile {
355+
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sendfile.h"
356+
export *
357+
}
354358
module socket {
355359
header "${GLIBC_ARCH_INCLUDE_PATH}/sys/socket.h"
356360
export *

validation-test/stdlib/Glibc.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ GlibcTestSuite.test("errno") {
2424
expectEqual(EBADF, errno)
2525
}
2626

27+
GlibcTestSuite.test("sendfile") {
28+
// Check that `sendfile` is available. Don't actually call it, because doing that is non-trivial.
29+
expectEqual(((Int32, Int32, UnsafeMutablePointer<off_t>!, ssize_t) -> ssize_t).self, type(of: sendfile))
30+
}
31+
2732
var GlibcIoctlConstants = TestSuite("GlibcIoctlConstants")
2833

2934
GlibcIoctlConstants.test("tty ioctl constants availability") {

0 commit comments

Comments
 (0)