Skip to content

Commit c2de390

Browse files
authored
Add FAQ about EINVAL for in/out vars
1 parent 59d3f61 commit c2de390

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/FAQ.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,13 @@ Before sending a pull request, please file an issue ([see the previous section](
5252
with the details of what you have changed or are going to change. This way, your time is not wasted if the change does
5353
not meet our goals, and we can discuss the changes in depth within the issue.
5454

55+
## Why am I getting EINVAL for a pointer passed to native (e.g. getsockopt's len pointer)
56+
57+
Length pointers passed to native functions are often read and also written back by the function to indicate how much
58+
data was actually returned. If you specify only @In OR @Out the native memory allocated for the pointer may not be
59+
set up correctly for two-way synchronization. Remove the annotation or specify both (which is the default when neither
60+
are specified.
61+
62+
5563
If you are adding new functionality, ensure that you add unit tests that will test the behavior of your new code and, if
56-
it is a public API, add descriptive javadoc comments for the new code.
64+
it is a public API, add descriptive javadoc comments for the new code.

0 commit comments

Comments
 (0)