41#if defined(__linux__) || defined(__APPLE__) || defined(__unix__)
44 #define BSL_SAL_ONCE_INIT PTHREAD_ONCE_INIT
50 #define BSL_SAL_ONCE_INIT {0}
53#define BSL_TIME_CMP_ERROR 0
54#define BSL_TIME_CMP_EQUAL 1
55#define BSL_TIME_DATE_BEFORE 2
56#define BSL_TIME_DATE_AFTER 3
285#define BSL_SAL_FREE(value_) \
287 BSL_SAL_Free((void *)(value_)); \
303#define BSL_SAL_DECLARE_THREAD_ONCE(name) static BSL_SAL_OnceControl name = BSL_SAL_ONCE_INIT
496typedef void *bsl_sal_file_handle;
545int32_t
BSL_SAL_FileRead(bsl_sal_file_handle stream,
void *buffer,
size_t size,
size_t num,
size_t *len);
562int32_t
BSL_SAL_FileWrite(bsl_sal_file_handle stream,
const void *buffer,
size_t size,
size_t num);
764typedef void *BSL_SAL_SockAddr;
783#define SAL_NET_SEEK_SET 0
784#define SAL_NET_SEEK_CUR 1
785#define SAL_NET_SEEK_END 2
787#define SAL_NET_IPV4 2
788#define SAL_NET_IPV6 10
789#define SAL_NET_IPUNIX 1
790#define SAL_NET_IPANY 0
792#define SAL_NET_SOCK_STREAM 1
793#define SAL_NET_SOCK_DGRAM 2
794#define SAL_NET_SOCK_ALL 0
796#define SAL_NET_IPPROTO_IP 0
797#define SAL_NET_IPPROTO_IPV6 41
798#define SAL_NET_IPPROTO_TCP 6
799#define SAL_NET_IPPROTO_UDP 17
800#define SAL_NET_IPPROTO_SCTP 132
801#define SAL_NET_IPPROTO_UNSPEC 0
802#define SAL_NET_SOL_SOCKET 1
804#define SAL_NET_SO_REUSEADDR 2
805#define SAL_NET_SO_KEEPALIVE 9
806#define SAL_NET_SO_ERROR 4
807#define SAL_NET_TCP_NODELAY 1
808#define SAL_NET_IPV6_V6ONLY 26
809#define SAL_NET_IP_MTU 14
810#define SAL_NET_IPV6_MTU 24
888int32_t
BSL_SAL_SetSockopt(int32_t sockId, int32_t level, int32_t name,
const void *val, int32_t len);
890#define SAL_PROTO_IP_LEVEL 0
891#define SAL_PROTO_IPV6_LEVEL 41
892#define SAL_MTU_OPTION 14
893#define SAL_IPV6_MTU_OPTION 24
993 BSL_SAL_MEM_MALLOC = 0x0100,
996 BSL_SAL_THREAD_LOCK_NEW_CB_FUNC = 0x0200,
997 BSL_SAL_THREAD_LOCK_FREE_CB_FUNC,
998 BSL_SAL_THREAD_LOCK_READ_LOCK_CB_FUNC,
999 BSL_SAL_THREAD_LOCK_WRITE_LOCK_CB_FUNC,
1000 BSL_SAL_THREAD_LOCK_UNLOCK_CB_FUNC,
1001 BSL_SAL_THREAD_GET_ID_CB_FUNC,
1002 BSL_SAL_THREAD_RUN_ONCE_CB_FUNC,
1003 BSL_SAL_THREAD_CREATE_CB_FUNC,
1004 BSL_SAL_THREAD_CLOSE_CB_FUNC,
1005 BSL_SAL_THREAD_CONDVAR_CREATE_LOCK_CB_FUNC,
1006 BSL_SAL_THREAD_CONDVAR_SIGNAL_CB_FUNC,
1007 BSL_SAL_THREAD_CONDVAR_WAIT_CB_FUNC,
1008 BSL_SAL_THREAD_CONDVAR_DELETE_CB_FUNC,
1010 BSL_SAL_NET_WRITE_CB_FUNC = 0x0300,
1011 BSL_SAL_NET_READ_CB_FUNC,
1012 BSL_SAL_NET_SOCK_CB_FUNC,
1013 BSL_SAL_NET_SOCK_CLOSE_CB_FUNC,
1014 BSL_SAL_NET_SET_SOCK_OPT_CB_FUNC,
1015 BSL_SAL_NET_GET_SOCK_OPT_CB_FUNC,
1016 BSL_SAL_NET_SOCK_LISTEN_CB_FUNC,
1017 BSL_SAL_NET_SOCK_BIND_CB_FUNC,
1018 BSL_SAL_NET_SOCK_CONNECT_CB_FUNC,
1019 BSL_SAL_NET_SOCK_SEND_CB_FUNC,
1020 BSL_SAL_NET_SOCK_RECV_CB_FUNC,
1021 BSL_SAL_NET_SELECT_CB_FUNC,
1022 BSL_SAL_NET_IOCTL_CB_FUNC,
1023 BSL_SAL_NET_GET_ERRNO_CB_FUNC,
1024 BSL_SAL_NET_SOCKADDR_NEW_CB_FUNC,
1025 BSL_SAL_NET_SOCKADDR_FREE_CB_FUNC,
1026 BSL_SAL_NET_SOCKADDR_SIZE_CB_FUNC,
1027 BSL_SAL_NET_SOCKADDR_COPY_CB_FUNC,
1028 BSL_SAL_NET_SENDTO_CB_FUNC,
1029 BSL_SAL_NET_RECVFROM_CB_FUNC,
1030 BSL_SAL_NET_GETFAMILY_CB_FUNC,
1032 BSL_SAL_TIME_GET_UTC_TIME_CB_FUNC = 0X0400,
1033 BSL_SAL_TIME_GET_BSL_TIME_CB_FUNC,
1034 BSL_SAL_TIME_UTC_TO_BSL_TIME_CB_FUNC,
1035 BSL_SAL_TIME_SLEEP_CB_FUNC,
1036 BSL_SAL_TIME_TICK_CB_FUNC,
1037 BSL_SAL_TIME_TICK_PER_SEC_CB_FUNC,
1038 BSL_SAL_TIME_GET_TIME_IN_NS,
1040 BSL_SAL_FILE_OPEN_CB_FUNC = 0X0500,
1041 BSL_SAL_FILE_READ_CB_FUNC,
1042 BSL_SAL_FILE_WRITE_CB_FUNC,
1043 BSL_SAL_FILE_CLOSE_CB_FUNC,
1044 BSL_SAL_FILE_LENGTH_CB_FUNC,
1045 BSL_SAL_FILE_ERROR_CB_FUNC,
1046 BSL_SAL_FILE_TELL_CB_FUNC,
1047 BSL_SAL_FILE_SEEK_CB_FUNC,
1048 BSL_SAL_FILE_GETS_CB_FUNC,
1049 BSL_SAL_FILE_PUTS_CB_FUNC,
1050 BSL_SAL_FILE_FLUSH_CB_FUNC,
1051 BSL_SAL_FILE_EOF_CB_FUNC,
1052 BSL_SAL_FILE_SET_ATTR_FUNC,
1053 BSL_SAL_FILE_GET_ATTR_FUNC,
1055 BSL_SAL_DL_OPEN_CB_FUNC = 0x0700,
1056 BSL_SAL_DL_CLOSE_CB_FUNC,
1057 BSL_SAL_DL_SYM_CB_FUNC,
1059 BSL_SAL_PID_GET_ID_CB_FUNC = 0x0800,
1061 BSL_SAL_MAX_FUNC_CB = 0xffff
1062} BSL_SAL_CB_FUNC_TYPE;
1086typedef int32_t (*
BslSalNetWrite)(int32_t fd,
const void *buf, uint32_t len, int32_t *err);
1104typedef int32_t (*
BslSalNetRead)(int32_t fd,
void *buf, uint32_t len, int32_t *err);
1165typedef int32_t (*
BslSalSocket)(int32_t af, int32_t type, int32_t protocol);
1197typedef int32_t (*
BslSalSetSockopt)(int32_t sockId, int32_t level, int32_t name,
const void *val, int32_t len);
1215typedef int32_t (*
BslSalGetSockopt)(int32_t sockId, int32_t level, int32_t name,
void *val, int32_t *len);
1313typedef int32_t (*
BslSalSockSend)(int32_t sockId,
const void *msg,
size_t len, int32_t flags);
1331typedef int32_t (*
BslSalSockRecv)(int32_t sockfd,
void *buff,
size_t len, int32_t flags);
1351typedef int32_t (*
BslSalNetSendTo)(int32_t sock,
const void *buf,
size_t len, int32_t flags,
void *address,
1352 int32_t addrLen, int32_t *err);
1372typedef int32_t (*
BslSalNetRecvFrom)(int32_t sock,
void *buf,
size_t len, int32_t flags,
void *address,
1373 int32_t *addrLen, int32_t *err);
1391typedef int32_t (*
BslSelect)(int32_t nfds,
void *readfds,
void *writefds,
void *exceptfds,
void *timeout);
1580typedef int32_t (*
BslSalFileOpen)(bsl_sal_file_handle *stream,
const char *path,
const char *mode);
1599typedef int32_t (*
BslSalFileRead)(bsl_sal_file_handle stream,
void *buffer,
size_t size,
size_t num,
size_t *len);
1617typedef int32_t (*
BslSalFileWrite)(bsl_sal_file_handle stream,
const void *buffer,
size_t size,
size_t num);
1693typedef int32_t (*
BslSalFileSeek)(bsl_sal_file_handle stream,
long offset, int32_t origin);
1709typedef char *(*BslSalFGets)(bsl_sal_file_handle stream,
char *buf, int32_t readLen);
1723typedef bool (*
BslSalFPuts)(bsl_sal_file_handle stream,
const char *buf);
1766typedef int32_t (*
BslSalFSetAttr)(bsl_sal_file_handle stream,
int cmd,
const void *arg);
1800typedef int32_t (*
BslDlOpen)(
const char *fileName,
void **handle);
1835typedef int32_t (*
BslDlSym)(
void *handle,
const char *funcName,
void **func);
1869int32_t
BSL_SAL_Select(int32_t nfds,
void *readfds,
void *writefds,
void *exceptfds,
void *timeout);
1999 BSL_SAL_LIB_FMT_OFF = 0,
2000 BSL_SAL_LIB_FMT_SO = 1,
2001 BSL_SAL_LIB_FMT_LIBSO = 2,
2002 BSL_SAL_LIB_FMT_LIBDLL = 3,
2003 BSL_SAL_LIB_FMT_DLL = 4
2060typedef int32_t (*
BslSalGetFunc)(
void *handle,
const char *funcName,
void **func);
int32_t BSL_SAL_FileRead(bsl_sal_file_handle stream, void *buffer, size_t size, size_t num, size_t *len)
Read the file.
int32_t(* BslSalSockAccept)(int32_t sockId, BSL_SAL_SockAddr addr, size_t *len)
Initiate a accept.
定义 bsl_sal.h:1295
int32_t BSL_SAL_SetSockopt(int32_t sockId, int32_t level, int32_t name, const void *val, int32_t len)
Set the socket
int32_t BSL_SAL_ThreadRunOnce(BSL_SAL_OnceControl *onceControl, BSL_SAL_ThreadInitRoutine initFunc)
Execute only once.
定义 sal_threadlock.c:111
int32_t BSL_SAL_ThreadWriteLock(BSL_SAL_ThreadLockHandle lock)
Lock the write operation.
定义 sal_threadlock.c:63
int32_t BSL_SAL_ThreadCreate(BSL_SAL_ThreadId *thread, void *(*startFunc)(void *), void *arg)
Create a thread.
void(* BslSalSockAddrCopy)(BSL_SAL_SockAddr dst, const BSL_SAL_SockAddr src)
Copy the BSL_SAL_SockAddr address.
定义 bsl_sal.h:843
void BSL_SAL_SysTimeFuncReg(BslTimeFunc func)
Interface for registering the function for obtaining the system time You can use this API to register...
int32_t BSL_SAL_ThreadUnlock(BSL_SAL_ThreadLockHandle lock)
Unlock
定义 sal_threadlock.c:76
int64_t(* BslSalNetLSeek)(int32_t fd, int64_t offset, uint32_t origin)
Seek interface.
定义 bsl_sal.h:1120
int32_t(* BslSalSockListen)(int32_t sockId, int32_t backlog)
Listen socket.
定义 bsl_sal.h:1247
int32_t(* BslCondTimedwaitMs)(BSL_SAL_Mutex condMutex, BSL_SAL_CondVar condVar, int32_t timeout)
The waiting time ends or the signal is obtained.
定义 bsl_sal.h:187
int32_t BSL_SAL_SockGetLastSocketError(void)
Obtain the last error corresponding to the socket.
int32_t(* BslSalNetRead)(int32_t fd, void *buf, uint32_t len, int32_t *err)
Read data from file descriptor.
定义 bsl_sal.h:1104
int32_t BSL_SAL_SockBind(int32_t sockId, BSL_SAL_SockAddr addr, size_t len)
Binding a socket
void * BSL_SAL_CondVar
定义 bsl_sal.h:84
int32_t(* BslCreateCondVar)(BSL_SAL_CondVar *condVar)
Create a condition variable.
定义 bsl_sal.h:158
int32_t BSL_SAL_FileLength(const char *path, size_t *len)
Obtain the file length.
int32_t BSL_SAL_SockListen(int32_t sockId, int32_t backlog)
Listening socket
int32_t BSL_SAL_CondSignal(BSL_SAL_CondVar condVar)
The waiting time ends or the signal is obtained.
int32_t BSL_SAL_UnLoadLib(void *handle)
Unload a dynamic library for dl.
int32_t(* BslSalSockBind)(int32_t sockId, BSL_SAL_SockAddr addr, size_t len)
Binding a socket.
定义 bsl_sal.h:1263
int32_t BSL_SAL_ThreadLockNew(BSL_SAL_ThreadLockHandle *lock)
Create a thread lock.
定义 sal_threadlock.c:39
void BSL_SAL_CleanseData(void *ptr, uint32_t size)
Set sensitive information to zero.
定义 sal_mem.c:204
int32_t BSL_SAL_DeleteCondVar(BSL_SAL_CondVar condVar)
Delete a condition variable.
int32_t BSL_SAL_LibNameFormat(BSL_SAL_LibFmtCmd cmd, const char *fileName, char **name)
Convert filename to full library path for dl.
int32_t(* BslThreadRunOnce)(BSL_SAL_OnceControl *onceControl, BSL_SAL_ThreadInitRoutine initFunc)
Run the init Func command only once.
定义 bsl_sal.h:116
int32_t(* BslSalGetSockName)(int32_t sockId, BSL_SAL_SockAddr addr, size_t *len)
Get socket.
定义 bsl_sal.h:1232
uint64_t BSL_SAL_TIME_GetNSec(void)
Get the system time in nanoseconds.
int32_t(* BslSalSocket)(int32_t af, int32_t type, int32_t protocol)
Socket creation interface.
定义 bsl_sal.h:1165
int32_t BSL_SAL_GetSockopt(int32_t sockId, int32_t level, int32_t name, void *val, int32_t *len)
Get the socket
int32_t BSL_SAL_LoadLib(const char *fileName, void **handle)
Load a dynamic library for dl.
BslUnixTime(* BslTimeFunc)(void)
Prototype of the callback function for obtaining the time
定义 bsl_sal.h:606
int32_t(* BslSalNetRecvFrom)(int32_t sock, void *buf, size_t len, int32_t flags, void *address, int32_t *addrLen, int32_t *err)
Same as linux function "recvfrom"
定义 bsl_sal.h:1372
int32_t(* BslSalSockAddrNew)(BSL_SAL_SockAddr *sockAddr)
Create a BSL_SAL_SockAddr
定义 bsl_sal.h:773
int64_t BslUnixTime
Unix Time structure definition.
定义 bsl_sal.h:598
void BSL_SAL_ThreadLockFree(BSL_SAL_ThreadLockHandle lock)
Release the thread lock.
定义 sal_threadlock.c:88
void BSL_SAL_FileClose(bsl_sal_file_handle stream)
Close the file.
int32_t BSL_SAL_Select(int32_t nfds, void *readfds, void *writefds, void *exceptfds, void *timeout)
Check the socket descriptor.
int32_t(* BslGetErrno)(void)
return "errno"
定义 bsl_sal.h:1419
int32_t(* BslSalFileSeek)(bsl_sal_file_handle stream, long offset, int32_t origin)
Change the current file position associated with stream to a new location within the file.
定义 bsl_sal.h:1693
void * BSL_SAL_Malloc(uint32_t size)
Allocate memory space.
定义 sal_mem.c:28
bool(* BslSalFlush)(bsl_sal_file_handle stream)
Flush cache buffer associated with the specified output stream.
定义 bsl_sal.h:1736
void(* BslSalFileClose)(bsl_sal_file_handle stream)
Close the file.
定义 bsl_sal.h:1630
int32_t(* BslSalFSetAttr)(bsl_sal_file_handle stream, int cmd, const void *arg)
Set the attributes associated with the terminal referred to by the open stream.
定义 bsl_sal.h:1766
int32_t BSL_SAL_DateToUtcTimeConvert(const BSL_TIME *dateTime, int64_t *utcTime)
Convert the date in the BslSysTime format to the UTC time format.
int32_t(* BslSalSetSockopt)(int32_t sockId, int32_t level, int32_t name, const void *val, int32_t len)
Set the socket.
定义 bsl_sal.h:1197
int32_t(* BslSalFileLength)(const char *path, size_t *len)
Obtain the file length.
定义 bsl_sal.h:1646
int32_t(* BslDlSym)(void *handle, const char *funcName, void **func)
Get function symbol from dynamic library.
定义 bsl_sal.h:1835
int32_t BSL_SAL_FileOpen(bsl_sal_file_handle *stream, const char *path, const char *mode)
Open a file.
int32_t(* BslSalFileTell)(bsl_sal_file_handle stream, long *pos)
Get the current file position in stream.
定义 bsl_sal.h:1676
int32_t BSL_SAL_StrcaseCmp(const char *str1, const char *str2)
String comparison
int32_t(* BslSalFeof)(bsl_sal_file_handle stream)
Indicate whether the end-of-file flag is set for the given stream.
定义 bsl_sal.h:1749
int32_t(* BslSalNetWrite)(int32_t fd, const void *buf, uint32_t len, int32_t *err)
Write data to file descriptor.
定义 bsl_sal.h:1086
int32_t(* BslUtcTimeToBslTime)(int64_t utcTime, BSL_TIME *sysTime)
Convert the utc time to BSL_TIME.
定义 bsl_sal.h:1509
int32_t BSL_SAL_DateTimeCompareByUs(const BSL_TIME *dateA, const BSL_TIME *dateB)
Compare two dates, accurate to microseconds.
long BSL_SAL_Tick(void)
Obtain the number of ticks that the system has experienced since startup.
void * BSL_SAL_Calloc(uint32_t num, uint32_t size)
Allocate and clear the memory space.
定义 sal_mem.c:56
int32_t BSL_SAL_UtcTimeToDateConvert(int64_t utcTime, BSL_TIME *sysTime)
Convert the date in the BslUnixTime format to the BslSysTime format.
int32_t(* BslSalFileRead)(bsl_sal_file_handle stream, void *buffer, size_t size, size_t num, size_t *len)
Read the file.
定义 bsl_sal.h:1599
void(* BslThreadClose)(BSL_SAL_ThreadId thread)
Close the thread.
定义 bsl_sal.h:144
int32_t(* BslSalLoadLib)(const char *fileName, void **handle)
Loading dynamic libraries.
定义 bsl_sal.h:2033
int32_t BSL_SAL_GetFuncAddress(void *handle, const char *funcName, void **func)
Get the address of the initialization function for dl.
int32_t(* BslSalSockAddrGetFamily)(const BSL_SAL_SockAddr sockAddr)
Obtain the UIO_Addr protocal family
定义 bsl_sal.h:824
int32_t(* BslSalNetOpen)(const char *path, int32_t flag)
Close file descriptor.
定义 bsl_sal.h:1135
int32_t(* BslSetBlockMode)(int32_t fd, int32_t isBlock)
Set block mode.
定义 bsl_sal.h:1434
int32_t BSL_SAL_GetPid(void)
Obtain the process ID.
long(* BslTicksPerSec)(void)
Obtain the number of system ticks per second.
定义 bsl_sal.h:1545
int32_t(* BslSelect)(int32_t nfds, void *readfds, void *writefds, void *exceptfds, void *timeout)
Same as linux function "select"
定义 bsl_sal.h:1391
int32_t BSL_SAL_CreateCondVar(BSL_SAL_CondVar *condVar)
Create a condition variable.
int32_t BSL_SAL_SockConnect(int32_t sockId, BSL_SAL_SockAddr addr, size_t len)
Initiate a connection.
int32_t(* BslSalSockRecv)(int32_t sockfd, void *buff, size_t len, int32_t flags)
Receive the message
定义 bsl_sal.h:1331
int32_t(* BslIoctlSocket)(int32_t sockId, long cmd, unsigned long *arg)
Same as linux function "ioctl"
定义 bsl_sal.h:1407
int32_t(* BslSalFileOpen)(bsl_sal_file_handle *stream, const char *path, const char *mode)
Open the file.
定义 bsl_sal.h:1580
void * BSL_SAL_Realloc(void *addr, uint32_t newSize, uint32_t oldSize)
Memory expansion
定义 sal_mem.c:101
int32_t BSL_SAL_CallBack_Ctrl(BSL_SAL_CB_FUNC_TYPE funcType, void *funcCb)
Control callback functions for SAL (System Abstraction Layer).
定义 sal_ctrl.c:60
void BSL_SAL_Free(void *value)
Release the specified memory.
定义 sal_mem.c:45
int32_t(* BslSalSockClose)(int32_t sockId)
Socket close interface.
定义 bsl_sal.h:1179
int32_t BSL_SAL_SockSend(int32_t sockId, const void *msg, size_t len, int32_t flags)
Send a message.
long(* BslTick)(void)
Obtain the number of ticks that the system has experienced since startup.
定义 bsl_sal.h:1533
void * BSL_SAL_Memchr(const char *str, int32_t character, size_t count)
Search for the corresponding character position in a string.
void BSL_SAL_Sleep(uint32_t time)
Sleep the current thread
int32_t BSL_SAL_Ioctlsocket(int32_t sockId, long cmd, unsigned long *arg)
Device control interface function
bool(* BslSalFileError)(bsl_sal_file_handle stream)
Test the error indicator for the given stream.
定义 bsl_sal.h:1660
int32_t BSL_SAL_Atoi(const char *str)
Convert string to number
int32_t BSL_SAL_SysTimeGet(BSL_TIME *sysTime)
Obtain the system time.
int32_t BSL_SAL_ThreadReadLock(BSL_SAL_ThreadLockHandle lock)
Lock the read operation.
定义 sal_threadlock.c:51
int32_t(* BslSalUnLoadLib)(void *handle)
Close dynamic library.
定义 bsl_sal.h:2045
int32_t(* BslSalGetFunc)(void *handle, const char *funcName, void **func)
Get function symbol from dynamic library.
定义 bsl_sal.h:2060
int32_t(* BslThreadCreate)(BSL_SAL_ThreadId *thread, void *(*startFunc)(void *), void *arg)
Create a thread.
定义 bsl_sal.h:132
int32_t(* BslSalGetSockopt)(int32_t sockId, int32_t level, int32_t name, void *val, int32_t *len)
Get socket.
定义 bsl_sal.h:1215
int32_t(* BslDlOpen)(const char *fileName, void **handle)
Loading dynamic libraries.
定义 bsl_sal.h:1800
void BSL_SAL_ThreadClose(BSL_SAL_ThreadId thread)
Close the thread.
void(* BSL_SAL_ThreadInitRoutine)(void)
The user registers the function structure for thread-related operations.
定义 bsl_sal.h:101
uint64_t(* BslGetTimeInNS)(void)
Obtain the system time in nanoseconds.
定义 bsl_sal.h:1557
int32_t BSL_SAL_SockRecv(int32_t sockfd, void *buff, size_t len, int32_t flags)
Receive the message.
void(* BslSleep)(uint32_t time)
Sets the program to sleep for a specified time, in seconds.
定义 bsl_sal.h:1521
BslUnixTime(* BslGetUtcTime)(void)
Obtains the current UTC time
定义 bsl_sal.h:1482
int32_t BSL_SAL_SockClose(int32_t sockId)
Close the socket
void * BSL_SAL_ThreadLockHandle
定义 bsl_sal.h:63
uint32_t BSL_SAL_Strnlen(const char *string, uint32_t count)
Obtain the length of a given string.
int32_t BSL_SAL_CondTimedwaitMs(BSL_SAL_Mutex condMutex, BSL_SAL_CondVar condVar, int32_t timeout)
The waiting time ends or the signal is obtained.
int32_t(* BslSalFGetAttr)(bsl_sal_file_handle stream, void *arg)
Get the attributes associated with the terminal referred to by the open stream.
定义 bsl_sal.h:1782
int32_t(* BslSalFileWrite)(bsl_sal_file_handle stream, const void *buffer, size_t size, size_t num)
Write the file
定义 bsl_sal.h:1617
bool(* BslSalFPuts)(bsl_sal_file_handle stream, const char *buf)
Write a string to the specified stream.
定义 bsl_sal.h:1723
void * BSL_SAL_Mutex
定义 bsl_sal.h:77
int32_t(* BslSalNetSendTo)(int32_t sock, const void *buf, size_t len, int32_t flags, void *address, int32_t addrLen, int32_t *err)
Same as linux function "sendto"
定义 bsl_sal.h:1351
int32_t BSL_SAL_DateTimeCompare(const BSL_TIME *dateA, const BSL_TIME *dateB, int64_t *diffSec)
Compare Two Dates
uint64_t BSL_SAL_ThreadGetId(void)
Obtain the thread ID.
定义 sal_threadlock.c:99
int32_t(* BslCondSignal)(BSL_SAL_CondVar condVar)
The waiting time ends or the signal is obtained.
定义 bsl_sal.h:172
int32_t(* BslGetBslTime)(BSL_TIME *bslTime)
Obtains the current system time. The time type is BSL_TIME.
定义 bsl_sal.h:1495
int32_t BSL_SAL_FileWrite(bsl_sal_file_handle stream, const void *buffer, size_t size, size_t num)
Write a file
int32_t(* BslSalSockSend)(int32_t sockId, const void *msg, size_t len, int32_t flags)
Send a message.
定义 bsl_sal.h:1313
uint32_t(* BslSalSockAddrSize)(const BSL_SAL_SockAddr sockAddr)
Obtain the size of the BSL_SAL_SockAddr address.
定义 bsl_sal.h:834
void BSL_SAL_ClearFree(void *ptr, uint32_t size)
Clear sensitive information and release memory.
定义 sal_mem.c:216
int32_t(* BslSocketWait)(int32_t fd, int32_t forRead, int64_t maxTime)
Wait for the socket to read and write data within the period specified by maxTime.
定义 bsl_sal.h:1450
int32_t(* BslDlClose)(void *handle)
Close dynamic library.
定义 bsl_sal.h:1816
void(* BslSalSockAddrFree)(BSL_SAL_SockAddr sockAddr)
Release the UIO_Addr object.
定义 bsl_sal.h:781
int32_t BSL_SAL_Socket(int32_t af, int32_t type, int32_t protocol)
Socket creation interface
long BSL_SAL_TicksPerSec(void)
Obtain the number of system ticks per second.
void * BSL_SAL_Dump(const void *src, uint32_t size)
Duplicate the memory space.
定义 sal_mem.c:87
int32_t(* BslSocketError)(int32_t fd)
Get the error code of the socket.
定义 bsl_sal.h:1464
int32_t(* BslDeleteCondVar)(BSL_SAL_CondVar condVar)
Delete a condition variable.
定义 bsl_sal.h:201
void * BSL_SAL_ThreadId
定义 bsl_sal.h:70
int32_t(* BslSalNetClose)(int32_t fd)
Close file descriptor.
定义 bsl_sal.h:1149
int32_t(* BslSalSockConnect)(int32_t sockId, BSL_SAL_SockAddr addr, size_t len)
Initiate a connection.
定义 bsl_sal.h:1279
BslUnixTime BSL_SAL_CurrentSysTimeGet(void)
Obtain the Unix time.
Thread run-once control type
定义 bsl_sal.h:47
Basic time data structure definition.
定义 bsl_sal.h:583
uint8_t month
定义 bsl_sal.h:585
uint16_t microSec
定义 bsl_sal.h:591
uint8_t second
定义 bsl_sal.h:590
uint8_t hour
定义 bsl_sal.h:587
uint8_t day
定义 bsl_sal.h:586
uint16_t millSec
定义 bsl_sal.h:589
uint8_t minute
定义 bsl_sal.h:588
uint16_t year
定义 bsl_sal.h:584