Author: iratqq
Date: Mon Feb 2 08:16:55 2009
New Revision: 5805
Modified:
trunk/configure.ac
trunk/replace/Makefile.am
trunk/replace/os_dep.h
trunk/uim/uim-posix.c
Log:
* uim/uim-posix.c (c_daemon):
- New function.
(uim_init_posix_subrs):
- New function (daemon).
* replace/Makefile.am (libreplace_la_SOURCES):
- Add daemon.c
* configure.ac:
- Check daemon().
* replace/os_dep.h:
- Add macro and declaration.
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Feb 2 08:16:55 2009
@@ -522,6 +522,7 @@
AC_CHECK_FUNCS([issetugid])
AC_CHECK_FUNCS([poll])
AC_CHECK_FUNCS([waitpid])
+AC_CHECK_FUNCS([daemon])
# IRIX has a const char return value for gai_strerror()
AC_CHECK_FUNCS(gai_strerror,[
Modified: trunk/replace/Makefile.am
==============================================================================
--- trunk/replace/Makefile.am (original)
+++ trunk/replace/Makefile.am Mon Feb 2 08:16:55 2009
@@ -8,6 +8,7 @@
bsd-snprintf.c \
bsd-waitpid.c \
bsd-waitpid.h \
+ daemon.c \
fake-rfc2553.c \
fake-rfc2553.h \
getpeereid.c \
Modified: trunk/replace/os_dep.h
==============================================================================
--- trunk/replace/os_dep.h (original)
+++ trunk/replace/os_dep.h Mon Feb 2 08:16:55 2009
@@ -150,6 +150,12 @@
waitpid(pid_t, int *, int);
#endif
+#ifndef HAVE_DAEMON
+#define daemon uim_internal_daemon
+int
+daemon(int, int);
+#endif
+
#ifdef __cplusplus
}
#endif
Modified: trunk/uim/uim-posix.c
==============================================================================
--- trunk/uim/uim-posix.c (original)
+++ trunk/uim/uim-posix.c Mon Feb 2 08:16:55 2009
@@ -639,6 +639,12 @@
return LIST5(ret_, uim_scm_f(), uim_scm_f(), uim_scm_f(),
MAKE_INT(status));
}
+static uim_lisp
+c_daemon(uim_lisp nochdir_, uim_lisp noclose_)
+{
+ return MAKE_INT(daemon(C_BOOL(nochdir_), C_BOOL(noclose_)));
+}
+
void
uim_init_posix_subrs(void)
{
@@ -695,4 +701,6 @@
uim_scm_gc_protect(&uim_lisp_process_waitpid_options);
uim_lisp_process_waitpid_options = make_arg_list(waitpid_options);
uim_scm_eval_c_string("(define process-waitpid-options-alist
(process-waitpid-options?))");
+
+ uim_scm_init_proc2("daemon", c_daemon);
}