|
Re: Custom file driver for OS X and Windows Re: CouchDB 0.9 and 1.0: msg#00098db.couchdb.devel
On Jul 2, 2008, at 19:01, Damien Katz wrote: So erlang still has some file driver troubles. The old issue of a 2gig limit is long gone, however two other issues remain: I'm not a C hacker and all but would this patch solve the issue on Darwin / Mac OS X? I worked solely off documentation: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fsync.2.html#/ /apple_ref/doc/man/2/fsync http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/fcntl.2.html The diff is against OTP R12B-3: --- erts/emulator/drivers/unix/unix_efile.c 2008-07-17 03:06:13.000000000 +0200 +++ erts/emulator/drivers/unix/unix_efile_new.c 2008-07-17 03:06:57.000000000 +0200 @@ -44,11 +44,20 @@ #endif #endif /* _OSE_ */ +#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) +#define DARWIN 1 +#endif + +#ifdef DARWIN +#include <fcntl.h> +#endif /* DARWIN */ + #ifdef VXWORKS #include <ioLib.h> #include <dosFsLib.h> #include <nfsLib.h> #include <sys/stat.h> + /* ** Not nice to include usrLib.h as MANY normal variable names get reported ** as shadowing globals, like 'i' for example. @@ -818,7 +827,11 @@ undefined fsync #endif /* VXWORKS */ #else +#ifdef DARWIN + return check_error(fcntl(fd, F_FULLFSYNC), errInfo); +#else /* all other unix systems */ return check_error(fsync(fd), errInfo); +#endif /* DARWIN */ #endif /* NO_FSYNC */ } If that looks okay, I'll forward it to the erlang-patches mailing list for inclusion. Cheers Jan -- |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Posting empty attachments: 00098, Jan Lehnardt |
|---|---|
| Next by Date: | [jira] Resolved: (COUCHDB-15) Error inserting attachment with empty data: 00098, Jan Lehnardt (JIRA) |
| Previous by Thread: | Re: Custom file driver for OS X and Windows Re: CouchDB 0.9 and 1.0i: 00098, Jan Lehnardt |
| Next by Thread: | Runtime Configuration - Re: CouchDB 0.9 and 1.0: 00098, Jan Lehnardt |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |