* winsup.api/mmaptest04.c: Take care for binmode explicitely.
This commit is contained in:
		| @@ -1,3 +1,7 @@ | |||||||
|  | 2001-04-27  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* winsup.api/mmaptest04.c: Take care for binmode explicitely. | ||||||
|  |  | ||||||
| 2001-04-19  Corinna Vinschen  <corinna@vinschen.de> | 2001-04-19  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* winsup.api/mmaptest02.c: New test. | 	* winsup.api/mmaptest02.c: New test. | ||||||
|   | |||||||
| @@ -3,6 +3,10 @@ | |||||||
| #include <sys/mman.h> | #include <sys/mman.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
|  |  | ||||||
|  | #ifndef O_BINARY | ||||||
|  | #define O_BINARY 0 | ||||||
|  | #endif | ||||||
|  |  | ||||||
| int | int | ||||||
| main () | main () | ||||||
| { | { | ||||||
| @@ -21,7 +25,7 @@ main () | |||||||
|   for (i = 0; i < pagesize; ++i) |   for (i = 0; i < pagesize; ++i) | ||||||
|     *(data + i) = rand (); |     *(data + i) = rand (); | ||||||
|   umask (0); |   umask (0); | ||||||
|   fd = creat ("conftestmmap", 0600); |   fd = open ("conftestmmap", O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0600); | ||||||
|   if (fd < 0) |   if (fd < 0) | ||||||
|     { |     { | ||||||
|       printf ("creat: %d\n", errno); |       printf ("creat: %d\n", errno); | ||||||
| @@ -37,7 +41,7 @@ main () | |||||||
|   /* |   /* | ||||||
|    * Next, try to mmap the file. |    * Next, try to mmap the file. | ||||||
|    */ |    */ | ||||||
|   fd = open ("conftestmmap", O_RDWR); |   fd = open ("conftestmmap", O_RDWR | O_BINARY); | ||||||
|   if (fd < 0) |   if (fd < 0) | ||||||
|     { |     { | ||||||
|       printf ("write: %d\n", errno); |       printf ("write: %d\n", errno); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user