Replies: 2 comments 2 replies
-
Maybe you could manually use and deref int <ref> [ posix_spawnattr_init ] keep int deref or in this case maybe allocate a struct and then keep it posix_spawnattr_t <struct> [ posix_spawnattr_init ] keep or if that doesn't work, make a void pointer and keep it around as a pointer to the thing void <ref> [ posix_spawnattr_init ] keep |
Beta Was this translation helpful? Give feedback.
2 replies
-
I see now this is likely just an issue with my struct layouts being wrong. Attempting to enumerate the members in Factor is a mistake because the actual contents are very unpredictable. Better to leave them opaque |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure if this is my error or a bug, so I'm not making it an issue yet.
If you run the following, Factor will say "Memory protection fault at address 0x0", and then crash on the next gc:
The constructor for
posix_spawnattr_t
also breaks:gives
Regardless of whether you use
pointer:
or not for thec-type
in the array towith-out-parameters
.I am able to use these functions fine from C.
I have unfortunately been away from Factor since March as I got too busy working ): but wanted to move forward on the posix-spawn implementation. My knowledge of the FFI has diminished without exercise but I will learn again :)
I forgot, I already had a branch going for posix-spawn; it has these constructors, but they have a trailing
throw-errno
clause which complicates matters, so I've omitted them here. edit-posix_spawnBeta Was this translation helpful? Give feedback.
All reactions