mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
net/socket: Fix nxstyle issue
This commit is contained in:
parent
5ee0432d6f
commit
76c87d2f85
5 changed files with 31 additions and 25 deletions
|
@ -60,10 +60,10 @@
|
|||
* Name: psock_getpeername
|
||||
*
|
||||
* Description:
|
||||
* The psock_getpeername() function retrieves the remote-connected name of the
|
||||
* specified socket, stores this address in the sockaddr structure pointed
|
||||
* to by the 'addr' argument, and stores the length of this address in the
|
||||
* object pointed to by the 'addrlen' argument.
|
||||
* The psock_getpeername() function retrieves the remote-connected name of
|
||||
* the specified socket, stores this address in the sockaddr structure
|
||||
* pointed to by the 'addr' argument, and stores the length of this address
|
||||
* in the object pointed to by the 'addrlen' argument.
|
||||
*
|
||||
* If the actual length of the address is greater than the length of the
|
||||
* supplied sockaddr structure, the stored address will be truncated.
|
||||
|
@ -79,8 +79,8 @@
|
|||
* Returned Value:
|
||||
* On success, 0 is returned, the 'addr' argument points to the address
|
||||
* of the socket, and the 'addrlen' argument points to the length of the
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
||||
* Possible errno values that may be returned include:
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||
* error. Possible errno values that may be returned include:
|
||||
*
|
||||
* EBADF - The socket argument is not a valid file descriptor.
|
||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||
|
@ -145,8 +145,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
* Returned Value:
|
||||
* On success, 0 is returned, the 'addr' argument points to the address
|
||||
* of the socket, and the 'addrlen' argument points to the length of the
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
||||
* Possible errno values that may be returned include:
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||
* error. Possible errno values that may be returned include:
|
||||
*
|
||||
* EBADF - The socket argument is not a valid file descriptor.
|
||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||
|
@ -157,7 +157,8 @@ int psock_getpeername(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int getpeername(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
||||
int getpeername(int sockfd, FAR struct sockaddr *addr,
|
||||
FAR socklen_t *addrlen)
|
||||
{
|
||||
FAR struct socket *psock = sockfd_socket(sockfd);
|
||||
int ret;
|
||||
|
|
|
@ -79,8 +79,8 @@
|
|||
* Returned Value:
|
||||
* On success, 0 is returned, the 'addr' argument points to the address
|
||||
* of the socket, and the 'addrlen' argument points to the length of the
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
||||
* Possible errno values that may be returned include:
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||
* error. Possible errno values that may be returned include:
|
||||
*
|
||||
* EBADF - The socket argument is not a valid file descriptor.
|
||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||
|
@ -139,8 +139,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
* Returned Value:
|
||||
* On success, 0 is returned, the 'addr' argument points to the address
|
||||
* of the socket, and the 'addrlen' argument points to the length of the
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the error.
|
||||
* Possible errno values that may be returned include:
|
||||
* address. Otherwise, -1 is returned and errno is set to indicate the
|
||||
* error. Possible errno values that may be returned include:
|
||||
*
|
||||
* EBADF - The socket argument is not a valid file descriptor.
|
||||
* ENOTSOCK - The socket argument does not refer to a socket.
|
||||
|
@ -151,7 +151,8 @@ int psock_getsockname(FAR struct socket *psock, FAR struct sockaddr *addr,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int getsockname(int sockfd, FAR struct sockaddr *addr, FAR socklen_t *addrlen)
|
||||
int getsockname(int sockfd, FAR struct sockaddr *addr,
|
||||
FAR socklen_t *addrlen)
|
||||
{
|
||||
FAR struct socket *psock = sockfd_socket(sockfd);
|
||||
int ret;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/socket/recvfrom.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2017, 2019 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -185,19 +186,20 @@ ssize_t nx_recvfrom(int sockfd, FAR void *buf, size_t len, int flags,
|
|||
* -1 is returned, and errno is set appropriately:
|
||||
*
|
||||
* EAGAIN
|
||||
* The socket is marked non-blocking and the receive operation would block,
|
||||
* or a receive timeout had been set and the timeout expired before data
|
||||
* was received.
|
||||
* The socket is marked non-blocking and the receive operation would
|
||||
* block, or a receive timeout had been set and the timeout expired
|
||||
* before data was received.
|
||||
* EBADF
|
||||
* The argument sockfd is an invalid descriptor.
|
||||
* ECONNREFUSED
|
||||
* A remote host refused to allow the network connection (typically because
|
||||
* it is not running the requested service).
|
||||
* A remote host refused to allow the network connection (typically
|
||||
* because it is not running the requested service).
|
||||
* EFAULT
|
||||
* The receive buffer pointer(s) point outside the process's address space.
|
||||
* The receive buffer pointer(s) point outside the process's address
|
||||
* space.
|
||||
* EINTR
|
||||
* The receive was interrupted by delivery of a signal before any data were
|
||||
* available.
|
||||
* The receive was interrupted by delivery of a signal before any data
|
||||
* were available.
|
||||
* EINVAL
|
||||
* Invalid argument passed.
|
||||
* ENOMEM
|
||||
|
|
|
@ -110,7 +110,8 @@ ssize_t psock_send(FAR struct socket *psock, FAR const void *buf, size_t len,
|
|||
ret = psock->s_sockif->si_send(psock, buf, len, flags);
|
||||
if (ret < 0)
|
||||
{
|
||||
nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n", ret);
|
||||
nerr("ERROR: socket si_send() (or usrsock_sendto()) failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/socket/sendto.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2011-2015, 2017 Gregory Nutt. All rights
|
||||
* reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
Loading…
Reference in a new issue