summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/os_calls.c24
-rw-r--r--common/os_calls.h4
2 files changed, 28 insertions, 0 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index 838e60ec..6b90ffc9 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -674,6 +674,20 @@ g_atoi(char* str)
}
/*****************************************************************************/
+int
+g_pos(char* str, char* to_find)
+{
+ char* pp;
+
+ pp = strstr(str, to_find);
+ if (pp == 0)
+ {
+ return -1;
+ }
+ return (pp - str);
+}
+
+/*****************************************************************************/
long
g_load_library(char* in)
{
@@ -780,6 +794,16 @@ g_signal_child_stop(void (*func)(int))
}
/*****************************************************************************/
+void
+g_unset_signals(void)
+{
+ sigset_t mask;
+
+ sigemptyset(&mask);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+}
+
+/*****************************************************************************/
int
g_fork(void)
{
diff --git a/common/os_calls.h b/common/os_calls.h
index af300817..de369246 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -117,6 +117,8 @@ int
g_strncmp(char* c1, char* c2, int len);
int
g_atoi(char* str);
+int
+g_pos(char* str, char* to_find);
long
g_load_library(char* in);
int
@@ -136,6 +138,8 @@ void
g_signal(int sig_num, void (*func)(int));
void
g_signal_child_stop(void (*func)(int));
+void
+g_unset_signals(void);
int
g_fork(void);
int