Skip to content

SysStrError

SysStrError

Description

Get last error using an error number.

Parameters

Name Direction Description
eno in Unique error number descriptor.
err_str out Error string will be stored in this.

Success

Error string describing last error.

Failure

Returns NULL if err_str is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    Str *SysStrError(i32 eno, Str *err_str) {
        char buf[1024] = {0};
    #if _WIN32
                Str syserr;
                StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
                    SysStrError(errno, &syserr);
                    LOG_ERROR("Failed to get localtime : {}", syserr);
                });
            Str syserr_;                                                                                                   \
            StrInitStack(syserr_, 256, {                                                                                   \
                SysStrError(errno, &syserr_);                                                                              \
                StrWriteFmt(&m_, " : {}", syserr_);                                                                        \
            });                                                                                                            \
            Str syserr_;                                                                                                   \
            StrInitStack(syserr_, 256, {                                                                                   \
                SysStrError(errno, &syserr_);                                                                              \
                StrWriteFmt(&m_, " : {}", syserr_);                                                                        \
            });                                                                                                            \
            Str syserr_;                                                                                                   \
            StrInitStack(syserr_, 256, {                                                                                   \
                SysStrError(errno, &syserr_);                                                                              \
                StrWriteFmt(&m_, " : {}", syserr_);                                                                        \
            });                                                                                                            \
Last updated on