From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 603C93858D32; Thu, 7 Jul 2022 12:23:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 603C93858D32 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: redefine some macros for Linux compatibility X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: d908a30fdcc1b283def86bae63670e8a09d9b263 X-Git-Newrev: 5d4f405d3b65536c5757e249832654c24759021f Message-Id: <20220707122337.603C93858D32@sourceware.org> Date: Thu, 7 Jul 2022 12:23:37 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 12:23:37 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D5d4f405d3b6= 5536c5757e249832654c24759021f commit 5d4f405d3b65536c5757e249832654c24759021f Author: Ken Brown Date: Wed Jul 6 14:43:16 2022 -0400 Cygwin: redefine some macros for Linux compatibility =20 Define FD_SETSIZE () to be 1024 by default, and define NOFILE () to be OPEN_MAX (=3D=3D 3200) by default. =20 Remove the comment in that FD_SETSIZE should be >=3D NOFILE. =20 Bump API minor. =20 Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251839.html Diff: --- newlib/libc/include/sys/select.h | 10 +++++++--- winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/include/sys/param.h | 4 +++- winsup/cygwin/release/3.4.0 | 4 ++++ winsup/doc/new-features.xml | 5 +++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/newlib/libc/include/sys/select.h b/newlib/libc/include/sys/sel= ect.h index a5cd6c3fe..93d0b79bf 100644 --- a/newlib/libc/include/sys/select.h +++ b/newlib/libc/include/sys/select.h @@ -25,10 +25,14 @@ typedef __sigset_t sigset_t; * Select uses bit masks of file descriptors in longs. * These macros manipulate such bit fields (the filesystem macros use char= s). * FD_SETSIZE may be defined by the user, but the default here - * should be >=3D NOFILE (param.h). + * should be enough for most uses. */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 64 +#ifndef FD_SETSIZE +# ifdef __CYGWIN__ +# define FD_SETSIZE 1024 +# else +# define FD_SETSIZE 64 +# endif #endif =20 typedef unsigned long __fd_mask; diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include= /cygwin/version.h index 6f65a1299..a5d38f37a 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -517,12 +517,13 @@ details. */ pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock, sem_clockwait, sig2str, str2sig. 342: Remove cleanup_glue. + 343: Change FD_SETSIZE and NOFILE. =20 Note that we forgot to bump the api for ualarm, strtoll, strtoull, sigaltstack, sethostname. */ =20 #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 342 +#define CYGWIN_VERSION_API_MINOR 343 =20 /* There is also a compatibity version number associated with the shared m= emory regions. It is incremented when incompatible changes are made to the s= hared diff --git a/winsup/cygwin/include/sys/param.h b/winsup/cygwin/include/sys/= param.h index 63de726e6..742599b8b 100644 --- a/winsup/cygwin/include/sys/param.h +++ b/winsup/cygwin/include/sys/param.h @@ -17,7 +17,9 @@ /* Max number of open files. The Posix version is OPEN_MAX. */ /* Number of fds is virtually unlimited in cygwin, but we must provide some reasonable value for Posix conformance */ -#define NOFILE 8192 +#if !defined NOFILE && defined OPEN_MAX +# define NOFILE OPEN_MAX +#endif =20 /* Max number of groups; must keep in sync with NGROUPS_MAX in limits.h */ #define NGROUPS NGROUPS_MAX diff --git a/winsup/cygwin/release/3.4.0 b/winsup/cygwin/release/3.4.0 index f310912c9..08d28d510 100644 --- a/winsup/cygwin/release/3.4.0 +++ b/winsup/cygwin/release/3.4.0 @@ -25,6 +25,10 @@ What changed: the current directory as Linux does. Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251730.html =20 +- The default values of FD_SETSIZE and NOFILE are now 1024 and 3200, + respectively. + Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251839.html + =20 Bug Fixes --------- diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index 0149a027a..46dc028f1 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -33,6 +33,11 @@ Handle UDP_SEGMENT and UDP_GRO socket options. The stdio input functions no longer try again to read after EOF. =20 + +The default values of FD_SETSIZE and NOFILE are now 1024 and 3200, +respectively. + + =20