[asterisk-commits] tilghman: branch tilghman/ast_select r280230 - in /team/tilghman/ast_select: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 28 15:00:57 CDT 2010


Author: tilghman
Date: Wed Jul 28 15:00:54 2010
New Revision: 280230

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=280230
Log:
Initialized merge tracking via "svnmerge" with revisions "1-280226" from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

Modified:
    team/tilghman/ast_select/   (props changed)
    team/tilghman/ast_select/configure
    team/tilghman/ast_select/configure.ac
    team/tilghman/ast_select/include/asterisk/autoconfig.h.in
    team/tilghman/ast_select/include/asterisk/channel.h
    team/tilghman/ast_select/include/asterisk/poll-compat.h
    team/tilghman/ast_select/res/res_features.c

Propchange: team/tilghman/ast_select/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/tilghman/ast_select/
------------------------------------------------------------------------------
    automerge-email = tlesher at digium.com

Propchange: team/tilghman/ast_select/
------------------------------------------------------------------------------
    svnmerge-integrated = /branches/1.4:1-280226

Modified: team/tilghman/ast_select/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/ast_select/configure.ac?view=diff&rev=280230&r1=280229&r2=280230
==============================================================================
--- team/tilghman/ast_select/configure.ac (original)
+++ team/tilghman/ast_select/configure.ac Wed Jul 28 15:00:54 2010
@@ -442,6 +442,38 @@
 AC_MSG_RESULT(yes)
 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
 AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(if we can increase the maximum select-able file descriptor)
+AC_RUN_IFELSE(
+AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+], [[
+	struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 };
+	int fd0, fd1;
+	struct timeval tv = { 0, };
+	struct ast_fdset { long fds_bits[[1024]]; } fds = { { 0, } };
+	if (setrlimit(RLIMIT_NOFILE, &rlim)) { exit(1); }
+	if ((fd0 = open("/dev/null", O_RDONLY)) < 0) { exit(1); }
+	if (dup2(fd0, (fd1 = FD_SETSIZE + 1)) < 0) { exit(1); }
+	FD_SET(fd0, (fd_set *) &fds);
+	FD_SET(fd1, (fd_set *) &fds);
+	if (select(FD_SETSIZE + 2, (fd_set *) &fds, NULL, NULL, &tv) < 0) { exit(1); }
+	exit(0)]]),
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([HAVE_VARIABLE_FDSET], 1, [Define to 1 if your system can support larger than default select bitmasks.]),
+	AC_MSG_RESULT(no),
+	AC_MSG_RESULT(cross-compile)
 )
 
 AST_GCC_ATTRIBUTE(pure)

Modified: team/tilghman/ast_select/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/ast_select/include/asterisk/autoconfig.h.in?view=diff&rev=280230&r1=280229&r2=280230
==============================================================================
--- team/tilghman/ast_select/include/asterisk/autoconfig.h.in (original)
+++ team/tilghman/ast_select/include/asterisk/autoconfig.h.in Wed Jul 28 15:00:54 2010
@@ -471,7 +471,7 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+/* Define to 1 if `st_blksize' is member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -554,6 +554,10 @@
 /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
 #undef HAVE_UTIME_NULL
 
+/* Define to 1 if your system can support larger than default select bitmasks.
+   */
+#undef HAVE_VARIABLE_FDSET
+
 /* Define to 1 if you have the `vasprintf' function. */
 #undef HAVE_VASPRINTF
 
@@ -660,11 +664,11 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#undef PROTOTYPES
 
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -684,6 +688,11 @@
 
 /* Define to the type of arg 5 for `select'. */
 #undef SELECT_TYPE_ARG5
+
+/* Define to 1 if the `setvbuf' function takes the buffering type as its
+   second argument and the buffer pointer as the third, as on System V before
+   release 3. */
+#undef SETVBUF_REVERSED
 
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
@@ -705,46 +714,50 @@
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 
-/* Enable extensions on AIX 3, Interix.  */
+/* Define to 1 if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Enable threading extensions on Solaris.  */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
-/* Enable extensions on HP NonStop.  */
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-#undef _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
+
+/* Define like PROTOTYPES; this can be used by system headers. */
+#undef __PROTOTYPES
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const

