Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/./man3mail/maillock.3mail
Real path: /usr/share/man/man3mail/maillock.3mail
Zurück
'\" te .\" Copyright (c) 1989, AT&T. All rights reserved. .\" Copyright (c) 1999, 2020, Oracle and/or its affiliates. .TH maillock 3MAIL "14 May 2018" "Oracle Solaris 11.4" "User Mailbox Library Functions" .SH NAME maillock, mailunlock, touchlock \- functions to manage lockfile(s) for user's mailbox .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lmail\fR [ \fIlibrary\fR ... ] #include <maillock.h> \fBint\fR \fBmaillock\fR(\fBconst char *\fR\fIuser\fR, \fBint\fR \fIretrycnt\fR); .fi .LP .nf \fBvoid\fR \fBmailunlock\fR(\fBvoid\fR); .fi .LP .nf \fBvoid\fR \fBtouchlock\fR(\fBvoid\fR); .fi .SH DESCRIPTION .sp .LP The \fBmaillock()\fR function attempts to create a lockfile for the user's mailfile. If a lockfile already exists, and it has not been modified in the last 5 minutes, \fBmaillock()\fR will remove the lockfile and set its own lockfile. .sp .LP It is crucial that programs locking mail files refresh their locks at least every three minutes to maintain the lock. Refresh the lockfile by calling the \fBtouchlock()\fR function with no arguments. .sp .LP The algorithm used to determine the age of the lockfile takes into account clock drift between machines using a network file system. A zero is written into the lockfile so that the lock will be respected by systems running the standard version of System V. .sp .LP If the lockfile has been modified in the last 5 minutes the process will sleep until the lock is available. The sleep algorithm is to sleep for 5 seconds times the attempt number. That is, the first sleep will be for 5 seconds, the next sleep will be for 10 seconds, etc. until the number of attempts reaches \fIretrycnt\fR. .sp .LP When the lockfile is no longer needed, it should be removed by calling \fBmailunlock()\fR. .sp .LP The \fIuser\fR argument is the login name of the user for whose mailbox the lockfile will be created. \fBmaillock()\fR assumes that user's mailfiles are in the "standard" place as defined in <\fBmaillock.h\fR>. .SH RETURN VALUES .sp .LP Upon successful completion, .\fBmaillock()\fR returns \fB0\fR. Otherwise it returns \fB\(mi1\fR. .SH FILES .sp .ne 2 .mk .na \fB\fB/var/mail/*\fR\fR .ad .RS 20n .rt user mailbox files .RE .sp .ne 2 .mk .na \fB\fB/var/mail/*.lock\fR\fR .ad .RS 20n .rt user mailbox lockfiles .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ MT-Level Unsafe .TE .sp .SH SEE ALSO .sp .LP \fBlibmail\fR(3LIB), \fBattributes\fR(7) .SH NOTES .sp .LP The \fBmailunlock()\fR function will only remove the lockfile created from the most previous call to \fBmaillock()\fR. Calling \fBmaillock()\fR for different users without intervening calls to \fBmailunlock()\fR will cause the initially created lockfile(s) to remain, potentially blocking subsequent message delivery until the current process finally terminates.