mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
nodeAgg.c: WARN -> NOTICE for elog parse_oper.c: was created after patch for fmgr_info, so function call wrong scan.c: regenerated for i386_solaris using flex 2.5.4 gethostname.c: required prototype for gethostname() function config.h.in: create prototype for isinfo() function isinf.c: "fake" isinf() under i386_solaris using fpclass() call...
25 lines
395 B
C
25 lines
395 B
C
/* $Id: gethostname.c,v 1.3 1998/01/15 20:54:34 scrappy Exp $ */
|
|
|
|
#include <sys/types.h>
|
|
#include <string.h>
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
#include "config.h"
|
|
|
|
int
|
|
gethostname(char *name, int namelen)
|
|
{
|
|
static struct utsname mname;
|
|
static int called = 0;
|
|
|
|
if (!called)
|
|
{
|
|
called++;
|
|
uname(&mname);
|
|
}
|
|
strncpy(name, mname.nodename, (SYS_NMLN < namelen ? SYS_NMLN : namelen));
|
|
|
|
return (0);
|
|
}
|