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

Re: [Minios-devel] [UNIKRAFT PATCH] lib/nolibc: Provide strerror(), strerror_r()



Hi Simon,

short remark:

On 4/17/19 11:49 AM, Simon Kuenzer wrote:
+char *strerror(int errnum)
+{
+       /* TODO: Place buffer on thread-local storage */
+       static char buf[1024];

Does this need to be that large? The largest message defined in this patch is 48 bytes. I'm asking because, if we make this thread-local, this would be quite a bit of memory area (and memcopying/memsetting) on every thread spawn.

That being said, strerror isn't required to be thread-safe (only strerror_l is), so we could just not make this thread-safe in the first place.

+
+       return strerror_r(errnum, buf, sizeof(buf));
+}


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.