Superkkt Blog

strerror_r()로 코드를 모두 변경하려다가 인터넷 뒤져보니 아래와 같은 글이 있었다. 따라서 그다지 문제가 없을것으로 생각되어 그냥 strerror()를 사용하기로 했다.

On Monday 11 December 2006 05:15, Tony Mountifield wrote:
> I was looking up the man page for strerror(), and found that there is
> an alternative, strerror_r(), which is described as thread-safe,
> using a buffer passed in from the caller instead of a static buffer.
>
> Despite asterisk being heavily multi-threaded, it uses strerror() in
> many places. Although it's unlikely, I guess there could be a problem
> if two threads need to report an error simultaneously.
>
> Comments?

Highly unlikely, given that strerror returns a pointer to a table of
strings on most errors; the only time when it uses the internal static
buffer is when the error is undefined; in which case, the text message
would be entirely useless anyway.  This is why we print the numeric of
the error in most cases afterwards.

--
Tilghman

2007/04/20 10:12 2007/04/20 10:12

trackbacks

trackbacks rss

이 글에는 트랙백을 보낼 수 없습니다

Leave a Comment