You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/02/24 03:58:46 UTC

[GitHub] [incubator-nuttx] Donny9 commented on a change in pull request #2899: Unify socket into file system to avoid the code duplication

Donny9 commented on a change in pull request #2899:
URL: https://github.com/apache/incubator-nuttx/pull/2899#discussion_r581602707



##########
File path: include/nuttx/net/net.h
##########
@@ -1333,87 +1240,27 @@ struct pollfd; /* Forward reference -- see poll.h */
 int psock_poll(FAR struct socket *psock, struct pollfd *fds, bool setup);
 
 /****************************************************************************
- * Name: net_poll
- *
- * Description:
- *   The standard poll() operation redirects operations on socket descriptors
- *   to this function.
- *
- * Input Parameters:
- *   fd    - The socket descriptor of interest
- *   fds   - The structure describing the events to be monitored, OR NULL if
- *           this is a request to stop monitoring events.
- *   setup - true: Setup up the poll; false: Teardown the poll
- *
- * Returned Value:
- *  0: Success; Negated errno on failure
- *
- ****************************************************************************/
-
-struct pollfd; /* Forward reference -- see poll.h */
-
-int net_poll(int sockfd, struct pollfd *fds, bool setup);
-
-/****************************************************************************
- * Name: psock_dup
- *
- * Description:
- *   Clone a socket descriptor to an arbitrary descriptor number.
- *
- * Returned Value:
- *   On success, returns the number of new socket.  On any error,
- *   a negated errno value is returned.
- *
- ****************************************************************************/
-
-int psock_dup(FAR struct socket *psock, int minsd);
-
-/****************************************************************************
- * Name: net_dup
+ * Name: psock_dup2
  *
  * Description:
- *   Clone a socket descriptor to an arbitrary descriptor number.
+ *   Clone a socket instance to an new instance.

Review comment:
       Ok, thanks~

##########
File path: include/nuttx/net/net.h
##########
@@ -1333,87 +1240,27 @@ struct pollfd; /* Forward reference -- see poll.h */
 int psock_poll(FAR struct socket *psock, struct pollfd *fds, bool setup);
 
 /****************************************************************************
- * Name: net_poll
- *
- * Description:
- *   The standard poll() operation redirects operations on socket descriptors
- *   to this function.
- *
- * Input Parameters:
- *   fd    - The socket descriptor of interest
- *   fds   - The structure describing the events to be monitored, OR NULL if
- *           this is a request to stop monitoring events.
- *   setup - true: Setup up the poll; false: Teardown the poll
- *
- * Returned Value:
- *  0: Success; Negated errno on failure
- *
- ****************************************************************************/
-
-struct pollfd; /* Forward reference -- see poll.h */
-
-int net_poll(int sockfd, struct pollfd *fds, bool setup);
-
-/****************************************************************************
- * Name: psock_dup
- *
- * Description:
- *   Clone a socket descriptor to an arbitrary descriptor number.
- *
- * Returned Value:
- *   On success, returns the number of new socket.  On any error,
- *   a negated errno value is returned.
- *
- ****************************************************************************/
-
-int psock_dup(FAR struct socket *psock, int minsd);
-
-/****************************************************************************
- * Name: net_dup
+ * Name: psock_dup2
  *
  * Description:
- *   Clone a socket descriptor to an arbitrary descriptor number.
+ *   Clone a socket instance to an new instance.
  *
  * Returned Value:
  *   On success, returns the number of new socket.  On any error,
  *   a negated errno value is returned.
  *
  ****************************************************************************/
 
-int net_dup(int sockfd, int minsd);
-
-/****************************************************************************
- * Name: psock_dup2
- *
- * Description:
- *   Performs the low level, common portion of net_dup() and net_dup2()
- *
- ****************************************************************************/
-
 int psock_dup2(FAR struct socket *psock1, FAR struct socket *psock2);
 
 /****************************************************************************
- * Name: net_dup2
- *
- * Description:
- *   Clone a socket descriptor to an arbitrary descriptor number.
- *
- * Returned Value:
- *   Zero (OK) is returned on success; a negated errno value is returned on
- *   any failure.
- *
- ****************************************************************************/
-
-int net_dup2(int sockfd1, int sockfd2);
-
-/****************************************************************************
- * Name: net_fstat
+ * Name: psock_fstat
  *
  * Description:
  *   Performs fstat operations on socket
  *
  * Input Parameters:
- *   sockfd - Socket descriptor of the socket to operate on
+ *   psock  - An instance of the internal socket structure.
  *   buf    - Caller-provided location in which to return the fstat data

Review comment:
       Ok, thanks




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org