diff --git a/.vscode/settings.json b/.vscode/settings.json index 7fee802..37745ce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "files.associations": { - "unistd.h": "c" + "unistd.h": "c", + "mman.h": "c" } } \ No newline at end of file diff --git a/System Abstraction/linux/cdb_file.c b/System Abstraction/linux/cdb_file.c index 7f7572d..c3e3106 100644 --- a/System Abstraction/linux/cdb_file.c +++ b/System Abstraction/linux/cdb_file.c @@ -5,6 +5,7 @@ #include #include #include +#include #include struct sus_File_impl{ @@ -21,6 +22,8 @@ sus_File sus_fileOpenInMem(char * fileName, unsigned long parameter) { int fd = open(fileName, flags, S_IRWXU); if(fd == -1) return NULL; + flock(fd, LOCK_EX); + struct stat info; if(stat(fileName, &info)) { close(fd); diff --git a/tests/System Abstraction/3/openTempFiletest b/tests/System Abstraction/3/openTempFiletest index 9e2b918..35fefc0 100755 Binary files a/tests/System Abstraction/3/openTempFiletest and b/tests/System Abstraction/3/openTempFiletest differ