net: Add NET_WAIT_FOREVER symbol to be used as timeout in network APIs

If a network API expects a millisecond timeout, then NET_WAIT_FOREVER
symbol can be used to indicate that the timeout should last forever.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-04-07 15:19:52 +03:00
parent aafd563195
commit e4224651bf
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,8 @@
#include <sys/__assert.h>
#include <kernel.h>
#include <net/net_timeout.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -28,6 +28,12 @@
extern "C" {
#endif
/**
* Symbol to indicate that the caller wants the timeout to be waited forever.
* This can be used when a network API expects a millisecond timeout.
*/
#define NET_WAIT_FOREVER (-1)
/** Let the max timeout be 100 ms lower because of
* possible rounding in delayed work implementation.
*/