mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
port.c no longer required...individual functions that were in there are
auto-generated via configure individual functions in individual files
This commit is contained in:
20
src/backend/port/gethostname.c
Normal file
20
src/backend/port/gethostname.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/utsname.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);
|
||||
}
|
||||
Reference in New Issue
Block a user