[Top][All Lists]

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

Re: [lwip-users] Can sys_arch.c functions return ERR_* codes?

From: Grant Edwards
Subject: Re: [lwip-users] Can sys_arch.c functions return ERR_* codes?
Date: Fri, 12 Nov 2021 21:39:39 -0000 (UTC)
User-agent: slrn/1.0.3 (Linux)

On 2021-11-12, goldsimon@gmx.de <goldsimon@gmx.de> wrote:
> Am 12.11.2021 um 16:24 schrieb Grant Edwards:
>> Are the various sys_arch.c functions allowed to return error codes
>> other than those specifically listed in the documentation?
> ...
>> Were I to _guess_, I would assume that functions returning err_t can
>> return any error codes they want, but functions returning millisecond
>> counts can't?
> You're right with your guess. Although I would have thought the
> documentation is clear here, so there would be no need to guess...

Maybe I'm reading the wrong documentation. All I can find is:


Where there are descriptions like this:

err_t sys_mbox_trypost  ( sys_mbox_t *mbox, void *msg)

  Try to post a message to an mbox - may fail if full. Can be used
  from ISR (if the sys arch layer allows this). Returns ERR_MEM if it
  is full, else, ERR_OK if the "msg" is posted.

To me, that indicates there ore only two possible outcomes: ERR_MEM if
full, and ERR_OK if the message is posted.

On that same page, it says this regarding sys_mbox_set_invalid():

   sys_mbox_free() is always called before calling this function! 

That isn't true in api/api_msg.c::netconn_alloc()

Is that a bug in the code or mistake in the documentation?


reply via email to

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