From 94da1cd22c3c4e0f120551d6c8891af73ae6824a Mon Sep 17 00:00:00 2001 From: manojampalam Date: Sat, 5 Mar 2016 12:09:26 -0800 Subject: [PATCH] 3-5 C2 --- .../win32posix/win32posix/inc/defs.h | 14 +++++++++-- .../win32posix/win32posix/inc/signal.h | 25 +++++++++++++++++++ .../win32posix/win32posix/win32posix.vcxproj | 1 + .../win32posix/win32posix.vcxproj.filters | 3 +++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/defs.h b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/defs.h index da015c8..77518e3 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/defs.h +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/defs.h @@ -43,7 +43,9 @@ /* #define O_RDWR 0x2 */ /* open file creation and file status flags can be bitwise-or'd*/ /* #define O_APPEND 0x8 /*file is opened in append mode*/ -#define O_NONBLOCK 0x10 /*io operations wont block*/ +#ifndef O_NONBLOCK +#define O_NONBLOCK 0x0004 /*io operations wont block*/ +#endif /* #define O_CREAT 0x100 /*If the file does not exist it will be created*/ /* * If the file exists and is a regular file, and the file is successfully @@ -55,7 +57,15 @@ /* #define O_EXCL 0x400 */ /* #define O_BINARY 0x8000 //Gives raw data (while O_TEXT normalises line endings */ // open modes +#ifndef S_IRUSR #define S_IRUSR 00400 //user has read permission +#endif // ! S_IRUSR +#ifndef S_IWUSR #define S_IWUSR 00200 //user has write permission +#endif +#ifndef S_IRGRP #define S_IRGRP 00040 //group has read permission -#define S_IROTH 00004 //others have read permission \ No newline at end of file +#endif +#ifndef S_IROTH +#define S_IROTH 00004 //others have read permission +#endif \ No newline at end of file diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/signal.h b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/signal.h index 3ed5867..9496e8e 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/signal.h +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/inc/signal.h @@ -6,4 +6,29 @@ #include "w32posix.h" +// Signal types +#define SIGINT 2 // interrupt +#define SIGILL 4 // illegal instruction - invalid function image +#define SIGFPE 8 // floating point exception +#define SIGSEGV 11 // segment violation +#define SIGTERM 15 // Software termination signal from kill +#define SIGBREAK 21 // Ctrl-Break sequence +#define SIGABRT 22 // abnormal termination triggered by abort call + +#define SIGABRT_COMPAT 6 // SIGABRT compatible with other platforms, same as SIGABRT + +#define SIGALRM 14 +#define SIGCHLD 26 +#define SIGHUP 1 +#define SIGPIPE 27 +#define SIGQUIT 3 + + +// Signal action codes +#define SIG_DFL (0) // default signal action +#define SIG_IGN (1) // ignore signal +#define SIG_GET (2) // return current value +#define SIG_SGE (3) // signal gets error +#define SIG_ACK (4) // acknowledge + #define signal w32_signal \ No newline at end of file diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj b/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj index 405680e..5405c0c 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj @@ -153,6 +153,7 @@ + diff --git a/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj.filters b/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj.filters index 2089657..e81afa9 100644 --- a/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj.filters +++ b/contrib/win32/w32-posix-prototype/win32posix/win32posix/win32posix.vcxproj.filters @@ -59,5 +59,8 @@ inc\sys + + inc + \ No newline at end of file