#include /* for struct flock */ typedef struct flock fileLock_t; typedef fileLock_t *fileLock_p; /* make a nice clean lock */ fileLock_p makeLock(void); /* obtains a write lock on the fd, returns the call to fcntl */ int getLock(fileLock_p lock, int fd); /* unlocks the write lock on fd, returns the call to fcntl */ int unLock(fileLock_p lock, int fd); /* frees the lock made by a makeLock */ void freeLock(fileLock_p lock);