Skip to content

Provide access to errno #244

Description

@dominikh

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • Android
  • iOS

What feature would you like to be added?

In cgo, C function calls can optionally return an additional value, the value of errno after returning from the function (in the form of an error). Purego should provide something similar.

Why is this needed?

Being able to read errno is important to get useful error information. errno is thread-local, which means we cannot read it ourselves without locking the goroutine to its thread. Furthermore, errno is allowed to be a macro, so there is no straightforward, non-cgo way of reading it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions