Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
871a4202
Commit
871a4202
authored
31 years ago
by
hallgren
Browse files
Options
Downloads
Patches
Plain Diff
Fixed getrusage to return the user and system times.
parent
b1a0e9d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lisp/hpux-os.c
+20
-1
20 additions, 1 deletion
lisp/hpux-os.c
with
20 additions
and
1 deletion
lisp/hpux-os.c
+
20
−
1
View file @
871a4202
/*
/*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/hpux-os.c,v 1.
1
1993/0
7/27 16:02:04
hallgren Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/hpux-os.c,v 1.
2
1993/0
8/02 19:56:26
hallgren Exp $
*
*
* OS-dependent routines. This file (along with os.h) exports an
* OS-dependent routines. This file (along with os.h) exports an
* OS-independent interface to the operating system VM facilities.
* OS-independent interface to the operating system VM facilities.
...
@@ -38,6 +38,7 @@ the particular section in.
...
@@ -38,6 +38,7 @@ the particular section in.
#include
<sys/resource.h>
#include
<sys/resource.h>
#include
"interrupt.h"
#include
"interrupt.h"
#include
<netdb.h>
#include
<netdb.h>
#include
<sys/times.h>
os_vm_size_t
os_vm_page_size
=
(
-
1
);
os_vm_size_t
os_vm_page_size
=
(
-
1
);
...
@@ -308,7 +309,25 @@ os_reallocate(os_vm_address_t addr, os_vm_size_t old_len,
...
@@ -308,7 +309,25 @@ os_reallocate(os_vm_address_t addr, os_vm_size_t old_len,
void
void
getrusage
(
int
who
,
struct
rusage
*
rusage
)
getrusage
(
int
who
,
struct
rusage
*
rusage
)
{
{
long
clk_tck
;
struct
tms
buf
;
bzero
(
rusage
,
sizeof
(
struct
rusage
));
bzero
(
rusage
,
sizeof
(
struct
rusage
));
clk_tck
=
sysconf
(
_SC_CLK_TCK
);
if
(
times
(
&
buf
)
==
-
1
)
{
perror
(
"times"
);
return
;
}
if
(
who
==
RUSAGE_SELF
)
{
rusage
.
ru_utime
.
tv_sec
=
buf
.
tms_utime
/
clk_tck
;
rusage
.
ru_utime
.
tv_usec
=
(
buf
.
tms_utime
%
clk
)
*
100000
;
rusage
.
ru_stime
.
tv_sec
=
buf
.
tms_stime
/
clk_tck
;
rusage
.
ru_stime
.
tv_usec
=
(
buf
.
tms_stime
%
clk_tck
)
*
100000
;
}
else
if
(
who
==
RUSAGE_CHILDREN
)
{
rusage
.
ru_utime
.
tv_sec
=
buf
.
tms_cutime
/
clk_tck
;
rusage
.
ru_utime
.
tv_usec
=
(
buf
.
tms_cutime
%
clk
)
*
100000
;
rusage
.
ru_stime
.
tv_sec
=
buf
.
tms_cstime
/
clk_tck
;
rusage
.
ru_stime
.
tv_usec
=
(
buf
.
tms_cstime
%
clk_tck
)
*
100000
;
}
}
}
int
int
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment