int fd = -1, err = 0;
struct flock lck;
struct stat st;
char lcktxt[11];
char lcktxt[20];
char *nfile;
if (!do_lock)
lck.l_len = 11;
lck.l_pid = 0;
if (lock) {
// NOTE `long` type on amd64, being printed, could take up to 18 decimal digits
// (according output of std::numeric_limits<long>::digits10)
sprintf(lcktxt, "%10li\n", (long)getpid());
} else {
sprintf(lcktxt, "%10s\n", "");