Modified: team/tilghman/ast_select/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/ast_select/include/asterisk/channel.h?view=diff&rev=280230&r1=280229&r2=280230
==============================================================================
--- team/tilghman/ast_select/include/asterisk/channel.h (original)
+++ team/tilghman/ast_select/include/asterisk/channel.h Wed Jul 28 15:00:54 2010
@@ -1394,42 +1394,6 @@
 }
 #endif
 
-/*! \brief Waits for activity on a group of channels 
- * \param nfds the maximum number of file descriptors in the sets
- * \param rfds file descriptors to check for read availability
- * \param wfds file descriptors to check for write availability
- * \param efds file descriptors to check for exceptions (OOB data)
- * \param tvp timeout while waiting for events
- * This is the same as a standard select(), except it guarantees the
- * behaviour where the passed struct timeval is updated with how much
- * time was not slept while waiting for the specified events
- */
-static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tvp)
-{
-#ifdef __linux__
-	return select(nfds, rfds, wfds, efds, tvp);
-#else
-	if (tvp) {
-		struct timeval tv, tvstart, tvend, tvlen;
-		int res;
-
-		tv = *tvp;
-		gettimeofday(&tvstart, NULL);
-		res = select(nfds, rfds, wfds, efds, tvp);
-		gettimeofday(&tvend, NULL);
-		timersub(&tvend, &tvstart, &tvlen);
-		timersub(&tv, &tvlen, tvp);
-		if (tvp->tv_sec < 0 || (tvp->tv_sec == 0 && tvp->tv_usec < 0)) {
-			tvp->tv_sec = 0;
-			tvp->tv_usec = 0;
-		}
-		return res;
-	}
-	else
-		return select(nfds, rfds, wfds, efds, NULL);
-#endif
-}
-
 #define CHECK_BLOCKING(c) do { 	 \
 	if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
 		if (option_debug) \

Modified: team/tilghman/ast_select/include/asterisk/poll-compat.h
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/ast_select/include/asterisk/poll-compat.h?view=diff&rev=280230&r1=280229&r2=280230
==============================================================================
--- team/tilghman/ast_select/include/asterisk/poll-compat.h (original)
+++ team/tilghman/ast_select/include/asterisk/poll-compat.h Wed Jul 28 15:00:54 2010
@@ -79,6 +79,8 @@
 #ifndef __AST_POLL_COMPAT_H
 #define __AST_POLL_COMPAT_H
 
+#include "asterisk/select.h"
+
 #ifndef AST_POLL_COMPAT
 
 #include <sys/poll.h>

Modified: team/tilghman/ast_select/res/res_features.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/ast_select/res/res_features.c?view=diff&rev=280230&r1=280229&r2=280230
==============================================================================
--- team/tilghman/ast_select/res/res_features.c (original)
+++ team/tilghman/ast_select/res/res_features.c Wed Jul 28 15:00:54 2010
@@ -2282,7 +2282,7 @@
 /*! \brief Take care of parked calls and unpark them if needed */
 static void *do_parking_thread(void *ignore)
 {
-	fd_set rfds, efds;	/* results from previous select, to be preserved across loops. */
+	ast_fdset rfds, efds;	/* results from previous select, to be preserved across loops. */
 	FD_ZERO(&rfds);
 	FD_ZERO(&efds);
 
@@ -2290,7 +2290,7 @@
 		struct parkeduser *pu, *pl, *pt = NULL;
 		int ms = -1;	/* select timeout, uninitialized */
 		int max = -1;	/* max fd, none there yet */
-		fd_set nrfds, nefds;	/* args for the next select */
+		ast_fdset nrfds, nefds;	/* args for the next select */
 		FD_ZERO(&nrfds);
 		FD_ZERO(&nefds);
 




More information about the asterisk-commits mailing list