From 5640683c67c325d9c93fe1efadd44b5c696b0d1e Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Sun, 28 Oct 2007 23:04:25 -0400 Subject: works on mac --- db/makefile | 3 ++- util/mmap.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/db/makefile b/db/makefile index 4d2d74ed9e8..30204890403 100644 --- a/db/makefile +++ b/db/makefile @@ -1,6 +1,7 @@ # makefile for our db project -FLAGS=-I .. -I/opt/java/include/ -I/opt/java/include/linux -Isrc/p -I/src/p/db +FLAGS=-I .. -I/opt/java/include/ -I/opt/java/include/linux -Isrc/p -I/src/p/db -I/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers/ + OBJS=../stdafx.o ../util/sock.o ../grid/message.o ../util/mmap.o pdfile.o query.o jsobj.o diff --git a/util/mmap.cpp b/util/mmap.cpp index 5151ea2ad00..b8a8b81ccf0 100644 --- a/util/mmap.cpp +++ b/util/mmap.cpp @@ -79,10 +79,14 @@ MemoryMappedFile::~MemoryMappedFile() { fd = 0; } +#ifndef O_NOATIME +#define O_NOATIME 0 +#endif + void* MemoryMappedFile::map(const char *filename, int length) { len = length; - fd = open(filename, O_CREAT | O_RDWR | O_NOATIME, S_IRUSR | S_IWUSR); + fd = open(filename, O_CREAT | O_RDWR | O_NOATIME, S_IRUSR | S_IWUSR); if( !fd ) { cout << "couldn't open " << filename << ' ' << errno << endl; return 0; -- cgit v1.2.1