mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-03-01 13:45:25 +08:00
[libc] 增加sys/select.h到partical/ls1
This commit is contained in:
parent
a3dfdadb78
commit
5c058b624f
@ -8,11 +8,16 @@ cwd = GetCurrentDir()
|
|||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
group = []
|
group = []
|
||||||
|
|
||||||
# There is no 'sys/select.h' in these bsp's gcc toolchain; thus, we need to copy this file from 'nogcc/sys/select.h'
|
if rtconfig.PLATFORM == 'gcc':
|
||||||
if GetDepend('SOC_LS1B') or GetDepend('SOC_LS1C300'):
|
if GetDepend('SOC_LS1B') or GetDepend('SOC_LS1C300'):
|
||||||
copy("../../nogcc/sys/select.h", "sys/select.h")
|
try:
|
||||||
if GetDepend('RT_USING_LIBC'):
|
# There is no 'sys/select.h' in these bsp's gcc toolchain; thus, we need to copy this file from 'nogcc/sys/select.h'
|
||||||
src += Glob('*.c')
|
copy("../../nogcc/sys/select.h", "./sys/select.h")
|
||||||
group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH)
|
except:
|
||||||
|
pass
|
||||||
|
if GetDepend('RT_USING_LIBC'):
|
||||||
|
src += Glob('*.c')
|
||||||
|
|
||||||
|
group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
@ -2,3 +2,7 @@ This folder will be included when compiling the BSPs as follow:
|
|||||||
|
|
||||||
- ls1bdev
|
- ls1bdev
|
||||||
- ls1cdev
|
- ls1cdev
|
||||||
|
|
||||||
|
These files will be generated by scons automatically , and **DO NOT** change them:
|
||||||
|
|
||||||
|
- sys/select.h
|
52
components/libc/compilers/common/partial/ls1/sys/select.h
Normal file
52
components/libc/compilers/common/partial/ls1/sys/select.h
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
* 2021-07-21 Meco Man The first version
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __SYS_SELECT_H__
|
||||||
|
#define __SYS_SELECT_H__
|
||||||
|
|
||||||
|
#include <rtconfig.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#ifndef FD_SETSIZE
|
||||||
|
#define FD_SETSIZE 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SAL_USING_POSIX
|
||||||
|
#ifdef FD_SETSIZE
|
||||||
|
#undef FD_SETSIZE
|
||||||
|
#endif
|
||||||
|
#define FD_SETSIZE DFS_FD_MAX
|
||||||
|
#endif /* SAL_USING_POSIX */
|
||||||
|
|
||||||
|
#define NBBY 8 /* number of bits in a byte */
|
||||||
|
|
||||||
|
typedef long fd_mask;
|
||||||
|
|
||||||
|
#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
|
||||||
|
#ifndef howmany
|
||||||
|
#define howmany(x,y) (((x)+((y)-1))/(y))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _SYS_TYPES_FD_SET /* MIPS */
|
||||||
|
typedef struct _types_fd_set {
|
||||||
|
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
|
||||||
|
} _types_fd_set;
|
||||||
|
#define fd_set _types_fd_set
|
||||||
|
|
||||||
|
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
|
||||||
|
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
|
||||||
|
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
|
||||||
|
#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
|
||||||
|
#endif /* _SYS_TYPES_FD_SET */
|
||||||
|
|
||||||
|
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
|
||||||
|
|
||||||
|
#endif /* __SYS_SELECT_H__ */
|
Loading…
x
Reference in New Issue
Block a user