golang 交叉编译mipsel在mt7688上运行时遇到过的坑,记录一下

异常提示: 网络监听端口一直提示 errno: -89问题

解决办法:

修改golang源码,fd_unix.go

原->

func (fd *FD) Init(net string, pollable bool) error {

// We don't actually care about the various network types.
if net == "file" {
fd.isFile = true
}
if !pollable {
fd.isBlocking = true
return nil
}
return fd.pd.init(fd)

}

修改为->

func (fd *FD) Init(net string, pollable bool) error {

// We don't actually care about the various network types.
if net == "file" {
fd.isFile = true
}
if !pollable {
fd.isBlocking = true
return nil
}
fd.SetBlocking()
return nil
// return fd.pd.init(fd)
}

异常提示: waiting for unsupported file type

解决办法:

修改golang源码,fd_poll_runtime.go

原->

func (pd *pollDesc) wait(mode int, isFile bool) error {

if pd.runtimeCtx == 0 {
return errors.New("waiting for unsupported file type")
}
res := runtime_pollWait(pd.runtimeCtx, mode)
return convertErr(res, isFile)

}

修改为->

func (pd *pollDesc) wait(mode int, isFile bool) error {

if pd.runtimeCtx == 0 {
// return nil
return errors.New("waiting for unsupported file type")
}
res := runtime_pollWait(pd.runtimeCtx, mode)
return convertErr(res, isFile)
}

你可能感兴趣的:(linux,go)