I am porting from Linux to FreeBSD and have run into ::mknod() failing with errno:
[EINVAL] Creating anything else than a block or character spe-
cial file (or a whiteout) is not supported.
But I also see it states earlier on the man page:
The mknod() system call requires super-user privileges.
So what would be a good replacement call to use that will work on both Linux and FreeBSD?
My code snippet where this occurs:
mode_t mode
= S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
if (::mknod(_resolvedName, mode, 0)) {
My objective is to create an empty file with the correct permissions.