summaryrefslogtreecommitdiff
path: root/components/net/sal_socket/include/sal.h
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-08-28 08:44:57 +0800
committerGitHub <[email protected]>2018-08-28 08:44:57 +0800
commit9028cb29f736ce214fea4c18e8e3d4aeef76eb5f (patch)
tree5136c29fb8ab6d35820bd1110d17493a0cd01614 /components/net/sal_socket/include/sal.h
parent9fdd46fa8be1c453455cb68e2563d426607e841f (diff)
parent6d702e579f533179e5b158a5daae6a6e78ca2d70 (diff)
Merge pull request #1743 from chenyong111/master
Remove DFS dependencies in the SAL
Diffstat (limited to 'components/net/sal_socket/include/sal.h')
-rw-r--r--components/net/sal_socket/include/sal.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h
index 62ffaa303e..480167c91d 100644
--- a/components/net/sal_socket/include/sal.h
+++ b/components/net/sal_socket/include/sal.h
@@ -25,9 +25,12 @@
#ifndef SAL_H__
#define SAL_H__
-#include <dfs_file.h>
#include <rtdevice.h>
+#ifdef SAL_USING_POSIX
+#include <dfs_file.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -40,7 +43,9 @@ typedef uint32_t socklen_t;
#define SAL_SOCKET_MAGIC 0x5A10
/* The maximum number of sockets structure */
+#ifndef SAL_SOCKETS_NUM
#define SAL_SOCKETS_NUM DFS_FD_MAX
+#endif
/* The maximum number of protocol families */
#ifndef SAL_PROTO_FAMILIES_NUM
@@ -68,7 +73,9 @@ struct proto_ops
int (*getpeername)(int s, struct sockaddr *name, socklen_t *namelen);
int (*getsockname)(int s, struct sockaddr *name, socklen_t *namelen);
int (*ioctlsocket)(int s, long cmd, void *arg);
+#ifdef SAL_USING_POSIX
int (*poll) (struct dfs_fd *file, struct rt_pollreq *req);
+#endif
};
struct sal_socket