This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19 #include <sys/socket.h>
20
21 #include "signature.h"
22 SIGNATURE_CHECK (recvfrom, ssize_t,
23 (int, void *, size_t, int,
24 struct sockaddr *, socklen_t *));
25
26 #include <errno.h>
27 #include <netinet/in.h>
28 #include <unistd.h>
29
30 #include "sockets.h"
31 #include "macros.h"
32
33 int
34 main (void)
35 {
36 (void) gl_sockets_startup (SOCKETS_1_1);
37
38
39 {
40 char byte;
41 struct sockaddr_in addr;
42 socklen_t addrlen = sizeof (addr);
43
44 errno = 0;
45 ASSERT (recvfrom (-1, &byte, 1, 0, (struct sockaddr *) &addr, &addrlen)
46 == -1);
47 ASSERT (errno == EBADF);
48 }
49 {
50 char byte;
51 struct sockaddr_in addr;
52 socklen_t addrlen = sizeof (addr);
53
54 close (99);
55 errno = 0;
56 ASSERT (recvfrom (99, &byte, 1, 0, (struct sockaddr *) &addr, &addrlen)
57 == -1);
58 ASSERT (errno == EBADF);
59 }
60
61 return 0;
62 }