~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/fileLock.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include "unicodeTypes.h"
32
32
 
33
 
// Horrible hack that exists to please VMX; should be removed ASAP
34
 
EXTERN int  FileLock_DeleteFileVMX(ConstUnicode filePath);
35
 
 
36
33
// The default time, in msec, to wait for a lock before giving up
37
34
#define FILELOCK_DEFAULT_WAIT 2500
38
35
 
50
47
#define FILELOCK_OVERHEAD 15
51
48
 
52
49
// File locking functions
53
 
EXTERN void *FileLock_Lock(ConstUnicode filePath,
54
 
                           const Bool readOnly,
55
 
                           const uint32 msecMaxWaitTime,
56
 
                           int *err);
57
 
 
58
 
EXTERN int FileLock_Unlock(ConstUnicode filePath,
59
 
                           const void *fileLockToken);
60
 
 
61
 
EXTERN Bool FileLock_IsLocked(ConstUnicode filePath,
62
 
                              int *err);
63
 
 
64
 
EXTERN int FileLock_Remove(ConstUnicode filePath);
65
 
EXTERN int FileLock_CleanupVM(ConstUnicode cfgfilePath);
 
50
typedef struct FileLockToken FileLockToken;
 
51
 
 
52
FileLockToken *FileLock_Lock(ConstUnicode filePath,
 
53
                             const Bool readOnly,
 
54
                             const uint32 msecMaxWaitTime,
 
55
                             int *err);
 
56
 
 
57
Unicode FileLock_TokenPathName(const FileLockToken *fileLockToken);
 
58
int FileLock_Unlock(const FileLockToken *lockToken);
 
59
 
 
60
Bool FileLock_IsLocked(ConstUnicode filePath,
 
61
                       int *err);
 
62
 
 
63
int FileLock_Remove(ConstUnicode filePath);
 
64
int FileLock_CleanupVM(ConstUnicode cfgfilePath);
66
65
 
67
66
// Device locking functions, for compatibility
68
 
EXTERN int FileLock_LockDevice(const char *device);
69
 
EXTERN Bool FileLock_UnlockDevice(const char *device);
 
67
int FileLock_LockDevice(const char *device);
 
68
Bool FileLock_UnlockDevice(const char *device);
70
69
 
71
70
#endif // ifndef _FILELOCK_H_