summaryrefslogtreecommitdiff
path: root/libmailutils/base
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-01-16 17:49:34 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2011-01-16 17:54:01 +0200
commita8001bb2e4684d7144e9a2217704e8f6635c5603 (patch)
tree94c9616975c3f5a3b085c7cf5ccdcf8e23cd95b2 /libmailutils/base
parentec0d5f94acb17be7357a6a819a706189b02cf2da (diff)
downloadmailutils-a8001bb2e4684d7144e9a2217704e8f6635c5603.tar.gz
mailutils-a8001bb2e4684d7144e9a2217704e8f6635c5603.tar.bz2
Add useful debugging hooks.
* libmailutils/diag/bt.c: New file. * libmailutils/diag/wd.c: New file. * libmailutils/diag/Makefile.am (libdiag_la_SOURCES): Add bt.c and wd.c * include/mailutils/debug.h (mu_gdb_bt, mu_wd): New protos. * include/mailutils/util.h (mu_getmaxfd): New protos. * libmailutils/base/getmaxfd.c: New file. * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add getmaxfd.c * libmailutils/server/acl.c: Use mu_getmaxfd. * libmailutils/stream/prog_stream.c: Likewise. * mh/mh_whatnow.c: Likewise. * libmu_scm/mu_body.c (mu-body?): Bugfix.
Diffstat (limited to 'libmailutils/base')
-rw-r--r--libmailutils/base/Makefile.am1
-rw-r--r--libmailutils/base/getmaxfd.c40
2 files changed, 41 insertions, 0 deletions
diff --git a/libmailutils/base/Makefile.am b/libmailutils/base/Makefile.am
index acb6b62b7..592eb7c93 100644
--- a/libmailutils/base/Makefile.am
+++ b/libmailutils/base/Makefile.am
@@ -31,6 +31,7 @@ libbase_la_SOURCES = \
filename.c\
freeitem.c\
getcwd.c\
+ getmaxfd.c\
getpass.c\
hostname.c\
iterator.c\
diff --git a/libmailutils/base/getmaxfd.c b/libmailutils/base/getmaxfd.c
new file mode 100644
index 000000000..b905ac8a3
--- /dev/null
+++ b/libmailutils/base/getmaxfd.c
@@ -0,0 +1,40 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <unistd.h>
+#include <limits.h>
+
+#if defined (HAVE_SYSCONF) && defined (_SC_OPEN_MAX)
+# define __getmaxfd() sysconf (_SC_OPEN_MAX)
+#elif defined (HAVE_GETDTABLESIZE)
+# define __getmaxfd() getdtablesize ()
+#elif defined OPEN_MAX
+# define __getmaxfd() OPEN_MAX
+#else
+# define __getmaxfd() 256
+#endif
+
+int
+mu_getmaxfd ()
+{
+ return __getmaxfd ();
+}
+

Return to:

Send suggestions and report system problems to the System administrator.