* cygwin.din (confstr): Export.
* posix.sgml (confstr): Move to list of implemented SUSv3 functions. * sysconf.cc (confstr): Implement. * include/cygwin/version.h: Bump API minor number.
This commit is contained in:
parent
f4cd2a1d71
commit
1570432db3
|
@ -1,3 +1,10 @@
|
||||||
|
2007-06-11 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygwin.din (confstr): Export.
|
||||||
|
* posix.sgml (confstr): Move to list of implemented SUSv3 functions.
|
||||||
|
* sysconf.cc (confstr): Implement.
|
||||||
|
* include/cygwin/version.h: Bump API minor number.
|
||||||
|
|
||||||
2007-06-05 Corinna Vinschen <corinna@vinschen.de>
|
2007-06-05 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* ansi.sgml: Delete.
|
* ansi.sgml: Delete.
|
||||||
|
|
|
@ -195,6 +195,7 @@ _close = close SIGFE
|
||||||
closedir SIGFE
|
closedir SIGFE
|
||||||
_closedir = closedir SIGFE
|
_closedir = closedir SIGFE
|
||||||
closelog SIGFE
|
closelog SIGFE
|
||||||
|
confstr SIGFE
|
||||||
connect = cygwin_connect SIGFE
|
connect = cygwin_connect SIGFE
|
||||||
copysign NOSIGFE
|
copysign NOSIGFE
|
||||||
_copysign = copysign NOSIGFE
|
_copysign = copysign NOSIGFE
|
||||||
|
|
|
@ -308,12 +308,13 @@ details. */
|
||||||
166: Export sem_unlink.
|
166: Export sem_unlink.
|
||||||
167: Add st_birthtim to struct stat.
|
167: Add st_birthtim to struct stat.
|
||||||
168: Export asnprintf, dprintf, _Exit, vasnprintf, vdprintf.
|
168: Export asnprintf, dprintf, _Exit, vasnprintf, vdprintf.
|
||||||
|
169: Export confstr.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
||||||
|
|
||||||
#define CYGWIN_VERSION_API_MAJOR 0
|
#define CYGWIN_VERSION_API_MAJOR 0
|
||||||
#define CYGWIN_VERSION_API_MINOR 168
|
#define CYGWIN_VERSION_API_MINOR 169
|
||||||
|
|
||||||
/* There is also a compatibity version number associated with the
|
/* There is also a compatibity version number associated with the
|
||||||
shared memory regions. It is incremented when incompatible
|
shared memory regions. It is incremented when incompatible
|
||||||
|
|
|
@ -75,6 +75,7 @@ also ISO/IEC 9945:2003 and IEEE Std 1003.1-2001 (POSIX.1-2001).</para>
|
||||||
close
|
close
|
||||||
closedir
|
closedir
|
||||||
closelog
|
closelog
|
||||||
|
confstr
|
||||||
connect
|
connect
|
||||||
copysign
|
copysign
|
||||||
copysignf
|
copysignf
|
||||||
|
@ -1070,7 +1071,6 @@ also ISO/IEC 9945:2003 and IEEE Std 1003.1-2001 (POSIX.1-2001).</para>
|
||||||
clog
|
clog
|
||||||
clogf
|
clogf
|
||||||
clogl
|
clogl
|
||||||
confstr
|
|
||||||
conj
|
conj
|
||||||
conjf
|
conjf
|
||||||
conjl
|
conjl
|
||||||
|
|
|
@ -248,3 +248,51 @@ sysconf (int in)
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
return -1L;
|
return -1L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define ls(s) sizeof(s),s
|
||||||
|
|
||||||
|
static struct
|
||||||
|
{
|
||||||
|
size_t l;
|
||||||
|
const char *s;
|
||||||
|
} csa[] =
|
||||||
|
{
|
||||||
|
{ls ("/bin:/usr/bin")}, /* _CS_PATH */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_CFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_LDFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_LIBS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS */
|
||||||
|
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS */
|
||||||
|
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS */
|
||||||
|
{ls ("")}, /* _CS_POSIX_V6_ILP32_OFFBIG_LIBS */
|
||||||
|
{ls ("")}, /* _CS_XBS5_ILP32_OFFBIG_LINTFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LP64_OFF64_CFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LP64_OFF64_LDFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LP64_OFF64_LIBS */
|
||||||
|
{0, NULL}, /* _CS_XBS5_LP64_OFF64_LINTFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS */
|
||||||
|
{0, NULL}, /* _CS_POSIX_V6_LPBIG_OFFBIG_LIBS */
|
||||||
|
{0, NULL}, /* _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS */
|
||||||
|
{ls ("POSIX_V6_ILP32_OFFBIG")}, /* _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CS_MIN _CS_PATH
|
||||||
|
#define CS_MAX _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
|
||||||
|
|
||||||
|
extern "C" size_t
|
||||||
|
confstr (int in, char *buf, size_t len)
|
||||||
|
{
|
||||||
|
if (in >= CS_MIN && in <= CS_MAX)
|
||||||
|
{
|
||||||
|
if (csa[in].l && len)
|
||||||
|
{
|
||||||
|
buf[0] = 0;
|
||||||
|
strncat (buf, csa[in].s, min (len, csa[in].l) - 1);
|
||||||
|
}
|
||||||
|
return csa[in].l;
|
||||||
|
}
|
||||||
|
/* Invalid option value. */
|
||||||
|
set_errno (EINVAL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue