Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
pathlocks.hh File Reference
#include "file-descriptor.hh"

Go to the source code of this file.

Classes

class  nix::PathLocks
 
struct  nix::FdLock
 

Enumerations

enum  LockType { ltRead , ltWrite , ltNone }
 

Functions

AutoCloseFD nix::openLockFile (const Path &path, bool create)
 
void nix::deleteLockFile (const Path &path, Descriptor desc)
 
bool nix::lockFile (Descriptor desc, LockType lockType, bool wait)
 

Function Documentation

◆ deleteLockFile()

void nix::deleteLockFile ( const Path & path,
Descriptor desc )

Delete an open lock file.

◆ openLockFile()

AutoCloseFD nix::openLockFile ( const Path & path,
bool create )

Open (possibly create) a lock file and return the file descriptor. -1 is returned if create is false and the lock could not be opened because it doesn't exist. Any other error throws an exception.