Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/lmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ mdb_sem_wait(sem_t *sem)
* Otherwise compile with the less efficient -DMDB_DSYNC=O_SYNC.
*/
#ifndef MDB_DSYNC
#ifdef O_DSYNC
# define MDB_DSYNC O_DSYNC
#else
# define MDB_DSYNC O_SYNC
#endif
#endif
#endif

Expand Down
1 change: 1 addition & 0 deletions src/server/command_list.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <arpa/inet.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include "nanomsg/nn.h"
#include "snappy.h"
Expand Down
22 changes: 22 additions & 0 deletions src/server/self_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,26 @@ const char *get_self_path() {
return (path);
}

#elif defined __FreeBSD__

# include <sys/types.h>
# include <sys/sysctl.h>
# include <limits.h>

const char *get_self_path() {
static char path[PATH_MAX] = { '\0' };

if ( path[0] == '\0' ) {
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
size_t size = sizeof(path);
char *pt;

sysctl(mib, sizeof(mib)/sizeof(*mib), path, &size, NULL, 0);
if ((pt = strrchr(path, '/')) != NULL)
*pt = '\0';
return path;
}
return path;
}

#endif
2 changes: 2 additions & 0 deletions src/server/server.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#ifdef __linux__
#include <linux/limits.h>
#endif
#include <unistd.h>
#include <netdb.h>
#include <netinet/in.h>
Expand Down