Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: net.newUnixFile #4517

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/os/file_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package os
import (
"io"
"syscall"
_ "unsafe"
)

const DevNull = "/dev/null"
Expand Down Expand Up @@ -223,3 +224,17 @@ func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
ude.info = info
return ude, nil
}

// Since internal/poll is not available, we need to stub this out.
// Big go requires the option to add the fd to the polling system.
//
//go:linkname net_newUnixFile net.newUnixFile
func net_newUnixFile(fd int, name string) *File {
deadprogram marked this conversation as resolved.
Show resolved Hide resolved
if fd < 0 {
panic("invalid FD")
}

// see src/os/file_unix.go:162 newFile for the original implementation.
// return newFile(fd, name, kindSock, true)
return NewFile(uintptr(fd), name)
}
Loading