aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-01-31 20:47:55 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-01-31 20:47:55 +0000
commit7d18953823ddbc315831578e6a7038a6138036c8 (patch)
treec6c3283493da24d6fc2ee24d0da09a1603cbb9f7 /libgo/go/syscall
parente15999a5ede3ad6367db32020d46ca5713c889e2 (diff)
downloadgcc-7d18953823ddbc315831578e6a7038a6138036c8.zip
gcc-7d18953823ddbc315831578e6a7038a6138036c8.tar.gz
gcc-7d18953823ddbc315831578e6a7038a6138036c8.tar.bz2
syscall: Add Gettid on GNU/Linux systems.
From-SVN: r183775
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r--libgo/go/syscall/libcall_linux.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go
index 7e88d04..aa14401 100644
--- 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.