diff -ur ./omi-1.0.8/base/user.c ./omi-1.0.8-mod/base/user.c --- ./omi-1.0.8/base/user.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/base/user.c 2014-06-21 01:16:35.000000000 +0530 @@ -507,6 +507,7 @@ int GetUIDByConnection(int fd, uid_t* uid, gid_t* gid) { #if defined(CONFIG_OS_LINUX) || defined(CONFIG_OS_BSD) +#if 0 struct ucred credentials; socklen_t ucred_size = (socklen_t)sizeof(credentials); @@ -522,7 +523,7 @@ /* the effective primary GID of the process on the other side of the socket */ *gid = credentials.gid; - +#endif return 0; #else diff -ur ./omi-1.0.8/buildtool ./omi-1.0.8-mod/buildtool --- ./omi-1.0.8/buildtool 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/buildtool 2014-06-21 01:27:12.000000000 +0530 @@ -241,6 +241,12 @@ arch=IX86 compiler=GNU ;; + + i386:NetBSD:*:*) + os=NETBSD + arch=IX86 + compiler=GNU + ;; *) echo "$0: error: unsupported platform: $__m:$__s:$__r:$__v" exit 1 @@ -309,7 +315,7 @@ os=LINUX ;; NETBSD*) - os=BSD + os=NETBSD ;; esac @@ -511,7 +517,7 @@ echo 586-gcc ;; NETBSD_IX86_GNU) - echo netbsd-gcc + echo gcc ;; SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO) echo cc @@ -552,7 +558,7 @@ echo 586-g++ ;; NETBSD_IX86_GNU) - echo netbsd-g++ + echo g++ ;; SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO) echo CC @@ -591,7 +597,7 @@ echo 586-ar ;; NETBSD_IX86_GNU) - echo netbsd-ar + echo ar ;; *) echo ar @@ -665,11 +671,15 @@ test -n "$pic_opt" && r="$r -fPIC" test -n "$errwarn_opt" && r="$r -Werror" r="$r -Wall" - r="$r -fvisibility=hidden" + #r="$r -fvisibility=hidden" r="$r -fno-strict-aliasing" r="$r -D_GNU_SOURCE" r="$r -D_XOPEN_SOURCE=600" - r="$r -D_BSD_SOURCE" + #r="$r -D_BSD_SOURCE" + r="$r -D_NETBSD_SOURCE" + r="$r -DPAL_HAVE_PTHREADS" + r="$r -DPAL_HAVE_POSIX" + r="$r -DPAL_NO_ALLOCA" #test -n "$cxx_opt" && r="$r -fno-exceptions" #test -n "$cxx_opt" && r="$r -fno-enforce-eh-specs" @@ -1079,7 +1089,7 @@ r="-lpthread -ldl -lpam" ;; NETBSD_IX86_GNU) - r="-lpthread -ldl -lpam" + r="-lpthread -lpam " ;; SUNOS_I86PC_SUNPRO|SUNOS_SPARC_SUNPRO) r="-lpthread -lsocket -lnsl -ldl -lpam" diff -ur ./omi-1.0.8/cli/GNUmakefile ./omi-1.0.8-mod/cli/GNUmakefile --- ./omi-1.0.8/cli/GNUmakefile 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/cli/GNUmakefile 2014-06-13 21:57:16.000000000 +0530 @@ -9,7 +9,7 @@ DEFINES = HOOK_BUILD MI_CONST= DETECT_FORBIDDEN_FUNCTIONS -LIBRARIES = miapi protocol sock wql base $(PALLIBS) omi_error wsman xmlserializer base +LIBRARIES = miapi protocol sock wql base nitspal $(PALLIBS) omi_error wsman xmlserializer base include $(TOP)/mak/rules.mak diff -ur ./omi-1.0.8/configure ./omi-1.0.8-mod/configure --- ./omi-1.0.8/configure 2014-04-02 12:31:43.000000000 +0530 +++ ./omi-1.0.8-mod/configure 2014-05-14 14:44:49.000000000 +0530 @@ -2077,6 +2077,9 @@ echo "pam script is not supported on Mac-OS yet" touch $fn.tmp ;; + NetBSD) + cp $root/scripts/installpam-nbsd $fn.tmp + ;; *) echo "Unknown" exit 1 diff -ur ./omi-1.0.8/gen/GNUmakefile ./omi-1.0.8-mod/gen/GNUmakefile --- ./omi-1.0.8/gen/GNUmakefile 2014-04-02 12:31:43.000000000 +0530 +++ ./omi-1.0.8-mod/gen/GNUmakefile 2014-06-13 21:54:03.000000000 +0530 @@ -13,6 +13,6 @@ DEFINES = MI_CONST= HOOK_BUILD -LIBRARIES = mof base $(PALLIBS) +LIBRARIES = mof base nitspal $(PALLIBS) include $(TOP)/mak/rules.mak diff -ur ./omi-1.0.8/nits/linkageSample/debug_build/linkageSample.c ./omi-1.0.8-mod/nits/linkageSample/debug_build/linkageSample.c --- ./omi-1.0.8/nits/linkageSample/debug_build/linkageSample.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/nits/linkageSample/debug_build/linkageSample.c 2014-06-11 22:51:35.000000000 +0530 @@ -44,8 +44,8 @@ PAL_Uint32 dummy; Sleep_Milliseconds(1000); NitsTrace(PAL_T("Foo running\n")); - Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); - Thread_Join(&mythread, &dummy); + //Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); + //Thread_Join(&mythread, &dummy); } int PAL_CDECLAPI main() diff -ur ./omi-1.0.8/nits/linkageSample/default_linkage/linkageSample.c ./omi-1.0.8-mod/nits/linkageSample/default_linkage/linkageSample.c --- ./omi-1.0.8/nits/linkageSample/default_linkage/linkageSample.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/nits/linkageSample/default_linkage/linkageSample.c 2014-06-11 22:52:19.000000000 +0530 @@ -44,8 +44,8 @@ PAL_Uint32 dummy; Sleep_Milliseconds(1000); NitsTrace(PAL_T("Foo running\n")); - Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); - Thread_Join(&mythread, &dummy); + //Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); + //Thread_Join(&mythread, &dummy); } int PAL_CDECLAPI main() diff -ur ./omi-1.0.8/nits/linkageSample/hook_build/linkageSample.c ./omi-1.0.8-mod/nits/linkageSample/hook_build/linkageSample.c --- ./omi-1.0.8/nits/linkageSample/hook_build/linkageSample.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/nits/linkageSample/hook_build/linkageSample.c 2014-06-13 20:49:13.000000000 +0530 @@ -44,8 +44,8 @@ PAL_Uint32 dummy; Sleep_Milliseconds(1000); NitsTrace(PAL_T("Foo running\n")); - Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); - Thread_Join(&mythread, &dummy); + //Thread_CreateJoinable_Injected(&mythread, MyThreadProc, NULL, NULL, NitsHere()); + //Thread_Join(&mythread, &dummy); } int PAL_CDECLAPI main() diff -ur ./omi-1.0.8/nits/nits/nits.cpp ./omi-1.0.8-mod/nits/nits/nits.cpp --- ./omi-1.0.8/nits/nits/nits.cpp 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/nits/nits/nits.cpp 2014-06-11 22:36:10.000000000 +0530 @@ -44,7 +44,7 @@ static void PrintUsage() { - Tprintf( PAL_T("NITS Integrated Test System\n") + /*Tprintf( PAL_T("NITS Integrated Test System\n") PAL_T("------------------------------------------\n\n") PAL_T("Usage: nits [option|test]*\n") PAL_T("\nV2 Options:\n") @@ -128,7 +128,8 @@ PAL_T("\tKilled: \tIsolation mode: the test was killed.\n") PAL_T("\t\t\tNOTE: Killed tests may fail to clean up properly.\n") PAL_T("\tFailed: \tTest assertions failed while running the test.\n") - PAL_T("\tError: \tSetup/cleanup failed, or no asserts were attempted.\n")); + PAL_T("\tError: \tSetup/cleanup failed, or no asserts were attempted.\n") + );*/ } int CDECLAPI main(int argc, _In_reads_(argc) char *argv[]) diff -ur ./omi-1.0.8/oi/gen_c/cmdline/GNUmakefile ./omi-1.0.8-mod/oi/gen_c/cmdline/GNUmakefile --- ./omi-1.0.8/oi/gen_c/cmdline/GNUmakefile 2014-04-02 12:31:43.000000000 +0530 +++ ./omi-1.0.8-mod/oi/gen_c/cmdline/GNUmakefile 2014-06-13 21:51:16.000000000 +0530 @@ -18,7 +18,7 @@ INCLUDES = $(TOP) $(TOP)/common $(TOP)/oi/gen_c/common -LIBRARIES = oicommon $(PALLIBS) +LIBRARIES = oicommon nitspal $(PALLIBS) ARGUMENTS=-i diff -ur ./omi-1.0.8/omireg/GNUmakefile ./omi-1.0.8-mod/omireg/GNUmakefile --- ./omi-1.0.8/omireg/GNUmakefile 2014-04-02 12:31:43.000000000 +0530 +++ ./omi-1.0.8-mod/omireg/GNUmakefile 2014-06-14 01:46:59.000000000 +0530 @@ -9,6 +9,6 @@ DEFINES = MI_CONST= DETECT_FORBIDDEN_FUNCTIONS HOOK_BUILD -LIBRARIES = omiclient micxx omi_error wsman xml xmlserializer $(BASELIBS) $(PALLIBS) +LIBRARIES = omiclient micxx omi_error wsman xml xmlserializer $(BASELIBS) nitspal $(PALLIBS) include $(TOP)/mak/rules.mak diff -ur ./omi-1.0.8/pal/memory.h ./omi-1.0.8-mod/pal/memory.h --- ./omi-1.0.8/pal/memory.h 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/memory.h 2014-06-14 01:47:39.000000000 +0530 @@ -55,9 +55,10 @@ size_t size, NitsCallSite cs) { +#if 0 if (NitsShouldFault(cs, NitsAutomatic)) return NULL; - +#endif return SystemCalloc(num, size); } diff -ur ./omi-1.0.8/pal/shlib.c ./omi-1.0.8-mod/pal/shlib.c --- ./omi-1.0.8/pal/shlib.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/shlib.c 2014-06-14 01:45:28.000000000 +0530 @@ -30,7 +30,7 @@ _In_z_ const PAL_Char* path, NitsCallSite cs) { - if (NitsShouldFault(cs, NitsAutomatic)) + if (0/*NitsShouldFault(cs, NitsAutomatic)*/) { #if defined(_MSC_VER) /* Caller may call Shlib_Err(). */ diff -ur ./omi-1.0.8/pal/shmem.c ./omi-1.0.8-mod/pal/shmem.c --- ./omi-1.0.8/pal/shmem.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/shmem.c 2014-06-11 21:53:26.000000000 +0530 @@ -107,7 +107,8 @@ /* Open the shared memory segment */ - if ((self->shmid = shm_open(self->shmname, oflag, S_IRUSR | S_IWUSR)) == -1) + //if ((self->shmid = shm_open(self->shmname, oflag, S_IRUSR | S_IWUSR)) == -1) + if (1) { return -1; } @@ -115,7 +116,7 @@ if (ftruncate(self->shmid, size) != 0) { close(self->shmid); - shm_unlink(self->shmname); + //shm_unlink(self->shmname); return -1; } diff -ur ./omi-1.0.8/pal/shmem.h ./omi-1.0.8-mod/pal/shmem.h --- ./omi-1.0.8/pal/shmem.h 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/shmem.h 2014-06-11 21:46:03.000000000 +0530 @@ -81,7 +81,7 @@ int status; status = close(self->shmid) == 0 ? 0 : -1; - shm_unlink(self->shmname); + //shm_unlink(self->shmname); return status; #endif } diff -ur ./omi-1.0.8/pal/thread.c ./omi-1.0.8-mod/pal/thread.c --- ./omi-1.0.8/pal/thread.c 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/thread.c 2014-06-14 01:46:00.000000000 +0530 @@ -254,9 +254,11 @@ int r; #if !defined(USE_ALLOCATOR) +#if 0 if (NitsShouldFault(cs, NitsAutomatic)) return -1; #endif +#endif /* Create the thread attributes and set the detached flag */ @@ -305,9 +307,11 @@ int r; #if !defined(USE_ALLOCATOR) +#if 0 if (NitsShouldFault(cs, NitsAutomatic)) return -1; #endif +#endif /* Create the thread */ { diff -ur ./omi-1.0.8/pal/thread.h ./omi-1.0.8-mod/pal/thread.h --- ./omi-1.0.8/pal/thread.h 2014-04-02 12:31:44.000000000 +0530 +++ ./omi-1.0.8-mod/pal/thread.h 2014-06-11 21:50:14.000000000 +0530 @@ -138,7 +138,7 @@ // Avoid using a cast here since pthread_self() may return a structure. // If so, we need to discover that and provide an alternative for that // platform. - return pthread_self(); + return (PAL_Uint64)pthread_self(); #endif } Only in ./omi-1.0.8-mod/scripts: installpam-nbsd