#cmakedefine01 HAVE_KQUEUE
#cmakedefine01 HAVE_SENDFILE_4
#cmakedefine01 HAVE_SENDFILE_6
+#cmakedefine01 HAVE_SENDFILE_7
#cmakedefine01 HAVE_CLONEFILE
#cmakedefine01 HAVE_GETNAMEINFO_SIGNED_FLAGS
#cmakedefine01 HAVE_GETPEEREID
*sent = 0;
return SystemNative_ConvertErrorPlatformToPal(errno);
-#elif HAVE_SENDFILE_6
+#elif HAVE_SENDFILE_6 || HAVE_SENDFILE_7
*sent = 0;
while (1) // in case we need to retry for an EINTR
{
off_t len = count;
+#if HAVE_SENDFILE_7
+ ssize_t res = sendfile(infd, outfd, (off_t)offset, (size_t)count, NULL, &len, 0);
+#else
ssize_t res = sendfile(infd, outfd, (off_t)offset, &len, NULL, 0);
+#endif
assert(len >= 0);
// If the call succeeded, store the number of bytes sent, and return. We add
"
HAVE_SENDFILE_6)
+check_c_source_compiles(
+ "
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/uio.h>
+ int main(void) { int i = sendfile(0, 0, 0, 0, NULL, NULL, 0); return 0; }
+ "
+ HAVE_SENDFILE_7)
+
check_symbol_exists(
clonefile
"sys/clonefile.h"
}
[Fact]
- [PlatformSpecific(~TestPlatforms.OSX)] // Not supported on OSX.
+ [PlatformSpecific(~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] // Not supported on BSD like OSes.
public async Task ConnectGetsCanceledByDispose()
{
bool usesApm = UsesApm ||
{
Assert.True(socket.DualMode);
}
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
+ {
+ // This is not valid check on FreeBSD.
+ // Accepted socket is never DualMode and cannot be changed.
+ }
else
{
Assert.True((listenOn != IPAddress.IPv6Any && !listenOn.IsIPv4MappedToIPv6) || socket.DualMode);
}
[Fact]
- [PlatformSpecific(~TestPlatforms.OSX)] // SendBufferSize, ReceiveBufferSize = 0 not supported on OSX.
+ [PlatformSpecific(~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] // SendBufferSize, ReceiveBufferSize = 0 not supported on BSD like stacks.
public async Task SendRecv_NoBuffering_Success()
{
if (UsesSync) return;
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // Skip on Nano: dotnet/corefx #29929
- [PlatformSpecific(~TestPlatforms.OSX)]
+ [PlatformSpecific(~(TestPlatforms.OSX | TestPlatforms.FreeBSD))]
public async Task MulticastInterface_Set_IPv6_AnyInterface_Succeeds()
{
if (PlatformDetection.IsRedHatFamily7)
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // In WSL, the connect() call fails immediately.
[InlineData(false)]
[InlineData(true)]
+ [PlatformSpecific(~TestPlatforms.FreeBSD)] // on FreeBSD Connect may or may not fail immediately based on timing.
public void FailedConnect_GetSocketOption_SocketOptionNameError(bool simpleGet)
{
using (var client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { Blocking = false })
}
}
- [PlatformSpecific(~TestPlatforms.OSX)] // macOS doesn't have an equivalent of DontFragment
+ [PlatformSpecific(~(TestPlatforms.OSX | TestPlatforms.FreeBSD))] // BSD like doesn't have an equivalent of DontFragment
[Fact]
public void DontFragment_Roundtrips()
{