File tree 4 files changed +45
-46
lines changed
4 files changed +45
-46
lines changed Original file line number Diff line number Diff line change
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 number Diff line number Diff line change 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 */
15
2
16
3
#include <errno.h>
17
4
#include "rusagestub.h"
18
5
#include "port-protos.h"
19
6
20
- long
21
- random ()
22
- {
23
- return (lrand48 ());
24
- }
25
-
26
- void
27
- srandom (int seed )
28
- {
29
- srand48 ((long int ) seed );
30
- }
31
-
32
7
int
33
8
getrusage (int who , struct rusage * rusage )
34
9
{
@@ -70,23 +45,3 @@ getrusage(int who, struct rusage * rusage)
70
45
return (0 );
71
46
}
72
47
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
- }
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments