From: David Levine Date: Wed, 6 Mar 2013 02:17:08 +0000 (-0600) Subject: Added lockmethod pseudocomponent to mhparam so that users X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/518dfa384e0c188a798134f3370c573ca307c51c?ds=inline;hp=--cc Added lockmethod pseudocomponent to mhparam so that users can easily find out what locking method was configured in. --- 518dfa384e0c188a798134f3370c573ca307c51c diff --git a/man/mh-folders.man b/man/mh-folders.man index 06296bcf..59de18da 100644 --- a/man/mh-folders.man +++ b/man/mh-folders.man @@ -1,4 +1,4 @@ -.TH MH-MAIL %manext5% "March 3, 2013" "%nmhversion%" +.TH MH-MAIL %manext5% "March 5, 2013" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -15,7 +15,6 @@ A .B nmh folder corresponds to directory. There are no limits on folder names beyond those of the host filesystem. -.I Is that right? .RE .PP .B one message per file @@ -31,7 +30,7 @@ the existence of non\-message files that are not prefixed with a \*(lq.\*(rq. .PP The filename for a new message is one greater than the highest numbered message in -the folder; its full path can be accessed by the pseudo\-sequence +the folder; its full path can be accessed by the pseudo\-sequence .I new (e.g., .B mhpath @@ -120,12 +119,13 @@ these files when accessing them. Any program outside of that accesses these files must be sure to lock them using the same locking method. The locking method is selected when .B nmh -is configured. By default, kernel-level locking is used if -appropriate for the platform, and it is for popular platforms. That -default should also be the same as used by the +is configured and can be accessed as a string using +.BR "mhparam lockmethod" . +By default, kernel-level locking is used if appropriate for the +platform, and it is for popular platforms. That default should also +be the same as used by the .B mail program, if provided on the platform. -.I Should we add a lockmethod component to mhparam so users can easily detect it? .SH FILES .fc ^ ~ .nf @@ -137,6 +137,7 @@ program, if provided on the platform. .SH "SEE ALSO" .I .IR mail (1), +.IR mh\-param (1), .IR mh\-path (1), .IR mh\-profile (5), .IR mh\-sequence (5) diff --git a/man/mhparam.man b/man/mhparam.man index cc614ef0..6f51ffd9 100644 --- a/man/mhparam.man +++ b/man/mhparam.man @@ -50,9 +50,11 @@ the locations of the nmh .I etcdir and .I libdir -install directories and all +install directories, all .I proc -settings. The +settings, and the locking method with which the +.B nmh +installation was configured. The .B \-debug switch displays all such other information available from .BR mhparam . @@ -88,6 +90,9 @@ context: context % mhparam libdir %libdir% + +% mhparam lockmethod +fcntl .fi .RE .PP diff --git a/uip/mhparam.c b/uip/mhparam.c index c4b0af2e..414255ba 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -12,11 +12,6 @@ #include -extern char *mhlibdir; -extern char *mhetcdir; - -char *sbackup = BACKUP_PREFIX; - #define MHPARAM_SWITCHES \ X("components", 0, COMPSW) \ X("nocomponents", 0, NCOMPSW) \ @@ -33,6 +28,25 @@ DEFINE_SWITCH_ENUM(MHPARAM); DEFINE_SWITCH_ARRAY(MHPARAM, switches); #undef X +extern char *mhlibdir; +extern char *mhetcdir; + +char *sbackup = BACKUP_PREFIX; + +char *lockmethod = +#if defined FCNTL_LOCKING + "fcntl" +#elif defined FLOCK_LOCKING + "flock" +#elif defined LOCKF_LOCKING + "lockf" +#elif defined DOT_LOCKING + "dot" +#else + "none" +#endif + ; + struct proc { char *p_name; char **p_field; @@ -65,6 +79,7 @@ static struct proc procs [] = { { "etcdir", &mhetcdir }, { "libdir", &mhlibdir }, { "sbackup", &sbackup }, + { "lockmethod", &lockmethod }, { NULL, NULL }, };