projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e15999a
)
syscall: Add Gettid on GNU/Linux systems.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 31 Jan 2012 20:47:55 +0000
(20:47 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 31 Jan 2012 20:47:55 +0000
(20:47 +0000)
From-SVN: r183775
libgo/go/syscall/libcall_linux.go
patch
|
blob
|
history
diff --git
a/libgo/go/syscall/libcall_linux.go
b/libgo/go/syscall/libcall_linux.go
index 7e88d04026e9106c3fd70e62af447d8187b430b7..aa1440118e3c7a30caafc397be37ca44296c00de 100644
(file)
--- a/
libgo/go/syscall/libcall_linux.go
+++ b/
libgo/go/syscall/libcall_linux.go
@@
-195,9
+195,10
@@
func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0)
// //sys Fstatfs(fd int, buf *Statfs_t) (err error)
// //fstatfs(fd int, buf *Statfs_t) int
-// FIXME: Only available as a syscall.
-// //sysnb Gettid() (tid int)
-// //gettid() Pid_t
+func Gettid() (tid int) {
+ r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0)
+ return int(r1)
+}
// FIXME: mksysinfo linux_dirent
// Or just abandon this function.