You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Takashi Yamamoto <ya...@midokura.com.INVALID> on 2020/06/05 05:21:02 UTC

dirname_r?

hi,

i'm using FLAT memory model.
i want to use dirname() in my app.
but there seems to be no safe way to use static-buffer returning
functions like this
unless you have very tight control on what you run on your system.
am i correct?
i think it makes sense for nuttx to provide non-standard reentrant versions
of these functions. (say, dirname_r(). macOS has it.)
how do you think?

RE: dirname_r?

Posted by Xiang Xiao <xi...@gmail.com>.
Many other similar extension(e.g. strtok_r) become standard(POSIX), it's reasonable practice for other functions.

> -----Original Message-----
> From: Takashi Yamamoto <ya...@midokura.com.INVALID>
> Sent: Friday, June 5, 2020 1:21 PM
> To: dev@nuttx.apache.org
> Subject: dirname_r?
> 
> hi,
> 
> i'm using FLAT memory model.
> i want to use dirname() in my app.
> but there seems to be no safe way to use static-buffer returning functions like this unless you have very tight control on what you run
> on your system.
> am i correct?
> i think it makes sense for nuttx to provide non-standard reentrant versions of these functions. (say, dirname_r(). macOS has it.) how
> do you think?