On 29.06.2013 10:09, NormW wrote: > Hi All, > Pardon for the noise. > I could build all .c executables in 1.7.x (<=.10) but find the 1.8.0 > series has mmap(), which my now 'dated' OS does not have. Two files > have the function, namely:
Let me guess ... Windows 95? (Or "98" or "Me" or whatever they wanted to call it) > libsvn_diff\diff_file.c, > libsvn_subr\named_atomic.c > > The former is guarded by an #if !APR_HAS_MMAP substitute, while the > second file does not; the question then 'is there (likely to be) a > suitable alternate to use of mmap in named_atomic.c in the foreseeable > future?' or have I arrived at the end of the branch? Looks like it could be fixed, as the code does have an explicit check for named atomic support; it just doesn't use the APR_HAS_MMAP flag as well. Can you try the attached patch? -- Brane -- Branko Čibej | Director of Subversion WANdisco // Non-Stop Data e. br...@wandisco.com
Index: named_atomic.c =================================================================== --- named_atomic.c (revision 1497896) +++ named_atomic.c (working copy) @@ -251,6 +251,7 @@ struct svn_atomic_namespace__t */ static svn_mutex__t *thread_mutex = NULL; +#if APR_HAS_MMAP /* Initialization flag for the above used by svn_atomic__init_once. */ static volatile svn_atomic_t mutex_initialized = FALSE; @@ -266,6 +267,7 @@ init_thread_mutex(void *baton, apr_pool_t *pool) return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, global_pool); } +#endif /* APR_HAS_MMAP */ /* Utility that acquires our global mutex and converts error types. */ @@ -297,6 +299,7 @@ unlock(struct mutex_t *mutex, svn_error_t * outer_ unlock_err)); } +#if APR_HAS_MMAP /* The last user to close a particular namespace should also remove the * lock file. Failure to do so, however, does not affect further uses * of the same namespace. @@ -318,6 +321,7 @@ delete_lock_file(void *arg) return status; } +#endif /* APR_HAS_MMAP */ /* Validate the ATOMIC parameter, i.e it's address. Correct code will * never need this but if someone should accidentally to use a NULL or @@ -351,7 +355,11 @@ return_atomic(svn_named_atomic__t **atomic, svn_boolean_t svn_named_atomic__is_supported(void) { -#ifdef _WIN32 +#if !APR_HAS_MMAP + return FALSE; +#elif !defined(_WIN32) + return TRUE; +#else static svn_tristate_t result = svn_tristate_unknown; if (result == svn_tristate_unknown) @@ -373,9 +381,7 @@ svn_named_atomic__is_supported(void) } return result == svn_tristate_true; -#else - return TRUE; -#endif +#endif /* _WIN32 */ } svn_boolean_t @@ -389,6 +395,9 @@ svn_atomic_namespace__create(svn_atomic_namespace_ const char *name, apr_pool_t *result_pool) { +#if !APR_HAS_MMAP + return svn_error_create(APR_ENOTIMPL, NULL, NULL); +#else apr_status_t apr_err; svn_error_t *err; apr_file_t *file; @@ -489,6 +498,7 @@ svn_atomic_namespace__create(svn_atomic_namespace_ /* Unlock to allow other processes may access the shared memory as well. */ return unlock(&new_ns->mutex, err); +#endif /* APR_HAS_MMAP */ } svn_error_t *