aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common/socket_tarray.h
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-30 18:22:46 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commit165666d8b8b1b21ffaf43ac436cfc1657ba83649 (patch)
tree82a21a93a7dadaa7eab78ccd1a82d6916d0edc11 /erts/emulator/nifs/common/socket_tarray.h
parent6b01561dc13a0152f56da0a2c61ad88236f87de7 (diff)
downloadotp-165666d8b8b1b21ffaf43ac436cfc1657ba83649.tar.gz
otp-165666d8b8b1b21ffaf43ac436cfc1657ba83649.tar.bz2
otp-165666d8b8b1b21ffaf43ac436cfc1657ba83649.zip
[socket-nif] Add support for recvmsg
Added preliminary support for function recvmsg. At the moment this only works on *nix (Windows has another function, WSARecvMsg, which has a slightly different API). Also we have "no" cmsg decode at the moment (just level and type). OTP-14831
Diffstat (limited to 'erts/emulator/nifs/common/socket_tarray.h')
-rw-r--r--erts/emulator/nifs/common/socket_tarray.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/erts/emulator/nifs/common/socket_tarray.h b/erts/emulator/nifs/common/socket_tarray.h
new file mode 100644
index 0000000000..2e9506d288
--- /dev/null
+++ b/erts/emulator/nifs/common/socket_tarray.h
@@ -0,0 +1,47 @@
+/*
+ * %CopyrightBegin%
+ *
+ * Copyright Ericsson AB 2018-2018. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * %CopyrightEnd%
+ *
+ * ----------------------------------------------------------------------
+ * Purpose : Build and "maintain" a (erlang) term array of
+ * variable length.
+ * ----------------------------------------------------------------------
+ *
+ */
+
+#ifndef SOCKET_TARRAY_H__
+#define SOCKET_TARRAY_H__
+
+typedef void* SocketTArray;
+
+extern SocketTArray esock_tarray_create(uint32_t sz);
+extern void esock_tarray_delete(SocketTArray ta);
+extern uint32_t esock_tarray_sz(SocketTArray ta);
+extern void esock_tarray_add(SocketTArray ta, ERL_NIF_TERM t);
+extern void esock_tarray_tolist(SocketTArray ta,
+ ErlNifEnv* env,
+ ERL_NIF_TERM* list);
+
+#define TARRAY_CREATE(SZ) esock_tarray_create((SZ))
+#define TARRAY_DELETE(TA) esock_tarray_delete((TA))
+#define TARRAY_SZ(TA) esock_tarray_sz((TA))
+#define TARRAY_ADD(TA, T) esock_tarray_add((TA), (T))
+#define TARRAY_TOLIST(TA, E, L) esock_tarray_tolist((TA), (E), (L))
+
+
+#endif // SOCKET_TARRAY_H__