INSTALL_SCRIPT = @INSTALL_SCRIPT@
ENABLE_KERNEL_MODULE=@ENABLE_KERNEL_MODULE@
+ENABLE_PTHREADED_UBIK=@ENABLE_PTHREADED_UBIK@
# To compile AFS from scratch in the src tree run "make".
# This recursively calls "make install ..." and does not depend on the
ubik: cmd comerr auth ubik_depinstall
${COMPILE_PART1} ubik ${COMPILE_PART2}
+tubik: ubik libafsrpc
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
+ ${COMPILE_PART1} tubik ${COMPILE_PART2} ;; \
+ *_darwin_[1-6][0-9]) \
+ echo Not building MT ubik for ${SYS_NAME} ;; \
+ *_darwin_*) \
+ ${COMPILE_PART1} tubik ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT ubik for ${SYS_NAME} ;; \
+ esac
+
ubiktests: ubik
ptserver: cmd comerr ubik cmd comerr auth audit ptserver_depinstall
${COMPILE_PART1} ptserver ${COMPILE_PART2}
+tptserver: cmd comerr ptserver tubik libafsrpc libafsauthent
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
+ ${COMPILE_PART1} tptserver ${COMPILE_PART2} ;; \
+ *_darwin_[1-6][0-9]) \
+ echo Not building MT ptserver for ${SYS_NAME} ;; \
+ *_darwin_*) \
+ ${COMPILE_PART1} tptserver ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT ptserver for ${SYS_NAME} ;; \
+ esac
+
kauth: cmd comerr ubik cmd auth comerr ptserver audit libacl kauth_depinstall
${COMPILE_PART1} kauth ${COMPILE_PART2}
vlserver: cmd comerr vol audit vlserver_depinstall
${COMPILE_PART1} vlserver ${COMPILE_PART2}
-viced: cmd comerr vlserver audit
+tvlserver: cmd comerr vol audit tubik libafsrpc libafsauthent tvlserver_depinstall
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
+ ${COMPILE_PART1} tvlserver ${COMPILE_PART2} ;; \
+ *_darwin_[1-6][0-9]) \
+ echo Not building MT tvlserver for ${SYS_NAME} ;; \
+ *_darwin_*) \
+ ${COMPILE_PART1} tvlserver ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT tvlserver for ${SYS_NAME} ;; \
+ esac
+
+
+viced: cmd comerr vlserver tvlserver audit
${COMPILE_PART1} viced ${COMPILE_PART2}
-tviced: cmd comerr viced vlserver libafsrpc libafsauthent
+tviced: cmd comerr viced vlserver tvlserver libafsrpc libafsauthent
case ${SYS_NAME} in \
alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \
vlserver_depinstall: config rxgen ubik_depinstall auth_depinstall
${COMPILE_PART1} vlserver ${COMPILE_DEPINSTALL}
+tvlserver_depinstall: pinstall rxgen ubik_depinstall auth_depinstall
+ ${COMPILE_PART1} tvlserver ${COMPILE_DEPINSTALL}
+
auth_depinstall: config comerr
${COMPILE_PART1} auth ${COMPILE_DEPINSTALL}
libafs_setup: config export
src/config/config src/libafs/MakefileProto.${MKAFS_OSTYPE} src/libafs/Makefile ${SYS_NAME}
-libafs: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \
+libafs: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall tvlserver_depinstall rxkad_depinstall fsint_depinstall \
libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall
${COMPILE_PART1} libafs ${COMPILE_PART2}
-libafs_tree: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall rxkad_depinstall fsint_depinstall \
+libafs_tree: libafs_setup lwp_depinstall rx_depinstall vlserver_depinstall tvlserver_depinstall rxkad_depinstall fsint_depinstall \
libacl_depinstall afs_depinstall dir_depinstall rxstat_depinstall sys_depinstall
${TOP_SRCDIR}/config/make_libafs_tree.pl \
-sn $(SYS_NAME) \
libuafs_setup: config export
src/config/config src/libuafs/MakefileProto.${MKAFS_OSTYPE} src/libuafs/Makefile ${SYS_NAME}
-libuafs: libuafs_setup vlserver_depinstall rx_depinstall fsint_depinstall \
+libuafs: libuafs_setup vlserver_depinstall tvlserver_depinstall rx_depinstall fsint_depinstall \
auth_depinstall dir_depinstall libacl_depinstall rxkad_depinstall \
ubik_depinstall afs_depinstall kauth_depinstall ptserver_depinstall \
rxstat_depinstall lwp_depinstall sys_depinstall des
budb: cmd comerr bubasics uss
${COMPILE_PART1} budb ${COMPILE_PART2}
+tbudb: budb
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun*_5*|rs_aix*|*linux*|hp_ux11*|ia64_hpux*|*[of]bsd*|*nbsd[234]*) \
+ ${COMPILE_PART1} tbudb ${COMPILE_PART2} ;; \
+ *_darwin_[1-6][0-9]) \
+ echo Not building MT budb for ${SYS_NAME} ;; \
+ *_darwin_*) \
+ ${COMPILE_PART1} tbudb ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT budb for ${SYS_NAME} ;; \
+ esac
+
bucoord: cmd comerr bubasics budb volser
${COMPILE_PART1} bucoord ${COMPILE_PART2}
jafsadm: libjafsadm
-finale: project cmd comerr afsd butc tbutc @ENABLE_KERNEL_MODULE@ libuafs audit kauth log \
- ptserver scout bu_utils ubik uss bozo vfsck volser tvolser tsalvaged \
+finale: project cmd comerr afsd butc tbutc tbudb @ENABLE_KERNEL_MODULE@ libuafs audit kauth log \
+ ptserver tptserver scout bu_utils ubik uss bozo vfsck volser tvolser tsalvaged \
venus update xstat afsmonitor rxdebug libafsrpc \
libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
platform kopenafs
${COMPILE_PART1} finale ${COMPILE_PART2}
-finale_nolibafs: project cmd comerr afsd butc tbutc libuafs audit kauth log \
- ptserver scout bu_utils ubik uss bozo vfsck volser tvolser tsalvaged \
+finale_nolibafs: project cmd comerr afsd butc tbutc tbudb libuafs audit kauth log \
+ ptserver tptserver scout bu_utils ubik tubik uss bozo vfsck volser tvolser tsalvaged \
venus update xstat afsmonitor rxdebug libafsrpc \
libafsauthent shlibafsrpc shlibafsauthent libadmin man-pages \
platform kopenafs
-${COMPILE_PART1} rxkad ${COMPILE_CLEAN}
-${COMPILE_PART1} auth ${COMPILE_CLEAN}
-${COMPILE_PART1} ubik ${COMPILE_CLEAN}
+ -${COMPILE_PART1} tubik ${COMPILE_CLEAN}
-${COMPILE_PART1} ptserver ${COMPILE_CLEAN}
+ -${COMPILE_PART1} tptserver ${COMPILE_CLEAN}
-${COMPILE_PART1} kauth ${COMPILE_CLEAN}
-${COMPILE_PART1} libacl ${COMPILE_CLEAN}
-${COMPILE_PART1} dir ${COMPILE_CLEAN}
-${COMPILE_PART1} vol ${COMPILE_CLEAN}
-${COMPILE_PART1} vlserver ${COMPILE_CLEAN}
+ -${COMPILE_PART1} tvlserver ${COMPILE_CLEAN}
-${COMPILE_PART1} viced ${COMPILE_CLEAN}
-${COMPILE_PART1} tviced ${COMPILE_CLEAN}
-${COMPILE_PART1} volser ${COMPILE_CLEAN}
-${COMPILE_PART1} butc ${COMPILE_CLEAN}
-${COMPILE_PART1} tbutc ${COMPILE_CLEAN}
-${COMPILE_PART1} budb ${COMPILE_CLEAN}
+ -${COMPILE_PART1} tbudb ${COMPILE_CLEAN}
-${COMPILE_PART1} bucoord ${COMPILE_CLEAN}
-${COMPILE_PART1} xstat ${COMPILE_CLEAN}
-${COMPILE_PART1} afsmonitor ${COMPILE_CLEAN}
src/bubasics/Makefile \
src/bucoord/Makefile \
src/budb/Makefile \
+ src/tbudb/Makefile \
src/butc/Makefile \
src/butm/Makefile \
src/cmd/test/Makefile \
src/procmgmt/Makefile \
src/procmgmt/test/Makefile \
src/ptserver/Makefile \
+ src/tptserver/Makefile \
src/rx/Makefile \
src/rx/bulk.example/Makefile \
src/rx/bulktest/Makefile \
src/tviced/Makefile \
src/tvolser/Makefile \
src/ubik/Makefile \
+ src/tubik/Makefile \
src/update/Makefile \
src/usd/test/Makefile \
src/usd/Makefile \
src/vfsck/Makefile \
src/viced/Makefile \
src/vlserver/Makefile \
+ src/tvlserver/Makefile \
src/vol/Makefile \
src/vol/test/Makefile \
src/volser/Makefile \
--- /dev/null
+NOTES FOR THE BETA VERSION OF PTHREADED UBIK
+
+This document describes how to build, and use, the new versions of ubik
+applications that have been modified to work with POSIX pthreads instead
+of LWP.
+
+Under the 'src' directory, contained herein, are 4 new directories that
+deal with pthreaded ubik applications. They are, as follows:
+
+* tubik - The pthreaded version of the ubik library.
+ This is built from the source in the 'ubik'
+ directory and, in its distributed form, contains
+ only a Makefile.in
+
+* tptserver - The pthreaded version of the ptserver program.
+ This is built from the source in the 'ptserver'
+ directory and, in its distributed form, contains
+ only a Makefile.in
+
+* tvlserver - The pthreaded version of the vlserver program.
+ This is built from the source in the 'vlserver'
+ directory and, in its distributed form, contains
+ only a Makefile.in
+
+* tbudb - The pthreaded version of the buserver program.
+ This is built from the source in the 'budb'
+ directory and, in its distributed form, contains
+ only a Makefile.in
+
+By default, all of these are built when doing a configure / make of
+the OpenAFS package.
+
+A new option has been added to the 'configure' script to control the
+packaging and installation of these new pthreaded ubik applications.
+
+When the '--enable-pthreaded-ubik' option (off by default) is specified,
+these components will be installed into the dest tree when a 'make dest'
+is run.
+
+If you DO NOT use this option at 'configure' time, you can still utilize
+these new binaries as follows:
+
+Assuming that you are using transarc paths in your configuration, you
+should copy
+
+ ./src/tptserver/ptserver to /usr/afs/bin/ptserver
+ ./src/tvlserver/vlserver to /usr/afs/bin/vlserver
+ ./src/tbudb/budb_server to /usr/afs/bin/buserver
+
+after a successful build and install.
+
AC_ARG_ENABLE(warnings,
[ --enable-warnings enable compilation warnings when building with gcc (defaults to disabled)],, enable_warnings="no"
)
+AC_ARG_ENABLE(pthreaded-ubik,
+[ --enable-pthreaded-ubik enable installation of pthreaded ubik applications (defaults to disabled)],, enable_pthreaded_ubik="no"
+)
enable_login="no"
ENABLE_KERNEL_MODULE=libafs
fi
+if test "x$enable_pthreaded_ubik" = "xyes"; then
+ENABLE_PTHREADED_UBIK=yes
+fi
+
AC_SUBST(AFS_SYSNAME)
AC_SUBST(AFS_PARAM_COMMON)
AC_SUBST(ENABLE_KERNEL_MODULE)
+AC_SUBST(ENABLE_PTHREADED_UBIK)
AC_SUBST(LIB_AFSDB)
AC_SUBST(LINUX_KERNEL_PATH)
AC_SUBST(HOST_CPU)
src/bubasics/Makefile \
src/bucoord/Makefile \
src/budb/Makefile \
+src/tbudb/Makefile \
src/butc/Makefile \
src/butm/Makefile \
src/cmd/Makefile \
src/procmgmt/Makefile \
src/procmgmt/test/Makefile \
src/ptserver/Makefile \
+src/tptserver/Makefile \
src/rx/Makefile \
src/rx/bulk.example/Makefile \
src/rx/bulktest/Makefile \
src/tviced/Makefile \
src/tvolser/Makefile \
src/ubik/Makefile \
+src/tubik/Makefile \
src/update/Makefile \
src/usd/Makefile \
src/usd/test/Makefile \
src/vfsck/Makefile \
src/viced/Makefile \
src/vlserver/Makefile \
+src/tvlserver/Makefile \
src/vol/Makefile \
src/vol/test/Makefile \
src/volser/Makefile \
B<buserver> S<<< [B<-database> <I<database directory>>] >>>
S<<< [B<-cellservdb> <I<cell configuration directory>>] >>> [B<-resetdb>]
- [B<-noauth>] [B<-smallht>] [-servers <I<list of ubik database servers>>+]
- [B<-enable_peer_stats>] [-enable_process_stats] [B<-help>]
+ [B<-noauth>] [B<-smallht>] [B<-servers> <I<list of ubik database servers>>+]
+ [B<-enable_peer_stats>] [B<-enable_process_stats>] [B<-rxbind>]
+ [B<-p> <I<number of threads>>] [B<-help>]
=for html
</div>
other machines. To display or otherwise access the records, use the Rx
Monitoring API.
+=item B<-rxbind>
+
+Bind the Rx socket to the primary interface only. (If not specified, the
+Rx socket will listen on all interfaces.)
+
+=item B<-p> <I<number of threads>>
+
+Sets the number of server lightweight processes (LWPs or pthreads) to run.
+Provide a positive integer from the range 3 to 16. The default value is 3.
+
=item B<-help>
Prints the online help for this command. All other valid options are
=for html
<div class="synopsis">
-B<ptserver> S<<< [B<-database> <I<db path>>] >>> S<<< [B<-p> <I<number of processes>>] >>>
+B<ptserver> S<<< [B<-database> <I<db path>>] >>> S<<< [B<-p> <I<number of threads>>] >>>
[B<-rebuildDB>] [B<-enable_peer_stats>] [B<-enable_process_stats>]
- [B<-allow-dotted-principal>] [B<-help>]
+ [B<-allow-dotted-principal>] [B<-rxbind>] [B<-help>]
=for html
</div>
example, the appropriate value for the default database files is
F</usr/afs/db/prdb>.
-=item B<-p> <I<number of processes>>
+=item B<-p> <I<number of threads>>
-Sets the number of server lightweight processes (LWPs) to run. Provide a
-positive integer from the range C<3> to C<16>. The default value is C<3>.
+Sets the number of server lightweight processes (LWPs or pthreads) to run.
+Provide a positive integer from the range C<3> to C<16>. The default
+value is C<3>.
=item B<-rebuildDB>
between principal names may disable this check by starting the server
with this option.
+=item B<-rxbind>
+
+Bind the Rx socket to the primary interface only. (If not specified, the
+Rx socket will listen on all interfaces.)
+
=item B<-help>
Prints the online help for this command. All other valid options are
=for html
<div class="synopsis">
-B<vlserver> S<<< [B<-p> <I<lwp processes>>] >>> [B<-nojumbo>]
+B<vlserver> S<<< [B<-p> <I<number of threads>>] >>> [B<-nojumbo>] [B<-rxbind>]
[B<-allow-dotted-principal>] [B<-enable_peer_stats>] [B<-enable_process_stats>]
[B<-help>]
=over 4
-=item B<-p> <I<lwp processes>>
+=item B<-p> <I<number of threads>>
-Sets the number of server lightweight processes (LWPs) to run. Provide an
-integer between C<4> and C<16>. The default is C<9>.
+Sets the number of server lightweight processes (LWPs or pthreads) to run.
+Provide an integer between C<3> and C<16>. The default is C<9>.
=item B<-nojumbo>
between principal names may disable this check by starting the server
with this option.
+=item B<-rxbind>
+
+Bind the Rx socket to the primary interface only. (If not specified, the
+Rx socket will listen on all interfaces.)
+
=item B<-help>
Prints the online help for this command. All other valid options are
error_exit:
if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollCount = 0;
}
return code;
error_exit:
if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollCount = 0;
}
return code;
error_exit:
if (((++pollCount) % 4) == 0) { /* Poll every 4 reads/writes */
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollCount = 0;
}
return code;
while (dumpSyncPtr->ds_bytes > 0) {
if (dumpSyncPtr->ds_readerStatus == DS_WAITING) {
dumpSyncPtr->ds_readerStatus = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dumpSyncPtr->ds_readerStatus_cond) == 0);
+#else
code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus);
if (code)
LogError(code, "canWrite: Signal delivery failed\n");
+#endif
}
dumpSyncPtr->ds_writerStatus = DS_WAITING;
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_mutex_lock(&dumpSyncPtr->ds_writerStatus_mutex) == 0);
+ assert(pthread_cond_wait(&dumpSyncPtr->ds_writerStatus_cond, &dumpSyncPtr->ds_writerStatus_mutex) == 0);
+ assert(pthread_mutex_unlock(&dumpSyncPtr->ds_writerStatus_mutex) == 0);
+#else
LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus);
+#endif
ObtainWriteLock(&dumpSyncPtr->ds_lock);
}
return (1);
dumpSyncPtr->ds_bytes += nbytes;
if (dumpSyncPtr->ds_readerStatus == DS_WAITING) {
dumpSyncPtr->ds_readerStatus = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dumpSyncPtr->ds_readerStatus_cond) == 0);
+#else
code = LWP_SignalProcess(&dumpSyncPtr->ds_readerStatus);
if (code)
LogError(code, "haveWritten: Signal delivery failed\n");
+#endif
}
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
}
LogDebug(4, "doneWriting: waiting for Reader\n");
dumpSyncPtr->ds_writerStatus = DS_WAITING;
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_mutex_lock(&dumpSyncPtr->ds_writerStatus_mutex) == 0);
+ assert(pthread_cond_wait(&dumpSyncPtr->ds_writerStatus_cond, &dumpSyncPtr->ds_writerStatus_mutex) == 0);
+ assert(pthread_mutex_unlock(&dumpSyncPtr->ds_writerStatus_mutex) == 0);
+#else
LWP_WaitProcess(&dumpSyncPtr->ds_writerStatus);
+#endif
ObtainWriteLock(&dumpSyncPtr->ds_lock);
}
else
dumpSyncPtr->ds_writerStatus = DS_DONE;
dumpSyncPtr->ds_readerStatus = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dumpSyncPtr->ds_readerStatus_cond) == 0);
+#else
code = LWP_NoYieldSignal(&dumpSyncPtr->ds_readerStatus);
if (code)
LogError(code, "doneWriting: Signal delivery failed\n");
+#endif
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
}
charListT *charListPtr;
afs_int32 *done;
{
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ pthread_t dumperPid, watcherPid;
+ pthread_attr_t dumperPid_tattr;
+ pthread_attr_t watcherPid_tattr;
+
+#else
PROCESS dumperPid, watcherPid;
+#endif
int readSize;
afs_int32 code = 0;
if (code)
ERROR(errno);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ /* Initialize the condition variables and the mutexes we use
+ * to signal and synchronize the reader and writer threads.
+ */
+ assert(pthread_cond_init(&dumpSyncPtr->ds_readerStatus_cond, (const pthread_condattr_t *)0) == 0);
+ assert(pthread_cond_init(&dumpSyncPtr->ds_writerStatus_cond, (const pthread_condattr_t *)0) == 0);
+ assert(pthread_mutex_init(&dumpSyncPtr->ds_readerStatus_mutex, (const pthread_mutexattr_t *)0) == 0);
+ assert(pthread_mutex_init(&dumpSyncPtr->ds_writerStatus_mutex, (const pthread_mutexattr_t *)0) == 0);
+
+ /* Initialize the thread attributes and launch the thread */
+
+ assert(pthread_attr_init(&dumperPid_tattr) == 0);
+ assert(pthread_attr_setdetachstate(&dumperPid_tattr, PTHREAD_CREATE_DETACHED) == 0);
+ assert(pthread_create(&dumperPid, &dumperPid_tattr, (void *)setupDbDump, NULL) == 0);
+
+#else
code =
LWP_CreateProcess(setupDbDump, 16384, 1,
(void *)dumpSyncPtr->pipeFid[1],
"Database Dumper", &dumperPid);
if (code)
goto error_exit;
+#endif
dumpSyncPtr->dumperPid = dumperPid;
dumpSyncPtr->timeToLive = time(0) + DUMP_TTL_INC;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ /* Initialize the thread attributes and launch the thread */
+
+ assert(pthread_attr_init(&watcherPid_tattr) == 0);
+ assert(pthread_attr_setdetachstate(&watcherPid_tattr, PTHREAD_CREATE_DETACHED) == 0);
+ assert(pthread_create(&watcherPid, &watcherPid_tattr, (void *)dumpWatcher, NULL) == 0);
+#else
/* now create the watcher thread */
code =
LWP_CreateProcess(dumpWatcher, 16384, 1, 0,
"Database Dump Watchdog", &watcherPid);
+#endif
} else if (firstcall)
ERROR(BUDB_LOCKED);
if (dumpSyncPtr->ds_writerStatus == DS_WAITING) {
LogDebug(6, "wakup writer\n");
dumpSyncPtr->ds_writerStatus = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dumpSyncPtr->ds_writerStatus_cond) == 0);
+#else
code = LWP_SignalProcess(&dumpSyncPtr->ds_writerStatus);
if (code)
LogError(code, "BUDB_DumpDB: signal delivery failed\n");
+#endif
}
LogDebug(6, "wait for writer\n");
dumpSyncPtr->ds_readerStatus = DS_WAITING;
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_mutex_lock(&dumpSyncPtr->ds_readerStatus_mutex) == 0);
+ assert(pthread_cond_wait(&dumpSyncPtr->ds_readerStatus_cond, &dumpSyncPtr->ds_readerStatus_mutex) == 0);
+ assert(pthread_mutex_unlock(&dumpSyncPtr->ds_readerStatus_mutex) == 0);
+#else
LWP_WaitProcess(&dumpSyncPtr->ds_readerStatus);
+#endif
ObtainWriteLock(&dumpSyncPtr->ds_lock);
}
dumpSyncPtr->ds_bytes -= readSize;
if (dumpSyncPtr->ds_writerStatus == DS_WAITING) {
dumpSyncPtr->ds_writerStatus = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dumpSyncPtr->ds_writerStatus_cond) == 0);
+#else
code = LWP_SignalProcess(&dumpSyncPtr->ds_writerStatus);
if (code)
LogError(code, "BUDB_DumpDB: signal delivery failed\n");
+#endif
}
error_exit:
close(dumpSyncPtr->pipeFid[0]);
close(dumpSyncPtr->pipeFid[1]);
-
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cancel(dumpSyncPtr->dumperPid) == 0);
+#else
code = LWP_DestroyProcess(dumpSyncPtr->dumperPid);
if (code)
LogError(code, "dumpWatcher: failed to kill dump thread\n");
+#endif
if (dumpSyncPtr->ut) {
code = ubik_AbortTrans(dumpSyncPtr->ut);
}
/*i */
ReleaseWriteLock(&dumpSyncPtr->ds_lock);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ sleep(5);
+#else
IOMGR_Sleep(5);
+#endif
} /*w */
exit:
struct Lock ds_lock; /* for this struct. */
afs_int32 statusFlags; /* 0, or 1 for dump in progress */
int pipeFid[2]; /* pipe between threads */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ pthread_mutex_t ds_writerStatus_mutex;
+ pthread_mutex_t ds_readerStatus_mutex;
+ pthread_cond_t ds_writerStatus_cond;
+ pthread_cond_t ds_readerStatus_cond;
+ pthread_t dumperPid;
+#else
+ PROCESS dumperPid; /* pid of dumper lwp */
+#endif
char ds_writerStatus;
char ds_readerStatus;
- PROCESS dumperPid; /* pid of dumper lwp */
struct ubik_trans *ut; /* dump db transaction */
afs_int32 ds_bytes; /* no. of bytes buffered */
time_t timeToLive; /* time. After this, kill the dump */
/* check each entry */
for (entryIndex = 0; entryIndex < blockMap[blockIndex]->nEntries; entryIndex++) { /*f */
+#ifndef AFS_PTHREAD_ENV
if ((entryIndex % 1024) == 0)
IOMGR_Poll();
-
+#endif
bits = blockMap[blockIndex]->entries[entryIndex];
for (i = 0; i < NMAPCs; i++)
start = time(0);
else if (time(0) - start > 5)
return UNOQUORUM;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ sleep(1);
+#else
IOMGR_Sleep(1);
+#endif
}
return 0;
}
Log("Waiting for quorum election\n");
if (wait < 15.0)
wait *= 1.1;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ sleep((int)wait);
+#else
IOMGR_Sleep((int)wait);
+#endif
}
}
if (code)
}
/* dump id is in use - wait a while */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ sleep(1);
+#else
IOMGR_Sleep(1);
+#endif
} /*w */
} else {
/* dump id supplied (e.g. for database restore) */
int debugging = 0;
int rxBind = 0;
+int lwps = 3;
+
+#define MINLWP 3
+#define MAXLWP 16
#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
afs_uint32 SHostAddrs[ADDRSPERSITE];
cmd_AddParm(cptr, "-auditlog", CMD_SINGLE, CMD_OPTIONAL,
"audit log path");
+ cmd_AddParm(cptr, "-p", CMD_SINGLE, CMD_OPTIONAL,
+ "number of processes");
+
+ cmd_AddParm(cptr, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
+ "bind the Rx socket (primary interface only)");
+
}
int
printf("Warning: auditlog %s not writable, ignored.\n", fileName);
}
+ /* user provided the number of threads */
+ if (as->parms[8].items != 0) {
+ lwps = atoi(as->parms[8].items->data);
+ if (lwps > MAXLWP) {
+ printf ("Warning: '-p %d' is too big; using %d instead\n",
+ lwps, MAXLWP);
+ lwps = MAXLWP;
+ }
+ if (lwps < MINLWP) {
+ printf ("Warning: '-p %d' is too small; using %d instead\n",
+ lwps, MINLWP);
+ lwps = MINLWP;
+ }
+ }
+
+ /* user provided rxbind option */
+ if (as->parms[9].items != 0) {
+ rxBind = 1;
+ }
+
return 0;
}
BUDB_EXIT(3);
}
rx_SetMinProcs(tservice, 1);
- rx_SetMaxProcs(tservice, 3);
+ rx_SetMaxProcs(tservice, lwps);
rx_SetStackSize(tservice, 10000);
/* allow super users to manage RX statistics */
LEX="lex"
CSTATIC="-non_shared"
DBG="-g3"
- MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
TXLIBS="-lcurses"
XCFLAGS="-D_NO_PROTO -DOSF"
LEX="flex -l"
DBG="-g3"
CSTATIC="-non_shared"
- MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
TXLIBS="-lcurses"
XCFLAGS="-D_NO_PROTO -DOSF"
DBG="-g3"
CSTATIC="-non_shared"
LWP_OPTMZ="-O2"
- MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-pthread -lpthread -lmach -lexc -lc"
TXLIBS="-lcurses"
XCFLAGS="-D_NO_PROTO -DOSF"
alpha_linux_22)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
CCOBJ="${CC} -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
CCOBJ="${CC} -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
LEX="/opt/langtools/bin/lex"
LWP_OPTMZ="-O"
MT_CC="/opt/ansic/bin/cc -Ae"
- MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-L/opt/dce/lib -ldce"
MV="/bin/mv"
OPTMZ="-O"
LEX="/opt/langtools/bin/lex"
LWP_OPTMZ="-O"
MT_CC="$CC"
- MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
MV="/bin/mv"
OPTMZ="-O"
LEX="/opt/langtools/bin/lex"
LWP_OPTMZ=""
MT_CC="$CC"
- MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_POSIX_C_SOURCE=199506L -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
MV="/bin/mv"
OPTMZ="-O"
*fbsd_*)
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-pthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-pipe -fPIC"
*nbsd2*|*nbsd3*|*nbsd4*)
LEX="flex -l"
- MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -D_REENTRANT '
+ MT_CFLAGS='${XCFLAGS} -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -D_REENTRANT '
MT_LIBS="-lpthread" # XXX -pthread soon
PAM_OPTMZ=-O2
PAM_CFLAGS="-pipe -fPIC"
ia64_linux24|ia64_linux26)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
CCOBJ="${CC} -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
ppc64_linux24)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
ppc64_linux26)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
MT_CC="gcc -pipe"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
MT_CC="gcc -pipe"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
DBG=-g
KERN_DBG=-g
MT_CC="gcc -pipe"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
DBG=-g
KERN_DBG=-g
MT_CC="gcc -pipe"
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
DBG=-g
KERN_DBG=-g
KRB5CFLAGS="-I/usr/include/kerberosV"
KRB5LIBS="-lkrb5 -lcrypto"
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-pthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-pipe -fpic"
parisc_linux24)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
ppc_darwin_70)
AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration"
LEX="lex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -D_REENTRANT ${XCFLAGS}'
KROOT=
KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
LWP_OPTMZ="-O2"
*_darwin_80)
AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
LEX="lex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}'
KROOT=
KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
KERN_OPTMZ="-Os"
*_darwin_90)
AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
LEX="lex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -D_REENTRANT ${XCFLAGS} ${ARCHFLAGS}'
KROOT=
KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
LD="cc"
ppc_linux*)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
LEX="lex"
LIBSYS_AIX_EXP="afsl.exp"
MT_CC="xlc_r"
- MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthreads"
SHLIB_SUFFIX="o"
TXLIBS="-lcurses"
LEX="lex"
LIBSYS_AIX_EXP="afsl.exp"
MT_CC="xlc_r"
- MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthreads"
SHLIB_SUFFIX="o"
TXLIBS="-lcurses"
LEX="lex"
LIBSYS_AIX_EXP="afsl.exp"
MT_CC="xlc_r"
- MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthreads"
SHLIB_SUFFIX="o"
TXLIBS="-lcurses"
LEX="lex"
LIBSYS_AIX_EXP="afsl.exp"
MT_CC="xlc_r"
- MT_CFLAGS='-DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthreads"
SHLIB_SUFFIX="o"
TXLIBS="-lcurses"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CC="$CC"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
FSINCLUDES="-I/usr/include/sys/fs"
LEX="lex"
- MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
TXLIBS="-lcurses"
XCFLAGS64="-64 -mips3"
AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
FSINCLUDES="-I/usr/include/sys/fs"
LEX="lex"
- MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
TXLIBS="-lcurses"
XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
FSINCLUDES="-I/usr/include/sys/fs"
LEX="lex"
- MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
TXLIBS="-lcurses"
XCFLAGS64="-D_BSD_COMPAT -64 -mips3"
LD="/usr/bin/ld"
LEX="lex"
MT_CC="/usr/bin/cc"
- MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-D_SGI_MP_SOURCE -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread"
TXLIBS="-lcurses"
XCFLAGS64="-64 -mips3"
sparc*_linux*)
KERN_OPTMZ=-O2
LEX="flex -l"
- MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
+ MT_CFLAGS='-DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_OPTMZ=-O2
PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
CCOBJ="/opt/SUNWspro/bin/cc"
LEX="lex"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
SHLIB_CFLAGS="-KPIC"
TXLIBS="-lcurses"
CCOBJ="/opt/SUNWspro/bin/cc"
LEX="lex"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
LEX="lex"
LD="/usr/ccs/bin/ld"
MT_CC="/opt/SUNWspro/bin/cc"
- MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ MT_CFLAGS='-mt -DAFS_PTHREAD_ENV -DUBIK_PTHREAD_ENV ${XCFLAGS}'
MT_LIBS="-lpthread -lsocket"
PAM_CFLAGS="-KPIC"
PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
CRYPT_OBJ = crypt.o
LWPOBJS = \
- fasttime.o
+ fasttime.o \
+ lock.o
LIBOBJS = \
${RXOBJS} \
fasttime.o: ${LWP}/fasttime.c
${CCRULE} ${LWP}/fasttime.c
+lock.o: ${LWP}/lock.c
+ ${CCRULE} ${LWP}/lock.c
+
syscall.o: ${SYS}/syscall.s
case "$(SYS_NAME)" in \
sun4x_5* | sunx86_5*) \
AUD_END);
ViceLog(125, ("PTS_NameToID: code %d aname %s aid %d", code,
aname->namelist_val[i], aid->idlist_val[i]));
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
aid->idlist_len = aname->namelist_len;
AUD_STR, aname->namelist_val[i], AUD_END);
ViceLog(125, ("PTS_idToName: code %d aid %d aname %s", code,
aid->idlist_val[i], aname->namelist_val[i]));
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
aname->namelist_len = aid->idlist_len;
if (code)
ABORT_WITH(tt, code);
tentry.count--; /* maintain count */
+#ifndef AFS_PTHREAD_ENV
if ((i & 3) == 0)
IOMGR_Poll();
+#endif
}
tentry.next = centry.next; /* thread out this block */
code = FreeBlock(tt, nptr); /* free continuation block */
code = ubik_EndTrans(tt);
if (code)
return code;
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll(); /* just to keep the connection alive */
+#endif
code = ubik_BeginTrans(dbase, UBIK_WRITETRANS, &tt);
if (code)
return code;
if (code)
ABORT_WITH(tt, code);
tentryg->countsg--; /* maintain count */
+#ifndef AFS_PTHREAD_ENV
if ((i & 3) == 0)
IOMGR_Poll();
+#endif
}
tentryg->nextsg = centry.next; /* thread out this block */
code = FreeBlock(tt, nptr); /* free continuation block */
code = ubik_EndTrans(tt);
if (code)
return code;
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll(); /* just to keep the connection alive */
+#endif
code = ubik_BeginTrans(dbase, UBIK_WRITETRANS, &tt);
if (code)
if (code)
ABORT_WITH(tt, code);
count++;
+#ifndef AFS_PTHREAD_ENV
if ((count & 3) == 0)
IOMGR_Poll();
+#endif
}
if (count < 50)
continue;
code = ubik_EndTrans(tt);
if (code)
return code;
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll(); /* just to keep the connection alive */
+#endif
code = ubik_BeginTrans(dbase, UBIK_WRITETRANS, &tt);
if (code)
return code;
goto done;
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
return 1;
}
delay = atoi(as->parms[0].items->data);
+#ifdef AFS_PTHREAD_ENV
+ sleep(delay);
+#else
IOMGR_Sleep(delay);
+#endif
return 0;
}
}
if (ccode == 1) {
host = SHostAddrs[0];
+ /* the following call is idempotent so if/when it gets called
+ * again by the ubik init stuff, it doesn't really matter
+ * -- klm
+ */
rx_InitHost(host, htons(AFSCONF_PROTPORT));
}
}
return code;
#endif
}
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
if (add) { /* this is for a CPS, so tack on appropriate stuff */
return code;
}
}
+#ifndef AFS_PTHREAD_ENV
if (alist->prlist_len > 100)
IOMGR_Poll();
+#endif
qsort(alist->prlist_val, alist->prlist_len, sizeof(afs_int32), IDCmp);
return PRSUCCESS;
}
#endif
}
nptr = centry.next;
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
for (i = 0; i < PRSIZE; i++) {
break;
}
nptr = centry.next;
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
}
if (add) { /* this is for a CPS, so tack on appropriate stuff */
return code;
}
}
+#ifndef AFS_PTHREAD_ENV
if (alist->prlist_len > 100)
IOMGR_Poll();
+#endif
qsort(alist->prlist_val, alist->prlist_len, sizeof(afs_int32), IDCmp);
return PRSUCCESS;
}
return code;
}
nptr = centry.next;
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
#if DEBUG_SG_MAP
fprintf(stderr, "] for gid %d, done [flag=%s]\n", gid,
return code;
}
nptr = centry.next;
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
+#ifndef AFS_PTHREAD_ENV
if (alist->prlist_len > 100)
IOMGR_Poll();
+#endif
qsort((char *)alist->prlist_val, (int)alist->prlist_len,
sizeof(afs_int32), IDCmp);
return PRSUCCESS;
}
if (code)
return code;
- if (count++ > 50)
- IOMGR_Poll(), count = 0;
+ if (count++ > 50) {
+#ifndef AFS_PTHREAD_ENV
+ IOMGR_Poll();
+#endif
+ count = 0;
+ }
}
+#ifndef AFS_PTHREAD_ENV
if (alist->prlist_len > 100)
IOMGR_Poll();
+#endif
qsort(alist->prlist_val, alist->prlist_len, sizeof(afs_int32), IDCmp);
return PRSUCCESS;
}
if (gid == AUTHUSERID && aid != ANONYMOUSID)
return 1;
if (gid < 0) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
if (IsAMemberOfSG(at, aid, gid, depth - 1))
return 1;
}
if (gid == AUTHUSERID && aid != ANONYMOUSID)
return 1;
if (gid < 0) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
if (IsAMemberOfSG(at, aid, gid, depth - 1))
return 1;
}
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+# */
+
+srcdir=@srcdir@/../budb
+include @TOP_OBJDIR@/src/config/Makefile.config
+
+CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $<
+
+RX=../rx
+UTIL=../util
+
+RXOBJS= rx_pthread.o rxkad_errs.o
+
+UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
+ volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
+
+
+INCLS=\
+ ${TOP_INCDIR}/lock.h \
+ ${TOP_INCDIR}/ubik.h \
+ ${TOP_INCDIR}/lwp.h \
+ ${TOP_INCDIR}/des.h \
+ ${TOP_INCDIR}/rx/rx.h \
+ ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/rx/rxkad.h \
+ ${TOP_INCDIR}/afs/auth.h \
+ ${TOP_INCDIR}/afs/cellconfig.h \
+ ${TOP_INCDIR}/afs/com_err.h \
+ ${TOP_INCDIR}/afs/bubasics.h \
+ budb.h budb_client.h ${srcdir}/database.h
+
+# library ordering defined by top level makefile
+LIBS=${RXOBJS} ${UTILOBJS} \
+ ${TOP_LIBDIR}/libbubasics.a \
+ ${TOP_LIBDIR}/libubik_pthread.a \
+ ${TOP_LIBDIR}/libafsauthent.a \
+ ${TOP_LIBDIR}/libafsrpc.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/libafsutil.a \
+ ${LDFLAGS} ${MT_LIBS}
+
+COMMON_OBJS = database.o db_alloc.o db_dump.o db_hash.o struct_ops.o ol_verify.o
+
+SERVER_OBJS = ${COMMON_OBJS} budb.ss.o budb.xdr.o dbs_dump.o db_lock.o db_text.o \
+ procs.o server.o budb_errs.o
+
+all: ${TOP_LIBDIR}/libbudb.a ${TOP_INCDIR}/afs/budb.h ${TOP_INCDIR}/afs/budb_errs.h ${TOP_INCDIR}/afs/budb_client.h budb_server
+
+#
+# budb_errs.o actually depends on neither budb_client.h nor budb_errs.h
+# but generating either of them will rebuild budb_errs.c
+#
+budb_errs.o: budb_errs.c budb_client.h budb_errs.h
+
+budb_errs.c budb_client.h: ${srcdir}/budb_errs.et ${srcdir}/budb_client.p.h
+ $(RM) -f budb_client.h budb_errs.c; ${COMPILE_ET} -p ${srcdir} budb_errs -h budb_client
+
+budb_errs.h: ${srcdir}/budb_errs.et
+ ${COMPILE_ET} -p ${srcdir} budb_errs
+
+#
+# Build targets
+#
+
+rx_pthread.o: ${RX}/rx_pthread.c
+ ${CCRULE}
+
+rxkad_errs.o: ../rxkad/rxkad_errs.c
+ ${CCRULE}
+
+# get the pthreaded util stuff compiled here. we do this instead of
+# using the non-pthreaded libutil.a. There probably should be a
+# pthreaded version of this library, as we are doing with ubik itself, but...
+#
+
+assert.o: ${UTIL}/assert.c
+ ${CCRULE}
+
+uuid.o: ${UTIL}/uuid.c
+ ${CCRULE}
+
+serverLog.o: ${UTIL}/serverLog.c
+ ${CCRULE}
+
+fileutil.o: ${UTIL}/fileutil.c
+ ${CCRULE}
+
+volparse.o: ${UTIL}/volparse.c
+ ${CCRULE}
+
+flipbase64.o: ${UTIL}/flipbase64.c
+ ${CCRULE}
+
+netutils.o: ${UTIL}/netutils.c
+ ${CCRULE}
+
+dirpath.o: ${UTIL}/dirpath.c
+ ${CCRULE}
+
+softsig.o: ${UTIL}/softsig.c
+ ${CCRULE}
+
+hostparse.o: ${UTIL}/hostparse.c
+ ${CCRULE}
+
+snprintf.o: ${UTIL}/snprintf.c
+ ${CCRULE}
+
+pthread_glock.o: ${UTIL}/pthread_glock.c
+ ${CCRULE}
+
+
+database.o: ${srcdir}/database.c budb_errs.h ${srcdir}/globals.h ${INCLS}
+ ${CCRULE}
+
+db_alloc.o: ${srcdir}/db_alloc.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+db_dump.o: ${srcdir}/db_dump.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+dbs_dump.o: ${srcdir}/dbs_dump.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+db_lock.o: ${srcdir}/db_lock.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+db_text.o: ${srcdir}/db_text.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+db_hash.o: ${srcdir}/db_hash.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+ol_verify.o: ${srcdir}/ol_verify.c budb_errs.h ${INCLS}
+ ${CCRULE}
+
+procs.o: ${srcdir}/procs.c budb_errs.h ${srcdir}/globals.h ${INCLS}
+ ${CCRULE}
+
+struct_ops.o: ${srcdir}/struct_ops.c budb_errs.h
+ ${CCRULE}
+
+server.o: ${srcdir}/server.c budb_errs.h ${INCLS} AFS_component_version_number.c
+ ${CCRULE}
+
+
+budb_server: $(SERVER_OBJS) ${LIBS}
+ ${MT_CC} ${CFLAGS} ${MT_CFLAGS} -o budb_server $(SERVER_OBJS) ${LIBS} ${XLIBS}
+
+budb.cs.c: ${srcdir}/budb.rg
+ ${RXGEN} -u -C -o $@ ${srcdir}/budb.rg
+
+budb.ss.c: ${srcdir}/budb.rg
+ ${RXGEN} -S -o $@ ${srcdir}/budb.rg
+
+budb.xdr.c: ${srcdir}/budb.rg
+ ${RXGEN} -c -o $@ ${srcdir}/budb.rg
+
+budb.h: ${srcdir}/budb.rg
+ ${RXGEN} -u -h -o $@ ${srcdir}/budb.rg
+
+budb.cs.c: budb.h
+budb.xdr.c: budb.h
+budb.ss.c: budb.h
+
+libbudb.a: budb_errs.o budb.cs.o budb.xdr.o struct_ops.o AFS_component_version_number.o
+ -$(RM) -f $@
+ $(AR) crv $@ budb_errs.o budb.cs.o budb.xdr.o struct_ops.o AFS_component_version_number.o
+ $(RANLIB) $@
+
+#
+# Install targets
+#
+install: \
+ ${DESTDIR}${libdir}/afs/libbudb.a \
+ ${DESTDIR}${includedir}/afs/budb.h \
+ ${DESTDIR}${includedir}/afs/budb_errs.h \
+ ${DESTDIR}${includedir}/afs/budb_client.h \
+ ${DESTDIR}${afssrvlibexecdir}/buserver
+
+${DEST}/lib/afs/libbudb.a: libbudb.a
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/budb.h: budb.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/budb_errs.h: budb_errs.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/budb_client.h: budb_client.h
+ ${INSTALL} $? $@
+
+${DEST}/root.server/usr/afs/bin/buserver: budb_server
+ ${INSTALL} -f $? $@
+
+#
+# Misc targets
+#
+clean:
+ $(RM) -f *.o *~ budb_errs.[ch] budb.h budb_client.h *.a *.xdr.c \
+ *.ss.c *.cs.c core budb_server AFS_component_version_number.c
+
+include ../config/Makefile.version
+${DESTDIR}${libdir}/afs/libbudb.a: libbudb.a
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libbudb.a: libbudb.a
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/budb.h: budb.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/budb.h: budb.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/budb_errs.h: budb_errs.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/budb_errs.h: budb_errs.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/budb_client.h: budb_client.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/budb_client.h: budb_client.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvlibexecdir}/buserver: budb_server
+ ${INSTALL} -f $? $@
+
+dest: \
+ ${DEST}/lib/afs/libbudb.a \
+ ${DEST}/include/afs/budb.h \
+ ${DEST}/include/afs/budb_errs.h \
+ ${DEST}/include/afs/budb_client.h \
+ ${DEST}/root.server/usr/afs/bin/buserver
+
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+srcdir=@srcdir@/../ptserver
+include @TOP_OBJDIR@/src/config/Makefile.config
+
+
+CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $<
+
+RX=../rx
+UTIL=../util
+
+RXOBJS= rx_pthread.o rxkad_errs.o
+
+UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
+ volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
+
+INCLS=${TOP_INCDIR}/ubik.h \
+ ${TOP_INCDIR}/lock.h \
+ ${TOP_INCDIR}/lwp.h \
+ ${TOP_INCDIR}/rx/rx.h \
+ ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/afs/keys.h \
+ ${TOP_INCDIR}/afs/cellconfig.h \
+ ${srcdir}/ptserver.h \
+ ${srcdir}/ptclient.h \
+ ${srcdir}/ptuser.h \
+ ptint.h \
+ pterror.h \
+ ${srcdir}/map.h \
+ ${srcdir}/ptprototypes.h
+
+LINCLS=${TOP_INCDIR}/ubik.h \
+ ${TOP_INCDIR}/lock.h \
+ ${TOP_INCDIR}/rx/rx.h \
+ ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/rx/rxkad.h \
+ ${TOP_INCDIR}/afs/auth.h \
+ ${TOP_INCDIR}/afs/cellconfig.h \
+ ${srcdir}/ptclient.h \
+ ${srcdir}/ptuser.h \
+ ptint.h \
+ pterror.h
+
+LIBS=${RXOBJS} ${UTILOBJS}\
+ ${TOP_LIBDIR}/libubik_pthread.a \
+ ${TOP_LIBDIR}/libafsauthent.a \
+ ${TOP_LIBDIR}/librxstat.a \
+ ${TOP_LIBDIR}/libafsrpc.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libafsutil.a \
+ ${LDFLAGS} ${MT_LIBS}
+
+
+all: ptserver pts pt_util db_verify ${TOP_LIBDIR}/libprot.a \
+ depinstall readgroup readpwd testpt
+
+depinstall: \
+ ptint.cs.c ptint.xdr.c \
+ ${TOP_INCDIR}/afs/prclient.h \
+ ${TOP_INCDIR}/afs/prerror.h \
+ ${TOP_INCDIR}/afs/print.h \
+ ${TOP_INCDIR}/afs/prserver.h \
+ ${TOP_INCDIR}/afs/ptclient.h \
+ ${TOP_INCDIR}/afs/ptuser.h \
+ ${TOP_INCDIR}/afs/pterror.h \
+ ${TOP_INCDIR}/afs/ptint.h \
+ ${TOP_INCDIR}/afs/ptserver.h
+
+#
+# Build targets
+#
+
+rx_pthread.o: ${RX}/rx_pthread.c
+ ${CCRULE}
+
+rxkad_errs.o: ../rxkad/rxkad_errs.c
+ ${CCRULE}
+
+#
+# get the pthreaded util stuff compiled here. we do this instead of
+# using the non-pthreaded libutil.a. There probably should be a
+# pthreaded version of this library, as we are doing with ubik itself, but...
+#
+
+assert.o: ${UTIL}/assert.c
+ ${CCRULE}
+
+uuid.o: ${UTIL}/uuid.c
+ ${CCRULE}
+
+serverLog.o: ${UTIL}/serverLog.c
+ ${CCRULE}
+
+fileutil.o: ${UTIL}/fileutil.c
+ ${CCRULE}
+
+volparse.o: ${UTIL}/volparse.c
+ ${CCRULE}
+
+flipbase64.o: ${UTIL}/flipbase64.c
+ ${CCRULE}
+
+netutils.o: ${UTIL}/netutils.c
+ ${CCRULE}
+
+dirpath.o: ${UTIL}/dirpath.c
+ ${CCRULE}
+
+softsig.o: ${UTIL}/softsig.c
+ ${CCRULE}
+
+hostparse.o: ${UTIL}/hostparse.c
+ ${CCRULE}
+
+snprintf.o: ${UTIL}/snprintf.c
+ ${CCRULE}
+
+pthread_glock.o: ${UTIL}/pthread_glock.c
+ ${CCRULE}
+
+
+#ptserver.o: ${srcdir}/ptserver.c ${INCLS} AFS_component_version_number.c
+# ${CCRULE}
+
+ptserver.o: ${srcdir}/ptserver.c
+ ${CCRULE}
+
+ptutils.o: ${srcdir}/ptutils.c
+ ${CCRULE}
+
+ptprocs.o: ${srcdir}/ptprocs.c
+ ${CCRULE}
+
+utils.o: ${srcdir}/utils.c
+ ${CCRULE}
+
+map.o: ${srcdir}/map.c
+ ${CCRULE}
+
+ptint.ss.o: ptint.ss.c
+ ${CCRULE}
+
+ptint.cs.o: ptint.cs.c
+ ${CCRULE}
+
+ptint.xdr.o: ptint.xdr.c
+ ${CCRULE}
+
+ptint.cs.c: ${srcdir}/ptint.xg
+ ${RXGEN} -x -C -u -o $@ ${srcdir}/ptint.xg
+
+ptint.ss.c: ${srcdir}/ptint.xg
+ ${RXGEN} -x -S -o $@ ${srcdir}/ptint.xg
+
+ptint.xdr.c: ${srcdir}/ptint.xg
+ ${RXGEN} -x -c -o $@ ${srcdir}/ptint.xg
+
+ptint.h: ${srcdir}/ptint.xg
+ ${RXGEN} -x -h -u -o $@ ${srcdir}/ptint.xg
+
+ptint.cs.c: ptint.h
+ptint.ss.c: ptint.h
+ptint.xdr.c: ptint.h
+
+Kptint.cs.c: ${srcdir}/ptint.xg Kptint.h
+ ${RXGEN} -x -k -C -o Kptint.cs.c ${srcdir}/ptint.xg
+
+Kptint.xdr.c: ${srcdir}/ptint.xg
+ ${RXGEN} -x -k -c -o Kptint.xdr.c ${srcdir}/ptint.xg
+
+Kptint.h: ${srcdir}/ptint.xg
+ ${RXGEN} -x -k -h -o Kptint.h ${srcdir}/ptint.xg
+
+display.o: ${srcdir}/display.c
+ ${CCRULE}
+
+ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${TOP_LIBDIR}/libaudit.a map.o
+ ${MT_CC} ${CFLAGS} ${MT_CFLAGS} -o ptserver ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o map.o $(LIBS) ${XLIBS} ${TOP_LIBDIR}/libaudit.a
+
+db_verify.o: ${srcdir}/db_verify.c
+ ${CCRULE}
+
+db_verify: db_verify.o pterror.o display.o $(LIBS)
+ $(CC) ${CFLAGS} -o db_verify db_verify.o display.o pterror.o $(LIBS) ${XLIBS}
+
+ptclient: ptclient.o display.o libprot.a $(LIBS)
+ $(CC) ${CFLAGS} -o ptclient ptclient.o display.o libprot.a $(LIBS) ${XLIBS}
+
+ptclient.o: ${srcdir}/ptclient.c
+ ${CCRULE}
+
+ptuser.o: ${srcdir}/ptuser.c
+ ${CCRULE}
+
+pterror.h pterror.c: ${srcdir}/pterror.et
+ $(RM) -f pterror.h pterror.c
+ ${COMPILE_ET} -p ${srcdir} pterror
+
+libprot.a: ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
+ $(RM) -f $@
+ $(AR) crv $@ ptuser.o pterror.o ptint.cs.o ptint.xdr.o AFS_component_version_number.o
+ $(RANLIB) $@
+
+pts: pts.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
+ $(CC) ${CFLAGS} -o pts pts.o ${TOP_LIBDIR}/libcmd.a libprot.a ${LIBS} ${XLIBS}
+
+pts.o: ${srcdir}/pts.c
+ ${CCRULE}
+
+readgroup: readgroup.o libprot.a $(LIBS)
+ $(CC) ${CFLAGS} -o readgroup readgroup.o libprot.a ${LIBS} ${XLIBS}
+
+readgroup.o: ${srcdir}/readgroup.c
+ ${CCRULE}
+
+readpwd: readpwd.o libprot.a $(LIBS)
+ $(CC) ${CFLAGS} -o readpwd readpwd.o libprot.a ${LIBS} ${XLIBS}
+
+readpwd.o: ${srcdir}/readpwd.c
+ ${CCRULE}
+
+testpt: testpt.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS)
+ case "$(SYS_NAME)" in \
+ *_darwin_12 ) \
+ $(CC) ${CFLAGS} -o testpt testpt.o ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ;; \
+ * ) \
+ $(CC) ${CFLAGS} -o testpt testpt.o -lm ${TOP_LIBDIR}/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
+ esac
+
+testpt.o: ${srcdir}/testpt.c
+ ${CCRULE}
+
+pt_util: pt_util.o ptutils.o ubik.o utils.o map.o libprot.a $(LIBS)
+ $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o map.o libprot.a ${TOP_LIBDIR}/libcmd.a $(LIBS) ${XLIBS}
+
+pt_util.o: ${srcdir}/pt_util.c
+ ${CCRULE}
+
+ubik.o: ${srcdir}/ubik.c
+ ${CCRULE}
+
+prerror.h: pterror.h
+ ${INSTALL} $? $@
+ echo '#define ERROR_TABLE_BASE_pr ERROR_TABLE_BASE_PT' >> $@
+
+#
+# Installation targets
+#
+install: \
+ ${DESTDIR}${afssrvlibexecdir}/ptserver \
+ ${DESTDIR}${afssrvbindir}/pts \
+ ${DESTDIR}${bindir}/pts \
+ ${DESTDIR}${afssrvsbindir}/pt_util \
+ ${DESTDIR}${afssrvsbindir}/prdb_check \
+ ${DESTDIR}${libdir}/afs/libprot.a \
+ ${DESTDIR}${includedir}/afs/prclient.h \
+ ${DESTDIR}${includedir}/afs/prerror.h \
+ ${DESTDIR}${includedir}/afs/print.h \
+ ${DESTDIR}${includedir}/afs/prserver.h \
+ ${DESTDIR}${includedir}/afs/ptclient.h \
+ ${DESTDIR}${includedir}/afs/ptuser.h \
+ ${DESTDIR}${includedir}/afs/pterror.h \
+ ${DESTDIR}${includedir}/afs/ptint.h \
+ ${DESTDIR}${includedir}/afs/ptserver.h
+
+${DEST}/root.server/usr/afs/bin/ptserver: ptserver
+ ${INSTALL} $? $@
+
+${DEST}/bin/pts ${DEST}/root.server/usr/afs/bin/pts: pts
+ ${INSTALL} $? $@
+
+${DEST}/root.server/usr/afs/bin/pt_util: pt_util
+ ${INSTALL} $? $@
+
+${DEST}/lib/afs/libprot.a: libprot.a
+ ${INSTALL} $? $@
+
+${DEST}/etc/prdb_check: db_verify
+ ${INSTALL} -f $? $@
+
+${DEST}/include/afs/prclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/prerror.h: pterror.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/print.h: ptint.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/prserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/ptserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/ptint.h: ptint.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/pterror.h: pterror.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/ptclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/ptuser.h: ${srcdir}/ptuser.h
+ ${INSTALL} $? $@
+
+#
+# Misc. targets
+#
+clean:
+ $(RM) -f *.a *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
+ libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
+ core AFS_component_version_number.c Kptint.cs.c Kptint.h Kptint.xdr.c
+
+include ../config/Makefile.version
+${DESTDIR}${afssrvlibexecdir}/ptserver: ptserver
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvbindir}/pts: pts
+ ${INSTALL} $? $@
+
+${DESTDIR}${bindir}/pts: pts
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/pt_util: pt_util
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/prdb_check: db_verify
+ ${INSTALL} -f $? $@
+
+${DESTDIR}${libdir}/afs/libprot.a: libprot.a
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libprot.a: libprot.a
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/prclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/prclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/prerror.h: pterror.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/prerror.h: pterror.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/print.h: ptint.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/print.h: ptint.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/prserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/prserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptuser.h: ${srcdir}/ptuser.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptclient.h: ${srcdir}/ptclient.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptuser.h: ${srcdir}/ptuser.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/pterror.h: pterror.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/pterror.h: pterror.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptint.h: ptint.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptint.h: ptint.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/ptserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/ptserver.h: ${srcdir}/ptserver.h
+ ${INSTALL} $? $@
+
+
+dest: \
+ ${DEST}/root.server/usr/afs/bin/ptserver \
+ ${DEST}/root.server/usr/afs/bin/pts \
+ ${DEST}/bin/pts \
+ ${DEST}/root.server/usr/afs/bin/pt_util \
+ ${DEST}/etc/prdb_check \
+ ${DEST}/lib/afs/libprot.a \
+ ${DEST}/include/afs/prclient.h \
+ ${DEST}/include/afs/prerror.h \
+ ${DEST}/include/afs/print.h \
+ ${DEST}/include/afs/prserver.h \
+ ${DEST}/include/afs/ptclient.h \
+ ${DEST}/include/afs/ptuser.h \
+ ${DEST}/include/afs/pterror.h \
+ ${DEST}/include/afs/ptint.h \
+ ${DEST}/include/afs/ptserver.h
+
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+srcdir=@srcdir@/../ubik
+include @TOP_OBJDIR@/src/config/Makefile.config
+
+CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $<
+
+RX=../rx
+UTIL=../util
+
+LIBOBJS=disk.o remote.o beacon.o recovery.o ubik.o vote.o lock.o phys.o \
+ ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
+ ubikclient.o uerrors.o uinit.o
+
+INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
+ ${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/lock.h ubik.h ubik_int.h utst_int.h
+
+RXOBJS = rx_pthread.o
+
+UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
+ volparse.o flipbase64.o softsig.o hostparse.o snprintf.o pthread_glock.o
+
+LIBS=${RXOBJS} ${UTILOBJS} ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/liblwp.a \
+ ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/libsys.a ${XLIBS} \
+ ${LDFLAGS} ${MT_LIBS}
+
+all: depinstall ${TOP_LIBDIR}/libubik_pthread.a udebug utst_server utst_client
+
+depinstall: \
+ ubik_int.cs.c ubik_int.xdr.c \
+ ${TOP_INCDIR}/ubik.h \
+ ${TOP_INCDIR}/ubik_int.h
+
+#
+# get the pthreaded rx stuff compiled here
+#
+
+rx_pthread.o: ${RX}/rx_pthread.c
+ ${CCRULE} -DDPF_FSLOG
+
+#
+# get the pthreaded util stuff compiled here. we do this instead of
+# using the non-pthreaded libutil.a. There probably should be a
+# pthreaded version of this library, as we are doing with ubik itself, but...
+#
+
+assert.o: ${UTIL}/assert.c
+ ${CCRULE}
+
+uuid.o: ${UTIL}/uuid.c
+ ${CCRULE}
+
+serverLog.o: ${UTIL}/serverLog.c
+ ${CCRULE}
+
+fileutil.o: ${UTIL}/fileutil.c
+ ${CCRULE}
+
+volparse.o: ${UTIL}/volparse.c
+ ${CCRULE}
+
+flipbase64.o: ${UTIL}/flipbase64.c
+ ${CCRULE}
+
+netutils.o: ${UTIL}/netutils.c
+ ${CCRULE}
+
+dirpath.o: ${UTIL}/dirpath.c
+ ${CCRULE}
+
+softsig.o: ${UTIL}/softsig.c
+ ${CCRULE}
+
+hostparse.o: ${UTIL}/hostparse.c
+ ${CCRULE}
+
+snprintf.o: ${UTIL}/snprintf.c
+ ${CCRULE}
+
+pthread_glock.o: ${UTIL}/pthread_glock.c
+ ${CCRULE}
+
+
+#
+# insert comments here
+#
+
+utst_server: utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
+ ${CC} ${CFLAGS} -o utst_server utst_server.o utst_int.ss.o utst_int.xdr.o libubik_pthread.a $(LIBS)
+
+utst_client: utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
+ ${CC} ${CFLAGS} -o utst_client utst_client.o utst_int.cs.o utst_int.xdr.o libubik_pthread.a $(LIBS)
+
+udebug: udebug.o libubik_pthread.a ${RXOBJS} ${UTILOBJS}
+ ${CC} ${CFLAGS} -o udebug udebug.o libubik_pthread.a $(LIBS)
+
+ubik_int.cs.c: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -C -o $@ ${srcdir}/ubik_int.xg
+
+ubik_int.ss.c: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -S -o $@ ${srcdir}/ubik_int.xg
+
+ubik_int.xdr.c: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -c -o $@ ${srcdir}/ubik_int.xg
+
+ubik_int.h: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -h -o $@ ${srcdir}/ubik_int.xg
+
+ubik_int.cs.c: ubik_int.h
+ubik_int.ss.c: ubik_int.h
+ubik_int.xdr.c: ubik_int.h
+
+Kubik_int.cs.c: ${srcdir}/ubik_int.xg Kubik_int.h
+ ${RXGEN} -x -k -C -o Kubik_int.cs.c ${srcdir}/ubik_int.xg
+
+Kubik_int.xdr.c: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -k -c -o Kubik_int.xdr.c ${srcdir}/ubik_int.xg
+
+Kubik_int.h: ${srcdir}/ubik_int.xg
+ ${RXGEN} -x -k -h -o Kubik_int.h ${srcdir}/ubik_int.xg
+
+#utst_int.ss.o: utst_int.ss.c utst_int.xdr.c
+# ${CCRULE}
+
+#utst_int.cs.o: utst_int.cs.c utst_int.xdr.c
+# ${CCRULE}
+
+#utst_int.xdr.o: utst_int.xdr.c utst_int.h
+# ${CCRULE}
+
+utst_int.cs.c: ${srcdir}/utst_int.xg
+ ${RXGEN} -C -o $@ ${srcdir}/utst_int.xg
+
+utst_int.ss.c: ${srcdir}/utst_int.xg
+ ${RXGEN} -S -o $@ ${srcdir}/utst_int.xg
+
+utst_int.xdr.c: ${srcdir}/utst_int.xg
+ ${RXGEN} -c -o $@ ${srcdir}/utst_int.xg
+
+utst_int.h: ${srcdir}/utst_int.xg
+ ${RXGEN} -h -o $@ ${srcdir}/utst_int.xg
+
+utst_int.cs.c: utst_int.h
+utst_int.ss.c: utst_int.h
+utst_int.xdr.c: utst_int.h
+
+utst_server.o: ${srcdir}/utst_server.c ${INCLS}
+ ${CCRULE}
+
+utst_client.o: ${srcdir}/utst_client.c ${INCLS}
+ ${CCRULE}
+
+udebug.o: ${srcdir}/udebug.c ${INCLS} AFS_component_version_number.c
+ ${CCRULE}
+
+# ${CC} ${CFLAGS} -I. -I${TOP_INCDIR} -I${TOP_INCDIR}/afs -c ${srcdir}/udebug.c
+
+uerrors.o: uerrors.c
+ ${CCRULE}
+
+uerrors.c ubik.h: ${srcdir}/uerrors.et ${srcdir}/ubik.p.h
+ $(RM) -f ubik.h uerrors.c
+ ${COMPILE_ET} -p ${srcdir} uerrors -h ubik
+
+libubik_pthread.a: ${LIBOBJS} AFS_component_version_number.o
+ -$(RM) -f $@
+ $(AR) crc $@ ${LIBOBJS} AFS_component_version_number.o
+ $(RANLIB) $@
+
+disk.o: ${srcdir}/disk.c ${INCLS}
+ ${CCRULE}
+
+uinit.o: ${srcdir}/uinit.c ${INCLS}
+ ${CCRULE}
+
+remote.o: ${srcdir}/remote.c ${INCLS}
+ ${CCRULE}
+
+beacon.o: ${srcdir}/beacon.c ${INCLS}
+ ${CCRULE}
+
+lock.o: ${srcdir}/lock.c ${INCLS}
+ ${CCRULE}
+
+recovery.o: ${srcdir}/recovery.c ${INCLS}
+ ${CCRULE}
+
+ubik.o: ${srcdir}/ubik.c ${INCLS}
+ ${CCRULE}
+
+phys.o: ${srcdir}/phys.c ${INCLS}
+ ${CCRULE}
+
+vote.o: ${srcdir}/vote.c ${INCLS}
+ ${CCRULE}
+
+ubikcmd.o: ${srcdir}/ubikcmd.c ${INCLS}
+ ${CCRULE}
+
+ubikclient.o: ${srcdir}/ubikclient.c ${INCLS}
+ ${CCRULE}
+
+ubik_int.ss.o: ubik_int.ss.c ${INCLS}
+ ${CCRULE}
+
+ubik_int.cs.o: ubik_int.cs.c ${INCLS}
+ ${CCRULE}
+
+ubik_int.xdr.o: ubik_int.xdr.c ${INCLS}
+ ${CCRULE}
+
+utst_int.ss.o: utst_int.ss.c ${INCLS} utst_int.h
+ ${CCRULE}
+
+utst_int.cs.o: utst_int.cs.c ${INCLS} utst_int.h
+ ${CCRULE}
+
+utst_int.xdr.o: utst_int.xdr.c ${INCLS} utst_int.h
+ ${CCRULE}
+
+#
+# Installation targets
+#
+test: all
+
+install: \
+ ${DESTDIR}${libdir}/libubik_pthread.a \
+ ${DESTDIR}${includedir}/ubik.h \
+ ${DESTDIR}${includedir}/ubik_int.h \
+ ${DESTDIR}${bindir}/udebug \
+ ${DESTDIR}${afssrvbindir}/udebug
+
+${DEST}/bin/udebug ${DEST}/root.server/usr/afs/bin/udebug: udebug
+ ${INSTALL} $? $@
+
+${DEST}/lib/libubik_pthread.a: libubik_pthread.a
+ ${INSTALL} $? $@
+
+${DEST}/include/ubik.h: ubik.h
+ ${INSTALL} $? $@
+
+${DEST}/include/ubik_int.h: ubik_int.h
+ ${INSTALL} $? $@
+
+#
+# Misc. targets
+#
+clean:
+ $(RM) -f *.o utst_server utst_client udebug *.a *.cs.c *.ss.c *.xdr.c
+ $(RM) -f utst_int.h ubik_int.h uerrors.c ubik.h core AFS_component_version_number.c Kubik_int.h
+
+include ../config/Makefile.version
+
+
+${DESTDIR}${libdir}/libubik_pthread.a: libubik_pthread.a
+ ${INSTALL} $? $@
+
+${TOP_LIBDIR}/libubik_pthread.a: libubik_pthread.a
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/ubik.h: ubik.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/ubik.h: ubik.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/ubik_int.h: ubik_int.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/ubik_int.h: ubik_int.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${bindir}/udebug: udebug
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvbindir}/udebug: udebug
+ ${INSTALL} $? $@
+
+dest: \
+ ${DEST}/lib/libubik_pthread.a \
+ ${DEST}/include/ubik.h \
+ ${DEST}/include/ubik_int.h \
+ ${DEST}/bin/udebug \
+ ${DEST}/root.server/usr/afs/bin/udebug
+
--- /dev/null
+# Copyright 2000, International Business Machines Corporation and others.
+# All Rights Reserved.
+#
+# This software has been released under the terms of the IBM Public
+# License. For details, see the LICENSE file in the top-level source
+# directory or online at http://www.openafs.org/dl/license10.html
+
+srcdir=@srcdir@/../vlserver
+include @TOP_OBJDIR@/src/config/Makefile.config
+
+CCRULE=${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c $<
+
+RX=../rx
+UTIL=../util
+
+RXOBJS= rx_pthread.o rxkad_errs.o
+
+UTILOBJS=assert.o uuid.o serverLog.o fileutil.o netutils.o dirpath.o \
+ volparse.o flipbase64.o softsig.o hostparse.o snprintf.o \
+ pthread_glock.o get_krbrlm.o
+
+INCLS=${TOP_INCDIR}/ubik.h \
+ ${TOP_INCDIR}/lwp.h \
+ ${TOP_INCDIR}/lock.h \
+ ${TOP_INCDIR}/rx/rx.h \
+ ${TOP_INCDIR}/rx/xdr.h \
+ ${TOP_INCDIR}/afs/keys.h \
+ ${TOP_INCDIR}/afs/cellconfig.h \
+ vlserver.h ${srcdir}/vlclient.h vldbint.h
+
+LIBS=${RXOBJS} ${UTILOBJS} \
+ ${TOP_LIBDIR}/libubik_pthread.a \
+ ${TOP_LIBDIR}/libafsauthent.a \
+ ${TOP_LIBDIR}/librxstat.a \
+ ${TOP_LIBDIR}/libcom_err.a \
+ ${TOP_LIBDIR}/libcmd.a \
+ ${TOP_LIBDIR}/libsys.a \
+ ${TOP_LIBDIR}/libafsrpc.a \
+ ${LDFLAGS} ${MT_LIBS}
+
+OBJS=vldbint.xdr.o vldbint.cs.o vl_errors.o
+
+
+all: \
+ vlserver vlclient cnvldb vlserver cnvldb vldb_check \
+ Kvldbint.cs.c Kvldbint.xdr.c vldbint.h \
+ ${TOP_LIBDIR}/libvldb.a depinstall
+
+depinstall: \
+ Kvldbint.cs.c Kvldbint.xdr.c vldbint.h \
+ ${TOP_INCDIR}/afs/vl_opcodes.h \
+ ${TOP_INCDIR}/afs/vlserver.h \
+ ${TOP_INCDIR}/afs/vldbint.h \
+ ${TOP_INCDIR}/afs/cnvldb.h
+
+rx_pthread.o: ${RX}/rx_pthread.c
+ ${CCRULE}
+
+rxkad_errs.o: ../rxkad/rxkad_errs.c
+ ${CCRULE}
+
+#
+# get the pthreaded util stuff compiled here. we do this instead of
+# using the non-pthreaded libutil.a. There probably should be a
+# pthreaded version of this library, as we are doing with ubik itself, but...
+#
+
+assert.o: ${UTIL}/assert.c
+ ${CCRULE}
+
+uuid.o: ${UTIL}/uuid.c
+ ${CCRULE}
+
+serverLog.o: ${UTIL}/serverLog.c
+ ${CCRULE}
+
+fileutil.o: ${UTIL}/fileutil.c
+ ${CCRULE}
+
+volparse.o: ${UTIL}/volparse.c
+ ${CCRULE}
+
+flipbase64.o: ${UTIL}/flipbase64.c
+ ${CCRULE}
+
+netutils.o: ${UTIL}/netutils.c
+ ${CCRULE}
+
+dirpath.o: ${UTIL}/dirpath.c
+ ${CCRULE}
+
+softsig.o: ${UTIL}/softsig.c
+ ${CCRULE}
+
+hostparse.o: ${UTIL}/hostparse.c
+ ${CCRULE}
+
+snprintf.o: ${UTIL}/snprintf.c
+ ${CCRULE}
+
+pthread_glock.o: ${UTIL}/pthread_glock.c
+ ${CCRULE}
+
+get_krbrlm.o: ${UTIL}/get_krbrlm.c
+ ${CCRULE}
+
+#
+# Other stuff
+#
+
+
+vldb_check: vldb_check.o ${LIBS}
+ $(CC) ${CFLAGS} -o vldb_check vldb_check.o ${LIBS} ${XLIBS}
+
+vldb_check.o: ${srcdir}/vldb_check.c AFS_component_version_number.o
+ ${CCRULE}
+
+cnvldb: cnvldb.o ${LIBS}
+ $(CC) ${CFLAGS} -o cnvldb cnvldb.o ${LIBS} ${XLIBS}
+
+cnvldb.o: ${srcdir}/cnvldb.c ${srcdir}/cnvldb.h AFS_component_version_number.o
+ ${CCRULE}
+
+sascnvldb: sascnvldb.o ${LIBS}
+ $(CC) ${CFLAGS} -o sascnvldb sascnvldb.o ${LIBS} ${XLIBS}
+
+sascnvldb.o: ${srcdir}/sascnvldb.c ${srcdir}/cnvldb.h AFS_component_version_number.o
+ ${CCRULE}
+
+vlserver: vlserver.o vlutils.o vlprocs.o vldbint.ss.o vldbint.xdr.o $(LIBS)
+ $(CC) ${CFLAGS} -o vlserver vlserver.o vlutils.o vlprocs.o vldbint.ss.o \
+ vldbint.xdr.o $(LIBS) ${XLIBS} ${TOP_LIBDIR}/libaudit.a
+
+vlserver.o: ${srcdir}/vlserver.c ${INCLS} AFS_component_version_number.o
+ ${CCRULE}
+
+vlutils.o: ${srcdir}/vlutils.c ${INCLS}
+ ${CCRULE}
+
+vlprocs.o: ${srcdir}/vlprocs.c ${INCLS}
+ ${CCRULE}
+
+vldbint.ss.o: vldbint.ss.c vldbint.xdr.c
+ ${CCRULE}
+
+vldbint.cs.o: vldbint.cs.c vldbint.xdr.c
+ ${CCRULE}
+
+vldbint.xdr.o: vldbint.xdr.c vldbint.h
+ ${CCRULE}
+
+vldbint.cs.c: ${srcdir}/vldbint.xg
+ ${RXGEN} -u -x -C -o $@ ${srcdir}/vldbint.xg
+
+vldbint.ss.c: ${srcdir}/vldbint.xg
+ ${RXGEN} -x -S -o $@ ${srcdir}/vldbint.xg
+
+vldbint.xdr.c: ${srcdir}/vldbint.xg
+ ${RXGEN} -x -c -o $@ ${srcdir}/vldbint.xg
+
+vldbint.h: ${srcdir}/vldbint.xg
+ ${RXGEN} -u -x -h -o $@ ${srcdir}/vldbint.xg
+
+vldbint.cs.c: vldbint.h
+vldbint.ss.c: vldbint.h
+vldbint.xdr.c: vldbint.h
+
+Kvldbint.cs.c: ${srcdir}/vldbint.xg
+ ${RXGEN} -x -k -C -o $@ ${srcdir}/vldbint.xg
+
+Kvldbint.xdr.c: ${srcdir}/vldbint.xg
+ ${RXGEN} -x -k -c -o $@ ${srcdir}/vldbint.xg
+
+libvldb.a: $(OBJS) AFS_component_version_number.o
+ $(RM) -f $@
+ $(AR) crv $@ $(OBJS) AFS_component_version_number.o
+ $(RANLIB) $@
+
+vlclient: vlclient.o libvldb.a $(LIBS)
+ $(CC) ${CFLAGS} -o vlclient vlclient.o libvldb.a $(LIBS) ${XLIBS} ${TOP_LIBDIR}/libcmd.a
+
+vlclient.o: ${srcdir}/vlclient.c ${INCLS} AFS_component_version_number.o
+ ${CCRULE}
+
+
+vl_errors.o: vl_errors.c
+ ${CCRULE}
+
+vlserver.h vl_errors.c: ${srcdir}/vl_errors.et ${srcdir}/vlserver.p.h
+ $(RM) -f vlserver.h vl_errors.c; ${COMPILE_ET} -p ${srcdir} vl_errors -h vlserver
+
+system: install
+
+${DEST}/root.server/usr/afs/bin/vlserver: vlserver
+ ${INSTALL} $? $@
+
+${DEST}/etc/vldb_convert: cnvldb
+ ${INSTALL} -f $? $@
+
+${TOP_LIBDIR}/libvldb.a: libvldb.a
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/vl_opcodes.h: ${srcdir}/vl_opcodes.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/vlserver.h: vlserver.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/vldbint.h: vldbint.h
+ ${INSTALL} $? $@
+
+${TOP_INCDIR}/afs/cnvldb.h: ${srcdir}/cnvldb.h
+ ${INSTALL} $? $@
+
+install: \
+ ${DESTDIR}${afssrvlibexecdir}/vlserver \
+ ${DESTDIR}${afssrvsbindir}/vldb_convert \
+ ${DESTDIR}${libdir}/afs/libvldb.a \
+ ${DESTDIR}${includedir}/afs/vl_opcodes.h \
+ ${DESTDIR}${includedir}/afs/vlserver.h \
+ ${DESTDIR}${includedir}/afs/vldbint.h \
+ ${DESTDIR}${includedir}/afs/cnvldb.h \
+ ${DESTDIR}${afssrvsbindir}/vldb_check
+
+${DESTDIR}${afssrvlibexecdir}/vlserver: vlserver
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/vldb_convert: cnvldb
+ ${INSTALL} -f $? $@
+
+${DESTDIR}${libdir}/afs/libvldb.a: libvldb.a
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/vl_opcodes.h: ${srcdir}/vl_opcodes.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/vlserver.h: vlserver.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/vldbint.h: vldbint.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${includedir}/afs/cnvldb.h: ${srcdir}/cnvldb.h
+ ${INSTALL} $? $@
+
+${DESTDIR}${afssrvsbindir}/vldb_check: vldb_check
+ ${INSTALL} $? $@
+
+dest: \
+ ${DEST}/root.server/usr/afs/bin/vlserver \
+ ${DEST}/etc/vldb_convert \
+ ${DEST}/lib/afs/libvldb.a \
+ ${DEST}/include/afs/vl_opcodes.h \
+ ${DEST}/include/afs/vlserver.h \
+ ${DEST}/include/afs/vldbint.h \
+ ${DEST}/include/afs/cnvldb.h \
+ ${DEST}/etc/vldb_check
+
+${DEST}/lib/afs/libvldb.a: libvldb.a
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/vl_opcodes.h: ${srcdir}/vl_opcodes.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/vlserver.h: vlserver.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/vldbint.h: vldbint.h
+ ${INSTALL} $? $@
+
+${DEST}/include/afs/cnvldb.h: ${srcdir}/cnvldb.h
+ ${INSTALL} $? $@
+
+${DEST}/etc/vldb_check: vldb_check
+ ${INSTALL} $? $@
+
+#
+# Misc targets
+#
+include ../config/Makefile.version
+
+clean:
+ $(RM) -f *.o *.a *.otl *.xdr.c *.cs.c *.ss.c core \
+ vlserver vlclient cnvldb vldbint.h vlserver.h vldb_check \
+ vl_errors.c AFS_component_version_number.c
temp = POLLTIME;
tt.tv_sec = temp;
tt.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ code = select(0, 0, 0, 0, &tt);
+#else
code = IOMGR_Select(0, 0, 0, 0, &tt);
+#endif
} else
code = 0;
ubik_dprint("Ubik: I am the sync site\n");
ubik_amSyncSite = 1;
syncSiteUntil = oldestYesVote + SMALLTIME;
- LWP_NoYieldSignal(&ubik_amSyncSite);
+#ifndef AFS_PTHREAD_ENV
+#ifndef UBIK_PTHREAD_ENV
+ /* I did not find a corresponding LWP_WaitProcess(&ubik_amSyncSite) --
+ this may be a spurious signal call -- sjenkins */
+ LWP_NoYieldSignal(&ubik_amSyncSite);
+#endif
+#endif
} else {
if (ubik_amSyncSite)
ubik_dprint("Ubik: I am no longer the sync site\n");
}
dbase->version.counter++; /* bump commit count */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dbase->version_cond) == 0);
+#else
LWP_NoYieldSignal(&dbase->version);
-
+#endif
code = udisk_LogEnd(dbase, &dbase->version);
if (code) {
dbase->version.counter--;
free(atrans);
/* Wakeup any writers waiting in BeginTrans() */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dbase->flags_cond) == 0);
+#else
LWP_NoYieldSignal(&dbase->flags);
+#endif
return 0;
}
#include <netinet/in.h>
#endif
#include <sys/stat.h>
+
+/* #if defined (AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV) */
+#if 0 /* temporary hack - klm */
+/* nothing */
+#else
#include <lwp.h>
+#endif
+
#include <lock.h>
#include <errno.h>
#include <string.h>
urecovery_ResetState(void)
{
urecovery_state = 0;
+#if !defined(AFS_PTHREAD_ENV) || !defined(UBIK_PTHREAD_ENV)
+ /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
LWP_NoYieldSignal(&urecovery_state);
+#endif
return 0;
}
int
urecovery_LostServer(void)
{
+#if !defined(AFS_PTHREAD_ENV) || !defined(UBIK_PTHREAD_ENV)
+ /* No corresponding LWP_WaitProcess found anywhere for this -- klm */
LWP_NoYieldSignal(&urecovery_state);
return 0;
+#endif
}
/* return true iff we have a current database (called by both sync
adbase->version.counter = 0;
(*adbase->setlabel) (adbase, 0, &adbase->version);
}
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&adbase->version_cond) == 0);
+#else
LWP_NoYieldSignal(&adbase->version);
+#endif
}
return 0;
}
/* Run through this loop every 4 seconds */
tv.tv_sec = 4;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
ubik_dprint("recovery running in state %x\n", urecovery_state);
urecovery_state |= UBIK_RECHAVEDB;
}
udisk_Invalidate(ubik_dbase, 0); /* data has changed */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
+#else
LWP_NoYieldSignal(&ubik_dbase->version);
+#endif
DBRELE(ubik_dbase);
}
#if defined(UBIK_PAUSE)
code =
(*ubik_dbase->setlabel) (ubik_dbase, 0, &ubik_dbase->version);
udisk_Invalidate(ubik_dbase, 0); /* data may have changed */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&ubik_dbase->version_cond) == 0);
+#else
LWP_NoYieldSignal(&ubik_dbase->version);
+#endif
DBRELE(ubik_dbase);
}
while ((ubik_dbase->flags & DBWRITING) && (safety < 500)) {
DBRELE(ubik_dbase);
/* sleep for a little while */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
tv.tv_usec += 10000;
safety++;
DBHOLD(ubik_dbase);
memcpy(&ubik_dbase->version, &tversion, sizeof(struct ubik_version));
while (length > 0) {
tlen = (length > sizeof(tbuffer) ? sizeof(tbuffer) : length);
-#if !defined(OLD_URECOVERY) && defined(AFS_PTHREAD_ENV)
+#if !defined(OLD_URECOVERY) && !defined(AFS_PTHREAD_ENV)
if (pass % 4 == 0)
IOMGR_Poll();
#endif
#endif
memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
udisk_Invalidate(dbase, file); /* new dbase, flush disk buffers */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_cond_broadcast(&dbase->version_cond) == 0);
+#else
LWP_NoYieldSignal(&dbase->version);
+#endif
DBRELE(dbase);
failed:
if (code) {
#include "ubik.h"
#include "ubik_int.h"
+#include <lwp.h> /* temporary hack by klm */
+
#define ERROR_EXIT(code) {error=(code); goto error_exit;}
/* This system is organized in a hierarchical set of related modules. Modules
{
register struct ubik_dbase *tdb;
register afs_int32 code;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ pthread_t rxServerThread; /* pthread variables */
+ pthread_t ubeacon_InteractThread;
+ pthread_t urecovery_InteractThread;
+ pthread_attr_t rxServer_tattr;
+ pthread_attr_t ubeacon_Interact_tattr;
+ pthread_attr_t urecovery_Interact_tattr;
+#else
PROCESS junk;
+#endif
+
afs_int32 secIndex;
struct rx_securityClass *secClass;
ubik_dbase = tdb; /* for now, only one db per server; can fix later when we have names for the other dbases */
/* initialize RX */
+
+ /* the following call is idempotent so when/if it got called earlier,
+ * by whatever called us, it doesn't really matter -- klm */
+ code = rx_Init(myPort);
+ if (code < 0)
+ return code;
+
ubik_callPortal = myPort;
/* try to get an additional security object */
ubik_sc[0] = rxnull_NewServerSecurityObject();
}
/* for backwards compat this should keep working as it does now
and not host bind */
+#if 0
+ /* This really needs to be up above, where I have put it. It works
+ * here when we're non-pthreaded, but the code above, when using
+ * pthreads may (and almost certainly does) end up calling on a
+ * pthread resource which gets initialized by rx_Init. The end
+ * result is that an assert fails and the program dies. -- klm
+ */
code = rx_Init(myPort);
if (code < 0)
return code;
+#endif
+
tservice =
rx_NewService(0, VOTE_SERVICE_ID, "VOTE", ubik_sc, 3,
VOTE_ExecuteRequest);
* UpdateInterfaceAddr RPC that occurs in ubeacon_InitServerList. This avoids
* the "steplock" problem in ubik initialization. Defect 11037.
*/
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+/* do assert stuff */
+ assert(pthread_attr_init(&rxServer_tattr) == 0);
+ assert(pthread_attr_setdetachstate(&rxServer_tattr, PTHREAD_CREATE_DETACHED) == 0);
+/* assert(pthread_attr_setstacksize(&rxServer_tattr, rx_stackSize) == 0); */
+
+ assert(pthread_create(&rxServerThread, &rxServer_tattr, (void *)rx_ServerProc, NULL) == 0);
+#else
LWP_CreateProcess(rx_ServerProc, rx_stackSize, RX_PROCESS_PRIORITY,
- (void *)0, "rx_ServerProc", &junk);
+ (void *)0, "rx_ServerProc", &junk);
+#endif
/* do basic initialization */
code = uvote_Init();
return code;
/* now start up async processes */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+/* do assert stuff */
+ assert(pthread_attr_init(&ubeacon_Interact_tattr) == 0);
+ assert(pthread_attr_setdetachstate(&ubeacon_Interact_tattr, PTHREAD_CREATE_DETACHED) == 0);
+/* assert(pthread_attr_setstacksize(&ubeacon_Interact_tattr, 16384) == 0); */
+ /* need another attr set here for priority??? - klm */
+
+ assert(pthread_create(&ubeacon_InteractThread, &ubeacon_Interact_tattr,
+ (void *)ubeacon_Interact, NULL) == 0);
+#else
code = LWP_CreateProcess(ubeacon_Interact, 16384 /*8192 */ ,
LWP_MAX_PRIORITY - 1, (void *)0, "beacon",
&junk);
if (code)
return code;
+#endif
+
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+/* do assert stuff */
+ assert(pthread_attr_init(&urecovery_Interact_tattr) == 0);
+ assert(pthread_attr_setdetachstate(&urecovery_Interact_tattr, PTHREAD_CREATE_DETACHED) == 0);
+/* assert(pthread_attr_setstacksize(&urecovery_Interact_tattr, 16384) == 0); */
+ /* need another attr set here for priority??? - klm */
+
+ assert(pthread_create(&urecovery_InteractThread, &urecovery_Interact_tattr,
+ (void *)urecovery_Interact, NULL) == 0);
+
+ return 0; /* is this correct? - klm */
+#else
code = LWP_CreateProcess(urecovery_Interact, 16384 /*8192 */ ,
LWP_MAX_PRIORITY - 1, (void *)0, "recovery",
&junk);
return code;
+#endif
+
}
int
#endif
return UNOQUORUM; /* a white lie */
}
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ sleep(2);
+#else
IOMGR_Sleep(2);
+#endif
DBHOLD(dbase);
}
#endif /* UBIK_PAUSE */
/* if we're writing already, wait */
while (dbase->flags & DBWRITING) {
DBRELE(dbase);
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_mutex_lock(&dbase->flags_mutex) == 0);
+ assert(pthread_cond_wait(&dbase->flags_cond, &dbase->flags_mutex) == 0);
+ assert(pthread_mutex_unlock(&dbase->flags_mutex) == 0);
+#else
LWP_WaitProcess(&dbase->flags);
+#endif
DBHOLD(dbase);
}
if (!ubeacon_AmSyncSite()) {
code = 1;
tv.tv_sec = 1; /* try again after a while (ha ha) */
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv); /* poll, should we wait on something? */
+#endif
break;
}
}
/* wait until version # changes, and then return */
if (vcmp(*aversion, adatabase->version) != 0)
return 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ assert(pthread_mutex_lock(&adatabase->version_mutex) == 0);
+ assert(pthread_cond_wait(&adatabase->version_cond,&adatabase->version_mutex) == 0);
+ assert(pthread_mutex_unlock(&adatabase->version_mutex) == 0);
+#else
LWP_WaitProcess(&adatabase->version); /* same vers, just wait */
+#endif
}
}
#ifdef AFS_PTHREAD_ENV
#include <pthread.h>
#include <assert.h>
+#else
+#include <lwp.h>
#endif
/* per-client structure for ubik */
int (*getnfiles) (struct ubik_dbase * adbase); /* find out number of files */
short readers; /* number of current read transactions */
struct ubik_version cachedVersion; /* version of caller's cached data */
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ pthread_cond_t version_cond; /* condition variable to manage changes to version */
+ pthread_cond_t flags_cond; /* condition variable to manage changes to flags */
+ pthread_mutex_t version_mutex;
+ pthread_mutex_t flags_mutex;
+#endif
};
/* procedures for automatically authenticating ubik connections */
tv.tv_sec = 1;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
printf("Repeating the SAMPLE operations again...\n");
}
} else if (!strcmp(argv[i], "-mget")) {
tv.tv_sec = 1;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
}
}
if (sleepTime) {
tv.tv_sec = sleepTime;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
/* read the original value */
code = ubik_Read(tt, &temp, sizeof(afs_int32));
if (sleepTime) {
tv.tv_sec = sleepTime;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
/* read the value */
code = ubik_Read(tt, &temp, sizeof(afs_int32));
if (sleepTime) {
tv.tv_sec = sleepTime;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
/* read the value */
code = ubik_Read(tt, &temp, sizeof(afs_int32));
if (sleepTime) {
tv.tv_sec = sleepTime;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
/* shrink the file */
code = ubik_Truncate(tt, 0);
if (sleepTime) {
tv.tv_sec = sleepTime;
tv.tv_usec = 0;
+#if defined(AFS_PTHREAD_ENV) && defined(UBIK_PTHREAD_ENV)
+ select(0, 0, 0, 0, &tv);
+#else
IOMGR_Select(0, 0, 0, 0, &tv);
+#endif
}
/* read the original value */
code = ubik_Read(tt, &temp, sizeof(afs_int32));
hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
dirpath.o fileutil.o netutils.o flipbase64.o fstab.o \
afs_atomlist.o afs_lhash.o snprintf.o strlcat.o strlcpy.o strnlen.o \
- daemon.o rxkstats.o ${REGEX_OBJ}
+ pthread_glock.o daemon.o rxkstats.o ${REGEX_OBJ}
includes = \
${TOP_INCDIR}/afs/dirpath.h \
$(AR) crv util.a ${objects} AFS_component_version_number.o
$(RANLIB) util.a
+pthread_glock.o: ${srcdir}/pthread_glock.c ${includes}
+ ${MT_CC} ${CFLAGS} ${MT_CFLAGS} -c ${srcdir}/pthread_glock.c
+
assert.o: ${srcdir}/assert.c ${includes}
${CCOBJ} ${CFLAGS} -c ${srcdir}/assert.c
{
int rc = 0;
+/*
+ * FSLog("Entered pthread_recursive_mutex_lock, thread id is %d\n",
+ * pthread_self());
+ */
+
(glock_init || pthread_once(&glock_init_once, glock_init_func));
if (mut->locked) {
{
int rc = 0;
+/*
+ * FSLog("Entered pthread_recursive_mutex_unlock, thread id is %d\n",
+ * pthread_self());
+ *
+ */
+
(glock_init || pthread_once(&glock_init_once, glock_init_func));
if ((mut->locked) && (pthread_equal(mut->owner, pthread_self()))) {
#else
+#include <syslog.h>
+
#define LOCK_GLOBAL_MUTEX
#define UNLOCK_GLOBAL_MUTEX
#include <des.h>
#include <des/stats.h>
-#ifndef AFS_PTHREAD_ENV
+#ifndef AFS_PTHREAD_ENV
struct rxkad_stats rxkad_stats = { { 0 } };
+#else
+rxkad_stats_t rxkad_stats = { { 0 } };
#endif
while (nextblockindex =
NextEntry(trans, nextblockindex, &tentry, &count)) {
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
match = 0;
while (nextblockindex =
NextEntry(trans, nextblockindex, &tentry, &count)) {
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
blockindex = startindex;
while (blockindex = NextEntry(trans, blockindex, &tentry, &count)) {
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
match = 0;
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
match = 0;
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
for (blockindex = NextEntry(atrans, 0, &tentry, &count); blockindex;
blockindex = NextEntry(atrans, blockindex, &tentry, &count)) {
if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
IOMGR_Poll();
+#endif
pollcount = 0;
}
for (j = 0; j < NMAXNSERVERS; j++) {
static void
CheckSignal_Signal()
{
+#if defined(AFS_PTHREAD_ENV)
+ CheckSignal(0);
+#else
IOMGR_SoftSig(CheckSignal, 0);
+#endif
}
static void *