1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Add get_error function for internal use

Sometimes, the _libcpuid_errno value needs to be returned
This commit is contained in:
Xorg 2022-09-25 10:22:22 +02:00
parent 10b4e46179
commit 73c33ced4a
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A
2 changed files with 10 additions and 0 deletions

View file

@ -53,6 +53,11 @@ int set_error(cpu_error_t err)
return (int) err;
}
int get_error()
{
return _libcpuid_errno;
}
static void raw_data_t_constructor(struct cpu_raw_data_t* raw)
{
memset(raw, 0, sizeof(struct cpu_raw_data_t));

View file

@ -94,6 +94,11 @@ void debug_print_lbits(int debuglevel, uint64_t mask);
*/
int set_error(cpu_error_t err);
/*
* Gets the current errno
*/
int get_error(void);
extern libcpuid_warn_fn_t _warn_fun;
extern int _current_verboselevel;