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

time_t and suseconds_t types are wrong for freebsd #544

Closed
dcws opened this issue Jan 2, 2017 · 2 comments
Closed

time_t and suseconds_t types are wrong for freebsd #544

dcws opened this issue Jan 2, 2017 · 2 comments

Comments

@dcws
Copy link

dcws commented Jan 2, 2017

There is a longstanding bug with the ethons library such that select() intermittently returns 22 on select on FreeBSD, I have just tracked this down to the type definition in ffi being incorrect for (at least) time_t and suseconds_t in ffi you have them as ints.. However a printf of sizeof(...) on FreeBSD 11-amd64 indicates they are 8 bytes long (and therefore int64).. I updated the specification to long in the files and was just able to solve the errno22 issue.

I am not sure at what point FreeBSD cut over to 64 bits for those structures (it was a LONG time ago though), how you would version differences in ABI formats within a platform, what is the correct value (long vs int64), what the difference is for the 2 time_t and suseconds_t types, or what other values there are incorrect; but I hope this could be quickly updated.

@t-zuehlsdorff
Copy link

Just to prevent confusion:
I just committed a patch to the FreeBSD ports-tree which will change the types until the bug is fixed in an release. :)

@dcws
Copy link
Author

dcws commented Jan 21, 2019

This was fixed in
#627 thank you!

@dcws dcws closed this as completed Jan 21, 2019
adam12 added a commit to adam12/ffi that referenced this issue Oct 9, 2019
The types for time_t and suseconds_t should be long and not int.

Complementary of 4ba53c5

Related to ffi#544 and ffi#627
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

No branches or pull requests

2 participants