1 /* SCCS Id: @(#)macunix.c 3.1 94/11/07 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* This file collects some Unix dependencies */
14 for (lp = s; *lp; lp++) {
15 if (*lp == '.' || *lp == ':')
24 int pid = getpid(); /* Process ID */
26 set_levelfile_name (lock, 0);
28 if ((fd = open (lock, O_RDWR | O_EXCL | O_CREAT, LEVL_TYPE)) == -1) {
29 raw_printf ("Could not lock the game %s.", lock);
30 panic ("Another game in progress?");
33 if (write (fd, (char *)&pid, sizeof (pid)) != sizeof (pid)) {
34 raw_printf ("Could not lock the game %s.", lock);
35 panic("Disk locked?");