mirror of
https://github.com/NishiOwO/fvwm1.git
synced 2025-04-21 08:44:39 +00:00
30 lines
501 B
C
30 lines
501 B
C
#include "../configure.h"
|
|
|
|
#if HAVE_UNAME
|
|
/* define mygethostname() by using uname() */
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
int mygethostname(char *client, int length)
|
|
{
|
|
struct utsname sysname;
|
|
|
|
uname(&sysname);
|
|
strncpy(client,sysname.nodename,length);
|
|
}
|
|
#else
|
|
#if HAVE_GETHOSTNAME
|
|
/* define mygethostname() by using gethostname() :-) */
|
|
|
|
int mygethostname(char *client, int length)
|
|
{
|
|
gethostname(client, length);
|
|
}
|
|
#else
|
|
int mygethostname(char *client, int length)
|
|
{
|
|
*client = 0;
|
|
}
|
|
#endif
|
|
#endif
|