Implement file-mapped shared memory

svn path=/trunk/boinc/; revision=13471
This commit is contained in:
Charlie Fenton 2007-08-28 00:28:11 +00:00
parent 25ec43a839
commit ca051eb314
1 changed files with 1 additions and 2 deletions

View File

@ -170,7 +170,6 @@ int detach_shmem(void* p) {
int create_shmem(char *path, size_t size, void** pp) {
int fd, retval;
ssize_t n;
struct stat sbuf;
fstore_t storestruct = { F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, size, 0 };
@ -196,7 +195,7 @@ int create_shmem(char *path, size_t size, void** pp) {
storestruct.fst_length = size - sbuf.st_size;
retval = fcntl(fd, F_PREALLOCATE, &storestruct);
lseek(fd, size-1, SEEK_SET);
n = write(fd, "\0", 1);
write(fd, "\0", 1);
}
}