summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-11-28 15:01:37 +0000
committerColin Watson <cjwatson@debian.org>2010-11-28 15:01:37 +0000
commit6e52ef210a440618ecc65180a57fcd6a1fe7758b (patch)
tree501249fa45daef947960ff7fe136c41f1b225b89 /m4
parenta7aab9879f7abf31ee4cf849da79dd98b5ddf3a2 (diff)
Remove internal copy of libpipeline.
* configure.ac: Remove --enable-socketpair-pipe and --with-external-pipeline options. Remove INTERNAL_PIPELINE Automake conditional. Check for libpipeline unconditionally. * docs/INSTALL.quick: Mention the need to install libpipeline. * gnulib: Remove strsignal and sys_select modules. * lib/Makefile.am (libman_la_SOURCES): Never add pipeline.c or pipeline.h. * lib/pipeline.c, lib/pipeline.h: Remove. * m4/man-socketpair.m4: Remove. * NEWS: Document this. Bump to 2.6.0.
Diffstat (limited to 'm4')
-rw-r--r--m4/man-socketpair.m4116
1 files changed, 0 insertions, 116 deletions
diff --git a/m4/man-socketpair.m4 b/m4/man-socketpair.m4
deleted file mode 100644
index 68749c6c..00000000
--- a/m4/man-socketpair.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-# man-socketpair.m4 serial 1
-dnl
-dnl Check if the socketpair(2) system call can be used
-dnl and should be used as a fast replacement for pipe(2)
-dnl
-dnl Author: Werner Fink <werner@suse.de>, 2009
-
-AC_DEFUN([MAN_SOCKETPAIR_PIPE],
-[ AC_MSG_CHECKING([if socketpair(2) can be used as fast replacement for pipe(2)])
- AC_CACHE_VAL(man_cv_socketpair_pipe, [
- AC_TRY_RUN([
-#include <netdb.h>
-#include <netinet/in.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#ifndef SHUT_RD
-# define SHUT_RD 0
-#endif
-#ifndef SHUT_WR
-# define SHUT_WR 1
-#endif
-
-static void sigpipe(int sig)
-{
- _exit(0);
-}
-
-int main()
-{
- const char test[] = "May use socketpair(2) instead of pipe(2)\n";
- char buf[256];
- int sfd[2], s;
- pid_t pid;
- if (socketpair(AF_UNIX,SOCK_STREAM,0,sfd) < 0)
- return 1;
- if (shutdown(sfd[1],SHUT_RD) < 0 || shutdown(sfd[0],SHUT_WR) < 0)
- return 1;
- if ((pid = fork()) < 0)
- return 1;
- if (pid) {
- close(sfd[1]);
- waitpid(-1,&s,0);
- if (read(sfd[0],buf,sizeof(buf)) < 0)
- return 1;
- } else {
- close(sfd[0]);
- write(sfd[1],test,sizeof(test) - 1);
- return 0;
- }
- close(sfd[0]);
- signal(SIGPIPE, sigpipe);
- if (socketpair(AF_UNIX,SOCK_STREAM,0,sfd) < 0)
- return 1;
- if (shutdown(sfd[1],SHUT_RD) < 0 || shutdown(sfd[0],SHUT_WR) < 0)
- return 1;
- close(sfd[0]);
- write(sfd[1],test,sizeof(test) - 1);
- return 1;
-}], [man_cv_socketpair_pipe=yes], [man_cv_socketpair_pipe=no], [man_cv_socketpair_pipe=no])
- ])
- AC_MSG_RESULT([$man_cv_socketpair_pipe])
- if test "$man_cv_socketpair_pipe" = yes; then
- AC_DEFINE(USE_SOCKETPAIR_PIPE, 1, [Define if socketpair(2) can be used as a fast replacement for pipe(2).])
- fi
-])
-
-dnl
-dnl Check if shutdown(2) does not set mode for the socket descriptor
-dnl compare with ls -lL /proc/<pid>/fd/
-dnl
-AC_DEFUN([MAN_SOCKETPAIR_MODE],
-[ AC_MSG_CHECKING([if shutdown(2) does not set mode for the socket descriptor])
- AC_CACHE_VAL(man_cv_socketpair_mode, [
- AC_TRY_RUN([
-#include <netdb.h>
-#include <netinet/in.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-#ifndef SHUT_RD
-# define SHUT_RD 0
-#endif
-#ifndef SHUT_WR
-# define SHUT_WR 1
-#endif
-
-int main()
-{
- int sfd[2];
- struct stat st[2];
- if (socketpair(AF_UNIX,SOCK_STREAM,0,sfd) < 0)
- return 1;
- if (shutdown(sfd[1],SHUT_RD) < 0 || shutdown(sfd[0],SHUT_WR) < 0)
- return 1;
- if (fstat(sfd[0], &(st[0])) < 0 || fstat(sfd[1], &(st[1])) < 0)
- return 1;
- if ((st[0].st_mode & (S_IRUSR|S_IWUSR)) == S_IRUSR && (st[1].st_mode & (S_IRUSR|S_IWUSR)) == S_IWUSR)
- return 1;
- if (fchmod(sfd[0], S_IRUSR) < 0 || fchmod(sfd[1], S_IWUSR) < 0)
- return 1;
- if (fstat(sfd[0], &(st[0])) < 0 || fstat(sfd[1], &(st[1])) < 0)
- return 1;
- if ((st[0].st_mode & (S_IRUSR|S_IWUSR)) != S_IRUSR && (st[1].st_mode & (S_IRUSR|S_IWUSR)) != S_IWUSR)
- return 1;
- return 0;
-}], [man_cv_socketpair_mode=yes], [man_cv_socketpair_mode=no], [man_cv_socketpair_mode=no])
- ])
- AC_MSG_RESULT([$man_cv_socketpair_mode])
- if test "$man_cv_socketpair_mode" = yes; then
- AC_DEFINE(CORRECT_SOCKETPAIR_MODE, 1, [Define if shutdown(2) does not set modes for socket descriptor.])
- fi
-])