Lutz, I think I found the error. This is in 'nl-filesys.c' of newLisp 9.0.16:
Code: Select all
607 if(*accessMode == 'r')
608 return(open(fileName, O_RDONLY | O_BINARY | blocking, 0));
609
610 else if(*accessMode == 'w')
611 #ifdef WINCC
612 return(open( fileName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE) );
613 #else
614 return(open(fileName,O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
615 S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH | blocking)); <----------- !!! FILEMODE here
616 /* S_IRWXU | S_IRWXG | S_IRWXO | blocking)); rwxrwxrwx */
617 #endif
Now look where 'blocking' is mentioned. You can see it at line 615, but this is the wrong position. Because here it specifies a filemode.
It should be part of the opening flags. I have changed the code as follows:
Code: Select all
607 if(*accessMode == 'r')
608 return(open(fileName, O_RDONLY | O_BINARY | blocking, 0));
609
610 else if(*accessMode == 'w')
611 #ifdef WINCC
612 return(open( fileName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE) );
613 #else
614 return(open(fileName, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | blocking, <------------
615 S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH)); /* rw-rw-rw */
616 /* S_IRWXU | S_IRWXG | S_IRWXO | blocking)); rwxrwxrwx */
617 #endif
Now it works, blocking and non-blocking,
Why the previous code worked on BSD is a riddle to me. But then again, I have stopped to grasp everything in this world. ;-)
Peter