From patchwork Fri Feb 8 17:42:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libgo patch committed: Update to current version of Go library From: Uros Bizjak X-Patchwork-Id: 219237 Message-Id: To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org Date: Fri, 8 Feb 2013 18:42:49 +0100 On Fri, Feb 8, 2013 at 6:10 PM, Uros Bizjak wrote: > On Fri, Feb 8, 2013 at 5:53 PM, Ian Lance Taylor wrote: >> On Fri, Feb 8, 2013 at 8:48 AM, Uros Bizjak wrote: >>> >>> utimensat returns zero on CentOS. Following is gdb session: >> >> Thanks--can you do the same session but with "step" instead of "next"? > > I think I got the problem. Yep. Following patch fixes the failure: --cut here-- return EINVAL --cut here-- Please note, that looking at generated libcalls.go, there are many other possible signed/unsigned issues of the same type. Since this all happens on x86_64 (where go int is apparently 64bit), it looks that it is very important to distinguish int from _C_int in glue source. Uros. Index: go/syscall/libcall_linux_utimesnano.go =================================================================== --- go/syscall/libcall_linux_utimesnano.go (revision 195879) +++ go/syscall/libcall_linux_utimesnano.go (working copy) @@ -9,7 +9,7 @@ import "unsafe" //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) -//utimensat(dirfd int, path *byte, times *[2]Timespec, flags int) int +//utimensat(dirfd _C_int, path *byte, times *[2]Timespec, flags int) _C_int func UtimesNano(path string, ts []Timespec) (err error) { if len(ts) != 2 {