9 #include "local_proto.h" 30 int main(
int argc,
char *argv[])
37 if (argc != 3 || sscanf(argv[2],
"%d", &lockpid) != 1)
42 G_warning(
_(
"Concurrent mapset locking is not supported on Windows"));
46 if ((lock = open(
file, 0)) >= 0) {
48 if (read(lock, &pid,
sizeof pid) ==
sizeof pid)
55 if ((lock = creat(
file, 0666)) < 0) {
59 if (write(lock, &lockpid,
sizeof lockpid) !=
sizeof lockpid)
61 file, strerror(errno));
77 if (kill(pid, 0) == 0)
79 return errno != ESRCH;
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_sleep(unsigned int)
int find_process(int pid)
int main(int argc, char *argv[])
void G_warning(const char *,...) __attribute__((format(printf