compat / clipped-write.con commit git-remote-mediawiki: factoring code between git-remote-mediawiki and Git::Mediawiki (192f7a0)
   1#include "../git-compat-util.h"
   2#undef write
   3
   4/*
   5 * Version of write that will write at most INT_MAX bytes.
   6 * Workaround a xnu bug on Mac OS X
   7 */
   8ssize_t clipped_write(int fildes, const void *buf, size_t nbyte)
   9{
  10        if (nbyte > INT_MAX)
  11                nbyte = INT_MAX;
  12        return write(fildes, buf, nbyte);
  13}