Last change
on this file since 413 was 398, checked in by coas-nagasima, 5 years ago |
mbedTLS版Azure IoT Hub接続サンプルのソースコードを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
670 bytes
|
Line | |
---|
1 | #include <sys/socket.h>
|
---|
2 | #include <limits.h>
|
---|
3 | #include <string.h>
|
---|
4 | #include <errno.h>
|
---|
5 | #include "syscall.h"
|
---|
6 | #include "libc.h"
|
---|
7 |
|
---|
8 | ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)
|
---|
9 | {
|
---|
10 | #if LONG_MAX > INT_MAX
|
---|
11 | struct msghdr h;
|
---|
12 | struct cmsghdr chbuf[1024/sizeof(struct cmsghdr)+1], *c;
|
---|
13 | if (msg) {
|
---|
14 | h = *msg;
|
---|
15 | h.__pad1 = h.__pad2 = 0;
|
---|
16 | msg = &h;
|
---|
17 | if (h.msg_controllen) {
|
---|
18 | if (h.msg_controllen > 1024) {
|
---|
19 | errno = ENOMEM;
|
---|
20 | return -1;
|
---|
21 | }
|
---|
22 | memcpy(chbuf, h.msg_control, h.msg_controllen);
|
---|
23 | h.msg_control = chbuf;
|
---|
24 | for (c=CMSG_FIRSTHDR(&h); c; c=CMSG_NXTHDR(&h,c))
|
---|
25 | c->__pad1 = 0;
|
---|
26 | }
|
---|
27 | }
|
---|
28 | #endif
|
---|
29 | return socketcall_cp(sendmsg, fd, msg, flags, 0, 0, 0);
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.