compate/clipped-write.c: large write(2) fails on Mac OS X/XNU
Due to a bug in the Darwin kernel, write(2) calls have a maximum size of INT_MAX bytes. Introduce a new compat function, clipped_write(), that only writes at most INT_MAX bytes and returns the number of bytes written, as a substitute for write(2), and allow platforms that need this to enable it from the build mechanism with NEEDS_CLIPPED_WRITE. Set it for Mac OS X by default. It may be necessary to include this function on Windows, too. Signed-off-by: NFilipe Cabecinhas <filcab+git@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
Showing
compat/clipped-write.c
0 → 100644
想要评论请 注册 或 登录