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

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



Hey Florian,

On 17.04.19, 16:04, "Florian Schmidt" <Florian.Schmidt@xxxxxxxxx> wrote:

    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.

Fair enough and good point. I agree, we should not be wasteful. I am going to 
reduce it in a v2.
    
    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.

Okay, that is fine, too.
    
    > +
    > + return strerror_r(errnum, buf, sizeof(buf));
    > +}
    > 

Thanks,

Simon

    -- 
    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®.