9#include "local_proto.h"
11#include <grass/glocale.h>
30int 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)
77 if (kill(pid, 0) == 0)
79 return errno != ESRCH;
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
void G_warning(const char *msg,...)
Print a warning message to stderr.
int find_process(int pid)
void G_sleep(unsigned int seconds)