Before the update everything worked. Now when any program tries to open+create a file without u+rw in a directory shared with OSX, the open system call fails with a memory error! I noticed it first with some SCM tools that create the file without read/write. I am able to duplicate the problem with the following code:
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int FD;
if((FD = open("foo", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR)) < 0) {
printf("First open: NO NO NO NO!!\n");
perror(" ERROR MSG");
} else {
printf("First open: YES!!\n");
} /* end if */
close(FD);
if((FD = open("bar", O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR)) < 0) {
printf("Second open: NO NO NO NO!!\n");
perror(" ERROR MSG");
} else {
printf("Second open: YES!!\n");
} /* end if */
close(FD);
if((FD = open("foobar", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) < 0) {
printf("Third open: NO NO NO NO!!\n");
perror(" ERROR MSG");
} else {
printf("Third open: YES!!\n");
} /* end if */
close(FD);
exit(0);
} /* end func main */
=========================================
Run it on a directory on the VM's disk:
gcc t.c -o t; rm -rf foo bar foobar; ./t
First open: YES!!
Second open: YES!!
Third open: YES!!
=========================================
Run it on a shared directory:
gcc t.c -o t; rm -rf foo bar foobar; ./t
First open: NO NO NO NO!!
ERROR MSG: Cannot allocate memory
Second open: NO NO NO NO!!
ERROR MSG: Cannot allocate memory
Third open: YES!!
Last edited: Mar 20, 2014