Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3ad815f

Browse files
committed
port.c no longer required...individual functions that were in there are
auto-generated via configure individual functions in individual files
1 parent 5379b84 commit 3ad815f

File tree

4 files changed

+45
-46
lines changed

4 files changed

+45
-46
lines changed

src/backend/port/gethostname.c

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <sys/types.h>
2+
#include <string.h>
3+
4+
#include <sys/utsname.h>
5+
6+
int
7+
gethostname(char *name, int namelen)
8+
{
9+
static struct utsname mname;
10+
static int called = 0;
11+
12+
if (!called)
13+
{
14+
called++;
15+
uname(&mname);
16+
}
17+
strncpy(name, mname.nodename, (SYS_NMLN < namelen ? SYS_NMLN : namelen));
18+
19+
return (0);
20+
}
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,9 @@
1-
/*-------------------------------------------------------------------------
2-
*
3-
* port.c--
4-
* Intel x86/Intel SVR4-specific routines
5-
*
6-
* Copyright (c) 1994, Regents of the University of California
7-
*
8-
*
9-
* IDENTIFICATION
10-
* /usr/local/devel/pglite/cvs/src/backend/port/svr4/port.c,v 1.2 1995/03/17 06:40:19 andrew Exp
11-
*
12-
*-------------------------------------------------------------------------
13-
*/
14-
#include <math.h> /* for pow() prototype */
1+
#include <math.h> /* for pow() prototype */
152

163
#include <errno.h>
174
#include "rusagestub.h"
185
#include "port-protos.h"
196

20-
long
21-
random()
22-
{
23-
return (lrand48());
24-
}
25-
26-
void
27-
srandom(int seed)
28-
{
29-
srand48((long int) seed);
30-
}
31-
327
int
338
getrusage(int who, struct rusage * rusage)
349
{
@@ -70,23 +45,3 @@ getrusage(int who, struct rusage * rusage)
7045
return (0);
7146
}
7247

73-
#include <sys/types.h>
74-
#include <string.h>
75-
76-
#include <sys/utsname.h>
77-
78-
int
79-
gethostname(char *name, int namelen)
80-
{
81-
static struct utsname mname;
82-
static int called = 0;
83-
84-
if (!called)
85-
{
86-
called++;
87-
uname(&mname);
88-
}
89-
strncpy(name, mname.nodename, (SYS_NMLN < namelen ? SYS_NMLN : namelen));
90-
91-
return (0);
92-
}

src/backend/port/random.c

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <math.h> /* for pow() prototype */
2+
3+
#include <errno.h>
4+
#include "rusagestub.h"
5+
#include "port-protos.h"
6+
7+
long
8+
random()
9+
{
10+
return (lrand48());
11+
}
12+

src/backend/port/srandom.c

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <math.h> /* for pow() prototype */
2+
3+
#include <errno.h>
4+
#include "rusagestub.h"
5+
#include "port-protos.h"
6+
7+
void
8+
srandom(int seed)
9+
{
10+
srand48((long int) seed);
11+
}
12+

0 commit comments

Comments
 (0)