Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit976b386

Browse files
committed
Currently, building on any platform that hasn't got getrusage()
requires manual editing of src/backend/port/getrusage.c, becauseits substitute version of getrusage is #if'd out.There is no good reason for that, because configure won't eveninclude the file into the Makefile unless the platform hasn't gotgetrusage. Furthermore, we only have one working substitute versionof getrusage --- the alleged HPUX syscall-based code doesn't work.(It causes a coredump because the syscall returns a struct rusagethat's much larger than the stub struct defined insrc/include/rusagestub.h.) The times()-based emulation works fineon HPUX, however.I propose, therefore, that getrusage.c should just unconditionallycompile the times-based version, and rely on configure to includethe file only if needed. This will be one less manual configurationstep on all platforms that need this code.Patch attached.Tom Lane.
1 parent5aea406 commit976b386

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

‎src/backend/port/getrusage.c

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
/* $Id: getrusage.c,v 1.8 1998/06/19 02:55:04 momjian Exp $ */
2-
3-
#include<math.h>/* for pow() prototype */
1+
/* $Id: getrusage.c,v 1.9 1998/07/13 16:39:07 momjian Exp $ */
42

53
#include<errno.h>
64
#include"rusagestub.h"
75

8-
#if0/* this is from univel port ... how does
9-
* compiler define? */
10-
/* same for solaris_i386 port ... how does compiler define? */
11-
/* same for sco port ... how does compiler define? */
12-
/* same for solaris_sparc port ... how does compiler define? */
13-
/* same for svr4 port ... how does compiler define? */
6+
/* This code works on:
7+
*univel
8+
*solaris_i386
9+
*sco
10+
*solaris_sparc
11+
*svr4
12+
*hpux 9.*
13+
* which currently is all the supported platforms that don't have a
14+
* native version of getrusage(). So, if configure decides to compile
15+
* this file at all, we just use this version unconditionally.
16+
*/
17+
1418
int
1519
getrusage(intwho,structrusage*rusage)
1620
{
@@ -51,14 +55,3 @@ getrusage(int who, struct rusage * rusage)
5155
rusage->ru_stime.tv_usec=TICK_TO_USEC(u,tick_rate);
5256
return (0);
5357
}
54-
55-
#endif
56-
57-
#if0/* this is for hpux port ... how does
58-
* compiler define? */
59-
getrusage(intwho,structrusage*ru)
60-
{
61-
return (syscall(SYS_GETRUSAGE,who,ru));
62-
}
63-
64-
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp