Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

appserver_lock.h File Reference


Detailed Description

Code to for an exclusive file lock that does not block if the lock is already held.

Copyright (c) 2006 PalmSource, Inc. All right reserverd.

#include <unistd.h>
#include <fcntl.h>
#include <glib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include <hiker/config.h>

Go to the source code of this file.

Defines

#define _ALP_APPSERVERLOCK_H   1

Functions

gboolean alp_prv_acquirelock (char *filename)
 gboolean alp_prv_aquirelock( char *filename );


Define Documentation

#define _ALP_APPSERVERLOCK_H   1
 


Function Documentation

gboolean alp_prv_acquirelock char *  filename  ) 
 

gboolean alp_prv_aquirelock( char *filename );

alp_prv_aquirelock locks the file pointed to by filename. It is OK if the file does not exist. It will create it and then lock it. The same process can lock the file mulitple times. However it does not keep track of the number of times. It will return TRUE if it aquired the lock, otherwise it returns FALSE. On error it returns FALSE. This is the standard UNIX file lock so the OS will release the lock when the process dies.


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4