-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Musl libc compatibility #4385
Musl libc compatibility #4385
Changes from all commits
aef21e6
5551372
911852a
a806680
57e61c9
3bca72d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,11 @@ | |
#define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) | ||
#endif | ||
|
||
typedef long long hrtime_t; | ||
typedef struct timespec timestruc_t; | ||
typedef struct timespec timespec_t; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @behlendorf ive moved the typedefs as you suggested in previous commit, and i have changed longlong_t to long long as longlong_t is not defined by any standard so musl does not support it. |
||
|
||
extern hrtime_t gethrtime(void); | ||
extern void gethrestime(timestruc_t *); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ | |
#include <langinfo.h> | ||
#include "statcommon.h" | ||
|
||
#ifndef _DATE_FMT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nicer to move this into our own langinfo.h header that uses |
||
#define _DATE_FMT "%+" | ||
#endif | ||
|
||
/* | ||
* Print timestamp as decimal reprentation of time_t value (-T u was specified) | ||
* or in date(1) format (-T d was specified). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. But can you add a link to the commit comment explaining why GLIBC should be used instead of GNUC. My guess is that GNUC was used here since that's what recommenced fron by gcc documentation.
https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
execinfo.h
andbacktrace()
are GNU extensions provided by glibc and not by gcc so the change is correct.The mentioned gcc documentation does not mention backtrace() or execinfo.h as far I can see.
An alternative way to solve it would be to do a configure check for it and use
HAVE_EXECINFO_H
andHAVE_BACKTRACE
.