| 12 |
|
#include <string.h> |
| 13 |
|
#include <signal.h> |
| 14 |
|
#include <sys/stat.h> |
| 15 |
– |
#ifdef _WIN32 |
| 16 |
– |
#include <process.h> /* getpid() */ |
| 17 |
– |
#endif |
| 15 |
|
|
| 16 |
+ |
#include "rtprocess.h" /* getpid() */ |
| 17 |
|
#include "standard.h" |
| 18 |
+ |
#include "platform.h" |
| 19 |
|
#include "random.h" |
| 20 |
|
|
| 21 |
|
#ifdef F_SETLKW |
| 26 |
|
#define TIMELIM (8*3600) /* time limit for holding pattern */ |
| 27 |
|
#endif |
| 28 |
|
|
| 30 |
– |
#ifndef freebsd |
| 31 |
– |
#define mkfifo(fn,md) mknod(fn, S_IFIFO|(md), 0) |
| 32 |
– |
#endif |
| 33 |
– |
|
| 29 |
|
extern void io_process(); |
| 30 |
|
|
| 31 |
|
extern int headismine; /* boolean true if header belongs to me */ |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
|
| 88 |
+ |
void |
| 89 |
|
persistfile(pfn) /* open persist file and lock it */ |
| 90 |
|
char *pfn; |
| 91 |
|
{ |
| 137 |
|
n = strlen(buf); |
| 138 |
|
if (write(persistfd, buf, n) < n) |
| 139 |
|
error(SYSTEM, "error writing persist file"); |
| 140 |
< |
lseek(persistfd, (off_t)0L, 0); |
| 140 |
> |
lseek(persistfd, (off_t)0, SEEK_SET); |
| 141 |
|
/* wait TIMELIM for someone to signal us */ |
| 142 |
|
got_io = 0; |
| 143 |
|
signal(SIGIO, sig_io); |