use std::os::fd::AsRawFd;
use std::path::Path;
pub(crate) fn lock<F: AsRawFd>(file: &F) -> i32 {
unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_EX | libc::LOCK_NB) }
}
pub(crate) fn unlock<F: AsRawFd>(file: &F) -> i32 {
unsafe { libc::flock(file.as_raw_fd(), libc::LOCK_UN) }
}
pub(crate) fn symlink(rel_src: &Path, _src: &Path, dst: &Path) -> std::io::Result<()> {
std::os::unix::fs::symlink(rel_src, dst)
}