diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-15 19:50:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-15 19:50:06 +0000 |
commit | 8e8a4c5677c081b145768538d9944d817e3985c8 (patch) | |
tree | 2b6a33844e017512f530187deac45579988f248f /nuttx/include | |
parent | f2675bf333e0378c842717a94a13c73dabb76a52 (diff) | |
download | px4-nuttx-8e8a4c5677c081b145768538d9944d817e3985c8.tar.gz px4-nuttx-8e8a4c5677c081b145768538d9944d817e3985c8.tar.bz2 px4-nuttx-8e8a4c5677c081b145768538d9944d817e3985c8.zip |
Add logic to clone socket descriptors when a new task is started.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1885 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/net.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/nuttx/include/nuttx/net.h b/nuttx/include/nuttx/net.h index 9b83971df..55ff9885e 100644 --- a/nuttx/include/nuttx/net.h +++ b/nuttx/include/nuttx/net.h @@ -164,12 +164,31 @@ EXTERN int net_poll(int sockfd, struct pollfd *fds, boolean setup); #endif /* net_dup.c *****************************************************************/ -/* The standard dup() and dup2() operations redirect operations on socket - * descriptors to these function. +/* The standard dup() operation redirects operations on socket descriptors to + * this function (when both file and socket descriptors are supported) */ +#if CONFIG_NFILE_DESCRIPTOR > 0 EXTERN int net_dup(int sockfd); +#else +# define net_dup(sockfd) dup(sockfd) +#endif + +/* net_dup2.c ****************************************************************/ +/* The standard dup2() operation redirects operations on socket descriptors to + * this function (when both file and socket descriptors are supported) + */ + +#if CONFIG_NFILE_DESCRIPTOR > 0 EXTERN int net_dup2(int sockfd1, int sockfd2); +#else +# define net_dup2(sockfd1, sockfd2) dup2(sockfd1, sockfd2) +#endif + +/* net_clone.c ***************************************************************/ +/* Performs the low level, common portion of net_dup() and net_dup2() */ + +EXTERN int net_clone(FAR struct socket *psock1, FAR struct socket *psock2); /* netdev-register.c *********************************************************/ /* This function is called by network interface device drivers to inform the |