This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] add confstr for Cygwin


Hi,

I applied the below patch, which is Cygwin-only for now.  It declares
the POSIX function confstr and defines the constants for it in
sys/unistd.h.  As a small extra, the patch adds a comment preceding
the _PC_xxx constants.


Corinna
 

	* libc/include/sys/unistd.h: Declare confstr for Cygwin.
	Define confstr constants for Cygwin.


Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.58
diff -u -p -r1.58 unistd.h
--- libc/include/sys/unistd.h	7 Feb 2007 17:19:35 -0000	1.58
+++ libc/include/sys/unistd.h	11 Jun 2007 17:28:17 -0000
@@ -27,6 +27,9 @@ int     _EXFUN(chown, (const char *__pat
 int     _EXFUN(chroot, (const char *__path ));
 #endif
 int     _EXFUN(close, (int __fildes ));
+#if defined(__CYGWIN__)
+size_t	_EXFUN(confstr, (int __name, char *__buf, size_t __len));
+#endif
 char    _EXFUN(*ctermid, (char *__s ));
 char    _EXFUN(*cuserid, (char *__s ));
 #if defined(__CYGWIN__)
@@ -367,6 +370,10 @@ int     _EXFUN(symlink, (const char *__n
 #define _SC_2_UPE                       120
 #define _SC_2_VERSION                   121
 
+/*
+ *  pathconf values per IEEE Std 1003.1, 2004 Edition
+ */
+
 #define _PC_LINK_MAX                      0
 #define _PC_MAX_CANON                     1
 #define _PC_MAX_INPUT                     2
@@ -389,6 +396,43 @@ int     _EXFUN(symlink, (const char *__n
 #define _PC_POSIX_SECURITY               91
 #endif
 
+/*
+ *  confstr values per IEEE Std 1003.1, 2004 Edition
+ */
+
+#ifdef __CYGWIN__	/* Only defined on Cygwin for now. */
+#define _CS_PATH                               0
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS        1
+#define _CS_XBS5_ILP32_OFF32_CFLAGS           _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS       2
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS          _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS          3
+#define _CS_XBS5_ILP32_OFF32_LIBS             _CS_POSIX_V6_ILP32_OFF32_LIBS
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS         4
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS       5
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS          _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS      6
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS         _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS         7
+#define _CS_XBS5_ILP32_OFFBIG_LIBS            _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS        8
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS         9
+#define _CS_XBS5_LP64_OFF64_CFLAGS            _CS_POSIX_V6_LP64_OFF64_CFLAGS
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS       10
+#define _CS_XBS5_LP64_OFF64_LDFLAGS           _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+#define _CS_POSIX_V6_LP64_OFF64_LIBS          11
+#define _CS_XBS5_LP64_OFF64_LIBS              _CS_POSIX_V6_LP64_OFF64_LIBS
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS         12
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS      13
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS          _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS     14
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS         _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS        15
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS            _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS       16
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS    17
+#endif
+
 /* FIXME: This is temporary until winsup gets sorted out.  */
 #ifdef __CYGWIN__
 #define MAXPATHLEN (260 - 1 /* NUL */)

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]