-/*
- * Function: lock_reg
- *
- * Purpose: lock a file with fctnl
- *
- * Arguments:
- *
- * fd (r) File descriptor
- * cmd (r) cmd to fcntl, only F_SETLK is usable here
- * type (r) F_RDLCK, F_WRLCK, F_UNLCK
- * offset (r) byte offset relative to l_whence
- * whence (r) SEEK_SET, SEEK_CUR, SEEK_END
- * len (r) no. of bytes (0 means to EOF)
- *
- * Returns: 0 on success, -1 on failure
- * fcntl return value and errno
- *
- * Effects:
- *
- * Function called by macros to ease locking.
- */