-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve hostname utilities #871
Comments
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 8, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) This closes java-native-access#871
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 8, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) This closes java-native-access#871
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 9, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java if the parameter needs to be writeable from the C side and String if the parameter is a constant passed into the function. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) The This closes java-native-access#871
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 9, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) The sethostname and setdomainname were tested manually, as changing the hostname is a privileged operation and is not regularly possible in unittests. This closes java-native-access#871
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 9, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) The sethostname and setdomainname were tested manually, as changing the hostname is a privileged operation and is not regularly possible in unittests. This closes java-native-access#871
matthiasblaesing
added a commit
to matthiasblaesing/jna
that referenced
this issue
Nov 9, 2017
Fix wrong mapping of libc function gethostname, sethostname, getdomainname and setdomainname. The functions are defined as: int getdomainname(char *name, size_t len); int setdomainname(const char *name, size_t len); int gethostname(char *name, size_t len); int sethostname(const char *name, size_t len); and a C char[] maps by default to a byte[] in java. In addition bind the winsock gethostname function: com.sun.jna.platform.win32.Winsock2.gethostname(byte[], int) The sethostname and setdomainname were tested manually, as changing the hostname is a privileged operation and is not regularly possible in unittests. This closes java-native-access#871
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gethostname
,sethostname
,getdomainname
andsetdomainname
are expectchar[]
, this maps tobyte[]
on the java side, notchar[]
gethostname
function, that should also be boundThe text was updated successfully, but these errors were encountered: