* This function will get sal socket object by sal socket descriptor. * * @param socket sal socket index * * @return sal socket object of the current sal socket index */
| 365 | * @return sal socket object of the current sal socket index |
| 366 | */ |
| 367 | struct sal_socket *sal_get_socket(int socket) |
| 368 | { |
| 369 | struct sal_socket_table *st = &socket_table; |
| 370 | |
| 371 | socket = socket - SAL_SOCKET_OFFSET; |
| 372 | |
| 373 | if (socket < 0 || socket >= (int)st->max_socket) |
| 374 | { |
| 375 | return RT_NULL; |
| 376 | } |
| 377 | |
| 378 | /* check socket structure valid or not */ |
| 379 | RT_ASSERT(st->sockets[socket]->magic == SAL_SOCKET_MAGIC); |
| 380 | |
| 381 | return st->sockets[socket]; |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * This function will lock sal socket. |
no outgoing calls
no test coverage detected