Support for Compilation on Solaris

This is based on patch at:

http://node3.rnode.ru/glusterfs-3.0.0-p1.patch

Thanks to Petrunin Egor <shellcode@mail.ru> for this patch.

Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>

BUG: 481 (Fix compilation failures in Solaris)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=481
This commit is contained in:
Vijay Bellur 2009-12-18 12:38:04 +00:00 committed by Vijay Bellur
parent 2a51ab19e6
commit 96ae032a9c
6 changed files with 54 additions and 6 deletions

View File

@ -376,6 +376,8 @@ case $host_os in
GF_LDADD="${ARGP_STANDALONE_LDADD}"
GF_GLUSTERFS_LDFLAGS="-lnsl -lresolv -lsocket"
GF_BOOSTER_SUBDIR=""
BUILD_FUSE_CLIENT=no
FUSE_CLIENT_SUBDIR=""
;;
*bsd*)
GF_HOST_OS="GF_BSD_HOST_OS"

View File

@ -928,7 +928,7 @@ cleanup_and_exit (int signum)
gf_log ("glusterfs", GF_LOG_WARNING, "shutting down");
if (ctx->pidfp) {
flock (fileno (ctx->pidfp), LOCK_UN);
lockf (fileno (ctx->pidfp), F_ULOCK, 0);
fclose (ctx->pidfp);
ctx->pidfp = NULL;
}
@ -1201,7 +1201,8 @@ main (int argc, char *argv[])
#ifdef DEBUG
mtrace ();
#endif
signal (SIGUSR1, (sighandler_t) gf_proc_dump_info);
signal (SIGUSR1, gf_proc_dump_info);
signal (SIGSEGV, gf_print_trace);
signal (SIGABRT, gf_print_trace);
signal (SIGPIPE, SIG_IGN);
@ -1285,8 +1286,8 @@ main (int argc, char *argv[])
/* do cleanup and exit ?! */
return -1;
}
ret = flock (fileno (ctx->pidfp),
(LOCK_EX | LOCK_NB));
ret = lockf (fileno (ctx->pidfp),
(F_LOCK | F_TLOCK), 0);
if (ret == -1) {
gf_log ("glusterfs", GF_LOG_ERROR,
"Is another instance of %s running?",
@ -1305,7 +1306,7 @@ main (int argc, char *argv[])
"unable to truncate file %s. %s.",
cmd_args->pid_file,
strerror (errno));
flock (fileno (ctx->pidfp), LOCK_UN);
lockf (fileno (ctx->pidfp), F_ULOCK, 0);
fclose (ctx->pidfp);
if (write (pipe_fd[1], &gf_failure,
sizeof (int)) < 0) {

View File

@ -218,7 +218,49 @@ enum {
#define lutimes(filename,times) utimes(filename,times)
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
enum {
DT_UNKNOWN = 0,
# define DT_UNKNOWN DT_UNKNOWN
DT_FIFO = 1,
# define DT_FIFO DT_FIFO
DT_CHR = 2,
# define DT_CHR DT_CHR
DT_DIR = 4,
# define DT_DIR DT_DIR
DT_BLK = 6,
# define DT_BLK DT_BLK
DT_REG = 8,
# define DT_REG DT_REG
DT_LNK = 10,
# define DT_LNK DT_LNK
DT_SOCK = 12,
# define DT_SOCK DT_SOCK
DT_WHT = 14
# define DT_WHT DT_WHT
};
#ifndef _PATH_MOUNTED
#define _PATH_MOUNTED "/etc/mtab"
#endif
#ifndef O_ASYNC
#ifdef FASYNC
#define O_ASYNC FASYNC
#else
#define O_ASYNC 0
#endif
#endif
#ifndef FTW_CONTINUE
#define FTW_CONTINUE 0
#endif
int asprintf(char **string_ptr, const char *format, ...);
char* strsep(char** str, const char* delims);
int solaris_listxattr(const char *path, char *list, size_t size);
int solaris_removexattr(const char *path, const char* key);

View File

@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#define GF_PRI_FSBLK PRId64
#define GF_PRI_BLKSIZE "ld"

View File

@ -4,7 +4,7 @@ libglusterfsclient_HEADERS = libglusterfsclient.h
libglusterfsclientdir = $(includedir)
libglusterfsclient_la_SOURCES = libglusterfsclient.c libglusterfsclient-dentry.c
libglusterfsclient_la_CFLAGS = -fPIC -Wall -pthread
libglusterfsclient_la_CFLAGS = -fPIC -Wall
libglusterfsclient_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la
libglusterfsclient_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D$(GF_HOST_OS) -D__USE_FILE_OFFSET64 -D_GNU_SOURCE -I$(top_srcdir)/libglusterfs/src -DDATADIR=\"$(localstatedir)\" -DCONFDIR=\"$(sysconfdir)/glusterfs\" $(GF_CFLAGS)
libglusterfsclient_la_LDFLAGS = -shared -nostartfiles

View File

@ -44,7 +44,9 @@
#include "libglusterfsclient-internals.h"
#include "compat.h"
#include "compat-errno.h"
#ifndef GF_SOLARIS_HOST_OS
#include <sys/vfs.h>
#endif
#include <utime.h>
#include <sys/param.h>
#include <list.h>