Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / freebsd / sctp2.c
blob4c4b3299f6642808ae61b711add67385c403f1a4
2 #include <sys/types.h>
3 #include <sys/socket.h>
4 #include <unistd.h>
5 #include <arpa/inet.h>
6 #include <libgen.h>
7 #include <netinet/in.h>
8 #include <netinet/sctp.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
12 #include <stdint.h>
13 #include "../../memcheck.h"
15 int main()
17 int conn_fd;
18 char msg[10];
19 char buffer[10];
20 struct sockaddr to;
21 socklen_t tolen = sizeof (struct sockaddr);
22 uint32_t ppid;
23 uint32_t flags;
24 uint16_t stream_no;
25 uint32_t timetolive;
26 uint32_t context;
27 struct sctp_sndrcvinfo sinfo;
28 int rflags;
29 size_t undef_size = 10U;
31 VALGRIND_MAKE_MEM_UNDEFINED(&undef_size, sizeof(undef_size));
32 VALGRIND_MAKE_MEM_UNDEFINED(&tolen, sizeof(tolen));
34 sctp_sendmsg(conn_fd, msg, undef_size, &to, tolen, ppid, flags, stream_no, timetolive, context);
36 VALGRIND_MAKE_MEM_NOACCESS(&to, sizeof(to));
37 VALGRIND_MAKE_MEM_UNDEFINED(&tolen, sizeof(tolen));
38 VALGRIND_MAKE_MEM_NOACCESS(&sinfo, sizeof(sinfo));
39 VALGRIND_MAKE_MEM_NOACCESS(&rflags, sizeof(rflags));
41 sctp_recvmsg(conn_fd, buffer, undef_size, &to, &tolen, &sinfo, &rflags);