mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 13:01:28 +02:00
21270: don't use poll() on Apple
This commit is contained in:
parent
c15127b3f1
commit
e78a844b37
2 changed files with 70 additions and 12 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2005-05-23 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 21270: Src/system.h: don't use poll() on Apple.
|
||||||
|
|
||||||
2005-05-10 Oliver Kiddle <opk@zsh.org>
|
2005-05-10 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
* Haakon Riiser: 21188: Completion/X/Command/_acroread: handle
|
* Haakon Riiser: 21188: Completion/X/Command/_acroread: handle
|
||||||
|
|
78
Src/system.h
78
Src/system.h
|
@ -27,9 +27,23 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* Setting _XPG_IV here is actually wrong and is not needed
|
||||||
|
* with currently supported versions (5.43C20 and above)
|
||||||
|
*/
|
||||||
#ifdef sinix
|
#ifdef sinix
|
||||||
# define _XPG_IV 1
|
# define _XPG_IV 1
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux
|
||||||
|
/*
|
||||||
|
* Turn on numerous extensions.
|
||||||
|
* This is in order to get the functions for manipulating /dev/ptmx.
|
||||||
|
*/
|
||||||
|
#define _GNU_SOURCE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* NeXT has half-implemented POSIX support *
|
/* NeXT has half-implemented POSIX support *
|
||||||
* which currently fools configure */
|
* which currently fools configure */
|
||||||
|
@ -83,6 +97,16 @@ char *alloca _((size_t));
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDDEF_H
|
||||||
|
/*
|
||||||
|
* Seen on Solaris 8 with gcc: stddef defines offsetof, which clashes
|
||||||
|
* with system.h's definition of the symbol unless we include this
|
||||||
|
* first. Otherwise, this will be hooked in by wchar.h, too late
|
||||||
|
* for comfort.
|
||||||
|
*/
|
||||||
|
#include <stddef.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -194,19 +218,21 @@ struct timezone {
|
||||||
# define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z))
|
# define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* we should be getting this value from pathconf(_PC_PATH_MAX) */
|
/* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */
|
||||||
/* but this is too much trouble */
|
/* but this is too much trouble */
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
# ifdef MAXPATHLEN
|
# ifdef MAXPATHLEN
|
||||||
# define PATH_MAX MAXPATHLEN
|
# define PATH_MAX MAXPATHLEN
|
||||||
# else
|
# else
|
||||||
/* so we will just pick something */
|
# ifdef _POSIX_PATH_MAX
|
||||||
# define PATH_MAX 1024
|
# define PATH_MAX _POSIX_PATH_MAX
|
||||||
|
# else
|
||||||
|
/* so we will just pick something */
|
||||||
|
# define PATH_MAX 1024
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* we should be getting this value from sysconf(_SC_OPEN_MAX) */
|
|
||||||
/* but this is too much trouble */
|
|
||||||
#ifndef OPEN_MAX
|
#ifndef OPEN_MAX
|
||||||
# ifdef NOFILE
|
# ifdef NOFILE
|
||||||
# define OPEN_MAX NOFILE
|
# define OPEN_MAX NOFILE
|
||||||
|
@ -215,6 +241,9 @@ struct timezone {
|
||||||
# define OPEN_MAX 64
|
# define OPEN_MAX 64
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAVE_SYSCONF
|
||||||
|
# define zopenmax() ((long) OPEN_MAX)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
|
@ -271,6 +300,15 @@ struct timezone {
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__APPLE__) && defined(HAVE_SELECT)
|
||||||
|
/*
|
||||||
|
* Prefer select() to poll() on MacOS X since poll() is known
|
||||||
|
* to be problematic in 10.4
|
||||||
|
*/
|
||||||
|
#undef HAVE_POLL
|
||||||
|
#undef HAVE_POLL_H
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_FILIO_H
|
#ifdef HAVE_SYS_FILIO_H
|
||||||
# include <sys/filio.h>
|
# include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -299,10 +337,6 @@ struct timezone {
|
||||||
# endif /* HAVE_TERMIO_H */
|
# endif /* HAVE_TERMIO_H */
|
||||||
#endif /* HAVE_TERMIOS_H */
|
#endif /* HAVE_TERMIOS_H */
|
||||||
|
|
||||||
#ifdef HAVE_TERMCAP_H
|
|
||||||
# include <termcap.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
|
#if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -399,8 +433,10 @@ struct timezone {
|
||||||
/* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 *
|
/* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 *
|
||||||
* (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) *
|
* (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) *
|
||||||
* converted to printable decimal form including the sign and the *
|
* converted to printable decimal form including the sign and the *
|
||||||
* terminating null character. Below 0.30103 > lg 2. */
|
* terminating null character. Below 0.30103 > lg 2. *
|
||||||
#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 0.30103) + 3)
|
* BDIGBUFSIZE is for a number converted to printable binary form. */
|
||||||
|
#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 30103/100000) + 3)
|
||||||
|
#define BDIGBUFSIZE ((int)((sizeof(zlong) * 8) + 4))
|
||||||
|
|
||||||
/* If your stat macros are broken, we will *
|
/* If your stat macros are broken, we will *
|
||||||
* just undefine them. */
|
* just undefine them. */
|
||||||
|
@ -642,3 +678,21 @@ extern short ospeed;
|
||||||
#if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL)
|
#if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL)
|
||||||
# define USE_LOCALE 1
|
# define USE_LOCALE 1
|
||||||
#endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */
|
#endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */
|
||||||
|
|
||||||
|
#ifndef MAILDIR_SUPPORT
|
||||||
|
#define mailstat(X,Y) stat(X,Y)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
# include <sys/cygwin.h>
|
||||||
|
# define IS_DIRSEP(c) ((c) == '/' || (c) == '\\')
|
||||||
|
#else
|
||||||
|
# define IS_DIRSEP(c) ((c) == '/')
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__APPLE__)
|
||||||
|
/* Does the OS X port of gcc still gag on __attribute__? */
|
||||||
|
#define UNUSED(x) x __attribute__((__unused__))
|
||||||
|
#else
|
||||||
|
#define UNUSED(x) x
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue