aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/libgo/go
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/libgo/go')
-rw-r--r--gcc-4.8/libgo/go/go/build/build.go2
-rw-r--r--gcc-4.8/libgo/go/go/build/syslist.go8
-rw-r--r--gcc-4.8/libgo/go/net/fd_unix.go11
-rw-r--r--gcc-4.8/libgo/go/reflect/all_test.go60
-rw-r--r--gcc-4.8/libgo/go/reflect/makefunc.go90
-rw-r--r--gcc-4.8/libgo/go/reflect/makefunc_386.S36
-rw-r--r--gcc-4.8/libgo/go/reflect/makefunc_amd64.S15
-rw-r--r--gcc-4.8/libgo/go/reflect/makefuncgo_386.go24
-rw-r--r--gcc-4.8/libgo/go/reflect/makefuncgo_amd64.go2
-rw-r--r--gcc-4.8/libgo/go/reflect/type.go2
-rw-r--r--gcc-4.8/libgo/go/reflect/value.go43
-rw-r--r--gcc-4.8/libgo/go/syscall/libcall_linux.go15
-rw-r--r--gcc-4.8/libgo/go/syscall/libcall_posix.go6
-rw-r--r--gcc-4.8/libgo/go/syscall/socket.go2
14 files changed, 261 insertions, 55 deletions
diff --git a/gcc-4.8/libgo/go/go/build/build.go b/gcc-4.8/libgo/go/go/build/build.go
index cc89afb21..59ddcefd7 100644
--- a/gcc-4.8/libgo/go/go/build/build.go
+++ b/gcc-4.8/libgo/go/go/build/build.go
@@ -429,7 +429,7 @@ func (ctxt *Context) Import(path string, srcDir string, mode ImportMode) (*Packa
switch ctxt.Compiler {
case "gccgo":
dir, elem := pathpkg.Split(p.ImportPath)
- pkga = "pkg/gccgo/" + dir + "lib" + elem + ".a"
+ pkga = "pkg/gccgo_" + ctxt.GOOS + "_" + ctxt.GOARCH + "/" + dir + "lib" + elem + ".a"
case "gc":
suffix := ""
if ctxt.InstallSuffix != "" {
diff --git a/gcc-4.8/libgo/go/go/build/syslist.go b/gcc-4.8/libgo/go/go/build/syslist.go
new file mode 100644
index 000000000..a322c88c4
--- /dev/null
+++ b/gcc-4.8/libgo/go/go/build/syslist.go
@@ -0,0 +1,8 @@
+// Copyright 2011 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 build
+
+const goosList = "darwin dragonfly freebsd linux netbsd openbsd plan9 windows solaris "
+const goarchList = "386 amd64 arm alpha m68k mipso32 mipsn32 mipsn64 mipso64 ppc ppc64 sparc sparc64 "
diff --git a/gcc-4.8/libgo/go/net/fd_unix.go b/gcc-4.8/libgo/go/net/fd_unix.go
index 8c59bff98..0f863aadd 100644
--- a/gcc-4.8/libgo/go/net/fd_unix.go
+++ b/gcc-4.8/libgo/go/net/fd_unix.go
@@ -9,6 +9,7 @@ package net
import (
"io"
"os"
+ "runtime"
"sync"
"syscall"
"time"
@@ -90,6 +91,16 @@ func (fd *netFD) connect(la, ra syscall.Sockaddr) error {
if err == nil || err == syscall.EISCONN {
break
}
+
+ // On Solaris we can see EINVAL if the socket has
+ // already been accepted and closed by the server.
+ // Treat this as a successful connection--writes to
+ // the socket will see EOF. For details and a test
+ // case in C see http://golang.org/issue/6828.
+ if runtime.GOOS == "solaris" && err == syscall.EINVAL {
+ break
+ }
+
if err != syscall.EINPROGRESS && err != syscall.EALREADY && err != syscall.EINTR {
return err
}
diff --git a/gcc-4.8/libgo/go/reflect/all_test.go b/gcc-4.8/libgo/go/reflect/all_test.go
index 526f09bb2..50f49e066 100644
--- a/gcc-4.8/libgo/go/reflect/all_test.go
+++ b/gcc-4.8/libgo/go/reflect/all_test.go
@@ -1430,6 +1430,46 @@ func TestFunc(t *testing.T) {
}
}
+type emptyStruct struct{}
+
+type nonEmptyStruct struct {
+ member int
+}
+
+func returnEmpty() emptyStruct {
+ return emptyStruct{}
+}
+
+func takesEmpty(e emptyStruct) {
+}
+
+func returnNonEmpty(i int) nonEmptyStruct {
+ return nonEmptyStruct{member: i}
+}
+
+func takesNonEmpty(n nonEmptyStruct) int {
+ return n.member
+}
+
+func TestCallWithStruct(t *testing.T) {
+ r := ValueOf(returnEmpty).Call([]Value{})
+ if len(r) != 1 || r[0].Type() != TypeOf(emptyStruct{}) {
+ t.Errorf("returning empty struct returned %s instead", r)
+ }
+ r = ValueOf(takesEmpty).Call([]Value{ValueOf(emptyStruct{})})
+ if len(r) != 0 {
+ t.Errorf("takesEmpty returned values: %s", r)
+ }
+ r = ValueOf(returnNonEmpty).Call([]Value{ValueOf(42)})
+ if len(r) != 1 || r[0].Type() != TypeOf(nonEmptyStruct{}) || r[0].Field(0).Int() != 42 {
+ t.Errorf("returnNonEmpty returned %s", r)
+ }
+ r = ValueOf(takesNonEmpty).Call([]Value{ValueOf(nonEmptyStruct{member: 42})})
+ if len(r) != 1 || r[0].Type() != TypeOf(1) || r[0].Int() != 42 {
+ t.Errorf("takesNonEmpty returned %s", r)
+ }
+}
+
func TestMakeFunc(t *testing.T) {
switch runtime.GOARCH {
case "amd64", "386":
@@ -1587,9 +1627,13 @@ func TestMethod(t *testing.T) {
}
}
-/* Not yet implemented for gccgo
-
func TestMethodValue(t *testing.T) {
+ switch runtime.GOARCH {
+ case "amd64", "386":
+ default:
+ t.Skip("reflect method values not implemented for " + runtime.GOARCH)
+ }
+
p := Point{3, 4}
var i int64
@@ -1658,8 +1702,6 @@ func TestMethodValue(t *testing.T) {
}
}
-*/
-
// Reflect version of $GOROOT/test/method5.go
// Concrete types implementing M method.
@@ -1744,14 +1786,18 @@ type Tm4 struct {
func (t4 Tm4) M(x int, b byte) (byte, int) { return b, x + 40 }
func TestMethod5(t *testing.T) {
- /* Not yet used for gccgo
+ switch runtime.GOARCH {
+ case "amd64", "386":
+ default:
+ t.Skip("reflect method values not implemented for " + runtime.GOARCH)
+ }
+
CheckF := func(name string, f func(int, byte) (byte, int), inc int) {
b, x := f(1000, 99)
if b != 99 || x != 1000+inc {
t.Errorf("%s(1000, 99) = %v, %v, want 99, %v", name, b, x, 1000+inc)
}
}
- */
CheckV := func(name string, i Value, inc int) {
bx := i.Method(0).Call([]Value{ValueOf(1000), ValueOf(byte(99))})
@@ -1761,9 +1807,7 @@ func TestMethod5(t *testing.T) {
t.Errorf("direct %s.M(1000, 99) = %v, %v, want 99, %v", name, b, x, 1000+inc)
}
- /* Not yet implemented for gccgo
CheckF(name+".M", i.Method(0).Interface().(func(int, byte) (byte, int)), inc)
- */
}
var TinterType = TypeOf(new(Tinter)).Elem()
diff --git a/gcc-4.8/libgo/go/reflect/makefunc.go b/gcc-4.8/libgo/go/reflect/makefunc.go
index 3e8085bec..9f150ea65 100644
--- a/gcc-4.8/libgo/go/reflect/makefunc.go
+++ b/gcc-4.8/libgo/go/reflect/makefunc.go
@@ -17,6 +17,11 @@ type makeFuncImpl struct {
code uintptr
typ *funcType
fn func([]Value) []Value
+
+ // For gccgo we use the same entry point for functions and for
+ // method values.
+ method int
+ rcvr Value
}
// MakeFunc returns a new function of the given Type
@@ -61,7 +66,7 @@ func MakeFunc(typ Type, fn func(args []Value) (results []Value)) Value {
dummy := makeFuncStub
code := **(**uintptr)(unsafe.Pointer(&dummy))
- impl := &makeFuncImpl{code: code, typ: ftyp, fn: fn}
+ impl := &makeFuncImpl{code: code, typ: ftyp, fn: fn, method: -1}
return Value{t, unsafe.Pointer(&impl), flag(Func<<flagKindShift) | flagIndir}
}
@@ -85,15 +90,94 @@ func makeMethodValue(op string, v Value) Value {
panic("reflect: internal error: invalid use of makePartialFunc")
}
+ switch runtime.GOARCH {
+ case "amd64", "386":
+ default:
+ panic("reflect.makeMethodValue not implemented for " + runtime.GOARCH)
+ }
+
// Ignoring the flagMethod bit, v describes the receiver, not the method type.
fl := v.flag & (flagRO | flagAddr | flagIndir)
fl |= flag(v.typ.Kind()) << flagKindShift
rcvr := Value{v.typ, v.val, fl}
+ // v.Type returns the actual type of the method value.
+ ft := v.Type().(*rtype)
+
+ // Indirect Go func value (dummy) to obtain
+ // actual code address. (A Go func value is a pointer
+ // to a C function pointer. http://golang.org/s/go11func.)
+ dummy := makeFuncStub
+ code := **(**uintptr)(unsafe.Pointer(&dummy))
+
// Cause panic if method is not appropriate.
// The panic would still happen during the call if we omit this,
// but we want Interface() and other operations to fail early.
- methodReceiver(op, rcvr, int(v.flag)>>flagMethodShift)
+ t, _, _ := methodReceiver(op, rcvr, int(v.flag)>>flagMethodShift)
+
+ fv := &makeFuncImpl{
+ code: code,
+ typ: (*funcType)(unsafe.Pointer(t)),
+ method: int(v.flag) >> flagMethodShift,
+ rcvr: rcvr,
+ }
+
+ return Value{ft, unsafe.Pointer(&fv), v.flag&flagRO | flag(Func)<<flagKindShift | flagIndir}
+}
+
+// makeValueMethod takes a method function and returns a function that
+// takes a value receiver and calls the real method with a pointer to
+// it.
+func makeValueMethod(v Value) Value {
+ typ := v.typ
+ if typ.Kind() != Func {
+ panic("reflect: call of makeValueMethod with non-Func type")
+ }
+ if v.flag&flagMethodFn == 0 {
+ panic("reflect: call of makeValueMethod with non-MethodFn")
+ }
- panic("reflect makeMethodValue not implemented")
+ switch runtime.GOARCH {
+ case "amd64", "386":
+ default:
+ panic("reflect.makeValueMethod not implemented for " + runtime.GOARCH)
+ }
+
+ t := typ.common()
+ ftyp := (*funcType)(unsafe.Pointer(t))
+
+ // Indirect Go func value (dummy) to obtain
+ // actual code address. (A Go func value is a pointer
+ // to a C function pointer. http://golang.org/s/go11func.)
+ dummy := makeFuncStub
+ code := **(**uintptr)(unsafe.Pointer(&dummy))
+
+ impl := &makeFuncImpl{
+ code: code,
+ typ: ftyp,
+ method: -2,
+ rcvr: v,
+ }
+
+ return Value{t, unsafe.Pointer(&impl), flag(Func<<flagKindShift) | flagIndir}
+}
+
+// Call the function represented by a makeFuncImpl.
+func (c *makeFuncImpl) call(in []Value) []Value {
+ if c.method == -1 {
+ return c.fn(in)
+ } else if c.method == -2 {
+ if c.typ.IsVariadic() {
+ return c.rcvr.CallSlice(in)
+ } else {
+ return c.rcvr.Call(in)
+ }
+ } else {
+ m := c.rcvr.Method(c.method)
+ if c.typ.IsVariadic() {
+ return m.CallSlice(in)
+ } else {
+ return m.Call(in)
+ }
+ }
}
diff --git a/gcc-4.8/libgo/go/reflect/makefunc_386.S b/gcc-4.8/libgo/go/reflect/makefunc_386.S
index 5878bc44c..0e2e76465 100644
--- a/gcc-4.8/libgo/go/reflect/makefunc_386.S
+++ b/gcc-4.8/libgo/go/reflect/makefunc_386.S
@@ -25,9 +25,13 @@ reflect.makeFuncStub:
struct {
esp uint32 // 0x0
eax uint32 // 0x4
- st0 uint64 // 0x8
+ st0 float64 // 0x8
+ sr bool // 0x10
+ sf bool // 0x11
}
- */
+ The sr field is set by the function to a non-zero value if
+ the function takes a struct hidden pointer that must be
+ popped off the stack. */
pushl %ebp
.LCFI0:
@@ -45,6 +49,15 @@ reflect.makeFuncStub:
leal 8(%ebp), %eax /* Set esp field in struct. */
movl %eax, -24(%ebp)
+ /* For MakeFunc functions that call recover. */
+ movl 4(%ebp), %eax
+ movl %eax, (%esp)
+#ifdef __PIC__
+ call __go_makefunc_can_recover@PLT
+#else
+ call __go_makefunc_can_recover
+#endif
+
#ifdef __PIC__
call __go_get_closure@PLT
#else
@@ -62,9 +75,20 @@ reflect.makeFuncStub:
call reflect.MakeFuncStubGo
#endif
+ /* MakeFunc functions can no longer call recover. */
+#ifdef __PIC__
+ call __go_makefunc_returning@PLT
+#else
+ call __go_makefunc_returning
+#endif
+
/* Set return registers. */
movl -20(%ebp), %eax
+
+ cmpb $0, -7(%ebp)
+ je 2f
+
fldl -16(%ebp)
#ifdef __SSE2__
@@ -73,12 +97,20 @@ reflect.makeFuncStub:
movsd -16(%ebp), %xmm0
#endif
+2:
+ movb -8(%ebp), %dl
+
addl $36, %esp
popl %ebx
.LCFI3:
popl %ebp
.LCFI4:
+
+ testb %dl,%dl
+ jne 1f
ret
+1:
+ ret $4
.LFE1:
#ifdef __ELF__
.size reflect.makeFuncStub, . - reflect.makeFuncStub
diff --git a/gcc-4.8/libgo/go/reflect/makefunc_amd64.S b/gcc-4.8/libgo/go/reflect/makefunc_amd64.S
index 9d12f193f..88302eee1 100644
--- a/gcc-4.8/libgo/go/reflect/makefunc_amd64.S
+++ b/gcc-4.8/libgo/go/reflect/makefunc_amd64.S
@@ -61,6 +61,14 @@ reflect.makeFuncStub:
movdqa %xmm6, 0xa0(%rsp)
movdqa %xmm7, 0xb0(%rsp)
+ /* For MakeFunc functions that call recover. */
+ movq 8(%rbp), %rdi
+#ifdef __PIC__
+ call __go_makefunc_can_recover@PLT
+#else
+ call __go_makefunc_can_recover
+#endif
+
# Get function type.
#ifdef __PIC__
call __go_get_closure@PLT
@@ -77,6 +85,13 @@ reflect.makeFuncStub:
call reflect.MakeFuncStubGo
#endif
+ /* MakeFunc functions can no longer call recover. */
+#ifdef __PIC__
+ call __go_makefunc_returning@PLT
+#else
+ call __go_makefunc_returning
+#endif
+
# The structure will be updated with any return values. Load
# all possible return registers before returning to the caller.
diff --git a/gcc-4.8/libgo/go/reflect/makefuncgo_386.go b/gcc-4.8/libgo/go/reflect/makefuncgo_386.go
index 0fac1f488..45dd2d759 100644
--- a/gcc-4.8/libgo/go/reflect/makefuncgo_386.go
+++ b/gcc-4.8/libgo/go/reflect/makefuncgo_386.go
@@ -15,7 +15,9 @@ import "unsafe"
type i386Regs struct {
esp uint32
eax uint32 // Value to return in %eax.
- st0 uint64 // Value to return in %st(0).
+ st0 float64 // Value to return in %st(0).
+ sr bool // Set to true if hidden struct pointer.
+ sf bool // Set to true if returning float
}
// MakeFuncStubGo implements the 386 calling convention for MakeFunc.
@@ -56,10 +58,13 @@ func MakeFuncStubGo(regs *i386Regs, c *makeFuncImpl) {
in := make([]Value, 0, len(ftyp.in))
ap := uintptr(regs.esp)
+ regs.sr = false
+ regs.sf = false
var retPtr unsafe.Pointer
if retStruct {
retPtr = *(*unsafe.Pointer)(unsafe.Pointer(ap))
ap += ptrSize
+ regs.sr = true
}
for _, rt := range ftyp.in {
@@ -77,7 +82,7 @@ func MakeFuncStubGo(regs *i386Regs, c *makeFuncImpl) {
// Call the real function.
- out := c.fn(in)
+ out := c.call(in)
if len(out) != len(ftyp.out) {
panic("reflect: wrong return count from function created by MakeFunc")
@@ -123,13 +128,16 @@ func MakeFuncStubGo(regs *i386Regs, c *makeFuncImpl) {
v := out[0]
w := v.iword()
- if v.Kind() != Ptr && v.Kind() != UnsafePointer {
- w = loadIword(unsafe.Pointer(w), v.typ.size)
- }
switch v.Kind() {
- case Float32, Float64:
- regs.st0 = uint64(uintptr(w))
- default:
+ case Ptr, UnsafePointer:
regs.eax = uint32(uintptr(w))
+ case Float32:
+ regs.st0 = float64(*(*float32)(unsafe.Pointer(w)))
+ regs.sf = true
+ case Float64:
+ regs.st0 = *(*float64)(unsafe.Pointer(w))
+ regs.sf = true
+ default:
+ regs.eax = uint32(uintptr(loadIword(unsafe.Pointer(w), v.typ.size)))
}
}
diff --git a/gcc-4.8/libgo/go/reflect/makefuncgo_amd64.go b/gcc-4.8/libgo/go/reflect/makefuncgo_amd64.go
index ecc50a425..42fe03a93 100644
--- a/gcc-4.8/libgo/go/reflect/makefuncgo_amd64.go
+++ b/gcc-4.8/libgo/go/reflect/makefuncgo_amd64.go
@@ -319,7 +319,7 @@ argloop:
// All the real arguments have been found and turned into
// Value's. Call the real function.
- out := c.fn(in)
+ out := c.call(in)
if len(out) != len(ftyp.out) {
panic("reflect: wrong return count from function created by MakeFunc")
diff --git a/gcc-4.8/libgo/go/reflect/type.go b/gcc-4.8/libgo/go/reflect/type.go
index d084f38eb..2b8342cb5 100644
--- a/gcc-4.8/libgo/go/reflect/type.go
+++ b/gcc-4.8/libgo/go/reflect/type.go
@@ -508,7 +508,7 @@ func (t *uncommonType) Method(i int) (m Method) {
m.Type = toType(mt)
x := new(unsafe.Pointer)
*x = unsafe.Pointer(&p.tfn)
- m.Func = Value{mt, unsafe.Pointer(x), fl | flagIndir}
+ m.Func = Value{mt, unsafe.Pointer(x), fl | flagIndir | flagMethodFn}
m.Index = i
return
}
diff --git a/gcc-4.8/libgo/go/reflect/value.go b/gcc-4.8/libgo/go/reflect/value.go
index b199f7088..492155781 100644
--- a/gcc-4.8/libgo/go/reflect/value.go
+++ b/gcc-4.8/libgo/go/reflect/value.go
@@ -98,6 +98,7 @@ const (
flagIndir
flagAddr
flagMethod
+ flagMethodFn // gccgo: first fn parameter is always pointer
flagKindShift = iota
flagKindWidth = 5 // there are 27 kinds
flagKindMask flag = 1<<flagKindWidth - 1
@@ -433,7 +434,7 @@ func (v Value) call(op string, in []Value) []Value {
if v.flag&flagMethod != 0 {
nin++
}
- firstPointer := len(in) > 0 && t.In(0).Kind() != Ptr && v.flag&flagMethod == 0 && isMethod(v.typ)
+ firstPointer := len(in) > 0 && t.In(0).Kind() != Ptr && v.flag&flagMethodFn != 0
params := make([]unsafe.Pointer, nin)
off := 0
if v.flag&flagMethod != 0 {
@@ -484,33 +485,6 @@ func (v Value) call(op string, in []Value) []Value {
return ret
}
-// gccgo specific test to see if typ is a method. We can tell by
-// looking at the string to see if there is a receiver. We need this
-// because for gccgo all methods take pointer receivers.
-func isMethod(t *rtype) bool {
- if Kind(t.kind) != Func {
- return false
- }
- s := *t.string
- parens := 0
- params := 0
- sawRet := false
- for i, c := range s {
- if c == '(' {
- if parens == 0 {
- params++
- }
- parens++
- } else if c == ')' {
- parens--
- } else if parens == 0 && c == ' ' && s[i+1] != '(' && !sawRet {
- params++
- sawRet = true
- }
- }
- return params > 2
-}
-
// methodReceiver returns information about the receiver
// described by v. The Value v may or may not have the
// flagMethod bit set, so the kind cached in v.flag should
@@ -917,6 +891,16 @@ func valueInterface(v Value, safe bool) interface{} {
v = makeMethodValue("Interface", v)
}
+ if v.flag&flagMethodFn != 0 {
+ if v.typ.Kind() != Func {
+ panic("reflect: MethodFn of non-Func")
+ }
+ ft := (*funcType)(unsafe.Pointer(v.typ))
+ if ft.in[0].Kind() != Ptr {
+ v = makeValueMethod(v)
+ }
+ }
+
k := v.kind()
if k == Interface {
// Special case: return the element inside the interface.
@@ -1230,8 +1214,7 @@ func (v Value) Pointer() uintptr {
// created via reflect have the same underlying code pointer,
// so their Pointers are equal. The function used here must
// match the one used in makeMethodValue.
- // This is not properly implemented for gccgo.
- f := Zero
+ f := makeFuncStub
return **(**uintptr)(unsafe.Pointer(&f))
}
p := v.val
diff --git a/gcc-4.8/libgo/go/syscall/libcall_linux.go b/gcc-4.8/libgo/go/syscall/libcall_linux.go
index 79de2f389..60eecd9ef 100644
--- a/gcc-4.8/libgo/go/syscall/libcall_linux.go
+++ b/gcc-4.8/libgo/go/syscall/libcall_linux.go
@@ -190,6 +190,9 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
//sys Adjtimex(buf *Timex) (state int, err error)
//adjtimex(buf *Timex) _C_int
+//sysnb Dup3(oldfd int, newfd int, flags int) (err error)
+//dup3(oldfd _C_int, newfd _C_int, flags _C_int) _C_int
+
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
//faccessat(dirfd _C_int, pathname *byte, mode _C_int, flags _C_int) _C_int
@@ -268,6 +271,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
return origlen - len(buf), count, names
}
+//sys Getxattr(path string, attr string, dest []byte) (sz int, err error)
+//getxattr(path *byte, attr *byte, buf *byte, count Size_t) Ssize_t
+
//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
//inotify_add_watch(fd _C_int, pathname *byte, mask uint32) _C_int
@@ -283,6 +289,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
//sys Klogctl(typ int, buf []byte) (n int, err error)
//klogctl(typ _C_int, bufp *byte, len _C_int) _C_int
+//sys Listxattr(path string, dest []byte) (sz int, err error)
+//listxattr(path *byte, list *byte, size Size_t) Ssize_t
+
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//mkdirat(dirfd _C_int, path *byte, mode Mode_t) _C_int
@@ -305,6 +314,9 @@ func Pipe2(p []int, flags int) (err error) {
//sys PivotRoot(newroot string, putold string) (err error)
//pivot_root(newroot *byte, putold *byte) _C_int
+//sys Removexattr(path string, attr string) (err error)
+//removexattr(path *byte, name *byte) _C_int
+
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//renameat(olddirfd _C_int, oldpath *byte, newdirfd _C_int, newpath *byte) _C_int
@@ -338,6 +350,9 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sysnb Setresuid(ruid int, eguid int, suid int) (err error)
//setresuid(ruid Uid_t, euid Uid_t, suid Uid_t) _C_int
+//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
+//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+
//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
diff --git a/gcc-4.8/libgo/go/syscall/libcall_posix.go b/gcc-4.8/libgo/go/syscall/libcall_posix.go
index 1e7823b54..91ff59b6c 100644
--- a/gcc-4.8/libgo/go/syscall/libcall_posix.go
+++ b/gcc-4.8/libgo/go/syscall/libcall_posix.go
@@ -238,6 +238,9 @@ func FDZero(set *FdSet) {
//sysnb Getppid() (ppid int)
//getppid() Pid_t
+//sys Getpriority(which int, who int) (prio int, err error)
+//getpriority(which _C_int, who _C_int) _C_int
+
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//getrlimit(resource _C_int, rlim *Rlimit) _C_int
@@ -307,6 +310,9 @@ func Gettimeofday(tv *Timeval) (err error) {
//sysnb Setpgid(pid int, pgid int) (err error)
//setpgid(pid Pid_t, pgid Pid_t) _C_int
+//sys Setpriority(which int, who int, prio int) (err error)
+//setpriority(which _C_int, who _C_int, prio _C_int) _C_int
+
//sysnb Setreuid(ruid int, euid int) (err error)
//setreuid(ruid Uid_t, euid Uid_t) _C_int
diff --git a/gcc-4.8/libgo/go/syscall/socket.go b/gcc-4.8/libgo/go/syscall/socket.go
index cc98d6b79..4a80a4cdb 100644
--- a/gcc-4.8/libgo/go/syscall/socket.go
+++ b/gcc-4.8/libgo/go/syscall/socket.go
@@ -25,7 +25,7 @@ type RawSockaddrAny struct {
Pad [96]int8
}
-const SizeofSockaddrAny = 0x1c
+const SizeofSockaddrAny = 0x6c
type SockaddrInet4 struct {
Port int