]> sourceware.org Git - newlib-cygwin.git/commitdiff
Add sethostname
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 17 Jun 2015 09:11:02 +0000 (11:11 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 17 Jun 2015 09:11:02 +0000 (11:11 +0200)
* 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 <corinna@vinschen.de>
winsup/cygwin/ChangeLog
winsup/cygwin/common.din
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/net.cc
winsup/cygwin/release/2.1.0 [moved from winsup/cygwin/release/2.0.5 with 93% similarity]
winsup/doc/ChangeLog
winsup/doc/new-features.xml

index 062b065ce87261e6c5c4f0a2c1769f4c2904e903..58a3821581d69c3cc912601ae90758fae1e61eda 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-17  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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  <corinna@vinschen.de>
 
        * fhandler_socket.cc (LOCK_EVENTS): Don't enter critical section with
index f14b33107a8a38e38c8b11ae9e19ed567c880bd9..dd9bb2576de97a38a272388deb88e627b883aefd 100644 (file)
@@ -1054,6 +1054,7 @@ sendmsg = cygwin_sendmsg SIGFE
 sendto = cygwin_sendto SIGFE
 setbuf SIGFE
 setbuffer SIGFE
+sethostname SIGFE
 setdtablesize SIGFE
 setegid SIGFE
 setenv SIGFE
index 8305b07a5af30710812758c91862e0767a10bbe6..3d5d4de588badc63fe274759e7acf6f018b8d720 100644 (file)
@@ -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. */
index ae8612952919586fdddfe260ebeeb79b75591814..20b4d3cb1deefd01a29d28898be0219d41ebf1ff 100644 (file)
@@ -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)
similarity index 93%
rename from winsup/cygwin/release/2.0.5
rename to winsup/cygwin/release/2.1.0
index 9f26a8a59b8a1e65c68556034d149af886688625..5680cb31ec1df16a503f1d1e49a23a89e1b3062d 100644 (file)
@@ -1,6 +1,8 @@
 What's new:
 -----------
 
+- New API: sethostname.
+
 
 What changed:
 -------------
index 6f1b01aa0d4b4f0c82bd9f14a49b25c9ffc6a4e4..02bf22e80cdbfc501d0b39fc9c84343c5e9d3ebf 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-17  Corinna Vinschen  <corinna@vinschen.de>
+
+       * new-features.xml (ov-new): Rename from ov-new1.7.
+       (ov-new2.1): Add new section.  Document sethostname.
+
 2015-06-12  Jon Turney  <jon.turney@dronecode.org.uk>
 
        * Makefile.in (install-man, utils2man.stamp): Add rules to build
index 2d0ed0b03158fde782655ddb4bb219efc58f2bba..6edde24e165fb7a85d134ba70e135680fc53b6a2 100644 (file)
@@ -2,7 +2,19 @@
 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
                "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 
-<sect1 id="ov-new1.7"><title>What's new and what changed in Cygwin</title>
+<sect1 id="ov-new"><title>What's new and what changed in Cygwin</title>
+
+<sect2 id="ov-new2.1"><title>What's new and what changed in 2.1</title>
+
+<itemizedlist mark="bullet">
+
+<listitem><para>
+New API: sethostname.
+</para></listitem>
+
+</itemizedlist>
+
+</sect2>
 
 <sect2 id="ov-new2.0"><title>What's new and what changed in 2.0</title>
 
This page took 0.046902 seconds and 5 git commands to generate.