getting errno with ffi
I am using ffi to call
execv
and need to get the value of errno
for failures, but can’t see how I can do that.10 Replies
@aapoalas, as the local ffi wizard, do you have any input here?
Seems like errno is defined by a macro so I'm not sure it's exactly readable directly with Deno FFI but if it is then it's something like this:
Hm yeah, seems to be somewhat platform specific. Here's how it'd work for Android:
thanks both!
works (darwin/vanilla linux)
Happy to help! If you have your code up somewhere or put it up later, let me know, I'm interested in seeing all the wonderful and wacky things people come up with using FFI 🙂
Pretty sure this is for tea
curious what this is for specifically though
Like brewing?
GitHub
GitHub - teaxyz/cli: the next-generation, cross‐platform package ma...
the next-generation, cross‐platform package manager - GitHub - teaxyz/cli: the next-generation, cross‐platform package manager
TLDR; package manager written in Deno
https://github.com/teaxyz/cli/pull/621/files
oh wow this is a cursed PR
thanks for the help here both. This use of ffi is now live!
Happy to help as always Max