Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
afba16f4
Commit
afba16f4
authored
May 26, 2009
by
David Symonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getrusage for linux.
R=rsc APPROVED=rsc DELTA=40 (38 added, 0 deleted, 2 changed) OCL=29351 CL=29422
parent
646927e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
2 deletions
+42
-2
src/lib/syscall/Makefile
src/lib/syscall/Makefile
+3
-2
src/lib/syscall/proc_darwin.go
src/lib/syscall/proc_darwin.go
+15
-0
src/lib/syscall/proc_linux.go
src/lib/syscall/proc_linux.go
+19
-0
src/lib/syscall/types_amd64_linux.go
src/lib/syscall/types_amd64_linux.go
+5
-0
No files found.
src/lib/syscall/Makefile
View file @
afba16f4
...
...
@@ -3,7 +3,7 @@
# license that can be found in the LICENSE file.
# DO NOT EDIT. Automatically generated by gobuild.
# gobuild -m errstr_${GOOS}.go file_${GOOS}.go socket_${GOOS}.go syscall_${GOARCH}_${GOOS}.go time_${GOARCH}_${GOOS}.go types_${GOARCH}_${GOOS}.go asm_${GOARCH}_${GOOS}.s syscall.go signal_${GOARCH}_${GOOS}.go exec.go >Makefile
# gobuild -m errstr_${GOOS}.go file_${GOOS}.go socket_${GOOS}.go syscall_${GOARCH}_${GOOS}.go time_${GOARCH}_${GOOS}.go types_${GOARCH}_${GOOS}.go asm_${GOARCH}_${GOOS}.s syscall.go signal_${GOARCH}_${GOOS}.go exec.go
proc_${GOOS}.go
>Makefile
D
=
...
...
@@ -51,6 +51,7 @@ O2=\
O3
=
\
file_
$(GOOS)
.
$O
\
proc_
$(GOOS)
.
$O
\
socket_
$(GOOS)
.
$O
\
time_
$(GOARCH)
_
$(GOOS)
.
$O
\
...
...
@@ -70,7 +71,7 @@ a2: $(O2)
rm
-f
$(O2)
a3
:
$(O3)
$(AR)
grc _obj
$D
/syscall.a file_
$(GOOS)
.
$O
socket_
$(GOOS)
.
$O
time_
$(GOARCH)
_
$(GOOS)
.
$O
$(AR)
grc _obj
$D
/syscall.a file_
$(GOOS)
.
$O
proc_
$(GOOS)
.
$O
socket_
$(GOOS)
.
$O
time_
$(GOARCH)
_
$(GOOS)
.
$O
rm
-f
$(O3)
a4
:
$(O4)
...
...
src/lib/syscall/proc_darwin.go
0 → 100644
View file @
afba16f4
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
syscall
// Process operations for Darwin
// TODO:
// - getrusage
// - getrlimit, setrlimit
import
(
"syscall"
;
"unsafe"
;
)
src/lib/syscall/proc_linux.go
0 → 100644
View file @
afba16f4
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
syscall
// Process operations for Linux
// TODO:
// - getrlimit, setrlimit
import
(
"syscall"
;
"unsafe"
;
)
func
Getrusage
(
who
int64
,
usage
*
Rusage
)
(
ret
,
errno
int64
)
{
r1
,
r2
,
err
:=
Syscall
(
SYS_GETRUSAGE
,
who
,
int64
(
uintptr
(
unsafe
.
Pointer
(
usage
))),
0
);
return
r1
,
err
}
src/lib/syscall/types_amd64_linux.go
View file @
afba16f4
...
...
@@ -28,6 +28,11 @@ type Timeval struct {
// Processes
const
(
RUSAGE_SELF
=
0
;
RUSAGE_CHILDREN
=
-
1
;
)
type
Rusage
struct
{
Utime
Timeval
;
Stime
Timeval
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment