lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] LWIP blocking API return value check


From: 杨文成(蹊远)
Subject: [lwip-devel] LWIP blocking API return value check
Date: Tue, 16 Apr 2019 16:00:54 +0800


hi, gus

I'm Alibaba engineer from AliOS Things RTOS team, we have integrated LWIP as the default net protocol. Recently we are developing micro kernel, to support LWIP API as user space system call. 

Normally, system calls like recv(), send(), accept() should be cancellation points, that's to say, user space task can be cancelled when it reaches the cancellation points. To this end, if the task is blocked within these APIs, it can be waken up by signals, the return code of the blocking function should be checked to decide what to do next. 

for example: 
api/api_lib.c: netconn_recv_data(), if the task is blocked at sys_arch_mbox_fetch(), waiting for new package, then a signal is sent to the blocked task, the task will resume and return from sys_arch_mbox_fetch() with return code indicating it's waken up by signals other than timeout or normal return.

However, I checked the LWIP APIs, there are a couple of places where the return code of blocking functions are ignored. it makes it difficult to handle the case that the task is waken up by signal.

 we suggest LWIP adding another error code, for example SYS_ARCH_WAKEUP, to indicate the blocking function is waken up, and handle this error case properly.

best regards,
wencheng


reply via email to

[Prev in Thread] Current Thread [Next in Thread]