xref: /freebsd/lib/libc/sys/send.c (revision 7dd9070e4425a1c2e2418694fd632425a283d558)
1d7847a8dSBrooks Davis /*-
2d7847a8dSBrooks Davis  * SPDX-License-Identifier: BSD-3-Clause
3d7847a8dSBrooks Davis  *
4d7847a8dSBrooks Davis  * Copyright (c) 1988, 1993
5d7847a8dSBrooks Davis  *	The Regents of the University of California.  All rights reserved.
6d7847a8dSBrooks Davis  *
7d7847a8dSBrooks Davis  * Redistribution and use in source and binary forms, with or without
8d7847a8dSBrooks Davis  * modification, are permitted provided that the following conditions
9d7847a8dSBrooks Davis  * are met:
10d7847a8dSBrooks Davis  * 1. Redistributions of source code must retain the above copyright
11d7847a8dSBrooks Davis  *    notice, this list of conditions and the following disclaimer.
12d7847a8dSBrooks Davis  * 2. Redistributions in binary form must reproduce the above copyright
13d7847a8dSBrooks Davis  *    notice, this list of conditions and the following disclaimer in the
14d7847a8dSBrooks Davis  *    documentation and/or other materials provided with the distribution.
15d7847a8dSBrooks Davis  * 3. Neither the name of the University nor the names of its contributors
16d7847a8dSBrooks Davis  *    may be used to endorse or promote products derived from this software
17d7847a8dSBrooks Davis  *    without specific prior written permission.
18d7847a8dSBrooks Davis  *
19d7847a8dSBrooks Davis  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20d7847a8dSBrooks Davis  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21d7847a8dSBrooks Davis  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22d7847a8dSBrooks Davis  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23d7847a8dSBrooks Davis  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24d7847a8dSBrooks Davis  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25d7847a8dSBrooks Davis  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26d7847a8dSBrooks Davis  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27d7847a8dSBrooks Davis  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28d7847a8dSBrooks Davis  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29d7847a8dSBrooks Davis  * SUCH DAMAGE.
30d7847a8dSBrooks Davis  */
31d7847a8dSBrooks Davis 
32d7847a8dSBrooks Davis #include <sys/types.h>
33d7847a8dSBrooks Davis #include <sys/socket.h>
34d7847a8dSBrooks Davis #include "libc_private.h"
35d7847a8dSBrooks Davis 
36d7847a8dSBrooks Davis #include <stddef.h>
37d7847a8dSBrooks Davis 
38d7847a8dSBrooks Davis ssize_t
39d7847a8dSBrooks Davis send(int s, const void *msg, size_t len, int flags)
40d7847a8dSBrooks Davis {
41d7847a8dSBrooks Davis 	/*
42d7847a8dSBrooks Davis 	 * POSIX says send() shall be a cancellation point, so call the
43d7847a8dSBrooks Davis 	 * cancellation-enabled sendto() and not _sendto().
44d7847a8dSBrooks Davis 	 */
45*7dd9070eSBrooks Davis 	return (INTERPOS_SYS(sendto, s, msg, len, flags, NULL, 0));
46d7847a8dSBrooks Davis }
47