From 50b00d2b936c937099c24d6fa1f0b6f642462900 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 17 Jun 2015 11:11:02 +0200 Subject: Add sethostname * net.cc (sethostname): New function. * common.din (sethostname): Export * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2001. (CYGWIN_VERSION_DLL_MINOR): Set to 0. * new-features.xml (ov-new): Rename from ov-new1.7. (ov-new2.1): Add new section. Document sethostname. Signed-off-by: Corinna Vinschen --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/common.din | 1 + winsup/cygwin/include/cygwin/version.h | 4 ++-- winsup/cygwin/net.cc | 14 ++++++++++++++ winsup/cygwin/release/2.0.5 | 16 ---------------- winsup/cygwin/release/2.1.0 | 18 ++++++++++++++++++ winsup/doc/ChangeLog | 5 +++++ winsup/doc/new-features.xml | 14 +++++++++++++- 8 files changed, 60 insertions(+), 19 deletions(-) delete mode 100644 winsup/cygwin/release/2.0.5 create mode 100644 winsup/cygwin/release/2.1.0 diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 062b065ce..58a382158 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2015-06-17 Corinna Vinschen + + * net.cc (sethostname): New function. + * common.din (sethostname): Export + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2001. + (CYGWIN_VERSION_DLL_MINOR): Set to 0. + 2015-06-15 Corinna Vinschen * fhandler_socket.cc (LOCK_EVENTS): Don't enter critical section with diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din index f14b33107..dd9bb2576 100644 --- a/winsup/cygwin/common.din +++ b/winsup/cygwin/common.din @@ -1054,6 +1054,7 @@ sendmsg = cygwin_sendmsg SIGFE sendto = cygwin_sendto SIGFE setbuf SIGFE setbuffer SIGFE +sethostname SIGFE setdtablesize SIGFE setegid SIGFE setenv SIGFE diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 8305b07a5..3d5d4de58 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -42,8 +42,8 @@ details. */ the Cygwin shared library". This version is used to track important changes to the DLL and is mainly informative in nature. */ -#define CYGWIN_VERSION_DLL_MAJOR 2000 -#define CYGWIN_VERSION_DLL_MINOR 5 +#define CYGWIN_VERSION_DLL_MAJOR 2001 +#define CYGWIN_VERSION_DLL_MINOR 0 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are incompatible. */ diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index ae8612952..20b4d3cb1 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1095,6 +1095,20 @@ cygwin_gethostname (char *name, size_t len) return res; } +extern "C" int +sethostname (const char *name, size_t len) +{ + WCHAR wname[MAX_COMPUTERNAME_LENGTH + 1]; + + sys_mbstowcs (wname, MAX_COMPUTERNAME_LENGTH + 1, name, len); + if (!SetComputerNameExW (ComputerNamePhysicalDnsHostname, wname)) + { + __seterrno (); + return -1; + } + return 0; +} + /* exported as gethostbyname: standards? */ extern "C" struct hostent * cygwin_gethostbyname (const char *name) diff --git a/winsup/cygwin/release/2.0.5 b/winsup/cygwin/release/2.0.5 deleted file mode 100644 index 9f26a8a59..000000000 --- a/winsup/cygwin/release/2.0.5 +++ /dev/null @@ -1,16 +0,0 @@ -What's new: ------------ - - -What changed: -------------- - - -Bug Fixes ---------- - -- Enable non-SA_RESTART behaviour on threads other than main thread. - Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00260.html - -- Try to handle concurrent close on socket more gracefully - Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00235.html diff --git a/winsup/cygwin/release/2.1.0 b/winsup/cygwin/release/2.1.0 new file mode 100644 index 000000000..5680cb31e --- /dev/null +++ b/winsup/cygwin/release/2.1.0 @@ -0,0 +1,18 @@ +What's new: +----------- + +- New API: sethostname. + + +What changed: +------------- + + +Bug Fixes +--------- + +- Enable non-SA_RESTART behaviour on threads other than main thread. + Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00260.html + +- Try to handle concurrent close on socket more gracefully + Addresses: https://cygwin.com/ml/cygwin/2015-06/msg00235.html diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 6f1b01aa0..02bf22e80 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-17 Corinna Vinschen + + * new-features.xml (ov-new): Rename from ov-new1.7. + (ov-new2.1): Add new section. Document sethostname. + 2015-06-12 Jon Turney * Makefile.in (install-man, utils2man.stamp): Add rules to build diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index 2d0ed0b03..6edde24e1 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -2,7 +2,19 @@ -What's new and what changed in Cygwin +What's new and what changed in Cygwin + +What's new and what changed in 2.1 + + + + +New API: sethostname. + + + + + What's new and what changed in 2.0 -- cgit v1.2.3