AXTLS_DIR = axTLS
AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
NIXIO_TLS ?= openssl
-NIXIO_LDFLAGS = -lcrypt
NIXIO_SO = nixio.so
+NIXIO_LDFLAGS =
+
+ifeq (,$(findstring Darwin,$(OS)))
+ NIXIO_LDFLAGS += -lcrypt
+else
+ EXTRA_CFLAGS += -D__DARWIN__
+endif
NIXIO_OBJ = src/nixio.o src/socket.o src/sockopt.o src/bind.o src/address.o \
src/poll.o src/io.o src/file.o src/splice.o src/process.o src/syslog.o \
const off_t offset = lseek(infd, 0, SEEK_CUR);
do {
+#ifdef __DARWIN__
+ r = sendfile(infd, sock, offset, len, NULL, 0);
+#else
r = sendfile(infd, sock, offset, len, NULL, &spliced, 0);
+#endif
} while (r == -1 && errno == EINTR);
if (r == -1) {