mirror of https://github.com/mkerrisk/man-pages
sendmmsg.2: Minor fix-ups for Elie De Brauwer's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
daf3eb0c70
commit
821e74fad4
|
@ -23,7 +23,7 @@
|
|||
.\" Formatted or processed versions of this manual, if unaccompanied by
|
||||
.\" the source, must acknowledge the copyright and authors of this work.
|
||||
.\"
|
||||
.TH SENDMMSG 2 2012-02-27 "Linux" "Linux Programmer's Manual"
|
||||
.TH SENDMMSG 2 2012-12-16 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
sendmmsg \- send multiple messages on a socket
|
||||
.SH SYNOPSIS
|
||||
|
@ -170,8 +170,8 @@ to send
|
|||
.I onetwo
|
||||
and
|
||||
.I three
|
||||
in two distinct UDP datagrams using one system call. The contents
|
||||
of the first datagram originates from a pair of buffers.
|
||||
in two distinct UDP datagrams using one system call.
|
||||
The contents of the first datagram originates from a pair of buffers.
|
||||
|
||||
.nf
|
||||
#define _GNU_SOURCE
|
||||
|
@ -200,7 +200,7 @@ main()
|
|||
sa.sin_family = AF_INET;
|
||||
sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
sa.sin_port = htons(1234);
|
||||
if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa))) {
|
||||
if (connect(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == \-1) {
|
||||
perror("connect()");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ main()
|
|||
msg[1].msg_hdr.msg_iovlen = 1;
|
||||
|
||||
retval = sendmmsg(sockfd, msg, 2, 0);
|
||||
if (retval == -1)
|
||||
if (retval == \-1)
|
||||
perror("sendmmsg()");
|
||||
else
|
||||
printf("%d messages sent\\n", retval);
|
||||
|
|
Loading…
Reference in New Issue