Skip to content

Avoid calls to (*os.File).Fd() when calling ioctl#214

Closed
WeidiDeng wants to merge 13 commits into
creack:masterfrom
WeidiDeng:master
Closed

Avoid calls to (*os.File).Fd() when calling ioctl#214
WeidiDeng wants to merge 13 commits into
creack:masterfrom
WeidiDeng:master

Conversation

@WeidiDeng

Copy link
Copy Markdown
Contributor

In #167 (*os.File).SyscallConn() is used whenever possible, but it caused some operations to fail sometimes and had to be reverted.

The problem is not race condition, but incorrect usage of uintptr. In go, any pointer value should only be converted to uintptr when passed as arguments to syscall.Syscall.

According to test results, even the blocking version may rarely have this kind of problem.

Copilot was used to refactor the function signature and some manual editing to make sure it works.

@WeidiDeng

Copy link
Copy Markdown
Contributor Author

Superseded by #215

@WeidiDeng WeidiDeng closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants