Is zero copy principle supported in Mac

598 views Asked by At

Hi Trying to understand the zero copy principle. Wikipedia says

Several operating systems support zero-copying of files through specific APIs.

The Linux kernel supports zero-copy through various system calls, such as sys/socket.h's sendfile, sendfile64, and splice. Some of them are specified in POSIX and thus also present in the BSD kernels or IBM AIX, some are unique to the Linux kernel API.

Microsoft Windows supports zero-copy through the TransmitFile API.

Java input streams can support zero-copy through the java.nio.channels.FileChannel's transferTo() method if the underlying operating system also supports zero copy.[4]

I dont see any mention of OSX though It says present in BSD kernels.

But http://www.bigfastblog.com/zero-copy-transfer-data-faster-in-ruby blog says its not supported in OSX.

1

There are 1 answers

0
missimer On

There is a man page for sendfile for OS X. While it makes no reference to zero copy, it does refer to sendfile as a system call (as oppose to some wrapper around open/read/write/close) so I think it is pretty safe to assume that it doesn't involve copying a file to user-space.