/* */
/* stat.h */
/* */
-/* Constants for the mode argument of open */
+/* Constants for the mode argument of open and creat */
/* */
/* */
/* */
-/* Must match the values in src/sim65/paravirt.c */
+#define S_IREAD 0x01
+#define S_IWRITE 0x02
-#define S_IREAD 0x1
-#define S_IWRITE 0x2
/*****************************************************************************/
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <sys/stat.h>
#if defined(_WIN32)
# define O_INITIAL O_BINARY
# include <unistd.h>
#endif
#ifndef S_IREAD
-# ifdef _WIN32
-# define S_IREAD _S_IREAD
-# else
-# define S_IREAD S_IRUSR
-# endif
+# define S_IREAD S_IRUSR
#endif
#ifndef S_IWRITE
-# ifdef _WIN32
-# define S_IWRITE _S_IWRITE
-# else
-# define S_IWRITE S_IWUSR
-# endif
+# define S_IWRITE S_IWUSR
#endif
/* common */
{
char Path[1024];
int OFlag = O_INITIAL;
+ int OMode = 0;
unsigned RetVal, I = 0;
- mode_t OMode = 0;
unsigned Mode = PopParam (Regs->YR - 4);
unsigned Flags = PopParam (2);
unsigned Name = PopParam (2);
if (Regs->YR - 4 < 2) {
- /* If the caller did not supply the mode argument,
- ** use a reasonable default.
+ /* If the caller didn't supply the mode
+ ** argument, use a reasonable default.
*/
- Mode = 0x1 | 0x2;
+ Mode = 0x01 | 0x02;
}
do {
OFlag |= O_EXCL;
}
- if (Mode & 0x1) {
+ if (Mode & 0x01) {
OMode |= S_IREAD;
}
- if (Mode & 0x2) {
+ if (Mode & 0x02) {
OMode |= S_IWRITE;
}