mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 02:44:53 +08:00
socket: separation error code EBADF and ENOTSOCK
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
2c95c04f4e
commit
f00c11aec4
@@ -527,14 +527,18 @@ int sockfd_allocate(FAR struct socket *psock, int oflags);
|
||||
* Input Parameters:
|
||||
* sockfd - The socket descriptor index to use.
|
||||
*
|
||||
* Returned Value:
|
||||
* On success, a reference to the socket structure associated with the
|
||||
* the socket descriptor is returned. NULL is returned on any failure.
|
||||
* Returns zero (OK) on success. On failure, it returns a negated errno
|
||||
* value to indicate the nature of the error.
|
||||
*
|
||||
* EBADF
|
||||
* The file descriptor is not a valid index in the descriptor table.
|
||||
* ENOTSOCK
|
||||
* psock is a descriptor for a file, not a socket.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct socket *file_socket(FAR struct file *filep);
|
||||
FAR struct socket *sockfd_socket(int sockfd);
|
||||
int sockfd_socket(int sockfd, FAR struct socket **socketp);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: psock_socket
|
||||
|
||||
Reference in New Issue
Block a user